:root { color-scheme: dark; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; --viewport-height: 100dvh; --viewport-top: 0px; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #080a0e; color: #fff; overscroll-behavior: none; }
button, input, textarea, select { font: inherit; }
button, .button { border: 1px solid #4a4d56; border-radius: 12px; padding: 10px 14px; color: #fff; background: #24272e; cursor: pointer; text-decoration: none; text-align: center; touch-action: manipulation; font-size: 14px; }
button:hover:not(:disabled), .button:hover { background: #373b46; }
button:disabled { opacity: .42; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #b2d7ff; outline-offset: 3px; }
[hidden] { display: none !important; }
.primary { background: #3058b7; border-color: #7596e6; }
.muted, small { color: #b7bcc8; font-size: 13px; line-height: 1.65; }
.error, .silent-warning { color: #ffce97; }
.app { position: fixed; top: var(--viewport-top); left: 0; width: 100%; height: var(--viewport-height); overflow: hidden; }
.video-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #080a0e; }
#preview { display: block; max-width: 100%; max-height: 100%; width: auto; height: 100%; object-fit: contain; }
.camera-placeholder { position: absolute; bottom: 205px; left: 12px; right: 12px; text-align: center; display: grid; justify-items: center; gap: 10px; z-index: 15; background: #10131ce8; border-radius: 16px; padding: 12px; }
.app:not(.camera-ready) .teleprompter-overlay { opacity: .3; }
.app[data-state="rehearsing"] .teleprompter-overlay { opacity: 1; }
.app[data-state="rehearsing"] .camera-placeholder { display: none; }
.camera-placeholder p { margin: 0; }
.status-bar { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); z-index: 20; display: flex; justify-content: space-between; gap: 8px; font-size: 12px; pointer-events: none; }
#recBadge, .sound-status { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 18px; background: #10131cdc; }
#recDot { width: 9px; height: 9px; border-radius: 50%; background: #757b88; }
.app[data-state="recording"] #recDot { background: #ff514c; box-shadow: 0 0 12px #ff514c; }
.sound-status { max-width: 58%; }
#audioMeter { width: 42px; height: 12px; }
.teleprompter-overlay { position: absolute; --reading-top: calc(clamp(58px, calc(var(--viewport-height) * .16), 140px) + env(safe-area-inset-top, 0px)); top: var(--reading-top); left: 50%; transform: translateX(-50%); width: min(calc(100% - 24px), var(--reading-width, 480px)); --reading-height: max(64px, min(420px, calc(var(--viewport-height) * .48), calc(var(--viewport-height) - var(--reading-top) - 205px - env(safe-area-inset-bottom, 0px)))); height: var(--reading-height); border-radius: 18px; background: linear-gradient(#090c13a6, #090c1366 75%, transparent); z-index: 10; }
.prompter-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 10px 14px 0; scrollbar-width: thin; scrollbar-color: #ffffff55 transparent; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(#000 85%, transparent); -webkit-mask-image: linear-gradient(#000 85%, transparent); scroll-behavior: auto; }
.prompter-text { font-size: var(--prompter-font-size, 28px); line-height: 1.55; text-align: center; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; text-shadow: 0 2px 8px #000, 0 0 20px #000; }
.prompt-sentence { display: block; margin-bottom: .5em; color: #bec2cc; opacity: .55; transition: color .15s, opacity .15s; }
.prompt-sentence.current { opacity: 1; color: #fff1c2; }
.prompter-text::after { content: ''; display: block; height: max(0px, calc(var(--reading-height) - 1.55em - 10px)); }
.countdown { position: absolute; inset: 0; z-index: 25; display: grid; place-content: center; text-align: center; background: #080a0e66; font-size: 80px; font-weight: 700; pointer-events: none; text-shadow: 0 4px 20px #000; }
.bottom-dock { position: absolute; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); z-index: 30; display: grid; justify-items: center; gap: 7px; }
#pageHint { margin: 0; max-width: 640px; font-size: 12px; line-height: 1.4; text-align: center; text-shadow: 0 1px 6px #000; }
.reading-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: min(100%, 480px); }
.reading-tools button { padding: 8px 4px; font-size: 12px; background: #161b26db; }
.capture-controls { display: grid; grid-template-columns: 1fr 80px 1fr; gap: 16px; align-items: center; width: min(100%, 400px); }
.capture-controls .secondary { justify-self: center; padding: 10px; font-size: 13px; }
.record-control { justify-self: center; width: 72px; height: 72px; border: 2px solid #fffc; border-radius: 50%; padding: 6px; background: #151821cc; display: grid; place-items: center; box-shadow: 0 6px 24px #0008; }
.record-control::before { content: ''; position: absolute; width: 56px; height: 56px; border-radius: 50%; border: 1px solid #fff6; pointer-events: none; }
.record-symbol { width: 46px; height: 46px; border-radius: 50%; background: #ff453a; transition: width .15s, height .15s, border-radius .15s; }
.record-control.recording .record-symbol { width: 26px; height: 26px; border-radius: 6px; }
.history-button { padding: 2px 12px; font-size: 12px; background: transparent; border-color: transparent; color: #c7cad4; }
.silent-warning { padding: 5px 8px; font-size: 12px; background: #342311ed; border-radius: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
dialog { top: var(--viewport-top); bottom: auto; margin: 0 auto; width: min(calc(100% - 20px), 580px); max-height: calc(var(--viewport-height) - 8px); padding: 22px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #434955; border-radius: 18px; background: #161a23; color: #fff; }
dialog::backdrop { background: #05070bcc; }
dialog h2 { margin: 0 0 10px; font-size: 21px; }
dialog p { line-height: 1.6; font-size: 13px; }
dialog label { display: block; margin: 16px 0 8px; font-size: 14px; }
dialog label input[type="checkbox"] { width: auto; }
textarea, select, input[type="number"] { width: 100%; background: #0b1018; color: white; border: 1px solid #4b5160; border-radius: 8px; padding: 10px; font-size: 16px; }
textarea { height: min(180px, calc(var(--viewport-height) * .26)); min-height: 90px; resize: vertical; line-height: 1.6; }
textarea.short-text { height: 90px; }
input[type="range"] { width: 100%; accent-color: #a0caff; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-grid label { min-width: 0; }
.field-grid select { margin-top: 6px; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
#reviewVideo { width: 100%; max-height: calc(var(--viewport-height) * .42); background: #000; display: block; }
#exportProgress { width: 100%; }
fieldset { border: 1px solid #444c5b; border-radius: 10px; padding: 12px; }
.take-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #353a44; }
.take-row button:first-child { flex: 1; text-align: left; }
@media (max-height: 480px) {
  .bottom-dock { gap: 3px; bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
  .record-control { width: 48px; height: 48px; }
  .record-control::before { width: 38px; height: 38px; }
  .record-symbol { width: 30px; height: 30px; }
  .capture-controls { grid-template-columns: 1fr 56px 1fr; }
  .reading-tools button { padding: 5px; }
  .teleprompter-overlay { --reading-height: max(48px, min(200px, calc(var(--viewport-height) - var(--reading-top) - 140px - env(safe-area-inset-bottom, 0px)))); }
  .camera-placeholder { bottom: 150px; }
  .camera-placeholder p, .camera-placeholder small { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
