/* Cosec Director web app — 17-series director register (dark ink ground).
   Voice-first, phone AND desktop. One responsive column, max 760px thread. */

#app { height: 100%; display: flex; flex-direction: column; }

.screen { flex: 1; min-height: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }

/* ---- shared bits ---------------------------------------------------------- */
.wordmark { font-family: var(--font-heading); font-weight: 800; letter-spacing: -0.02em; }
.wordmark .dot { color: var(--accent); }

.kicker {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent-text);
}

.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font-size: 15px; font-weight: 600; border-radius: var(--radius-pill);
  padding: 11px 20px; transition: background var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
  color: var(--text); background: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.secondary { background: var(--surface); border-color: var(--hairline-strong); }
.btn.secondary:hover:not(:disabled) { background: var(--surface-raised); }
.btn.ghost { color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface); color: var(--text); }
.btn.block { width: 100%; text-align: center; }

.field {
  width: 100%; background: var(--surface); color: var(--text);
  border: 1px solid var(--hairline-strong); border-radius: var(--radius-md);
  padding: 13px 15px; font-size: 16px; /* 16px: no iOS zoom-on-focus */
  font-family: inherit; transition: border-color var(--dur-fast);
}
.field:focus { outline: none; border-color: var(--accent); }
.err { color: var(--crit); font-size: 13px; min-height: 18px; margin-top: 6px; }

/* ---- sign-in -------------------------------------------------------------- */
#screen-signin { align-items: center; justify-content: center; padding: 24px; }
.signin-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  padding: 30px 26px; box-shadow: var(--shadow-card);
  animation: springIn var(--dur-spring) var(--ease-spring) both;
}
.signin-card h1 { font-size: 26px; margin-bottom: 4px; }
.signin-card .lede { color: var(--text-2); margin: 0 0 22px; font-size: 14px; }
.signin-card form { display: flex; flex-direction: column; gap: 4px; }
.signin-card label { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.signin-card .btn { margin-top: 12px; }
.code-input {
  letter-spacing: 0.4em; text-align: center; font-size: 22px;
  font-variant-numeric: tabular-nums; font-weight: 700;
}
.signin-sub { font-size: 12.5px; color: var(--text-3); margin-top: 16px; text-align: center; }
.link-btn {
  background: none; border: none; color: var(--accent-text); cursor: pointer;
  font: inherit; font-size: 12.5px; padding: 0; text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- top bar -------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 18px 12px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
  border-bottom: 1px solid var(--hairline); background: var(--bg);
}
.topbar .iconbtn { flex: none; }
.monogram {
  width: 38px; height: 38px; border-radius: var(--radius-md); flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 12.5px;
  letter-spacing: 0.04em; background: color-mix(in oklab, var(--company) 20%, transparent);
  color: var(--company);
}
.topbar .title { flex: 1; min-width: 0; }
.topbar .title h2 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title .sub {
  font-size: 12px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.iconbtn {
  appearance: none; background: transparent; border: none; cursor: pointer;
  color: var(--text-2); width: 40px; height: 40px; border-radius: var(--radius-pill);
  display: grid; place-items: center; transition: background var(--dur-fast), color var(--dur-fast);
}
.iconbtn:hover { background: var(--surface); color: var(--text); }
.iconbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.iconbtn svg { width: 21px; height: 21px; }
.iconbtn.on { color: var(--accent-text); background: var(--accent-tint); }

/* narrow phones: tighter chrome so the title keeps real estate; the icon
   buttons keep their full 40px hit area — only the gaps shrink */
@media (max-width: 480px) {
  .topbar { gap: 4px; padding-left: 10px; padding-right: 10px; }
  .topbar .monogram { width: 32px; height: 32px; font-size: 11px; margin-right: 4px; }
  .topbar .brand-logo { width: 32px; height: 32px; }
  .topbar .title { padding-right: 2px; }
}
@media (max-width: 360px) {
  .topbar .title .sub { display: none; }
}

/* ---- company picker ------------------------------------------------------- */
#screen-companies .scroll { overflow-y: auto; padding: 8px 18px 32px; }
.companies-wrap { max-width: 640px; margin: 0 auto; }
.hello { padding: 26px 2px 18px; }
.hello .kicker { display: block; margin-bottom: 8px; }
.hello h1 { font-size: 28px; line-height: 1.15; }
.hello p { color: var(--text-2); margin: 8px 0 0; }
.company-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 12px;
  cursor: pointer; color: var(--text);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast), background var(--dur-fast);
  animation: fadeUp var(--dur-base) var(--ease-out) both;
}
.company-card:hover { transform: translateY(-1px); border-color: var(--hairline-strong); background: var(--surface-raised); }
.company-card .cc-body { flex: 1; min-width: 0; }
.company-card .cc-name { font-family: var(--font-heading); font-weight: 700; font-size: 17px; }
.company-card .cc-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.company-card .cc-arrow { color: var(--text-3); font-size: 20px; }

