/*
  ChefBoy at chefboy.app: ChoreBoy's look (its tokens and components) with a warm orange accent.
  Light or dark follows the device. Responsive from 320 px: on a phone the sections sit in a bar at
  the bottom of the screen.
*/
:root {
  color-scheme: light;
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f6f3ee;
  --sunken: #f1ede6;
  --border: #e9e3da;
  --border-strong: #d6cec2;
  --text: #1c1917;
  --text-2: #57534e;
  --text-3: #78716c;
  --accent: #ea580c;
  --accent-hover: #c2410c;
  --accent-soft: #fff1e6;
  --accent-contrast: #ffffff;
  --accent-text: #c2410c;
  --good: #067647;
  --good-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --bad: #c01048;
  --bad-soft: #fff1f3;
  --info: #026aa2;
  --info-soft: #f0f9ff;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, .06);
  --shadow-md: 0 4px 12px rgba(28, 25, 23, .08);
  --shadow-lg: 0 12px 32px rgba(28, 25, 23, .16);
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --bottom-nav: 0px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #12100e;
    --surface: #1b1815;
    --surface-2: #221e1a;
    --sunken: #16130f;
    --border: #2e2924;
    --border-strong: #3d3730;
    --text: #f5f2ee;
    --text-2: #c4bcb2;
    --text-3: #978e83;
    --accent: #fb923c;
    --accent-hover: #fdba74;
    --accent-soft: rgba(251, 146, 60, .14);
    --accent-contrast: #12100e;
    --accent-text: #fdba74;
    --good: #47cd89;
    --good-soft: rgba(71, 205, 137, .12);
    --warn: #fdb022;
    --warn-soft: rgba(253, 176, 34, .12);
    --bad: #fd6f8e;
    --bad-soft: rgba(253, 111, 142, .12);
    --info: #7cd4fd;
    --info-soft: rgba(124, 212, 253, .12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body.modal-open { overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--accent-text); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--text-3); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: .5rem; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- top bar --------------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); flex: 0 0 auto; }
