/* PrimeCare AI demo page. Plain CSS, no build step. Tokens on :root; dark
   mode follows the system unless <html data-theme> pins one. */

:root {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f1f5f4;
  --text: #171d1c;
  --muted: #586360;
  --primary: #00796b;
  --primary-strong: #005e53;
  --on-primary: #ffffff;
  --primary-container: #cce8e3;
  --primary-tint: #e0f2f1;
  --accent: #a6750a;
  --accent-tint: #fbf1d6;
  --border: #dce3e1;
  --success: #2e7d32;
  --success-tint: #e3f2e4;
  --warning: #9a5b00;
  --warning-tint: #fff1dc;
  --danger: #b3261e;
  --danger-tint: #fde7e5;
  --info: #0b5f9e;
  --phone-frame: #1f2524;
  --shadow: 0 1px 2px rgba(23, 29, 28, 0.06), 0 10px 28px rgba(23, 29, 28, 0.07);
  --radius: 16px;
  --radius-sm: 9px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --hero-a: #cce8e3;
  --hero-b: #e0f2f1;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1413;
    --surface: #161c1b;
    --surface-2: #1e2523;
    --text: #e2e8e6;
    --muted: #a2adaa;
    --primary: #60d9c6;
    --primary-strong: #8ee6d8;
    --on-primary: #00382f;
    --primary-container: #1f4a43;
    --primary-tint: #17302c;
    --accent: #f2c14e;
    --accent-tint: #3a2e10;
    --border: #2c3532;
    --success: #7bd389;
    --success-tint: #16301b;
    --warning: #f0b45b;
    --warning-tint: #3a2a0d;
    --danger: #ff8a80;
    --danger-tint: #3f1b18;
    --info: #7cc4ff;
    --phone-frame: #38423f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.35);
    --hero-a: #163a34;
    --hero-b: #0f1413;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1413;
  --surface: #161c1b;
  --surface-2: #1e2523;
  --text: #e2e8e6;
  --muted: #a2adaa;
  --primary: #60d9c6;
  --primary-strong: #8ee6d8;
  --on-primary: #00382f;
  --primary-container: #1f4a43;
  --primary-tint: #17302c;
  --accent: #f2c14e;
  --accent-tint: #3a2e10;
  --border: #2c3532;
  --success: #7bd389;
  --success-tint: #16301b;
  --warning: #f0b45b;
  --warning-tint: #3a2a0d;
  --danger: #ff8a80;
  --danger-tint: #3f1b18;
  --info: #7cc4ff;
  --phone-frame: #38423f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.35);
  --hero-a: #163a34;
  --hero-b: #0f1413;
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  overflow-x: hidden;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: var(--primary);
  text-underline-offset: 0.15em;
}
h1,
h2,
h3,
h4 {
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.4rem);
  font-weight: 750;
}
h2 {
  font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.3rem);
  font-weight: 700;
}
h3 {
  font-size: 1.125rem;
  font-weight: 650;
}
p {
  margin: 0 0 1em;
}
ul,
ol {
  margin: 0;
  padding: 0;
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 720px) {
  .wrap {
    padding: 0 24px;
  }
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--surface);
  padding: 8px 12px;
  z-index: 100;
}
.skip:focus {
  left: 8px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.86rem;
}
.eyebrow {
  color: var(--primary);
  font-weight: 650;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.6em;
}
.lead,
.section-lead {
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.2rem);
  color: var(--muted);
  max-width: 60ch;
}
.section {
  padding: 56px 0;
}
@media (min-width: 900px) {
  .section {
    padding: 88px 0;
  }
}
.section-head {
  max-width: 720px;
}
.tour-intro {
  padding-bottom: 8px;
}
@media (min-width: 900px) {
  .tour-intro {
    padding-bottom: 16px;
  }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--primary-tint);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}
