/* jay-build:7e8cfe1543 */
/* Jay — field-notebook transcription. Parchment, jay-wing blue, cinnamon. */
:root {
  color-scheme: light;
  --paper: #f5f1e8;
  --paper-2: #ece6d8;
  --sheet: #fbf9f4;
  --line: #dcd4c2;
  --line-2: #c9bfa9;
  --ink: #1a2230;
  --ink-2: #4a5466;
  --ink-3: #7d8494;
  --jay: #2f63c4;
  --jay-deep: #1d3f86;
  --jay-wash: #dfe7f6;
  --cinnamon: #b65a32;
  --cinnamon-wash: #f3e1d6;
  --fawn: #a8865c;
  --sono: #1d3f86;
  --sel: color-mix(in oklab, var(--jay) 22%, transparent);
  --focus: color-mix(in oklab, var(--jay) 55%, transparent);
  --shadow: 0 1px 0 rgb(40 30 10 / .04), 0 8px 28px -12px rgb(40 30 10 / .22);
  --jay-crest: #2f63c4; --jay-face: #fbf9f4; --jay-ink: #1a2230;
  --wing: repeating-linear-gradient(90deg, var(--jay-deep) 0 5px, var(--jay) 5px 9px, #9fc0f0 9px 11px, var(--ink) 11px 13px);
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --r: 10px;
  --ledger-w: 300px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="dark"], :root:not([data-theme="light"]) .force-dark { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --is-dark: 1; } }
