/* ═══════════════════════════════════════════════════════════════
   Sotaiga — design tokens (verbatim from tokens.css) + components
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* surfaces */
  --ct-bg:        #0d1117;
  --ct-surface-1: #161b22;
  --ct-surface-2: #1c2128;
  --ct-border:    #30363d;
  --ct-border-2:  #3d4754;

  /* text */
  --ct-text:      #e6edf3;
  --ct-text-2:    #8b949e;
  --ct-text-3:    #5b6573;

  /* semantic */
  --ct-frost:     #79c0ff;
  --ct-aurora:    #3fb950;
  --ct-ember:     #d29922;
  --ct-cinder:    #ff7b72;
  --ct-glow:      rgba(121, 192, 255, 0.18);
  --ct-glow-soft: rgba(121, 192, 255, 0.10);

  /* ornament-only accents */
  --ct-red:       #c9484a;
  --ct-gold:      #d4b478;

  /* type */
  --ct-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ct-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* base reset for screen interiors */
.ct {
  background: var(--ct-bg);
  color: var(--ct-text);
  font-family: var(--ct-sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
  font-size: 16px;
  line-height: 1.45;
}
.ct *, .ct *::before, .ct *::after { box-sizing: border-box; }
.ct button { font-family: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.ct input {
  font-family: inherit; color: inherit; background: transparent; border: 0; padding: 0;
  outline: none; width: 100%;
}
.ct input::placeholder { color: var(--ct-text-3); }

/* visually hidden — accessible but invisible (e.g. fieldset legends) */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* type scale */
.ct-h1     { font-size: 28px; line-height: 1.2;  font-weight: 600; letter-spacing: -0.01em; }
.ct-h2     { font-size: 20px; line-height: 1.3;  font-weight: 600; letter-spacing: -0.005em; }
.ct-body   { font-size: 16px; line-height: 1.45; font-weight: 400; }
.ct-label  { font-size: 14px; line-height: 1.35; font-weight: 500; }
.ct-caption{ font-size: 13px; line-height: 1.4;  font-weight: 400; color: var(--ct-text-2); }
.ct-sas    { font-family: var(--ct-mono); font-size: 32px; line-height: 1; font-weight: 500; letter-spacing: 6px; }

/* subtle pulse for active dots */
@keyframes ct-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.35); opacity: 0.55; }
}
.ct-pulse-dot::after {
  content: ''; position: absolute; inset: -3px; border-radius: 999px;
  border: 1px solid currentColor; opacity: 0.6;
  animation: ct-pulse 3s ease-in-out infinite;
}

/* audio meter shimmer */
@keyframes ct-meter {
  0%   { transform: scaleX(0.20); }
  20%  { transform: scaleX(0.55); }
  35%  { transform: scaleX(0.30); }
  55%  { transform: scaleX(0.78); }
  70%  { transform: scaleX(0.40); }
  85%  { transform: scaleX(0.62); }
  100% { transform: scaleX(0.25); }
}
.ct-meter-fill { transform-origin: left center; animation: ct-meter 2.4s ease-in-out infinite; }

/* state-pill color transitions */
.ct-pill { transition: background 200ms ease, color 200ms ease, border-color 200ms ease; }

/* SAS code halo */
.ct-sas-halo {
  background:
    radial-gradient(120% 80% at 50% 50%, rgba(121,192,255,0.10), transparent 70%),
    var(--ct-surface-1);
}

/* caret blink */
@keyframes ct-caret { 50% { opacity: 0; } }

