/* Otthon: monochrome. Neutral greys, black and white; the only hue is the
   error/missed red. Type: Geist. */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --sunken: #f2f2f2;
  --hover: #ebebeb;
  --line: #e5e5e5;
  --line-strong: #d4d4d4;
  --muted: #737373;
  --ink: #0a0a0a;
  --on-ink: #ffffff;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgb(0 0 0 / .04);
  --r: 12px;
  --r-lg: 16px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #141414;
    --sunken: #1c1c1c;
    --hover: #232323;
    --line: #262626;
    --line-strong: #3a3a3a;
    --muted: #a1a1a1;
    --ink: #fafafa;
    --on-ink: #0a0a0a;
    --danger: #f87171;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Geist", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
p { margin: 0 0 12px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

h1, h2, h3 { font-weight: 600; margin: 0; letter-spacing: -.025em; line-height: 1.15; }
h1 { font-size: 32px; letter-spacing: -.035em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; letter-spacing: -.015em; }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 22px; height: 22px; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* --- app frame ------------------------------------------------------------ */
.nav {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 0 8px env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  border-top: 1px solid var(--line);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500;
}
.nav a .i { width: 22px; height: 22px; }
.nav a.on { color: var(--ink); }
.nav a.on .i { stroke-width: 2.25; }
.nav .av { width: 24px; height: 24px; font-size: 11px; }
.nav a.on .av { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.nav-brand { display: none !important; }
.nav-name { display: none; }

main { max-width: 1040px; margin: 0 auto; padding: 24px 16px calc(var(--nav-h) + 40px); }
main.narrow { max-width: 580px; }
main.bare { padding-bottom: 40px; }

@media (min-width: 900px) {
  body.has-nav { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .nav {
    position: sticky; top: 0; inset: auto; height: 100vh;
    display: flex; flex-direction: column; gap: 2px; padding: 20px 12px;
    background: var(--bg); backdrop-filter: none;
    border-top: 0; border-right: 1px solid var(--line);
  }
  .nav a {
    flex-direction: row; justify-content: flex-start; gap: 10px;
    padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 500;
  }
  .nav a .i { width: 18px; height: 18px; }
  .nav a:hover { background: var(--hover); color: var(--ink); }
  .nav a.on { background: var(--sunken); }
  .nav .nav-me { margin-top: auto; }
  .nav .nav-me .nav-label { display: none; }
  .nav .nav-me .nav-name { display: inline; }
  .nav a.on .av { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
  .nav-brand {
    display: flex !important; align-items: center; gap: 8px; margin: 0 0 20px;
    font-size: 15px !important; font-weight: 600 !important; color: var(--ink) !important; letter-spacing: -.02em;
  }
  .nav-brand:hover { background: none !important; }
  .nav-brand .i { width: 28px; height: 28px; padding: 6px; border-radius: 7px; background: var(--ink); color: var(--on-ink); stroke-width: 2; }
  main { padding: 48px 48px 64px; }
}

/* page header */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 24px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px;
}
.back:hover { color: var(--ink); }
.meta-line { margin: -12px 0 24px; color: var(--muted); font-size: 14px; }

section { margin-bottom: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 15px; letter-spacing: -.01em; }
.section-head a { color: var(--muted); font-weight: 500; text-decoration: none; font-size: 14px; }
.section-head a:hover { color: var(--ink); }

.sheet {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 20px;
}
.sheet + .sheet { margin-top: 16px; }
.sheet > h2:first-child { font-size: 15px; margin-bottom: 16px; }

/* --- buttons and fields --------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: 10px;
  font: inherit; font-weight: 500; font-size: 14px; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow);
  transition: background-color .15s ease-out, border-color .15s ease-out;
}
.btn:hover { background: var(--sunken); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); }
.btn.quiet { background: transparent; border-color: transparent; box-shadow: none; }
.btn.quiet:hover { background: var(--hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.btn.icon { width: 40px; padding: 0; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.sm.icon { width: 32px; padding: 0; }
.btn:disabled { opacity: .5; cursor: default; }
form.inline { display: inline-flex; margin: 0; }

.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { font-weight: 500; font-size: 14px; }
.field small, .hint { color: var(--muted); font-size: 13px; font-weight: 400; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select {
  font: inherit; font-size: 16px; color: inherit; width: 100%;
  min-height: 42px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .15s ease-out;
}
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--ink); }
input[type=file] { font: inherit; font-size: 14px; color: var(--muted); }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 500; margin-right: 12px; padding: 8px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 500; font-size: 14px; padding: 0; margin-bottom: 8px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.row > .field { flex: 1 1 200px; }

.search { position: relative; display: block; margin-bottom: 16px; max-width: 400px; }
.search .i { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search input { padding-left: 38px !important; }

.progress { position: relative; height: 28px; border-radius: 8px; background: var(--sunken); overflow: hidden; }
.progress .bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ink); transition: width .2s ease-out; }
.progress span { position: relative; display: block; text-align: center; line-height: 28px; font-size: 13px; font-weight: 500; mix-blend-mode: difference; color: #fff; }

/* --- people --------------------------------------------------------------- */
.av {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 12px; font-weight: 600; line-height: 1;
  background: var(--sunken); color: var(--ink); border: 1px solid var(--line);
}
.person { display: inline-flex; align-items: center; gap: 8px; }
.person .av { width: 22px; height: 22px; font-size: 10px; }
.person.none { color: var(--muted); }

/* --- task rows ------------------------------------------------------------ */
.tasks { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.task { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.task + .task { border-top: 1px solid var(--line); }
.tick-form { display: flex; margin: 0; }
.tick {
  width: 32px; height: 32px; flex: none; padding: 0; cursor: pointer;
  display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: transparent; color: transparent;
  transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out;
}
.tick .i { width: 16px; height: 16px; stroke-width: 2.5; }
.tick:hover { border-color: var(--ink); color: var(--muted); }
.done .tick { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-name { font-weight: 500; font-size: 15px; }
.done .task-name { color: var(--muted); text-decoration: line-through; }
.task-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.missed { color: var(--danger); font-weight: 500; }
.done .missed { display: none; }
.task-guide { color: var(--muted); }

/* --- home ----------------------------------------------------------------- */
.today-head { margin-bottom: 40px; }
.today-head .day { font-size: clamp(44px, 10vw, 72px); font-weight: 600; letter-spacing: -.05em; line-height: 1; }
.today-head .date { font-size: clamp(20px, 4vw, 28px); color: var(--muted); font-weight: 400; letter-spacing: -.03em; margin: 6px 0 0; }
.home-grid { display: grid; gap: 40px; }
@media (min-width: 1100px) { .home-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; } }

.plate-link {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 40px;
  border-radius: var(--r-lg); text-decoration: none;
  background: var(--ink); color: var(--on-ink);
}
.plate-link .mini-plate { width: 56px; height: 56px; flex: none; }
.plate-link strong { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.plate-link span { opacity: .65; font-size: 13px; }
.plate-link .i { margin-left: auto; opacity: .65; }
.plate-link:hover { background: color-mix(in srgb, var(--ink) 88%, var(--bg)); }

/* The three doors: food, chores, shopping. Ink floods out of the icon on
   hover or press; on load the tiles land one after another and each icon
   does its little move once. */
.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: -12px 0 40px; }
.door {
  --c: 36px; /* centre of the icon box: where the ink starts */
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 128px; padding: 14px;
  border-radius: 20px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); -webkit-tap-highlight-color: transparent;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), color .3s ease, border-color .3s ease;
  animation: rise .6s cubic-bezier(.2, .8, .2, 1) backwards;
  animation-delay: calc(var(--i) * 80ms + 60ms);
}
.door::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--ink); clip-path: circle(0 at var(--c) var(--c));
  transition: clip-path .5s cubic-bezier(.2, .8, .2, 1);
}
.door-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: var(--sunken); transition: background-color .3s ease;
  animation: .7s ease-in-out backwards; animation-delay: calc(var(--i) * 80ms + 480ms);
}
.door-icon .i { width: 24px; height: 24px; }
.door[data-anim="food"] .door-icon { animation-name: hat; }
.door[data-anim="chores"] .door-icon { animation-name: sweep; transform-origin: 50% 85%; }
.door[data-anim="shop"] .door-icon { animation-name: hop; transform-origin: 50% 100%; }
.door-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.door-label { font-size: 15px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.door-sub { font-size: 12px; line-height: 1.3; color: var(--muted); transition: color .3s ease; }
.door-badge {
  position: absolute; top: 12px; right: 12px; display: grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--ink); color: var(--on-ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: background-color .3s ease, color .3s ease;
  animation: badge-pop .45s cubic-bezier(.3, 1.6, .5, 1) backwards; animation-delay: .75s;
}
.door:active { transform: scale(.96); }
.door:active::before, .door:focus-visible::before { clip-path: circle(160% at var(--c) var(--c)); }
.door:active, .door:focus-visible { color: var(--on-ink); border-color: var(--ink); }
.door:is(:active, :focus-visible) .door-icon { background: color-mix(in srgb, var(--on-ink) 14%, transparent); }
.door:is(:active, :focus-visible) .door-sub { color: color-mix(in srgb, var(--on-ink) 65%, transparent); }
.door:is(:active, :focus-visible) .door-badge { background: var(--on-ink); color: var(--ink); }
/* Mouse only: on phones :hover sticks after a tap. */
@media (hover: hover) {
  .door:hover { color: var(--on-ink); border-color: var(--ink); transform: translateY(-3px); }
  .door:hover:active { transform: scale(.97); }
  .door:hover::before { clip-path: circle(160% at var(--c) var(--c)); }
  .door:hover .door-icon { background: color-mix(in srgb, var(--on-ink) 14%, transparent); }
  .door:hover .door-sub { color: color-mix(in srgb, var(--on-ink) 65%, transparent); }
  .door:hover .door-badge { background: var(--on-ink); color: var(--ink); }
  .door[data-anim="food"]:hover .i { animation: hat .7s ease-in-out; }
  .door[data-anim="chores"]:hover .i { animation: sweep .7s ease-in-out; transform-origin: 50% 85%; }
  .door[data-anim="shop"]:hover .i { animation: hop .7s ease-in-out; transform-origin: 50% 100%; }
}

@media (min-width: 640px) {
  .doors { gap: 16px; }
  .door { --c: 46px; gap: 40px; min-height: 176px; padding: 20px; border-radius: 24px; }
  .door-icon { width: 52px; height: 52px; border-radius: 16px; }
  .door-icon .i { width: 28px; height: 28px; }
  .door-label { font-size: 21px; letter-spacing: -.03em; }
  .door-sub { font-size: 14px; }
  .door-badge { top: 18px; right: 18px; min-width: 26px; height: 26px; border-radius: 13px; font-size: 13px; }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes badge-pop { from { transform: scale(0); } }
@keyframes hat { 35% { transform: translateY(-4px) rotate(-10deg); } 70% { transform: rotate(4deg); } }
@keyframes sweep { 30% { transform: rotate(-16deg); } 65% { transform: rotate(12deg); } }
@keyframes hop { 35% { transform: translateY(-6px); } 60% { transform: scale(1.1, .9); } 80% { transform: scale(.97, 1.03); } }

/* --- plain rows (recipes, guides, users) ---------------------------------- */
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.rows > li + li { border-top: 1px solid var(--line); }
.rows .row-link { display: flex; align-items: center; gap: 16px; padding: 14px 18px; text-decoration: none; }
.rows a.row-link:hover { background: var(--sunken); }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-weight: 500; font-size: 15px; line-height: 1.35; }
.row-sub { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row-end { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; flex: none; }
.count { display: inline-flex; align-items: center; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 500; }
.compact .row-link { padding: 12px 16px; }

.empty { padding: 32px 0; max-width: 46ch; }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--muted); }

