/* Higgins — bold mid-century: Bauhaus/Eames palette + type, Atomic rounded tiles. Light by default. */
:root {
  --bg: #F6F3EC;
  --surface: #FFFFFF;
  --surface-2: #EEE9DE;
  --ink: #1D1A17;
  --ink-2: #57514A;
  --ink-3: #8E877D;
  --line: #E4DED2;
  --rule: #1D1A17;
  --blue: #2553A6;
  --red: #D7412B;
  --yellow: #F2B705;
  --green: #2F7D57;
  --blue-soft: #DCE5F5;
  --red-soft: #F8DCD6;
  --yellow-soft: #FCEFC4;
  --green-soft: #D8EDE1;
  --on-yellow: #1D1A17;
  /* legacy aliases used by the app */
  --teal: var(--blue); --teal-soft: var(--blue-soft);
  --rust: var(--red); --rust-soft: var(--red-soft);
  --mustard: var(--yellow); --mustard-soft: var(--yellow-soft);
  --olive: var(--green); --olive-soft: var(--green-soft);
  --sky: var(--blue);
  --radius: 22px;
  --display: "Syne", "Futura", system-ui, sans-serif;
  --sans: "Jost", "Futura", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #14130F; --surface: #1F1D19; --surface-2: #2A2722; --ink: #F3EFE6; --ink-2: #BDB5A8; --ink-3: #857E73;
  --line: #36322B; --rule: #F3EFE6; --blue: #6D96E6; --red: #F06A55; --yellow: #F5C43A; --green: #5DBB8A;
  --blue-soft: #1E2A44; --red-soft: #45211B; --yellow-soft: #3F3313; --green-soft: #1B3527; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #14130F; --surface: #1F1D19; --surface-2: #2A2722; --ink: #F3EFE6; --ink-2: #BDB5A8; --ink-3: #857E73;
    --line: #36322B; --rule: #F3EFE6; --blue: #6D96E6; --red: #F06A55; --yellow: #F5C43A; --green: #5DBB8A;
    --blue-soft: #1E2A44; --red-soft: #45211B; --yellow-soft: #3F3313; --green-soft: #1B3527; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; margin: 0; }
a { color: var(--blue); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; border-right: 2px solid var(--rule); display: flex; flex-direction: column; gap: 3px; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; text-transform: uppercase; letter-spacing: .01em; }
.brand-sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; font-weight: 500; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 99px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--ink); color: var(--bg); }
.nav a .badge { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--red); color: #fff; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.nav a.active .badge { background: var(--yellow); color: var(--on-yellow); }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.whoami { margin-top: auto; padding: 12px; border-top: 2px solid var(--rule); }
.whoami label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 6px; font-weight: 600; }

.main { min-width: 0; padding: 0 40px 64px; }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 20px 0 12px; }

/* ---------- Capture ---------- */
.capture { display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); border-radius: 18px; padding: 7px 7px 7px 18px; max-width: 860px; }
.capture input { flex: 1; border: 0; background: transparent; outline: none; font-size: 17px; min-width: 0; color: var(--bg); }
.capture input::placeholder { color: color-mix(in srgb, var(--bg) 55%, transparent); }
.mic { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--yellow); display: grid; place-items: center; cursor: pointer; color: var(--on-yellow); flex: none; }
.mic .ico { width: 20px; height: 20px; stroke-width: 2.2; }
.mic.listening, .fab.listening { background: var(--red); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--red) 25%, transparent); } }
.capture .send { border: 0; background: transparent; color: var(--bg); font-weight: 600; padding: 8px 12px; cursor: pointer; font-family: var(--display); text-transform: uppercase; font-size: 13px; letter-spacing: .06em; }
.capture-hint { font-size: 13px; color: var(--ink-3); margin: 8px 0 0 18px; }