/* ═══════════════════════════════════════════════════════════════
   Global page shell
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--ct-bg);
  font-family: var(--ct-sans);
  color: var(--ct-text);
  -webkit-font-smoothing: antialiased;
}

/* centered column — 540px cap, fills viewport on mobile */
.ct-page {
  max-width: 540px;
  margin: 0 auto;
  padding: 0 20px 40px;
  position: relative;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   Ambient backdrop  (absolute, spans the column, z-index 0)
   ═══════════════════════════════════════════════════════════════ */
.ct-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ct-ambient-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(121,192,255,0.05), transparent 55%),
    radial-gradient(80% 50% at 50% 110%, rgba(0,0,0,0.45), transparent 70%);
}
.ct-ambient-ornament {
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  filter: blur(34px) saturate(80%);
  opacity: 0.7;
  pointer-events: none;
}
.ct-ambient-ornament.intense {
  top: -260px;
  filter: blur(64px) saturate(80%);
  opacity: 0.55;
}
/* hairline frost lines (non-intense only) */
.ct-ambient-line {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  opacity: 0.5;
}
.ct-ambient-line::after {
  content: '';
  display: block;
  width: 100%; height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--ct-border) 0px, var(--ct-border) 1px,
    transparent 1px, transparent 6px
  );
  opacity: 0.35;
}

/* ═══════════════════════════════════════════════════════════════
   Page content wrapper (sits above ambient, z-index 1)
   ═══════════════════════════════════════════════════════════════ */
.ct-content {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════
   Frieze — thin top accent on each page
   ═══════════════════════════════════════════════════════════════ */
.ct-frieze-bar {
  position: relative;
  z-index: 2;
  opacity: 0.45;
  pointer-events: none;
  line-height: 0;
  padding: 8px 0 0;
}

/* ═══════════════════════════════════════════════════════════════
   Page header (wordmark + pill / version)
   ═══════════════════════════════════════════════════════════════ */
.ct-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 0;
}

/* ═══════════════════════════════════════════════════════════════
   Wordmark
   ═══════════════════════════════════════════════════════════════ */
.ct-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.ct-wordmark__text {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ct-text);
  font-feature-settings: 'ss01';
}

/* ═══════════════════════════════════════════════════════════════
   State pill
   ═══════════════════════════════════════════════════════════════ */
#state,
.ct-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
  /* default / preparing */
  background: rgba(139,148,158,0.12);
  border: 1px solid rgba(139,148,158,0.32);
  color: var(--ct-text-2);
}
#state::before,
.ct-state-pill::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 999px;
  background: currentColor;
  flex-shrink: 0;
}

/* pill variants via data-state attribute */
#state[data-state="preparing"],
.ct-state-pill[data-state="preparing"] {
  background: rgba(139,148,158,0.12);
  border-color: rgba(139,148,158,0.32);
  color: var(--ct-text-2);
}
#state[data-state="waiting"],
.ct-state-pill[data-state="waiting"] {
  background: var(--ct-glow-soft);
  border-color: rgba(121,192,255,0.4);
  color: var(--ct-frost);
}
#state[data-state="verifying"],
.ct-state-pill[data-state="verifying"] {
  background: rgba(212,180,120,0.12);
  border-color: rgba(212,180,120,0.4);
  color: var(--ct-gold);
}
#state[data-state="talking"],
.ct-state-pill[data-state="talking"] {
  background: rgba(63,185,80,0.12);
  border-color: rgba(63,185,80,0.38);
  color: var(--ct-aurora);
}
#state[data-state="talking"]::before,
.ct-state-pill[data-state="talking"]::before {
  box-shadow: 0 0 0 3px rgba(63,185,80,0.18);
}
#state[data-state="reconnecting"],
.ct-state-pill[data-state="reconnecting"] {
  background: rgba(210,153,34,0.12);
  border-color: rgba(210,153,34,0.4);
  color: var(--ct-ember);
}
#state[data-state="done"],
.ct-state-pill[data-state="done"] {
  background: rgba(139,148,158,0.10);
  border-color: rgba(139,148,158,0.28);
  color: var(--ct-text-2);
}
#state[data-state="password"],
.ct-state-pill[data-state="password"] {
  background: rgba(230,237,243,0.06);
  border-color: var(--ct-border);
  color: var(--ct-text);
}
#state[data-state="failed"],
.ct-state-pill[data-state="failed"] {
  background: rgba(255,123,114,0.12);
  border-color: rgba(255,123,114,0.4);
  color: var(--ct-cinder);
}

