/* Small overrides on top of Bootstrap 5.3 */

.brand-icon {
  width: 32px;
  height: 32px;
  display: block;
}

.code-display {
  letter-spacing: .25em;
  text-align: center;
}

/* Role selector cards built on btn-check */
.role-card {
  border-width: 2px;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.role-card .role-desc {
  color: var(--bs-secondary-color);
}
.btn-check:checked + .role-card .role-desc,
.btn-check:checked + .role-card .bi {
  color: inherit;
  opacity: .9;
}
.btn-check:focus-visible + .role-card {
  box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .35);
}

/* Video area */
.video-frame video {
  object-fit: contain;
  background: #000;
}

/* Numbered "how it works" steps */
.step-number {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
}

/* Status alert transitions */
#status {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.eyebrow {
  letter-spacing: .06em;
}

/* "Your connection details" card: gradient so it is obviously the user's own side */
.card-you {
  --you-start: #1f6feb;
  --you-end: #6f42c1;
  background: linear-gradient(135deg, var(--you-start) 0%, var(--you-end) 100%);
  color: #fff;
}
[data-bs-theme="dark"] .card-you {
  --you-start: #1b4fa8;
  --you-end: #4c2a8c;
}
.card-you .card-header {
  border-bottom-color: rgba(255, 255, 255, .25);
  color: #fff;
}
.card-you .form-label,
.card-you .form-text,
.card-you .card-you-intro {
  color: rgba(255, 255, 255, .85);
}
.card-you .form-control {
  background: rgba(255, 255, 255, .95);
  color: #142033;
  border-color: rgba(255, 255, 255, .6);
}
.card-you .form-control:focus {
  box-shadow: 0 0 0 .25rem rgba(255, 255, 255, .35);
}
.card-you .you-badge {
  background: rgba(255, 255, 255, .2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .45);
}
.card-you .copy-btn {
  border-color: rgba(255, 255, 255, .6);
}

/* Pointer overlay drawn over the video picture */
.pointer-overlay {
  position: absolute;
  pointer-events: none;
  z-index: 2;
}
.video-frame.interactive .pointer-overlay {
  pointer-events: auto;
  cursor: none;
  touch-action: none;
}
.ratio > .pointer-overlay {
  width: auto;
  height: auto;
}

/* Document Picture-in-Picture pop-out preview */
.pip-body {
  margin: 0;
  background: #000;
  overflow: hidden;
}
.pip-body .video-frame {
  position: absolute;
  inset: 0;
  border-radius: 0 !important;
}
.pip-body .video-frame::before {
  display: none;
}

/* Address picker inside the identity card */
.card-you .form-select {
  background-color: rgba(255, 255, 255, .95);
  color: #142033;
  border-color: rgba(255, 255, 255, .6);
}

/* "Other person's address" machine picker */
.peer-pick-menu {
  min-width: min(24rem, calc(100vw - 2rem));
  max-height: 22rem;
  overflow-y: auto;
}
.peer-pick-menu .dropdown-item {
  white-space: normal;
}
.peer-pick-menu .peer-pick-name {
  overflow-wrap: anywhere;
}
.peer-pick-menu .dropdown-item .mono {
  font-family: var(--bs-font-monospace);
}

.footer-mark {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
}
.form-switch .form-check-input {
  cursor: pointer;
}

.voice-tools .form-check-input {
  width: 2.6em;
  height: 1.3em;
  margin-top: .1em;
}
.voice-tools .form-check-label {
  padding-left: .35rem;
}