.btn-small {
  padding: 8px 14px;
  font-size: 0.9rem;
}
.btn[disabled] {
  opacity: 0.5;
  cursor: default;
  transform: none;
}
.btn[disabled]:hover {
  background: var(--primary);
}
.btn:not(.btn-primary)[disabled]:hover {
  background: transparent;
}
.btn[aria-pressed="true"] {
  opacity: 0.7;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  margin-right: auto;
}
.brand b {
  color: var(--primary);
}
.site-nav {
  display: none;
  gap: 4px;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 500;
}
.site-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}
@media (min-width: 900px) {
  .site-nav {
    display: flex;
  }
}

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--hero-a), var(--hero-b) 70%, var(--bg));
  padding: 56px 0 24px;
}
@media (min-width: 900px) {
  .hero {
    padding: 88px 0 32px;
  }
}
.hero-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}
@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
  }
}
.hero h1 .hl {
  color: var(--primary);
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}
.mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  font-size: 0.86rem;
}
.mini-a {
  margin-right: 14%;
  transform: rotate(-1.5deg);
}
.mini-b {
  margin-left: 14%;
  transform: rotate(1.2deg);
}
.mini-c {
  margin-right: 26%;
  transform: rotate(-1deg);
}
.mini-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.mini-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-weight: 600;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
}
.dot.rec {
  background: var(--danger);
  animation: pulse 1.4s ease-in-out infinite;
}
.dot.gold {
  background: var(--accent);
}
.wave {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 34px;
  margin-bottom: 12px;
}
.wave i {
  flex: 1;
  background: var(--primary);
  border-radius: 3px;
  opacity: 0.85;
  animation: wave 1.2s ease-in-out infinite;
}
.wave i:nth-child(odd) {
  height: 60%;
}
.wave i:nth-child(even) {
  height: 35%;
  animation-delay: 0.3s;
}
.wave i:nth-child(3n) {
  height: 90%;
  animation-delay: 0.6s;
}
.mini-line {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  margin: 8px 0;
}
.w80 {
  width: 80%;
}
.w60 {
  width: 60%;
}
.mini-foot {
  margin-top: 10px;
  font-weight: 600;
  color: var(--muted);
}
.mini-foot.ok {
  color: var(--success);
}
.trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.trust-label {
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}
.trust ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  list-style: none;
}
.trust li {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 500;
}

/* ---------- feature sections ---------- */
.feature {
  padding: 48px 0;
}
@media (min-width: 960px) {
  .feature {
    padding: 72px 0;
  }
}
.feature:nth-of-type(even) {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.feature .wrap {
  max-width: 1280px;
}
.feature-grid {
  display: grid;
  gap: 24px;
  align-items: start;
}
@media (min-width: 960px) {
  .feature-grid {
    grid-template-columns: 4fr 8fr;
    gap: 48px;
  }
  .feature:nth-of-type(even) .feature-grid {
    grid-template-columns: 8fr 4fr;
  }
  .feature:nth-of-type(even) .feature-copy {
    order: 2;
  }
  .feature-copy {
    position: sticky;
    top: 88px;
  }
}
.feature-copy h2 {
  font-size: clamp(1.4rem, 1rem + 1.4vw, 1.9rem);
}
.feature-copy p {
  color: var(--muted);
}
.feature-copy p.small {
  font-size: 0.86rem;
}
.stage {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
  container-type: inline-size;
}
.feature:nth-of-type(odd) .stage {
  background: var(--surface);
}
@media (min-width: 720px) {
  .stage {
    padding: 20px;
  }
}
.notice {
  color: var(--muted);
}

/* ---------- stage furniture ---------- */
.demo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 14px;
}
.sim {
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 4px 10px;
  border-radius: 999px;
}
.demo-status {
  color: var(--muted);
  font-size: 0.9rem;
  margin-right: auto;
  flex: 1 1 200px;
}
.demo-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}
/* Two columns only when the stage itself is wide enough (container query;
   browsers without it keep the stacked layout). */
@container (min-width: 640px) {
  .demo-grid {
    grid-template-columns: 1fr 1fr;
  }
  .demo-grid.phone-grid {
    grid-template-columns: 1.3fr 1fr;
    align-items: start;
  }
  .demo-grid.plan-grid {
    grid-template-columns: 2fr 3fr;
  }
}
.dcard {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dcard header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dcard h3 {
  font-size: 0.98rem;
  margin: 0;
}
.dcard h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 14px 0 6px;
}
.dcard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.pill {
  font-size: 0.75rem;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.pill.rec {
  color: var(--danger);
  border-color: var(--danger);
  animation: pulse 1.4s ease-in-out infinite;
}
.pill.ok {
  color: var(--success);
  background: var(--success-tint);
  border-color: transparent;
}
.pill.warn {
  color: var(--warning);
  background: var(--warning-tint);
  border-color: transparent;
}
.pill.urgent {
  color: var(--danger);
  background: var(--danger-tint);
  border-color: transparent;
}
.pill.busy {
  color: var(--info);
}
.pill.held {
  color: var(--accent);
  background: var(--accent-tint);
  border-color: transparent;
}
.done {
  color: var(--success);
  font-weight: 600;
  font-size: 0.9rem;
}
.chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid var(--primary-container);
  white-space: nowrap;
}
.book-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}
.steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.steps li::before {
  content: "✓";
  color: var(--success);
  font-weight: 700;
  flex: 0 0 1em;
}
.steps li.busy::before {
  content: "…";
  color: var(--info);
}