/* ---- chat ----------------------------------------------------------------- */
#screen-chat { position: relative; }
.thread {
  flex: 1; min-height: 0; overflow-y: auto; padding: 22px 18px 12px;
  scroll-behavior: smooth;
}
.thread-inner { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.empty { padding: 20px 2px; animation: fadeUp var(--dur-base) var(--ease-out) both; }
.empty .kicker { display: block; margin-bottom: 10px; }
.empty h2 { font-size: 23px; line-height: 1.25; }
.suggestions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.suggestion {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; cursor: pointer; color: var(--text);
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 14px 16px; font-size: 15px; line-height: 1.4;
  transition: background var(--dur-fast), border-color var(--dur-fast);
  animation: fadeUp var(--dur-base) var(--ease-out) both;
}
.suggestion:hover { background: var(--surface-raised); border-color: var(--hairline-strong); }
.suggestion .arrow { color: var(--company); font-size: 16px; flex: none; }

.msg { display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.bubble {
  max-width: 84%; padding: 11px 15px; border-radius: 18px; font-size: 15px;
  line-height: 1.45; animation: springIn var(--dur-base) var(--ease-spring) both;
}
.msg.user .bubble {
  background: var(--company); color: #fff; border-bottom-right-radius: 6px;
}
.msg.assistant { align-items: stretch; }
.msg.assistant .answer { font-size: 16.5px; line-height: 1.62; white-space: pre-wrap; }
.msg.assistant .answer .cite {
  color: var(--accent-text); font-weight: 600; font-size: 0.72em;
  vertical-align: super; cursor: pointer; padding: 0 1px;
}
.via-tag {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 5px; display: inline-flex; gap: 5px; align-items: center;
}
.via-tag svg { width: 12px; height: 12px; }

.caret {
  display: inline-block; width: 8px; height: 1.05em; vertical-align: text-bottom;
  background: var(--accent); margin-left: 2px; border-radius: 1px;
  animation: caret 1s steps(1) infinite;
}
.thinking { display: inline-flex; gap: 5px; padding: 4px 0; }
.thinking span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: thinking 1.2s ease-in-out infinite;
}
.thinking span:nth-child(2) { animation-delay: .15s; }
.thinking span:nth-child(3) { animation-delay: .3s; }

/* citation chips */
.cites { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--accent-tint); color: var(--accent-tint-text);
  border: none; border-radius: var(--radius-pill); padding: 5px 11px;
  font-size: 11.5px; font-weight: 600; max-width: 100%;
}
.chip .chip-idx { font-variant-numeric: tabular-nums; opacity: .8; }
.chip .chip-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.chip:hover { filter: brightness(1.08); }

/* answer error / notes */
.note {
  font-size: 12.5px; color: var(--warn-text); background: var(--warn-tint);
  border-radius: 10px; padding: 8px 12px; margin-top: 10px; display: inline-block;
}

