/* Terminal Foundry: landing page and owner dashboard.
   Built on the light, editorial look of granola.ai and cal.com: white and warm off-white surfaces,
   a serif display face, plain sans for everything else, hairline borders and pill buttons.
   Layout: a landing page with a two-column hero and ruled sections; a dashboard with a left sidebar. */
:root {
  color-scheme: light;
  --bg: #ffffff; --paper: #f7f7f2;
  --ink: #1f1f1c; --muted: #6f6f69; --faint: #96958d;
  --line: #e7e5dc; --line-strong: #d3d1c6;
  --green: #24402a; --green-hover: #1b3221; --on-green: #ffffff;
  --lime: #d3f580; --lime-soft: #eef8cf;
  --ok: #1a7f37; --ok-bg: #eaf6ec; --ok-border: #bfe3c6;
  --warn: #8a5a00; --warn-bg: #fff6e0; --warn-border: #f0d9a0; --warn-dot: #f5a623;
  --danger: #b3261e; --danger-bg: #fdecec; --danger-border: #f3c4c4;
  --ring: rgb(31 31 28 / .14);
  --shadow: 0 1px 2px rgb(31 31 28 / .04), 0 8px 24px -12px rgb(31 31 28 / .10);
  --shadow-lg: 0 2px 4px rgb(31 31 28 / .05), 0 30px 60px -24px rgb(31 31 28 / .32);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%236f6f69' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5'/%3E%3C/svg%3E");
  --serif: "Iowan Old Style", "Sitka Heading", "Sitka Display", Cambria, "Palatino Linotype", Georgia, serif;
  --sans: "Inter Variable", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --side: 248px;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 84px; }