/* --- recipe --------------------------------------------------------------- */
.recipe-cols { display: grid; gap: 16px; margin-bottom: 40px; align-items: start; }
.recipe-cols > .sheet { margin: 0; }
@media (min-width: 760px) { .recipe-cols { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li + li { border-top: 1px solid var(--line); }
.ingredients label { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; }
.ingredients input { margin-top: 2px; }
.ingredients input:checked + span { color: var(--muted); text-decoration: line-through; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; max-width: 66ch; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 0 0 16px; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; margin-top: -1px;
  border-radius: 50%; border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.prose { max-width: 66ch; }
.prose p:last-child { margin-bottom: 0; }
.prose a, .steps a, .ingredients a { text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

/* --- videos --------------------------------------------------------------- */
.videos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); align-items: start; }
.video { margin: 0; }
.video .frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #000; border: 1px solid var(--line); }
.video.tall .frame { aspect-ratio: 9 / 16; max-height: 78vh; max-width: 400px; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video video { object-fit: contain; }
.video figcaption { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.video figcaption a { color: inherit; }
.linkcard { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-decoration: none; }
.linkcard small { display: block; color: var(--muted); overflow-wrap: anywhere; }

/* --- rota ----------------------------------------------------------------- */
.tabs { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 24px; border-radius: 10px; background: var(--sunken); }
.tabs a {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px;
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .06); }

.weeknav { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.weeknav .label { min-width: 170px; text-align: center; }
.weeknav .label strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.weeknav .label span { font-size: 13px; color: var(--muted); }

/* desktop: the rota sheet */
.rota { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; table-layout: fixed; }
.rota th, .rota td { border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; padding: 10px 4px; }
.rota tr:last-child > * { border-bottom: 0; }
.rota thead tr:last-child > th { border-bottom: 1px solid var(--line); }
.rota thead th { font-weight: 500; font-size: 12px; color: var(--muted); padding: 12px 4px; }
.rota thead th b { display: grid; place-items: center; width: 28px; height: 28px; margin: 4px auto 0; font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.rota .rowhead { text-align: left; padding-left: 18px; width: 26%; }
.rota .rowhead strong { display: block; font-size: 14px; font-weight: 500; }
.rota .rowhead small { color: var(--muted); font-size: 12px; }
.rota .is-today { background: var(--sunken); }
.rota thead .is-today b { border-radius: 50%; background: var(--ink); color: var(--on-ink); }
.cell { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; }
.cell .tick { width: 36px; height: 36px; position: relative; color: inherit; border: 0; background: transparent; }
.cell .tick .av { width: 32px; height: 32px; font-size: 12px; background: var(--surface); }
.cell .tick .i { position: absolute; right: -4px; bottom: -4px; width: 12px; height: 12px; padding: 3px; border-radius: 50%; background: var(--ink); color: var(--on-ink); border: 2px solid var(--surface); box-sizing: content-box; opacity: 0; transition: opacity .15s ease-out; }
.cell.done .tick .i { opacity: 1; }
.cell.done .tick .av { color: var(--muted); }
.cell.mine .tick .av { border: 1.5px solid var(--ink); }
.cell.past:not(.done) .tick .av { border: 1.5px dashed var(--danger); color: var(--danger); }
.cell .tick:hover { background: transparent; }
.cell .tick:hover .av { background: var(--sunken); }
.cell .who { font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* phone: day strip + list */
.daystrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 20px; }
.daystrip button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0;
  font: inherit; font-size: 11px; font-weight: 500; color: var(--muted); cursor: pointer;
  border: 1px solid transparent; border-radius: 12px; background: transparent;
}
.daystrip button b { font-size: 17px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.daystrip button[aria-selected=true] { background: var(--ink); color: color-mix(in srgb, var(--on-ink) 70%, transparent); }
.daystrip button[aria-selected=true] b { color: var(--on-ink); }
.daystrip button.is-today:not([aria-selected=true]) { border-color: var(--line-strong); }
.daystrip .pips { display: flex; gap: 2px; height: 4px; }
.daystrip .pips i { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }
.daystrip .pips i.done { background: var(--ink); }
.daystrip button[aria-selected=true] .pips i { background: color-mix(in srgb, var(--on-ink) 35%, transparent); }
.daystrip button[aria-selected=true] .pips i.done { background: var(--on-ink); }
.day-panel h3 { margin-bottom: 10px; font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.rota-phone .day-panel + .day-panel { margin-top: 24px; }
.rota-phone.js .day-panel + .day-panel { margin-top: 0; }

.rota-desk { display: none; }
@media (min-width: 900px) {
  .rota-desk { display: block; }
  .rota-phone { display: none; }
}

.order { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.order .av { width: 24px; height: 24px; font-size: 10px; }
.order .av.next { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* chore form */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 420px; }
.day-pick { position: relative; }
.day-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.day-pick span {
  display: grid; place-items: center; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 500; font-size: 14px;
  transition: background-color .15s ease-out, color .15s ease-out;
}
.day-pick input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.day-pick input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; transition: border-color .15s ease-out; }
.choice:has(input:checked) { border-color: var(--ink); outline: 1px solid var(--ink); }
.choice input { margin-top: 2px; }
.choice b { display: block; font-weight: 500; }
.choice small { color: var(--muted); font-size: 13px; }
.members { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.members li { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; }
.members li + li { border-top: 1px solid var(--line); }
.members li:not(:has(input:checked)) .person { color: var(--muted); }
.members .check { flex: 1; min-height: 36px; }
.members .pos { width: 18px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

/* --- wheel ---------------------------------------------------------------- */
.wheel-page { display: flex; flex-direction: column; align-items: center; text-align: center; }
.wheel-page h1 { margin-bottom: 4px; }
.wheel-wrap { position: relative; width: min(88vw, 420px); aspect-ratio: 1; margin: 24px auto; }
#wheel { width: 100%; height: 100%; display: block; }
.pointer {
  position: absolute; top: -8px; left: 50%; translate: -50% 0; z-index: 2;
  width: 22px; height: 26px; background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.hub {
  position: absolute; top: 50%; left: 50%; translate: -50% -50%;
  width: 24%; aspect-ratio: 1; border-radius: 50%; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 0; background: var(--ink); color: var(--on-ink);
  outline: 6px solid var(--bg);
  font: inherit; font-weight: 600; font-size: clamp(13px, 3.4vw, 15px);
  transition: transform .15s ease-out;
}
.hub:disabled { cursor: default; }
.hub:active:not(:disabled) { transform: scale(.97); }
.result { width: min(100%, 420px); }
.result p { margin: 0 0 4px; color: var(--muted); }
.result h2 { font-size: 28px; letter-spacing: -.035em; margin-bottom: 16px; }
.result .toolbar { justify-content: center; }
.result.reveal { animation: reveal .3s ease-out; }
@keyframes reveal { from { opacity: 0; translate: 0 6px; } }

/* --- shopping list ------------------------------------------------------- */
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.shop-head h1 { margin: 0; }
.shop-more { position: relative; }
.shop-more summary { list-style: none; color: var(--muted); }
.shop-more summary::-webkit-details-marker { display: none; }
.shop-more[open] summary { background: var(--hover); color: var(--ink); }
.shop-more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 32px -12px rgb(0 0 0 / .25); transform-origin: top right;
  animation: menu-in .16s cubic-bezier(.2, .8, .2, 1);
}
.shop-more-menu form { display: flex; margin: 0; }
.shop-more-menu .btn { flex: 1; justify-content: flex-start; }
@keyframes menu-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.shop-add { display: flex; gap: 8px; margin-bottom: 16px; }
.shop-add input { flex: 1; min-width: 0; height: 46px; font-size: 16px !important; }
.shop-add .btn { height: 46px; flex: none; }
.items .task { gap: 12px; padding: 10px 8px 10px 14px; }
.item-tick, .item-del { display: flex; margin: 0; }
.item .btn.icon { color: var(--muted); }
.item .btn.icon:hover { color: var(--ink); }
.item .task-name { overflow-wrap: anywhere; }
/* The strike draws across the words instead of snapping on. */
.item .strike {
  background: linear-gradient(currentColor, currentColor) 0 58% / 0 1.5px no-repeat;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  transition: background-size .3s cubic-bezier(.2, .8, .2, 1);
}
.item.done .task-name { text-decoration: none; }
.item.done .strike { background-size: 100% 1.5px; }
.item .item-done, .item.done .item-added { display: none; }
.item.done .item-done { display: inline; }
.tick.pop { animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.item.new { animation: item-in .45s cubic-bezier(.2, .8, .2, 1); }
.items.clearing .item { animation: item-out .3s ease-in forwards; animation-delay: calc(var(--n, 0) * 40ms); }
.shop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.shop-actions form { display: flex; margin: 0; }
.shop-empty { padding-top: 24px; animation: rise .5s cubic-bezier(.2, .8, .2, 1) backwards; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 16px; border-radius: 18px; background: var(--sunken); }
.empty-icon .i { width: 28px; height: 28px; }
@keyframes pop { from { transform: scale(.75); } }
@keyframes item-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes item-out { to { opacity: 0; transform: translateX(24px); } }

/* --- toasts --------------------------------------------------------------- */
.toasts {
  position: fixed; z-index: 30; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 520px;
  padding: 10px 12px 10px 14px; border-radius: var(--r); font-weight: 500; font-size: 14px;
  background: var(--ink); color: var(--on-ink); box-shadow: 0 8px 24px rgb(0 0 0 / .16);
  animation: reveal .2s ease-out;
}
.toast.error .i:first-child { color: var(--danger); }
.toast button { margin-left: 4px; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 4px; display: flex; }
@media (min-width: 900px) { .toasts { bottom: 24px; left: 256px; } }
body:not(.has-nav) .toasts { bottom: 24px; }

/* --- auth ----------------------------------------------------------------- */
.auth { max-width: 380px; margin: 12vh auto 0; }
.wordmark { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.wordmark .i { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--ink); color: var(--on-ink); stroke-width: 2; box-sizing: border-box; }
.wordmark span { font-size: 26px; font-weight: 600; letter-spacing: -.04em; }

/* users */
.user-row { padding: 14px 18px; }
.user-row .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.user-row details summary { list-style: none; }
.user-row details summary::-webkit-details-marker { display: none; }
.user-row details[open] .user-tools { display: flex; }
.user-tools { display: none; flex-direction: column; gap: 12px; margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
