/* Carli sünnipäev: a Saaremaa October weekend.
   Dolomite limestone base, juniper ink, Baltic slate for actions,
   pike olive for done, fishing-float red for what is missing. */

@font-face {
  font-family: "Bricolage";
  src: url(/fonts/bricolage-latin.woff2) format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage";
  src: url(/fonts/bricolage-latin-ext.woff2) format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --bg: #E6E9E2;
  --surface: #F5F6F1;
  --sunk: #DADFD6;
  --ink: #17251F;
  --muted: #56655D;
  --line: #C3CAC1;
  --sea: #1F4F5C;
  --sea-ink: #F5F6F1;
  --sea-soft: #D0DFDF;
  --pike: #56651F;
  --pike-soft: #DEE4C7;
  --float: #C9391A;
  --float-soft: #F5DBD1;
  --float-white: #F7F4EE;
  --sky-top: #C9D2DC;
  --sky-mid: #DCD9DC;
  --sky-low: #EBDCC4;
  --trees: #22352C;
  --water: #2A5461;
  --water-line: #7FA4AB;
  --shadow: 0 1px 2px rgba(23, 37, 31, .08), 0 10px 30px rgba(23, 37, 31, .10);
  --radius: 14px;
  --radius-s: 9px;
  --tabbar: 64px;
  --font: "Bricolage", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #18232B;
    --surface: #1F2D36;
    --sunk: #142029;
    --ink: #E3E7DF;
    --muted: #9AA8A8;
    --line: #2F404A;
    --sea: #8CC3CC;
    --sea-ink: #10202A;
    --sea-soft: #23404A;
    --pike: #B4C66C;
    --pike-soft: #2B3823;
    --float: #FF7C57;
    --float-soft: #45271F;
    --float-white: #E9E4DA;
    --sky-top: #16212C;
    --sky-mid: #2A2C40;
    --sky-low: #4D3A4A;
    --trees: #0C1512;
    --water: #1A3440;
    --water-line: #4F7580;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 30px rgba(0, 0, 0, .3);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  font-optical-sizing: auto;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.12; text-wrap: balance; font-stretch: 82%; }
h1 { font-size: 1.75rem; font-weight: 750; }
h2 { font-size: 1.35rem; font-weight: 720; }
h3 { font-size: 1.05rem; font-weight: 650; font-stretch: 90%; }
p { margin: 0; }
a { color: var(--sea); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2.5px solid var(--sea); outline-offset: 2px; }

/* ---------- chrome ---------- */

/* prelive: a striped warning band above everything, in the page flow */
.ribbon {
  padding: calc(env(safe-area-inset-top, 0px) + 3px) 16px 3px; text-align: center;
  background: repeating-linear-gradient(135deg, var(--float) 0 14px, color-mix(in srgb, var(--float) 82%, var(--ink)) 14px 28px);
  color: var(--float-white); font-weight: 750; font-size: .8rem; letter-spacing: .08em;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 8px;
  /* no backdrop-filter: it would make the header the containing block of the fixed tab bar */
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 700; font-stretch: 85%; font-size: 1.05rem; margin-right: auto; min-height: 40px; }
.brand-float { width: 20px; height: 26px; background: url(/img/float.svg) center / contain no-repeat; flex: none; }

.who { position: relative; display: flex; align-items: center; gap: 6px; }
.who-btn {
  min-height: 40px; min-width: 40px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600;
}
.who-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 200px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; display: grid; gap: 10px;
}
.who-name { font-weight: 650; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  color: var(--ink); border: 1px solid transparent; background: transparent; cursor: pointer;
}
.icon-btn:hover { background: var(--sunk); }
.icon-btn[aria-current="page"] { background: var(--sea-soft); color: var(--sea); }
.icon-btn svg { width: 22px; height: 22px; }

/* bottom tab bar on phones */
.tabs {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tab {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 600; font-stretch: 78%;
  min-width: 0;
}
.tab svg { width: 23px; height: 23px; }
.tab[aria-current="page"] { color: var(--sea); }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--float);
}

main {
  display: block; width: 100%; max-width: 760px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 32px);
  outline: none;
}
main.wide { max-width: 1140px; }
main.bare { max-width: none; padding: 0; }
.boot { padding: 40px 0; color: var(--muted); }