body { margin: 0; min-width: 260px; font-size: .9375rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, blockquote, pre { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { font: 400 clamp(2rem, 3.4vw, 2.75rem)/1.08 var(--serif); letter-spacing: -.02em; }
h2 { font-size: 1.0625rem; line-height: 1.3; font-weight: 600; letter-spacing: -.015em; }
h3 { font-size: .9375rem; line-height: 1.35; font-weight: 600; letter-spacing: -.01em; }
::selection { background: var(--lime); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1:focus, h2:focus, h3:focus, main:focus { outline: none; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; inset: 12px auto auto 12px; z-index: 9; padding: 10px 16px; border-radius: 999px; color: var(--on-green); background: var(--green); }
svg { width: 1.125rem; height: 1.125rem; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; max-width: 100%; padding: 8px 18px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--ink); font-size: .9375rem; line-height: 1.3; font-weight: 500; text-decoration: none; text-align: center; overflow-wrap: anywhere; }
.btn:hover { background: var(--paper); border-color: var(--faint); }
.btn.primary, .btn.ink { background: var(--green); border-color: var(--green); color: var(--on-green); }
.btn.primary:hover, .btn.ink:hover { background: var(--green-hover); border-color: var(--green-hover); }
.btn.danger { color: var(--danger); border-color: var(--danger-border); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger-border); }
button:disabled { opacity: .5; cursor: default; }
.text-button { padding: 4px 0; border: 0; background: transparent; font-size: .875rem; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.text-button:hover { text-decoration-color: currentColor; }
label:not(.sr-only, .item-main), .pair-controls > label { display: block; font-size: .875rem; font-weight: 500; line-height: 1.5; }
.field-action { display: flex; align-items: stretch; gap: 8px; margin-top: 6px; }
.field-action > .btn { flex: none; }
input:not([type=checkbox], [type=radio]), select, textarea { width: 100%; min-width: 0; padding: 9px 14px; line-height: 1.45; border: 1px solid var(--line-strong); border-radius: 12px; background-color: var(--bg); font-size: .9375rem; }
select { appearance: none; padding-right: 36px; background-image: var(--chevron); background-repeat: no-repeat; background-position: right 14px center; background-size: 10px 7px; }
input:not([type=checkbox], [type=radio], :disabled, [readonly]):hover, select:not(:disabled):hover, textarea:not(:disabled):hover { border-color: var(--faint); }
input:not([type=checkbox], [type=radio]):focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); background-color: var(--paper); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; margin-top: 6px; }
.field-note, .optional, .review-meta { color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.field-note { margin-top: 6px; }
.optional { font-weight: 400; }
.error { margin-top: 10px; color: var(--danger); font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
summary { position: relative; width: fit-content; padding-left: 18px; list-style: none; font-weight: 500; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; position: absolute; left: 3px; top: 50%; width: 6px; height: 6px; margin-top: -4px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); }
details[open] > summary::before { transform: translateY(-1px) rotate(45deg); }

/* ---------- Header: a floating rounded bar on the landing page ---------- */
.mast { position: sticky; top: 12px; z-index: 5; width: min(1160px, calc(100% - 32px)); margin: 12px auto 0; border: 1px solid var(--line); border-radius: 999px; background: rgb(255 255 255 / .88); box-shadow: var(--shadow); }
@supports (backdrop-filter: blur(1px)) { .mast { backdrop-filter: saturate(180%) blur(14px); } }
.mast-inner { min-height: 54px; display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); padding-inline: 20px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; white-space: nowrap; font-size: 1rem; font-weight: 500; letter-spacing: -.015em; color: var(--muted); }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand strong { font-weight: 600; color: var(--ink); }
.workspace-nav { display: flex; gap: 4px; }
.workspace-nav a { display: inline-flex; align-items: center; gap: 9px; padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; }
.workspace-nav a svg { width: 16px; height: 16px; flex: none; }
.workspace-nav a:hover { color: var(--ink); background: var(--paper); }
.workspace-nav a[aria-current] { color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.mast-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.connection { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.connection::before, .hero-state i { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.connection[data-state="live"]::before, .hero-state[data-live="true"] i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.connection[data-state="down"]::before { background: var(--warn-dot); box-shadow: 0 0 0 3px var(--warn-bg); }
.account { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); background: var(--bg); }
.account:hover, .account[aria-current] { color: var(--ink); border-color: var(--faint); }
main { width: min(1160px, 100%); margin-inline: auto; padding: clamp(20px, 3vw, 36px) clamp(16px, 3.5vw, 40px) 72px; }

/* ---------- Landing page ---------- */
.lp-hero { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); align-items: center; gap: clamp(32px, 5vw, 72px); padding-block: clamp(28px, 6vw, 72px) clamp(40px, 7vw, 88px); }
.lp-title { font-size: clamp(2.6rem, 5.4vw, 4.25rem); line-height: 1.02; }
.lp-sub { margin-top: 20px; max-width: 32rem; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); line-height: 1.45; }
.signin-card { margin-top: 30px; max-width: 430px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); box-shadow: var(--shadow); }
.signin-message { margin-top: 4px; color: var(--muted); }
#google-signin:not(:empty) { margin-top: 18px; max-width: 100%; }
/* Google's button only shows while the sign-in form is offered. */
#gate:has(#session-form[hidden]) #google-signin { display: none; }
.session-form { margin-top: 16px; }
.code-signin-options > summary { margin-top: 14px; padding: 4px 0 4px 18px; color: var(--muted); font-size: .875rem; }
.code-signin-options:has(> summary:not([hidden])) .session-form { margin-top: 10px; }
.signin-help { margin-top: 12px; }
.signin-help > summary { color: var(--muted); font-size: .8125rem; }
#reconnect, #enter-studio { margin-top: 18px; }
/* The picture: a call being transcribed, and the review it leads to. */
.lp-showcase { position: relative; min-height: clamp(380px, 46vw, 540px); }
.lp-art { position: absolute; border-radius: 6px; }
.lp-art-lime { left: 0; top: 16%; width: 44%; height: 66%; background: var(--lime); }
.lp-art-photo { right: 0; top: 0; width: 60%; height: 76%; background: #101911 url('/ui-handset.webp') center / cover no-repeat; }
.lp-window { position: absolute; left: 12%; top: 8%; bottom: 10%; width: 66%; padding: 16px 20px 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow-lg); }
.lp-window-bar { display: flex; gap: 7px; }
.lp-window-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.lp-window-bar i:nth-child(2) { background: #febc2e; }
.lp-window-bar i:nth-child(3) { background: #28c840; }
.lp-window-title { margin-top: 22px; font: 400 clamp(1.2rem, 2vw, 1.5rem)/1.2 var(--serif); letter-spacing: -.01em; }
.lp-lines { list-style: none; margin: 18px 0 0; padding: 0; font-size: .8125rem; line-height: 1.45; }
.lp-lines li + li { margin-top: 12px; }
.lp-lines b { display: block; color: var(--muted); font-size: .6875rem; font-weight: 500; }
.lp-live { position: absolute; left: 20px; bottom: 16px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); box-shadow: var(--shadow); color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.lp-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.lp-result { position: absolute; right: 0; bottom: 0; width: 47%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: var(--shadow-lg); font-size: .8125rem; }
.lp-result-label { color: var(--muted); font-size: .6875rem; font-weight: 500; }
.lp-result-row { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.lp-result-row i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); translate: 0 -1px; }
.lp-result-row i.ok { background: var(--ok); }
.lp-result-badge { width: fit-content; margin-top: 12px; padding: 2px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: .75rem; font-weight: 500; }
.lp-statement { padding-block: clamp(56px, 10vw, 132px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; font: 400 clamp(3rem, 10.5vw, 7.75rem)/1 var(--serif); letter-spacing: -.03em; text-wrap: balance; }
.lp-steps { padding-block: clamp(48px, 8vw, 112px); }
.lp-step-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); column-gap: clamp(24px, 4vw, 56px); }
.lp-step-list li { padding: 28px 0; border-top: 1px solid var(--line); }
.lp-step-list h3 { margin: 0 0 8px; font: 400 1.625rem/1.2 var(--serif); letter-spacing: -.01em; }
.lp-step-list li > p:last-child { max-width: 48ch; font-size: 1.0625rem; line-height: 1.5; }
.lp-foot { padding-top: 32px; color: var(--muted); font-size: .875rem; text-align: center; }

