/* Unmodified OpenDyslexic web fonts, SIL OFL 1.1; see OpenDyslexic-LICENSE.txt. */
@font-face { font-family: OpenDyslexic; src: url('OpenDyslexic-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: OpenDyslexic; src: url('OpenDyslexic-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: OpenDyslexic; src: url('OpenDyslexic-Italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: OpenDyslexic; src: url('OpenDyslexic-Bold-Italic.woff2') format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }
:root {
  color-scheme: dark;
  --bg: #181d19; --surface: #202721; --surface-raised: #283129;
  --field: #181f19; --text: #f2f0e7; --muted: #b0b9ad; --faint: #899683;
  --border: #3b463b; --accent: #c0d4a9; --accent-hover: #d0e2bc; --accent-ink: #1e2c19;
  --danger: #f0aaa1; --danger-bg: #3a2926; --shadow: 0 24px 90px #0004;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-family: var(--sans);
  font-size: 100%; line-height: 1.5; background: var(--bg); color: var(--text);
}
:root[data-text-size='large'] { font-size: 125%; }
:root[data-text-size='extra-large'] { font-size: 150%; }
:root[data-text-size='largest'] { font-size: 200%; }
:root[data-font='opendyslexic'] { --sans: OpenDyslexic, sans-serif; --serif: var(--sans); }
:root[data-font='opendyslexic'] * { letter-spacing: normal; }
:root[data-font='opendyslexic'] h1 { font-size: 1.65rem; line-height: 1.4; }
:root[data-font='opendyslexic'] .modal h2 { font-size: 1.3rem; line-height: 1.4; }
:root[data-theme='light'] {
  color-scheme: light; --bg: #f5f3eb; --surface: #fffef8; --surface-raised: #edeedF;
  --field: #f4f4eb; --text: #263324; --muted: #5d6b58; --faint: #5f6e58;
  --border: #d2d8c9; --accent: #3f5f35; --accent-hover: #314e29; --accent-ink: #fffef8;
  --danger: #a43f36; --danger-bg: #f6e6e1; --shadow: 0 24px 90px #24321b16;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 12px; min-height: 44px; padding: 10px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.4; transition: background .16s, border-color .16s, color .16s; }
button:hover { background: var(--surface-raised); }
button:disabled { opacity: .5; cursor: not-allowed; }
button:active:not(:disabled) { transform: translateY(1px); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden], .hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { width: 44px; height: 44px; padding: 10px; flex-shrink: 0; }
.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.primary:hover { background: var(--accent-hover); }
.secondary { background: transparent; border-color: var(--border); }
.secondary:hover { background: var(--surface-raised); border-color: var(--faint); }
.text-button { padding: 6px 0; min-height: 44px; font-size: .85rem; color: var(--accent); border-radius: 4px; }
.text-button:hover { background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.quiet-danger { color: var(--danger); font-size: .85rem; background: transparent; }
.quiet-danger:hover { background: var(--danger-bg); }
.container { max-width: 1184px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: max(26px, env(safe-area-inset-top)) max(40px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(40px, env(safe-area-inset-left)); display: flex; flex-direction: column; }
.app-header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 24px; min-height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; justify-self: start; font-size: 1.2rem; font-weight: 500; letter-spacing: -.04em; min-width: 0; max-width: 100%; }
.brand > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand > .icon { width: 34px; height: 34px; color: var(--accent); stroke-width: 1.2; }
.brand-dot { color: var(--accent); }
.tabs { display: flex; gap: 5px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.tab { color: var(--muted); border-radius: 11px; padding: 9px 17px; font-size: .85rem; gap: 8px; }
.tab .icon { width: 18px; height: 18px; }
.tab.active { color: var(--text); background: var(--surface-raised); }
.header-actions { display: flex; justify-self: end; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.status-badge { color: var(--muted); font-size: .72rem; gap: 7px; padding: 8px 3px; white-space: nowrap; min-width: 0; }
.badge-label { overflow: hidden; text-overflow: ellipsis; }
.status-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.status-badge[data-ready='true'] .status-dot { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
#timer-view { flex: 1; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 58px 0 32px; }
.eyebrow { color: var(--muted); font-size: .63rem; font-weight: 600; letter-spacing: .18em; margin: 0 0 10px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font: 400 clamp(2rem, 4vw, 3rem)/1.16 var(--serif); letter-spacing: -.045em; margin-bottom: 12px; }
/* Keep serif overhang and antialiased edges inside the title's repaint area
 * when switching panels. The gutter is offset so text alignment stays put. */
.page-heading h1 {
  contain: paint;
  background: var(--bg);
  padding: .15em .2em;
  margin: -.15em -.2em calc(12px - .15em);
}
h1 em { color: var(--accent); font-weight: 400; }
.page-heading > div > p:last-child { color: var(--muted); font-size: .88rem; margin-bottom: 0; }
h2 { font: 400 1.75rem/1.2 var(--serif); letter-spacing: -.03em; margin-bottom: 0; }
h3 { font-size: .88rem; font-weight: 500; margin: 0 0 18px; }
.timer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; align-items: start; }
.timer-stage { min-width: 0; display: flex; flex-direction: column; align-items: center; border: 1px solid var(--border); border-radius: 24px; padding: 28px 34px 0; background: var(--surface); }
.current-preset { font-size: .75rem; color: var(--muted); margin: 0 0 16px; max-width: 100%; overflow-wrap: anywhere; }
.dial { width: 280px; height: 280px; max-width: 100%; aspect-ratio: 1; flex-shrink: 0; position: relative; }
.dial-ring { width: 100%; height: 100%; display: block; }
.dial-track { fill: none; stroke: var(--border); stroke-width: 1; }
.dial-progress { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 100; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset .3s linear; }
.dial-ticks { fill: none; stroke: var(--border); stroke-width: 4; stroke-dasharray: .13 3.87; }
.dial-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dial-center .eyebrow { font-size: .56rem; letter-spacing: .15em; margin: 0 0 3px; }
.time { font-size: 3.8rem; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -.055em; line-height: 1.25; padding: 0 8px; border-radius: 10px; }
.time[data-long='true'] { font-size: clamp(1.4rem, 9vw, 2.7rem); }
.time:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.status { color: var(--muted); font-size: .75rem; margin-top: 5px; }
.quick-durations { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 4rem), 1fr)); gap: 5px; width: 100%; max-width: 342px; margin-top: 18px; }
.quick-durations button { font-size: .8rem; padding: 8px 5px; border-radius: 10px; color: var(--muted); }
.quick-durations button[aria-pressed='true'] { color: var(--accent); background: var(--surface-raised); border-color: var(--border); }
#custom-duration-btn { margin: 4px 0 14px; color: var(--muted); font-size: .73rem; }
.start-button { min-height: 52px; width: 100%; max-width: 342px; font-size: .94rem; border-radius: 14px; }
.start-button .icon { width: 18px; height: 18px; }
.session-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; width: 100%; padding: 23px 0; margin-top: 26px; border-top: 1px solid var(--border); border-radius: 0; gap: 12px; text-align: left; }
.session-summary > .icon { color: var(--muted); width: 18px; height: 18px; }
.session-summary > span:nth-child(2) { display: flex; flex: 1 1 140px; flex-direction: column; gap: 4px; min-width: 0; }
.session-summary strong { font-size: .72rem; font-weight: 400; overflow-wrap: anywhere; }
#session-interval-summary { font-size: .68rem; color: var(--muted); }
.summary-edit { display: none; }
.panel { border: 1px solid var(--border); border-radius: 24px; padding: 26px; background: var(--surface); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.section-heading .eyebrow { font-size: .56rem; }
.section-heading.small { margin-bottom: 10px; }
.section-heading.small h3 { margin: 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; min-width: 0; }
.setting-row:not(.stacked):not(.reading-setting):not(.duration-setting) { flex-wrap: wrap; }
.setting-row label, .field-label { font-size: .8rem; }
.field-hint { display: block; color: var(--muted); font-size: .65rem; margin: 4px 0 12px; }
.duration-setting, .stacked { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
input[type='text'], input[type='number'], select { min-height: 44px; width: 100%; min-width: 0; background: var(--field); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 1rem; }
input::placeholder { color: var(--faint); opacity: 1; }
input:focus-visible, select:focus-visible { outline-offset: 2px; }
select { padding-right: 25px; }
.time-input-wrapper { position: relative; width: 100%; }
.time-input-wrapper input { padding-right: 48px; font-variant-numeric: tabular-nums; }
.time-picker-btn { position: absolute; right: 2px; top: 1px; color: var(--muted); min-height: 42px; height: 42px; }
.bell-row { display: flex; align-items: center; gap: 5px; flex: 1 1 180px; min-width: 0; }
.bell-row select { font-size: .8rem; padding-left: 9px; }
.bell-preview { width: 36px; padding: 6px; color: var(--muted); }
.bell-preview .icon { width: 17px; height: 17px; }
.editor-section { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 20px; }
.interval-item { border: 1px solid var(--border); width: 100%; justify-content: space-between; text-align: left; background: var(--field); padding: 12px; margin-bottom: 8px; gap: 10px; border-radius: 12px; }
.interval-info { flex: 1; min-width: 0; }
.interval-time { display: block; font-size: .82rem; }
.interval-details { display: block; font-size: .68rem; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.interval-edit-icon { color: var(--muted); font-size: .72rem; }
.save-session-button { font-size: .78rem; margin-top: 24px; width: 100%; }
.save-session-button .icon { width: 17px; height: 17px; }
.editor-note { color: var(--muted); font-size: .65rem; text-align: center; margin: 12px 0 0; }
.empty-state { font-size: .8rem; line-height: 1.7; color: var(--muted); margin: 0; }
.mobile-editor-close { display: none; }
.app-footer { display: flex; justify-content: space-between; color: var(--faint); font-size: .66rem; padding-top: 35px; margin-top: auto; }
.library-panel { padding-bottom: 24px; }
.library-panel .page-heading { margin-bottom: 40px; }
.preset-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.preset-item { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px; min-width: 0; }
.preset-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.preset-top > .icon { color: var(--accent); width: 30px; height: 30px; }
.preset-name { margin: 26px 0 12px; font: 400 1.4rem/1.25 var(--serif); overflow-wrap: anywhere; }
.preset-duration { font: 400 2.5rem/1.2 var(--serif); margin-bottom: 16px; }
.preset-duration span { font: 400 .8rem/1.5 var(--sans); color: var(--muted); }
.preset-details { min-height: 48px; color: var(--muted); font-size: .72rem; line-height: 1.6; overflow-wrap: anywhere; }
.load-preset { width: 100%; margin-top: 22px; justify-content: space-between; font-size: .8rem; border: 1px solid var(--border); border-radius: 10px; color: var(--accent); }
.load-preset .icon { width: 17px; }
.preset-menu { position: relative; }
.preset-menu summary { display: flex; list-style: none; cursor: pointer; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; color: var(--muted); }
.preset-menu summary::-webkit-details-marker { display: none; }
.preset-menu summary:hover, .preset-menu[open] summary { background: var(--surface-raised); }
.preset-menu-actions { position: absolute; right: 0; top: 48px; background: var(--surface-raised); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 5px; min-width: 150px; border-radius: 12px; z-index: 2; }
.preset-menu-actions button { width: 100%; text-align: left; justify-content: flex-start; font-size: .8rem; }
.library-empty { grid-column: 1 / -1; text-align: center; border: 1px dashed var(--border); border-radius: 24px; padding: 70px 24px; background: var(--surface); }
.library-empty > .icon { width: 48px; height: 48px; margin-bottom: 20px; color: var(--accent); }
.library-empty h2 { margin-bottom: 14px; }
.library-empty p { max-width: 330px; margin: 0 auto 22px; color: var(--muted); font-size: .85rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: 20px; background: var(--surface); padding: 24px; gap: 20px; }
.stat { text-align: center; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat-value { font: 400 2.3rem/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .75rem; margin-top: 8px; }
.history-note { font-size: .68rem; color: var(--muted); margin: 12px 0 36px; }
.history-group { margin-bottom: 26px; }
.history-group h2 { font: 500 .72rem/1.5 var(--sans); color: var(--muted); margin-bottom: 12px; }
.history-item { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 8px; }
.history-item > .icon { width: 24px; height: 24px; color: var(--accent); }
.history-item-info { flex: 1; min-width: 0; }
.history-duration { font-size: .9rem; overflow-wrap: anywhere; }
.history-preset { font-size: .73rem; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.history-date { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 550; background: #090e0bcc; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); align-items: center; justify-content: center; overflow: auto; }
.modal-overlay.show { display: flex; }
body.dialog-open { overflow: hidden; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 30px; max-width: 460px; width: 100%; max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 40px); overflow-y: auto; overscroll-behavior: contain; box-shadow: var(--shadow); }
.modal .section-heading { margin-bottom: 24px; }
.modal h2 { margin-bottom: 0; }
.modal > h2 { margin-bottom: 24px; }
.modal .setting-row { margin-top: 22px; }
.modal .field-label { display: block; margin: 24px 0 10px; }
.modal-buttons { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 28px; }
.modal-buttons .quiet-danger { margin-right: auto; padding-left: 0; }
.modal-buttons button { font-size: .85rem; }
.muted { color: var(--muted); font-size: .8rem; line-height: 1.7; }
.time-segments { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 4.5rem), 1fr)); align-items: start; gap: 9px; margin-top: 32px; }
.time-segments > label { display: flex; flex-direction: column; align-items: stretch; min-width: 0; gap: 8px; text-align: center; }
.time-segments input { width: 100%; min-height: 70px; font-size: 1.8rem; font-weight: 300; text-align: center; padding: 8px 4px; }
.time-segments label span { font-size: .7rem; color: var(--muted); }
.settings-section + .settings-section { border-top: 1px solid var(--border); padding-top: 24px; margin-top: 24px; }
.settings-section h3 { margin-bottom: 14px; }
.settings-section .muted { margin-bottom: 20px; }
.backup-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: 10px; }
.backup-actions button { font-size: .8rem; padding: 10px; }
.backup-format { margin-top: 18px !important; }
.backup-format select { max-width: 180px; font-size: .85rem; }
.modal .reading-setting { flex-direction: column; align-items: stretch; gap: 8px; }
.modal .reading-setting select { max-width: none; font-size: 1rem; }
.reading-font-options { border: 0; padding: 0; margin: 22px 0 16px; min-width: 0; }
.reading-font-options legend { font-size: .8rem; margin-bottom: 8px; }
.font-option { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; margin-bottom: 8px; font-size: 1rem; }
.font-option:has(:checked) { border-color: var(--accent); background: var(--field); }
.font-option input { flex-shrink: 0; width: 20px; height: 20px; accent-color: var(--accent); }
.font-option span { min-width: 0; overflow-wrap: anywhere; }
.font-credit .text-button { font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }
.license-content { display: flex; flex-direction: column; }
.license-content > .section-heading, .license-content > .modal-buttons { flex-shrink: 0; }
.license-text { font: inherit; font-size: .85rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0; }
.update-notice { display: flex; justify-content: space-between; align-items: center; gap: 15px; font-size: .8rem; padding: 8px 18px; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; margin-top: 26px; }
.update-notice button { font-size: .78rem; color: var(--accent); }
.toast { position: fixed; z-index: 600; bottom: max(28px, env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 140%); max-width: min(90vw, 460px); width: max-content; padding: 14px 20px; background: var(--surface-raised); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); font-size: .85rem; text-align: center; white-space: pre-wrap; transition: transform .2s; }
.toast.show { transform: translate(-50%, 0); }
.toast.error { border-color: var(--danger); }
.toast.info, .toast.success { border-color: var(--accent); }
.toast.warning { border-color: #e7c991; }
.focus-overlay { color-scheme: dark; --bg: #151a16; --surface: #202721; --surface-raised: #283129; --text: #f2f0e7; --muted: #b0b9ad; --faint: #899683; --border: #3b463b; --accent: #c0d4a9; --accent-hover: #d0e2bc; --accent-ink: #1e2c19; --danger: #f0aaa1; --danger-bg: #3a2926; position: fixed; inset: 0; z-index: 500; background: var(--bg); color: var(--text); display: none; flex-direction: column; align-items: center; justify-content: center; padding: max(34px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(64px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); gap: 22px; overflow-y: auto; overscroll-behavior: contain; text-align: center; }
.focus-overlay.show { display: flex; }
.focus-brand { position: absolute; top: max(30px, env(safe-area-inset-top)); display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--muted); }
.focus-brand > .icon { width: 27px; height: 27px; color: var(--accent); }
.focus-overlay > .eyebrow { margin: 20px 0 0; font-size: .6rem; }
.focus-dial { width: min(52vmin, 390px); height: auto; }
.focus-time { font-size: clamp(3.4rem, 9vmin, 5.5rem); font-weight: 300; letter-spacing: -.05em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.focus-time[data-long='true'] { font-size: clamp(1.4rem, 9vmin, 3.4rem); }
.focus-lotus { height: 34px; margin-bottom: 7px; color: var(--accent); transition: opacity .3s; }
.focus-lotus .icon { width: 34px; height: 34px; }
.focus-status { font-size: .8rem; margin-top: 10px; color: var(--muted); }
.focus-session-description { color: var(--muted); font-size: .8rem; margin: -3px 0 0; max-width: 40ch; overflow-wrap: anywhere; }
.focus-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.focus-controls button, .focus-pause { min-width: 150px; min-height: 48px; font-size: .85rem; }
.session-support-hint { font-size: .7rem; line-height: 1.6; color: var(--muted); max-width: 34ch; margin: 0; }
.focus-hint { position: absolute; bottom: max(28px, env(safe-area-inset-bottom)); color: var(--muted); font-size: .73rem; }
.completion-message h2 { font-size: clamp(2rem, 6vw, 3.5rem); margin: 25px 0 15px; }
.completion-message p { color: var(--muted); font-size: .85rem; }
.completion-icon { display: flex; align-items: center; justify-content: center; width: 80px; height: 80px; border: 1px solid var(--border); border-radius: 50%; margin: 0 auto; color: var(--accent); }
.completion-icon .icon { width: 32px; height: 32px; }
.focus-overlay[data-phase='complete'] .focus-dial { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 1000px) {
  .container { padding-left: 28px; padding-right: 28px; }
  .app-header { gap: 12px; }
  .tab { padding-left: 12px; padding-right: 12px; }
  .timer-layout { grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; }
  .timer-stage { padding-left: 22px; padding-right: 22px; }
  .panel { padding: 23px; }
  .preset-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .container { padding: max(18px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) calc(98px + env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); }
  .app-header { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; min-height: 44px; }
  .brand { font-size: 1.12rem; gap: 7px; min-width: 0; }
  .brand > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand > .icon { width: 29px; height: 29px; }
  .header-actions { gap: 8px; }
  .status-badge { font-size: .63rem; max-width: 105px; }
  .badge-label { overflow: hidden; text-overflow: ellipsis; }
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; justify-content: space-around; padding: 8px max(15px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left)); border-radius: 0; border: 0; border-top: 1px solid var(--border); gap: 6px; background: var(--bg); }
  .tab { flex: 1; min-width: 0; max-width: 130px; flex-direction: column; gap: 4px; border-radius: 12px; font-size: .65rem; padding: 7px 4px; min-height: 54px; overflow-wrap: anywhere; }
  .tab .icon { width: 21px; height: 21px; }
  .tab.active { color: var(--accent); background: var(--surface); }
  .page-heading { margin: 35px 0 26px; gap: 20px; }
  .page-heading .eyebrow { font-size: .55rem; }
  h1 { font-size: clamp(2.1rem, 8vw, 2.8rem); }
  .page-heading > div > p:last-child { font-size: .8rem; }
  .timer-layout { display: block; }
  .timer-stage { padding: 22px 20px 0; border-radius: 22px; }
  .current-preset { font-size: .7rem; margin-bottom: 6px; }
  .dial { width: 244px; height: auto; }
  .time { font-size: 3.5rem; }
  .quick-durations { margin-top: 8px; gap: 3px; }
  .quick-durations button { font-size: .75rem; overflow-wrap: anywhere; }
  #custom-duration-btn { margin-bottom: 12px; margin-top: 0; }
  .start-button { min-height: 52px; }
  .session-summary { margin-top: 22px; padding: 20px 0; justify-content: flex-start; gap: 10px; }
  .session-summary strong { font-size: .72rem; }
  #session-interval-summary { font-size: .69rem; }
  .summary-edit { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; color: var(--accent); font-size: .69rem; }
  .summary-edit .icon { width: 16px; height: 16px; }
  #session-editor-home { display: none; }
  .session-settings-overlay .session-settings-content { padding: 0; }
  .session-settings-content .session-editor { border: 0; border-radius: 0; padding: 25px 24px; }
  .mobile-editor-close { display: inline-flex; }
  .bell-row select, #appearance, .backup-format select { font-size: 1rem; }
  #session-settings-done { width: 100%; margin-top: 20px; }
  .session-settings-content .setting-row { margin-top: 0; }
  .app-footer { justify-content: center; padding-top: 24px; font-size: .6rem; }
  .app-footer span:last-child { display: none; }
  .library-panel .page-heading { flex-direction: column; align-items: stretch; margin-bottom: 25px; }
  .library-panel .page-heading > button { align-self: start; font-size: .8rem; }
  .preset-list { grid-template-columns: 1fr; gap: 14px; }
  .preset-item { padding: 22px; }
  .preset-name { margin-top: 12px; }
  .preset-duration { float: right; font-size: 2rem; margin: 0 0 12px 12px; }
  .preset-details { min-height: 40px; }
  .load-preset { margin-top: 18px; }
  .stats { padding: 20px 10px; gap: 4px; border-radius: 16px; }
  .stat-value { font-size: 1.8rem; }
  .stat-label { font-size: .65rem; }
  .history-note { font-size: .63rem; margin-bottom: 28px; }
  .history-item { padding: 17px 15px; gap: 12px; }
  .history-date { font-size: .65rem; }
  .history-duration { font-size: .82rem; }
  .modal-overlay { padding: max(12px, env(safe-area-inset-top)) env(safe-area-inset-right) 0 env(safe-area-inset-left); align-items: flex-end; }
  .modal { max-width: 100%; border-radius: 24px 24px 0 0; padding: 26px 24px max(28px, env(safe-area-inset-bottom)); max-height: calc(100dvh - env(safe-area-inset-top) - 12px); }
  .modal h2 { font-size: 1.7rem; }
  .modal .section-heading { margin-bottom: 24px; }
  .modal-buttons .quiet-danger { flex-basis: 100%; justify-content: flex-start; }
  .time-segments { gap: 8px; }
  .time-segments input { min-height: 66px; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .update-notice { margin-top: 18px; padding: 8px 12px; font-size: .7rem; }
  .update-notice button { font-size: .7rem; padding: 8px 0; }
  .focus-dial { width: min(78vw, 330px); }
  .focus-time { font-size: clamp(3.5rem, 15vw, 5rem); }
  .focus-overlay { gap: 22px; }
}
@media (max-width: 360px) {
  .container { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .status-badge .badge-label { display: none; }
  .status-badge { width: 30px; }
  .timer-stage { padding: 20px 15px 0; }
  .summary-edit .icon { display: none; }
  .session-summary > .icon { width: 16px; }
  .dial { width: 222px; }
  .time { font-size: 3.2rem; }
  .focus-dial { width: 260px; max-width: 100%; }
  .focus-controls button { min-width: 120px; }
}
@media (max-height: 600px) {
  .focus-overlay { justify-content: flex-start; padding-top: 25px; padding-bottom: 22px; gap: 15px; }
  .focus-brand { position: static; }
  .focus-overlay > .eyebrow { margin-top: 0; }
  .focus-dial { width: 190px; }
  .focus-time { font-size: 3rem; }
  .focus-hint { position: static; }
}
@media (max-height: 440px) and (orientation: landscape) {
  .focus-overlay { display: none; padding: 16px 28px; }
  .focus-overlay.show { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto auto; justify-items: center; align-content: center; gap: 10px 26px; }
  .focus-brand { grid-column: 1; grid-row: 1; }
  .focus-overlay > .eyebrow { grid-column: 2; grid-row: 1; }
  .focus-dial { grid-column: 1; grid-row: 2 / 5; width: 200px; }
  .focus-session-description { grid-column: 2; grid-row: 2; }
  .focus-pause, .focus-controls { grid-column: 2; grid-row: 3; }
  .focus-controls { gap: 6px; }
  .focus-controls button { min-width: 100px; padding: 10px; }
  .session-support-hint { grid-column: 2; grid-row: 4; }
  .focus-hint { display: none; }
  .completion-message { grid-column: 1; grid-row: 2 / 5; }
  .completion-message h2 { font-size: 1.8rem; }
  .completion-icon { width: 50px; height: 50px; }
}
/* Keep numerals inside the rings while surrounding copy follows text size. */
.dial .time { font-size: min(3.8rem, 14vw, 64px); }
.dial .time[data-long='true'] { font-size: min(2.7rem, 8vw, 43px); }
.focus-time { font-size: min(5.5rem, 16vmin, 88px); }
.focus-time[data-long='true'] { font-size: min(3.4rem, 9vmin, 54px); }
.dial-center > .eyebrow, .focus-status { max-width: 85%; }
h1, h2, h3, p, label, .stat-value, .stat-label, .field-hint, .time-segments label span { overflow-wrap: anywhere; }
:root[data-reading-layout='expanded'] .focus-overlay.show { display: flex; justify-content: flex-start; }
:root[data-reading-layout='expanded'] .focus-overlay > * { flex-shrink: 0; }
:root[data-reading-layout='expanded'] .focus-brand,
:root[data-reading-layout='expanded'] .focus-hint { position: static; }
:root[data-reading-layout='expanded'] .focus-hint { display: block; margin: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