/* Pop-out preview toolbar: shows on hover, top-right corner */
.pip-toolbar {
  position: absolute;
  top: .5rem;
  right: .5rem;
  display: flex;
  gap: .25rem;
  z-index: 10;
  opacity: 0;
  transition: opacity .2s ease;
}
.pip-body:hover .pip-toolbar,
.pip-toolbar:focus-within {
  opacity: 1;
}
.pip-btn {
  --bs-btn-bg: rgba(0, 0, 0, .65);
  --bs-btn-border-color: rgba(255, 255, 255, .35);
  --bs-btn-hover-bg: rgba(0, 0, 0, .85);
  --bs-btn-hover-border-color: rgba(255, 255, 255, .6);
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Bootstrap's display utilities (d-flex etc.) are !important and defined after its
   own [hidden] rule, so an element with both stays visible. Restate the rule here,
   after bootstrap.min.css, so the hidden attribute always wins. */
[hidden] {
  display: none !important;
}

/* Static pages: pricing and legal */
.page-lead { max-width: 46rem; }
.pricing-card-featured { border: 2px solid var(--bs-primary); }
/* Hanging indent: the tick sits in its own column, so wrapped lines align with the text, not the tick. */
.pricing-features li { position: relative; padding: .25rem 0 .25rem 1.6rem; }
.pricing-features li > .bi { position: absolute; left: 0; top: .3rem; color: var(--bs-success); }
.legal-page { max-width: 52rem; }
.legal-page h2 { color: var(--bs-primary); }

/* Honeypot for the launch-interest form: off-screen, never filled in by people. */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.launch-modal { border-top: 5px solid var(--bs-primary); }

/* Free tier meter in the navbar: how much of this month's shared free allowance is left. */
.free-meter {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 1rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-size: 0.8rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.free-meter:hover { border-color: var(--bs-primary); color: var(--bs-body-color); }
.free-meter-label { font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.7rem; color: var(--bs-secondary-color); }
.free-meter-label .bi { color: #198754; }
.free-meter-track { display: block; width: 140px; height: 8px; border-radius: 999px; background: var(--bs-secondary-bg); overflow: hidden; }
.free-meter-fill { display: block; width: 100%; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #198754, #20c997); transition: width 0.6s ease; }
.free-meter-text { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 6.2rem; }
.free-meter-mid .free-meter-fill { background: linear-gradient(90deg, #fd7e14, #ffc107); }
.free-meter-mid .free-meter-label .bi { color: #fd7e14; }
.free-meter-low .free-meter-fill { background: linear-gradient(90deg, #dc3545, #fd7e14); }
.free-meter-low .free-meter-label .bi, .free-meter-empty .free-meter-text { color: #dc3545; }
/* Narrow screens: the meter becomes a full-width strip under the navbar row. */
@media (max-width: 991.98px) {
  .free-meter { order: 10; width: 100%; margin: 0.5rem 0 0; }
  .free-meter-track { flex: 1 1 auto; width: auto; }
  .free-meter-text { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .free-meter-fill { transition: none; } }

/* Chat panel in the live session */
.chat-panel { background: var(--bs-body-bg); }
.chat-log { height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; }
.chat-line { display: flex; }
.chat-line.chat-me { justify-content: flex-end; }
.chat-bubble { display: inline-block; max-width: 80%; padding: .35rem .7rem; border-radius: .9rem; font-size: .9rem; line-height: 1.35; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-me .chat-bubble { background: var(--bs-primary); color: #fff; border-bottom-right-radius: .2rem; }
.chat-them .chat-bubble { background: var(--bs-secondary-bg); color: var(--bs-body-color); border-bottom-left-radius: .2rem; }

/* When the helper is controlling, the picture takes the input */
.video-frame.controlling { outline: 3px solid var(--bs-danger); cursor: none; }
.video-frame.controlling video { pointer-events: none; }

.control-modal { border-top: 5px solid var(--bs-warning); }

/* Front-page Helper download call-to-action */
.helper-cta { background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); }

/* Pricing: compare table + FAQ accordion polish */
.compare-table thead th { border-top: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color); }
.compare-table td, .compare-table th { vertical-align: middle; }
.faq-accordion .accordion-button { font-weight: 600; }
.faq-accordion .accordion-button:not(.collapsed) { background: var(--bs-primary-bg-subtle); color: var(--bs-emphasis-color); }
.faq-accordion .accordion-button:focus { box-shadow: none; }

/* Pricing compare: coloured header band */
.compare-header { background: linear-gradient(135deg, #1f6feb, #6f42c1); border-bottom: 0; }
.compare-header .opacity-75 { color: rgba(255,255,255,.85); }
.compare-table thead th { background: var(--bs-tertiary-bg); }

/* Footer links: readable in both themes (were too dim on the tertiary footer) */
footer .link-secondary { color: var(--bs-body-color) !important; opacity: .85; text-decoration: none; }
footer .link-secondary:hover, footer .link-secondary:focus { color: var(--bs-primary) !important; opacity: 1; text-decoration: underline; }

/* "How it works" step cards: visible in light mode (were near-white on white) */
.how-steps .card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
:root:not([data-theme="light"]) .how-steps .card,
[data-bs-theme="dark"] .how-steps .card { background: var(--bs-tertiary-bg); box-shadow: none; }

/* Compare table: keep highlighted ComeOnPC rows readable in dark mode too
   (theme-aware subtle background + emphasis text instead of fixed light blue) */
.compare-table .table-primary {
  --bs-table-bg: var(--bs-primary-bg-subtle);
  --bs-table-color: var(--bs-emphasis-color);
  --bs-table-hover-bg: var(--bs-primary-bg-subtle);
  --bs-table-hover-color: var(--bs-emphasis-color);
}
.compare-table .table-primary strong { color: var(--bs-emphasis-color); }