/* ---------- Dashboard shell: the header becomes a left sidebar once signed in ---------- */
@media (min-width: 900px) {
  body:has(#workspace:not([hidden])) .mast { position: fixed; inset: 0 auto 0 0; top: 0; width: var(--side); margin: 0; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: var(--paper); box-shadow: none; backdrop-filter: none; }
  body:has(#workspace:not([hidden])) .mast-inner { height: 100%; flex-direction: column; align-items: stretch; gap: 4px; padding: 20px 14px 16px; }
  body:has(#workspace:not([hidden])) .brand { padding: 4px 8px 18px; }
  body:has(#workspace:not([hidden])) .workspace-nav { flex-direction: column; gap: 2px; }
  body:has(#workspace:not([hidden])) .workspace-nav a { padding: 9px 10px; border-radius: 10px; }
  body:has(#workspace:not([hidden])) .workspace-nav a:hover { background: rgb(31 31 28 / .05); }
  body:has(#workspace:not([hidden])) .workspace-nav a[aria-current] { background: var(--bg); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
  body:has(#workspace:not([hidden])) .mast-end { margin: auto 0 0; justify-content: space-between; padding: 14px 8px 0; border-top: 1px solid var(--line); }
  body:has(#workspace:not([hidden])) main { width: auto; max-width: none; margin-left: var(--side); padding: clamp(24px, 3vw, 44px) clamp(24px, 4vw, 56px) 80px; }
  body:has(#workspace:not([hidden])) #workspace { max-width: 1040px; margin-inline: auto; }
  html:has(#workspace:not([hidden])) { scroll-padding-top: 24px; }
}

/* ---------- Studio ---------- */
.eyebrow { color: var(--muted); font-size: .875rem; font-weight: 500; line-height: 1.5; }
.invite-copy > .eyebrow { margin-bottom: 8px; }
.hero-lede { margin-top: 12px; max-width: 34rem; color: var(--muted); font-size: 1.0625rem; line-height: 1.5; }
.hero-states, .button-row, .live-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.hero-states { margin-top: 22px; }
.hero-state { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .8125rem; line-height: 1.4; overflow-wrap: anywhere; }
.project-state { color: var(--ink); background: var(--paper); }
.invite-stage { border: 1px solid var(--line); border-radius: 20px; background: var(--bg); box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(220px, .7fr); align-items: center; gap: clamp(24px, 4vw, 56px); padding: clamp(24px, 4vw, 48px); }
.invite-copy { min-width: 0; }
.invite-copy h1 { font-size: clamp(2.2rem, 3.8vw, 3.1rem); }
.invite-copy #invite-controls { margin-top: 20px; }
.invite-copy .arrival-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.arrival-note, .arrival-feedback, .arrival-time { color: var(--muted); font-size: .8125rem; line-height: 1.45; overflow-wrap: anywhere; }
.invite-copy .arrival-feedback:not(:empty) { margin-block: 6px 10px; }
.invite-code { justify-self: center; display: grid; justify-items: center; gap: 12px; min-width: 0; width: min(100%, 280px); }
/* The private QR stays on an opaque white surface. */
.qr-tile { display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.qr-tile > * { grid-area: 1 / 1; }
#qr-status:empty, .qr-tile:has(#invite-qr[hidden]):has(#qr-status:empty) { display: none; }
#invite-qr, #projection-qr { display: block; max-width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; }
#invite-qr { width: 100%; }
#qr-status { color: var(--muted); font-size: .8125rem; text-align: center; }
.qr-button svg { width: 15px; height: 15px; }
/* Full-screen code for showing to a room. */
.qr-dialog { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; padding: 0; background: var(--paper); color: var(--ink); }
.qr-dialog::backdrop { background: var(--paper); }
.qr-projection { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 2vh, 22px); padding: 14px; }
.qr-projection h2 { font: 400 clamp(1.75rem, 4.4vw, 3.25rem)/1.1 var(--serif); letter-spacing: -.02em; text-align: center; }
#projection-qr { width: min(92vw, calc(100dvh - 178px)); background: #fff; padding: clamp(6px, 1.2vmin, 18px); border: 1px solid var(--line); border-radius: 18px; }
.qr-dialog:has(#projection-local-note:not([hidden])) #projection-qr { width: min(92vw, calc(100dvh - 219px)); }
#projection-local-note { margin: 0; }
.projection-actions { display: flex; align-items: center; gap: 20px; }
.projection-actions label { color: var(--muted); font-weight: 400; cursor: pointer; }
.projection-actions input { accent-color: var(--green); vertical-align: middle; }
.studio-settings, .one-call-options { margin-top: 16px; padding: 14px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.studio-settings { background: var(--paper); }
.studio-settings > summary, .one-call-options > summary { width: 100%; }
.setup-grid, .capture-grid { display: grid; gap: 16px; margin-top: 16px; grid-template-columns: 1fr 1fr; }
.panel, .review-block, .review-empty { min-width: 0; padding: clamp(18px, 2.2vw, 26px); background: var(--bg); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.panel-heading h2, .panel-heading h3 { font-size: 1rem; line-height: 1.35; font-weight: 600; letter-spacing: -.01em; }
.tile-icon { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--green); background: var(--lime-soft); }
.tile-icon svg { width: 16px; height: 16px; }
.count, .chip { padding: 1px 9px; border-radius: 999px; font-size: .75rem; font-weight: 500; line-height: 1.6; font-variant-numeric: tabular-nums; }
.count { margin-left: auto; color: var(--muted); background: var(--paper); }
.chip { color: var(--ok); background: var(--ok-bg); }
.timer { color: var(--muted); font: .875rem var(--mono); font-variant-numeric: tabular-nums; }
.sub, .page-intro { color: var(--muted); line-height: 1.55; }
.standard-form { margin-top: 16px; }
.standard-form .field-action { flex-wrap: wrap; }
.standard-form select { flex: 1 1 215px; }
.mac-launch { margin-top: 14px; }
.mac-call-help { margin-top: 10px; max-width: 30rem; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.mac-call-help strong { color: var(--ink); font-weight: 600; }
.mac-setup { margin-top: 16px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.mac-setup-grid { display: grid; grid-template-columns: 1fr; gap: 20px; padding: 14px 0 0; }
.mac-setup-grid > div { min-width: 0; }
.mac-device-heading, .mac-devices li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mac-devices { list-style: none; margin: 6px 0; padding: 0; }
.mac-devices li { padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.mac-devices button { flex: none; }
.mac-code-result, #phone-line-options .arrival-note { margin-top: 14px; }
#mac-code { font-family: var(--mono); }
.incoming-preference { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; margin-top: 7px; }
.incoming-preference .field-note { margin: 0; }
.one-call-body { max-width: 600px; margin-top: 14px; }
#one-call-indicator { color: var(--ok); }
.inline-options { margin-top: 12px; }
.inline-options[open] > input { margin-top: 8px; }
.arm-state { margin: 14px 0 0; padding: 9px 14px; border: 1px solid var(--ok-border); border-radius: 12px; background: var(--ok-bg); font: .8125rem/1.5 var(--mono); overflow-wrap: anywhere; }
#disarm-btn { min-height: 32px; margin-top: 8px; padding: 5px 14px; font-size: .875rem; }
.room-action { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding-top: 14px; }
.room-action p { margin: 0; flex: 1; min-width: 135px; }
.room-card, .viewing { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 16px 0 0; }
.room-card { background: var(--lime-soft); border-color: #d7e8a6; }
.room-card h2, .viewing h3 { margin-block: 3px; }
.viewing { padding: 14px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.pair-controls { width: min(52%, 470px); }
.pair-controls > .btn { margin-bottom: 12px; }
.pair-controls input { font-family: var(--mono); font-size: .75rem; }
.ring-banner, .studio-build, .connection-notice { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 16px; overflow-wrap: anywhere; }
.ring-banner, .connection-notice { margin-bottom: 14px; background: var(--warn-bg); border-color: var(--warn-border); }
.ring-banner { font-weight: 500; }
.ring-banner p::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: var(--warn-dot); }
.studio-build { margin-top: 16px; background: var(--bg); box-shadow: var(--shadow); }
.ring-banner .btn, .studio-build .btn { flex: none; }

/* ---------- Call notes ---------- */
.section-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: clamp(32px, 4.5vw, 56px); padding-top: 28px; border-top: 1px solid var(--line); }
.section-bar h2 { margin: 4px 0; font: 400 clamp(1.6rem, 2.6vw, 2rem)/1.15 var(--serif); letter-spacing: -.02em; }
.manual-box { margin-top: 14px; }
.manual-form { max-width: 480px; margin: 12px 0; }
.capture-grid { grid-template-columns: 1.14fr 1fr; }
.empty, .review-empty p { color: var(--muted); line-height: 1.55; }
.empty { padding: 0 0 18px; }
.transcript { max-height: 320px; overflow: auto; }
.transcript, .review-diff, #review-content pre { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.lines, .items, .calls { margin: 0; padding: 0; list-style: none; }
.line { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; padding: 12px 0; word-break: break-word; }
.line:first-child { padding-top: 0; }
.line + .line, .item + .item { border-top: 1px solid var(--line); }
.line time, .tag, .when, .call-meta, .item-meta { color: var(--muted); font-size: .75rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.line time { font-family: var(--mono); }
.who { font-size: .875rem; font-weight: 600; }
.line p { grid-column: 1 / -1; line-height: 1.55; white-space: pre-wrap; }
.composer { border-top: 1px solid var(--line); padding-top: 14px; }
.composer-row, .composer-foot, .add, .speaker { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.composer-row { margin-bottom: 12px; }
.speaker { gap: 2px; margin: 0; padding: 3px; border: 0; border-radius: 999px; background: var(--paper); }
.speaker label { position: relative; cursor: pointer; }
.speaker input { position: absolute; opacity: 0; }
.speaker span { display: block; padding: 4px 14px; border-radius: 999px; color: var(--muted); font-size: .875rem; font-weight: 500; }
.speaker input:checked + span { color: var(--ink); background: var(--bg); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.speaker input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 1px; }
.mic { min-height: 32px; padding: 4px 14px; font-size: .875rem; }
.mic[aria-pressed=true] { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.composer-foot { justify-content: space-between; flex-wrap: nowrap; }
.composer-foot p { max-width: 335px; }
.add { border-top: 1px solid var(--line); padding-top: 14px; }
.add select { flex: none; width: auto; }
.add input { flex: 1 1 9rem; }
.add .btn, .composer-foot .btn { flex: none; }
.group { padding: 0 0 16px; }
.group h3 { display: flex; gap: 6px; align-items: center; padding-bottom: 4px; color: var(--muted); font-size: .875rem; font-weight: 500; letter-spacing: 0; }
.group .n { font-size: .75rem; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; }
.item-main { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.item input { accent-color: var(--green); flex: none; margin-top: 4px; }
.item-text { display: grid; }
.item-title, .call-title { overflow-wrap: anywhere; }
.item.done .item-title { text-decoration: line-through; color: var(--muted); }
.item-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.del { padding: 4px 10px; border: none; border-radius: 999px; background: transparent; color: var(--muted); font-size: .8125rem; }
.del:hover { color: var(--danger); background: var(--danger-bg); }

/* ---------- Interior pages ---------- */
.interior { padding-top: 8px; }
.interior > h1 { margin-top: 6px; font-size: clamp(2.2rem, 3.8vw, 3.1rem); }
.page-intro { margin: 10px 0 26px; font-size: 1.0625rem; }
.access-panel { margin-top: 22px; max-width: 560px; }
.access-panel .sub { margin: 6px 0 16px; }
.call { width: 100%; display: grid; gap: 3px; padding: 13px 0; text-align: left; border: none; background: transparent; }
.calls li:first-child .call { padding-top: 0; }
.calls li + li { border-top: 1px solid var(--line); }
.call:hover .call-title { text-decoration: underline; text-underline-offset: 3px; }
.call-title { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.history-detail { margin-bottom: 16px; }
.history-detail-head,.history-detail-foot { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 18px; }
.history-detail-head h2 { margin-top: 4px; overflow-wrap: anywhere; }
.history-detail-status { font-size: 1.05rem; font-weight: 650; margin: 18px 0 8px; }
.history-detail-reason { margin: 5px 0; font-weight: 530; overflow-wrap: anywhere; }
.history-detail .sub { margin-block: 6px; }
.history-lines:not(:empty) { max-height: min(52vh,34rem); overflow-y: auto; padding: 4px 10px; margin-top: 13px; border: 1px solid var(--line); border-radius: 8px; }
.history-lines:empty { display: none; }
.history-detail-foot { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; align-items: center; }
.history-detail-foot .eyebrow { margin-bottom: 2px; }
.history-transcript-label { font-weight: 620; }
.history-build-label { color: var(--muted); font-size: .82rem; }
.history-row-action { width: fit-content; margin-top: 3px; color: var(--green); font-size: .83rem; text-decoration: underline; text-underline-offset: 3px; }
#review-content { min-width: 0; display: grid; gap: 14px; }
#review-content > * { min-width: 0; }
.review-back { margin-bottom: 14px; }
.review-heading, .review-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-heading { font-size: 1.0625rem; letter-spacing: -.015em; }
.review-status { display: inline-flex; margin-top: 9px; padding: 1px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--muted); font-size: .75rem; font-weight: 500; line-height: 1.6; }
.review-status[data-status="ready"] { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); }
.review-status[data-status="review_required"] { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.review-status[data-status="failed"] { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.review-empty p, .review-meta, .review-actions, .review-verification { margin-top: 9px; }
.review-items, .review-files { padding-left: 18px; overflow-wrap: anywhere; }
.review-items, .review-files, .review-disclosure[open] > :last-child { margin-top: 10px; }
.review-items li + li { margin-top: 14px; }
.review-quote { margin: 8px 0; padding: 8px 14px; border-left: 2px solid var(--line-strong); color: var(--muted); }
.review-quote footer { margin-top: 3px; font-size: .75rem; }
.review-diff, #review-content pre { max-width: 100%; max-height: 420px; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: .8125rem/1.6 var(--mono); tab-size: 2; }
#review-content details { margin-top: 12px; }
#review-content :is(p, li, blockquote, code) { overflow-wrap: anywhere; }
#review-content h3 { margin-top: 0; }
.review-jobs { list-style: none; padding: 0; margin-top: 9px; }
.review-jobs .btn { width: 100%; margin: 4px 0; border-radius: 12px; text-align: left; justify-content: space-between; }
.review-jobs .btn[aria-current] { background: var(--paper); border-color: var(--faint); }
.review-jobs .review-status { margin: 0; }

/* ---------- Smaller screens ---------- */
@media (max-width: 899px) {
  .workspace-nav a svg { display: none; }
  .lp-hero { grid-template-columns: 1fr; }
  .lp-showcase { max-width: 560px; }
}
@media (max-width: 680px) {
  /* The bar wraps to two rows here; pinning it would cover too much of a phone screen. */
  .mast { position: static; border-radius: 22px; }
  html { scroll-padding-top: 20px; }
  .mast-inner { flex-wrap: wrap; padding: 10px 16px 0; gap: 0 12px; }
  .mast-inner:has(.workspace-nav[hidden]) { padding-bottom: 10px; }
  .workspace-nav { order: 3; width: 100%; margin: 6px 0 8px; overflow-x: auto; }
  .lp-showcase { min-height: 400px; }
  .lp-lines li:nth-child(3) { display: none; }
  .setup-grid, .capture-grid { grid-template-columns: 1fr; }
  .invite-stage { grid-template-columns: 1fr; gap: 22px; }
  .invite-code { width: min(100%, 240px); }
  .studio-settings { padding: 13px; }
  .room-card, .viewing { align-items: flex-start; flex-direction: column; }
  .pair-controls { width: 100%; }
  .section-bar { align-items: flex-start; }
  /* 16px stops phones zooming the page when a field is focused. */
  input:not([type=checkbox], [type=radio]), select, textarea, .pair-controls input { font-size: 16px; }
}
@media (max-width: 460px) {
  .ring-banner, .studio-build { align-items: flex-start; }
  .standard-form .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
@media (prefers-reduced-motion: no-preference) {
  .btn, input, select, textarea, .workspace-nav a, .account, .speaker span, .text-button, .del { transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
  summary::before { transition: transform .15s; }
  /* A new line or item is tinted once, then settles. */
  .new { animation: arrive 1.6s ease-out; }
  .ring-banner p::before, .lp-live i { animation: pulse 1.4s ease-in-out infinite; }
  /* Landing page: the copy rises in, the picture plays a call through to its review. */
  .lp-title, .lp-sub, .lp-art, .lp-window, .lp-lines li, .lp-result { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .lp-sub { animation-delay: .08s; }
  /* The card only fades, so its controls stay put while people reach for them. */
  .signin-card { animation: fade .7s .16s both; }
  .lp-art-photo { animation-delay: .1s; }
  .lp-art-lime { animation-delay: .2s; }
  .lp-window { animation-delay: .3s; }
  .lp-lines li:nth-child(1) { animation-delay: .9s; }
  .lp-lines li:nth-child(2) { animation-delay: 1.5s; }
  .lp-lines li:nth-child(3) { animation-delay: 2.1s; }
  .lp-result { animation-delay: 2.7s; }
  .lp-result-badge { animation: fade .5s 3.3s both; }
  .page { animation: fade .25s both; }
  .btn:active { scale: .98; }
  /* Arrows lean the way they point when a button is hovered. */
  .btn span[aria-hidden]:not(.call-action-icon) { display: inline-block; transition: translate .2s; }
  .btn:hover span[aria-hidden]:not(.call-action-icon) { translate: 3px 0; }
  .signin-card { transition: box-shadow .25s, border-color .25s; }
  .signin-card:hover, .signin-card:focus-within { border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
  /* The picture's layers drift with the pointer; landing.js sets --px and --py (-1 to 1). */
  .lp-showcase { --px: 0; --py: 0; }
  .lp-art, .lp-window, .lp-result { transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
  .lp-art-photo { transform: translate(calc(var(--px) * -10px), calc(var(--py) * -10px)); }
  .lp-art-lime { transform: translate(calc(var(--px) * -16px), calc(var(--py) * -16px)); }
  .lp-window { transform: translate(calc(var(--px) * 8px), calc(var(--py) * 8px)); }
  .lp-result { transform: translate(calc(var(--px) * 14px), calc(var(--py) * 14px)); }
  /* A step draws its rule in green and leans in when pointed at. */
  .lp-step-list li { position: relative; }
  .lp-step-list li::before { content: ""; position: absolute; inset: -1px 0 auto; height: 2px; background: var(--green); scale: 0 1; transform-origin: left; transition: scale .35s cubic-bezier(.2, .7, .2, 1); }
  .lp-step-list li:hover::before { scale: 1 1; }
  .lp-step-list h3 { transition: translate .25s; }
  .lp-step-list li:hover h3 { translate: 6px 0; }
  /* Sections further down rise as they scroll into view, where the browser supports it. */
  @supports (animation-timeline: view()) {
    /* The statement fills with ink, left to right, as it scrolls up the screen. */
    @media (forced-colors: none) {
      .lp-statement { background: linear-gradient(90deg, var(--ink) 50%, var(--line-strong) 50%) 100% 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ink linear both; animation-timeline: view(); animation-range: entry 25% cover 55%; }
    }
    .lp-step-list li { animation: rise linear both; animation-timeline: view(); animation-range: entry 5% entry 45%; }
    .lp-step-list li:nth-child(2) { animation-range: entry 15% entry 55%; }
    .lp-step-list li:nth-child(3) { animation-range: entry 25% entry 65%; }
  }
}
@keyframes arrive { from { background-color: var(--lime-soft); } to { background-color: transparent; } }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes rise { from { opacity: 0; translate: 0 16px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes ink { to { background-position: 0 0; } }

/* ---------- Incoming-call screen ---------- */
.incoming-call-screen {
  --receiver-edge: clamp(18px,3vw,34px);
  box-sizing: border-box;
  width: min(440px,calc(100vw - 30px));
  max-width: 100vw;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 28px;
  color: var(--ink);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
}
.incoming-call-screen::backdrop { background: rgb(31 31 28 / .35); backdrop-filter: blur(6px); }
html:has(.incoming-call-screen[open]) { overflow: hidden; }
.incoming-call-sheet { padding: 24px var(--receiver-edge) 30px; text-align: center; }
.incoming-brand { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: .875rem; font-weight: 500; }
.incoming-brand img { flex: none; border-radius: 7px; }
.incoming-call-heading { margin-top: 28px; color: var(--muted); font-size: .9375rem; font-weight: 500; }
.incoming-avatar {
  display: grid; place-items: center;
  width: clamp(102px,16vh,134px); aspect-ratio: 1; margin: 18px auto 13px;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--lime-soft); color: var(--green);
}
.incoming-avatar svg { width: 63%; height: 63%; fill: currentColor; stroke: none; }
.incoming-call-screen .arrival-rings { padding: 0; margin: 0; list-style: none; }
.incoming-call-screen .arrival-ring { display: flex; flex-direction: column; align-items: center; border: 0; padding: 0; gap: 0; }
.incoming-call-screen .arrival-identity { display: grid; justify-items: center; gap: 5px; min-width: 0; }
.incoming-call-screen .arrival-title { font: 400 clamp(2.4rem,6vw,3.05rem)/1.08 var(--serif); letter-spacing: -.02em; }
.incoming-call-screen :is(.arrival-time,.arrival-queue) { color: var(--muted); font: .8125rem/1.4 var(--sans); }
.incoming-call-screen .arrival-queue { margin: 5px 0; }
.arrival-ring-actions { display: flex; justify-content: space-evenly; align-items: flex-start; gap: clamp(20px,5vw,52px); width: 100%; margin: clamp(24px,5vh,52px) 0 16px; }
.incoming-call-screen .arrival-ring-actions button {
  display: grid; justify-items: center; gap: 8px; min-width: 92px;
  padding: 4px 7px; min-height: 0; border: 0; border-radius: 12px;
  font: 500 1rem/1.3 var(--sans); color: var(--ink); background: transparent;
}
.incoming-call-screen .answer-call { order: 2; }
.incoming-call-screen .decline-call { order: 1; }
.call-action-icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--ok); }
.decline-call .call-action-icon { background: var(--danger); }
.call-action-icon::after {
  content: ''; display: block; width: 32px; height: 32px; background: #fff;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2c.3-.3.8-.4 1.2-.2 1.1.4 2.4.6 3.7.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1C10.8 21 3 13.2 3 3.7c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.6.6 3.7.1.4 0 .9-.2 1.2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.decline-call .call-action-icon::after { transform: rotate(135deg); }
.arrival-ring-actions button:not(:disabled):hover .call-action-icon { filter: brightness(.9); }
.incoming-call-screen button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.incoming-call-screen .arrival-feedback { margin: 7px auto 0; max-width: 38ch; font-size: .8125rem; line-height: 1.48; }
.incoming-call-screen .arrival-feedback[role=alert] { color: var(--danger); }
.incoming-call-screen .arrival-feedback:empty { display: none; }
.incoming-call-screen #choose-project { margin-top: 10px; }
@media (max-width: 560px) {
  .incoming-call-screen { width: 100vw; height: 100dvh; max-height: 100dvh; max-width: 100vw; border: 0; border-radius: 0; }
  .incoming-call-sheet { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: max(24px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left)); }
  .incoming-call-heading { margin-top: clamp(25px,6vh,64px); }
  .incoming-avatar { width: clamp(110px,20vh,158px); }
  #incoming-call-content { width: 100%; }
  .arrival-ring-actions { margin-top: clamp(30px,8vh,80px); }
}
@media (max-height: 530px) and (min-width: 561px) {
  .incoming-call-heading { margin-top: 10px; }
  .incoming-avatar { width: 72px; margin-block: 9px; }
  .arrival-ring-actions { margin: 12px 0; }
  .call-action-icon { width: 51px; height: 51px; }
}
@media (forced-colors: active) {
  .call-action-icon { border: 2px solid ButtonText; }
  .call-action-icon::after { background: ButtonText; }
}

/* Call codes use a single field for keyboard entry, paste and phone autofill. */
.join-form { max-width: 330px; margin-top: 14px; }
.join-form .field-action { align-items: center; gap: 10px; }
#join-code,#host-join-code { font: 600 clamp(1.7rem, 4.5vw, 2.55rem)/1.2 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: .18em; text-transform: uppercase; }
#join-code { width: 6.3em; padding: 9px 12px; }
.owner-signin-options,.guest-host-link { margin-top: 14px; }
.owner-signin-options { padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.owner-signin-options > summary { width: 100%; font-size: .95rem; font-weight: 610; }
#host-gate { max-width: 470px; padding-top: 14px; }
#host-gate :is(.signin-help,.code-signin-options > summary) { color: var(--muted); }
.guest-host-link { display: inline-flex; align-items: center; min-height: 42px; color: var(--green); font-size: .9rem; }
.host-code { margin-top: 20px; }
.host-code label { color: var(--muted); }
.host-code-action { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#host-join-code { width: 4.35em; padding: 4px 0; border: 0; border-radius: 3px; color: var(--ink); background: none; font-size: clamp(2.45rem,5vw,4rem); letter-spacing: .12em; }
#host-join-code::placeholder { color: var(--faint); }
#join-code-status:empty { display: none; }
.projection-code { max-width: 95vw; color: var(--ink); font: 610 clamp(1.7rem,4.8vmin,3rem)/1 var(--mono); letter-spacing: .16em; }
.qr-dialog:has(#projection-join-code:not([hidden])) #projection-qr { width: min(92vw,calc(100dvh - 255px)); }
.qr-dialog:has(#projection-local-note:not([hidden])):has(#projection-join-code:not([hidden])) #projection-qr { width:min(92vw,calc(100dvh - 289px)); }
@media (max-width: 680px) {
  #join-code { max-width: calc(100% - 95px); }
  .host-code { margin-top: 12px; }
}
.join-address { display: inline-block; color: var(--muted); font: .9rem/1.5 var(--mono); text-underline-offset: .2em; overflow-wrap: anywhere; }
.projection-join { display: grid; justify-items: center; gap: 4px; }
.projection-join:has(output[hidden]):has(a[hidden]) { display: none; }
.projection-join .join-address { font-size: clamp(.86rem,2.1vmin,1.4rem); }
.engine-label { background: transparent; cursor: pointer; text-align: left; }
.engine-label:hover { background: var(--paper); border-color: var(--faint); }
.transcript-options { margin-top: 13px; border-top: 1px solid var(--line); padding-top: 10px; }
.transcript-options .standard-form { margin-top: 8px; }
@media (max-height: 510px) and (orientation: landscape) {
  .qr-projection { display: grid; grid-template-columns: 1fr minmax(0,1fr); grid-template-rows: 1fr auto auto 1fr; justify-items:center; align-items:center; gap: 8px 16px; padding: 10px; }
  .qr-projection h2 { grid-column:1; align-self:end; font-size:clamp(1.5rem,5vh,2.5rem); }
  .qr-projection :is(.projection-join,#projection-local-note,.projection-actions) { grid-column:1; }
  .qr-projection .projection-actions { align-self:start; }
  .qr-dialog #projection-qr,.qr-dialog:has(#projection-join-code:not([hidden])) #projection-qr,.qr-dialog:has(#projection-local-note:not([hidden])) #projection-qr,.qr-dialog:has(#projection-local-note:not([hidden])):has(#projection-join-code:not([hidden])) #projection-qr { width:min(46vw,calc(100dvh - 24px)); grid-column:2; grid-row:1/-1; }
}
