/* The "Fresh green" look and the simpler screens (public/ui/simple.js). Loaded last, so it decides.
   1. colours: cool neutral surfaces, hairlines, one green. A Look chosen in Settings still replaces the colours.
   2. shapes: tighter corners, flat buttons, outlined "Used", no heading badges
   3. the simpler screens: Pantry, the item sheet, Settings rows, Supply, Meals
   4. wide screens: a sidebar, a dense table and a detail panel */

/* ---- 1. colours ---- */
html:root:not([data-look]) {
  --bg: #f7f8f7; --card: #ffffff; --deep: #eef1ee; --ink: #0f1a14; --muted: #5d6b63; --faint: #98a39c; --line: #e1e6e2;
  --brand: #15803d; --brand-2: #15803d; --brandbg: #dcfce7; --btn: #15803d; --btn-ink: #ffffff;
  --pa: #15803d; --pa-ink: #ffffff; --accent: #15803d; --gold: #b45309;
  --good: #15803d; --soon: #b45309; --past: #dc2626; --empty: #98a39c;
  --ok: #15803d; --warn: #b45309; --bad: #dc2626; --okbg: #dcfce7; --warnbg: #fef3c7; --badbg: #fee2e2;
}
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]):not([data-look]) {
  --bg: #0b100d; --card: #131a16; --deep: #1b241f; --ink: #e8efe9; --muted: #93a199; --faint: #5f6e66; --line: #243029;
  --brand: #4ade80; --brand-2: #4ade80; --brandbg: #12301f; --btn: #22c55e; --btn-ink: #052e14;
  --pa: #4ade80; --pa-ink: #052e14; --accent: #4ade80; --gold: #fbbf24;
  --good: #4ade80; --soon: #fbbf24; --past: #f87171; --empty: #5f6e66;
  --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --okbg: #12301f; --warnbg: #3a2c0b; --badbg: #3b1616; color-scheme: dark; } }
html:root[data-theme="dark"]:not([data-look]) {
  --bg: #0b100d; --card: #131a16; --deep: #1b241f; --ink: #e8efe9; --muted: #93a199; --faint: #5f6e66; --line: #243029;
  --brand: #4ade80; --brand-2: #4ade80; --brandbg: #12301f; --btn: #22c55e; --btn-ink: #052e14;
  --pa: #4ade80; --pa-ink: #052e14; --accent: #4ade80; --gold: #fbbf24;
  --good: #4ade80; --soon: #fbbf24; --past: #f87171; --empty: #5f6e66;
  --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --okbg: #12301f; --warnbg: #3a2c0b; --badbg: #3b1616; color-scheme: dark; }
/* with a Look, the buttons take that Look's colour */
html[data-look] { --btn: var(--pa); --btn-ink: var(--pa-ink); --brandbg: color-mix(in srgb, var(--pa) 16%, var(--card)); --faint: var(--muted); }

/* ---- 2. shapes ---- */
:root { --radius: 10px; }
body { letter-spacing: -.003em; }
h1, h2, h3, .brand, .big-name { font-weight: 700; letter-spacing: -.02em; }
main h1 { font-size: 1.75rem; }
h2 { font-size: .8125rem; font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--muted); margin: 1.4rem 0 .5rem; }
h3 { font-size: 1rem; font-weight: 650; }
.hic { display: none !important; }
.card { border-radius: 10px; }
button, .btn, input, select, textarea { border-radius: 9px; }
button, .btn, button.tinted, .btn.tinted, .usebtn, .modal-actions button:not(.primary), .onhand-row button:not(.primary), button.primary, .btn.primary { box-shadow: none; }
button.primary, .btn.primary, :root[data-theme="dark"] button.primary, :root[data-theme="dark"] .btn.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button.primary, :root:not([data-theme="light"]) .btn.primary { color: var(--btn-ink); } }
button.tinted, .btn.tinted { background: var(--brandbg); color: var(--brand); border-color: transparent; }
button.danger { background: none; border-color: var(--line); color: var(--bad); }
button.sm, .btn.sm { border-radius: 8px; }
.list li .usebtn { background: none; border: 1px solid var(--line); color: var(--ink); font-weight: 600; border-radius: 8px; min-width: 60px; }
.chips button, .chips a.chip, .chips .needbtn, .tagbtn { border-radius: 7px; }
.chips button.on, .tagbtn.on, .chips .needbtn.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pill, .tag { border-radius: 6px; font-weight: 600; }
.thumb, .thumb.icon { border-radius: 8px; }
.thumb.icon { background: var(--deep); }
.ilist { border-radius: 10px; }
.irow-ic { background: var(--deep); color: var(--ink); border-radius: 8px; box-shadow: none; }
.seg { border-radius: 9px; background: var(--deep); } .seg button { border-radius: 7px; }
.seg button.on { background: var(--card); box-shadow: 0 0 0 1px var(--line); }
input.check { border-radius: 6px; border-width: 1.5px; }
input.check:checked { background: var(--btn); border-color: var(--btn); }
input.check::after { background: var(--btn-ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
#toast { border-radius: 10px; }
dialog { border-radius: 14px; }
@media (max-width: 699px) {
  dialog#modal:not(.plusdlg) { border-radius: 16px 16px 0 0; }
  dialog#modal:not(.plusdlg) .nv-sheetbar { border-radius: 16px 16px 0 0; }
}
@media (max-width: 899px), (hover: none) {
  nav.bottom { border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 26, 20, .06), 0 6px 20px rgba(15, 26, 20, .07); background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line); }
  nav.bottom a { border-radius: 12px; color: var(--muted); }
  nav.bottom a.on { color: var(--brand); }
  nav.bottom::before { border-radius: 12px; background: var(--brandbg); }
}