/* ---------- book ---------- */
.book {
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.slot {
  display: grid;
  grid-template-columns: 3.4rem 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  min-height: 46px;
  font-size: 0.9rem;
}
.slot:last-child {
  border-bottom: 0;
}
.slot time {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.slot .who {
  font-weight: 600;
  min-width: 0;
}
.slot .who small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.78rem;
}
.slot .who small.sub {
  color: var(--primary);
}
.slot.empty .who {
  color: var(--muted);
  font-weight: 400;
}
.slot.new {
  box-shadow: inset 3px 0 var(--primary);
  background: var(--primary-tint);
}
.slot.blocked {
  background: repeating-linear-gradient(45deg, var(--surface) 0 6px, var(--surface-2) 6px 12px);
}
.book.compact .slot {
  padding: 6px 4px;
  font-size: 0.78rem;
  min-height: 38px;
  grid-template-columns: 2.6rem 1fr auto;
}
.book.compact .pill {
  font-size: 0.66rem;
  padding: 2px 7px;
}
.book.compact .slot .who small {
  font-size: 0.7rem;
}

/* ---------- transcript + note ---------- */
.transcript {
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.92rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
.transcript li {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 8px;
}
.transcript time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding-top: 3px;
}
.transcript .who {
  font-weight: 650;
  margin-right: 6px;
}
.transcript .who.dr {
  color: var(--primary);
}
.transcript .who.pt {
  color: var(--accent);
}
.note {
  margin: 0;
  font-size: 0.92rem;
}
.note dt {
  font-weight: 650;
  color: var(--primary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 10px;
}
.note dd {
  margin: 2px 0 0;
}
.inputs {
  margin: 12px 0 0;
}

/* ---------- plan ---------- */
.plan {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.plan th,
.plan td {
  text-align: left;
  vertical-align: top;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.plan th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 650;
}
.plan td:first-child {
  font-weight: 600;
}
@media (max-width: 700px) {
  .plan thead {
    display: none;
  }
  .plan tr {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
  }
  .plan td {
    display: block;
    padding: 2px 0;
    border: 0;
  }
  .plan td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 650;
  }
}
.providers {
  list-style: none;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.plan-meta {
  margin: 12px 0 0;
  font-size: 0.88rem;
  color: var(--primary);
  font-weight: 600;
}

/* ---------- results ---------- */
.inbox {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inbox button {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.92rem;
}
.inbox button:hover {
  border-color: var(--primary);
}
.inbox button[aria-pressed="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-container);
}
.inbox .test {
  font-weight: 650;
  grid-column: 1;
  grid-row: 1;
}
.inbox .meta {
  color: var(--muted);
  font-size: 0.82rem;
  grid-column: 1;
  grid-row: 2;
}
.inbox .chips {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 11rem;
}
.triage-patient {
  font-weight: 650;
  margin-bottom: 6px;
}
.tests {
  list-style: none;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tests li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}
.tests .tname {
  font-weight: 600;
  min-width: 7rem;
}
.tests .tval {
  font-family: var(--mono);
  font-size: 0.82rem;
}
.summary {
  font-size: 0.95rem;
}
.findings {
  list-style: disc;
  padding-left: 1.2em;
  font-size: 0.92rem;
}
.findings li {
  margin-bottom: 4px;
}
.decide {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  align-self: flex-start;
  background: var(--surface);
}
.seg button {
  border: 0;
  background: transparent;
  padding: 6px 16px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--on-primary);
}
fieldset.actions {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 0.9rem;
}
fieldset.actions label {
  display: flex;
  gap: 6px;
  align-items: center;
  cursor: pointer;
}
fieldset.actions input {
  accent-color: var(--primary);
  margin: 0;
}

/* ---------- phone frame ---------- */
.phone {
  width: min(100%, 270px);
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  border: 10px solid var(--phone-frame);
  border-radius: 36px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.phone-screen {
  height: 100%;
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.82rem;
  overflow: hidden;
}
.phone-title {
  font-weight: 700;
  font-size: 0.9rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.bubble {
  padding: 8px 12px;
  border-radius: 14px;
  max-width: 96%;
  line-height: 1.35;
  background: var(--surface-2);
  border-bottom-left-radius: 4px;
}
.bubble .link {
  color: var(--info);
  text-decoration: underline;
  word-break: break-all;
}
.q {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
}
.q-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.q-option {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 0.74rem;
  line-height: 1.3;
}
.q-option.picked {
  border-color: var(--primary);
  background: var(--primary-tint);
}
.qbar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: auto;
}
.qbar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.4s ease;
}
.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-size: 0.66rem;
  text-align: center;
  color: var(--muted);
}
.tabbar b {
  color: var(--primary);
  font-weight: 650;
}

/* ---------- scores ---------- */
.scores {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 12px;
}
.scores th,
.scores td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.scores th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 650;
}
.scores .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- script form ---------- */
.form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px 12px;
  margin: 0 0 12px;
  font-size: 0.9rem;
}
@media (min-width: 600px) {
  .form {
    grid-template-columns: 10rem 1fr;
    gap: 8px 12px;
  }
}
.form dt {
  color: var(--muted);
  font-size: 0.8rem;
  padding-top: 7px;
}
.form dd {
  margin: 0;
  position: relative;
  min-width: 0;
}
.form .input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  min-height: 2.1em;
}
.form .input.typing::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1em;
  background: var(--text);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: pulse 1s steps(2) infinite;
}
.suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 3;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.86rem;
  margin-top: 2px;
}
.suggest li {
  padding: 6px 10px;
}
.suggest li[aria-selected="true"] {
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 600;
}
.suggest .src {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

/* ---------- letter ---------- */
.field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.input.ask {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-height: 5.4em;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.input.ask.typing::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1em;
  background: var(--text);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: pulse 1s steps(2) infinite;
}
.letter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 0.88rem;
  line-height: 1.55;
}
.letterhead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}
.letterhead b {
  color: var(--primary);
  font-size: 1rem;
}
.letterhead span,
.letter-meta,
.letter-sign span {
  color: var(--muted);
  font-size: 0.8rem;
}
.letter-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 0 0 10px;
}
.dcard h4.letter-title {
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  margin: 0 0 8px;
}
.letter-body p {
  margin: 0 0 8px;
}
.gap {
  font: inherit;
  font-weight: 650;
  color: var(--warning);
  background: var(--warning-tint);
  border: 1px dashed var(--warning);
  border-radius: 6px;
  padding: 0 5px;
  cursor: pointer;
}
.gap[disabled] {
  cursor: default;
}
.gap:not([disabled]) {
  animation: pulse 1.4s ease-in-out infinite;
}
.gap.filled {
  color: var(--success);
  background: var(--success-tint);
  border-style: solid;
  border-color: transparent;
  animation: none;
}
.letter-sign {
  margin: 12px 0 0;
  font-weight: 650;
}

