/* Voice agent: only what is special to this page. Tokens, cards, buttons and the guide come from /_s/shell.css.
   The picker and the phone are the same pieces as Coach, so the demos read as one showroom. */
.work { display: grid; gap: 16px; }
.small { font-size: .88rem; }
/* the picker: which member, and play */
.stage-head { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.stage-head > div:first-child { flex: 1 1 340px; min-width: 0; }
.stage-head .sr-hint { margin: 0 0 4px; }
.stage-head h2 { font: 600 1.35rem/1.25 var(--serif); letter-spacing: -.01em; margin: 0; }
.stage-actions { display: flex; gap: 10px; flex-wrap: wrap; }
/* members: three cards that read as a choice (one is always picked), then what the picked member told the app */
.members { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.members [role=radio] { display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 0; padding: 14px 14px 14px 14px; text-align: left; white-space: normal;
  justify-content: flex-start; border: 1.5px solid var(--axis); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; }
.members [role=radio]:hover:not(:disabled) { border-color: var(--accent); background: var(--surface); }
.members [role=radio][aria-checked="true"], .members [role=radio][aria-checked="true"]:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.mb-av { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface2); color: var(--ink2); font: 650 1.05rem var(--serif); }
[aria-checked="true"] .mb-av { background: var(--accent); color: var(--on-accent, #fff); }
.mb-t { flex: 1; min-width: 0; display: grid; gap: 3px; }
.mb-t b { font: 650 1rem/1.25 var(--sans); }
.mb-t span { font-size: .85rem; line-height: 1.4; color: var(--ink2); }
.mb-dot { flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--axis); background: var(--surface); }
[aria-checked="true"] .mb-dot { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 5px, var(--surface) 5.5px); }
.answers { margin-top: 14px; padding: 16px 18px; border-radius: var(--r); background: var(--surface2); }
.answers h3 { margin: 0 0 12px; font: 650 .95rem var(--sans); }
.answers dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
.answers dt { font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 3px; }
.answers dd { margin: 0; font-size: .9rem; line-height: 1.4; }
@media (max-width: 900px) { .members { grid-template-columns: minmax(0, 1fr); gap: 8px; } .answers dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* two columns: the app on the left, how it was made on the right */
.coach { display: grid; grid-template-columns: 410px minmax(0, 1fr); gap: 24px; align-items: start; }
.proof { min-width: 0; }
.proof > h2 { font: 600 1.2rem/1.25 var(--serif); margin: 0 0 14px; }
.proof h3 { font: 650 .95rem var(--sans); margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--grid); }
.proof h2 + h3 { border-top: 0; padding-top: 0; }
@media (max-width: 959px) { .coach { grid-template-columns: minmax(0, 1fr); } }
/* ---------------------------------------------------------------- the phone */
/* A graphite phone: machined rim (border), black glass bezel (padding), side keys, a camera pill and a status bar.
   The device is drawn in fixed colours in both themes, because it is an object on the page, not part of it. */
.phone { position: sticky; top: calc(var(--bar-h, 0px) + 16px); display: flex; justify-content: center; }
.ph-device { --metal: linear-gradient(152deg, #9a958f 0%, #57534e 9%, #2f2d2a 30%, #1d1c1a 55%, #2c2a27 78%, #5c5853 92%, #8f8a84 100%);
  position: relative; box-sizing: border-box; width: 392px; aspect-ratio: 392 / 804;   /* app.js zooms it down on a short window */
  padding: 11px; border: 3.5px solid transparent; border-radius: 62px;
  background: linear-gradient(#050505, #050505) padding-box, var(--metal) border-box;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 0 0 .5px rgba(0, 0, 0, .5),
    0 50px 80px -40px rgba(45, 30, 15, .55), 0 22px 36px -22px rgba(0, 0, 0, .45); }
.ph-key { position: absolute; width: 4px; border-radius: 2px 0 0 2px; background: linear-gradient(90deg, #1a1917, #5e5a55 50%, #2b2926); }
.ph-key-action { left: -7px; top: 17%; height: 4%; }
.ph-key-up { left: -7px; top: 24.5%; height: 7.5%; }
.ph-key-down { left: -7px; top: 33.5%; height: 7.5%; }
.ph-key-power { right: -7px; top: 27%; height: 11.5%; border-radius: 0 2px 2px 0; background: linear-gradient(270deg, #1a1917, #5e5a55 50%, #2b2926); }
.ph-frame { position: relative; isolation: isolate; height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 47px; background: var(--page); color: var(--ink); }
.ph-island { position: absolute; z-index: 9; top: 11px; left: 50%; translate: -50% 0; width: 31%; height: 31px; border-radius: 20px; background: #000; pointer-events: none; }
.ph-island::after { content: ""; position: absolute; right: 11px; top: 50%; translate: 0 -50%; width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #4b5a78 0 12%, #161b26 34%, #07080b 62%); box-shadow: 0 0 0 1.5px #0d0e10; }
.ph-status { flex: none; display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 6px 30px 0 38px; background: var(--surface); color: var(--ink); }
.ph-clock { font: 650 .92rem/1 var(--sans); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ph-icons { display: flex; align-items: center; gap: 6px; } .ph-icons svg { fill: currentColor; display: block; }
.ph-top { flex: none; display: flex; align-items: center; gap: 10px; padding: 4px 18px 12px; background: var(--surface); border-bottom: 1px solid var(--grid); }
.ph-mark { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.ph-mark svg { width: 20px; height: 20px; }
.ph-title { min-width: 0; display: grid; } .ph-title > b { font: 650 1rem/1.2 var(--sans); }
.ph-who { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ph-who b { color: var(--ink2); font-weight: 600; }
.ph-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 24px; scroll-behavior: smooth; }
.ph-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; color: var(--muted); padding: 0 32px; }
.ph-empty svg { width: 46px; height: 46px; color: var(--accent); }
.ph-empty p { margin: 0; font-size: .95rem; }
.ph-fine { font-size: .76rem; color: var(--muted); margin: 12px 2px 0; }
.ph-btn { width: 100%; min-height: 44px; border-radius: 12px; margin-top: 8px; font-weight: 600; }
.ph-btn.ghost { background: none; }
.ph-link { border: 0; background: none; min-height: 40px; padding: 0 10px; color: var(--accent-ink); font: 600 .85rem var(--sans); border-radius: 10px; }
.ph-link:hover { background: var(--hover); }
.ph-x { border: 0; background: none; font-size: 1.5rem; line-height: 1; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); padding: 0; }

/* ---------------------------------------------------------------- a real phone: the app is the page */
@media (max-width: 640px) {
  .phone { position: static; display: block; margin-inline: -8px; }
  .ph-device { width: auto; min-width: 0; aspect-ratio: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }   /* on a real phone the app is the page */
  .ph-key, .ph-island, .ph-status, .ph-tabs::after { display: none; }
  .ph-frame { height: auto; min-height: 420px; border: 1px solid var(--grid); border-radius: 18px; overflow: visible; box-shadow: var(--shadow-sm); }
  .ph-top { order: -2; border-radius: 18px 18px 0 0; padding: 10px 14px; }
  .ph-tabs { order: -1; position: sticky; top: 0; z-index: 4; border-top: 0; border-bottom: 1px solid var(--grid); padding: 4px; border-radius: 0; }
  .ph-body { overflow: visible; padding: 12px 10px 18px; }
}
@media (min-width: 641px) and (max-width: 959px) { .phone { position: static; } }

/* ---------------------------------------------------------------- the call inside the phone */
/* data-call: idle (nothing yet, or the live line set up), replay, played, live, ended */
.line-state { flex: none; display: flex; align-items: center; gap: 9px; padding: 8px 18px; background: var(--surface); border-bottom: 1px solid var(--grid); font: 500 .82rem var(--mono); color: var(--ink2); }
.line-state .dot { width: 10px; height: 10px; margin: 0; flex: none; border-radius: 50%; background: var(--axis); }
.dot.listening { background: var(--good); } .dot.thinking { background: var(--warn); } .dot.speaking { background: var(--accent); } .dot.idle, .dot.initializing { background: var(--s1); }
#clock { margin-left: auto; color: var(--muted); }
#talk { display: flex; flex-direction: column; gap: 8px; }
#talk:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#talk .ph-empty { flex: 1; }
.line { margin: 0; max-width: 86%; padding: 9px 13px; border-radius: 18px 18px 18px 5px; background: var(--surface); border: 1px solid var(--grid); align-self: flex-start; line-height: 1.45; font-size: .92rem; overflow-wrap: anywhere; box-shadow: var(--shadow-sm); }
.line.caller { align-self: flex-end; border-radius: 18px 18px 5px 18px; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--grid)); }
.line small { display: block; font: 500 .66rem var(--mono); color: var(--muted); letter-spacing: .03em; margin-bottom: 2px; }
.ph-dock { flex: none; padding: 10px 16px 30px; background: var(--surface); border-top: 1px solid var(--grid); }
.ph-dock:not(:has(> :not([hidden]))) { display: none; }
.replay-bar { display: flex; align-items: center; gap: 10px; }
.progress { flex: 1; height: 4px; border-radius: 2px; background: var(--grid); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s var(--ease); }
.consent { display: flex; gap: 10px; align-items: flex-start; font: 400 .85rem/1.4 var(--sans); color: var(--ink); margin: 0 0 10px; cursor: pointer; }
.consent input { flex: none; margin-top: 2px; }
.call-btn { width: 100%; min-height: 54px; border-radius: 27px; font-size: 1.02rem; font-weight: 650; background: var(--good); border-color: var(--good); color: #fff; }
.call-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--good) 86%, #000); }
.call-btn:disabled { background: var(--surface2); border-color: var(--axis); color: var(--muted); }
.call-btn svg { width: 22px; height: 22px; }
.call-btn.stop { background: var(--bad); border-color: var(--bad); }
.call-btn.stop:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 86%, #000); }
.why { color: var(--ink2); margin: 6px 0 0; min-height: 1.2em; }
[data-call="live"] .consent, [data-call="live"] .ph-fine, [data-call="live"] .why { display: none; }
#msg { margin: 8px 0 0; font-size: .86rem; }

/* behind the call: what the roastery has first, each action under it, the raw record one tap away */
.proof { padding: 20px 22px; }
#record .item { border: 1px solid var(--grid); border-left: 3px solid var(--good); border-radius: var(--r-sm); padding: 8px 12px; margin-bottom: 8px; font-size: .92rem; overflow-wrap: anywhere; }
#record .item.hot { border-left-color: var(--bad); background: var(--bad-soft, var(--surface2)); }
#record .item b { display: block; font: 600 .7rem var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
#record .item.hot b { color: var(--bad); }
.empty { color: var(--muted); font-size: .92rem; margin: 0; }
#log { max-height: 360px; overflow: auto; padding-top: 2px; margin: 0; }
#log:empty { display: none; }
#log code { display: block; background: none; border: 0; padding: 0; overflow-wrap: anywhere; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.kpi { border: 1px solid var(--grid); border-radius: var(--r-sm); padding: 8px 10px; min-width: 0; }
.kpi b { display: block; font: 600 1rem var(--mono); overflow-wrap: anywhere; } .kpi span { font: 500 .72rem var(--sans); color: var(--muted); }
.tries { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tries li { position: relative; padding: 8px 12px 8px 36px; border: 1px solid var(--axis); border-radius: var(--r-sm); font-size: .9rem; line-height: 1.35; }
.tries li::before { content: ""; position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; border: 1.5px solid var(--field); border-radius: 50%; }
.tries li.done { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 45%, var(--axis)); }
.tries li.done::before { content: "✓"; border-color: var(--good); background: var(--good); color: #fff; font: 700 10px/13px var(--mono); text-align: center; }

@media (prefers-reduced-motion: no-preference) {
  .dot.speaking, .dot.thinking, .dot.initializing { animation: pulse 1s ease-in-out infinite; }
  .line, #log > li, #record .item { animation: talk-in 220ms var(--ease) both; }
  @keyframes pulse { 50% { transform: scale(1.4); opacity: .6; } }
  @keyframes talk-in { from { opacity: 0; transform: translateY(6px); } }
}
@media (max-width: 640px) {
  .line-state { order: -1; border-radius: 0; }
  #talk { min-height: 360px; max-height: 62vh; overflow-y: auto; }
  .ph-dock { padding: 10px 12px 14px; border-radius: 0 0 18px 18px; }
  .proof { padding: 16px; }
  .stage-actions, .stage-actions button { width: 100%; }
}
.dot.paused { animation: none !important; opacity: .5; }