/* ---- 3. the simpler screens ---- */
/* the screen's name with the Settings button beside it */
.shead { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: 0 0 .8rem; }
.shead h1 { margin: 0; }
.gearbtn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); flex: none; }
.gearbtn .ion-ic { width: 20px; height: 20px; }

.pfind { display: flex; align-items: center; gap: .5rem; padding: 0 .75rem; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--muted); }
.pfind input { border: 0; background: none; padding: 0; min-height: 46px; outline: 0; }
.pfind:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brandbg); }
.pfind .ion-ic { width: 18px; height: 18px; flex: none; }
.bigacts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .7rem 0 1.1rem; }
.bigacts .btn { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 56px; font-size: 1.0625rem; font-weight: 600; text-decoration: none; border-radius: 10px; }
.bigacts .btn .ion-ic { width: 22px; height: 22px; }
.bigacts .btn:not(.primary) { border-color: var(--line); background: var(--card); color: var(--ink); }

.sect { display: flex; align-items: baseline; justify-content: space-between; margin: 1.2rem 0 .45rem; }
.sect h2 { margin: 0; }
.sect a { font-size: .875rem; font-weight: 600; color: var(--brand); text-decoration: none; }
.plist { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.plist li { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-bottom: 1px solid var(--line); min-height: 60px; }
.plist li:last-child { border-bottom: 0; }
.plist li.click { cursor: pointer; }
.plist li.click:active, .plist li.nv-held { background: var(--deep); }
.plist .grow { flex: 1; min-width: 0; }
.plist .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .sub { font-size: .8125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .sub .b { color: var(--bad); font-weight: 600; } .plist .sub .w { color: var(--warn); font-weight: 600; }
.plist .qty { font-size: 1.0625rem; }
.plist .usebtn, .plist .ghost { min-height: 40px; padding: 0 .75rem; background: none; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; flex: none; color: var(--ink); }
.plist .ghost.bad { color: var(--bad); }
.plist .grp { min-height: 0; padding: .35rem .75rem; background: var(--bg); font-size: .75rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.plist mark { background: var(--warnbg); color: inherit; border-radius: 3px; }
.pchips { display: flex; gap: .4rem; overflow-x: auto; margin: 0 0 .6rem; padding-bottom: 2px; scrollbar-width: none; }
.pchips::-webkit-scrollbar { display: none; }
.pchips button { min-height: 36px; padding: 0 .75rem; border-radius: 7px; white-space: nowrap; font-weight: 500; font-size: .875rem; color: var(--muted); background: var(--card); }
.pchips button b { font-weight: 500; color: var(--faint); margin-left: .25rem; }
.pchips button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; } .pchips button.on b { color: inherit; opacity: .7; }
.pnote { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: 0 0 .6rem; padding: .45rem .5rem .45rem .75rem; border-radius: 8px; background: var(--deep); font-size: .875rem; }
.pnote button { min-height: 32px; padding: 0 .6rem; border-radius: 7px; }
.pempty { text-align: center; padding: 1.6rem 1rem; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); background: var(--card); }
.pempty img.scene { display: block; width: min(200px, 60%); height: auto; margin: 0 auto .6rem; }
.pempty b { display: block; color: var(--ink); font-size: 1.0625rem; margin-bottom: .2rem; }
.pempty button, .pempty .btn { margin-top: .8rem; }

/* the item sheet: count, date, place, list, more */
.isheet-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.isheet-head h3 { margin: 0; font-size: 1.125rem; }
.icount { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .5rem; }
.icount .where { flex: 1; min-width: 0; font-weight: 600; }
.icount .where small { display: block; font-weight: 400; color: var(--muted); font-size: .8125rem; }
.icount b { min-width: 2.2ch; text-align: center; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.icount button { width: 48px; height: 48px; min-height: 0; padding: 0; border-radius: 9px; font-size: 1.5rem; line-height: 1; justify-content: center; }
.irows { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: .7rem 0; }
.irows > * { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 52px; padding: .3rem .75rem; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; color: var(--ink); text-align: left; font-weight: 400; }
.irows > *:last-child { border-bottom: 0; }
.irows .k { flex: 1; font-weight: 600; }
.irows .v { color: var(--muted); display: flex; align-items: center; gap: .3rem; }
.irows .v .ion-ic { width: 16px; height: 16px; }
.irows input[type=date] { width: auto; min-height: 38px; padding: .2rem .5rem; }
.irows button.sm { min-height: 36px; }
.irows .bad .k { color: var(--bad); }
.irows label { margin: 0; color: var(--ink); font-size: 1rem; }

/* Settings: plain rows in groups */
.sgroup { margin: 0 0 1.1rem; }
.sgroup h2 { margin: 0 0 .4rem .2rem; }
.switchrow { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; min-height: 56px; position: relative; }
.switchrow + .switchrow::before, .irow + .switchrow::before, .switchrow + .irow::before { content: ""; position: absolute; left: .9rem; right: 0; top: 0; border-top: 1px solid var(--line); }
.switchrow .grow { flex: 1; display: flex; flex-direction: column; } .switchrow b { font-weight: 600; }
.ilist.plain .irow + .irow::before { left: .9rem; }
.ilist.plain .irow { min-height: 52px; }
#inv .plist li button.usebtn { min-height: 40px; padding: 0 .75rem; background: none; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; font-size: .9375rem; }
.nv-sheetbar .nv-x { position: absolute; }
/* Use first: the item on one line, its two buttons under it */
.plist li.uf { flex-wrap: wrap; row-gap: .5rem; padding-bottom: .7rem; }
.plist li.uf .ufbtns { display: flex; gap: .5rem; width: 100%; padding-left: calc(40px + .7rem); }
.plist li.uf .ufbtns button { flex: 1; min-height: 38px; }

/* Scan and Talk */
.scanway { margin: 0 0 .8rem; }
.scanway button { min-height: 44px; font-weight: 600; }
.scanway button.on { background: var(--card); color: var(--ink); }
.scaninto { display: flex; align-items: center; gap: .6rem; margin: 0 0 .8rem; }
.scaninto[hidden] { display: none; }
.scaninto label { margin: 0; }
.scaninto select { flex: 1; }
a.pnote { text-decoration: none; color: var(--ink); }
.talkhow { margin: -.3rem 0 .8rem; }
.talkhelp { margin-top: 1.4rem; }
.talkhelp summary { font-weight: 600; color: var(--brand); cursor: pointer; padding: .5rem 0; }
.talkhelp .plist li { min-height: 0; }
.talkhelp .plist .name { white-space: normal; font-weight: 500; }
.tmic { border-radius: 10px; border-width: 1px; min-height: 56px; }
.plist li.uf .ufbtns button { min-height: 36px; }

/* Supply */
.sdays { padding: .9rem 1rem 1rem; }
.sd-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; margin-bottom: .5rem; }
.sd-num { display: block; font-size: 2.25rem; line-height: 1.05; letter-spacing: -.03em; font-weight: 700; }
.sd-of { color: var(--muted); font-size: .9375rem; }
.sgauge { margin: .7rem 0; }
.sg-top { display: flex; justify-content: space-between; font-size: .9375rem; }
.sg-top span { color: var(--muted); } .sg-top b span { color: inherit; }
.sbar.big { height: 8px; border-radius: 4px; }
.sbar.big i { border-radius: 4px; }
.sline .sbar { max-width: 220px; height: 4px; }
.sline.off { opacity: .55; }
.sstat { display: inline-flex; align-items: center; gap: .2rem; font-size: .8125rem; font-weight: 600; color: var(--muted); white-space: nowrap; flex: none; }
.sstat.ok { color: var(--ok); } .sstat.warn { color: var(--warn); }
.sstat .ion-ic { width: 15px; height: 15px; }
.plist li > .ion-ic { width: 16px; height: 16px; color: var(--faint); flex: none; }
.pchips button .plustag { margin-left: .3rem; }
button.wide { display: flex; justify-content: center; width: 100%; margin: .6rem 0 0; }
.cjob { align-items: flex-start !important; }
.cjob .linklike { padding: 0; min-height: 30px; }
.bagcard .baghead { display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; border: 0; background: none; padding: 0; }
.bagcard .baghead .grow { display: flex; flex-direction: column; }
.bagcard .baghead > .ion-ic { width: 16px; height: 16px; color: var(--faint); }
.bagcard .baghead[aria-expanded="true"] > .ion-ic { transform: rotate(90deg); }
.linklike { border: 0 !important; background: none !important; }
details.sgrp { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: .5rem; overflow: hidden; }
details.sgrp summary { display: flex; align-items: center; gap: .7rem; padding: .7rem .75rem; cursor: pointer; list-style: none; }
details.sgrp summary::-webkit-details-marker { display: none; }
details.sgrp summary .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
details.sgrp summary .sub { font-size: .8125rem; color: var(--muted); }
details.sgrp summary .sbar { height: 4px; max-width: 260px; }
details.sgrp summary > .ion-ic { width: 16px; height: 16px; color: var(--faint); transition: transform .15s ease; }
details.sgrp[open] summary > .ion-ic { transform: rotate(90deg); }
details.sgrp .plist { border: 0; border-top: 1px solid var(--line); border-radius: 0; }

/* Meals */
.tonight { padding: .8rem .9rem .9rem; margin-bottom: 1rem; }
.tn-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.tn-k { font-size: .8125rem; font-weight: 600; color: var(--brand); letter-spacing: .02em; }
.tn-body { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.tn-body h3 { margin: 0 0 .15rem; font-size: 1.25rem; letter-spacing: -.02em; }
.tn-body .sub { font-size: .875rem; color: var(--muted); } .tn-body .sub .w { color: var(--warn); font-weight: 600; }
.tn-art { flex: none; width: 64px; height: 64px; display: grid; place-items: center; background: var(--deep); border-radius: 10px; }
.btn.wide { margin: 0; }
.plist.mgroup { margin-bottom: .6rem; }
.plist.mgroup .grp { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem .45rem .75rem; font-size: .875rem; color: var(--ink); font-weight: 400; letter-spacing: 0; }
.plist.mgroup .grp .ghost { min-height: 34px; }
.rserves { display: flex; align-items: center; gap: .6rem; }
.plist li.more { min-height: 44px; } .plist li.more .sub { color: var(--brand); font-weight: 600; }
details.sgrp summary b { color: var(--ink); font-weight: 600; }
#lbody .card h3 { font-size: .8125rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin: 0 0 .2rem; }

/* ---- 4. wide screens: sidebar, table, detail panel ---- */
#side { display: none; }
.plist .col, .plist .thead { display: none; }
@media (min-width: 900px) and (hover: hover) {
  body:not(.bare) { padding-left: 232px; padding-bottom: 0; }
  body:not(.bare) header.top { position: fixed; left: 0; top: 0; bottom: 0; width: 232px; flex-direction: column; align-items: stretch; gap: 0; padding: 1rem .7rem; background: var(--card);
    border-right: 1px solid var(--line); border-bottom: 0; overflow-y: auto; z-index: 5; }
  header.top .brand { padding: .2rem .5rem 1.1rem; font-size: .9375rem; font-weight: 650; letter-spacing: -.01em; }
  header.top .brand img { width: 24px; height: 24px; border-radius: 6px; }
  .tabs { display: flex; flex-direction: column; gap: 2px; margin: 0; }
  .tabs a, #side a { display: flex; align-items: center; gap: .6rem; padding: .42rem .6rem; border-radius: 7px; color: var(--muted); font-size: .9063rem; font-weight: 500; text-decoration: none; }
  .tabs a:hover, #side a:hover { background: var(--bg); color: var(--ink); }
  .tabs a.on, #side a.on { background: var(--deep); color: var(--ink); font-weight: 600; }
  .tabs .ic, #side .ion-ic { width: 18px; height: 18px; display: grid; place-items: center; flex: none; }
  .tabs .ic .ion-ic { width: 18px; height: 18px; }
  .tabs .navbadge { position: static; margin-left: auto; }
  body:not(.bare) #side { display: flex; flex-direction: column; gap: 2px; flex: 1; margin-top: .6rem; }
  .side-k { padding: .8rem .6rem .25rem; font-size: .75rem; font-weight: 600; color: var(--faint); letter-spacing: .02em; }
  #side a:not(:has(.ion-ic)) { padding-left: 2.25rem; }
  .side-sp { flex: 1; min-height: 1rem; }
  nav.bottom { display: none; }
  main { max-width: 1120px; margin: 0; padding: 1.6rem 2.2rem 3rem; }
  main h1 { font-size: 1.5rem; }
  .gearbtn { display: none; }
  .shead { margin-bottom: 1.1rem; }
  /* Pantry: search and the two buttons on one line, Use first as three cards, the list as a table */
  .ptop { display: flex; gap: .7rem; align-items: stretch; margin-bottom: 1.2rem; }
  .ptop .pfind { flex: 1; }
  .ptop .bigacts { margin: 0; grid-template-columns: auto auto; }
  .ptop .bigacts .btn { min-height: 46px; padding: 0 1.2rem; font-size: .9375rem; }
  #usefirst .plist { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; border: 0; background: none; overflow: visible; }
  #usefirst .plist li { border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
  #inv .plist li { min-height: 48px; padding: .35rem .9rem; }
  #inv .plist li:not(.grp):not(.thead):hover { background: var(--bg); }
  #inv .plist .thumb { width: 30px !important; height: 30px !important; }
  #inv .plist .col { display: block; flex: none; font-size: .875rem; color: var(--muted); }
  #inv .plist .c-place { width: 150px; } #inv .plist .c-date { width: 130px; }
  #inv .plist .c-date .b { color: var(--bad); font-weight: 600; } #inv .plist .c-date .w { color: var(--warn); font-weight: 600; }
  #inv .plist .qty { width: 56px; font-size: .9375rem; }
  #inv .plist .c-use, #inv .plist li button.usebtn { width: 64px; min-width: 64px; }
  #inv .plist li button.usebtn { min-height: 32px; padding: 0; justify-content: center; font-size: .8125rem; }
  #inv .plist li:not(:has(.usebtn))::after { content: ""; width: 64px; flex: none; }
  #inv .plist .thead { display: flex; min-height: 36px; background: var(--bg); font-size: .75rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; padding-left: calc(.9rem + 30px + .7rem); }
  #inv .plist .thead .col, #inv .plist .thead .qty { font-size: .75rem; font-weight: 600; color: var(--muted); }
  #inv .plist .thead::after { display: none; }
  #inv .plist .sub .m-only { display: none; }
  #inv .plist li.grp { min-height: 0; padding: .3rem .9rem; }
  .tabs .ic { position: relative; } .tabs .navbadge { position: absolute; top: -6px; right: -10px; margin: 0; }
  /* a sheet is a panel down the right side */
  dialog#modal:not(.plusdlg) { margin: 0 0 0 auto; width: 440px; max-width: 92vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(15, 26, 20, .08); }
  dialog#modal:not(.plusdlg)::backdrop { background: rgba(15, 26, 20, .14); }
  dialog#modal:not(.plusdlg)[open] { animation: fresh-panel .22s ease-out; }
  @keyframes fresh-panel { from { transform: translateX(24px); opacity: 0; } }
  #modal-body { padding: 1.4rem; }
  /* two columns where a phone has one */
  .sgroup .ilist, .ilist.plain { max-width: 720px; }
  #view[data-view="supply"] .sdays, #view[data-view="meals"] .tonight { max-width: 720px; }
  #view[data-view="supply"] details.sgrp, #view[data-view="supply"] .plist, #view[data-view="meals"] .plist, #view[data-view="list"] #lbody, #view[data-view="talk"] > *, #view[data-view="scan"] > * { max-width: 720px; }
}
.plist .sub > span:not(:first-child)::before { content: " · "; color: var(--muted); font-weight: 400; }

/* the first screen */
.first { display: flex; flex-direction: column; align-items: stretch; gap: .7rem; max-width: 420px; margin: 0 auto; padding: 12vh 0 2rem; text-align: center; }
.first img { align-self: center; border-radius: 14px; }
.first h1 { margin: .4rem 0 0; font-size: 1.75rem; }
.first p { margin: 0 0 1rem; font-size: 1.0625rem; }
.first button.big { display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 58px; margin: 0; font-size: 1.0625rem; font-weight: 600; border-radius: 10px; }
.first button.big .ion-ic { width: 22px; height: 22px; }
.first-links { display: flex; flex-direction: column; align-items: center; gap: .2rem; margin-top: .9rem; }
.first-links .linklike { min-height: 44px; color: var(--brand); font-weight: 500; font-size: .9375rem; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; margin: 0; }

/* how to use the app: four picture cards (howto.js) */
.howto { display: flex; flex-direction: column; max-width: 420px; min-height: calc(100dvh - 2rem); margin: 0 auto; padding: .4rem 0 1.2rem; }
.ht-top { display: flex; justify-content: space-between; min-height: 44px; }
.ht-top .linklike { color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: .2rem; margin: 0; min-height: 44px; }
.ht-slide { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.ht-slide h1 { margin: 1.4rem 0 .4rem; font-size: 1.5rem; }
.ht-slide p { margin: 0 auto; max-width: 21rem; color: var(--muted); font-size: 1.0625rem; line-height: 1.45; min-height: 4.6em; }
.ht-slide[data-dir="fwd"] { animation: ht-in .28s ease-out; } .ht-slide[data-dir="back"] { animation: ht-in-back .28s ease-out; }
@keyframes ht-in { from { opacity: 0; transform: translateX(28px); } } @keyframes ht-in-back { from { opacity: 0; transform: translateX(-28px); } }
@media (prefers-reduced-motion: reduce) { .ht-slide { animation: none !important; } }
/* the picture: a small piece of the app, with its tab bar underneath */
.ht-pic { align-self: center; width: min(300px, 82vw); border: 1px solid var(--line); border-radius: 22px; background: var(--bg); overflow: hidden; box-shadow: 0 10px 30px rgba(15, 26, 20, .07); text-align: left; }
.ht-screen { display: flex; flex-direction: column; justify-content: center; gap: .5rem; min-height: 214px; padding: 1rem .9rem; }
.ht-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ht-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font-weight: 600; font-size: .9375rem; }
.ht-btn.on { background: var(--btn, var(--brand)); border-color: transparent; color: var(--btn-ink, #fff); }
.ht-btn.sm { min-height: 30px; padding: 0 .7rem; font-size: .8125rem; border-radius: 7px; }
.ht-btn .ion-ic { width: 18px; height: 18px; }
.ht-arrow { display: grid; place-items: center; color: var(--faint); height: 18px; } .ht-arrow .ion-ic { width: 18px; height: 18px; transform: rotate(90deg); }
.ht-row { display: flex; align-items: center; gap: .6rem; min-height: 52px; padding: .4rem .65rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.ht-row b { display: block; font-size: .9375rem; font-weight: 600; color: var(--ink); } .ht-row b.done { color: var(--faint); text-decoration: line-through; font-weight: 500; }
.ht-row small, .ht-card small { display: block; font-size: .8125rem; color: var(--muted); }
.ht-row .w { color: var(--warn); font-weight: 600; } .ht-row .b { color: var(--bad); font-weight: 600; }
.ht-row > .ion-ic { width: 18px; height: 18px; color: var(--brand); }
.ht-plus { font-weight: 700; color: var(--brand); background: var(--brandbg); border-radius: 99px; padding: .15rem .55rem; font-size: .875rem; }
.ht-n { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); } .ht-n s { color: var(--faint); font-weight: 500; margin-right: .15rem; }
.ht-box { width: 22px; height: 22px; flex: none; border: 1.5px solid var(--faint); border-radius: 6px; display: grid; place-items: center; }
.ht-box.on { background: var(--brand); border-color: var(--brand); color: var(--card); } .ht-box .ion-ic { width: 14px; height: 14px; }
.ht-k { font-size: .75rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.ht-card { display: flex; flex-direction: column; gap: .35rem; padding: .65rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.ht-card .ht-row { border: 0; padding: 0; min-height: 0; }
.ht-days { font-size: 1.375rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink); line-height: 1.1; }
.ht-bar { height: 6px; border-radius: 99px; background: var(--deep); overflow: hidden; } .ht-bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); } .ht-bar.water i { background: #0ea5e9; }
.ht-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: var(--card); padding: .35rem .3rem .45rem; }
.ht-tabs span { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .25rem 0; border-radius: 8px; font-size: .6563rem; font-weight: 500; color: var(--faint); }
.ht-tabs span .ion-ic { width: 18px; height: 18px; }
.ht-tabs span.on { color: var(--brand); background: var(--brandbg); font-weight: 650; }
.ht-dots { display: flex; justify-content: center; gap: .4rem; margin: 1.1rem 0; } .ht-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); } .ht-dots i.on { background: var(--brand); width: 20px; border-radius: 99px; }
.howto > button.big { min-height: 54px; font-size: 1.0625rem; font-weight: 600; border-radius: 10px; margin: 0; }
#htnote { display: flex; align-items: center; gap: .5rem; } #htnote a { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); } #htnote .ghost { min-width: 40px; }
.howto > button.big { display: flex; align-items: center; justify-content: center; width: 100%; }
.ht-top .linklike { text-decoration: none; }
.ht-tabs span .ion-ic svg { width: 18px; height: 18px; }
.ht-tabs span .ion-ic { display: grid; place-items: center; } .ht-tabs span svg { width: 18px !important; height: 18px !important; }
@media (min-width: 900px) { .howto { min-height: min(calc(100dvh - 6rem), 720px); } }
/* Talk button in the Shopping add box (list.js). Red while listening, like the Talk screen. */
#xform .xmic { flex: 0 0 auto; padding: 0 .7rem; }
#xform .xmic .ion-ic { width: 22px; height: 22px; }
#xform .xmic.on { background: var(--bad); border-color: var(--bad); color: #fff; }

/* Shopping: "Where are you shopping?" store names (shopat.js). Names only, no logos. */
.shopat h3 { margin: 0; }
.shoptiles { display: flex; flex-wrap: wrap; gap: .35rem; margin: .55rem 0 0; }
.shoptile { min-height: 36px; padding: .3rem .75rem; border: 1px solid var(--line) !important; border-radius: 8px; background: var(--card) !important;
  color: var(--ink); font-size: .875rem; font-weight: 500; letter-spacing: .005em; box-shadow: none !important; }
.shoptile.on { border-color: var(--accent) !important; background: var(--brandbg) !important; color: var(--brand); font-weight: 650; }
.shoptile.other { color: var(--muted); display: inline-flex; align-items: center; gap: .2rem; }
.shoptile.other svg { width: 1rem; height: 1rem; }
.storelinks li { align-items: center; }
.storelinks .btn { white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: .25rem; }