.brand img { width: 30px; height: 30px; image-rendering: pixelated; }
.brand b { font-size: 1.15rem; letter-spacing: -.01em; }
.brand b span { color: var(--accent); }
.nav { display: flex; gap: .25rem; flex: 1 1 auto; }
.nav-btn { appearance: none; border: 0; background: none; color: var(--text-2); font: inherit; font-weight: 600; padding: .45rem .8rem; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.nav-btn .ico { margin-right: .3rem; }
.top-tools { display: flex; gap: .4rem; align-items: center; }
body.logged-out .nav { display: none; }

@media (max-width: 720px) {
  :root { --bottom-nav: calc(60px + env(safe-area-inset-bottom)); }
  .topbar { padding: .5rem .75rem; backdrop-filter: none; background: var(--surface); }
  .week-strip { gap: .2rem; }
  .week-day { padding: .3rem 0; font-size: .8rem; }
  .week-day b { font-size: .65rem; }
  .week-day .ems { font-size: .7rem; }

  .day-nav h2 { font-size: 1.05rem; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; justify-content: space-around; gap: 0; padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
  .nav-btn { display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .72rem; padding: .3rem .4rem; border-radius: var(--radius); flex: 1 1 0; }
  .nav-btn .ico { margin: 0; font-size: 1.25rem; }
  body.logged-out { --bottom-nav: 0px; }
}

.view { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem calc(2rem + var(--bottom-nav)); }
@media (max-width: 720px) { .view { padding: 1rem .75rem calc(1.5rem + var(--bottom-nav)); } }

/* ---- buttons, chips, inputs --------------------------------------------------------- */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; padding: .55rem .95rem; border-radius: var(--radius); cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .12s, border-color .12s, transform .06s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.small { padding: .35rem .65rem; font-size: .85rem; border-radius: var(--radius-sm); }
.btn.big { padding: .8rem 1.3rem; font-size: 1.05rem; }
.btn.icon { padding: .35rem .5rem; min-width: 2.1rem; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.btn-row.right { justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: .2rem .6rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.chip.btn-like { cursor: pointer; font: inherit; font-size: .85rem; font-weight: 600; padding: .35rem .75rem; }
.chip.btn-like:hover { background: var(--surface-2); }
.chip.on, .chip[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent-text); }
.chip.ai { color: var(--info); background: var(--info-soft); border-color: transparent; }
.chip.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.chip.good { color: var(--good); background: var(--good-soft); border-color: transparent; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }

label.field { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .88rem; color: var(--text-2); }
label.field .hint { font-weight: 400; color: var(--text-3); font-size: .8rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=url], select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .55rem .7rem; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .nav-btn:focus-visible, .chip:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; }
input.emoji-in { width: 3.4rem; text-align: center; font-size: 1.2rem; padding: .35rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
.err { color: var(--bad); font-size: .85rem; min-height: 1em; }

/* ---- panels, cards, lists ------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 1rem; }
.panel.flat { box-shadow: none; }
.panel + .panel { margin-top: 1rem; }
.page-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h2 { flex: 1 1 auto; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tab { appearance: none; border: 0; background: none; font: inherit; font-weight: 600; color: var(--text-3); padding: .55rem .8rem; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); }
.empty { text-align: center; color: var(--text-3); padding: 1.5rem 1rem; }
.empty .big { font-size: 2rem; display: block; margin-bottom: .3rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: .6rem; padding: .55rem .25rem; border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; }
.emo { font-size: 1.25rem; width: 1.7rem; text-align: center; flex: 0 0 auto; }
.sub { color: var(--text-3); font-size: .82rem; }
.overdue { color: var(--bad); }
.money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* ---- modal, toast, dialog --------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(12, 10, 8, .5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem 2rem; overflow-y: auto; }
.modal.hidden { display: none; }
.modal-box { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1.1rem; }
.modal-box.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.modal-head h3 { flex: 1 1 auto; font-size: 1.15rem; }
@media (max-width: 600px) { .modal { padding: 0; align-items: flex-end; } .modal-box { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; overflow-y: auto; padding-bottom: calc(1.1rem + env(safe-area-inset-bottom)); } }
.dlg-layer { z-index: 90; align-items: center; }
.dlg-box { max-width: 400px; }
.dlg-text { margin: 0 0 1rem; white-space: pre-line; }
.toast { position: fixed; left: 50%; bottom: calc(1.25rem + var(--bottom-nav)); transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: .75rem; background: var(--text); color: var(--bg); padding: .65rem .9rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); max-width: calc(100vw - 2rem); font-weight: 500; }
.toast.hidden { display: none; }
.toast button { appearance: none; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; padding: .1rem .3rem; }
@media (prefers-color-scheme: dark) { .toast button { color: var(--accent-text); } .toast { background: #f5f2ee; color: #12100e; } .toast button { color: #c2410c; } }
.menu { position: fixed; z-index: 70; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .3rem; min-width: 210px; }
.menu button { display: flex; width: 100%; gap: .55rem; align-items: center; appearance: none; border: 0; background: none; font: inherit; color: var(--text); text-align: left; padding: .5rem .65rem; border-radius: var(--radius-sm); cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: .25rem 0; }

/* ---- login ---------------------------------------------------------------------------- */
.login-wrap { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.login-card { width: 100%; max-width: 420px; }
.login-hero { text-align: center; margin-bottom: 1.25rem; }
.login-hero img { width: 84px; height: 84px; image-rendering: pixelated; }
.login-hero h1 { font-size: 2rem; margin-top: .4rem; letter-spacing: -.02em; }
.login-hero h1 span { color: var(--accent); }
.login-hero p { color: var(--text-2); margin: .4rem 0 0; }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin: 1rem 0 0; font-size: .85rem; color: var(--text-2); }
.features div { background: var(--surface-2); border-radius: var(--radius-sm); padding: .5rem .6rem; }

/* ---- Today ---------------------------------------------------------------------------- */
.day-nav { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.day-nav h2 { flex: 1 1 auto; text-align: center; font-size: 1.25rem; }
.day-nav h2 small { display: block; font-size: .8rem; color: var(--text-3); font-weight: 600; margin-bottom: .1rem; text-transform: uppercase; letter-spacing: .06em; }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; margin-bottom: 1rem; }
.week-day { appearance: none; font: inherit; min-width: 0; overflow: hidden; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: .35rem .2rem; cursor: pointer; text-align: center; color: var(--text-2); }
.week-day b { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.week-day .ems { font-size: .95rem; letter-spacing: -.05em; min-height: 1.3em; display: block; overflow: hidden; white-space: nowrap; }
.week-day[aria-current="date"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.week-day.today b::after { content: ' •'; color: var(--accent); }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px) { .slots { grid-template-columns: 1fr; } }
.slot-card { display: flex; flex-direction: column; gap: .6rem; min-height: 170px; }
.slot-card .slot-head { display: flex; align-items: center; gap: .4rem; color: var(--text-3); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.slot-card .slot-head .grow { text-align: right; }
.meal-main { display: flex; align-items: center; gap: .7rem; }
.meal-main .bigemo { font-size: 2.4rem; line-height: 1; width: 3rem; text-align: center; }
.meal-main .name { font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
.meal-main .name.projected { color: var(--text-2); font-weight: 600; }
.slot-card.eaten { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 30%, var(--border)); }
.slot-card.eaten .name { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--good) 60%, transparent); }
.slot-card .acts { margin-top: auto; display: flex; gap: .4rem; flex-wrap: wrap; }
.missed { border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); background: var(--bad-soft); }
.missed h3 { color: var(--bad); font-size: .95rem; margin-bottom: .4rem; }
.side-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
@media (max-width: 700px) { .side-cards { grid-template-columns: 1fr; } }
.stat-big { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }

/* ---- Meals rotation ---------------------------------------------------------------------- */
.rot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
@media (max-width: 960px) { .rot-cols { grid-template-columns: 1fr; } }
.rot-col h3 { display: flex; align-items: center; gap: .4rem; margin-bottom: .2rem; }
.rot-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.rot-item { display: flex; align-items: center; gap: .5rem; padding: .45rem .35rem; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--surface); position: relative; }
.rot-item + .rot-item { border-top-color: var(--border); border-radius: 0; }
.rot-item:hover { background: var(--surface-2); }
.rot-item .handle { cursor: grab; touch-action: none; color: var(--text-3); padding: .2rem .25rem; user-select: none; font-size: 1.05rem; line-height: 1; }
.rot-item .when { width: 4.4rem; flex: 0 0 auto; font-size: .78rem; color: var(--text-3); font-weight: 600; }
.rot-item.is-today .when { color: var(--accent-text); }
.rot-item.is-missed .when { color: var(--bad); }
.rot-item .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.rot-item.dragging { opacity: .9; box-shadow: var(--shadow-lg); z-index: 5; background: var(--surface); border-color: var(--accent); border-radius: var(--radius-sm); }
.rot-item.drop-gap { outline: 2px dashed color-mix(in srgb, var(--accent) 50%, transparent); }
.add-row { display: flex; gap: .4rem; margin-top: .6rem; }
.add-row input { flex: 1 1 auto; }
.add-row .btn { flex: 0 0 auto; }
.cal { width: 100%; border-collapse: collapse; }
.cal th, .cal td { border-top: 1px solid var(--border); padding: .45rem .4rem; text-align: left; vertical-align: top; font-size: .9rem; }
.cal th { color: var(--text-3); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.cal td.day { white-space: nowrap; font-weight: 600; width: 7.5rem; }
.cal tr.today td { background: var(--accent-soft); }
.cal .proj { color: var(--text-3); }
.cal .ate { color: var(--good); }
@media (max-width: 600px) { .cal td.day { width: auto; } .cal td, .cal th { font-size: .82rem; padding: .4rem .25rem; } }

/* ---- Groceries ------------------------------------------------------------------------------ */
.g-group { margin-top: 1rem; }
.g-group:first-child { margin-top: 0; }
.g-group h3 { display: flex; align-items: center; gap: .5rem; font-size: .95rem; padding-bottom: .3rem; border-bottom: 2px solid var(--border); }
.g-group h3 .grow { color: var(--text-2); }
.g-item { cursor: default; }
.g-item .tick { appearance: none; width: 1.45rem; height: 1.45rem; flex: 0 0 auto; border: 2px solid var(--border-strong); border-radius: 6px; background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.g-item .tick:hover { border-color: var(--accent); }
.g-item .tick:checked { background: var(--accent); border-color: var(--accent); }
.g-item .tick:checked::after { content: '✓'; color: var(--accent-contrast); font-weight: 900; font-size: .85rem; }
.g-item .nm { cursor: pointer; }
.g-item .nm b { font-weight: 600; }
.totals { display: flex; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.bars { display: flex; flex-direction: column; gap: .35rem; }
.bar-row { display: grid; grid-template-columns: 7.5rem 1fr 6rem; gap: .5rem; align-items: center; font-size: .88rem; }
.bar-row .bar { height: .9rem; background: var(--sunken); border-radius: 999px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar-row .money { text-align: right; }
.month-chart { display: flex; align-items: flex-end; gap: .3rem; height: 160px; padding-top: .5rem; }
.month-chart .col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: .2rem; height: 100%; justify-content: flex-end; min-width: 0; }
.month-chart .col i { width: 100%; max-width: 38px; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.month-chart .col.now i { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.month-chart .col span { font-size: .7rem; color: var(--text-3); }
.month-chart .col em { font-style: normal; font-size: .65rem; color: var(--text-2); white-space: nowrap; }
.export-img { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }

/* ---- Recipes ----------------------------------------------------------------------------- */
.r-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.r-card { appearance: none; text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; gap: .65rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .8rem; box-shadow: var(--shadow-sm); }
.r-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.r-card .emo { font-size: 1.8rem; width: 2.4rem; }
.r-card b { display: block; line-height: 1.25; }
.recipe-head { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.recipe-head .bigemo { font-size: 2.6rem; }
.recipe-head h2 { font-size: 1.6rem; }
.recipe-cols { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 1rem; align-items: start; }
@media (max-width: 800px) { .recipe-cols { grid-template-columns: 1fr; } }
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li { padding: .35rem 0; border-top: 1px solid var(--border); }
.ing-list li:first-child { border-top: 0; }
.ing-list .grp, .steps .grp { font-weight: 700; color: var(--text-3); text-transform: uppercase; font-size: .75rem; letter-spacing: .05em; border-top: 0; padding-top: .7rem; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li.st { counter-increment: step; position: relative; padding: .5rem 0 .5rem 2.4rem; border-top: 1px solid var(--border); }
.steps li.st::before { content: counter(step); position: absolute; left: 0; top: .5rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.tmr { appearance: none; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--accent-soft); color: var(--accent-text); font: inherit; font-weight: 700; border-radius: 999px; padding: 0 .45rem; cursor: pointer; white-space: nowrap; }
.tmr:hover { background: var(--accent); color: var(--accent-contrast); }
.preview-box { background: var(--surface-2); border-radius: var(--radius); padding: .7rem .8rem; font-size: .88rem; }
.scale { display: inline-flex; align-items: center; gap: .3rem; }

/* ---- Cook mode -------------------------------------------------------------------------- */
.cook { position: fixed; inset: 0; z-index: 75; background: var(--bg); display: flex; flex-direction: column; }
.cook-top { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.cook-top h3 { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cook-progress { height: 4px; background: var(--sunken); }
.cook-progress i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.cook-body { flex: 1 1 auto; overflow-y: auto; display: flex; justify-content: center; padding: 1.5rem 1.25rem; }
.cook-inner { width: 100%; max-width: 760px; margin: auto 0; }
.cook-step-no { color: var(--accent-text); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; margin-bottom: .6rem; }
.cook-text { font-size: clamp(1.35rem, 3.6vw, 2.1rem); line-height: 1.4; font-weight: 600; }
.cook-text .tmr { font-size: inherit; padding: 0 .4em; }
.cook-group { color: var(--text-3); font-weight: 700; margin-bottom: .3rem; }
.cook-ings { list-style: none; padding: 0; margin: 1rem 0 0; columns: 2 260px; column-gap: 1.5rem; }
.cook-ings li { break-inside: avoid; display: flex; gap: .6rem; align-items: center; padding: .45rem 0; font-size: 1.1rem; cursor: pointer; }
.cook-ings li input { width: 1.3rem; height: 1.3rem; accent-color: var(--accent); flex: 0 0 auto; }
.cook-ings li.got { color: var(--text-3); text-decoration: line-through; }
.cook-ings li.grp { font-weight: 800; color: var(--text-3); font-size: .8rem; text-transform: uppercase; cursor: default; }
.cook-foot { display: flex; gap: .6rem; padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
.cook-foot .btn { flex: 1 1 0; padding: .9rem; font-size: 1.05rem; }
.cook-mini { margin-top: 1.2rem; font-size: .95rem; }
.cook-done { text-align: center; }
.cook-done .big { font-size: 4rem; }
.timers { position: fixed; right: 1rem; bottom: calc(1rem + var(--bottom-nav)); z-index: 85; display: flex; flex-direction: column; gap: .5rem; align-items: flex-end; pointer-events: none; }

.timer { pointer-events: auto; display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; box-shadow: var(--shadow-lg); padding: .35rem .4rem .35rem .85rem; font-weight: 700; }
.timer .clock { font-variant-numeric: tabular-nums; font-size: 1.1rem; min-width: 3.6rem; text-align: right; }
.timer .lbl { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: .85rem; }
.timer.paused .clock { color: var(--text-3); }
.timer.ring { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); animation: ring 1s infinite; }
.timer.ring .lbl { color: var(--accent-contrast); }
@keyframes ring { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .timer.ring { animation: none; } }

/* ---- the tour ----------------------------------------------------------------------------- */
.tour-spot { position: fixed; z-index: 95; border-radius: 12px; box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px rgba(12, 10, 8, .6); pointer-events: none; transition: all .3s ease; }
.tour-spot.none { box-shadow: 0 0 0 9999px rgba(12, 10, 8, .6); width: 0 !important; height: 0 !important; left: 50% !important; top: 40% !important; }
.tour-bubble { position: fixed; z-index: 96; width: min(340px, calc(100vw - 2rem)); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1rem; border: 1px solid var(--border); transition: top .3s, left .3s; }
.tour-bubble h3 { margin-bottom: .35rem; }
.tour-bubble p { margin: 0 0 .9rem; color: var(--text-2); }
.tour-bubble .count { color: var(--text-3); font-size: .8rem; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-bubble { transition: none; } }

/* ---- setup -------------------------------------------------------------------------------- */
.setup { max-width: 760px; margin: 0 auto; }
.setup h2 { font-size: 1.6rem; margin-bottom: .3rem; }
.setup .slot-in { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 700px) { .setup .slot-in { grid-template-columns: 1fr; } }

body.cooking .toast { bottom: calc(5.4rem + env(safe-area-inset-bottom)); z-index: 86; }
body.cooking .timers { bottom: calc(8.6rem + env(safe-area-inset-bottom)); }

@media (max-width: 720px) {
  .slot-card { min-height: 0; gap: .5rem; }
  .meal-main .bigemo { font-size: 2rem; width: 2.5rem; }
  .top-tools { margin-left: auto; }
}

#back-choreboy { white-space: nowrap; }
body.logged-out .top-tools { display: flex; }
body.logged-out #account { display: none; }
