/* Whisper · dark, secure, mobile-first — v2.2 visual refresh (violet accent) */
:root {
  --bg:             #09090f;
  --bg-2:           #12121a;
  --bg-3:           #1a1a24;
  --fg:             #e8eaf0;
  --fg-2:           #9aa5b1;
  --fg-3:           #6b7785;
  /* Primary accent: violet-500. Used for CTAs, active states, brand glow. */
  --accent:         #8b5cf6;
  --accent-light:   #a78bfa;   /* violet-400 — text-on-dark, subtle highlights */
  --accent-dim:     rgba(139, 92, 246, 0.14);
  --accent-border:  rgba(139, 92, 246, 0.35);
  --accent-glow:    rgba(139, 92, 246, 0.45);
  /* Semantic signals for feature tiles */
  --info:           #60a5fa;
  --info-dim:       rgba(96, 165, 250, 0.15);
  --warn:           #f59e0b;
  --warn-dim:       rgba(245, 158, 11, 0.12);
  --warn-border:    rgba(245, 158, 11, 0.35);
  --bad:            #f87171;
  --good:           #34d399;
  /* Legacy teal still usable inside call UI (quality pill, success states) */
  --teal:           #00d4aa;
  --border:         #232336;
  --radius:         14px;
  --shadow:         0 10px 40px rgba(0,0,0,.55);
  --shadow-violet:  0 10px 50px rgba(139,92,246,0.20);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Subtle violet halo — top-centre and bottom-right — keeps the product
     feeling "encrypted / premium" without tinting the whole page. */
  background-image:
    radial-gradient(ellipse 70% 55% at 50% 0%,  rgba(139,92,246,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 85% 95%, rgba(139,92,246,0.05) 0%, transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
}
#app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 28px 48px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
/* Narrow layout (in-call, join page, security page) caps at 560px for
   readability. Home page widens to 1180px (see .hero which lives in
   #app :only-child contexts). The body class .narrow is toggled by
   renderers that want the old width. */
body.narrow #app { max-width: 560px; }
button { font: inherit; cursor: pointer; }
input { font: inherit; }
a { color: var(--accent); text-decoration: none; }

/* ─── Header ─── */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: inline-block;
}
.brand-name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .02em;
}
.brand-sub {
  margin-left: auto;
  font-size: 12px;
  color: var(--fg-3);
  font-family: var(--mono);
}

/* ─── Card ─── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
}
.card p {
  margin: 0 0 16px;
  color: var(--fg-2);
}
.card p:last-child { margin-bottom: 0; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--fg);
  font-size: 15px;
  font-weight: 500;
  transition: all .15s;
  width: 100%;
}
.btn:hover { background: #242c3c; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06231d;
  font-weight: 600;
}
.btn-primary:hover { background: #14e6bb; }
.btn-danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.btn-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 0;
  font-size: 22px;
}
.btn-row {
  display: flex;
  gap: 10px;
}
.btn-row .btn { flex: 1; }

/* ─── Form ─── */
.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--fg-2);
  cursor: pointer;
  user-select: none;
}
.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }
.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 16px;
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--accent); }
.input-pin {
  font-size: 24px;
  letter-spacing: .35em;
  text-align: center;
  padding: 16px;
}

/* ─── Result block (invite link & code) ─── */
.result {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}
.result-item {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.result-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fg-3);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.result-value {
  font-family: var(--mono);
  font-size: 14px;
  word-break: break-all;
  color: var(--fg);
}
.result-value.pin {
  font-size: 28px;
  letter-spacing: .25em;
  text-align: center;
  color: var(--accent);
  font-weight: 600;
}
.copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-2);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }

/* ─── How it works ─── */
.how {
  font-size: 13px;
  color: var(--fg-3);
  line-height: 1.6;
}
.how strong { color: var(--fg-2); }
.how ul { padding-left: 18px; margin: 8px 0 0; }
.how li { margin-bottom: 4px; }

/* ─── Status banner ─── */
.banner {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.banner.info { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.banner.warn { background: #f0a13220; border-color: var(--warn); color: var(--warn); }
.banner.bad { background: #e5484d20; border-color: var(--bad); color: var(--bad); }

/* ─── Call view ─── */
body.in-call {
  background: #000;
  background-image: none;
}
body.in-call #app {
  max-width: none;
  padding: 0;
}
.call-stage {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
}
.video-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}
#remoteVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050708;
}
#localVideo {
  position: absolute;
  top: max(env(safe-area-inset-top, 0px), 16px);
  right: 16px;
  width: 110px;
  height: 150px;
  border-radius: 12px;
  object-fit: cover;
  background: #1a1a1a;
  border: 2px solid rgba(255,255,255,.15);
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  z-index: 5;
}
.call-info {
  position: absolute;
  top: max(env(safe-area-inset-top, 0px), 16px);
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.1);
}
.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  display: inline-block;
}
.pill.warn .dot { background: var(--warn); }
.pill.bad .dot { background: var(--bad); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--bad); }