.receipts { max-width: 860px; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.receipt { background: var(--surface); border: 1.5px solid var(--line); border-left: 6px solid var(--blue); border-radius: 12px; padding: 8px 8px 8px 12px; animation: drop .25s ease-out; }
.receipt-main { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.receipt-main .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt button.link { border: 0; background: none; font-family: var(--display); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; padding: 6px 7px; color: var(--ink); border-radius: 8px; }
.receipt button.link:hover { background: var(--surface-2); }
.receipt.pending { border-left-color: var(--ink-3); color: var(--ink-2); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--red); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.receipt-actions { display: flex; align-items: center; flex: none; }
.receipt .movechips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 2px; }
@keyframes drop { from { transform: translateY(-6px); } }

/* ---------- Category shapes (Bauhaus markers) ---------- */
.shape { width: 18px; height: 18px; flex: none; display: inline-block; border: 0; padding: 0; }
.shape.ci { border-radius: 50%; }
.shape.sq { border-radius: 4px; }
.shape.tr { clip-path: polygon(50% 4%, 100% 96%, 0 96%); }
.shape.r { background: var(--red); } .shape.b { background: var(--blue); } .shape.y { background: var(--yellow); } .shape.ink { background: var(--ink); } .shape.g { background: var(--green); }
button.shape { cursor: pointer; width: 26px; height: 26px; }
button.shape.tr:hover { filter: brightness(.9); }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 18px 0 22px; }
.page-head h1 { font-size: 36px; line-height: 1.02; font-weight: 800; text-transform: uppercase; letter-spacing: -.015em; }
.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; font-weight: 600; }

.hello { position: relative; margin: 14px 0 20px; padding-right: 110px; min-height: 110px; }
.hello h1 { font-size: 44px; line-height: .98; font-weight: 800; text-transform: uppercase; letter-spacing: -.02em; }
.hello .deco { position: absolute; right: 0; top: -6px; width: 120px; height: 120px; }

