:root {
  --bg:        #0B0604;
  --bg-2:      #140B07;
  --surface:   rgba(255, 237, 215, 0.045);
  --surface-2: rgba(255, 237, 215, 0.08);
  --line:      rgba(255, 237, 215, 0.10);
  --line-2:    rgba(255, 237, 215, 0.18);
  --ink:       #FFEDD7;
  --ink-2:     #C9A98C;
  --ink-3:     #93735C;
  --orange:    #FF5A1F;
  --orange-d:  #DC5000;
  --amber:     #FFB36B;
  --warn:      #FFB36B;
  --err:       #FF8A7A;
  --r-card: 20px; --r-inner: 12px; --r-pill: 999px;
  --f-display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* Component display rules (grid/flex) would otherwise override the hidden attribute. */
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: 17px; line-height: 1.55; font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--orange); color: var(--bg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

/* Top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 40px);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar { transition: background 250ms, border-color 250ms; border-bottom: 1px solid transparent; }
.topbar.is-solid { background: rgba(11, 6, 4, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--line); pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand svg { display: block; }
.topbar-link {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--ink-2); text-decoration: none;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: rgba(11, 6, 4, 0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: color 180ms, border-color 180ms;
}
.topbar-link:hover { color: var(--ink); border-color: var(--line-2); }

/* Hero: sticky canvas inside a short scroll stage */
#scroll-stage {
  position: relative; height: 175vh;
  background: radial-gradient(120% 60% at 50% 88%, rgba(220, 80, 0, 0.16), transparent 60%), var(--bg);
}
#scene { position: sticky; top: 0; display: block; width: 100%; height: 100vh; z-index: 0; }

#hero {
  position: absolute; top: 0; left: 0; right: 0; height: 100vh; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 22vh 24px 0; text-align: center;
  pointer-events: none;
}
#hero a, #hero button { pointer-events: auto; }
.eyebrow {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 22px;
}
.eyebrow b { color: var(--orange); font-weight: 500; }
h1 {
  font-size: clamp(64px, 13.5vw, 190px); font-weight: 600; line-height: 0.86; letter-spacing: -0.055em;
  color: var(--ink);
  text-shadow: 0 6px 40px rgba(11, 6, 4, 0.85), 0 0 90px rgba(255, 90, 31, 0.25);
}
h1 .ch { display: inline-block; }
.hero-sub {
  max-width: 460px; margin-top: 26px;
  font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); text-wrap: balance;
  text-shadow: 0 2px 18px rgba(11, 6, 4, 0.95);
}
.hero-cta { display: flex; align-items: center; gap: 18px; margin-top: 34px; flex-wrap: wrap; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: inherit; font-size: 16px; font-weight: 500;
  padding: 14px 26px; border-radius: var(--r-pill); border: none; cursor: pointer; text-decoration: none;
  transition: transform 200ms cubic-bezier(.2,.8,.2,1), background 200ms, opacity 200ms;
}
.btn-cream { background: var(--ink); color: var(--bg); }
.btn-cream:hover { transform: translateY(-2px); background: #FFF6EA; }
.btn-cream svg { transition: transform 200ms; }
.btn-cream:hover svg { transform: translateY(2px); }

#scroll-cue {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); pointer-events: none;
}
#scroll-cue .line { width: 1px; height: 38px; background: linear-gradient(var(--ink-3), transparent); animation: cue 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* Hand-off: the hero fades into the same warm black the next section uses */
#scroll-stage::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 40vh; z-index: 3;
  background: linear-gradient(to bottom, rgba(11, 6, 4, 0), var(--bg) 85%);
  pointer-events: none;
}

/* Sections */
section { position: relative; padding: 0 24px; }
.wrap { max-width: 720px; margin: 0 auto; }
.label {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.h2 { font-size: clamp(44px, 7vw, 76px); font-weight: 600; line-height: 0.95; letter-spacing: -0.045em; margin-top: 14px; text-wrap: balance; }
.h2 em { font-style: normal; color: var(--orange); }
.lede { font-size: 18px; color: var(--ink-2); margin-top: 18px; max-width: 520px; }

/* Rises over the fading scene; its gradient leading edge dissolves the bars so text always sits on solid ground */
#transcribe {
  padding-top: 20vh; padding-bottom: 72px; margin-top: -50vh; z-index: 4;
  background: linear-gradient(to bottom, rgba(11, 6, 4, 0) 0, var(--bg) 18vh);
}

