:root {
  color-scheme: dark;
  --bg: #161815;
  --side: #1a1c18;
  --panel: #21241d;
  --panel-hover: #2b2e24;
  --field: #191c17;
  --line: #383d32;
  --line-strong: #505546;
  --text: #f2eee1;
  --muted: #c4c1b3;
  --subtle: #aaa998;
  --accent: #e5bf7a;
  --accent-strong: #f3d59a;
  --moss: #c4d0a1;
  --ink: #251c0d;
  --ui: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --max-width: 1320px;
  --gutter: clamp(18px, 4.2vw, 58px);
  font-family: var(--ui);
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:is(button, a, summary, input, textarea, select, [tabindex="0"]):focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
::selection { color: var(--ink); background: var(--accent); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1.34rem; font-weight: 670; letter-spacing: -.035em; }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; top: 10px; left: 12px; padding: 10px 14px; z-index: 20; border-radius: 5px; color: var(--ink); background: var(--accent); }

#app { display: flex; min-height: 100vh; flex-direction: column; }
.topbar { border-bottom: 1px solid #30352a; background: #191b17; z-index: 3; }
.topbar-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); min-height: 74px; display: grid; grid-template-columns: minmax(151px, 1fr) auto minmax(151px, 1fr); align-items: center; gap: clamp(14px, 2.45vw, 35px); }
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; }
.brand-icon { width: 39px; height: 39px; display: grid; place-items: center; flex: none; border: 1px solid #6a5b3e; border-radius: 8px; color: var(--accent); background: #2c2b20; }
.brand-icon .icon { width: 23px; height: 23px; }
.brand strong { font-size: .88rem; font-weight: 670; line-height: 1.17; letter-spacing: -.018em; }
.navigation { display: flex; align-self: stretch; align-items: stretch; justify-content: center; gap: clamp(6px, 1.55vw, 26px); }
.nav-link { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 2px; font-size: .88rem; font-weight: 550; white-space: nowrap; color: var(--muted); transition: color .18s; }
.nav-link .icon { width: 16px; height: 16px; }
.nav-link:hover { color: var(--text); }
.nav-link.current { color: var(--accent-strong); }
.nav-link.current::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--accent); }
.topbar .new-button { justify-self: end; white-space: nowrap; }
.content { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 35px var(--gutter) 36px; outline: none; flex: 1; }
.inner-content { max-width: 1190px; }
.page-footer { max-width: var(--max-width); width: 100%; margin: 0 auto; padding: 0 var(--gutter); }
.local-notice { display: flex; align-items: center; justify-content: flex-end; gap: 7px; border-top: 1px solid var(--line); padding: 14px 0 max(19px, env(safe-area-inset-bottom)); color: var(--subtle); font-size: .79rem; }
.local-notice .icon { width: 15px; height: 15px; color: var(--moss); }

