@font-face { font-family: "Funnel Display"; font-weight: 600; font-display: swap; src: url("/fonts/funnel-display-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url("/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Devanagari"; font-weight: 400; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+25CC, U+A830-A839, U+A8E0-A8FF; src: url("/fonts/noto-sans-devanagari-devanagari-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Devanagari"; font-weight: 600; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+25CC, U+A830-A839, U+A8E0-A8FF; src: url("/fonts/noto-sans-devanagari-devanagari-600-normal.woff2") format("woff2"); }

:root {
  --navy: #001672; --deep: #000F52; --raised: #0A2487; --line: #2B43A6;
  --gold: #EECC53; --paper: #F5F3EF; --soft: #C5CDF3; --danger: #FFB4A8;
  --body: Inter, "Noto Sans Devanagari", system-ui, sans-serif;
  --display: "Funnel Display", Inter, "Noto Sans Devanagari", sans-serif;
  --gutter: 20px; --safe-b: env(safe-area-inset-bottom); --safe-t: env(safe-area-inset-top);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; background: var(--navy); color: var(--paper); font: 400 16px/1.5 var(--body); overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; border-radius: 0; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: var(--gold); }

.page { width: 100%; max-width: 640px; margin: 0 auto; padding: calc(16px + var(--safe-t)) var(--gutter) calc(112px + var(--safe-b)); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
a.brand, a.row, a.icon-btn, a.btn { color: inherit; text-decoration: none; }
.print svg { display: block; width: 100%; height: 100%; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 34px; height: 34px; flex: none; }
.brand strong { display: block; font: 600 21px/1.05 var(--display); }
.wordmark { display: block; margin-top: 2px; font: 600 12px/1.2 var(--display); color: #fff; }
.wordmark b { font-weight: 600; color: var(--gold); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; flex: none; color: var(--paper); }
.icon-btn svg { width: 22px; height: 22px; }

.search { width: 100%; height: 46px; margin-top: 18px; padding: 0 14px; background: var(--deep); border: 1px solid var(--line); }
.search::placeholder { color: var(--soft); }
.list { margin-top: 12px; }
.row { display: block; width: 100%; padding: 16px 0 14px; text-align: left; border-bottom: 1px solid var(--line); }
.row-head { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.row-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row-time { flex: none; color: var(--soft); font-size: 14px; font-variant-numeric: tabular-nums; }
.print { display: block; width: 100%; height: 34px; margin: 10px 0 8px; color: var(--soft); }
.row[data-done="1"] .print { color: var(--gold); }
.row-meta { color: var(--soft); font-size: 13px; }

.empty { padding: 72px 0 24px; }
.empty h1 { font: 600 clamp(38px, 12vw, 58px)/1 var(--display); letter-spacing: -.02em; }
.empty p { max-width: 30ch; margin-top: 16px; color: var(--soft); font-size: 17px; }

.dock { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; padding: 10px var(--gutter) calc(12px + var(--safe-b)); background: var(--navy); border-top: 1px solid var(--line); }
.dock > * { display: flex; width: 100%; max-width: 600px; margin: 0 auto; }
.btn { min-height: 48px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 600; border: 1px solid var(--line); background: var(--raised); text-align: center; }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn.gold { color: var(--navy); background: var(--gold); border-color: var(--gold); }
.btn.big { min-height: 58px; width: 100%; font-size: 18px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); background: transparent; border-color: var(--danger); }

/* recording: the whole screen changes so the microphone state is unmistakable */
.recording { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-rows: auto 1fr auto; padding: calc(18px + var(--safe-t)) var(--gutter) calc(18px + var(--safe-b)); background: var(--gold); color: var(--navy); }
.recording.paused { background: var(--paper); }
.rec-state { font-weight: 600; font-size: 17px; }
.rec-center { display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.rec-time { font: 600 clamp(72px, 25vw, 136px)/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
#wave { width: 100%; height: 150px; margin-top: 28px; }
.rec-note { margin-top: 18px; font-size: 15px; }
.rec-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; }
.rec-actions .btn { min-height: 62px; color: var(--navy); background: transparent; border: 2px solid var(--navy); font-size: 17px; }
.rec-actions .stop { color: var(--gold); background: var(--navy); }
.recording.paused .rec-actions .stop { color: var(--paper); }

/* recording detail */
.title-input { width: 100%; margin-top: 8px; padding: 4px 0; background: transparent; border: 0; border-bottom: 1px solid transparent; font: 600 30px/1.15 var(--display); letter-spacing: -.01em; }
.title-input:focus { outline: 0; border-bottom-color: var(--gold); }
.detail-meta { margin-top: 2px; color: var(--soft); font-size: 14px; }
.player { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; margin-top: 20px; }
.play { width: 52px; height: 52px; display: grid; place-items: center; color: var(--navy); background: var(--gold); }
.play svg { width: 22px; height: 22px; }
.scrub { position: relative; display: block; width: 100%; height: 52px; color: var(--soft); touch-action: none; }
.scrub svg { display: block; width: 100%; height: 40px; }
.scrub .fill { position: absolute; inset: 0 auto 12px 0; overflow: hidden; color: var(--gold); pointer-events: none; }
.scrub .fill svg { width: var(--w, 100%); }
.scrub .clock { position: absolute; left: 0; right: 0; bottom: -4px; display: flex; justify-content: space-between; color: var(--soft); font-size: 12px; font-variant-numeric: tabular-nums; }

.panel { margin-top: 28px; }
.panel h2 { font: 600 22px/1.2 var(--display); }
.panel > p { margin-top: 6px; color: var(--soft); }
.field-label { display: block; margin-top: 16px; font-size: 14px; font-weight: 500; color: var(--soft); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; margin-top: 6px; border: 1px solid var(--line); }
.segmented button { min-height: 46px; font-weight: 500; }
.segmented button[aria-pressed="true"] { color: var(--navy); background: var(--paper); font-weight: 600; }
.stack { display: grid; gap: 8px; margin-top: 14px; }
.progress { height: 6px; margin-top: 14px; background: var(--deep); }
.progress i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s linear; }
.status { margin-top: 8px; color: var(--soft); font-size: 14px; }
.live { max-height: 150px; margin-top: 12px; overflow: hidden; color: var(--soft); font-size: 15px; display: flex; flex-direction: column; justify-content: flex-end; }
.error { margin-top: 12px; padding: 10px 12px; color: var(--danger); border: 1px solid var(--danger); font-size: 14px; }

.tabs { display: flex; gap: 22px; margin-top: 30px; border-bottom: 1px solid var(--line); }
.tabs button { min-height: 44px; color: var(--soft); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--paper); border-bottom-color: var(--gold); }
.transcript { margin-top: 10px; }
.seg { display: grid; grid-template-columns: 50px 1fr; gap: 8px; width: 100%; padding: 9px 0; text-align: left; font-size: 17px; line-height: 1.6; }
.seg time { padding-top: 3px; color: var(--soft); font-size: 13px; font-variant-numeric: tabular-nums; }
.seg.now span { color: var(--gold); }
.send-list { margin-top: 14px; border-top: 1px solid var(--line); }
.send { width: 100%; min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; border-bottom: 1px solid var(--line); font-weight: 600; }
.send small { color: var(--soft); font-weight: 400; font-size: 13px; }
.send svg { width: 18px; height: 18px; flex: none; color: var(--soft); }
.ask-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 6px; border: 1px solid var(--line); }
.ask-grid button { min-height: 46px; padding: 4px; font-size: 14px; font-weight: 500; }
.ask-grid button[aria-pressed="true"] { color: var(--navy); background: var(--paper); font-weight: 600; }
.credit { margin-top: 22px; padding: 16px; background: var(--deep); border-left: 3px solid var(--gold); }
.credit h3 { font: 600 19px/1.25 var(--display); }
.credit p { margin-top: 5px; color: var(--soft); font-size: 15px; }
.credit .soon { display: inline-block; margin-top: 10px; color: var(--gold); font-size: 14px; font-weight: 600; }

.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 9, 58, .72); }
.sheet-card { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; padding: 22px var(--gutter) calc(20px + var(--safe-b)); background: var(--paper); color: var(--navy); }
.sheet-card h2 { font: 600 26px/1.15 var(--display); }
.sheet-card p { margin-top: 10px; }
.sheet-card .fact { margin-top: 16px; padding-top: 12px; border-top: 1px solid #CFCBC0; }
.sheet-card .fact strong { display: block; }
.sheet-actions { display: grid; gap: 8px; margin-top: 20px; }
.sheet-card .btn { color: var(--navy); background: transparent; border-color: var(--navy); }
.sheet-card .btn.gold { color: var(--gold); background: var(--navy); }
.sheet-card .btn.danger { color: #A3200F; border-color: #A3200F; }

.toast { position: fixed; z-index: 50; left: var(--gutter); right: var(--gutter); bottom: calc(88px + var(--safe-b)); max-width: 560px; margin: 0 auto; padding: 12px 14px; background: var(--paper); color: var(--navy); font-weight: 500; }

.toast.low { bottom: calc(16px + var(--safe-b)); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