.foot {
  text-align: center; color: var(--muted); font-size: .78rem;
  padding: 0 16px calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 14px);
  margin-top: calc(-1 * (var(--tabbar) + env(safe-area-inset-bottom, 0px) + 14px));
}

@media (min-width: 900px) {
  .topbar { padding: 10px 28px; gap: 20px; }
  .brand { margin-right: 0; }
  .tabs {
    position: static; display: flex; height: auto; padding: 0; margin-right: auto;
    background: none; border: 0; gap: 2px;
  }
  .tab { display: flex; gap: 7px; padding: 9px 12px; border-radius: 999px; font-size: .92rem; font-stretch: 88%; }
  .tab svg { width: 19px; height: 19px; }
  .tab:hover { background: var(--sunk); color: var(--ink); }
  .tab[aria-current="page"] { background: var(--sea-soft); }
  .tab[aria-current="page"]::before { display: none; }
  main { padding: 28px 28px 56px; }
  .foot { padding: 0 16px 24px; margin-top: 0; }
}

/* ---------- toasts ---------- */

.toasts {
  position: fixed; z-index: 80; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 14px);
  display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none;
}
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast {
  pointer-events: auto; padding: 12px 16px; border-radius: var(--radius-s);
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-weight: 550;
}
.toast.error { background: var(--float); color: var(--float-white); }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in .22s ease-out; }
  @keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
}

/* ---------- buttons & inputs ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--sea); background: var(--sea); color: var(--sea-ink);
  font-weight: 650; text-decoration: none; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: transparent; color: var(--sea); }
.btn.quiet { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.danger { background: var(--float); border-color: var(--float); color: var(--float-white); }
.btn.small { min-height: 36px; padding: 0 13px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.link-btn { background: none; border: 0; padding: 6px 0; color: var(--sea); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.mini-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 999px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.mini-btn:hover { background: var(--sunk); color: var(--ink); }
.mini-btn svg { width: 18px; height: 18px; }

.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: .92rem; }
.field .hint { font-size: .82rem; color: var(--muted); font-weight: 400; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: var(--radius-s);
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
}
textarea.input { min-height: 90px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--sea); outline: none; box-shadow: 0 0 0 3px var(--sea-soft); }
.check-field { display: flex; gap: 12px; align-items: center; min-height: 44px; cursor: pointer; font-weight: 550; }

/* switch */
.switch {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0;
  width: 44px; height: 26px; border-radius: 999px; position: relative; cursor: pointer;
  background: var(--sunk); border: 1.5px solid var(--line); transition: background-color .15s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s;
}
.switch:checked { background: var(--sea); border-color: var(--sea); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: .45; cursor: default; }

/* checkbox tick */
.tick {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--muted); background: var(--surface);
  display: grid; place-items: center;
}
.tick::after {
  content: ""; width: 12px; height: 7px; border: solid var(--sea-ink); border-width: 0 0 3px 3px;
  transform: rotate(-45deg) translate(1px, -1px); opacity: 0;
}
.tick:checked { background: var(--pike); border-color: var(--pike); }
.tick:checked::after { opacity: 1; border-color: var(--surface); }
.tick:disabled { cursor: default; }

/* segmented */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--sunk); gap: 2px; }
.seg button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-weight: 600; cursor: pointer; font-size: .92rem;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.status button { padding: 0 10px; font-size: .84rem; min-height: 32px; }
.seg.status button[aria-pressed="true"][data-v="vaja"] { color: var(--float); }
.seg.status button[aria-pressed="true"][data-v="olemas"] { color: var(--sea); }
.seg.status button[aria-pressed="true"][data-v="pakitud"] { color: var(--pike); }

/* ---------- common content ---------- */