/* ═══════════════════════════════════════════════════════════════
   Button
   ═══════════════════════════════════════════════════════════════ */
.ct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  width: 100%;
  padding: 0 20px;
  border-radius: 4px;
  font-family: var(--ct-sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer;
  border: none;
  transition: box-shadow 150ms, background 150ms, opacity 150ms;
  text-decoration: none;
}
.ct-btn--primary {
  background: var(--ct-frost);
  color: #06121f;
  border: 1px solid transparent;
}
.ct-btn--primary:hover  { box-shadow: 0 0 0 4px var(--ct-glow); }
.ct-btn--primary:focus-visible { box-shadow: 0 0 0 3px var(--ct-glow); outline: none; }
.ct-btn--danger {
  background: var(--ct-cinder);
  color: #2a0708;
  border: 1px solid transparent;
}
.ct-btn--danger:hover   { box-shadow: 0 0 0 4px rgba(255,123,114,0.18); }
.ct-btn--ghost {
  background: transparent;
  color: var(--ct-text);
  border: 1px solid var(--ct-border);
}
.ct-btn--ghost:hover    { background: var(--ct-surface-2); }
.ct-btn--secondary {
  background: var(--ct-surface-1);
  color: var(--ct-text);
  border: 1px solid var(--ct-border);
}
.ct-btn--secondary:hover { background: var(--ct-surface-2); }
.ct-btn--md  { height: 44px; font-size: 15px; padding: 0 16px; }
.ct-btn--sm  { height: 36px; font-size: 14px; padding: 0 12px; }
.ct-btn:disabled,
.ct-btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.ct-btn--auto { width: auto; }

/* ═══════════════════════════════════════════════════════════════
   Input
   ═══════════════════════════════════════════════════════════════ */
.ct-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ct-field__label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ct-text-2);
}
.ct-field__wrap {
  height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ct-surface-1);
  border: 1px solid var(--ct-border);
  border-radius: 4px;
  transition: border-color 150ms, box-shadow 150ms;
}
.ct-field__wrap:focus-within {
  border-color: var(--ct-frost);
  box-shadow: 0 0 0 3px var(--ct-glow);
}
.ct-field__wrap--error {
  border-color: var(--ct-cinder);
}
.ct-field__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--ct-sans);
  font-size: 15px;
  color: var(--ct-text);
  width: 100%;
}
.ct-field__input::placeholder { color: var(--ct-text-3); }
.ct-field__input--mono {
  font-family: var(--ct-mono);
  letter-spacing: 0.06em;
}
.ct-field__error {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ct-cinder);
}
.ct-field__helper {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ct-text-2);
}
/* eye toggle inside input */
.ct-field__eye {
  flex: 0 0 auto;
  padding: 0 4px;
  color: var(--ct-text-2);
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* ═══════════════════════════════════════════════════════════════
   Checkbox / Radio
   ═══════════════════════════════════════════════════════════════ */
.ct-checkbox,
.ct-radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  position: relative;
}
/* hide native control visually but keep accessible */
.ct-checkbox input[type="checkbox"],
.ct-radio    input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.ct-checkbox__mark {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  border-radius: 3px;
  background: var(--ct-surface-1);
  border: 1px solid var(--ct-border-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: background 150ms, border-color 150ms;
}
.ct-checkbox input:checked ~ .ct-checkbox__mark {
  background: var(--ct-frost);
  border-color: var(--ct-frost);
}
.ct-radio__mark {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--ct-surface-1);
  border: 1px solid var(--ct-border-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: border-color 150ms;
}
.ct-radio input:checked ~ .ct-radio__mark {
  border-color: var(--ct-frost);
}
.ct-radio__dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--ct-frost);
  display: none;
}
.ct-radio input:checked ~ .ct-radio__mark .ct-radio__dot { display: block; }
.ct-check-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ct-check-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ct-text);
}
.ct-check-sub {
  font-size: 13px;
  color: var(--ct-text-2);
}