.no-video-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--fg-2);
  font-size: 14px;
  z-index: 1;
  background: linear-gradient(180deg, #0c1018, #050708);
}
.no-video-overlay.show { display: flex; }
.no-video-overlay svg {
  width: 80px;
  height: 80px;
  opacity: .25;
}

.controls {
  padding: 24px 20px max(env(safe-area-inset-bottom, 0px), 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.6) 30%);
  z-index: 10;
}
.ctrl {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ctrl:hover { background: rgba(255,255,255,.2); }
.ctrl:active { transform: scale(.95); }
.ctrl.muted { background: var(--bad); }
.ctrl.hangup { background: var(--bad); width: 70px; height: 70px; }
.ctrl.hangup:hover { background: #f56e72; }
.ctrl svg { width: 26px; height: 26px; fill: currentColor; }

/* ─── Footer / tiny info ─── */
.footer {
  margin-top: auto;
  padding-top: 24px;
  text-align: center;
  font-size: 11px;
  color: var(--fg-3);
}
.footer .lock { color: var(--accent); }

/* ─── Responsive ─── */
@media (max-width: 480px) {
  #app { padding: 16px 14px 30px; }
  .card { padding: 20px; }
  #localVideo { width: 90px; height: 120px; }
  .controls { gap: 14px; }
  .ctrl { width: 54px; height: 54px; }
  .ctrl.hangup { width: 64px; height: 64px; }
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.85);
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 13px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
}
.toast.show { opacity: 1; }

/* ─── v2.1 additions ─── */

/* CSP-friendly visibility helpers */
.hidden { display: none !important; }
.dim    { opacity: .5; }
.mt-sm  { margin-top: 8px; }
.mt-md  { margin-top: 14px; }
.mt-lg  { margin-top: 18px; }
.mb-sm  { margin-bottom: 10px; }
.mb-md  { margin-bottom: 14px; }
.mb-lg  { margin-bottom: 18px; }
.fg-3   { color: var(--fg-3); }
.small  { font-size: 12px; }

/* invisible-but-focusable text area for clipboard fallback */
.offscreen-copy {
  position: fixed;
  left: -9999px;
  top: 0;
  opacity: 0;
}

/* Password input + strength meter */
.pin-wrap        { margin-top: 14px; }
.pin-random-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.pin-random-btn {
  flex: 1;
  padding: 8px;
  margin-top: 0;
}
.pin-random-btn-primary {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.pin-random-btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
}
.meter {
  margin-top: 10px;
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: 0%;
  background: var(--fg-3);
  transition: width .25s, background .25s;
}
.meter-fill.score-1 { width: 20%; }
.meter-fill.score-3 { width: 60%; }
.meter-fill.score-5 { width: 100%; background: var(--good); }
.meter-fill.bad     { background: var(--bad); }
.meter-fill.warn    { background: var(--warn); }
.meter-label {
  font-size: 11px;
  margin-top: 6px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.meter-label.bad  { color: var(--bad); }
.meter-label.warn { color: var(--warn); }

/* SAS (safety phrase) pill on the call screen */
.sas-pill {
  background: rgba(0, 212, 170, 0.18);
  border-color: rgba(0, 212, 170, 0.55);
  color: #b3fbe9;
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 14px;
  align-items: center;
}
.sas-pill .sas-prefix {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #8fe6cb;
  margin-right: 8px;
  border-right: 1px solid rgba(0, 212, 170, 0.35);
  padding-right: 8px;
}
.sas-pill .sas-words {
  font-weight: 600;
  letter-spacing: .04em;
  color: #ffffff;
}

/* No-video overlay text layout */
.no-video-overlay { gap: 14px; }
.no-video-text { display: flex; flex-direction: column; }
.no-video-title { font-size: 16px; color: var(--fg); }
.no-video-sub   { margin-top: 4px; }

/* Security page typography */
.security-h3 {
  margin-top: 18px;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--fg-2);
  font-weight: 600;
}
.security-h3:first-child { margin-top: 0; }
.how code {
  background: var(--bg-3);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
.how p { margin: 6px 0 8px; }

/* ─── Diagnostic panel (WebRTC / GCC trace) ──────────────────
   Hidden by default. Opened by:
     - triple-tap on the quality pill
     - #diag in the URL hash on page load
   Closed by × button or Esc key. CSP-safe (no inline style). */
.diag-panel {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: 60vh;
  background: rgba(10, 14, 20, 0.94);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px 12px;
  color: var(--fg-2);
  z-index: 9999;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.diag-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.diag-panel-title {
  text-transform: uppercase;
}
.diag-panel-close {
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--fg-3);
  padding: 0 4px;
  user-select: none;
}
.diag-panel-close:hover {
  color: var(--bad);
}
.diag-panel-body {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--fg-2);
  white-space: pre;
  overflow-y: auto;
  max-height: calc(60vh - 40px);
  /* long traces shouldn't wrap — horizontal scroll instead */
  overflow-x: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   v2.2 · Home redesign: hero / progress / SAS / features / tech list
═══════════════════════════════════════════════════════════════════ */

/* Password strength "score-5" now follows the violet primary */
.meter-fill.score-5 { background: var(--accent); }

/* ─── Status badge (purple pill above the hero headline) ──────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  font-family: var(--sans);
}
.status-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: statusPulse 2s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%      { opacity: .55; transform: scale(1.35);}
}

/* ─── Hero container + two-column grid ────────────────────────── */
.hero {
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(139,92,246,0.04) 0%, transparent 35%),
    var(--bg-2);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 28px;
  align-items: start;
}
.hero-main  { min-width: 0; }
.hero-aside { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.hero-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 16px 0 10px;
  color: var(--fg);
}
.hero-desc {
  font-size: 13.5px;
  color: var(--fg-2);
  line-height: 1.65;
  max-width: 520px;
  margin: 0 0 18px;
}

/* ─── Invite link field ──────────────────────────────────────── */
.link-field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px 12px 16px;
  margin-bottom: 14px;
  transition: border-color .15s;
}
.link-field:focus-within,
.link-field.ready { border-color: var(--accent-border); }
.link-field-label {
  color: var(--fg-3);
  font-size: 12px;
  white-space: nowrap;
  letter-spacing: .02em;
}
.link-field-value {
  flex: 1;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-field-value.empty { color: var(--fg-3); font-style: italic; }
.link-field-copy {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg-2);
  cursor: pointer;
  font-size: 12px;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.link-field-copy:hover:not(:disabled)   { border-color: var(--accent); color: var(--accent-light); }
.link-field-copy.copied                 { border-color: var(--accent); color: var(--accent-light); background: var(--accent-dim); }
.link-field-copy:disabled               { opacity: .35; cursor: not-allowed; }
/* Nudge the copy button for a few seconds after the link is generated,
   so the user doesn't miss it and accidentally enter the call before
   sharing the link with the other party. */
.link-field-copy.nudge {
  border-color: var(--accent);
  color: var(--accent-light);
  animation: copyNudge 1.2s ease-in-out infinite;
}
@keyframes copyNudge {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%      { box-shadow: 0 0 0 6px rgba(139,92,246,0); }
}

/* ─── Big action button row ──────────────────────────────────── */
.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.action-btn {
  flex: 1 1 140px;
  padding: 13px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
  cursor: pointer;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all .18s;
  font-family: var(--sans);
}
.action-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-dim); color: var(--accent-light); }
.action-btn:disabled             { opacity: .55; cursor: not-allowed; }
.action-btn.active               { border-color: var(--accent); background: var(--accent-dim); color: var(--accent-light); }
.action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 500;
  box-shadow: 0 4px 18px rgba(139,92,246,0.30);
}
.action-btn.primary:hover:not(:disabled) {
  background: var(--accent-light);
  border-color: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(139,92,246,0.45);
}
.action-btn .icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* ─── Amber "security advisory" panel ────────────────────────── */
.advisory {
  background: var(--warn-dim);
  border: 1px solid var(--warn-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: #fbbf24;
  font-size: 13px;
  line-height: 1.6;
}
.advisory-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(245,158,11,0.25);
  color: var(--warn);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}