.input-card {
  margin-top: 40px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 8px; display: flex; gap: 8px;
  transition: border-color 200ms, background 200ms;
}
.input-card:focus-within { border-color: rgba(255, 90, 31, 0.55); background: var(--surface-2); }
.input-card.is-warn { border-color: rgba(255, 179, 107, 0.55); }
#url-input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  padding: 14px 16px; font-family: var(--f-mono); font-size: 15px; color: var(--ink);
}
#url-input::placeholder { color: var(--ink-3); }
#go-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 150px;
  background: var(--orange); color: #1A0800; font-family: inherit; font-size: 16px; font-weight: 600;
  border: none; border-radius: calc(var(--r-card) - 8px); padding: 0 22px; cursor: pointer;
  transition: background 180ms, opacity 180ms;
}
#go-btn:hover { background: #FF6D38; }
#go-btn:disabled { opacity: 0.55; cursor: progress; }

.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--ink-2);
  padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-pill);
  transition: color 180ms, border-color 180ms, background 180ms;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); transition: background 180ms; }
.chip.is-on { color: var(--ink); border-color: rgba(255, 90, 31, 0.6); background: rgba(255, 90, 31, 0.1); }
.chip.is-on::before { background: var(--orange); }
.paste-btn {
  font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); background: none; border: none; cursor: pointer;
  padding: 6px 0; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-2);
}
.paste-btn:hover { color: var(--ink); }

/* How it works */
#how { padding-top: 120px; padding-bottom: 100px; border-top: 1px solid var(--line); }
#how .wrap { max-width: 1040px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 56px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.step { background: var(--bg); padding: 32px 28px 36px; }
.step-n { font-family: var(--f-mono); font-size: 13px; color: var(--orange); }
.step h3 { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; margin-top: 40px; }
.step p { font-size: 16px; color: var(--ink-2); margin-top: 10px; }
.fine { margin-top: 28px; font-size: 14px; color: var(--ink-3); max-width: 640px; }

footer { padding: 36px 24px 48px; border-top: 1px solid var(--line); }
footer .wrap { max-width: 1040px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }

.js .reveal { opacity: 0; transform: translateY(20px); }

.btn-ghost {
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 9px 16px; cursor: pointer; transition: background 180ms, border-color 180ms;
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-2); }
.btn-ghost:disabled { opacity: 0.4; cursor: default; }
.chip-more { border-style: dashed; }
.chip-more::before { display: none; }

/* Live progress */
#status { display: none; margin-top: 28px; padding: 18px 20px; border-radius: var(--r-inner); background: var(--surface); border: 1px solid var(--line); }
#status.is-on { display: block; }
.steps-live { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.steps-live li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink-3); transition: color 200ms; }
.steps-live .dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink-3); flex-shrink: 0; transition: all 200ms; }
.steps-live li.is-active { color: var(--ink); }
.steps-live li.is-active .dot { border-color: var(--orange); background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.18); animation: pulse 1.2s ease-in-out infinite; }
.steps-live li.is-done { color: var(--ink-2); }
.steps-live li.is-done .dot { border-color: var(--orange); background: var(--orange); }
.steps-live li.is-fail .dot { border-color: var(--err); }
.st-time { margin-left: auto; font-family: var(--f-mono); font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255, 90, 31, 0.06); } }

#error-box {
  display: none; margin-top: 24px; padding: 16px 18px; border-radius: var(--r-inner);
  background: rgba(255, 138, 122, 0.07); border: 1px solid rgba(255, 138, 122, 0.25);
  color: var(--err); font-size: 15px;
}

/* Library */
#library { margin-top: 56px; }
.lib-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 14px; }
.lib-item {
  display: flex; gap: 12px; align-items: center; text-align: left; width: 100%;
  padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-inner);
  color: var(--ink); font-family: inherit; cursor: pointer; transition: border-color 180ms, background 180ms;
}
.lib-item:hover { border-color: var(--line-2); background: var(--surface-2); }
.lib-item img, .lib-item .lib-ph { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--bg-2); }
.lib-item b { display: block; font-weight: 500; font-size: 14px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lib-item small { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }

/* Workspace */
#workspace { padding: 24px clamp(16px, 3vw, 32px) 120px; scroll-margin-top: 70px; }
.ws { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 28px; align-items: start; }
.ws > * { min-width: 0; }
/* The download card makes the column taller than most screens, so it scrolls on its own to reach the last rows. */
.ws-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); overflow-y: auto; scrollbar-width: thin; }
.ws-side > * { flex-shrink: 0; }
.media { border-radius: var(--r-card); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); aspect-ratio: 16 / 9; }
.media iframe, .media img { display: block; width: 100%; height: 100%; border: 0; object-fit: cover; }
.media .ph { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
.ws-title { font-size: 22px; font-weight: 500; line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; }
.ws-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ws-stats span { font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); padding: 4px 9px; border: 1px solid var(--line); border-radius: var(--r-pill); }
.copy-fallback { display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.copy-fallback textarea {
  width: 100%; resize: vertical; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-inner);
  padding: 10px 12px; font-family: var(--f-mono); font-size: 12px; color: var(--ink);
}
.copy-fallback .btn-ghost { align-self: flex-start; }