/* ═══════════════════════════════════════════════════════════════
   Password-options frost card
   ═══════════════════════════════════════════════════════════════ */
.ct-pw-options {
  margin-left: 28px;
  padding: 14px 16px;
  background: var(--ct-surface-1);
  border-radius: 4px;
  border: 1px solid var(--ct-border);
  border-left: 2px solid var(--ct-frost);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   Created card (Landing)
   ═══════════════════════════════════════════════════════════════ */
.ct-card {
  background: var(--ct-surface-1);
  border: 1px solid var(--ct-border);
  border-radius: 6px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  z-index: 1;
}
.ct-card__caption {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ct-text-2);
  margin-bottom: 4px;
}
.ct-card__caption--success { color: var(--ct-aurora); }
.ct-card__divider {
  height: 1px;
  background: var(--ct-border);
}

/* ═══════════════════════════════════════════════════════════════
   Link box  (CTLinkBox)
   ═══════════════════════════════════════════════════════════════ */
.ct-link-box {
  display: flex;
  align-items: stretch;
  background: var(--ct-surface-1);
  border: 1px solid var(--ct-border);
  border-radius: 4px;
  overflow: hidden;
}
.ct-link-box__url {
  flex: 1;
  padding: 0 12px;
  display: flex;
  align-items: center;
  font-family: var(--ct-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ct-text);
  min-width: 0;
  overflow: hidden;
}
.ct-link-box__url-prefix { color: var(--ct-text-2); }
.ct-link-box__url-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* the copy input (hidden visually, accessible for reading value) */
.ct-link-box__input {
  /* we keep a hidden input for value access by app.js & E2E */
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.ct-link-box__copy {
  flex: 0 0 auto;
  padding: 0 14px;
  height: 44px;
  border-left: 1px solid var(--ct-border);
  color: var(--ct-frost);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  cursor: pointer;
  transition: color 150ms;
  white-space: nowrap;
}
.ct-link-box__copy.copied { color: var(--ct-aurora); }
.ct-link-box__copy:hover  { background: var(--ct-surface-2); }

/* ═══════════════════════════════════════════════════════════════
   Code reveal  (CTCodeReveal — password block)
   ═══════════════════════════════════════════════════════════════ */
.ct-code-reveal {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ct-code-reveal__value {
  padding: 14px 16px;
  border: 1px dashed var(--ct-border-2);
  background: rgba(121,192,255,0.04);
  border-radius: 4px;
  font-family: var(--ct-mono);
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--ct-frost);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   Watermark container
   ═══════════════════════════════════════════════════════════════ */
.ct-watermark-wrap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}

/* "next steps" list on landing created */
.ct-next-steps {
  margin: 0; padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ct-next-steps li {
  display: flex;
  gap: 10px;
}
.ct-next-steps__num {
  font-family: var(--ct-mono);
  font-size: 12px;
  color: var(--ct-frost);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Peer row  (CTPeerRow)
   ═══════════════════════════════════════════════════════════════ */
.ct-peer-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--ct-surface-1);
  border: 1px solid var(--ct-border);
  border-radius: 6px;
}
.ct-peer-row__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.ct-peer-row__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.ct-peer-row__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ct-text);
}
.ct-peer-row__time {
  font-size: 13px;
  font-family: var(--ct-mono);
  color: var(--ct-text-2);
}

/* ═══════════════════════════════════════════════════════════════
   Audio meter
   ═══════════════════════════════════════════════════════════════ */
