:root {
  color-scheme: light;
  --bg: #f7f8f5; --bg-elevated: #fff; --card: #fff; --text: #233b34;
  --muted: #737e78; --border: #e6eae4; --accent: #2a6553; --accent-2: #60836c;
  --accent-soft: #e9f0e8; --good: #33735a; --good-soft: #edf5ef;
  --bad: #b94e48; --bad-soft: #f9ebe8; --nav-w: 252px;
  --shadow: 0 3px 16px #253f3010; --shadow-lift: 0 12px 35px #213d2920;
  --radius-lg: 18px; --radius-md: 12px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131d1b; --bg-elevated: #182420; --card: #1c2b25; --text: #e3ece5;
  --muted: #a0b4a7; --border: #30443a; --accent: #a4d2b3; --accent-2: #9cbfab;
  --accent-soft: #2a4034; --good: #9aceb0; --good-soft: #213d2b;
  --bad: #f1a49a; --bad-soft: #472c2a; --shadow: 0 3px 16px #0001;
}
body { font-family: "Avenir Next", "Segoe UI", sans-serif; font-size: 14px; line-height: 1.55; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #b38c48; outline-offset: 4px; }
[hidden] { display: none !important; }
svg { width: 21px; height: 21px; flex-shrink: 0; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0,0,0,0); overflow: hidden; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 100; padding: 12px; background: var(--card); }
.skip-link:focus { top: 10px; }
.bottomnav { position: fixed; inset: 0 auto 0 0; width: var(--nav-w); display: flex; flex-direction: column; gap: 3px; padding: 28px 18px 16px; background: var(--bg-elevated); border: 0; border-right: 1px solid var(--border); backdrop-filter: none; overflow-y: auto; z-index: 30; }
.bottomnav .nav-brand { display: flex; gap: 12px; padding: 0 8px 27px; color: var(--text); flex: none; background: none; }
.nav-brand-mark { background: #315f4b; color: #fff; border-radius: 13px; width: 43px; height: 44px; font: 32px Georgia, serif; display: grid; place-items: center; letter-spacing: -4px; padding-right: 4px; }
.bottomnav .nav-brand .nav-brand-text { font-size: 25px; font-weight: 700; letter-spacing: -.9px; line-height: 1.15; margin: 0; }
.bottomnav .nav-brand .brand-caption { font: 8px "Avenir Next", sans-serif; display: block; letter-spacing: 1.7px; color: var(--muted); margin-top: 7px; }
.nav-search { display: flex; align-items: center; gap: 9px; width: 100%; border: 1px solid var(--border); background: var(--bg); color: var(--muted); border-radius: 9px; padding: 10px; font-size: 11px; margin-bottom: 10px; }
kbd { font: 9px inherit; margin-left: auto; border: 1px solid var(--border); border-radius: 4px; padding: 2px 4px; }
.nav-search svg { width: 15px; }
.nav-label { color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: 1.8px; text-transform: uppercase; padding: 17px 12px 7px; }
.bottomnav a { flex: none; text-align: left; display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--muted); border-radius: 8px; font-size: 12px; font-weight: 500; transition: background .15s; }
.bottomnav a span:last-child { font-size: 12px; font-weight: 500; margin: 0; }
.bottomnav a:hover { background: var(--bg); color: var(--text); }
.bottomnav a.active { background: var(--accent-soft); color: var(--accent); transform: none; font-weight: 650; }
.bottomnav a.active::after { content: ""; width: 5px; height: 5px; border-radius: 50%; margin-left: auto; background: var(--accent); }
.nav-footer { display: block; margin-top: auto; padding-top: 22px; border: none; }
.nav-profile { display: flex; align-items: center; gap: 10px; margin: 20px 4px 0; padding-top: 20px; border-top: 1px solid var(--border); font-size: 11px; }
.nav-profile small { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #f1e9db; color: #866b49; font: 17px Georgia, serif; }
.theme-toggle { margin-left: auto; padding: 6px; border: 0; background: none; color: var(--text); font-size: 20px; }
.content-col { margin-left: var(--nav-w); }
.topbar { position: relative; border-bottom: 1px solid var(--border); padding: 23px 42px; align-items: center; background: var(--bg); flex-wrap: nowrap; }
.topbar-heading h1 { color: var(--text); background: none; font-size: 21px; font-weight: 600; letter-spacing: -.6px; }
.topbar-sub { font-size: 8px; letter-spacing: 1.8px; margin: 0 0 5px; }
.topbar-actions { display: flex; gap: 20px; align-items: center; margin-left: auto; }
.connection-pill { color: var(--muted); font-size: 10px; white-space: nowrap; }
.connection-pill::before { content: ""; display: inline-block; width: 6px; height: 6px; background: #78917c; border-radius: 50%; margin-right: 7px; }
.primary-button, .secondary-button { display: inline-flex; gap: 10px; align-items: center; justify-content: center; border-radius: 9px; padding: 11px 18px; font-size: 11px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.primary-button { background: #2a5746; color: #fff; }
.primary-button:hover { background: #346b55; color: #fff; }
.primary-button svg { width: 16px; height: 16px; }
.secondary-button { background: var(--bg); border-color: var(--border); color: var(--text); }
#menuToggle { display: none; }
main { max-width: 1440px; padding: 16px 42px 60px; }
.storage-note { font-size: 10px; color: var(--muted); margin: 0 0 20px; }
.storage-note a { text-decoration: underline; text-underline-offset: 3px; }
.welcome-panel { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 295px; border-radius: 20px; padding: 31px 38px; background: #eaf0e6; position: relative; overflow: hidden; }
[data-theme="dark"] .welcome-panel { background: #2a4033; }
.eyebrow { font-size: 9px; font-weight: 650; letter-spacing: 1.6px; color: var(--muted); }
.welcome-panel h2 { font: 42px/1.12 Georgia, "Times New Roman", serif; letter-spacing: -1.4px; font-weight: 400; margin: 15px 0; }
.welcome-panel p:not(.eyebrow) { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 0 0 22px; }
.welcome-panel .primary-button { padding: 10px 16px; }
.welcome-art { position: relative; display: grid; place-items: center; }
.orbit { position: absolute; border: 1px solid #91aa8360; border-radius: 50%; width: 230px; height: 230px; transform: rotate(-25deg) scaleX(.8); }
.orbit-two { width: 290px; height: 290px; transform: rotate(30deg) scaleX(.85); opacity: .7; }
.art-sun { width: 73px; height: 73px; background: #dcbb7f; border-radius: 50%; position: absolute; right: 13%; top: 13px; }
.art-note { z-index: 1; background: #fffef6; color: #3d5141; border: 1px solid #fff; border-radius: 7px; width: 206px; padding: 28px 24px 36px; transform: rotate(-9deg); box-shadow: 7px 15px 30px #26452a15; }
.art-note span { font-size: 7px; letter-spacing: 1.5px; color: #8b927f; }
.art-note b { display: block; font: 24px/1.3 Georgia, serif; padding-top: 14px; }
.art-line { width: 90%; height: 1px; background: #dde3d5; margin-top: 20px; }
.art-line.short { width: 65%; margin-top: 11px; }
.art-note i { position: absolute; right: -21px; bottom: 0; background: #789473; color: #fff; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font: 22px Georgia, serif; box-shadow: 0 0 0 5px #eaf0e6; }
.art-caption { position: absolute; bottom: -10px; font-size: 7px; letter-spacing: 2px; color: var(--muted); }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 27px 0 13px; gap: 12px; }
.section-heading h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.3px; }
.section-heading span, .section-heading a { color: var(--muted); font-size: 10px; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.stat-tile { padding: 20px 22px 16px; text-align: left; border-radius: 13px; box-shadow: none; color: var(--text); }
.stat-label { margin: 0; font-size: 8px; letter-spacing: 1.2px; font-weight: 500; }
.stat-value { font-size: 30px; font-weight: 500; letter-spacing: -1px; margin: 11px 0; }
.stat-value small { font-size: 14px; letter-spacing: 0; color: var(--muted); }
.stat-tile > span { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }
.stat-tile b { color: var(--accent); }
.space-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.space-links a { display: flex; align-items: center; gap: 13px; padding: 17px 20px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; color: var(--text); }
.space-links a > span:last-child { margin-left: auto; color: var(--muted); }
.space-icon { width: 41px; height: 41px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 11px; }
.space-icon.peach { background: #f5ebe0; color: #a28059; }
.space-links b { font-size: 11px; font-weight: 600; }
.space-links small { display: block; font-size: 9px; color: var(--muted); margin-top: 3px; }
.card { box-shadow: none; padding: 23px; border-radius: 14px; min-width: 0; }
.card canvas { max-width: 100%; }
.card:hover { transform: none; box-shadow: none; }
.card h2 { font-weight: 600; font-size: 14px; }
.card h3 { font-size: 14px; font-weight: 600; }
.card p { font-size: 12px; color: var(--muted); line-height: 1.8; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.card-heading h2 { margin: 0; }
.card-heading a, .tiny-label { font-size: 9px; color: var(--muted); }
.tiny-label { letter-spacing: 1px; }
.list { margin: 0; padding: 0; list-style: none; }
.list li { border-color: var(--border); }
.priority-row { display: flex; gap: 12px; align-items: center; padding: 14px 0; }
.priority-row b { font-size: 12px; font-weight: 550; }
.priority-row small { display: block; font-size: 9px; color: var(--muted); margin-top: 4px; }
.priority-row .badge { margin-left: auto; font-size: 8px; }
.task-dot { flex-shrink: 0; width: 16px; height: 16px; border: 1px solid var(--border); border-radius: 5px; }
.empty { font-size: 11px; line-height: 2; }
.empty-mark { display: block; font: 25px Georgia,serif; margin-bottom: 12px; color: #8aa087; }
.kanban-col { background: color-mix(in srgb, var(--accent-soft) 35%, var(--bg)); border: 1px solid var(--border); }
.kanban-card { border-radius: 12px; box-shadow: none; }
.kanban-card .title { font-size: 13px; }
.toolbar input, .toolbar select, input, select, textarea { color: var(--text); border: 1px solid var(--border); border-radius: 8px; background: var(--card); padding: 10px 12px; max-width: 100%; }
.toolbar button, .item-actions button, .kanban-actions button, .form-actions button { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border); border-radius: 7px; }
.form-actions .save { background: #2a5746; color: white; }
.item-actions .danger, .form-actions .danger { color: var(--bad); background: var(--bad-soft); border-color: var(--bad); }
.form-field label, #page-settings label { display: block; font-size: 11px; margin: 16px 0 7px; color: var(--text); }
#page-settings input:not([type=file]) { width: 100%; margin-bottom: 12px; }
#page-settings .hint, .hint { font-size: 10px; color: var(--muted); }
#page-settings hr { margin: 26px 0; border: 0; border-top: 1px solid var(--border); }
.connection-choice { padding: 15px; border-radius: 10px; background: var(--accent-soft); margin: 20px 0; }
.connection-choice p { margin-bottom: 0; }
.notice { padding: 17px 20px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--muted); font-size: 12px; }
.error-notice { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); margin-bottom: 16px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.page-description { font-size: 12px; color: var(--muted); margin: 0 0 25px; max-width: 750px; }
#moneyFrame { display: block; width: 100%; height: calc(100dvh - 180px); min-height: 650px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
.nutrition-hero { padding: 44px; background: var(--accent-soft); }
.nutrition-hero h2 { font: 52px/1.1 Georgia,serif; letter-spacing: -1.7px; margin: 22px 0; }
.nutrition-hero h2 em { color: var(--accent); font-weight: 400; }
.nutrition-hero small { display: block; margin-top: 12px; font-size: 10px; color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.feature-grid svg { color: var(--accent); }
.fab { background: #315f4b; width: 48px; height: 48px; line-height: 48px; font-size: 24px; border-radius: 15px; bottom: 22px; right: 24px; box-shadow: 0 6px 18px #29422d30; }
.modal { z-index: 60; backdrop-filter: blur(5px); background: #10221955; }
.modal-box { max-height: 88dvh; overflow-y: auto; padding: 26px; }
.modal-header { padding: 0 0 20px; }
.modal-header h3 { font: 23px Georgia,serif; }
.gate { z-index: 65; background: #10221966; backdrop-filter: blur(5px); }
.gate-box button { background: #2a5746; margin-top: 8px; }
.gate-box .secondary-button { background: var(--bg); color: var(--text); }
.quick-actions, .search-results { display: grid; gap: 8px; }
.quick-actions button, .search-results a { padding: 15px; text-align: left; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--bg); font-size: 13px; }
.quick-actions small { display: block; color: var(--muted); font-size: 10px; padding-top: 5px; }
.search-results a { display: flex; justify-content: space-between; }
#spaceSearch { width: 100%; margin-bottom: 15px; }
.heatmap div { border-radius: 3px; }
.heatmap .done, .progress-fill { background: #72936c; }
.gut-item { cursor: pointer; width: 100%; text-align: left; background: var(--card); color: var(--text); border: 1px solid var(--border); font: inherit; margin-bottom: 7px; }
.chart-placeholder { padding: 35px 16px; background: var(--bg); border-radius: 10px; }
.gut-item.done { background: var(--good-soft); }
.toast { border: 1px solid var(--border); box-shadow: var(--shadow-lift); font-size: 12px; max-width: min(440px,90vw); }
.nav-purpose { margin: 26px 8px; padding: 22px 16px; border-top: 1px solid var(--border); }
.nav-purpose b { font: 21px/1.3 Georgia, serif; color: var(--accent); }
.nav-purpose p { font-size: 10px; line-height: 1.8; color: var(--muted); margin: 10px 0 0; }
.workout-top { font-size: 11px; font-weight: 650; white-space: nowrap; padding: 10px 0; }
.focus-mini { color: var(--accent); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 6px 9px; background: var(--accent-soft); border-radius: 7px; }
.daily-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin: 6px 0 24px; }
.daily-heading h2 { font: 36px/1.2 Georgia, serif; letter-spacing: -1px; margin: 10px 0; }
.daily-heading h2 em { font-weight: 400; color: var(--accent); }
.daily-heading p:not(.eyebrow) { margin: 9px 0 0; color: var(--muted); font-size: 12px; max-width: 650px; }
.daily-heading .secondary-button { white-space: nowrap; background: transparent; }
#page-home .stats { gap: 12px; margin: 0 0 22px; }
#page-home .stat-tile { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 17px 20px; font: inherit; }
#page-home .stat-tile > span { border: 0; padding: 0; display: block; min-height: auto; }
#page-home .stat-tile .stat-value { grid-column: 2; grid-row: 1/3; color: var(--text); font-size: 28px; margin: 0 0 0 12px; }
#page-home .stat-tile .stat-label { color: var(--muted); font-size: 8px; letter-spacing: 1px; }
#page-home .stat-tile small { font-size: 9px; color: var(--muted); margin-top: 5px; }
#page-home .stat-tile.attention .stat-value { color: var(--bad); }
.capture-bar { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); margin-bottom: 25px; }
.capture-bar svg { color: var(--muted); width: 18px; }
.capture-bar input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 7px 0; font-size: 12px; }
.capture-bar input:focus { outline-offset: 3px; }
.capture-bar .primary-button { white-space: nowrap; }
.today-layout { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(250px,1fr); gap: 24px; align-items: start; }
.today-layout > * { min-width: 0; }
.priorities-card .eyebrow { margin: 0 0 7px; font-size: 8px; }
.priorities-card .card-heading h2 { font: 24px/1.3 Georgia, serif; font-weight: 400; letter-spacing: -.5px; }
.priorities-card .card-heading { align-items: center; margin-bottom: 5px; }
.priorities-card .hint { margin: 8px 0 16px; }
.plan-empty { padding: 24px 4px; }
.plan-empty b { color: var(--text); font-size: 12px; }
.plan-empty .secondary-button { margin-top: 17px; }
.planned-task { display: flex; align-items: center; gap: 12px; padding: 17px 0; border-bottom: 1px solid var(--border); }
.planned-task .task-check { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; background: var(--bg); border: 1px solid var(--border); color: var(--muted); font-size: 10px; padding: 0; }
.planned-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.planned-copy b { font-size: 12px; font-weight: 550; }
.planned-copy small { display: block; font-size: 9px; color: var(--muted); margin-top: 6px; }
.planned-copy .badge { font-size: 8px; margin-left: 6px; }
.is-done .planned-copy b { text-decoration: line-through; color: var(--muted); }
.is-done .task-check { background: var(--accent-soft); color: var(--accent); }
.focus-task-button { border: 1px solid var(--border); background: transparent; color: var(--accent); padding: 6px 9px; font-size: 10px; border-radius: 7px; }
.remove-pick { border: 0; background: none; color: var(--muted); font-size: 17px; padding: 4px; }
.plan-progress { font-size: 10px; color: var(--muted); margin-top: 16px; }
.routine-check { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--border); padding: 14px 0; font-size: 12px; }
.routine-check:last-child { border-bottom: 0; }
.routine-check small { margin-left: auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.routine-box { display: grid; place-items: center; width: 19px; height: 19px; border: 1px solid var(--border); border-radius: 5px; flex-shrink: 0; }
.routine-check.checked .routine-box { background: var(--accent-soft); color: var(--accent); }
.daily-review summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; font-size: 13px; color: var(--text); }
.daily-review summary::before { content: "+"; color: var(--accent); }
.daily-review[open] summary::before { content: "−"; }
#reviewStatus { margin-left: auto; font-size: 9px; color: var(--muted); }
#reviewForm label { display: block; font-size: 11px; margin: 20px 0 10px; }
#reviewForm textarea { width: 100%; resize: vertical; margin-bottom: 12px; font-size: 12px; }
#reviewForm a { font-size: 10px; margin-left: 10px; }
.focus-card { background: var(--accent-soft); border-color: transparent; }
.focus-card h2 { font: 24px/1.3 Georgia,serif; font-weight: 400; letter-spacing: -.5px; margin: 10px 0; }
.focus-card .eyebrow { font-size: 8px; }
.focus-card #focusTaskLabel { min-height: 40px; font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.focus-clock { font-size: 57px; line-height: 1; font-weight: 400; letter-spacing: -3px; font-variant-numeric: tabular-nums; margin: 23px 0 12px; }
#focusStatus { color: var(--muted); font-size: 10px; margin-bottom: 20px; }
#focusMinutes { font-size: 11px; width: 100%; background: color-mix(in srgb, var(--card) 50%, transparent); margin-bottom: 12px; }
.focus-actions { display: flex; gap: 8px; }
.focus-actions button { flex: 1; }
.focus-card p.hint { font-size: 9px; line-height: 1.6; }
.workout-callout { display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--card); padding: 21px; color: var(--text); margin: 0 0 16px; }
.workout-callout b { font-size: 12px; font-weight: 600; }
.workout-callout small { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
.workout-callout > span:last-child { margin-left: auto; }
.bot-callout { background: transparent; border-style: dashed; }
.bot-callout a { font-size: 10px; }
.bot-callout h3 { font-size: 13px; }
.bot-callout p { font-size: 11px; }
.tools-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.tools-grid a { color: var(--text); margin: 0; transition: border-color .2s; }
.tools-grid a:hover { border-color: var(--accent); }
.tools-grid h2 { margin: 20px 0 10px; }
.tools-grid p { margin-bottom: 0; }
.tools-grid svg { color: var(--accent); }
.assistant-intro { padding: 34px; background: var(--accent-soft); }
.assistant-intro h2 { font: 36px/1.25 Georgia,serif; margin: 17px 0; letter-spacing: -.7px; }
.assistant-intro h2 em { color: var(--accent); font-weight: 400; }
.assistant-intro p { max-width: 720px; }
.bot-prompts { display: grid; gap: 10px; }
.bot-prompts button { text-align: left; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 8px; padding: 14px; font-size: 12px; }
#deploymentStatus { margin-bottom: 22px; overflow-wrap: anywhere; }
#prioritySearch { width: 100%; margin: 10px 0 16px; }
.priority-option { display: flex; gap: 14px; align-items: center; padding: 15px 3px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.priority-option input { width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }
.priority-option small { display: block; font-size: 10px; color: var(--muted); margin-top: 5px; }
#priorityOptions { max-height: 50vh; overflow-y: auto; }
.today-layout > div > .hint { font-size: 9px; line-height: 1.8; }
.food-col { background: var(--bg); }
.food-chip.good { background: var(--good-soft); color: var(--good); }
.food-chip.bad { background: var(--bad-soft); color: var(--bad); }
@media (min-width: 1300px) { main { padding-left: 55px; padding-right: 55px; } .topbar { padding-left: 55px; padding-right: 55px; } .welcome-panel { min-height: 320px; } }
@media (max-width: 1080px) { :root { --nav-w: 220px; } main { padding: 16px 24px 65px; } .topbar { padding: 21px 24px; } .welcome-panel { padding: 28px; } .welcome-panel h2 { font-size: 36px; } .art-note { width: 170px; } .art-note b { font-size: 21px; } .orbit-two { width: 220px; height: 220px; } .stat-tile { padding: 18px 16px; } .stat-value { font-size: 27px; } }
@media (max-width: 899px) {
  .bottomnav { width: 260px; visibility: hidden; transform: translateX(-100%); transition: transform .2s ease; }
  .bottomnav.nav-open { visibility: visible; transform: translateX(0); }
  .content-col { margin-left: 0; }
  #menuToggle { display: block; padding: 7px; border: 0; background: none; color: var(--text); }
  .nav-scrim { display: block; position: fixed; inset: 0; border: 0; background: #0b241a66; z-index: 25; }
  .topbar { padding: 16px 20px; gap: 12px; }
  .topbar-heading h1 { font-size: 20px; }
  .topbar-actions { gap: 12px; }
  .topbar-sub { font-size: 7px; }
  .feature-grid { grid-template-columns: 1fr; gap: 0; }
  .food-grid { grid-template-columns: 1fr; }
  .today-layout { gap: 16px; }
  .tools-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .daily-heading h2 { font-size: 30px; }
}
@media (max-width: 600px) {
  main { padding: 14px 17px 75px; }
  .topbar { padding: 15px 12px; }
  .topbar-actions .connection-pill { display: none; }
  .topbar-actions .primary-button { padding: 9px 11px; font-size: 10px; gap: 5px; }
  .welcome-panel { grid-template-columns: 1fr; padding: 27px; min-height: 0; }
  .welcome-panel h2 { font-size: 38px; }
  .welcome-art { display: none; }
  .storage-note { font-size: 9px; line-height: 1.8; margin-bottom: 16px; }
  .stats { gap: 8px; }
  .stat-tile { padding: 14px 10px 10px; }
  .stat-label { font-size: 7px; letter-spacing: .5px; min-height: 24px; }
  .stat-value { font-size: 21px; margin: 8px 0; overflow-wrap: anywhere; }
  .stat-value small { font-size: 10px; }
  .stat-tile > span { font-size: 8px; min-height: 35px; }
  .space-links { grid-template-columns: 1fr; gap: 10px; }
  .space-links a { padding: 14px 17px; }
  .section-heading span { display: none; }
  .card { padding: 20px; }
  .nutrition-hero h2 { font-size: 42px; }
  .nutrition-hero { padding: 28px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar input { min-width: 0; flex: 1 1 180px; }
  .item-row { gap: 10px; overflow-wrap: anywhere; }
  .item-actions { flex-shrink: 0; }
  .modal-box { width: 100%; }
  #moneyFrame { border-radius: 10px; min-height: 650px; }
  .topbar { flex-wrap: wrap; }
  .topbar-actions { gap: 12px; flex-wrap: wrap; }
  .workout-top { font-size: 10px; }
  .focus-mini { font-size: 9px; }
  .daily-heading { display: block; margin-top: 12px; }
  .daily-heading .secondary-button { padding: 6px 10px; font-size: 10px; margin-top: 14px; }
  .daily-heading h2 { font-size: 29px; }
  .today-layout { grid-template-columns: 1fr; gap: 0; }
  #page-home .stats { gap: 8px; }
  #page-home .stat-tile { display: block; padding: 12px 10px; }
  #page-home .stat-tile .stat-label { font-size: 7px; letter-spacing: .4px; }
  #page-home .stat-tile .stat-value { font-size: 25px; margin: 9px 0; }
  #page-home .stat-tile small { font-size: 8px; display: block; }
  .capture-bar { padding-left: 10px; }
  .capture-bar svg { display: none; }
  .capture-bar input { font-size: 11px; }
  .capture-bar button { font-size: 10px; padding: 10px; }
  .planned-task { gap: 8px; }
  .planned-copy b { font-size: 11px; }
  .priorities-card .card-heading h2 { font-size: 22px; }
  .tools-grid { grid-template-columns: 1fr; }
  .assistant-intro { padding: 25px; }
  .assistant-intro h2 { font-size: 29px; }
}
.mobile-tabs { display: none; }
body { -webkit-text-size-adjust: 100%; }
.app-shell { min-height: 100dvh; }
.modal, .gate { top: var(--visual-top, 0px); bottom: auto; height: var(--visual-height, 100dvh); }
.modal-box, .gate-box { max-height: min(88dvh, 100%); overflow-y: auto; overscroll-behavior: contain; }
body:has(.modal:not(.hidden)), body:has(.gate:not(.hidden)) { overflow: hidden; }
@media (max-width: 899px) {
  .topbar { padding-top: max(15px, env(safe-area-inset-top)); padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  main { padding-left: max(17px, env(safe-area-inset-left)); padding-right: max(17px, env(safe-area-inset-right)); padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .bottomnav { padding-top: max(28px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom)); padding-left: max(18px, env(safe-area-inset-left)); max-width: calc(100vw - 44px); overscroll-behavior: contain; }
  body:has(.bottomnav.nav-open) { overflow: hidden; }
  .mobile-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; padding: 5px max(8px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: var(--bg-elevated); border-top: 1px solid var(--border); }
  .mobile-tabs a { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; min-height: 52px; text-decoration: none; color: var(--muted); font-size: 11px; border-radius: 9px; }
  .mobile-tabs a.active { color: var(--accent); background: var(--accent-soft); }
  button, .primary-button, .secondary-button, .bottomnav a, .workout-top, .focus-mini, .kanban-tab, summary { min-height: 44px; touch-action: manipulation; }
  button, .primary-button, .secondary-button { min-width: 44px; }
  #menuToggle, #modalClose, .planned-task .task-check { width: 44px; height: 44px; flex-shrink: 0; }
  .theme-toggle { position: static; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea,
  #captureInput, #reviewNotes, #focusMinutes, .toolbar input, .toolbar select, .gate-box input { font-size: 16px; min-height: 44px; }
  select, #focusMinutes { -webkit-appearance: none; appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23737e78' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
  .modal, .gate { padding-top: max(12px, env(safe-area-inset-top)); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .modal-box { padding: 20px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); max-height: 100%; }
  .modal-header { position: sticky; top: -20px; background: var(--card); z-index: 1; padding-top: 12px; }
  .gate-box { padding: 22px; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .fab { bottom: calc(78px + env(safe-area-inset-bottom)); right: max(18px, env(safe-area-inset-right)); }
  #toastHost { top: max(12px, env(safe-area-inset-top)); }
  .form-actions { position: sticky; bottom: -20px; background: var(--card); padding: 12px 0; z-index: 1; }
  #moneyFrame { height: calc(100svh - 190px); min-height: 480px; }
  .planned-task { flex-wrap: wrap; }
  .planned-copy { flex-basis: calc(100% - 60px); }
  .focus-task-button { margin-left: 52px; }
  .remove-pick { margin-left: auto; }
  .card-heading { flex-wrap: wrap; }
  .storage-note, #page-settings .hint, .hint { font-size: 12px; }
  .topbar-heading { min-width: 0; }
  .topbar-heading h1 { overflow-wrap: anywhere; }
}
@media (max-width: 380px) {
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .capture-bar { flex-wrap: wrap; }
  .capture-bar input { flex-basis: 100%; min-height: 44px; }
  .capture-bar button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