/* ---- composer ------------------------------------------------------------- */
.composer {
  border-top: 1px solid var(--hairline); background: var(--bg);
  padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 14px);
}
.composer-inner {
  max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px;
  position: relative; /* anchors the overflow menu */
}
.composer textarea {
  /* the input always wins the width fight: everything else is flex:none */
  flex: 1; min-width: 0; resize: none; max-height: 132px; min-height: 44px;
  background: var(--surface); color: var(--text); border: 1px solid var(--hairline-strong);
  border-radius: 22px; padding: 11px 15px; font-size: 16px; font-family: inherit;
  line-height: 1.4; transition: border-color var(--dur-fast);
}
.composer textarea::placeholder {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.composer textarea:focus { outline: none; border-color: var(--accent); }
.round-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; border: 1px solid var(--hairline-strong);
  background: var(--surface); color: var(--text-2);
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast), border-color var(--dur-fast);
}
.round-btn svg { width: 21px; height: 21px; }
.round-btn:active { transform: scale(.94); }
.round-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.round-btn.send { background: var(--company); color: #fff; border-color: transparent; }
.round-btn.send:disabled { opacity: .35; }
.round-btn.more[aria-expanded="true"] { background: var(--surface-raised); color: var(--text); }

/* overflow menu: secondary voice controls (hands-free + push-to-talk) */
.composer-menu {
  position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 30;
  width: min(320px, calc(100vw - 32px));
  background: var(--surface-raised); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 6px; box-shadow: var(--shadow-float);
  animation: springIn var(--dur-base) var(--ease-spring) both;
}
.composer-menu[hidden] { display: none; }
.menu-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  appearance: none; background: none; border: none; cursor: pointer;
  text-align: left; color: var(--text); padding: 10px 12px; border-radius: 10px;
  font-family: inherit; transition: background var(--dur-fast);
}
.menu-row:hover, .menu-row:focus-visible { background: var(--surface); outline: none; }
.menu-row .menu-ico { flex: none; width: 24px; display: grid; place-items: center; color: var(--text-2); }
.menu-row .menu-ico svg { width: 20px; height: 20px; }
.menu-row .menu-label { flex: 1; min-width: 0; }
.menu-row .menu-label strong { display: block; font-size: 14px; font-weight: 600; }
.menu-row .menu-label span { display: block; font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.menu-row .menu-check {
  flex: none; width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--hairline-strong); display: grid; place-items: center;
}
.menu-row .menu-check::after { content: "✓"; font-size: 12px; font-weight: 800; opacity: 0; }
.menu-row.on .menu-ico { color: var(--accent-text); }
.menu-row.on .menu-check {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.menu-row.on .menu-check::after { opacity: 1; }
.menu-row.recording .menu-ico { color: var(--crit); }

.trust-line {
  text-align: center; font-size: 10.5px; color: var(--text-3); margin-top: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-height: 700px) {
  .trust-line { display: none; }
}

/* ---- voice overlay (listening / thinking / speaking) --------------------- */
.voice-overlay {
  position: absolute; inset: 0; z-index: 20; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  padding: 32px; text-align: center;
  /* near-opaque ink so the state reads cleanly even where backdrop-filter
     is unavailable; the blur is a progressive enhancement on top */
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  animation: fadeUp var(--dur-base) var(--ease-out) both;
}
.voice-overlay.active { display: flex; }
.orb-wrap { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.orb {
  width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,
    color-mix(in oklab, var(--company) 85%, white 15%), var(--company));
  box-shadow: 0 0 40px color-mix(in oklab, var(--company) 45%, transparent);
  transition: transform var(--dur-base) var(--ease-out);
}
.orb-ring {
  position: absolute; inset: 20px; border-radius: 50%;
  border: 2px solid var(--company); opacity: 0;
}
.voice-overlay[data-state="listening"] .orb-ring { animation: ring 2s ease-out infinite; }
.voice-overlay[data-state="listening"] .orb-ring:nth-child(2) { animation-delay: .7s; }
.voice-overlay[data-state="listening"] .orb-ring:nth-child(3) { animation-delay: 1.4s; }
.voice-overlay[data-state="thinking"] .orb { animation: breathe 1.6s ease-in-out infinite; }
.voice-overlay[data-state="speaking"] .orb { animation: breathe 1s ease-in-out infinite; transform: scale(1.05); }
.voice-status { font-family: var(--font-heading); font-weight: 700; font-size: 21px; }
.voice-hint { color: var(--text-2); font-size: 14px; max-width: 300px; margin-top: -14px; }
.voice-transcript {
  color: var(--text); font-size: 16px; max-width: 420px; min-height: 24px;
  line-height: 1.5;
}
.voice-actions { display: flex; gap: 12px; margin-top: 4px; }

@media (prefers-reduced-motion: reduce) {
  .orb-ring { animation: none !important; opacity: .25; }
  .voice-overlay .orb { animation: none !important; }
}

/* ---- provenance sheet ----------------------------------------------------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.5);
  display: none; align-items: flex-end; justify-content: center;
}
.sheet-backdrop.active { display: flex; animation: fadeUp var(--dur-base) var(--ease-out) both; }
.sheet {
  width: 100%; max-width: 620px; background: var(--surface-raised);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 22px 22px calc(env(safe-area-inset-bottom,0px) + 22px);
  max-height: 78vh; overflow-y: auto; box-shadow: var(--shadow-overlay);
  animation: springIn var(--dur-spring) var(--ease-spring) both;
}
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--hairline-strong); margin: 0 auto 16px; }
.sheet h3 { font-size: 19px; }
.sheet .meta { font-size: 12px; color: var(--text-2); margin: 6px 0 14px; }
.sheet blockquote { font-size: 14.5px; }
.sheet .close-row { margin-top: 18px; text-align: right; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom,0px) + 22px);
  transform: translateX(-50%) translateY(20px); z-index: 60;
  background: var(--surface-raised); color: var(--text); border: 1px solid var(--hairline);
  border-radius: var(--radius-pill); padding: 10px 18px; font-size: 13.5px;
  box-shadow: var(--shadow-float); opacity: 0; pointer-events: none;
  transition: opacity var(--dur-base), transform var(--dur-base) var(--ease-spring);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* thread drawer */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); display: none;
}
.drawer-backdrop.active { display: block; animation: fadeUp var(--dur-base) var(--ease-out) both; }
.drawer {
  position: absolute; top: 0; left: 0; bottom: 0; width: min(320px, 82vw);
  background: var(--surface); border-right: 1px solid var(--hairline);
  padding: max(16px, env(safe-area-inset-top)) 14px 16px; overflow-y: auto;
  transform: translateX(-100%); animation: slideIn var(--dur-spring) var(--ease-spring) forwards;
}
@keyframes slideIn { to { transform: none; } }
.drawer h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin: 8px 6px 12px; }
.thread-item {
  display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  color: var(--text); padding: 11px 12px; border-radius: 10px; font-size: 14px;
  transition: background var(--dur-fast);
}
.thread-item:hover { background: var(--surface-raised); }
.thread-item .ti-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-item .ti-time { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.drawer .newthread { margin: 4px 6px 14px; }

/* desktop niceties */
@media (min-width: 900px) {
  .thread { padding: 30px 24px 14px; }
  .hello h1 { font-size: 32px; }
}

/* ---- answer delivery actions ("email me this" / "text me this") ---- */
.answer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--hairline-strong);
  color: var(--text-2); border-radius: var(--radius-pill);
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.mini-btn:hover { background: var(--surface-raised); color: var(--text); border-color: var(--company); }
.mini-btn svg { width: 15px; height: 15px; }