.button { display: inline-flex; width: fit-content; align-items: center; justify-content: center; gap: 7px; padding: 9px 13px; min-height: 42px; border: 1px solid transparent; border-radius: 6px; font-size: .93rem; font-weight: 670; line-height: 1.25; text-align: center; transition: background .18s, border-color .18s, color .18s, transform .18s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button .icon { width: 17px; height: 17px; }
.primary { color: var(--ink); background: var(--accent); }
.primary:hover { background: var(--accent-strong); }
.secondary { border-color: var(--line-strong); background: #292d23; color: var(--text); }
.secondary:hover { border-color: #888970; background: #35392c; }
.text-button { background: transparent; color: var(--accent-strong); }
.text-button:hover { background: #302c21; color: var(--accent-strong); }
.danger { border-color: #754e44; background: #4c3129; color: #ffdbca; }
.danger:hover { background: #644137; }
.icon-button { display: grid; place-items: center; width: 40px; min-height: 40px; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px; background: transparent; color: var(--muted); transition: background .18s; }
.icon-button:hover { background: var(--panel-hover); color: var(--text); }
.icon-button .icon { width: 17px; height: 17px; }

.opening-grid { display: grid; grid-template-columns: minmax(0, 2.12fr) minmax(268px, 1fr); gap: 18px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); min-height: 335px; border: 1px solid #414535; border-radius: 11px; overflow: hidden; background: radial-gradient(ellipse at 10% 100%, #292c22, #20231d 73%); }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: 32px 12px 30px clamp(23px, 3vw, 42px); }
.hero-label { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; color: var(--moss); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; }
.hero-label::before { content: ''; width: 20px; height: 1px; background: #a9af8b; }
.hero h1 { font-size: clamp(2.5rem, 4.55vw, 4.4rem); font-weight: 700; line-height: .94; letter-spacing: -.072em; }
.hero h1 span { display: block; color: var(--accent); }
.hero p { max-width: 310px; margin-top: 20px; color: var(--muted); line-height: 1.52; }
.hero-art { position: relative; min-width: 0; overflow: hidden; background: #333724; }
.hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: 51% 54%; }
.hero-art::after { position: absolute; inset: 0; content: ''; pointer-events: none; border-left: 1px solid #f2d7a742; background: linear-gradient(90deg, #171b1349, transparent 31%); }
.home-modes { display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--side); }
.home-modes h2 { margin: 0 0 14px 1px; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-modes .mode-grid { grid-template-columns: minmax(0, 1fr); flex: 1; }
.mode { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; min-height: 105px; overflow: hidden; border: 1px solid var(--mode-line); border-radius: 7px; padding: 13px 11px; text-align: left; background: var(--mode-bg); transition: border-color .18s, background .18s, transform .18s; }
.mode:hover { transform: translateY(-1px); border-color: var(--mode-color); background: var(--panel-hover); }
.mode:active { transform: translateY(0); }
.mode-quick { --mode-line: #4d5840; --mode-color: #cad7a8; --mode-tone: #363e2b; --mode-bg: #242b20; }
.mode-deep { --mode-line: #62543a; --mode-color: #edcc92; --mode-tone: #3b3222; --mode-bg: #2a281e; }
.mode-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--mode-color); border: 1px solid var(--mode-line); border-radius: 50%; background: var(--mode-tone); }
.mode-icon .icon { width: 20px; height: 20px; }
.mode-start { color: var(--mode-color); }
.mode-start .icon { width: 15px; height: 15px; }
.mode-text { display: grid; gap: 4px; }
.mode-text strong { font-size: 1rem; font-weight: 680; line-height: 1.22; letter-spacing: -.018em; }
.mode-text > span { color: var(--muted); font-size: .87rem; line-height: 1.39; }
.mode-tag { width: fit-content; margin-top: 3px; color: var(--mode-color); font-size: .76rem; font-weight: 650; }

.home-records { margin-top: 34px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.count { padding: 4px 7px; border-radius: 5px; background: #313627; color: var(--moss); font-size: .8rem; letter-spacing: 0; }
.segments { display: flex; flex-wrap: wrap; gap: 6px 14px; border-bottom: 1px solid var(--line); margin-bottom: 13px; }
.segments button { min-height: 40px; padding: 5px 3px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: .9rem; font-weight: 550; transition: border-color .18s, color .18s; }
.segments button:hover { color: var(--text); }
.segments button[aria-pressed="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.empty { display: flex; align-items: center; gap: 14px; min-height: 114px; padding: 17px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--side); }
.empty-symbol { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border: 1px solid #575740; border-radius: 50%; background: #2d3023; color: var(--moss); }
.empty-symbol .icon { width: 21px; height: 21px; }
.empty-copy { flex: 1; }
.empty h3 { font-size: 1.05rem; font-weight: 680; }
.empty p { margin-top: 4px; color: var(--muted); font-size: .93rem; line-height: 1.45; }
.empty .button { flex: none; }
.search-box { display: flex; gap: 7px; align-items: center; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--field); color: var(--subtle); }
.search-box .icon { width: 16px; height: 16px; }
.search-box input { width: min(26vw, 160px); min-width: 0; padding: 7px 0; border: none; background: transparent; color: var(--text); font-size: .91rem; }
.record-list { display: grid; border: 1px solid var(--line); border-radius: 8px; background: var(--side); }
.record-row { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 13px 15px; transition: background .18s; }
.record-row + .record-row { border-top: 1px solid var(--line); }
.record-row:first-child { border-radius: 7px 7px 0 0; }
.record-row:last-child { border-radius: 0 0 7px 7px; }
.record-row:only-child { border-radius: 7px; }
.record-row:hover { background: var(--panel-hover); }
.record-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: #3b3222; color: var(--accent-strong); }
.record-icon.quick { background: #333d2b; color: var(--moss); }
.record-icon .icon { width: 18px; height: 18px; }
.record-copy { display: grid; gap: 3px; flex: 1; min-width: 0; }
.record-copy strong, .record-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-copy strong { font-size: 1rem; font-weight: 670; }
.record-copy > span { color: var(--muted); font-size: .88rem; }
.record-meta { display: grid; justify-items: end; gap: 4px; flex: none; }
.status { width: fit-content; display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px; border: 1px solid #67583b; border-radius: 5px; color: var(--accent-strong); background: #322c20; font-size: .8rem; font-weight: 600; line-height: 1.25; }
.status.accepted { border-color: #505e41; background: #2a3627; color: #d5e1b9; }
.status.reviewed { border-color: #545741; background: #333426; color: #d4d7ad; }
.record-date { display: flex; gap: 5px; align-items: center; color: var(--subtle); font-size: .8rem; }
.record-date .icon { width: 13px; height: 13px; }
.record-date.due { color: var(--accent-strong); }

.page-intro { margin: 0 0 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.page-intro h1, .edit-title h1 { color: var(--text); font-size: clamp(2.1rem, 4.5vw, 3.75rem); font-weight: 680; line-height: 1.03; letter-spacing: -.065em; overflow-wrap: anywhere; }
.page-intro p { max-width: 650px; margin-top: 10px; color: var(--muted); line-height: 1.55; }
.page-section + .page-section { margin-top: 25px; }
.page-section h2 { margin-bottom: 11px; }
.panel { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.editor-panel { padding: clamp(15px, 2.55vw, 30px); }
.editor-panel + .editor-panel { margin-top: 14px; }
.panel-intro { margin-bottom: 21px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.panel-intro p { margin-top: 6px; color: var(--muted); line-height: 1.5; }
.edit-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 23px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.edit-title { min-width: 0; }
.edit-title h1 { margin-top: 11px; }
.edit-attributes, .edit-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mode-indicator { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-strong); font-size: .88rem; font-weight: 600; }
.mode-indicator.quick { color: var(--moss); }
.mode-indicator .icon { width: 17px; height: 17px; }
.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(174px, .275fr); grid-template-areas: 'entry index'; align-items: start; gap: clamp(12px, 2vw, 23px); }
.edit-content { grid-area: entry; min-width: 0; }
.edit-steps { grid-area: index; min-width: 0; padding: 15px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--side); }
.edit-steps h2 { margin: 0 7px 10px; color: var(--subtle); font-size: .82rem; font-weight: 680; letter-spacing: .04em; }
.step-list { display: grid; gap: 2px; }
.step-list a { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 7px 8px; border: 1px solid transparent; border-radius: 5px; color: var(--muted); font-size: .92rem; line-height: 1.26; }
.step-list a::before { content: ''; width: 7px; height: 7px; flex: none; border: 1px solid #8f917a; border-radius: 50%; }
.step-list a:hover { background: var(--panel-hover); color: var(--text); }
.step-list a[aria-current] { border-color: #554b35; background: #302b20; color: var(--accent-strong); }
.step-list a[aria-current]::before { background: var(--accent); border-color: var(--accent); }
.field-stack { display: grid; gap: 17px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 17px 14px; }
.field.full { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span:first-child, .rating legend { color: var(--text); font-size: .94rem; font-weight: 630; line-height: 1.36; }
.field :is(input, textarea, select) { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--field); color: var(--text); line-height: 1.44; }
.field :is(input, textarea, select):disabled { opacity: .77; }
.field textarea { min-height: 88px; resize: vertical; }
.field :is(input, textarea)::placeholder { color: var(--subtle); opacity: 1; }
.field :is(input, textarea, select):focus { border-color: var(--accent); outline-offset: 1px; }
.select-wrap { position: relative; display: grid; }
.select-wrap select { appearance: none; padding-right: 37px; }
.select-wrap .icon { position: absolute; top: 50%; right: 11px; width: 16px; height: 16px; color: var(--accent); transform: translateY(-50%); pointer-events: none; }
.rating { min-width: 0; margin: 0; padding: 0; border: 0; }
.rating legend { margin-bottom: 7px; padding: 0; }
.rate-buttons, .rate-labels { display: flex; gap: 5px; max-width: 300px; }
.rate-buttons button { flex: 1; min-height: 43px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--field); color: var(--muted); }
.rate-buttons button:not(:disabled):hover { border-color: #948366; background: var(--panel-hover); }
.rate-buttons button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--ink); font-weight: 700; }
.rate-buttons button:disabled { cursor: default; }
.rate-labels { justify-content: space-between; margin-top: 6px; color: var(--subtle); font-size: .8rem; }
.accordion { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--side); }
.accordion > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 45px; padding: 11px; color: var(--text); font-size: .93rem; font-weight: 630; list-style: none; cursor: pointer; }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary:hover { color: var(--accent-strong); }
.accordion > summary .icon { width: 17px; height: 17px; color: var(--accent); transition: transform .18s; }
.accordion[open] > summary .icon { transform: rotate(180deg); }
.accordion-body { padding: 3px 11px 13px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.editor-panel > .actions { padding-top: 14px; border-top: 1px solid var(--line); }
.option-tabs, .choice-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 15px; }
.option-tabs button:not(.button) { max-width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--field); color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.option-tabs button[aria-pressed="true"] { border-color: #776547; background: #3a3223; color: var(--accent-strong); }
.option-tabs button:not(.button):hover { border-color: var(--accent); color: var(--text); }
.option-tabs .button, .choice-chips .button { min-height: 36px; padding: 6px 9px; }
.choice-chips { margin: -4px 0 0; }
.choice-chip { max-width: 100%; overflow-wrap: anywhere; }
.option-name-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.option-name-row .icon-button { width: 44px; min-height: 44px; }
.comparison { min-width: 0; overflow-x: auto; border: 1px solid var(--line-strong); border-radius: 6px; }
.comparison table { width: 100%; border-spacing: 0; font-size: .93rem; }
.comparison :is(td, th) { min-width: 165px; max-width: 320px; padding: 10px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.comparison thead th { background: #373323; color: var(--accent-strong); }
.comparison th:first-child { position: sticky; left: 0; z-index: 1; }
.comparison tbody th { background: #2a2e23; color: var(--text); font-weight: 630; }
.comparison td { background: var(--field); color: var(--muted); }
.comparison .blank { color: var(--subtle); }
.comparison tr > :last-child { border-right: 0; }
.comparison tbody tr:last-child > * { border-bottom: 0; }
.callout { display: flex; gap: 11px; padding: 15px; border: 1px solid #50583e; border-left: 3px solid #8e9b6d; border-radius: 6px; background: #2a3023; color: var(--moss); }
.callout > .icon { width: 20px; height: 20px; margin-top: 2px; }
.callout strong { font-size: 1rem; }
.callout p { color: var(--muted); margin-top: 4px; line-height: 1.5; }
.content > .callout { margin-bottom: 14px; }
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 7px; }
.summary-item { min-width: 0; padding: 10px 11px; border-left: 2px solid #62684d; background: var(--field); }
.summary-item dt { color: var(--subtle); font-size: .86rem; }
.summary-item dd { margin: 5px 0 0; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.snapshot .button { margin: 3px 0 -7px; }

.metric-grid, .data-grid { display: grid; gap: 12px; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric, .data-panel { min-width: 0; padding: 17px; }
.metric { position: relative; border-top: 2px solid #756547; }
.metric-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 10px; border: 1px solid #625637; border-radius: 50%; background: #383224; color: var(--accent-strong); }
.metric-icon .icon { width: 19px; height: 19px; }
.metric h2, .data-panel h2 { font-size: 1rem; letter-spacing: -.02em; }
.metric strong { display: block; margin: 5px 0 4px; color: var(--accent-strong); font-size: clamp(1.8rem, 3.55vw, 2.9rem); font-weight: 650; line-height: 1.08; letter-spacing: -.06em; }
.metric p, .data-panel p { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.data-panel p { margin: 4px 0 12px; }
.account-panel { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 14px; }
.account-panel .metric-icon { flex: none; }
.account-panel .actions { margin-top: 11px; }
.account-panel p.account-email { margin-bottom: 4px; color: var(--text); overflow-wrap: anywhere; }
.account-panel p.account-status { margin-bottom: 0; color: var(--accent); }
.account-panel p.account-error { color: #ffd7bf; }
.chart-panel { margin-top: 12px; }
.chart-empty { display: grid; place-items: center; min-height: 112px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 6px; color: var(--muted); text-align: center; }
.chart-layout { display: flex; gap: 8px; }
.chart-scale { flex: none; display: grid; align-content: space-between; height: 122px; margin: 0; padding: 0; list-style: none; color: var(--subtle); font-size: .8rem; }
.chart-scroll { flex: 1; overflow-x: auto; }
.chart-bars { display: flex; gap: 13px; width: max-content; min-width: 100%; margin: 0; padding: 0 12px; list-style: none; background: repeating-linear-gradient(to top, #414537 0 1px, transparent 1px 24px) 0 8px / 100% 120px no-repeat; }
.chart-bars li { display: grid; width: 61px; text-align: center; }
.chart-tower { display: flex; align-items: end; justify-content: center; height: 128px; }
.chart-bar { display: grid; justify-content: center; align-content: start; width: 30px; height: calc(var(--rating) * 24px); padding: 3px; border-radius: 4px 4px 0 0; background: linear-gradient(#e4c38a, #b08b54); color: var(--ink); font-size: .8rem; font-weight: 700; }
.chart-date { padding: 5px 0; color: var(--muted); font-size: .79rem; white-space: nowrap; }

.warning { margin-bottom: 14px; padding: 10px 12px; border: 1px solid #845e4b; border-radius: 6px; background: #422d25; color: #ffd7bf; line-height: 1.5; }
.toast { position: fixed; z-index: 5; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); max-width: calc(100vw - 36px); padding: 11px 14px; border: 1px solid #75684c; border-radius: 6px; background: #302b21; color: var(--text); font-size: .93rem; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.visible { opacity: 1; transform: translateY(0); }
dialog { width: min(640px, calc(100% - 24px)); max-height: calc(100% - 26px); padding: 19px; border: 1px solid #6b6047; border-radius: 9px; background: var(--panel); box-shadow: 0 24px 90px #0009; color: var(--text); }
dialog::backdrop { background: #10130fd0; backdrop-filter: blur(3px); }
dialog p { color: var(--muted); line-height: 1.55; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 13px; }
.dialog-head .icon-button { flex: none; }

@media (max-width: 960px) {
  .topbar-inner { gap: 15px; }
  .navigation { gap: 14px; }
  .nav-link .icon { display: none; }
  .opening-grid { grid-template-columns: minmax(0, 1.8fr) minmax(242px, 1fr); }
  .home-modes { padding: 13px; }
}

@media (max-width: 790px) {
  .opening-grid { grid-template-columns: 1fr; gap: 14px; }
  .hero { min-height: 298px; }
  .hero h1 { font-size: clamp(2.65rem, 7.3vw, 4.2rem); }
  .home-modes .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 705px) {
  .topbar-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 0 7px; padding-top: 11px; }
  .brand-icon { width: 34px; height: 34px; }
  .brand-icon .icon { width: 20px; height: 20px; }
  .brand strong { font-size: .82rem; }
  .topbar .new-button { grid-column: 2; grid-row: 1; min-height: 38px; padding: 7px 10px; font-size: .82rem; }
  .topbar .new-button .icon { width: 15px; height: 15px; }
  .navigation { grid-column: 1 / -1; justify-content: space-between; gap: 2px; margin-top: 7px; }
  .nav-link { min-height: 42px; padding: 6px 1px; font-size: .81rem; }
  .content { padding-top: 20px; padding-bottom: 30px; }
  .home-records { margin-top: 25px; }
  .edit-layout { grid-template-columns: 1fr; grid-template-areas: 'index' 'entry'; gap: 11px; }
  .edit-steps { padding: 4px; }
  .edit-steps h2 { display: none; }
  .step-list { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 2px; padding: 1px; }
  .step-list a { min-height: 38px; gap: 5px; padding: 6px 8px; font-size: .85rem; white-space: nowrap; }
  .step-list a:focus-visible { outline-offset: -2px; }
  .step-list a::before { display: none; }
}

@media (max-width: 520px) {
  :root { --gutter: 15px; }
  .brand { gap: 6px; }
  .navigation { gap: 1px; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 22px 18px 21px; }
  .hero-label { margin-bottom: 11px; }
  .hero h1 { font-size: clamp(2.42rem, 10.5vw, 3.55rem); }
  .hero p { margin-top: 13px; }
  .hero-art { min-height: clamp(116px, 34vw, 164px); }
  .hero-art img { object-position: 52% 49%; }
  .hero-art::after { border-left: none; border-top: 1px solid #e6c38b43; background: linear-gradient(#141a1142, transparent 30%); }
  .home-modes .mode-grid, .mode-grid, .data-grid, .field-grid { grid-template-columns: 1fr; gap: 8px; }
  .home-modes h2 { margin-bottom: 10px; }
  .mode { min-height: 78px; }
  .mode-icon { width: 34px; height: 34px; }
  .mode-icon .icon { width: 17px; height: 17px; }
  .mode-text strong { font-size: .98rem; }
  .mode-text > span { font-size: .86rem; }
  .segments { gap: 5px 8px; }
  .segments button { padding: 4px 2px; font-size: .8rem; }
  .empty { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; padding: 13px; }
  .empty > .button { grid-column: 2; justify-self: start; }
  .empty-symbol { width: 35px; height: 35px; }
  .empty-symbol .icon { width: 17px; height: 17px; }
  .empty p { font-size: .88rem; }
  .field-grid { gap: 13px; }
  .summary { grid-template-columns: 1fr; gap: 6px; }
  .comparison :is(td, th) { min-width: 150px; }
  .comparison tr > :first-child { min-width: 113px; max-width: 113px; padding-right: 7px; padding-left: 7px; }
  .metric-grid { gap: 7px; }
  .metric { padding: 10px; }
  .metric h2 { overflow-wrap: anywhere; }
  .record-row { gap: 7px; padding: 9px; }
  .record-icon { width: 31px; height: 31px; }
}

@media (max-width: 360px) {
  .navigation { justify-content: space-between; min-width: 0; gap: 5px; overflow-x: auto; scrollbar-width: thin; }
  .nav-link { flex: none; padding-right: 0; padding-left: 0; font-size: .72rem; }
  .nav-link:focus-visible { outline-offset: -2px; }
  .mode-tag { margin-top: 1px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