.ct-audio-meter {
  height: 6px;
  background: rgba(139,148,158,0.14);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.ct-audio-meter__fill {
  position: absolute;
  inset: 0;
  background: var(--ct-aurora);
  border-radius: 999px;
  transform-origin: left center;
}
.ct-audio-meter__fill--active { animation: ct-meter 2.4s ease-in-out infinite; }
.ct-audio-meter__fill--muted  { transform: scaleX(0.05); }

/* app.js sets --level for the legacy contract; keep as fallback */
#audio-level {
  height: 6px;
  background: rgba(139,148,158,0.14);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
#audio-level .ct-audio-meter__fill { background: var(--ct-aurora); }

/* ═══════════════════════════════════════════════════════════════
   Quality dot  (CTQualityDot)
   ═══════════════════════════════════════════════════════════════ */
.ct-qdot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ct-text-2);
}
.ct-qdot__dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.ct-qdot__dot--good   { background: var(--ct-aurora); color: var(--ct-aurora); }
.ct-qdot__dot--fair   { background: var(--ct-ember);  color: var(--ct-ember);  }
.ct-qdot__dot--poor   { background: var(--ct-cinder); color: var(--ct-cinder); }
.ct-qdot__dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: 0.6;
  animation: ct-pulse 3s ease-in-out infinite;
}
.ct-qdot__label { color: var(--ct-text); }

/* ═══════════════════════════════════════════════════════════════
   Segmented control  (CTSegmented)
   ═══════════════════════════════════════════════════════════════ */
.ct-segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--ct-surface-1);
  border-radius: 4px;
  border: 1px solid var(--ct-border);
  padding: 3px;
  gap: 3px;
}
/* hide native radio */
.ct-segmented input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.ct-segmented__label {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ct-text-2);
  cursor: pointer;
  transition: background 150ms, color 150ms, box-shadow 150ms;
  position: relative;
}
.ct-segmented input:checked ~ .ct-segmented__label,
.ct-segmented__label:has(input:checked) {
  background: var(--ct-surface-2);
  color: var(--ct-text);
  box-shadow: inset 0 0 0 1px var(--ct-border-2);
}
/* fallback for browsers without :has() — use JS class toggle */
.ct-segmented__label--active {
  background: var(--ct-surface-2);
  color: var(--ct-text);
  box-shadow: inset 0 0 0 1px var(--ct-border-2);
}

/* ═══════════════════════════════════════════════════════════════
   SAS code block
   ═══════════════════════════════════════════════════════════════ */