/* ---- requests sheet (register + agenda capture) ---- */
.req-menu { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 2px; }
.req-opt {
  text-align: left; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-md); padding: 14px 16px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
}
.req-opt:hover { background: var(--surface-raised); border-color: var(--hairline-strong); }
.req-opt strong { font-size: 15px; color: var(--text); }
.req-opt span { font-size: 12.5px; color: var(--text-2); }
.req-label { display: block; font-size: 12.5px; color: var(--text-2); margin: 14px 0 6px; }
.req-check {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--text-2); margin: 14px 0 0; cursor: pointer;
}
.req-check input { width: 16px; height: 16px; }
.sheet .close-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
/* ---- per-company logo (branding overlay) --------------------------------- */
.brand-logo {
  width: 38px; height: 38px; border-radius: var(--radius-md); flex: none;
  object-fit: contain; background: color-mix(in oklab, var(--company) 14%, transparent);
  padding: 3px;
}

/* ---- resolutions to sign -------------------------------------------------- */
.res-sheet { max-height: 82vh; overflow-y: auto; }
.res-empty { color: var(--text-2); font-size: 14px; padding: 8px 2px 4px; }
.res-item {
  border: 1px solid var(--hairline); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 12px; background: var(--surface);
}
.res-item .res-title { font-family: var(--font-heading); font-weight: 700; font-size: 15.5px; }
.res-item .res-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.res-item .res-summary { font-size: 13.5px; color: var(--text-2); margin: 8px 0 12px; line-height: 1.5; }
.res-tally { display: flex; gap: 12px; font-size: 12px; color: var(--text-2); margin-bottom: 12px; }
.res-tally .for { color: var(--ok); }
.res-tally .against { color: var(--crit); }
.res-votes { display: flex; gap: 10px; }
.vote-btn {
  flex: 1; appearance: none; cursor: pointer; border-radius: var(--radius-md);
  padding: 11px 12px; font-weight: 700; font-size: 14px; font-family: var(--font-heading);
  border: 1px solid var(--hairline-strong); background: var(--surface-raised); color: var(--text);
  transition: transform var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
}
.vote-btn:active { transform: translateY(1px); }
.vote-btn.for:hover { border-color: var(--ok); color: var(--ok); }
.vote-btn.against:hover { border-color: var(--crit); color: var(--crit); }
.vote-btn:disabled { opacity: .5; cursor: default; }
.res-signed {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  padding: 9px 12px; border-radius: var(--radius-md);
}
.res-signed.for { background: var(--ok-tint); color: var(--ok); }
.res-signed.against { background: var(--crit-tint); color: var(--crit-text); }
.res-signed.abstain { background: var(--surface-raised); color: var(--text-2); }

