:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: light-dark(#302b26, #e9e3da);
  background: light-dark(#f7f4ee, #1c1b18);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: light-dark(#f7f4ee, #1c1b18); }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, summary, select { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 16px; border-right: 1px solid light-dark(#dfd8ce, #39352f); background: light-dark(#eee8dd, #282521); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; color: inherit; text-decoration: none; font-weight: 700; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: #fffaf1; background: #7b5d43; font-family: Georgia, serif; }
.primary-action { display: block; margin-bottom: 22px; padding: 11px 14px; border-radius: 10px; color: light-dark(#fffaf3, #2b251f); background: light-dark(#3f342a, #e4d4bf); text-align: center; text-decoration: none; font-size: 14px; font-weight: 700; }
.global-add { position: relative; }
.global-add > summary { cursor: pointer; list-style: none; }
.global-add > summary::-webkit-details-marker { display: none; }
.global-add-panel { position: absolute; z-index: 45; top: 48px; left: 0; width: min(390px, calc(100vw - 28px)); max-height: calc(100vh - 90px); padding: 16px; overflow-y: auto; border: 1px solid light-dark(#d8cfc3, #484139); border-radius: 13px; background: light-dark(#fffdf9, #26231f); box-shadow: 0 18px 52px rgba(0,0,0,.22); }
.global-add-heading { display: grid; gap: 3px; margin-bottom: 10px; }
.global-add-heading span { font-size: 11px; }
.global-add-panel > details { border-top: 1px solid light-dark(#eee7dd, #3b3731); }
.global-add-panel > details > summary { padding: 11px 2px; font-size: 13px; font-weight: 750; }
.global-add-panel > details > form { padding: 2px 0 14px; }
.global-add-panel textarea { resize: vertical; }
.navigation { display: grid; gap: 4px; }
.navigation-label { padding: 16px 10px 6px; color: light-dark(#8a8177, #aaa197); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.navigation a, .nav-button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: 9px; color: light-dark(#625b53, #c5beb5); background: transparent; text-decoration: none; text-align: left; }
.navigation a.active { color: light-dark(#2e2924, #f1ebe2); background: light-dark(#ddd2c2, #403a33); font-weight: 700; }
.sidebar-footer { margin-top: auto; padding: 0 8px; color: light-dark(#8b837a, #9d958c); font-size: 12px; line-height: 1.5; }
.sidebar-footer .nav-button { margin: 8px -8px 0; font-size: 13px; }

.main-content { min-width: 0; min-height: 100vh; background: light-dark(#fbfaf7, #201f1c); }
.page { margin: 0 auto; padding: 48px 38px 70px; }
.page-narrow { max-width: 900px; }
.page-wide { max-width: 1500px; }
.page-header { margin-bottom: 30px; }
.horizontal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.page-header h1 { margin: 4px 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 5vw, 52px); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.eyebrow { margin: 0; color: light-dark(#8f7862, #c4aa8e); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.lead, .muted { color: light-dark(#7e766e, #aaa198); }
.lead { margin: 0; }
.grow { flex: 1; }
.numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }

.button, details > summary.button { display: inline-flex; align-items: center; justify-content: center; padding: 9px 13px; border: 1px solid light-dark(#d9d1c6, #46413a); border-radius: 9px; color: inherit; background: light-dark(#fff, #2a2824); text-decoration: none; font-weight: 650; list-style: none; }
.button-primary { border-color: transparent; color: light-dark(#fffaf4, #2a231d); background: light-dark(#7a5d43, #cdb497); }
.button-small { padding: 6px 9px; font-size: 11px; }
.button-danger { border-color: #a85047; color: #fff; background: #8e3f38; }
.quiet-button { display: inline-flex; align-items: center; justify-content: center; padding: 5px 8px; border: 0; border-radius: 7px; color: light-dark(#786a5e, #b9ab9f); background: light-dark(#eee8df, #39352f); text-decoration: none; font-size: 11px; white-space: nowrap; }
.inline-actions, .row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.inline-actions form, .row-actions form { margin: 0; }
.danger-zone { margin-top: 28px; font-size: 12px; }
.danger-zone a { color: #a85047; }
.header-actions { display: flex; align-items: flex-start; gap: 8px; }
.popover-panel { position: relative; }
.popover-panel[open] .form-panel { position: absolute; z-index: 20; top: 46px; right: 0; width: min(370px, calc(100vw - 40px)); max-height: 75vh; overflow: auto; }
.editor-panel { margin-bottom: 28px; }
.editor-panel .form-panel { margin-top: 12px; }
.form-panel { padding: 18px; border: 1px solid light-dark(#ddd5ca, #423e38); border-radius: 13px; background: light-dark(#fff, #282622); box-shadow: 0 14px 40px light-dark(rgba(70,56,38,.14), rgba(0,0,0,.35)); }
.stacked-form { display: grid; gap: 10px; }
.stacked-form p { display: grid; gap: 5px; margin: 0; }
.stacked-form label { font-size: 12px; font-weight: 700; }
.stacked-form input, .stacked-form textarea, .stacked-form select, .capture-box textarea, .task-move-form select { width: 100%; padding: 9px 10px; border: 1px solid light-dark(#d9d2c8, #49443e); border-radius: 8px; color: inherit; background: light-dark(#fff, #211f1c); }
.stacked-form input[type="checkbox"] { width: auto; justify-self: start; }
.form-error { color: #a43e36; }

.capture-box { margin-bottom: 36px; padding: 18px; border: 1px solid light-dark(#ddd5ca, #423e38); border-radius: 13px; background: light-dark(#fff, #282622); box-shadow: 0 7px 22px light-dark(rgba(70,56,38,.06), rgba(0,0,0,.12)); }
.capture-box textarea { resize: vertical; min-height: 80px; border: 0; outline: none; background: transparent; font-size: 16px; }
.capture-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; border-top: 1px solid light-dark(#eee9e2, #3a3732); font-size: 12px; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; }
.plan-card { display: flex; align-items: center; gap: 12px; min-height: 88px; margin-top: 8px; padding: 15px; border: 1px solid light-dark(#d9cbbb, #4c4035); border-radius: 12px; background: light-dark(#f3eadf, #312a24); }
.plan-card p { margin: 5px 0 0; font-size: 12px; }
.plan-picker { margin: 14px 0 0; }
.plan-picker .form-panel { margin-top: 10px; }

.section-block { margin-top: 30px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h2, .agenda > h2 { margin: 0; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.section-heading a { color: light-dark(#80664e, #c9ae8f); font-size: 12px; }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.simple-list { display: grid; gap: 8px; }
.simple-list.compact { gap: 0; }
.simple-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid light-dark(#ece6de, #36332e); }
.simple-row p { margin: 4px 0 0; font-size: 12px; }
.simple-row time { min-width: 44px; color: light-dark(#8f877e, #9c948c); font-size: 12px; }
.empty-state, .column-empty { padding: 16px; border: 1px dashed light-dark(#ddd5ca, #464039); border-radius: 10px; color: light-dark(#8b8177, #a59d95); font-size: 13px; }
.tag { display: inline-flex; padding: 3px 8px; border-radius: 999px; color: light-dark(#6f665d, #bbb2a8); background: light-dark(#eee8df, #39352f); font-size: 11px; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #9a7556; }
.timeline { display: grid; gap: 15px; }
.timeline article { display: grid; grid-template-columns: 42px 1fr; gap: 12px; }
.timeline time { color: light-dark(#9d948a, #89827b); font-size: 11px; }
.timeline p { margin: 5px 0 0; color: light-dark(#625a52, #bbb3ab); font-size: 13px; line-height: 1.5; }

.filter-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 18px; padding-bottom: 12px; overflow-x: auto; }
.filter-tabs a { padding: 8px 12px; border-radius: 9px; color: light-dark(#746c64, #aaa299); text-decoration: none; white-space: nowrap; }
.filter-tabs a.active { color: light-dark(#fffaf4, #2a231d); background: light-dark(#7a5d43, #cdb497); }
.inbox-count { margin-left: auto; color: light-dark(#8c8379, #9f978f); font-size: 12px; white-space: nowrap; }
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.board-column { min-width: 230px; padding: 12px; border-radius: 12px; background: light-dark(#f0ebe3, #292722); }
.board-column-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.board-column-heading h2 { margin: 0; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.board-column-heading span { color: light-dark(#8b837a, #9f978f); font-size: 12px; }
.task-column-list { min-height: 80px; display: grid; align-content: start; gap: 8px; }
.task-column-list.is-drop-target { outline: 2px dashed light-dark(#9b7657, #cdb497); outline-offset: 3px; }
.task-card { position: relative; padding: 13px; border: 1px solid light-dark(#ded6cb, #413d37); border-radius: 10px; background: light-dark(#fff, #211f1c); box-shadow: 0 3px 10px light-dark(rgba(61,48,33,.05), rgba(0,0,0,.12)); }
.task-card-handle { position: absolute; top: 9px; right: 9px; color: light-dark(#aaa197, #7f7972); cursor: grab; }
.task-card strong { display: block; padding-right: 20px; font-size: 13px; line-height: 1.4; }
.task-card p { margin: 7px 0; color: light-dark(#81776e, #a59d95); font-size: 11px; }
.task-meta { display: flex; gap: 8px; color: light-dark(#8c8379, #9f978f); font-size: 10px; }
.task-move-form { margin-top: 10px; }
.task-move-form select { padding: 5px 7px; font-size: 11px; }
.task-card-ghost { opacity: .45; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.project-card { padding: 16px; border: 1px solid light-dark(#e1d9cf, #403c36); border-radius: 11px; background: light-dark(#fff, #282622); }
.project-card h3 { margin: 10px 0 5px; font-size: 15px; }
.project-card p { min-height: 38px; margin: 0 0 12px; color: light-dark(#756c63, #aaa198); font-size: 12px; line-height: 1.5; }

.journal-feed { display: grid; }
.journal-entry { display: grid; grid-template-columns: 90px 1fr; gap: 18px; padding: 22px 0; border-bottom: 1px solid light-dark(#e8e2da, #37342f); }
.entry-time { color: light-dark(#948a80, #948c84); font-size: 11px; line-height: 1.5; }
.entry-meta { display: flex; align-items: center; gap: 8px; color: light-dark(#8a8178, #9f978f); font-size: 11px; }
.entry-content h2 { margin: 9px 0 6px; font-size: 17px; }
.entry-content > p { margin: 7px 0 0; line-height: 1.6; }

.notice-box { margin: 16px 0 20px; padding: 14px 16px; border: 1px solid light-dark(#d9cbbb, #4c4035); border-radius: 10px; background: light-dark(#f3eadf, #312a24); font-size: 13px; }
.notice-box p { margin: 5px 0 0; }
.notice-box.subtle { color: light-dark(#746a61, #aaa198); background: transparent; }
.agenda { display: grid; gap: 0; }
.agenda > h2 { margin-bottom: 8px; }
.agenda-row { display: grid; grid-template-columns: 92px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid light-dark(#e8e2da, #37342f); }
.agenda-row time { display: grid; color: light-dark(#756b62, #aaa198); font-size: 12px; }
.agenda-row h3 { margin: 7px 0 4px; font-size: 15px; }
.agenda-row p { margin: 0; color: light-dark(#827970, #a59d95); font-size: 12px; }
.activity-mark { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-grid article { display: grid; gap: 5px; padding: 16px; border: 1px solid light-dark(#e0d8ce, #403c36); border-radius: 11px; background: light-dark(#fff, #282622); }
.stat-grid span, .stat-grid small { color: light-dark(#837970, #a9a097); font-size: 11px; }
.stat-grid strong { font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.stats-columns { margin-top: 30px; }

.form-page { max-width: 680px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.danger-link { color: light-dark(#984c44, #df8e83); }
.is-inactive { opacity: .58; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; color: light-dark(#817970, #aaa198); font-size: 12px; }

.budget-page { max-width: 1100px; }
.budget-period-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.budget-period-toolbar h2 { margin: 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; }
.budget-month-picker { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.budget-month-picker label { color: light-dark(#817970, #aaa198); font-size: 11px; font-weight: 700; }
.budget-month-picker input, .budget-filters input, .budget-filters select { min-height: 38px; padding: 7px 9px; border: 1px solid light-dark(#d9d2c8, #49443e); border-radius: 8px; color: inherit; background: light-dark(#fff, #211f1c); }
.budget-summary .expense-value, .expense-value { color: light-dark(#8f4f43, #d99588); }
.budget-summary .income-value, .income-value { color: light-dark(#467058, #8fc4a1); }
.budget-overview { gap: 18px; }
.budget-overview .section-block { min-width: 0; }
.budget-plan-panel, .budget-comparison { min-height: 205px; }
.budget-plan-panel > p, .budget-comparison > p { line-height: 1.5; }
.budget-plan-form { margin-top: 15px; }
.budget-progress { height: 9px; overflow: hidden; border-radius: 999px; background: light-dark(#ebe4db, #39352f); }
.budget-progress span { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: light-dark(#a96a4b, #d39272); }
.budget-comparison > strong { display: block; margin: 9px 0 3px; font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.budget-category-stats, .budget-trend-list { display: grid; gap: 7px; }
.budget-category-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid light-dark(#e1d9cf, #403c36); border-radius: 10px; color: inherit; background: light-dark(#fff, #282622); text-decoration: none; }
.budget-category-row small { display: block; margin-top: 3px; color: light-dark(#817970, #aaa198); font-size: 10px; }
.budget-bar { grid-column: 2 / -1; height: 5px; overflow: hidden; border-radius: 999px; background: light-dark(#eee8df, #39352f); }
.budget-bar i { display: block; width: var(--bar-width); height: 100%; border-radius: inherit; background: var(--bar-color); }
.budget-trend-row { display: grid; grid-template-columns: 64px minmax(100px, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; color: inherit; border-bottom: 1px solid light-dark(#ece6de, #36332e); text-decoration: none; font-size: 11px; }
.budget-trend-bars { display: grid; gap: 3px; }
.budget-trend-bars i { display: block; width: var(--bar-width); min-width: 2px; height: 5px; border-radius: 999px; }
.budget-trend-bars .expense-bar { background: light-dark(#a96a4b, #d39272); }
.budget-trend-bars .income-bar { background: light-dark(#4f7c62, #8fc4a1); }
.budget-chart-legend { display: flex; align-items: center; gap: 6px; color: light-dark(#817970, #aaa198); font-size: 10px; }
.budget-chart-legend span { width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; }
.budget-chart-legend .expense-mark { background: #a96a4b; }
.budget-chart-legend .income-mark { background: #4f7c62; }
.budget-income-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.budget-filters { display: flex; align-items: end; gap: 8px; margin-bottom: 12px; padding: 13px; border: 1px solid light-dark(#e1d9cf, #403c36); border-radius: 11px; background: light-dark(#fff, #282622); }
.budget-filters label { display: grid; gap: 4px; color: light-dark(#817970, #aaa198); font-size: 11px; font-weight: 700; }
.budget-transaction-list .simple-row { gap: 10px; }
.budget-transaction-list .simple-row > time { min-width: 58px; }
.budget-kind-mark { display: grid; flex: 0 0 auto; width: 25px; height: 25px; place-items: center; border-radius: 8px; font-weight: 800; }
.budget-kind-mark.kind-expense { color: light-dark(#8f4f43, #e3a194); background: light-dark(#f1dfda, #422d29); }
.budget-kind-mark.kind-income { color: light-dark(#467058, #9ed0ae); background: light-dark(#dce9df, #293c30); }
.budget-main-form { padding: 24px; }
.budget-category-columns { align-items: start; }

.sobriety-page { max-width: 1050px; }
.sobriety-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.sobriety-card { min-width: 0; padding: 24px; border: 1px solid light-dark(#d8dfd4, #3d473c); border-radius: 15px; background: light-dark(#fcfdf9, #252a23); }
.sobriety-card > header, .sobriety-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sobriety-card h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.sobriety-card h2 a { text-decoration: none; }
.sobriety-card h2 a:hover { text-decoration: underline; }
.sobriety-card > footer { margin-top: 22px; padding-top: 15px; border-top: 1px solid light-dark(#e0e5dc, #3d473c); font-size: 11px; }
.sobriety-counter-main { display: flex; align-items: center; gap: 17px; padding-top: 19px; }
.sobriety-counter-main > strong { font-family: Georgia, serif; font-size: clamp(56px, 6vw, 86px); line-height: 1.1; font-weight: 400; color: light-dark(#536a4c, #afc9a4); }
.sobriety-counter-main > span { font-size: 19px; }
.sobriety-counter-main small { color: light-dark(#7a8274, #a7b29f); font-size: 11px; }
.sobriety-counter-remainder { margin: 7px 0 0; font-size: 17px; color: light-dark(#66735e, #b7c4af); }
.sobriety-start-date { margin: 18px 0 0; font-size: 12px; }
.sobriety-current { padding: 28px; }
.sobriety-current > h2 { margin-top: 16px; }
.sobriety-current > p:not(.eyebrow) { line-height: 1.55; font-size: 13px; }
.sobriety-current .row-actions { margin-top: 20px; }
.sobriety-paused { padding: 24px 0 10px; line-height: 1.5; font-size: 13px; }
.sobriety-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sobriety-stats article { min-width: 0; }
.sobriety-footnote { font-size: 11px; line-height: 1.6; margin-top: 18px; }
.sobriety-note { overflow-wrap: anywhere; line-height: 1.6; }
.sobriety-history-row { align-items: flex-start; font-size: 13px; }
.sobriety-history-row .grow { min-width: 0; }
.sobriety-manage > summary { color: light-dark(#7e766e, #aaa198); font-size: 12px; }
.sobriety-manage .row-actions { margin-top: 12px; }
.sobriety-empty { grid-column: 1 / -1; padding: 32px; }
.sobriety-empty h2 { color: light-dark(#536a4c, #afc9a4); font-size: 22px; font-weight: 500; }
.sobriety-empty p { max-width: 520px; line-height: 1.6; }
.sobriety-empty .button { margin-top: 10px; }
.sobriety-form .helptext { font-size: 11px; line-height: 1.5; color: light-dark(#7e766e, #aaa198); }
.sobriety-form .errorlist { color: light-dark(#a43e36, #eea599); list-style: none; padding: 0; margin: 0; font-size: 13px; }
.sobriety-page .button:focus-visible, .sobriety-page a:focus-visible, .sobriety-manage summary:focus-visible { outline: 2px solid light-dark(#536a4c, #afc9a4); outline-offset: 3px; }
@media (max-width: 760px) {
  .sobriety-grid, .sobriety-stats { grid-template-columns: 1fr; }
  .sobriety-page .horizontal-header { flex-direction: column; }
  .sobriety-history-row { flex-wrap: wrap; }
  .sobriety-history-row .grow { flex-basis: 100%; }
  .sobriety-card { padding: 20px; }
  .sobriety-card > footer { flex-wrap: wrap; }
}

.message-stack { position: fixed; z-index: 50; top: 16px; right: 16px; display: grid; gap: 8px; }
.message { padding: 11px 14px; border: 1px solid light-dark(#d8d0c5, #49443e); border-radius: 9px; background: light-dark(#fff, #2b2824); box-shadow: 0 8px 24px rgba(0,0,0,.13); font-size: 13px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(390px, 100%); padding: 30px; border: 1px solid light-dark(#ddd5ca, #423e38); border-radius: 16px; background: light-dark(#fff, #282622); box-shadow: 0 18px 55px light-dark(rgba(65,52,34,.12), rgba(0,0,0,.3)); }
.auth-brand { padding-left: 0; }
.auth-card h1 { margin: 8px 0; font-family: Georgia, serif; font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding-inline: 9px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > span:last-child, .primary-action, .navigation-label, .navigation a:not(.active) { font-size: 0; }
  .navigation a { justify-content: center; min-height: 42px; }
  .navigation a span { font-size: 16px; }
  .navigation a.active { font-size: 0; }
  .sidebar-footer p { display: none; }
  .nav-button { justify-content: center; font-size: 0 !important; }
  .nav-button::after { content: "↪"; font-size: 16px; }
  .two-column { grid-template-columns: 1fr; gap: 4px; }
  .plan-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .budget-income-stats { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; z-index: 30; top: 0; width: 100%; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px; border-right: 0; border-bottom: 1px solid light-dark(#dfd8ce, #39352f); overflow-x: auto; }
  .brand { padding: 0; }
  .brand-mark { width: 34px; height: 34px; }
  .navigation { display: flex; gap: 3px; }
  .navigation a { min-width: 40px; padding: 8px; }
  .sidebar-footer { display: none; }
  .global-add { flex: 0 0 auto; }
  .global-add > summary { width: 42px; height: 38px; margin: 0; padding: 0; overflow: hidden; font-size: 0; }
  .global-add > summary::after { content: "+"; font-size: 20px; }
  .global-add-panel { position: fixed; top: 58px; right: 10px; left: 10px; width: auto; max-height: calc(100vh - 70px); }
  .page { padding: 30px 18px 60px; }
  .horizontal-header { display: grid; }
  .header-actions { flex-wrap: wrap; }
  .popover-panel[open] .form-panel { position: fixed; top: 70px; right: 12px; left: 12px; width: auto; }
  .capture-actions { align-items: flex-end; }
  .board { grid-template-columns: repeat(4, 78vw); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .journal-entry { grid-template-columns: 1fr; gap: 8px; }
  .agenda-row { grid-template-columns: 74px 1fr; }
  .budget-period-toolbar { flex-wrap: wrap; }
  .budget-period-toolbar h2 { order: 4; flex-basis: 100%; margin: 5px 0 0; }
  .budget-month-picker { width: 100%; margin-left: 0; }
  .budget-month-picker input { min-width: 0; flex: 1; }
  .budget-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .budget-filters .grow { grid-column: 1 / -1; }
  .budget-filters input, .budget-filters select { width: 100%; }
  .budget-trend-row { grid-template-columns: 55px minmax(70px, 1fr); }
  .budget-trend-row .numeric { grid-column: 1 / -1; }
  .budget-transaction-list .simple-row { align-items: flex-start; flex-wrap: wrap; }
  .budget-transaction-list .simple-row .row-actions { width: 100%; padding-left: 35px; }
}