.advisory-body strong { color: #fcd34d; font-weight: 600; margin-right: 2px; }

/* ─── Aside cards (progress + SAS, right column) ─────────────── */
.aside-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.aside-card-title {
  color: var(--fg-2);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: .85;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.aside-card-hint {
  color: var(--fg-3);
  font-size: 10.5px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: .75;
}

/* ─── Progress stepper ───────────────────────────────────────── */
.progress-list { display: flex; flex-direction: column; gap: 2px; }
.progress-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  transition: background .18s;
}
.progress-step .step-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--fg-3);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: all .2s;
}
.progress-step .step-label { flex: 1; color: var(--fg-2); }
.progress-step .step-meta  { color: var(--fg-3); font-size: 11px; letter-spacing: .02em; }

.progress-step.done              { background: var(--accent-dim); }
.progress-step.done .step-icon   { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.progress-step.done .step-label  { color: var(--fg); }
.progress-step.done .step-meta   { color: var(--accent-light); }

.progress-step.active .step-icon { background: var(--bg); color: var(--fg); border-color: var(--fg-2); }
.progress-step.active .step-label{ color: var(--fg); }
.progress-step.active .step-meta { color: var(--fg-2); }
.progress-step.active .step-icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}
.progress-step.active .step-icon { position: relative; }