/* ---- signature capture ---------------------------------------------------- */
.sig-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.sig-tab {
  appearance: none; cursor: pointer; border: 1px solid var(--hairline-strong);
  background: var(--surface); color: var(--text-2); border-radius: var(--radius-pill);
  padding: 6px 16px; font-size: 13px; font-weight: 600;
}
.sig-tab.on { background: var(--accent-tint); color: var(--accent-tint-text); border-color: transparent; }
.sig-canvas {
  width: 100%; height: 200px; border: 1px dashed var(--hairline-strong);
  border-radius: var(--radius-md); background: var(--surface-raised); touch-action: none;
  display: block;
}
#sigDrawPane .link-btn { margin-top: 8px; }
.sig-preview {
  margin-top: 12px; min-height: 60px; display: grid; place-items: center;
  font-family: "Instrument Sans", cursive; font-size: 30px; font-style: italic;
  color: var(--text); border: 1px dashed var(--hairline); border-radius: var(--radius-md);
}
.confirm-sheet .confirm-body { font-size: 14.5px; color: var(--text-2); line-height: 1.55; margin: 6px 0 16px; }
.confirm-sheet .confirm-body strong { color: var(--text); }

/* ---- live voice screen (full-duplex streaming session) -------------------- */
/* Orb states (voice-pwa-plan + mobile-app-plan §Design language):
   idle sits dimmed and static (mic gated — tap to talk), listening pulses
   with the mic level (--mic-level, set by app.js from the 100ms PCM
   frames), thinking spins a conic shimmer while the agent works, speaking
   modulates with the output level (--out-level, posted by the pcm-player
   worklet). */