.tabs {
  display: flex; gap: 4px; padding: 4px; background: rgba(20, 11, 7, 0.85); border: 1px solid var(--line); border-radius: var(--r-pill);
  position: sticky; top: 76px; z-index: 5; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1; min-width: max-content; font-family: inherit; font-size: 15px; font-weight: 500; color: var(--ink-2);
  background: none; border: none; border-radius: var(--r-pill); padding: 10px 16px; cursor: pointer; transition: color 180ms, background 180ms;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.tab .badge { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); margin-left: 6px; vertical-align: middle; animation: pulse 1.2s infinite; }
.panel { padding-top: 28px; }

.sk { height: 14px; border-radius: 6px; margin: 12px 0; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.3s linear infinite; }
.sk.w60 { width: 60%; } .sk.w80 { width: 80%; } .sk.tall { height: 28px; width: 70%; }
@keyframes sk { to { background-position: -200% 0; } }
.panel-note { font-size: 15px; color: var(--ink-3); }
.panel-err { font-size: 15px; color: var(--err); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Notes */
.tldr { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.3; letter-spacing: -0.015em; text-wrap: pretty; }
.n-sec { margin-top: 36px; }
.n-sec h4 { font-family: var(--f-mono); font-size: 12px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.n-sum { font-size: 17px; color: var(--ink-2); line-height: 1.7; max-width: 68ch; }
.kp { list-style: none; display: flex; flex-direction: column; gap: 10px; max-width: 68ch; }
.kp li { display: flex; gap: 12px; font-size: 17px; line-height: 1.5; }
.kp li::before { content: ''; width: 6px; height: 6px; margin-top: 10px; border-radius: 2px; background: var(--orange); flex-shrink: 0; }
.concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.concept { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-inner); }
.concept dt { font-weight: 500; font-size: 15px; }
.concept dd { font-size: 14px; color: var(--ink-2); margin-top: 4px; line-height: 1.5; }

/* Notes style and language: a choice only marks what the rewrite button will make. */
.nc { display: grid; gap: 14px; padding: 16px; margin-bottom: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.nc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.nc-h { font-family: var(--f-mono); font-size: 12px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.nc-showing { font-size: 14px; color: var(--ink-2); }
.nc-showing b { font-weight: 500; color: var(--ink); }
.nc-toggle { display: none; }
.nc-body { display: grid; gap: 14px; container-type: inline-size; }
.nc-styles { border: 0; min-width: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
/* Below 38rem five cards are too narrow for their names, so three go on a row. */
@container (width < 38rem) { .nc-styles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.nc-opt {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 12px 13px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-inner); cursor: pointer;
  transition: border-color 160ms, background 160ms;
}
.nc-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nc-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.nc-name::before { content: ''; width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--ink-3); transition: background 160ms, border-color 160ms; }
.nc-desc { font-size: 13px; line-height: 1.4; color: var(--ink-3); }
.nc-tag { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }
.nc-opt:hover { border-color: var(--line-2); background: var(--surface-2); }
.nc-opt:has(input:checked) { border-color: rgba(255, 90, 31, 0.6); background: rgba(255, 90, 31, 0.08); }
.nc-opt:has(input:checked) .nc-name::before { background: var(--orange); border-color: var(--orange); }
.nc-opt:has(input:checked) .nc-desc { color: var(--ink-2); }
.nc-opt:has(input:focus-visible) { outline: 2px solid var(--amber); outline-offset: 3px; }
.nc-styles:disabled .nc-opt { opacity: 0.55; cursor: progress; }
.nc-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.nc-lang-label { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
/* The browser's own arrow sits in the curve of the pill, so the select draws none and this chevron takes its place. */
.nc-select { position: relative; display: inline-flex; }
.nc-select::after {
  content: ''; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px; margin-top: -6px; pointer-events: none;
  border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(45deg);
}
/* Without the browser's arrow Chrome sizes the select narrower than its longest option, so the width is set. */
.nc-select select {
  appearance: none; -webkit-appearance: none; width: 16rem; height: 40px; padding: 0 44px 0 16px; margin: 0;
  font: 500 14px/1.2 var(--f-display); color: var(--ink); color-scheme: dark; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); transition: border-color 160ms, background 160ms;
}
.nc-select select:hover:not(:disabled) { border-color: var(--line-2); background-color: var(--surface-2); }
.nc-select select:disabled { opacity: 0.55; cursor: progress; }
.nc-select select option { font: inherit; background: var(--bg-2); color: var(--ink); }
/* Where the browser can draw the list itself, it opens as a card under the field instead of a system menu over it. */
@supports (appearance: base-select) {
  .nc-select select, .nc-select select::picker(select) { appearance: base-select; }
  .nc-select select { align-items: center; }
  .nc-select select::picker-icon { display: none; }
  .nc-select select::picker(select) { margin-top: 6px; padding: 6px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-inner); }
  .nc-select select option { padding: 9px 12px; border-radius: 8px; cursor: pointer; }
  .nc-select select option:hover, .nc-select select option:focus-visible { background: var(--surface-2); outline: none; }
  .nc-select select option:checked { color: var(--amber); }
  .nc-select select option::checkmark { display: none; }
}
.nc-go {
  margin-left: auto; height: 40px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px/1 var(--f-display); color: #1A0800; background: var(--orange); border: none; border-radius: var(--r-pill); cursor: pointer; transition: background 180ms;
}
.nc-go:hover:not(:disabled) { background: #FF6D38; }
.nc-go:disabled { color: var(--ink-3); background: var(--surface-2); cursor: default; }
.nc-fine { font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.nc-err { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; line-height: 1.5; color: var(--err); }
.notes-stage { position: relative; }
#notes-body { transition: opacity 200ms; }
#notes-body[aria-busy="true"] { opacity: 0.28; pointer-events: none; }
/* The live region stays rendered while empty so its message is spoken; the pill hangs below it and sticks under the tabs. */
.nc-live { position: sticky; top: 140px; z-index: 2; height: 0; display: flex; justify-content: center; }
.nc-busy {
  display: flex; align-items: center; gap: 12px; height: max-content; max-width: 100%; padding: 12px 18px; font-size: 15px; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-pill);
}
.nc-busy .dot { width: 10px; height: 10px; flex-shrink: 0; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.18); animation: pulse 1.2s ease-in-out infinite; }

/* Downloads */
.ws-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ws-quick .dl-quick { display: none; flex: 0 1 auto; padding: 0 18px; }
.dl { display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.dl-h { font-family: var(--f-mono); font-size: 12px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.dl-main { display: grid; gap: 10px; padding: 14px; border-radius: var(--r-inner); background: rgba(255, 90, 31, 0.08); border: 1px solid rgba(255, 90, 31, 0.35); }
.dl-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.dl-kind { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.06em; background: var(--orange); color: #1A0800; padding: 2px 6px; border-radius: 4px; }
.dl-desc { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.dl-meta { font-family: var(--f-mono); font-size: 11px; line-height: 1.5; color: var(--ink-3); }
.dl-actions { display: flex; gap: 8px; }
.dl-go {
  flex: 1; height: 42px; padding: 0 16px; font: 600 15px/1 var(--f-display); color: #1A0800; background: var(--orange);
  border: none; border-radius: var(--r-pill); cursor: pointer; transition: background 180ms, opacity 180ms;
}
.dl-go:hover:not(:disabled, [aria-disabled="true"]) { background: #FF6D38; }
.dl-go:disabled, .dl-go[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.dl-go[aria-busy="true"] { cursor: progress; }
.dl-share { height: 42px; padding: 0 18px; }
.dl-sub { font-size: 13px; color: var(--ink-3); }
.dl-rows { list-style: none; display: grid; }
.dl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.dl-row:first-child { border-top: 0; padding-top: 0; }
.dl-row-name { display: flex; align-items: center; flex-wrap: wrap; gap: 0 8px; font-size: 14px; font-weight: 500; color: var(--ink); }
.dl-row-what { grid-column: 1; font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.dl-row-btn { grid-column: 2; grid-row: 1 / span 2; min-width: 64px; height: 34px; padding: 0 14px; font-size: 13px; }
.dl-state { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 10px; font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.dl-state:empty { display: none; }
.dl-state::before { content: ''; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: #7BD88F; }
.dl-state.is-making::before { background: var(--orange); animation: pulse 1.2s ease-in-out infinite; }
.dl-state.is-off { color: var(--err); text-transform: none; letter-spacing: 0; font-size: 11px; }
.dl-state.is-off::before { background: var(--err); }
.dl-more summary { cursor: pointer; font-size: 14px; color: var(--ink-2); padding: 6px 0; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.dl-more summary:hover { color: var(--ink); }
.dl-more summary::-webkit-details-marker { display: none; }
.dl-more summary::after { content: ''; width: 7px; height: 7px; margin-right: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 160ms; }
.dl-more[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.dl-more .dl-rows { margin-top: 6px; }
.dl-next:empty { display: none; }
.dl-next, .dl-note { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--r-inner); background: var(--bg-2); border: 1px solid var(--line-2); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.dl-next b { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.dl-next .btn-ghost, .dl-note .btn-ghost { justify-self: start; height: 34px; padding: 0 14px; font-size: 13px; }
.dl-note-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--err); }
.dl-err { font-size: 14px; line-height: 1.5; color: var(--err); }

/* Timeline */
.tl { list-style: none; position: relative; }
.tl::before { content: ''; position: absolute; left: 33px; top: 10px; bottom: 10px; width: 1px; background: var(--line-2); }
.tl li { position: relative; display: grid; grid-template-columns: 68px 1fr; gap: 18px; padding: 10px 0 22px; }
.tl li::after { content: ''; position: absolute; left: 29px; top: 44px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--orange); }
.tl h5 { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.tl p { font-size: 15px; color: var(--ink-2); margin-top: 4px; line-height: 1.55; }
.ts {
  font-family: var(--f-mono); font-size: 12px; color: var(--orange); background: rgba(255, 90, 31, 0.1);
  border: 1px solid rgba(255, 90, 31, 0.25); border-radius: var(--r-pill); padding: 3px 8px; cursor: pointer;
  font-variant-numeric: tabular-nums; height: fit-content; justify-self: start; transition: background 160ms;
}
.ts:hover { background: rgba(255, 90, 31, 0.2); }

/* Mind map: each node draws its own elbow from the parent's spine, and every node but the last carries the spine on. */
.mm-root { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; padding: 10px 18px; border-radius: var(--r-inner); background: var(--ink); color: var(--bg); }
.mm-kids { list-style: none; margin-left: 18px; }
.mm-node { position: relative; padding: 6px 0 0 22px; }
.mm-node::before { content: ''; position: absolute; left: 0; top: 0; width: 18px; height: 25px; border-left: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); border-bottom-left-radius: 10px; }
.mm-node:not(:last-child)::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px solid var(--line-2); }
.mm-row { display: flex; align-items: flex-start; gap: 6px; }
.mm-toggle {
  flex-shrink: 0; width: 28px; height: 28px; margin-top: 5px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 50%; color: var(--ink-2); transition: border-color 160ms;
}
.mm-toggle:hover { border-color: var(--line-2); color: var(--ink); }
.mm-toggle::before { content: ''; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 160ms; }
.mm-toggle[aria-expanded="false"]::before { transform: rotate(-45deg); }
.mm-label {
  min-width: 0; overflow-wrap: anywhere; font-family: inherit; font-size: 15px; line-height: 1.45; color: var(--ink-2); text-align: left;
  padding: 7px 12px; border: 1px solid transparent; border-radius: var(--r-inner); background: none;
}
.mm-d1 > .mm-row > .mm-label { color: var(--ink); font-weight: 500; background: rgba(255, 90, 31, 0.08); border-color: rgba(255, 90, 31, 0.35); }
.mm-group > .mm-row > .mm-label { background: rgba(255, 179, 107, 0.07); border-color: rgba(255, 179, 107, 0.3); }
button.mm-label { cursor: pointer; transition: border-color 160ms, background 160ms; }
button.mm-label:hover { border-color: rgba(255, 90, 31, 0.7); }
.mm-time { font-family: var(--f-mono); font-size: 12px; color: var(--orange); margin-right: 8px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .mm-kids { margin-left: 12px; }
  .mm-node { padding-left: 16px; }
  .mm-node::before { width: 12px; }
}

/* Transcript */
.tx-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
#tx-search {
  flex: 1; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 10px 16px; font-family: inherit; font-size: 15px; color: var(--ink); outline: none;
}
#tx-search:focus { border-color: rgba(255, 90, 31, 0.5); }
.tx-count { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
.tx-list { max-height: 70vh; overflow-y: auto; padding-right: 8px; overscroll-behavior: contain; }
.tx-list::-webkit-scrollbar, .chat::-webkit-scrollbar { width: 8px; }
.tx-list::-webkit-scrollbar-thumb, .chat::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.tx-row { display: grid; grid-template-columns: 68px 1fr; gap: 14px; padding: 8px 10px; border-radius: 10px; transition: background 300ms; }
.tx-row p { font-size: 16px; line-height: 1.65; }
.tx-row.is-hit { background: rgba(255, 90, 31, 0.1); }
mark { background: rgba(255, 179, 107, 0.35); color: var(--ink); border-radius: 3px; padding: 0 2px; }

/* Study */
.study-toggle, .seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); margin-bottom: 24px; }
.study-toggle button, .seg button { font-family: inherit; font-size: 14px; color: var(--ink-2); background: none; border: none; padding: 8px 16px; border-radius: var(--r-pill); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.study-toggle button[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.fc-wrap { perspective: 1400px; }
.fc {
  position: relative; width: 100%; min-height: 260px; cursor: pointer; transform-style: preserve-3d;
  transition: transform 520ms cubic-bezier(.2,.8,.2,1); border: none; background: none; color: inherit; font-family: inherit; text-align: left;
}
.fc.is-flipped { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  padding: 32px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--bg-2);
}
.fc-back { transform: rotateY(180deg); background: linear-gradient(160deg, rgba(255, 90, 31, 0.14), var(--bg-2) 60%); border-color: rgba(255, 90, 31, 0.3); }
.fc-face small { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.fc-face p { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.35; letter-spacing: -0.01em; }
.fc-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 12px; }
.fc-count { font-family: var(--f-mono); font-size: 13px; color: var(--ink-3); }
.quiz { display: flex; flex-direction: column; gap: 28px; }
.qz h5 { font-size: 18px; font-weight: 500; line-height: 1.35; margin-bottom: 12px; }
.qz-opts { display: flex; flex-direction: column; gap: 8px; }
.qz-opt {
  text-align: left; font-family: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-inner); padding: 12px 14px; cursor: pointer; transition: border-color 160ms, background 160ms;
}
.qz-opt:hover:not(:disabled) { border-color: var(--line-2); }
.qz-opt:disabled { cursor: default; }
.qz-opt.is-right { border-color: #7BD88F; background: rgba(123, 216, 143, 0.1); }
.qz-opt.is-wrong { border-color: var(--err); background: rgba(255, 138, 122, 0.08); }
.qz-why { font-size: 14px; color: var(--ink-2); margin-top: 10px; }
.qz-tag { margin-left: 10px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.qz-score { font-size: 18px; padding: 16px 18px; border-radius: var(--r-inner); background: var(--surface); border: 1px solid var(--line); }

/* Ask */
.chat { display: flex; flex-direction: column; gap: 14px; max-height: 56vh; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
.msg { max-width: 88%; padding: 12px 16px; border-radius: 16px; font-size: 16px; line-height: 1.6; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.ai .ts { margin: 0 2px; }
.msg.typing { color: var(--ink-3); }
.chat-empty { font-size: 15px; color: var(--ink-3); }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 12px; }
.chip-btn {
  font-family: inherit; font-size: 13px; color: var(--ink-2); background: none; border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 7px 13px; cursor: pointer; transition: color 160ms, border-color 160ms;
}
.chip-btn:hover { color: var(--ink); border-color: var(--line-2); }
.ask-form { display: flex; gap: 8px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); }
.ask-form:focus-within { border-color: rgba(255, 90, 31, 0.5); }
#ask-input { flex: 1; min-width: 0; background: none; border: none; outline: none; padding: 10px 14px; font-family: inherit; font-size: 16px; color: var(--ink); }
#ask-input::placeholder { color: var(--ink-3); }
#ask-btn { font-family: inherit; font-size: 15px; font-weight: 600; color: #1A0800; background: var(--orange); border: none; border-radius: var(--r-pill); padding: 0 20px; cursor: pointer; }
#ask-btn:disabled { opacity: 0.55; }

@media (max-width: 960px) {
  .ws { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  /* The side column's parts join the grid, so the download card can follow the notes and only a quick button stays up top. */
  .ws-side { display: contents; }
  .ws-main { order: 1; }
  .dl { order: 2; }
  .ws-quick .dl-quick { display: block; }
  .tabs { top: 64px; }
  .tab { padding: 9px 14px; font-size: 14px; }
  .ws-title { font-size: 19px; }
  #workspace { padding-top: 8px; }
  #library { margin-top: 36px; }
}
@media (max-width: 600px) {
  .nc { padding: 14px; }
  .nc-toggle { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; font-size: 13px; }
  .nc:not(.is-open) .nc-body { display: none; }
  .nc-head { align-items: center; }
  .nc-styles { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .nc-opt { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: baseline; gap: 2px 10px; padding: 10px 12px; }
  .nc-tag { grid-column: 2; }
  .nc-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .nc-select, .nc-select select { width: 100%; }
  /* 16px keeps iOS from zooming the page when the select takes focus. */
  .nc-select select { height: 44px; font-size: 16px; }
  .nc-go { width: 100%; height: 44px; margin: 4px 0 0; font-size: 15px; }
  .nc-live { top: 120px; }
  .ws-quick > * { flex: 1 1 auto; }
  .ws-quick .btn-ghost { height: 42px; }
}


/* Pro */
.topbar-right { display: flex; gap: 10px; align-items: center; }
.pro-btn {
  font-family: inherit; font-size: 14px; font-weight: 600; color: #1A0800; background: var(--orange);
  border: none; border-radius: var(--r-pill); padding: 8px 16px; cursor: pointer; transition: background 180ms;
}
.pro-btn:hover { background: #FF6D38; }
.pro-btn.is-pro { background: rgba(255, 90, 31, 0.12); color: var(--orange); border: 1px solid rgba(255, 90, 31, 0.4); }
.ask-quota { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); margin: 0 0 10px 6px; }
.ask-quota button { font: inherit; color: var(--orange); background: none; border: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.sheet { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 2, 1, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet-card {
  position: relative; width: min(640px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 24px; padding: 32px;
}
.sheet-x { position: absolute; top: 14px; right: 16px; font-size: 26px; line-height: 1; color: var(--ink-2); background: none; border: none; cursor: pointer; padding: 6px; }
.sheet-h { font-size: clamp(28px, 4vw, 38px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; margin-top: 10px; text-wrap: balance; }
.sheet-reason { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-inner); background: rgba(255, 90, 31, 0.1); border: 1px solid rgba(255, 90, 31, 0.3); color: var(--ink); font-size: 15px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.plan {
  position: relative; text-align: left; font-family: inherit; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-inner); padding: 16px 14px;
  display: flex; flex-direction: column; gap: 4px; transition: border-color 160ms, background 160ms, transform 160ms;
}
.plan:hover { border-color: var(--line-2); transform: translateY(-1px); }
.plan.is-best { border-color: rgba(255, 90, 31, 0.65); background: rgba(255, 90, 31, 0.08); }
.plan-tag { position: absolute; top: -9px; left: 12px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; background: var(--orange); color: #1A0800; padding: 2px 7px; border-radius: 4px; }
.plan-name { font-size: 14px; color: var(--ink-2); }
.plan-price { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan-sub { font-size: 12px; color: var(--ink-3); font-family: var(--f-mono); }
.plan-allow { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.sheet-team { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.sheet-team h3 { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.sheet-team p { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.plans.two { grid-template-columns: repeat(2, 1fr); margin-top: 14px; }
.signin-google { margin-top: 22px; }
.plan:disabled { opacity: 0.6; cursor: progress; }
.pro-feats { list-style: none; margin-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.pro-feats li { position: relative; padding-left: 16px; font-size: 15px; color: var(--ink-2); }
.pro-feats li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 2px; background: var(--orange); }
.pro-feats b { color: var(--ink); font-weight: 500; }
.sheet-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.link-btn { font: inherit; color: var(--ink-2); background: none; border: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.restore { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.restore input { flex: 1; min-width: 160px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 9px 14px; font-family: inherit; font-size: 14px; color: var(--ink); outline: none; }
.restore input:focus { border-color: rgba(255, 90, 31, 0.5); }
.sheet-msg { margin-top: 12px; font-size: 14px; min-height: 20px; color: var(--ink-2); }
.sheet-msg.is-err { color: var(--err); }
.sheet-msg.is-ok { color: #7BD88F; }
@media (max-width: 600px) {
  .plans, .plans.two { grid-template-columns: 1fr; }
  .sheet-card { padding: 24px 20px; }
}


/* Auth, pricing, FAQ */
.auth-btn { font-family: inherit; font-size: 14px; color: var(--ink); background: rgba(11, 6, 4, 0.5); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 7px 14px; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-btn:hover { border-color: var(--ink-3); }
.wrap.wide { max-width: 1100px; }
#pricing { padding-top: 120px; padding-bottom: 60px; border-top: 1px solid var(--line); }
.tiers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 48px; align-items: stretch; }
.tier { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 26px 24px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.tier.is-pro { border-color: rgba(255, 90, 31, 0.6); background: linear-gradient(170deg, rgba(255, 90, 31, 0.12), var(--surface) 55%); }
.tier-name { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.tier-price { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.tier-price small { font-size: 15px; font-weight: 400; color: var(--ink-2); margin-left: 2px; }
.tier-note { font-size: 14px; color: var(--ink-2); }
.ppp-note { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.tier-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 18px 0 22px; flex: 1; }
.tier-list li { position: relative; padding-left: 16px; font-size: 15px; line-height: 1.45; }
.tier-list li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 2px; background: var(--orange); }
.tier-cta { text-align: center; text-decoration: none; }
.pro-cta { font-family: inherit; font-size: 15px; font-weight: 600; color: #1A0800; background: var(--orange); border: none; border-radius: var(--r-pill); padding: 11px 16px; cursor: pointer; }
.pro-cta:hover { background: #FF6D38; }
#about { padding-top: 90px; padding-bottom: 20px; }
#about .lede { max-width: 68ch; }
#about a { color: var(--ink); }
#faq { padding-top: 90px; padding-bottom: 120px; }
.faq { margin-top: 36px; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 4px; }
.faq summary { cursor: pointer; font-size: 18px; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--orange); font-size: 22px; line-height: 1; transition: transform 200ms; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin-top: 10px; color: var(--ink-2); font-size: 16px; line-height: 1.65; max-width: 68ch; }
.foot { align-items: center; }
.foot-credit a { color: var(--ink-2); text-decoration: none; }
.foot-credit a:hover { color: var(--ink); }
#tools { padding-top: 70px; }
.tools { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 36px; }
.tools a { display: block; height: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-inner); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; transition: border-color 180ms, background 180ms; }
.tools a:hover { border-color: var(--line-2); background: var(--surface-2); }
.tools a span { display: block; margin-top: 4px; font-size: 14px; font-weight: 400; color: var(--ink-2); }
.plan-table-wrap { margin-top: 40px; overflow-x: auto; }
.plan-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.plan-table caption { text-align: left; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-3); padding-bottom: 12px; }
.plan-table th, .plan-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.plan-table thead th { font-family: var(--f-mono); font-size: 11px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.plan-table td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.plan-table tbody th { font-weight: 500; color: var(--ink); }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { color: var(--ink-3); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
@media (max-width: 860px) { .tiers { grid-template-columns: 1fr; } }

/* Compliance UI */
.consent-note { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--ink-3); max-width: 62ch; }
.consent-note a, .sheet-legal a { color: var(--ink-2); }
.tier-fine { font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 8px; }
.sheet-legal { margin-top: 16px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.topbar-right { position: relative; }
.account-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 320px; max-width: calc(100vw - 32px); max-height: calc(100vh - 90px); overflow-y: auto; overscroll-behavior: contain; padding: 14px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-inner); display: flex; flex-direction: column; gap: 10px; z-index: 20; }
.account-menu:focus-visible { outline-offset: 2px; border-radius: var(--r-inner); }
.account-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.account-email { font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pro-badge { flex-shrink: 0; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.06em; background: var(--orange); color: #1A0800; padding: 2px 7px; border-radius: 4px; }
.account-plan { font-size: 13px; color: var(--ink-2); }
.account-plan .link-btn, .account-nudge .link-btn { color: var(--ink); }
.meters { display: flex; flex-direction: column; gap: 10px; }
.meter-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--ink); }
.meter-num { font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.meter-bar { height: 6px; margin-top: 6px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: inherit; background: var(--orange); transition: width 300ms ease, background 300ms; }
.meter.is-warn .meter-fill { background: var(--warn); }
.meter.is-full .meter-fill { background: var(--err); }
.account-reset { font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); }
.account-nudge { font-size: 13px; color: var(--ink-2); }
.account-div { border: none; border-top: 1px solid var(--line); }
.account-item { text-align: left; font-family: inherit; font-size: 14px; color: var(--ink); background: none; border: none; border-radius: 8px; padding: 8px 10px; margin: 0 -10px; cursor: pointer; }
.account-item:hover { background: var(--surface-2); }
.account-foot { font-size: 12px; color: var(--ink-3); }
#menu-delete { color: var(--err); }
.account-daily { font-size: 13px; color: var(--ink-2); }
.team-box { display: flex; flex-direction: column; gap: 10px; }
.team-h { font-size: 14px; font-weight: 500; }
.team-count { font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); flex-shrink: 0; }
.team-add { display: flex; gap: 6px; }
.team-add input { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 7px 12px; font-family: inherit; font-size: 16px; color: var(--ink); }
.team-add input:focus { border-color: rgba(255, 90, 31, 0.5); }
.team-add .btn-ghost { padding: 7px 14px; font-size: 13px; }
.team-msg { font-size: 12px; color: var(--ink-2); }
.team-msg:empty { display: none; }
.team-msg.is-err { color: var(--err); }
.team-list { list-style: none; display: flex; flex-direction: column; }
.team-seat { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12px; }
.team-email { font-family: var(--f-mono); color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-you { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); flex-shrink: 0; }
.receipt-list { list-style: none; display: flex; flex-direction: column; }
.receipt-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink); text-decoration: none; }
.receipt-row:hover .receipt-what { text-decoration: underline; }
.receipt-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-sum { font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.video-hint { margin-top: 10px; font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
/* The region stays rendered while empty so screen readers announce each new message. */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast-msg { padding: 12px 16px; border-radius: var(--r-inner); background: var(--bg-2); border: 1px solid rgba(255, 138, 122, 0.35); color: var(--err); font-size: 14px; }
.toast-msg.is-ok { border-color: var(--line-2); color: var(--ink); }

@media (max-width: 720px) { .auth-btn { padding: 6px 11px; font-size: 13px; max-width: 120px; } }

@media (max-width: 720px) {
  #hero { padding-top: 20vh; }
  .input-card { flex-direction: column; }
  #go-btn { padding: 15px; }
  .steps { grid-template-columns: 1fr; }
  .step h3 { margin-top: 20px; }
  .result-head { align-items: flex-start; }
  .topbar-link { display: none; }
  .pro-btn { padding: 7px 13px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  #scroll-cue .line, .steps-live .dot, .sk, .tab .badge, .nc-busy .dot, .dl-state.is-making::before { animation: none; }
  .fc, .meter-fill, .mm-toggle::before { transition: none; }
}
