:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --fg: #1d1d1f;
  --muted: #73737b;
  --card: #fff;
  --control: rgba(255, 255, 255, .88);
  --accent: #007aff;
  --accent-soft: #eaf3ff;
  --focus: #f05252;
  --border: rgba(40, 40, 60, .085);
  --field: #f1f1f5;
  --shadow: 0 5px 22px rgba(30, 40, 60, .025);
  --code-keyword: #8d3ac9;
  --code-string: #33803d;
  --code-number: #b35a16;
  --code-function: #1672a3;
}
html[data-theme="oled"], html[data-theme="midnight"], html[data-theme="grey"] {
  color-scheme: dark;
  --bg: #000;
  --fg: #f5f5f7;
  --muted: #a1a1aa;
  --card: #171719;
  --control: rgba(28, 28, 30, .9);
  --accent: #0a84ff;
  --accent-soft: #122b46;
  --focus: #ff6961;
  --border: rgba(255, 255, 255, .09);
  --field: #28282c;
  --shadow: 0 5px 22px rgba(0, 0, 0, .1);
  --code-keyword: #c8a3f1;
  --code-string: #a7d98b;
  --code-number: #ffb86c;
  --code-function: #82cfff;
}
html[data-theme="midnight"] { --bg: #0a1020; --card: #121d32; --field: #1b2941; --control: rgba(18, 29, 50, .92); }
html[data-theme="grey"] { --bg: #202023; --card: #2b2b2f; --field: #39393e; --control: rgba(43, 43, 47, .92); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; }
body { min-width: 280px; overflow: hidden; background: var(--bg); color: var(--fg); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; transition: background-color .2s, color .2s; }
button, input, select { font: inherit; }
button, a { touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
button, a, input, select { outline-offset: 4px; }
:focus-visible { outline: 3px solid var(--accent); }
button:active:not(:disabled), a:active { transform: scale(.98); }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.setup-screen { width: min(100%, 480px); height: 100vh; height: 100dvh; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 24px max(10px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; overflow: hidden; }
.app-header { display: flex; align-items: center; justify-content: space-between; flex: 0 0 44px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--fg); text-decoration: none; font-size: 22px; font-weight: 750; letter-spacing: -.85px; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; background: var(--accent); border-radius: 11px; color: #fff; box-shadow: 0 3px 10px #007aff20; }
.brand-mark .icon { width: 21px; height: 21px; stroke-width: 1.75; }
.brand-dot { color: var(--accent); }
.support-link { display: flex; align-items: center; justify-content: center; min-height: 44px; gap: 6px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 550; }
.support-link .icon { width: 18px; height: 18px; }
.app-panel { flex: 1 1 auto; min-height: 0; }
.home-panel { display: flex; flex-direction: column; gap: 15px; justify-content: center; }
.home-heading { padding-top: 2px; }
.eyebrow { margin: 0 0 9px; color: var(--muted); font-size: 9px; line-height: 1.2; font-weight: 650; letter-spacing: 1.8px; }
.title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: clamp(26px, 6.4vw, 31px); font-weight: 730; line-height: 1.15; letter-spacing: -1.1px; }
.subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.focus-preview { position: relative; display: flex; min-height: 104px; flex: 1 1 120px; max-height: 168px; flex-direction: column; justify-content: center; align-items: center; overflow: hidden; border-radius: 22px; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow); }
.preview-word { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; width: 100%; padding: 0 18px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: clamp(24px, 7.2vw, 33px); line-height: 1.3; font-weight: 500; letter-spacing: -1px; }
.preview-word > :first-child { text-align: right; }
.preview-focus { color: var(--focus); }
.preview-ticks { position: absolute; top: 19px; bottom: 44px; left: 50%; width: 1px; background: linear-gradient(var(--focus) 0 7px, transparent 7px calc(100% - 7px), var(--focus) calc(100% - 7px)); opacity: .6; }
.preview-caption { margin-top: 20px; color: var(--muted); font-size: 10px; letter-spacing: .1px; }
.card { padding: 17px; border: 1px solid var(--border); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.import-card { padding: 0; flex-shrink: 0; overflow: hidden; }
.file-btn, .start-btn, .preview-btn, .text-button, .btn-icon { border: 0; }
.import-button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 74px; padding: 13px 16px; text-align: left; background: transparent; }
.upload-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.upload-icon .icon { width: 21px; height: 21px; }
.import-copy { display: flex; flex: 1; flex-direction: column; gap: 5px; min-width: 0; }
.import-copy strong { font-size: 14px; font-weight: 620; letter-spacing: -.2px; }
.import-copy > span { color: var(--muted); font-size: 11px; }
.small-chevron { width: 15px; height: 15px; color: var(--muted); }
.file-row { display: flex; align-items: center; gap: 8px; margin: 0 16px; padding: 9px 0 11px; border-top: 1px solid var(--border); font-size: 10px; color: var(--muted); }
.file-name { overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.document-meta { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.speed-card { padding: 15px 17px 12px; flex-shrink: 0; }
.range-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--fg); font-size: 12px; font-weight: 550; }
.range-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.range-value strong { font-size: 20px; font-weight: 650; letter-spacing: -.5px; }
.range-value > span { color: var(--muted); font-size: 10px; font-weight: 400; }
input[type="range"] { width: 100%; height: 44px; margin: 5px 0 0; accent-color: var(--accent); cursor: pointer; }
.range-limits { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; }
.home-music-mode { color: var(--accent); font-size: 9px; }
.home-actions { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.start-btn { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; min-height: 50px; padding: 12px 17px; border-radius: 15px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; letter-spacing: -.15px; box-shadow: 0 4px 14px #007aff15; }
.start-btn:disabled { opacity: 1; background: var(--field); color: var(--muted); box-shadow: none; }
.start-btn > span { font-size: 20px; line-height: 1; }
.text-button { min-height: 44px; padding: 7px 9px; background: transparent; color: var(--accent); font-size: 11px; font-weight: 550; }
.bottom-nav { display: grid; grid-template-columns: repeat(3, 1fr); flex: 0 0 63px; padding-top: 9px; border-top: 1px solid var(--border); }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 48px; padding: 1px 4px; border: 0; background: transparent; color: var(--muted); font-size: 9px; font-weight: 550; }
.bottom-nav button[aria-selected="true"] { color: var(--accent); }
.bottom-nav .icon { width: 23px; height: 23px; }
.status-message { flex: 0 0 auto; margin: -6px 0; color: var(--muted); font-size: 10px; line-height: 1.35; text-align: center; }
.status-message:empty { display: none; }
.panel-heading { padding: 16px 0 6px; }
.library-panel { display: flex; flex-direction: column; gap: 16px; }
.count-badge { display: inline-grid; min-width: 26px; height: 26px; place-items: center; padding: 0 7px; border-radius: 9px; background: var(--field); color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.library-card { min-height: 80px; padding: 0 16px; overflow: hidden; }
.saved-documents { margin: 0; padding: 0; list-style: none; }
.saved-document { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 86px; padding: 14px 0; border-top: 1px solid var(--border); }
.saved-document:first-child { border-top: 0; }
.saved-document-details { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 7px; }
.saved-document-details strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.saved-document-details > span { color: var(--muted); font-size: 10px; }
.saved-document-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.saved-document-actions .preview-btn { min-height: 44px; padding: 0 8px; border-radius: 11px; font-size: 10px; }
.saved-document-actions .delete-btn { min-width: 44px; min-height: 44px; background: transparent; padding: 0; font-size: 20px; }
.delete-btn { color: var(--focus) !important; }
.saved-documents-empty { display: grid; place-items: center; min-height: 200px; padding: 20px; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.library-pagination { margin-top: auto; }
.preview-btn { min-width: 44px; min-height: 44px; padding: 9px 12px; border-radius: 12px; background: var(--field); color: var(--accent); font-size: 14px; font-weight: 550; }
.page-button { font-size: 17px; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.privacy-note .icon { width: 13px; height: 13px; }
.settings-panel { display: flex; flex-direction: column; gap: 16px; }
.segmented-control { display: grid; grid-template-columns: repeat(2, 1fr); flex-shrink: 0; padding: 3px; border-radius: 12px; background: var(--field); }
.segmented-control button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; font-size: 12px; font-weight: 600; color: var(--muted); }
.segmented-control button[aria-selected="true"] { background: var(--card); color: var(--fg); box-shadow: 0 1px 4px #0000000d; }
.settings-content { display: flex; min-height: 0; flex-direction: column; gap: 14px; overflow-y: auto; scrollbar-width: thin; padding: 1px; }
.settings-card { display: flex; flex-shrink: 0; flex-direction: column; gap: 10px; padding: 16px; }
.setting-label { display: flex; flex-direction: column; gap: 12px; color: var(--fg); font-size: 12px; font-weight: 550; }
.select-input { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: 11px; background: var(--field); color: var(--fg); font-size: 12px; outline-color: var(--accent); }
.select-input option { background: var(--card); color: var(--fg); }
#musicSettings { flex: 1; gap: 10px; overflow: visible; }
.music-mode-toolbar { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 9px; min-height: 44px; }
.music-mode-toolbar h2 { margin: 0; font-size: 13px; line-height: 1.3; font-weight: 650; letter-spacing: -.2px; }
.music-mode-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.3; }
.music-auto-control { display: flex; min-height: 44px; align-items: center; gap: 7px; flex-shrink: 0; color: var(--muted); font-size: 10px; font-weight: 550; cursor: pointer; }
.music-auto-control input { appearance: none; -webkit-appearance: none; position: relative; width: 31px; height: 19px; margin: 0; border-radius: 99px; background: var(--field); border: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.music-auto-control input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #00000025; transition: transform .15s; }
.music-auto-control input:checked { background: var(--accent); border-color: transparent; }
.music-auto-control input:checked::after { transform: translateX(12px); }
.music-mode-grid { display: grid; flex-shrink: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.music-mode { display: flex; min-width: 0; min-height: 76px; flex-direction: column; justify-content: center; align-items: stretch; gap: 8px; padding: 12px 11px; border: 1px solid var(--border); border-radius: 15px; background: var(--card); text-align: left; box-shadow: var(--shadow); }
.music-mode[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.music-mode-top { display: grid; grid-template-columns: 17px minmax(0, 1fr) auto; align-items: center; column-gap: 6px; }
.music-mode-icon { color: var(--accent); font-size: 18px; line-height: 1; text-align: center; }
.music-mode-top strong { color: var(--fg); font-size: 12px; font-weight: 650; letter-spacing: -.2px; }
.music-mode-range { color: var(--muted); font-size: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.music-mode.is-recommended .music-mode-range, .music-mode[data-recommended="true"] .music-mode-range { color: var(--accent); }
.music-mode-description { min-height: 12px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.music-volume-tools { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 9px; flex-shrink: 0; padding-top: 3px; }
.music-volume-control { min-width: 0; }
.music-volume-control > label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.music-volume-control > label strong { color: var(--fg); font-size: 11px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-volume-control input[type="range"] { display: block; margin: 0; }
.music-volume-tools > button, .reader-music-volume > button { align-self: end; margin-bottom: 0; padding: 8px; }
.music-mute-button[aria-pressed="true"] { color: var(--muted); background: var(--field); }
.reading-notes { display: flex; flex-shrink: 0; flex-direction: column; gap: 20px; }
.small-section-title { color: var(--muted); font-size: 10px; font-weight: 600; }
.reading-notes > div { display: flex; align-items: center; gap: 13px; }
.note-symbol { display: grid; place-items: center; flex: 0 0 35px; height: 35px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: -.5px; }
.reading-notes p { display: flex; flex-direction: column; gap: 5px; margin: 0; font-size: 11px; line-height: 1.4; }
.reading-notes strong { font-weight: 600; }
.reading-notes p span { color: var(--muted); font-size: 10px; }
.settings-content > .privacy-note { margin-top: 4px; }
.reader-screen { position: fixed; inset: 0; display: none; flex-direction: column; gap: 0; padding: max(16px, env(safe-area-inset-top)) 24px max(12px, env(safe-area-inset-bottom)); background: var(--bg); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.reader-screen.active { display: flex; }
.reader-screen.is-reading-clean .reader-header, .reader-screen.is-reading-clean .reader-progress-track, .reader-screen.is-reading-clean .reader-bottom { display: none; }
.reader-header { display: flex; width: min(100%, 920px); min-height: 48px; align-items: center; align-self: center; gap: 12px; }
.btn-icon { display: grid; min-width: 44px; min-height: 44px; padding: 8px; place-items: center; border-radius: 50%; background: transparent; color: var(--fg); font-size: 20px; }
.reader-exit { background: var(--card); border: 1px solid var(--border); }
.reader-exit .icon { width: 17px; height: 17px; transform: rotate(180deg); }
.reader-document { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 4px; }
.reader-document strong { overflow: hidden; font-size: 12px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.reader-document > span { color: var(--muted); font-size: 10px; }
.reader-progress { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.reader-fullscreen-button { flex-shrink: 0; color: var(--muted); }
.reader-fullscreen-button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.reader-music-button { flex-shrink: 0; color: var(--muted); font-size: 20px; }
.reader-music-button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.reader-music-button[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
.reader-music-panel { position: absolute; z-index: 3; top: calc(max(16px, env(safe-area-inset-top)) + 67px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 12px; width: min(calc(100% - 36px), 360px); padding: 14px 17px 9px; box-shadow: 0 15px 50px #00000020; }
.reader-music-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -5px -7px -6px 0; }
.reader-music-panel h2 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.3px; }
.reader-music-panel .setting-label { gap: 7px; font-size: 11px; }
.reader-music-volume { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 11px; }
.reader-music-notice { position: absolute; z-index: 2; top: calc(max(16px, env(safe-area-inset-top)) + 77px); left: 24px; right: 24px; display: flex; align-items: center; gap: 14px; width: min(calc(100% - 48px), 540px); margin: auto; padding: 13px 15px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.reader-music-notice > span { flex: 1; min-width: 0; font-size: 12px; line-height: 1.5; }
.reader-music-notice .preview-btn { flex: 0 0 auto; font-size: 11px; white-space: nowrap; }
@media (max-width: 380px) { .reader-music-notice { align-items: stretch; flex-direction: column; gap: 8px; } }
.reader-progress-track { width: min(100%, 920px); align-self: center; height: 3px; margin: 15px 0 0; overflow: hidden; border-radius: 5px; background: var(--field); }
#readerProgressFill { width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s linear; }
.reader-stage { position: relative; display: flex; flex: 1; min-height: 0; width: min(100%, 920px); align-items: center; justify-content: center; align-self: center; padding: 28px 0; }
.reader-focus-guides { position: absolute; top: calc(50% - 61px); bottom: calc(50% - 61px); left: 50%; width: 1px; background: linear-gradient(var(--focus) 0 9px, transparent 9px calc(100% - 9px), var(--focus) calc(100% - 9px)); opacity: .45; pointer-events: none; }
.reader-screen[data-mode="group"] .reader-focus-guides, .reader-screen[data-mode="code"] .reader-focus-guides, .reader-screen[data-mode="complete"] .reader-focus-guides { display: none; }
.word-display { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: baseline; width: 100%; max-width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: clamp(24px, 8vw, 58px); font-weight: 500; letter-spacing: 0; line-height: 1.3; white-space: pre; font-variant-ligatures: none; }
.word-before { justify-self: end; text-align: right; }
.word-focus { justify-self: center; color: var(--focus); }
.word-after { justify-self: start; text-align: left; }
.group-display { width: min(100%, 750px); padding: 0 12px; font-size: clamp(20px, 5.5vw, 38px); font-weight: 500; line-height: 1.5; letter-spacing: -.5px; text-align: center; overflow-wrap: anywhere; }
.group-display[data-kind="heading"] { font-weight: 700; line-height: 1.3; letter-spacing: -1px; }
.reader-bottom { display: flex; flex: 0 0 auto; flex-direction: column; align-items: center; padding-top: 6px; }
.reader-hint { max-width: 100%; min-height: 16px; margin: 0 0 19px; color: var(--muted); font-size: 10px; line-height: 1.4; text-align: center; }
.controls-overlay { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); box-shadow: var(--shadow); }
.skip-button { display: flex; flex-direction: column; gap: 0; min-width: 48px; min-height: 48px; padding: 0 7px; color: var(--muted); }
.skip-button > span { height: 26px; font-size: 31px; font-weight: 400; line-height: 1; }
.skip-button small { font-size: 9px; line-height: 1; font-weight: 550; }
.pause-button { width: 56px; min-height: 56px; padding: 8px; background: var(--accent); color: #fff; font-size: 22px; font-weight: 650; }
.reader-speed { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 8px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.reader-speed strong { font-weight: 550; color: var(--fg); }
.reader-speed .btn-icon { color: var(--muted); font-size: 17px; }
.code-card { display: flex; flex-direction: column; gap: 15px; width: 100%; max-width: 820px; max-height: 100%; min-height: 0; padding: 18px; border: 1px solid var(--border); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); user-select: text; -webkit-user-select: text; }
.code-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.code-heading { margin: 0; color: var(--fg); font-size: 12px; font-weight: 600; }
.code-language { padding: 4px 7px; border-radius: 6px; background: var(--field); color: var(--muted); font-family: ui-monospace, monospace; font-size: 9px; }
.code-language:empty { display: none; }
.code-content { flex: 1; min-height: 0; margin: 0; overflow: auto; color: var(--fg); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: clamp(11px, 2.6vw, 14px); line-height: 1.65; tab-size: 2; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-overflow-scrolling: touch; }
.code-keyword { color: var(--code-keyword); }
.code-string { color: var(--code-string); }
.code-comment { color: var(--muted); font-style: italic; }
.code-number { color: var(--code-number); }
.code-function { color: var(--code-function); }
.code-card-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; flex-shrink: 0; border-top: 1px solid var(--border); padding-top: 12px; }
.code-card-footer .pagination { flex: 1; justify-content: flex-start; gap: 8px; }
.code-card-footer .page-button { min-width: 36px; min-height: 44px; padding: 5px; }
.code-continue { flex: 1; width: auto; min-width: 125px; min-height: 44px; padding: 9px 13px; font-size: 12px; border-radius: 11px; white-space: nowrap; }
@media (min-width: 700px) and (min-height: 650px) {
  .setup-screen { padding-top: max(30px, env(safe-area-inset-top)); padding-bottom: 18px; gap: 25px; }
  .home-panel { gap: 19px; }
  .focus-preview { max-height: 180px; }
  .card { border-radius: 22px; }
  .reader-screen { padding-right: 48px; padding-left: 48px; }
  .reader-stage { padding: 40px 0; }
  .reader-hint { font-size: 12px; }
}
@media (max-height: 740px) {
  .setup-screen { gap: 12px; padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(7px, env(safe-area-inset-bottom)); }
  .home-panel { gap: 11px; }
  .home-heading .eyebrow { margin-bottom: 7px; }
  .focus-preview { min-height: 90px; max-height: 130px; }
  .preview-caption { margin-top: 18px; font-size: 9px; }
  .preview-ticks { top: 12px; bottom: 37px; }
  .speed-card { padding-top: 12px; padding-bottom: 10px; }
  .panel-heading { padding-top: 5px; }
  .settings-panel, .library-panel { gap: 12px; }
  .settings-content { gap: 11px; }
  .settings-card { gap: 8px; padding: 13px 15px; }
  .bottom-nav { flex-basis: 57px; padding-top: 5px; }
  .reader-hint { margin-bottom: 12px; }
  .reader-stage { padding: 20px 0; }
}
@media (max-height: 610px) {
  .setup-screen { padding: max(8px, env(safe-area-inset-top)) 18px max(4px, env(safe-area-inset-bottom)); gap: 8px; }
  .app-header { flex-basis: 38px; }
  .brand { font-size: 20px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .home-panel { gap: 8px; }
  .home-heading .eyebrow { font-size: 8px; margin-bottom: 5px; }
  .home-heading .title { font-size: 25px; }
  .home-heading .subtitle { margin-top: 4px; font-size: 11px; }
  .focus-preview { min-height: 70px; max-height: 90px; border-radius: 17px; }
  .preview-word { font-size: 26px; }
  .preview-caption { margin-top: 11px; font-size: 8px; }
  .preview-ticks { top: 9px; bottom: 27px; }
  .import-button { min-height: 61px; padding: 9px 13px; }
  .upload-icon { width: 35px; height: 35px; }
  .import-copy strong { font-size: 13px; }
  .import-copy > span { font-size: 10px; }
  .file-row { padding-top: 7px; padding-bottom: 8px; font-size: 9px; }
  .speed-card { padding: 10px 14px 9px; }
  .range-heading { font-size: 11px; }
  .range-value strong { font-size: 18px; }
  input[type="range"] { height: 44px; margin-top: 2px; }
  .range-limits { font-size: 8px; }
  .home-actions { gap: 0; }
  .start-btn { min-height: 44px; font-size: 14px; border-radius: 13px; }
  .text-button { min-height: 44px; font-size: 10px; }
  .bottom-nav { flex-basis: 49px; padding-top: 3px; }
  .bottom-nav button { min-height: 44px; gap: 3px; font-size: 8px; }
  .bottom-nav .icon { width: 20px; height: 20px; }
  .panel-heading .title { font-size: 26px; }
  .settings-panel, .library-panel { gap: 10px; }
  .settings-card { padding: 11px 13px; gap: 7px; }
  .segmented-control button { min-height: 44px; }
  .settings-content { gap: 9px; }
  #musicSettings { gap: 7px; }
  .music-mode-toolbar h2 { font-size: 11px; }
  .music-mode-toolbar p, .music-auto-control { font-size: 9px; }
  .music-auto-control { gap: 5px; }
  .music-mode-grid { gap: 6px; }
  .music-mode { min-height: 58px; gap: 5px; padding: 8px; border-radius: 13px; }
  .music-mode-top { grid-template-columns: 14px minmax(0, 1fr) auto; column-gap: 4px; }
  .music-mode-top strong { font-size: 10px; }
  .music-mode-icon { font-size: 16px; }
  .music-mode-description { font-size: 9px; line-height: 1.3; }
  .music-mode-range { font-size: 7px; }
  .music-volume-tools { gap: 7px; padding-top: 0; }
  .reading-notes { gap: 15px; padding: 13px; }
  #readingSettings > .privacy-note { display: none; }
  .saved-document { min-height: 72px; padding: 10px 0; }
  .saved-document-details strong { font-size: 11px; }
  .reader-screen { padding: max(8px, env(safe-area-inset-top)) 18px max(6px, env(safe-area-inset-bottom)); }
  .reader-header { min-height: 44px; gap: 9px; }
  .reader-progress-track { margin-top: 8px; }
  .reader-stage { padding: 15px 0; }
  .reader-hint { margin-bottom: 8px; font-size: 9px; }
  .controls-overlay { gap: 20px; padding: 5px 11px; }
  .pause-button { width: 48px; min-height: 48px; }
  .reader-speed { margin-top: 2px; }
  .code-card { padding: 12px; gap: 10px; border-radius: 16px; }
  .code-card-footer { padding-top: 8px; }
}
@media (max-width: 350px) {
  .setup-screen { padding-right: 16px; padding-left: 16px; }
  .support-link { font-size: 10px; gap: 4px; }
  .home-heading .title { font-size: 24px; }
  .saved-document { gap: 5px; }
  .saved-document-actions { gap: 1px; }
  .saved-document-actions .preview-btn { padding-right: 6px; padding-left: 6px; font-size: 9px; }
  .saved-document-actions .delete-btn { font-size: 20px; padding: 0; }
  .file-row { margin-right: 13px; margin-left: 13px; }
  .document-meta { max-width: 49%; }
  .reader-progress { font-size: 9px; }
  .reader-document strong { font-size: 11px; }
}
@media (max-height: 450px) and (orientation: landscape) {
  .setup-screen { width: min(100%, 800px); }
  .home-panel { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto 1fr; align-items: center; gap: 9px 18px; }
  .home-heading { grid-column: 1; grid-row: 1; }
  .home-heading .eyebrow, .home-heading .subtitle { display: none; }
  .home-heading .title { font-size: 24px; }
  .focus-preview { grid-column: 1; grid-row: 2 / 4; min-height: 90px; max-height: 100%; height: 100%; }
  .import-card { grid-column: 2; grid-row: 1; }
  .import-button { min-height: 50px; padding: 6px 12px; }
  .import-copy > span, .file-row { display: none; }
  .speed-card { grid-column: 2; grid-row: 2; }
  .home-actions { grid-column: 2; grid-row: 3; display: grid; grid-template-columns: 1fr; }
  .home-actions .text-button { display: block; }
  .bottom-nav { display: flex; flex: 0 0 44px; gap: 10px; justify-content: center; }
  .bottom-nav button { flex-direction: row; gap: 6px; min-width: 100px; }
  .settings-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px 14px; }
  .settings-panel .panel-heading { display: flex; align-items: center; padding: 0; }
  .settings-panel .panel-heading .eyebrow { display: none; }
  .settings-panel .panel-heading .title { font-size: 24px; }
  .settings-panel .segmented-control { align-self: center; }
  .settings-panel .settings-content { display: grid; grid-column: 1 / -1; grid-row: 2; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); align-items: start; align-content: start; gap: 14px; overflow: visible; }
  .settings-panel .settings-card { min-width: 0; }
  #readingSettings .reading-notes { grid-column: 2; grid-row: 1; gap: 11px; padding: 12px; }
  .settings-panel #musicSettings { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 10px 15px; }
  #musicSettings .music-mode-grid { grid-column: 1; grid-row: 1 / 3; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  #musicSettings .music-mode-toolbar { grid-column: 2; grid-row: 1; flex-wrap: wrap; gap: 0 8px; }
  #musicSettings .music-volume-tools { grid-column: 2; grid-row: 2; align-self: start; }
  #musicSettings .music-mode { min-height: 65px; }
  #musicSettings .music-mode-top { grid-template-columns: 14px minmax(0, 1fr); row-gap: 3px; }
  #musicSettings .music-mode-range { grid-column: 2; }
  .reader-music-panel { top: 72px; width: min(calc(100% - 210px), 360px); left: calc((100% - 180px) / 2); gap: 8px; }
  .reader-music-panel > header { min-height: 34px; }
  .reader-music-panel > header .btn-icon { min-height: 44px; }

  .reader-bottom { position: absolute; right: 14px; top: 80px; bottom: 10px; width: 170px; justify-content: center; }
  .reader-hint { max-width: 150px; }
  .controls-overlay { gap: 5px; padding: 5px; }
  .reader-stage { align-self: flex-start; width: calc(100% - 180px); }
  .reader-screen { padding-bottom: 10px; }
  .reader-speed { gap: 0; }
  .reader-speed .btn-icon { min-width: 35px; }
  .code-card-footer { gap: 5px; padding-top: 5px; }
  .code-card { gap: 7px; }
  .code-content { font-size: 10px; line-height: 1.4; }
}
.reader-screen.is-reading-clean .reader-stage { align-self: center; width: min(100%, 920px); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