.live-voice {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  align-items: center; gap: 22px; text-align: center;
  padding: 24px 24px calc(env(safe-area-inset-bottom, 0px) + 24px);
}
.lv-orb {
  appearance: none; background: none; border: none; cursor: pointer;
  position: relative; width: 148px; height: 148px; flex: none; margin-top: 5vh;
  display: grid; place-items: center; -webkit-tap-highlight-color: transparent;
}
.lv-orb .orb-ring {
  position: absolute; inset: 26px; border-radius: 50%;
  border: 2px solid var(--company); opacity: 0;
}
.lv-core {
  display: block; width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,
    color-mix(in oklab, var(--company) 85%, white 15%), var(--company));
  box-shadow: 0 0 44px color-mix(in oklab, var(--company) 45%, transparent);
  transition: transform 90ms linear, opacity var(--dur-base) var(--ease-out),
    filter var(--dur-base) var(--ease-out);
}
.lv-halo {
  position: absolute; inset: 10px; border-radius: 50%; display: block; opacity: 0;
  background: conic-gradient(from 0deg, transparent 0 68%,
    color-mix(in oklab, var(--company) 75%, transparent) 92%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
  transition: opacity var(--dur-base) var(--ease-out);
}
#screen-voice[data-state="connecting"] .lv-core,
#screen-voice[data-state="reconnecting"] .lv-core { opacity: .55; animation: breathe 2.4s ease-in-out infinite; }
/* idle = disarmed: dimmed and STATIC so "mic engaged" (listening's pulse +
   full glow) is unmistakable at a glance across the room */
#screen-voice[data-state="idle"] .lv-core {
  opacity: .5; filter: saturate(.7);
  box-shadow: 0 0 18px color-mix(in oklab, var(--company) 22%, transparent);
}
#screen-voice[data-state="listening"] .orb-ring { animation: ring 2s ease-out infinite; }
#screen-voice[data-state="listening"] .orb-ring:nth-child(2) { animation-delay: .7s; }
#screen-voice[data-state="listening"] .orb-ring:nth-child(3) { animation-delay: 1.4s; }
#screen-voice[data-state="listening"] .lv-core { transform: scale(calc(1 + var(--mic-level, 0) * 0.3)); }
#screen-voice[data-state="thinking"] .lv-halo { opacity: 1; animation: lvSpin 1.3s linear infinite; }
#screen-voice[data-state="thinking"] .lv-core { animation: shimmer 1.6s ease-in-out infinite; }
#screen-voice[data-state="speaking"] .lv-core { transform: scale(calc(1.04 + var(--out-level, 0) * 0.22)); }
#screen-voice[data-state="unavailable"] .lv-core,
#screen-voice[data-state="unsupported"] .lv-core { filter: grayscale(.9); opacity: .35; box-shadow: none; }
@keyframes lvSpin { to { transform: rotate(360deg); } }

.lv-status { font-family: var(--font-heading); font-weight: 700; font-size: 21px; }
.lv-hint { color: var(--text-2); font-size: 14px; max-width: 320px; margin-top: -12px; }

/* mode pill: tap-to-talk (default) vs hands-free open mic */
.lv-mode {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center;
  gap: 7px; border: 1px solid var(--hairline-strong); background: var(--surface);
  color: var(--text-2); border-radius: var(--radius-pill); padding: 6px 14px;
  font-size: 13px; font-weight: 600; -webkit-tap-highlight-color: transparent;
}
.lv-mode svg { width: 15px; height: 15px; }
.lv-mode.on { background: var(--accent-tint); color: var(--accent-tint-text); border-color: transparent; }
#screen-voice[data-state="unavailable"] .lv-mode,
#screen-voice[data-state="unsupported"] .lv-mode { display: none; }

/* captions: interim (muted, in place) -> final (solid), then the agent's
   reply accumulating below so the answer is readable while it's spoken */
.lv-captions {
  width: 100%; max-width: 560px; flex: 1; min-height: 0; overflow-y: auto;
  text-align: left; display: flex; flex-direction: column; gap: 14px;
  padding-bottom: 8px;
}
.lv-user { color: var(--text); font-size: 16px; line-height: 1.5; }
.lv-user.interim { color: var(--text-3); }
.lv-user:empty, .lv-reply:empty { display: none; }
.lv-reply { font-size: 16.5px; line-height: 1.62; white-space: pre-wrap; }
.lv-reply .cite {
  color: var(--accent-text); font-weight: 600; font-size: 0.72em;
  vertical-align: super; cursor: pointer; padding: 0 1px;
}
#lvExtras .cites { margin-top: 2px; }
.lv-proposal {
  font-size: 12.5px; color: var(--proposal-text); background: var(--proposal-tint);
  border-radius: 10px; padding: 8px 12px; margin-top: 8px; display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
  #screen-voice .lv-core, #screen-voice .lv-halo { animation: none !important; }
  #screen-voice .orb-ring { animation: none !important; opacity: .25; }
}