/* ─── SAS phrase grid on home aside (pre-connect placeholder) ─ */
.sas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sas-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sas-slot-num { color: var(--fg-3); font-family: var(--mono); font-size: 11px; }
.sas-slot-word {
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
}
.sas-slot-word.empty { color: var(--fg-3); font-weight: 400; opacity: .6; }
/* Preview mode: real-looking BIP39 words shown on the home page for
   visual effect. Slightly dimmed so they don't compete with the real
   SAS rendered during the call — the subtitle makes it explicit. */
.sas-slot-word.preview { color: var(--fg-2); opacity: .88; }

/* ─── Section headings below hero ────────────────────────────── */
.section-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 28px 4px 14px;
}
.section-title h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--fg);
}
.section-title-hint { color: var(--fg-3); font-size: 13px; }

/* ─── 工作原理 — 3 feature cards ──────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 10px;
}
.feature-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  transition: border-color .18s, transform .18s;
}
.feature-card:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 18px;
}
.feature-icon.violet { background: var(--accent-dim); color: var(--accent-light); }
.feature-icon.info   { background: var(--info-dim);   color: var(--info); }
.feature-icon.warn   { background: var(--warn-dim);   color: var(--warn); }
.feature-card h3 {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--fg);
}
.feature-card p {
  font-size: 12.5px;
  color: var(--fg-2);
  line-height: 1.65;
  margin: 0;
}
.feature-card p code {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  background: var(--bg-3);
  border-radius: 4px;
  color: var(--accent-light);
}
.feature-card p strong { color: var(--fg); font-weight: 600; }

/* ─── 技术细节 — 01-04 numbered items ─────────────────────── */
.tech-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 26px;
}
.tech-item {
  display: flex;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
  align-items: flex-start;
}
.tech-item:last-child { border-bottom: 0; }
.tech-item-num {
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 11px;
  flex-shrink: 0;
  padding-top: 3px;
  width: 24px;
  letter-spacing: .04em;
}
.tech-item-body { flex: 1; font-size: 13.5px; line-height: 1.6; color: var(--fg-2); }
.tech-item-body strong { color: var(--fg); font-weight: 600; margin-right: 6px; }
.tech-item-body .dim   { color: var(--fg-3); }

/* ─── /security CTA card (horizontal, icon + text + arrow) ───── */
.cta-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-top: 16px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.cta-card:hover {
  border-color: var(--accent-border);
  background:
    linear-gradient(90deg, var(--accent-dim) 0%, transparent 50%),
    var(--bg-2);
}
.cta-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--accent-dim);
  color: var(--accent-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.cta-card-body { flex: 1; }
.cta-card-title { font-size: 14.5px; font-weight: 600; margin: 0 0 4px; color: var(--fg); }
.cta-card-desc  { font-size: 12.5px; color: var(--fg-3); margin: 0; }
.cta-card-link  { color: var(--accent-light); font-size: 13px; white-space: nowrap; font-weight: 500; }

/* ─── Bottom footer bar ──────────────────────────────────────── */
.app-footer {
  text-align: center;
  color: var(--fg-3);
  font-size: 12px;
  padding: 22px 0;
  margin-top: auto;
  letter-spacing: .05em;
}
.app-footer .lock { margin-right: 6px; opacity: .6; }
.app-footer .sep  { margin: 0 8px; opacity: .4; }

/* ─── Passcode drawer (toggled by 附加密码 button) ───────────── */
.pin-drawer {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.pin-drawer.hidden { display: none; }
.pin-drawer-label {
  color: var(--fg-2);
  font-size: 12.5px;
  margin-bottom: 10px;
  display: block;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero-grid     { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  #app           { padding: 20px 16px 40px; }
  .hero          { padding: 22px; }
  .hero-title    { font-size: 24px; }
}
@media (max-width: 600px) {
  .action-row { flex-direction: column; }
  .action-btn { flex: 1 1 auto; }
}