.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.page-head p { color: var(--muted); max-width: 60ch; }
.block { margin-top: 30px; }
.block > h2, .block-head { margin-bottom: 12px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.empty { color: var(--muted); padding: 14px 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.panel > .list { margin: -4px 0; }

.person { font-weight: 650; }
.nobody { color: var(--float); font-weight: 600; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 650;
  background: var(--sunk); color: var(--muted); white-space: nowrap; vertical-align: 1px;
}
.badge.late { background: var(--float-soft); color: var(--float); }
.badge.soon { background: var(--sea-soft); color: var(--sea); }
.badge.me { background: var(--pike-soft); color: var(--pike); }
.badge.cat { background: transparent; border: 1px solid var(--line); }

/* the fishing-line progress: line, olive fill, a float bobbing at the tip */
.fline { position: relative; height: 26px; margin: 4px 10px 2px 8px; }
a.task-title { text-decoration: none; }
.fline::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 1.5px; background: var(--line); }
.fline .fill { position: absolute; left: 0; top: 13px; height: 4px; border-radius: 3px; background: var(--pike); width: var(--p, 0%); }
.fline .bob {
  position: absolute; top: 3px; left: var(--p, 0%); width: 16px; height: 20px; margin-left: -8px;
}
.fline .bob::before { content: ""; position: absolute; left: 7px; top: 0; width: 2px; height: 6px; background: var(--ink); border-radius: 1px; }
.fline .bob::after {
  content: ""; position: absolute; left: 1px; top: 5px; width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(180deg, var(--float) 0 50%, var(--float-white) 50% 100%);
  border: 1.5px solid var(--ink);
}
.fline.done .bob::after { background: linear-gradient(180deg, var(--pike) 0 50%, var(--float-white) 50% 100%); }
.progress-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center; }
.progress-row .label { font-weight: 650; }
.progress-row .pct { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- hero: horizon with countdown ---------- */

.hero {
  position: relative; overflow: hidden; border-radius: 22px; margin: 4px 0 8px;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-low) 100%);
  padding: 22px 20px 0; min-height: 300px; display: flex; flex-direction: column;
}
.hero h1 { font-size: clamp(1.45rem, 5.4vw, 2.1rem); max-width: 18ch; }
.count { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.count-days {
  font-size: clamp(4.2rem, 21vw, 7.2rem); font-weight: 800; font-stretch: 75%; line-height: .86;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.count-rest { font-size: 1.25rem; font-weight: 650; font-stretch: 85%; font-variant-numeric: tabular-nums; }
.count-when { margin-top: 10px; max-width: 34ch; font-weight: 500; }
.horizon { position: relative; margin: auto -20px 0; height: 110px; flex: none; }
.hero .count-when { margin-bottom: 28px; }
.horizon svg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; display: block; }
.horizon .trees { fill: var(--trees); }
.horizon .mill { stroke: var(--trees); fill: var(--trees); }
.horizon .water { fill: var(--water); }
.horizon .wave { stroke: var(--water-line); fill: none; stroke-width: 1.2; stroke-linecap: round; opacity: .8; }
.horizon .hbob { transform-box: fill-box; }
.horizon .hbob-top { fill: var(--float); }
.horizon .hbob-bottom { fill: var(--float-white); }
.horizon .hbob-stick { stroke: var(--float-white); stroke-width: 1.4; }
@media (prefers-reduced-motion: no-preference) {
  .horizon .hbob { animation: bob 3.6s ease-in-out infinite; }
  @keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2.5px) rotate(4deg); } }
}

.facts { display: grid; gap: 0; margin: 0; }
.facts > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: start; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; }
.facts .fact-edit { display: flex; gap: 6px; align-items: start; justify-content: space-between; }
@media (max-width: 420px) { .facts > div { grid-template-columns: 1fr; gap: 2px; } }

.overview-grid { display: grid; gap: 0 28px; }
@media (min-width: 720px) { .overview-grid { grid-template-columns: 1fr 1fr; } }
.money-line { font-size: 1.1rem; }
.money-line strong { font-size: 1.45rem; font-stretch: 85%; font-variant-numeric: tabular-nums; }

/* ---------- login ---------- */