.ct-sas-block {
  padding: 18px 14px;
  border: 1px solid var(--ct-border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background:
    radial-gradient(120% 80% at 50% 50%, rgba(121,192,255,0.10), transparent 70%),
    var(--ct-surface-1);
}
.ct-sas-code {
  font-family: var(--ct-mono);
  font-size: 32px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 6px;
  color: var(--ct-text);
}
.ct-sas-code .digit { color: var(--ct-frost); }

/* ═══════════════════════════════════════════════════════════════
   Toast / inline notice
   ═══════════════════════════════════════════════════════════════ */
.ct-toast {
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.ct-toast__bar {
  width: 4px;
  align-self: stretch;
  border-radius: 2px;
  opacity: 0.5;
}
.ct-toast__text { flex: 1; color: var(--ct-text); }
.ct-toast--info    { background: rgba(121,192,255,0.10); border: 1px solid rgba(121,192,255,0.32); color: var(--ct-frost); }
.ct-toast--warn    { background: rgba(210,153,34,0.10);  border: 1px solid rgba(210,153,34,0.34);  color: var(--ct-ember); }
.ct-toast--error   { background: rgba(255,123,114,0.10); border: 1px solid rgba(255,123,114,0.34); color: var(--ct-cinder); }
.ct-toast--success { background: rgba(63,185,80,0.10);   border: 1px solid rgba(63,185,80,0.32);   color: var(--ct-aurora); }

/* mic permission notice in name screen */
.ct-mic-notice {
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(121,192,255,0.06);
  border: 1px solid rgba(121,192,255,0.18);
  border-radius: 4px;
}
.ct-mic-notice__icon { flex: 0 0 auto; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════
   Waiting screen — breathing diamond
   ═══════════════════════════════════════════════════════════════ */
.ct-waiting-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  position: relative;
  text-align: center;
}
.ct-avatar-glow {
  position: relative;
  width: 96px; height: 96px;
}
.ct-avatar-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: radial-gradient(circle, var(--ct-glow), transparent 70%);
}

/* ═══════════════════════════════════════════════════════════════
   Call screen zones
   ═══════════════════════════════════════════════════════════════ */
.ct-call-zone {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 0;
}
.ct-call-zone__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ct-call-self {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}
.ct-call-self__info { flex: 1; }
.ct-call-self__meter { flex: 0 0 110px; }
.ct-call-controls {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}
.ct-call-controls .ct-btn { flex: 1; }
.ct-call-controls .ct-btn--danger { flex: 1.4; }
.ct-call-footer {
  text-align: center;
  padding-top: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   Error / ended card
   ═══════════════════════════════════════════════════════════════ */
.ct-ended-wrap {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.ct-ended-card {
  position: relative;
  z-index: 1;
  background: var(--ct-surface-1);
  border: 1px solid var(--ct-border);
  border-radius: 6px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ct-ended-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ct-ended-stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--ct-border);
}
.ct-ended-stat:last-child { border-bottom: none; }
.ct-ended-stat__val {
  font-size: 13px;
  font-family: var(--ct-mono);
  color: var(--ct-text);
}

/* error-screen icon hexagon */
.ct-err-icon {
  position: relative;
  width: 72px; height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* error layout */
.ct-err-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 22px;
}
.ct-err-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.ct-err-body { max-width: 290px; display: flex; flex-direction: column; gap: 8px; }

/* locked screen */
.ct-locked-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
}
.ct-locked-timer {
  position: relative;
  width: 220px; height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ct-locked-timer__label {
  position: absolute;
  font-family: var(--ct-mono);
  font-size: 24px;
  color: var(--ct-ember);
  letter-spacing: 0.15em;
}

/* ═══════════════════════════════════════════════════════════════
   SAS verification screen — pair avatars row
   ═══════════════════════════════════════════════════════════════ */
.ct-sas-peers {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
}
.ct-sas-peer {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ct-sas-peer--right { flex-direction: row-reverse; text-align: right; }
.ct-sas-peer__label { font-size: 12px; color: var(--ct-text-2); }
.ct-sas-peer__name  { font-size: 13px; font-weight: 500; }

/* gold hint dot */
.ct-gold-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}
.ct-gold-hint__dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--ct-gold);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Screen-level layout helpers
   ═══════════════════════════════════════════════════════════════ */
.ct-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.ct-spacer { flex: 1; }

/* hidden utility */
[hidden] { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   Landing hero
   ═══════════════════════════════════════════════════════════════ */
.ct-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 80px 0 28px;
}
.ct-hero__sub {
  color: var(--ct-text-2);
  max-width: 300px;
}

/* form section on landing */
.ct-form-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ct-version {
  font-family: var(--ct-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ct-text-2);
}

/* landing footer ornament row */
.ct-landing-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 24px;
}

/* ═══════════════════════════════════════════════════════════════
   Responsive — nothing below 320px; desktop keeps 540px column.
   Mobile: full-height column, no body scroll. Content compresses
   via flex-grow on .ct-spacer / .ct-content rather than overflowing.
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 540px) {
  html, body { height: 100%; overflow: hidden; }
  .ct-page {
    /* 100dvh accounts for mobile browser chrome (address bar). 100vh fallback. */
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 0 16px env(safe-area-inset-bottom, 12px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .ct-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top, 8px);
  }
  /* Tighten top breathing room — the iOS-mock frame's 56px is too much in a real browser */
  .ct-header { margin-top: 8px; }
  /* Hide decorative landing footer on mobile — it's purely ornamental */
  .ct-landing-footer { display: none; }
  /* Tighten hero spacing */
  .ct-hero { margin-bottom: 20px; }
  /* Reduce call-screen self-row padding so controls stay above the fold */
  .ct-call-self { padding: 10px 12px; }
  /* Make screen sections fill remaining height so .ct-spacer can push
     controls/buttons to the bottom edge (no body-scroll on mobile). */
  #name-screen:not([hidden]),
  #password-screen:not([hidden]),
  #call-screen:not([hidden]),
  #ended-screen:not([hidden]) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }
}
