/* Kai: the whiteboard on the fridge. White board, marker colours per aisle, ticking draws a marker line through the item. */
:root {
  --board: #ffffff; --frame: #e3e7ec; --ink: #1d2228; --soft: #66707c; --tap: #f2f5f8;
  --m0: #1f9d55; --m1: #b7791f; --m2: #c05621; --m3: #c53030; --m4: #2b6cb0; --m5: #6b46c1; --m6: #b83280; --m7: #2c7a7b; --m8: #3182ce; --m9: #4a5568; --m10: #805ad5; --m11: #975a16; --m12: #718096;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --board: #16191d; --frame: #2a3037; --ink: #eef1f4; --soft: #9aa4b0; --tap: #20252b;
    --m0: #48c27e; --m1: #e0a845; --m2: #f08a4b; --m3: #f26b6b; --m4: #63a4f0; --m5: #a98bf0; --m6: #ef6fb3; --m7: #4fc1c1; --m8: #6cb6f5; --m9: #a8b3c2; --m10: #b79cf2; --m11: #d8a55a; --m12: #a9b4c2; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--board); color: var(--ink); font: 18px/1.4 ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif; }
main { max-width: 32rem; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px calc(100px + var(--safe-b)); outline: none; }
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.top h1 { font-size: 2.1rem; margin: 0; letter-spacing: -0.02em; }
.top p { margin: 0; color: var(--soft); font-size: .95rem; text-align: right; }
.hint { color: var(--soft); font-size: .95rem; } .empty { margin-top: 24px; }
a { color: var(--m4); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.btn { appearance: none; border: 0; border-radius: 14px; min-height: 50px; padding: 12px 18px; font: inherit; font-weight: 700; font-size: 1rem; background: var(--ink); color: var(--board); cursor: pointer; transition: transform .12s; }
.btn:active { transform: scale(.97); } .btn:disabled { opacity: .45; }
.btn.ghost { background: var(--tap); color: var(--ink); } .btn.wide { width: 100%; margin-top: 18px; }
.link { appearance: none; background: none; border: 0; font: inherit; color: var(--soft); text-decoration: underline; padding: 14px 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--m4); outline-offset: 2px; }

.add { display: flex; gap: 8px; position: sticky; top: 0; z-index: 2; background: var(--board); padding: 8px 0 10px; }
.add input, .form input, .form textarea, select { flex: 1; min-width: 0; font: inherit; font-size: 18px; color: var(--ink); background: var(--tap); border: 2px solid transparent; border-radius: 14px; padding: 12px 14px; min-height: 50px; }
.add input:focus, .form input:focus, .form textarea:focus, select:focus { outline: none; border-color: var(--ink); }

.aisle { font-size: .85rem; font-weight: 800; margin: 20px 0 4px; padding-left: 2px; }
.a0 { color: var(--m0); } .a1 { color: var(--m1); } .a2 { color: var(--m2); } .a3 { color: var(--m3); } .a4 { color: var(--m4); } .a5 { color: var(--m5); } .a6 { color: var(--m6); }
.a7 { color: var(--m7); } .a8 { color: var(--m8); } .a9 { color: var(--m9); } .a10 { color: var(--m10); } .a11 { color: var(--m11); } .a12 { color: var(--m12); }
.items, .meals, .days { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; align-items: center; border-bottom: 1.5px solid var(--frame); }
.tick { flex: 1; display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 8px 2px; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.tick small { margin-left: auto; color: var(--soft); font-size: .78rem; }
.box { flex: none; width: 26px; height: 26px; border: 2.5px solid currentColor; border-radius: 8px; opacity: .55; position: relative; transition: background .2s, opacity .2s; }
.done .box { opacity: 1; background: var(--ink); border-color: var(--ink); }
.done .box::after { content: ''; position: absolute; left: 7px; top: 2px; width: 7px; height: 13px; border: solid var(--board); border-width: 0 3px 3px 0; transform: rotate(45deg); }
/* the marker line drawn through a ticked item */
.name { position: relative; }
.name::after { content: ''; position: absolute; left: -3px; right: -3px; top: 52%; height: 3px; border-radius: 3px; background: var(--ink); transform: scaleX(0) rotate(-1.5deg); transform-origin: left; transition: transform .35s cubic-bezier(.3,.8,.3,1); }
.done .name { color: var(--soft); } .done .name::after { transform: scaleX(1) rotate(-1.5deg); background: var(--soft); }
.x { flex: none; width: 48px; height: 48px; border: 0; background: none; color: var(--soft); font-size: 1.6rem; line-height: 1; cursor: pointer; border-radius: 12px; }

.days li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1.5px solid var(--frame); }
.days label { flex: 0 0 7.5rem; display: grid; } .days small { color: var(--soft); font-size: .82rem; }
.days select { flex: 1; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }
.days .past { opacity: .5; } .days .today b { color: var(--m0); }

.new summary { list-style: none; display: inline-flex; align-items: center; } .new summary::-webkit-details-marker { display: none; }
.new[open] summary { margin-bottom: 14px; }
.form { display: grid; gap: 14px; } .form label { display: grid; gap: 6px; font-weight: 700; font-size: .95rem; }
.meals { margin-top: 18px; } .meals li { display: flex; align-items: flex-start; gap: 8px; padding: 12px 0; border-bottom: 1.5px solid var(--frame); }
.meals li div { flex: 1; } .meals small { display: block; color: var(--soft); font-size: .88rem; margin-top: 2px; }

.join { padding-top: 12vh; } .join h1 { font-size: 3.2rem; margin: 0; letter-spacing: -0.03em; } .join > p { color: var(--soft); margin: 4px 0 28px; }

.tabs { position: fixed; inset: auto 0 0; display: flex; background: color-mix(in srgb, var(--board) 88%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1.5px solid var(--frame); padding-bottom: var(--safe-b); }
.tabs[hidden] { display: none; }
.tabs a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 0 6px; font-size: .74rem; font-weight: 700; color: var(--soft); text-decoration: none; min-height: 54px; }
.tabs svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current] { color: var(--ink); }
.offline { position: sticky; top: 0; z-index: 5; margin: 0; padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 8px; background: var(--m1); color: #fff; font-size: .9rem; font-weight: 700; text-align: center; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(80px + var(--safe-b)); margin: auto; max-width: 28rem; background: var(--ink); color: var(--board); padding: 12px 16px; border-radius: 14px; text-align: center; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