:root[data-theme="dark"] { --is-dark: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #11151f; --paper-2: #171c28; --sheet: #1a2030; --line: #283044; --line-2: #36405a;
    --ink: #ece6d8; --ink-2: #b6b9c4; --ink-3: #7f8698;
    --jay: #6f9ef0; --jay-deep: #4b7bd6; --jay-wash: #1e2a44; --cinnamon: #e08a5f; --cinnamon-wash: #3a261f; --fawn: #c9a77a;
    --sono: #9fc0f0; --shadow: 0 10px 30px -14px rgb(0 0 0 / .7);
    --jay-crest: #6f9ef0; --jay-face: #ece6d8; --jay-ink: #0b0e15;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #11151f; --paper-2: #171c28; --sheet: #1a2030; --line: #283044; --line-2: #36405a;
  --ink: #ece6d8; --ink-2: #b6b9c4; --ink-3: #7f8698;
  --jay: #6f9ef0; --jay-deep: #4b7bd6; --jay-wash: #1e2a44; --cinnamon: #e08a5f; --cinnamon-wash: #3a261f; --fawn: #c9a77a;
  --sono: #9fc0f0; --shadow: 0 10px 30px -14px rgb(0 0 0 / .7);
  --jay-crest: #6f9ef0; --jay-face: #ece6d8; --jay-ink: #0b0e15;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper); color: var(--ink); font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--sel); }
.sprite { display: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .solid { fill: currentColor; stroke: none; }
kbd { font: 11px/1 var(--mono); color: var(--ink-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; background: var(--sheet); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--ink-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn[aria-pressed="true"] { background: var(--jay-wash); color: var(--jay-deep); }

/* ── Layout ─────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--ledger-w) minmax(0, 1fr); height: 100dvh; }
.ledger { display: flex; flex-direction: column; min-height: 0; background: var(--paper-2); border-right: 1px solid var(--line); }
.page { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); min-width: 0; min-height: 0; position: relative; }
.scrim { display: none; }

/* ── Ledger (sessions sidebar) ──────────────────────────── */
.brand { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 10px 16px; }
.wordmark { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: italic 600 26px/1 var(--serif); letter-spacing: -.01em; }
.wordmark .mark { width: 34px; height: 34px; stroke: none; margin-top: -4px; }
.search { position: relative; display: flex; align-items: center; gap: 8px; margin: 0 12px 8px; padding: 0 10px; height: 36px; border-radius: 9px; background: var(--sheet); border: 1px solid var(--line); color: var(--ink-3); }
.search:focus-within { border-color: var(--jay); box-shadow: 0 0 0 3px var(--sel); }
.search svg { width: 17px; height: 17px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.search:focus-within kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.sessions { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }
.group { font: 600 10.5px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); padding: 16px 10px 6px; }
.sess { position: relative; display: block; width: 100%; text-align: left; padding: 9px 10px 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.sess:hover { background: color-mix(in oklab, var(--sheet) 70%, transparent); }
.sess.on { background: var(--sheet); box-shadow: 0 1px 0 var(--line); }
.sess.on::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--wing); }
.sess .t { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess .m { display: flex; gap: 8px; font: 11.5px/1.5 var(--mono); color: var(--ink-3); margin-top: 1px; }
.sess .m .live { color: var(--cinnamon); }
.sess .s { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 13px/1.4 var(--serif); color: var(--ink-2); margin-top: 3px; }
.sess mark, .seg mark { background: color-mix(in oklab, var(--fawn) 35%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.ledger-empty { padding: 28px 14px; color: var(--ink-3); font: italic 14px/1.5 var(--serif); }
.ledger-foot { display: flex; align-items: center; gap: 2px; padding: 8px 8px 10px 12px; border-top: 1px solid var(--line); }
.store-meter { flex: 1; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; border-radius: 8px; color: var(--ink-3); font: 11.5px var(--mono); }
.store-meter:hover { background: var(--sheet); color: var(--ink-2); }
.store-meter svg { width: 16px; height: 16px; }


/* ── Page header ────────────────────────────────────────── */
.page-head { --gut: max(28px, calc((100% - 860px) / 2 + 92px)); display: flex; align-items: center; gap: 10px; padding: 14px max(20px, calc((100% - 860px) / 2 + 24px)) 12px var(--gut); border-bottom: 1px solid var(--line); background: var(--paper); z-index: 2; }
.menu-btn { display: none; }
.title-wrap { flex: 1; min-width: 0; }
.title { margin: 0; font: 600 22px/1.2 var(--serif); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; outline: none; border-radius: 4px; }
.title[contenteditable="true"] { white-space: normal; box-shadow: 0 0 0 2px var(--sel); padding: 0 4px; margin: 0 -4px; }
.title:hover { cursor: text; }
.meta { display: flex; gap: 12px; font: 12px/1.6 var(--mono); color: var(--ink-3); }
.head-actions { display: flex; gap: 2px; }
.page.draft .head-actions { visibility: hidden; }

/* ── Turns ──────────────────────────────────────────────── */
.turns { overflow-y: auto; padding: 8px 0 40px; scroll-padding-bottom: 40px; }
.turn { position: relative; max-width: 860px; margin: 0 auto; padding: 22px 32px 20px 92px; border-bottom: 1px dashed var(--line); }
.turn:last-child { border-bottom: 0; }
.turn-head { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.play { position: absolute; left: 36px; top: 22px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--sheet); color: var(--jay-deep); border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line); transition: transform .15s var(--ease), background .15s; }
.play:hover { background: var(--jay-wash); }
.play:active { transform: scale(.94); }
.play svg { width: 16px; height: 16px; margin-left: 2px; }
.turn.playing .play { background: var(--jay); color: var(--sheet); border-color: var(--jay); }
.turn.playing .play svg { margin-left: 0; }
.play[disabled] { opacity: .35; cursor: default; }
.kind { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.kind svg { width: 16px; height: 16px; color: var(--ink-3); }
.kind span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.when { font: 12px var(--mono); color: var(--ink-3); white-space: nowrap; }
.chip { font: 11px/1 var(--mono); padding: 4px 7px; border-radius: 20px; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.chip.live { background: var(--cinnamon-wash); color: var(--cinnamon); }
.chip.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; animation: blink 1.2s infinite; }
.chip.err { background: var(--cinnamon-wash); color: var(--cinnamon); }
.turn-tools { margin-left: auto; display: flex; gap: 0; opacity: 0; transition: opacity .15s; }
.turn:hover .turn-tools, .turn:focus-within .turn-tools, .turn.editing .turn-tools { opacity: 1; }
.turn-tools .icon-btn { width: 30px; height: 30px; }
.turn-tools .stop { color: var(--cinnamon); }
.turn:has(.stop) .turn-tools { opacity: 1; }
.turn-tools svg { width: 17px; height: 17px; }

.scrub { position: relative; height: 40px; margin: 8px 0 12px; border-radius: 6px; overflow: hidden; background: var(--sheet); border: 1px solid var(--line); cursor: pointer; touch-action: none; }
.scrub canvas { display: block; width: 100%; height: 100%; }
.scrub .cursor { position: absolute; top: 0; bottom: 0; width: 2px; left: 0; background: var(--cinnamon); transform: translateX(-1px); opacity: 0; pointer-events: none; }
.scrub .played { position: absolute; inset: 0 auto 0 0; width: 0; background: color-mix(in oklab, var(--jay) 12%, transparent); pointer-events: none; }
.turn.playing .scrub .cursor, .turn.seeked .scrub .cursor { opacity: 1; }
.scrub .dur { position: absolute; right: 6px; bottom: 4px; font: 10.5px/1 var(--mono); color: var(--ink-3); background: color-mix(in oklab, var(--sheet) 80%, transparent); padding: 2px 4px; border-radius: 3px; }
.progress { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 4px 0 12px; }
.progress i { display: block; height: 100%; width: 0; background: var(--wing); background-size: 13px 100%; transition: width .3s var(--ease); }
.progress.indeterminate i { width: 30%; animation: slide 1.4s var(--ease) infinite; }

.text { font: 17px/1.62 var(--serif); color: var(--ink); max-width: 68ch; text-wrap: pretty; }
.text p { margin: 0 0 .7em; position: relative; }
.text p:last-child { margin-bottom: 0; }
.text b.sec { font: 600 .74em/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--jay-deep); margin-right: .25em; }
.ts { position: absolute; left: -56px; top: .38em; font: 11px/1 var(--mono); color: var(--ink-3); cursor: pointer; padding: 2px 3px; border-radius: 3px; }
.editing .ts { pointer-events: none; opacity: .5; }
.ts:hover { color: var(--jay-deep); background: var(--jay-wash); }
.notime .ts { display: none; }
.seg { border-radius: 3px; cursor: pointer; transition: background .15s; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.seg:hover { background: color-mix(in oklab, var(--jay) 8%, transparent); }
.seg.now { background: var(--jay-wash); box-shadow: 0 0 0 2px var(--jay-wash); }
.seg.flash { animation: flash 1.6s var(--ease); }
.partial { color: var(--ink-3); font-style: italic; }
.partial b.sec { color: inherit; font-style: normal; }
.partial.tail::after, .caret::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--cinnamon); animation: blink 1s steps(2) infinite; }
.text .muted { color: var(--ink-3); font-style: italic; }
.editing .text { outline: none; }
.editing .seg { cursor: text; background: none; box-shadow: none; }
.editing .text p { background: var(--sheet); box-shadow: 0 0 0 1px var(--line); border-radius: 4px; padding: 2px 6px; margin-left: -6px; margin-right: -6px; }
.editing .seg:focus { outline: none; background: var(--jay-wash); }
.turn .foot { display: flex; gap: 12px; margin-top: 10px; font: 11.5px var(--mono); color: var(--ink-3); }
.turn .foot button { color: var(--jay-deep); text-decoration: underline; text-underline-offset: 2px; }

/* ── Empty state ────────────────────────────────────────── */
.empty { display: grid; place-items: center; height: 100%; min-height: 360px; padding: 30px 24px; text-align: center; }
.empty .inner { max-width: 440px; }
.empty .mark { width: 92px; height: 92px; stroke: none; }
.empty h2 { font: italic 600 30px/1.15 var(--serif); margin: 8px 0 6px; letter-spacing: -.01em; }
.empty .song { display: block; width: 280px; height: 56px; margin: 4px auto 18px; color: var(--jay); stroke-width: 1.5; }
.empty .acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--sheet); font-weight: 600; color: var(--ink); transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink-3); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--jay); border-color: var(--jay); color: #fff; }
.btn.primary:hover { background: var(--jay-deep); border-color: var(--jay-deep); }
:root[data-theme="dark"] .btn.primary { color: #0b0e15; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0b0e15; } }
.btn.danger { color: var(--cinnamon); }
.btn.danger.armed { background: var(--cinnamon); border-color: var(--cinnamon); color: #fff; }
.btn kbd { margin-left: 2px; background: transparent; color: inherit; opacity: .7; border-color: currentColor; }
.btn[disabled] { opacity: .5; cursor: default; }
.suggest { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; padding: 8px 12px 8px 10px; border-radius: 30px; border: 1px dashed var(--line-2); color: var(--ink-2); font-size: 13px; }
.suggest:hover { border-style: solid; border-color: var(--jay); color: var(--ink); }
.suggest b { color: var(--jay-deep); }
.suggest .sz { font: 11.5px var(--mono); color: var(--ink-3); }
.loadline { margin-top: 18px; font: 12px var(--mono); color: var(--ink-3); min-height: 1.5em; }
.link { color: var(--jay-deep); text-decoration: underline; text-underline-offset: 2px; font: inherit; }

/* ── Dock ───────────────────────────────────────────────── */
.dock { position: relative; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)) 24px; border-top: 1px solid var(--line); background: var(--paper); }
.dock::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--wing); background-size: 13px 100%; opacity: 0; transition: opacity .3s; }
.dock.recording::before { opacity: 1; animation: wing 1.2s linear infinite; }
.rec { --lvl: 0; position: relative; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--jay); color: #fff; box-shadow: 0 0 0 calc(var(--lvl) * 12px) color-mix(in oklab, var(--jay) 22%, transparent), 0 4px 14px -4px color-mix(in oklab, var(--jay) 70%, transparent); transition: background .2s, transform .15s var(--ease), box-shadow .08s linear; }
.rec:hover { background: var(--jay-deep); }
.rec:active { transform: scale(.95); }
.rec svg { width: 24px; height: 24px; }
.rec .i-off { display: none; }
.recording .rec { background: var(--cinnamon); box-shadow: 0 0 0 calc(4px + var(--lvl) * 14px) color-mix(in oklab, var(--cinnamon) 22%, transparent); }
.recording .rec .i-on { display: none; }
.recording .rec .i-off { display: block; }
:root[data-theme="dark"] .rec { color: #0b0e15; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rec { color: #0b0e15; } }
.strip { position: relative; height: 54px; border-radius: 10px; background: var(--sheet); border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; min-width: 0; }
.strip canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.clock { position: relative; z-index: 1; margin-left: 12px; font: 600 15px var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-3); background: color-mix(in oklab, var(--sheet) 85%, transparent); padding: 2px 4px; border-radius: 4px; }
.recording .clock { color: var(--cinnamon); }
.strip-status { position: relative; z-index: 1; flex: 0 1 auto; min-width: 0; margin: 0 10px 0 auto; padding: 0 6px; background: var(--sheet); font: 12px var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.recording .strip-status { visibility: hidden; }
.strip::after { content: ""; position: absolute; left: 70px; right: 16px; top: 50%; border-top: 1px dashed var(--line); pointer-events: none; }
.recording .strip::after { display: none; }
.strip .pause { position: relative; display: none; margin-right: 8px; background: color-mix(in oklab, var(--sheet) 85%, transparent); }
.recording .strip .pause { display: grid; }
.paused .strip .pause { color: var(--cinnamon); }
.dock-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--sheet); font-weight: 600; color: var(--ink-2); }
.dock-btn:hover { color: var(--ink); border-color: var(--line-2); }
.recording .dock-btn { opacity: .4; pointer-events: none; }
.model-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--paper-2); font-size: 13px; font-weight: 600; color: var(--ink-2); max-width: 220px; }
.model-chip:hover { color: var(--ink); border-color: var(--line-2); }
.model-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-chip .short { display: none; }
@media (pointer: coarse) { .strip-status.hint { visibility: hidden; } }
.model-chip svg { width: 16px; height: 16px; }
.dot { --p: 0; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ink-3); }
.dot.ready { background: #3f9a64; box-shadow: 0 0 0 3px color-mix(in oklab, #3f9a64 20%, transparent); }
.dot.loading { background: conic-gradient(var(--jay) calc(var(--p) * 1%), var(--line) 0); animation: pulse 1.6s infinite; }
.dot.error { background: var(--cinnamon); }
.recording .model-chip { pointer-events: none; opacity: .7; }

/* ── Menus, toasts, drop, dialogs ───────────────────────── */
.menu { position: fixed; z-index: 50; min-width: 230px; max-width: 340px; padding: 6px; border-radius: 12px; background: var(--sheet); border: 1px solid var(--line); box-shadow: var(--shadow); animation: pop .14s var(--ease); }
.menu button, .menu label { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 7px; text-align: left; color: var(--ink); }
.menu button:hover, .menu button:focus-visible { background: var(--paper-2); outline: none; }
.menu svg { width: 17px; height: 17px; color: var(--ink-3); }
.menu .sub { margin-left: auto; font: 11.5px var(--mono); color: var(--ink-3); }
.menu .on svg.ck { color: var(--jay); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu .danger { color: var(--cinnamon); }
.menu .danger svg { color: var(--cinnamon); }
.menu .hd { padding: 6px 10px 4px; font: 600 10.5px var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.toasts { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 16px; border-radius: 10px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow); animation: rise .2s var(--ease); font-size: 13.5px; }
.toast button { font-weight: 700; color: color-mix(in oklab, var(--jay) 50%, var(--paper)); padding: 4px 6px; border-radius: 6px; }
.toast button:hover { background: color-mix(in oklab, var(--paper) 12%, transparent); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }
.drop { position: fixed; inset: 0; z-index: 70; display: none; place-items: center; background: color-mix(in oklab, var(--paper) 75%, transparent); backdrop-filter: blur(3px); }
.drop div { display: grid; place-items: center; gap: 10px; padding: 40px 56px; border: 2px dashed var(--jay); border-radius: 18px; color: var(--jay-deep); font: italic 600 22px var(--serif); background: var(--sheet); }
.drop svg { width: 34px; height: 34px; }
body.dragging .drop { display: grid; }

.sheet { width: min(640px, calc(100vw - 24px)); max-height: min(720px, calc(100dvh - 40px)); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--sheet); color: var(--ink); box-shadow: var(--shadow); overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; animation: pop .16s var(--ease); }
.sheet::backdrop { background: rgb(17 21 31 / .35); backdrop-filter: blur(2px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 0 14px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; }
.tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 10px 10px 12px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button svg { width: 17px; height: 17px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--jay); }
.sheet-body { overflow-y: auto; padding: 8px 20px 22px; }
.sheet h3 { font: 600 10.5px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin: 18px 0 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row .desc { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.row .fine { font: 11.5px var(--mono); color: var(--ink-3); margin-top: 3px; }
.row .fine a { color: inherit; }
.tag { font: 600 10px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 4px 6px; border-radius: 4px; background: var(--paper-2); color: var(--ink-2); }
.tag.med { background: var(--cinnamon-wash); color: var(--cinnamon); }
.tag.in { background: var(--jay-wash); color: var(--jay-deep); }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; }
.radio.on { border-color: var(--jay); }
.radio.on::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--jay); }
.mbar { height: 4px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 7px; }
.mbar i { display: block; height: 100%; background: var(--wing); background-size: 13px 100%; }
.usage { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--paper-2); margin: 8px 0 8px; }
.usage i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font: 12px var(--mono); color: var(--ink-2); }
.legend b { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.field { display: grid; gap: 5px; margin: 10px 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field input[type=text], .field input[type=url], .field select { height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); }
.field input:focus, .field select:focus { outline: none; border-color: var(--jay); box-shadow: 0 0 0 3px var(--sel); }
.seg-ctl { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--paper-2); gap: 2px; }
.seg-ctl button { padding: 6px 11px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.seg-ctl button svg { width: 16px; height: 16px; }
.seg-ctl button[aria-pressed="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.switch { position: relative; width: 38px; height: 22px; border-radius: 12px; background: var(--line-2); flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--sheet); transition: transform .18s var(--ease); box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.switch[aria-checked="true"] { background: var(--jay); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
details.custom summary { cursor: pointer; font-weight: 600; color: var(--jay-deep); padding: 12px 0 4px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.custom summary svg { width: 17px; height: 17px; }
details.custom[open] summary svg { transform: rotate(45deg); }
.about { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font: 11.5px/1.7 var(--mono); color: var(--ink-3); }
.about a { color: inherit; }
.noscript { padding: 40px; font: italic 18px var(--serif); }

@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@keyframes wing { to { background-position: 13px 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes flash { 0%, 40% { background: color-mix(in oklab, var(--fawn) 40%, transparent); } }

/* ── Narrow / phone ─────────────────────────────────────── */
@media (max-width: 860px) {
  .turn { padding: 18px 20px 18px 70px; }
  .play { left: 18px; top: 18px; }
  .ts { left: -46px; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .ledger { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(86vw, 340px); transform: translateX(-102%); transition: transform .25s var(--ease); box-shadow: var(--shadow); padding-top: env(safe-area-inset-top); }
  .app.drawer .ledger { transform: none; }
  .app.drawer .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgb(17 21 31 / .3); }
  .menu-btn { display: inline-grid; margin-left: -6px; }
  .page-head { padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
  .title { font-size: 19px; }
  .meta { gap: 8px; font-size: 11px; }
  .head-actions [data-act="copy-session"] { display: none; }
  .turn { padding: 16px 16px 16px; }
  .play { left: 14px; top: 16px; width: 34px; height: 34px; }
  .turn-head { gap: 8px; padding-left: 44px; min-height: 34px; }
  .turn-tools { opacity: 1; }
  .turn-tools .icon-btn:not([data-act="turn-more"]) { display: none; }
  .text { font-size: 16.5px; }
  .ts { position: static; display: inline-block; margin-right: 6px; vertical-align: 1px; }
  .dock { grid-template-columns: 1fr auto 1fr; grid-template-areas: "strip strip strip" "up rec model"; row-gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .strip { grid-area: strip; height: 44px; }
  .rec { grid-area: rec; width: 62px; height: 62px; }
  .dock-btn { grid-area: up; justify-self: start; }
  .model-chip { grid-area: model; justify-self: end; max-width: 150px; }
  .model-chip .full { display: none; }
  .model-chip .short { display: inline; }
  .toasts { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .sheet { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .tabs button { padding: 10px 6px 12px; font-size: 13px; }
  .tabs button svg { display: none; }
}
@media (max-height: 520px) and (min-width: 761px) {
  .page-head { padding-top: 8px; padding-bottom: 8px; }
  .dock { padding-top: 8px; padding-bottom: 8px; }
  .rec, .strip { height: 46px; }
  .rec { width: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* corrections, warnings, keys */
.corr { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 6px 0; }
.corr input { height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); min-width: 0; }
.corr input:focus { outline: none; border-color: var(--jay); box-shadow: 0 0 0 3px var(--sel); }
.corr span { color: var(--ink-3); font: 13px var(--mono); }
.strip-warn { position: relative; z-index: 1; margin: 0 8px 0 auto; padding: 3px 8px; border-radius: 6px; font: 600 12px var(--sans); color: var(--cinnamon); background: var(--cinnamon-wash); white-space: nowrap; }
.strip-warn[hidden] { display: none; }
.recording .strip-warn:not([hidden]) ~ .pause { margin-left: 0; }
.keys { width: min(380px, calc(100vw - 24px)); }
.keys .sheet-head { padding: 12px 10px 10px 18px; }
.keys dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; padding: 16px 20px 20px; align-items: center; }
.keys dt { text-align: right; } .keys dd { margin: 0; color: var(--ink-2); }