.login { min-height: 100dvh; display: flex; flex-direction: column; }
.login .hero { border-radius: 0; margin: 0; flex: 1; min-height: 100dvh; padding: calc(env(safe-area-inset-top, 0px) + 28px) 20px 0; }
.login-inner { width: 100%; max-width: 520px; margin: 0 auto; display: grid; gap: 18px; }
.login h1 { font-size: clamp(1.8rem, 8vw, 2.6rem); max-width: 14ch; }
.login .sub { color: var(--muted); font-weight: 550; }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.name-btn {
  min-height: 64px; padding: 10px 14px; border-radius: 16px; cursor: pointer; text-align: left;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 1.15rem; font-weight: 700; font-stretch: 88%; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
}
.name-btn .initial {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sea-soft); color: var(--sea); font-size: 1rem;
}
.name-btn:hover { border-color: var(--sea); }
.pin-form { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.pin-form .who-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 700; }
.pin-input { font-size: 1.6rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.form-error { color: var(--float); font-weight: 600; }
.login .horizon { height: 150px; }
.login-inner { padding-bottom: 36px; }

/* ---------- budget ---------- */

.budget-grid { display: grid; gap: 0 32px; }
@media (min-width: 980px) {
  .budget-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  .budget-side { position: sticky; top: 76px; }
}
.budget-sum { font-size: 1.1rem; line-height: 1.35; }
.budget-sum strong { font-size: clamp(1.7rem, 7vw, 2.3rem); font-weight: 800; font-stretch: 78%; font-variant-numeric: tabular-nums; }
.budget-sum .sep { display: block; height: 6px; }

.receipt > li { padding: 10px 0; }
.rline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.rline .name-wrap { min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.rline .name {
  background: none; border: 0; padding: 4px 0; text-align: left; cursor: pointer; color: var(--ink);
  font-weight: 600; min-width: 0; overflow-wrap: anywhere;
}
.rline .name:hover { text-decoration: underline; text-underline-offset: 3px; }
.rline .leader { flex: 1; min-width: 12px; border-bottom: 2px dotted var(--line); transform: translateY(-4px); }
.rline .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rline .meta { grid-column: 2 / 4; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.receipt > li.off .name, .receipt > li.off .amt { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.receipt-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 0; border-top: 2px solid var(--ink); margin-top: 4px; font-weight: 800; font-size: 1.15rem; }

.ptable { width: 100%; border-collapse: collapse; }
.ptable th { text-align: center; font-size: .78rem; font-weight: 650; color: var(--muted); padding: 0 4px 8px; font-stretch: 85%; line-height: 1.2; }
.ptable th:first-child { text-align: left; }
.ptable td { padding: 8px 4px; border-top: 1px solid var(--line); text-align: center; }
.ptable td:first-child { text-align: left; font-weight: 600; }
.ptable td.r, .ptable th.r { text-align: right; }
.ptable tr.mine td { background: var(--pike-soft); }
.ptable tr.mine td:first-child { border-radius: 8px 0 0 8px; }
.ptable tr.mine td:last-child { border-radius: 0 8px 8px 0; }
.ptable .amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.credit { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-weight: 550; cursor: pointer; }

.pay-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; }
.pay-row .txt { flex: 1; min-width: 0; }
.pay-row .sub { font-size: .85rem; color: var(--muted); }
.transfer { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-weight: 600; }
.transfer .amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.settled { color: var(--pike); font-weight: 650; padding: 8px 0; }

details.history > summary { cursor: pointer; font-weight: 700; font-stretch: 85%; font-size: 1.2rem; min-height: 44px; display: flex; align-items: center; gap: 8px; }
details.history > summary::before {
  content: ""; width: 9px; height: 9px; border: solid var(--muted); border-width: 0 2.5px 2.5px 0;
  transform: rotate(-45deg); margin-right: 4px; transition: transform .15s;
}
details.history[open] > summary::before { transform: rotate(45deg) translate(-2px, -2px); }
.audit > li { padding: 9px 0; display: grid; gap: 1px; }
.audit .when { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- pack ---------- */

.cat-block { margin-top: 22px; }
.cat-block h3 { margin-bottom: 4px; display: flex; justify-content: space-between; gap: 10px; }
.cat-block h3 .count-sm { color: var(--muted); font-weight: 600; font-size: .9rem; }
.item-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 0; }
.item-row label { display: flex; align-items: center; gap: 12px; flex: 1; min-height: 44px; cursor: pointer; }
.item-row.checked .item-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--pike); text-decoration-thickness: 2px; }
.item-row.readonly .missing .item-name { color: var(--ink); }
.miss-mark { color: var(--float); font-weight: 800; width: 26px; text-align: center; flex: none; }
.ok-mark { color: var(--pike); font-weight: 800; width: 26px; text-align: center; flex: none; }
.own-tag { font-size: .75rem; color: var(--muted); }
.add-inline { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
@media (min-width: 560px) { .add-inline { grid-template-columns: 1fr 12rem auto; align-items: end; } }

.people > li { padding: 14px 0; }
.people details > summary { list-style: none; cursor: pointer; }
.people details > summary::-webkit-details-marker { display: none; }
.missing-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: .85rem; background: var(--float-soft); color: var(--ink); }
.chip .x { color: var(--float); font-weight: 800; }
.chip.more { background: var(--sunk); color: var(--muted); }
.person-list { margin-top: 10px; padding: 4px 14px; border-radius: var(--radius-s); background: var(--sunk); }