/* ---------- Components ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--rule); background: transparent; padding: 8px 16px; border-radius: 99px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { opacity: .88; }
.btn.ghost { border-color: transparent; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn.danger { color: var(--red); }
.btn .ico { width: 15px; height: 15px; }
.iconbtn { border: 0; background: transparent; cursor: pointer; padding: 5px; border-radius: 8px; color: var(--ink-3); display: inline-grid; place-items: center; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn .ico { width: 17px; height: 17px; }

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 19px; }
.section-title { font-family: var(--display); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin: 20px 0 6px; font-weight: 700; }
.section-title:first-child { margin-top: 0; }

.stat { display: flex; align-items: center; gap: 16px; }
.stat .num { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; }
.stat .lbl { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }

.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1.5px solid var(--line); }
.row:first-child { border-top: 0; }
.rule .row { border-top-color: var(--rule); }
.rule .row:first-child { border-top: 0; }
.row .title { font-weight: 500; }
.row .meta { font-size: 13px; color: var(--ink-2); }
.row .body { flex: 1; min-width: 0; }
.row .body > * { overflow: hidden; text-overflow: ellipsis; }
.row.done .title { text-decoration: line-through; color: var(--ink-3); }

.check { width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--red); background: transparent; cursor: pointer; flex: none; display: grid; place-items: center; padding: 0; color: transparent; }
.check.auto { border-color: var(--ink); }
.check.grocery { border-color: var(--yellow); border-radius: 50%; }
.check:hover { background: var(--red-soft); color: var(--red); }
.check.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.check .ico { width: 15px; height: 15px; stroke-width: 2.6; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.rust { background: var(--red); color: #fff; }
.pill.teal { background: var(--blue-soft); color: var(--blue); }
.pill.mustard { background: var(--yellow); color: var(--on-yellow); }
.pill.olive { background: var(--green-soft); color: var(--green); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip { border: 1.5px solid var(--rule); background: transparent; border-radius: 99px; padding: 5px 13px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); }
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--ink); color: var(--bg); }

.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--blue); }
.effort { letter-spacing: 1px; color: var(--yellow); font-size: 11px; }

.empty { text-align: center; padding: 26px 12px; color: var(--ink-2); }
.empty h3 { font-size: 18px; color: var(--ink); margin-bottom: 4px; }

.search { border: 1.5px solid var(--line); background: var(--surface); border-radius: 99px; padding: 8px 14px; min-width: 220px; }

/* ---------- Tiles (Atomic) ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.tile { border-radius: 22px; padding: 16px; min-height: 104px; text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; color: #fff; transition: transform .12s; }
.tile:hover { transform: translateY(-2px); }
.tile .n { font-family: var(--display); font-weight: 800; font-size: 36px; line-height: 1; }
.tile .n.txt { font-size: 19px; line-height: 1.15; }
.tile .l { font-size: 14px; font-weight: 600; }
.tile .s { font-size: 12px; opacity: .85; }
.tile.y { background: var(--yellow); color: var(--on-yellow); }
.tile.r { background: var(--red); }
.tile.b { background: var(--blue); }
.tile.k { background: var(--ink); color: var(--bg); }
.tile.w { background: var(--surface); color: var(--ink); border: 2px solid var(--rule); }
.tile::after { content: ''; position: absolute; right: -18px; bottom: -18px; width: 64px; height: 64px; border-radius: 50%; background: currentColor; opacity: .1; }

/* ---------- Forms / modal ---------- */
dialog { border: 0; padding: 0; border-radius: 24px; background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
dialog::backdrop { background: rgba(20, 18, 15, .5); }
.modal { padding: 24px; }
.modal h2 { font-size: 24px; margin-bottom: 16px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; grid-column: span 2; }
.field.half { grid-column: span 1; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .04em; text-transform: uppercase; }
.field input, .field select, .field textarea, .whoami select, select.plain { border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 9px 12px; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.field textarea { min-height: 90px; resize: vertical; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline input { width: auto; }
.field.inline > span { text-transform: none; font-size: 14px; letter-spacing: 0; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--ink-3); text-transform: none; letter-spacing: 0; }
.membercheck { display: flex; flex-wrap: wrap; gap: 6px; }
.membercheck label { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 99px; padding: 4px 11px; font-size: 13px; cursor: pointer; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; align-items: center; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- Stats strip / rings ---------- */
.strip { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.ring { position: relative; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 22px; }
.contrib { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.contrib .who { display: grid; grid-template-columns: 76px 1fr 28px; align-items: center; gap: 8px; font-size: 13px; }
.milestones { display: flex; flex-wrap: wrap; gap: 10px; }
.medal { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); flex: none; }
.medal.earned { background: var(--yellow); color: var(--on-yellow); }
.medal svg { width: 22px; height: 22px; }
.milestone-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; }

/* ---------- Upkeep ---------- */
.zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 20px; }
.zone { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; cursor: pointer; text-align: left; }
.zone.on { border-color: var(--rule); box-shadow: inset 0 0 0 1px var(--rule); }
.zone .zn { font-weight: 600; font-size: 14px; margin-bottom: 8px; display: flex; justify-content: space-between; }

/* ---------- Meals ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day { background: var(--bg); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; min-height: 118px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.day:hover { border-color: var(--rule); }
.day.today { border: 2px solid var(--red); }
.day .dn { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.day .dd { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1; }
.day .meal { font-weight: 500; font-size: 14px; margin-top: auto; }
.day .meal.none { color: var(--ink-3); font-weight: 400; }
.recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.recipe { cursor: pointer; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.recipe .swatch { height: 10px; margin: -20px -20px 8px; }
.recipe h3 { font-size: 19px; }
.star { color: var(--yellow); }
.aisle { margin-bottom: 8px; }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1.5px solid var(--rule); border-left: 1.5px solid var(--rule); border-radius: 16px; overflow: hidden; background: var(--surface); }
.cal .dow { font-family: var(--display); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--bg); padding: 8px 10px; border-right: 1.5px solid var(--rule); border-bottom: 1.5px solid var(--rule); background: var(--ink); font-weight: 700; }
.cal .cell { min-height: 108px; padding: 6px 8px; border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .cell:hover { background: var(--bg); }
.cal .cell.out { background: var(--bg); }
.cal .cell.out .n { color: var(--ink-3); }
.cal .cell .n { font-size: 13px; font-weight: 600; }
.cal .cell.today .n { background: var(--red); color: #fff; border-radius: 99px; width: 24px; height: 24px; display: grid; place-items: center; }
.ev { font-size: 12px; padding: 1px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--blue); background: var(--surface-2); }
.ev.bill { border-left-color: var(--yellow); }
.ev.task { border-left-color: var(--red); color: var(--ink-2); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.kcol h3 { font-size: 15px; font-weight: 700; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; text-transform: uppercase; letter-spacing: .06em; }
.kcard { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; }
.kcard .title { font-weight: 600; }
.kcard .actions { display: flex; gap: 6px; margin-top: 10px; align-items: center; }

/* ---------- Planning ---------- */
.step { border-top: 1.5px solid var(--line); padding: 12px 0; }
.step:first-child { border-top: 0; }
.step-head { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.step-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 14px; background: var(--surface-2); flex: none; }
.step-num .ico { width: 15px; height: 15px; stroke-width: 2.6; }
.step.done .step-num { background: var(--blue); color: #fff; }
.step.progress .step-num { background: var(--yellow); color: var(--on-yellow); }
.step-body { padding: 10px 0 4px 44px; display: none; }
.step.open .step-body { display: block; }
.step-body p { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; }
.step-body textarea { width: 100%; min-height: 70px; border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 8px 10px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; padding: 6px 8px; border-bottom: 1.5px solid var(--rule); }
table.t td { padding: 10px 8px; border-bottom: 1.5px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click, table.t td.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--bg); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
.notice { background: var(--surface-2); border-radius: 14px; padding: 10px 14px; font-size: 13px; color: var(--ink-2); }
.table-wrap { overflow-x: auto; }

/* ---------- Phone tab bar ---------- */
.tabbar { display: none; }
.morelist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.morelist a { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 16px; background: var(--bg); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 0 16px calc(104px + env(safe-area-inset-bottom)); }
  .topbar { padding: calc(10px + env(safe-area-inset-top)) 0 8px; }
  .capture { padding-left: 14px; border-radius: 16px; }
  .capture .send { display: none; }
  .capture-hint { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg); border-top: 2px solid var(--rule);
    padding: 4px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; align-items: flex-end; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 2px; color: var(--ink-3); text-decoration: none; font-size: 11px; font-weight: 600; position: relative; }
  .tabbar a .ico { width: 24px; height: 24px; }
  .tabbar a.active { color: var(--ink); }
  .tabbar a i { position: absolute; top: 4px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
  .fab { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--red); color: #fff; display: grid; place-items: center; margin: -30px 6px 4px; box-shadow: 0 10px 22px -8px rgba(0,0,0,.45); flex: none; cursor: pointer; }
  .fab .ico { width: 28px; height: 28px; stroke-width: 2.2; }
  .hello { padding-right: 84px; min-height: 90px; margin-top: 6px; }
  .hello h1 { font-size: 36px; }
  .hello .deco { width: 92px; height: 92px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { min-height: 96px; padding: 14px; }
  .g2, .g3, .g4, .kanban { grid-template-columns: 1fr; }
  .span2, .g4 > .span2 { grid-column: auto !important; }
  .week { grid-template-columns: 1fr; gap: 6px; }
  .day { min-height: 0; flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; }
  .day .meal { margin: 0 0 0 auto; text-align: right; }
  .page-head { margin: 10px 0 16px; }
  .page-head h1 { font-size: 28px; }
  .card { padding: 16px; }
  .card-head { flex-wrap: wrap; }
  .cal .cell { min-height: 52px; padding: 4px; }
  .cal .ev { display: none; }
  .cal .cell.has::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin: 2px auto 0; }
  .cal .dow { padding: 6px 2px; text-align: center; font-size: 10px; }
  .fields { grid-template-columns: 1fr; }
  .field.half { grid-column: span 2; }
  .field input, .field select, .field textarea, .search, .capture input { font-size: 16px; }
  .iconbtn { padding: 8px; }
  .row { gap: 10px; }
  .row .meta { white-space: normal; }
  .zones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { min-width: 0; width: 100%; }
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 24px 24px 0 0; max-height: 92vh; max-height: 92dvh; }
  .modal { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .receipt:nth-child(n+2) { display: none; }
  .receipt-main { flex-wrap: wrap; row-gap: 0; }
  .receipt-main .grow { white-space: normal; flex-basis: calc(100% - 30px); }
  .receipt-actions { width: 100%; justify-content: flex-end; margin: -2px -4px -4px 0; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}