/* ---------- call ---------- */
.call {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.call-timer {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.call-controls {
  display: flex;
  gap: 10px;
}
.call-controls button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.66rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.call-controls button[disabled] {
  opacity: 0.5;
  cursor: default;
}
.call-controls .hang {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.callee {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.callee.idle {
  justify-content: center;
}
.callee .clock {
  font-size: 2.4rem;
  font-weight: 300;
  color: var(--muted);
}
.callee .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-container);
}
.callee .num {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.callee.ring .avatar {
  animation: ring 1.2s ease-in-out infinite;
}

/* ---------- sync flow ---------- */
.sync-flow {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sync-flow .node {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.9rem;
}
.sync-flow .node span {
  color: var(--muted);
  font-size: 0.82rem;
}
.sync-flow .arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  font-size: 0.74rem;
  color: var(--muted);
  padding: 2px 8px;
}
.sync-flow .arrow::before {
  content: "⇅";
  font-size: 1.3rem;
  color: var(--primary);
  line-height: 1;
}
.sync-caption {
  margin-top: 12px;
}

/* ---------- closing + contact ---------- */
.closing {
  text-align: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.closing p {
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem);
  color: var(--muted);
  max-width: 60ch;
  margin: 0 auto;
}
.contact {
  text-align: center;
  background: linear-gradient(180deg, var(--bg), var(--primary-tint));
}
.mail {
  display: inline-block;
  font-size: clamp(1.3rem, 1rem + 2vw, 2.2rem);
  font-weight: 750;
  letter-spacing: -0.01em;
  margin: 4px 0 16px;
  word-break: break-all;
}
.contact-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- footer ---------- */
.site-footer {
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer p {
  margin: 0 0 8px;
}
.fine {
  font-size: 0.82rem;
}

/* ---------- motion ---------- */
.appear {
  animation: rise 0.35s ease both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}
@keyframes wave {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.45);
  }
}
@keyframes ring {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--primary-container);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 10px transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .appear,
  .dot.rec,
  .pill.rec,
  .wave i,
  .callee.ring .avatar,
  .form .input.typing::after,
  .input.ask.typing::after,
  .gap:not([disabled]) {
    animation: none;
  }
  .qbar i {
    transition: none;
  }
  .transcript {
    scroll-behavior: auto;
  }
}