/* ---------- gear & tasks ---------- */

.gear > li { padding: 14px 0; display: grid; gap: 8px; }
.gear-top { display: flex; align-items: start; gap: 8px; }
.gear-top .title { flex: 1; min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.gear-top .qty { color: var(--muted); font-weight: 600; }
.gear-note { color: var(--muted); font-size: .9rem; margin-top: -4px; }
.gear-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.claim { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-weight: 550; }
.stats strong { color: var(--ink); }

.tasks > li { padding: 12px 0; display: flex; gap: 12px; align-items: start; }
.tasks .tick { margin-top: 2px; }
.task-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.task-title { background: none; border: 0; padding: 0; text-align: left; color: var(--ink); font-weight: 650; cursor: pointer; overflow-wrap: anywhere; }
.task-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.tasks li.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .88rem; color: var(--muted); }
.task-note { font-size: .9rem; color: var(--muted); }
.tasks li.late .task-title { color: var(--float); }
.filters { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }

/* ---------- timetable ---------- */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 2px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 7.2rem 1fr; gap: 10px; padding: 9px 0 9px 28px; }
.timeline li::before { content: ""; position: absolute; left: 1px; top: 15px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--sea); }
.timeline li.day::before { background: var(--sea); }
.timeline .when { font-weight: 700; font-variant-numeric: tabular-nums; font-stretch: 88%; }
@media (max-width: 420px) { .timeline li { grid-template-columns: 1fr; gap: 0; } }
.tt-edit { display: grid; gap: 8px; }
.tt-row { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 6px; align-items: center; }
.tt-row .input { min-height: 42px; padding: 8px 10px; }
.tt-tools { display: flex; }

.span2 { grid-column: 1 / -1; }
.item-row .spacer { flex: 1; }
.ptable .switch { width: 40px; height: 24px; }
.ptable .switch::after { width: 17px; height: 17px; }
.ptable .switch:checked::after { transform: translateX(16px); }
.logged-out .foot { margin-top: 0; padding: 14px 16px 18px; background: var(--water); color: var(--water-line); }

/* ---------- admin ---------- */

.admin-people { overflow-x: auto; }
.admin-people .ptable { min-width: 560px; }
.danger-zone { border-color: var(--float); }
.danger-zone h2 { color: var(--float); }

/* ---------- dialogs (bottom sheets on phones) ---------- */

dialog.sheet {
  border: 0; padding: 0; color: var(--ink); background: var(--surface);
  width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh;
  border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
}
dialog.sheet::backdrop { background: rgba(10, 20, 18, .45); }
.sheet form { display: grid; gap: 16px; padding: 20px 18px calc(env(safe-area-inset-bottom, 0px) + 18px); overflow-y: auto; max-height: 92dvh; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding-top: 4px; }
.sheet-actions .btn { padding: 0 16px; }
.del-btn { background: none; border: 0; padding: 8px 4px; color: var(--float); font-weight: 650; cursor: pointer; min-height: 44px; }
.sheet-actions .spacer { flex: 1; }
.copy-area { min-height: 260px; font-size: .9rem; }
@media (min-width: 640px) {
  dialog.sheet { width: min(520px, calc(100% - 32px)); margin: auto; border-radius: 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: sheet-in .2s ease-out; }
  @keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
}
