/* ==========================================================================
   ChoreRace — design tokens
   Hue (data-hue) × Shade (data-shade) → 16 looks, all derived in OKLCH.
   ========================================================================== */

:root {
  --h1: 50;  --h2: 10;          /* sunset: amber → rose */
  --c: .15;  --al: .64;         /* chroma + accent lightness (shade) */
  --on-accent: #fff;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
[data-scheme="dark"] { color-scheme: dark; }

[data-hue="ocean"]  { --h1: 245; --h2: 280; }
[data-hue="meadow"] { --h1: 155; --h2: 190; }
[data-hue="lilac"]  { --h1: 300; --h2: 340; }

[data-shade="none"]     { --c: 0;    --al: .28; --on-accent: #fff; }
[data-shade="soft"]     { --c: .08;  --al: .80; --on-accent: oklch(.28 .05 var(--h1)); }
[data-shade="standard"] { --c: .15;  --al: .64; --on-accent: #fff; }
[data-shade="bold"]     { --c: .21;  --al: .57; --on-accent: #fff; }

/* Derived tokens are re-declared on any themed element so previews compute their own palette. */
:root, [data-hue], [data-shade] {
  --bg:        oklch(.985 calc(var(--c) * .07) var(--h1));
  --surface:   oklch(1 0 0);
  --surface-2: oklch(.965 calc(var(--c) * .12) var(--h1));
  --border:    oklch(.91 calc(var(--c) * .12) var(--h1));
  --text:      oklch(.22 calc(var(--c) * .1) var(--h1));
  --muted:     oklch(.5 calc(var(--c) * .12) var(--h1));
  --accent:    oklch(var(--al) var(--c) var(--h1));
  --accent-2:  oklch(calc(var(--al) - .03) var(--c) var(--h2));
  --accent-soft: oklch(.95 calc(var(--c) * .35) var(--h1));
  --accent-ink:  oklch(.45 calc(var(--c) * .95) var(--h1));
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --grad-text: linear-gradient(135deg, oklch(min(var(--al), .6) var(--c) var(--h1)), oklch(min(var(--al), .57) var(--c) var(--h2)));
  --glow: 0 10px 30px -10px oklch(var(--al) var(--c) var(--h1) / .55);

  --ok: oklch(.58 .14 155);   --ok-soft: oklch(.95 .04 155);
  --warn: oklch(.6 .14 65);   --warn-soft: oklch(.96 .05 80);
  --bad: oklch(.58 .19 25);   --bad-soft: oklch(.95 .035 25);

  --shadow-sm: 0 1px 2px oklch(.2 .02 var(--h1) / .06);
  --shadow: 0 1px 2px oklch(.2 .02 var(--h1) / .05), 0 12px 32px -14px oklch(.3 .06 var(--h1) / .18);
  --cat-bg-l: .95;
  --cat-fg-l: .45;
}

/* Dark scheme: data-scheme is resolved by JS from the user's choice (auto/light/dark) before first paint. */
[data-scheme="dark"][data-shade="none"],     [data-scheme="dark"] [data-shade="none"]     { --al: .92; --on-accent: oklch(.2 0 0); }
[data-scheme="dark"][data-shade="soft"],     [data-scheme="dark"] [data-shade="soft"]     { --al: .82; }
[data-scheme="dark"][data-shade="standard"], [data-scheme="dark"] [data-shade="standard"] { --al: .74; --on-accent: oklch(.2 .03 var(--h1)); }
[data-scheme="dark"][data-shade="bold"],     [data-scheme="dark"] [data-shade="bold"]     { --al: .7;  --on-accent: oklch(.16 .03 var(--h1)); }

[data-scheme="dark"], [data-scheme="dark"] [data-hue], [data-scheme="dark"] [data-shade] {
    --bg:        oklch(.17 calc(var(--c) * .12) var(--h1));
    --surface:   oklch(.215 calc(var(--c) * .14) var(--h1));
    --surface-2: oklch(.26 calc(var(--c) * .16) var(--h1));
    --border:    oklch(.31 calc(var(--c) * .16) var(--h1));
    --text:      oklch(.96 calc(var(--c) * .05) var(--h1));
    --muted:     oklch(.72 calc(var(--c) * .12) var(--h1));
    --accent-soft: oklch(.3 calc(var(--c) * .45) var(--h1));
    --accent-ink:  oklch(.84 calc(var(--c) * .8) var(--h1));
    --grad-text: linear-gradient(135deg, oklch(max(var(--al), .78) var(--c) var(--h1)), oklch(max(var(--al), .75) var(--c) var(--h2)));
    --ok: oklch(.75 .15 155);  --ok-soft: oklch(.3 .05 155);
    --warn: oklch(.8 .14 75);  --warn-soft: oklch(.32 .06 70);
    --bad: oklch(.72 .17 25);  --bad-soft: oklch(.3 .07 25);
    --shadow-sm: 0 1px 2px oklch(0 0 0 / .3);
    --shadow: 0 1px 2px oklch(0 0 0 / .3), 0 16px 40px -18px oklch(0 0 0 / .6);
    --cat-bg-l: .3;
    --cat-fg-l: .85;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.2rem); letter-spacing: -.03em; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

[hidden] { display: none !important; }
.defs { position: absolute; width: 0; height: 0; }
.gs1 { stop-color: var(--accent); }
.gs2 { stop-color: var(--accent-2); }
.i { width: 1.25em; height: 1.25em; flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.accent-text { color: var(--accent-ink); }
.hide-sm { display: none; }
@media (min-width: 640px) { .hide-sm { display: inline; } }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg);
  text-decoration: none; font-weight: 600; transition: top .2s;
}
.skip-link:focus { top: 12px; }
.noscript { padding: 2rem; text-align: center; }

.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-mark { width: 48px; height: 48px; border-radius: 16px; background: var(--grad); animation: pulse 1.2s var(--ease) infinite; }

/* ==========================================================================
   Buttons, chips, form controls
   ========================================================================== */

.btn {
  --btn-bg: var(--surface-2); --btn-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 650; font-size: .95rem; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background-color .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.btn[aria-busy="true"] .i { animation: spin .8s linear infinite; }
.btn.primary { --btn-bg: var(--grad); --btn-fg: var(--on-accent); background: var(--grad); box-shadow: var(--glow); }
.btn.ok { --btn-bg: var(--ok); --btn-fg: #fff; }
.btn.danger { --btn-bg: var(--bad); --btn-fg: #fff; }
.btn.ghost { --btn-bg: transparent; box-shadow: inset 0 0 0 1.5px var(--border); }
.btn.ghost:hover { --btn-bg: var(--surface-2); }
.btn.danger-text { color: var(--bad); }
.btn.block { width: 100%; }
.btn.lg { min-height: 52px; font-size: 1.02rem; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: .85rem; }
.push { margin-left: auto; }

/* The star of the show. */
.btn.grab {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--grad); color: var(--on-accent);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 800; font-size: .85rem;
  box-shadow: var(--glow);
}
.btn.grab::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, oklch(1 0 0 / .35) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: shimmer 3.2s var(--ease) infinite;
}
.btn.grab:hover { transform: translateY(-2px) scale(1.03); }
.btn.grab:hover .i { animation: wiggle .5s var(--ease); }
.btn.locked, .btn.locked[disabled] {
  opacity: 1; background: transparent; color: var(--muted);
  box-shadow: none; outline: 1.5px dashed var(--border); outline-offset: -1.5px;
  font-size: .85rem; cursor: not-allowed;
}

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color .2s, color .2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.chip {
  display: inline-flex; align-items: center; gap: .35em;
  min-height: 26px; padding: 2px 10px; border-radius: 999px; border: 0;
  background: var(--surface-2); color: var(--muted);
  font-size: .78rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
}
.chip .i { width: 1.05em; height: 1.05em; }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.sm { font-size: .72rem; white-space: normal; }
.chip .avatar-xs { margin-left: -6px; }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > span, .field > legend, .label {
  font-size: .82rem; font-weight: 650; color: var(--muted); padding: 0; margin-bottom: 0;
}
.field > legend { margin-bottom: 8px; }
.field em { font-style: normal; font-weight: 500; opacity: .7; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); outline: none; resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.field select:disabled { opacity: .6; }
.pin-input { font-family: var(--mono); font-size: 1.4rem !important; letter-spacing: .6em; text-align: center; }
.code-input { font-family: var(--mono); font-size: 1.2rem !important; letter-spacing: .15em; text-transform: uppercase; text-align: center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; }
.form-actions .danger-text { margin-right: auto; }
.form-error {
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bad-soft); color: var(--bad); font-size: .9rem; font-weight: 550;
}
.hint { display: flex; align-items: center; gap: 6px; font-size: .83rem; color: var(--muted); }
.hint .i { color: var(--accent-ink); }

/* Avatars */
.avatar {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  width: var(--av, 40px); height: var(--av, 40px);
  box-shadow: inset 0 0 0 1.5px color-mix(in oklch, var(--accent) 25%, transparent);
}
.avatar .i { width: 70%; height: 70%; }
.avatar-xs { --av: 22px; }
.avatar-sm { --av: 30px; }
.avatar-md { --av: 40px; }
.avatar-lg { --av: 52px; }
.avatar-xl { --av: 76px; }

.avatar-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatar-opt { position: relative; display: grid; place-items: center; cursor: pointer; }
.avatar-opt input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-opt .avatar { --av: min(52px, 12vw); background: var(--surface-2); color: var(--muted); box-shadow: none; transition: transform .2s var(--spring), background-color .2s, color .2s, box-shadow .2s; }
.avatar-opt:hover .avatar { transform: scale(1.08); }
.avatar-opt input:checked + .avatar { background: var(--accent-soft); color: var(--accent-ink); box-shadow: 0 0 0 2.5px var(--accent); transform: scale(1.06); }
.avatar-opt input:focus-visible + .avatar { outline: 2.5px solid var(--accent); outline-offset: 3px; }

/* Category picker */
.cat-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cat-opt { position: relative; cursor: pointer; }
.cat-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cat-opt span {
  display: grid; justify-items: center; gap: 4px; padding: 10px 4px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  font-size: .75rem; font-weight: 600; color: var(--muted); transition: all .2s var(--ease);
}
.cat-opt .i { width: 22px; height: 22px; }
.cat-opt input:checked + span {
  border-color: oklch(.6 calc(var(--c) * .9) var(--cat-h));
  background: oklch(var(--cat-bg-l) calc(var(--c) * .3) var(--cat-h)); color: oklch(var(--cat-fg-l) calc(var(--c) * .9) var(--cat-h));
}
.cat-opt input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* Weekday picker */
.weekday-picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.weekday-opt { position: relative; cursor: pointer; }
.weekday-opt input { position: absolute; opacity: 0; pointer-events: none; }
.weekday-opt span {
  display: grid; place-items: center; min-height: 44px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); font-size: .8rem; font-weight: 650; color: var(--muted);
  transition: background-color .2s, color .2s, border-color .2s;
}
.weekday-opt input:checked + span { background: var(--grad); color: var(--on-accent); border-color: transparent; }
.weekday-opt input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* Segmented control */
.segmented {
  display: flex; gap: 4px; padding: 4px; margin: 0 0 18px;
  border-radius: 999px; background: var(--surface-2);
  overflow-x: auto; scrollbar-width: none;
}
.seg {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font-weight: 650; font-size: .9rem;
  cursor: pointer; white-space: nowrap; transition: background-color .2s, color .2s, box-shadow .2s;
}
.seg .i { width: 1.1em; height: 1.1em; }
.seg[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center; font-size: .72rem;
  background: var(--accent-soft); color: var(--accent-ink);
}

/* ==========================================================================
   Auth
   ========================================================================== */

.auth {
  min-height: 100dvh; max-width: 460px; margin: 0 auto;
  padding: max(32px, env(safe-area-inset-top)) 20px 32px;
  display: flex; flex-direction: column; gap: 20px; justify-content: center;
}
.auth::before {
  content: ""; position: fixed; inset: -20% -10% auto; height: 60vh; z-index: -1;
  background:
    radial-gradient(40% 50% at 25% 40%, color-mix(in oklch, var(--accent) 28%, transparent), transparent 70%),
    radial-gradient(40% 50% at 75% 30%, color-mix(in oklch, var(--accent-2) 24%, transparent), transparent 70%);
  filter: blur(20px);
}
.auth-hero { text-align: center; display: grid; justify-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px;
  background: var(--grad); color: var(--on-accent); box-shadow: var(--glow);
  animation: float 4s ease-in-out infinite;
}
.brand-mark .i { width: 34px; height: 34px; }
.brand-mark.sm { width: 34px; height: 34px; border-radius: 11px; animation: none; box-shadow: none; }
.brand-mark.sm .i { width: 18px; height: 18px; }
.brand { font-size: 2.4rem; letter-spacing: -.04em; font-weight: 800; }
.brand span, .logo-text span { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { color: var(--muted); max-width: 30ch; }
.auth-card { padding: 20px; }
.auth-card .segmented { margin-bottom: 20px; }
.auth-card .hint { justify-content: center; text-align: center; }
.demo-hint { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.demo-hint strong { width: 100%; text-align: center; font-weight: 600; }
.demo-hint .chip { cursor: pointer; font-family: var(--mono); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); min-height: 32px; }
.demo-hint .chip small { font-family: var(--font); opacity: .7; margin-left: 4px; }
.demo-hint .chip:hover { color: var(--accent-ink); }
.auth-foot { display: grid; justify-items: center; }

.theme-quick { display: grid; justify-items: center; gap: 12px; }
.swatches { display: flex; gap: 10px; }
.swatch {
  width: 36px; height: 36px; padding: 3px; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .2s, transform .2s var(--spring);
}
.swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--grad); }
.swatch[data-shade="none"] span { background: linear-gradient(135deg, oklch(.75 .12 var(--h1)), oklch(.7 .12 var(--h2))); }
.swatch:hover { transform: scale(1.1); }
.swatch[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--text); }
.shade-pills { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.shade-pill {
  min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted); font-size: .8rem; font-weight: 600;
}
.shade-pill[aria-pressed="true"] { background: var(--grad); color: var(--on-accent); }

.mode-pills { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.mode-pill {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted); font-size: .8rem; font-weight: 600;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.mode-pill .i { width: 16px; height: 16px; }
.mode-pill[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.mode-pills.lg .mode-pill { min-height: 44px; font-size: .9rem; }

.lang-picker {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 0 6px 0 14px; min-height: 40px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); cursor: pointer;
}
.lang-picker .i { width: 18px; height: 18px; flex: none; }
.lang-picker select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--text);
  font-weight: 650; font-size: .88rem; padding: 8px 26px 8px 0; cursor: pointer; outline: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 12px) 55%, calc(100% - 7px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.lang-picker:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
.lang-picker.lg { display: flex; min-height: 48px; border-radius: var(--radius-sm); }
.lang-picker.lg select { flex: 1; font-size: .95rem; }
.lang-picker option { color: initial; }

/* Full theme picker */
.theme-full { display: grid; gap: 10px; }
.theme-full .label { margin-top: 6px; }
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .theme-grid { grid-template-columns: repeat(4, 1fr); } }
.theme-card {
  display: grid; gap: 2px; padding: 8px 8px 10px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); transition: border-color .2s, transform .2s var(--spring);
}
.theme-card:hover { transform: translateY(-2px); }
.theme-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tc-preview { display: grid; gap: 5px; padding: 8px; border-radius: 9px; background: var(--bg); margin-bottom: 6px; }
.tc-bar { height: 6px; border-radius: 3px; background: var(--grad); }
.tc-row { display: flex; gap: 5px; align-items: center; }
.tc-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.tc-line { flex: 1; height: 5px; border-radius: 3px; background: var(--border); }
.tc-btn { height: 12px; width: 60%; border-radius: 6px; background: var(--grad); }
.tc-name { font-weight: 700; font-size: .88rem; }
.tc-desc { font-size: .72rem; color: var(--muted); }

/* ==========================================================================
   App shell
   ========================================================================== */

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }

.app-header {
  position: sticky; top: 0; z-index: 30;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in oklch, var(--bg) 72%, transparent);
  backdrop-filter: saturate(1.8) blur(18px); -webkit-backdrop-filter: saturate(1.8) blur(18px);
  border-bottom: 1px solid color-mix(in oklch, var(--border) 60%, transparent);
}
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.03em; font-size: 1.15rem; }
.header-pot {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border);
  font-size: .82rem; color: var(--muted); text-decoration: none;
}
.header-pot strong { color: var(--text); }
.header-pot .i { color: var(--accent-ink); }
.mini-bar { display: none; width: 48px; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--grad); border-radius: 3px; }
@media (min-width: 520px) { .mini-bar { display: block; } }
.avatar-btn { border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; transition: transform .2s var(--spring); }
.avatar-btn:hover { transform: scale(1.06); }
@media (max-width: 380px) { .logo-text { display: none; } }

main.container { padding-top: 20px; padding-bottom: calc(120px + env(safe-area-inset-bottom)); outline: none; }
main.enter > * { animation: rise .45s var(--ease) both; }
main.enter > *:nth-child(2) { animation-delay: .04s; }
main.enter > *:nth-child(3) { animation-delay: .08s; }
main.enter > *:nth-child(4) { animation-delay: .12s; }
main.enter > *:nth-child(n+5) { animation-delay: .16s; }

.bottom-nav {
  position: fixed; z-index: 40; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; gap: 4px; padding: 6px;
  border-radius: 999px; border: 1px solid var(--border);
  background: color-mix(in oklch, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.8) blur(18px); -webkit-backdrop-filter: saturate(1.8) blur(18px);
  box-shadow: var(--shadow);
}
.nav-item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 68px; min-height: 52px; padding: 0 10px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 650;
  transition: color .2s, background-color .25s var(--ease);
}
.nav-item .i { width: 22px; height: 22px; }
.nav-item:hover { color: var(--text); }
.nav-item[aria-current="page"] { color: var(--on-accent); background: var(--grad); box-shadow: var(--glow); }
.nav-badge {
  position: absolute; top: 4px; right: 12px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; font-size: .66rem; font-weight: 800;
  background: var(--text); color: var(--bg);
}
.nav-badge.alert { background: var(--bad); color: #fff; animation: pop .4s var(--spring); }
.nav-item[aria-current="page"] .nav-badge { background: var(--surface); color: var(--text); }

/* ==========================================================================
   Layout + cards
   ========================================================================== */

.page-head { display: grid; gap: 6px; margin: 4px 0 20px; }
.page-head.row { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.lead { color: var(--muted); font-size: 1.05rem; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card + .card, .card + .kpis, .kpis + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; font-weight: 700; }
.card-title .i { color: var(--accent-ink); }
.big-num { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.big-num span { font-size: 1rem; color: var(--muted); font-weight: 600; }
.link { color: var(--accent-ink); font-weight: 650; font-size: .88rem; text-decoration: none; }
.link:hover { text-decoration: underline; }

.grid-2 { display: grid; gap: 16px; margin-bottom: 16px; }
.grid-2.align-start { align-items: start; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-2 > .card + .card { margin-top: 0; }
.stack { display: grid; gap: 16px; }
.stack > .card + .card { margin-top: 0; }

.stat-card { display: flex; align-items: center; gap: 20px; }
.pot-card { display: grid; gap: 12px; align-content: center; }
.pot-top { display: flex; align-items: center; gap: 14px; }
.pot-icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; flex: none;
  background: var(--accent-soft); color: var(--accent-ink);
}
.pot-icon .i { width: 28px; height: 28px; }

/* Ring */
.ring { position: relative; width: var(--size); height: var(--size); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; }
.ring-track { stroke: var(--surface-2); }
.ring-bar { stroke: url(#g-accent); stroke-linecap: round; transition: stroke-dasharray .8s var(--ease); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-center strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.ring-center small { font-size: .72rem; color: var(--muted); font-weight: 600; }

/* Bar */
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width .8s var(--ease); }
.bar.warn span { background: linear-gradient(90deg, var(--warn), var(--accent-2)); }
.bar.bad span { background: var(--bad); }

/* Category badge */
.cat {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; flex: none;
  background: oklch(var(--cat-bg-l) calc(var(--c) * .32) var(--cat-h)); color: oklch(var(--cat-fg-l) calc(var(--c) * .9) var(--cat-h));
}
.cat.sm { width: 34px; height: 34px; border-radius: 10px; }
.cat.sm .i { width: 18px; height: 18px; }

/* ==========================================================================
   Tasks
   ========================================================================== */

.task-list { display: grid; gap: 10px; }
.board { display: grid; gap: 10px; }
.section-title { font-size: .85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 2px 2px; }
.section-title:first-child { margin-top: 0; }

.task {
  display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: start;
  padding: 14px; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.card .task { box-shadow: none; background: color-mix(in oklch, var(--surface-2) 45%, var(--surface)); }
.task:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.task-icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  background: oklch(var(--cat-bg-l) calc(var(--c) * .32) var(--cat-h)); color: oklch(var(--cat-fg-l) calc(var(--c) * .9) var(--cat-h));
}
.task-icon .i { width: 24px; height: 24px; }
.task-main { min-width: 0; display: grid; gap: 6px; }
.task-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.task-title { font-size: 1rem; font-weight: 680; letter-spacing: -.01em; overflow-wrap: anywhere; }
.reward {
  flex: none; padding: 3px 10px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok); font-weight: 800; font-size: .85rem; font-variant-numeric: tabular-nums;
}
.reward.free { background: var(--surface-2); color: var(--muted); font-weight: 650; }
.task-desc { color: var(--muted); font-size: .9rem; white-space: pre-line; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.task-times { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0 0; padding: 0; list-style: none; font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.task-times li { display: inline-flex; align-items: center; gap: 4px; }
.task-times svg { width: 13px; height: 13px; flex: none; }
.task-times .ok { color: var(--ok); }
.task-times .warn { color: var(--warn); font-weight: 650; }
.task-times .bad { color: var(--bad); font-weight: 650; }
.task-actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.task-actions .btn { flex: 1; }
.task-actions .btn.ghost { flex: 0 0 auto; }
.task-actions .icon-btn { margin-left: auto; }
.task.status-open .task-actions .btn.grab { flex: 1; }
.task.status-completed { opacity: .85; }
.task.status-expired { opacity: .7; }
.task.status-expired .task-title, .task.status-expired .reward { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.task.status-expired .task-icon { filter: grayscale(1); }
.task.proposal { border-style: dashed; }
.task.proposal-pending { border-left: 3px solid var(--warn); border-left-style: solid; }
.task.proposal-rejected { opacity: .7; }
.task.proposal-rejected .task-title { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.task.is-overdue { border-color: color-mix(in oklch, var(--bad) 40%, var(--border)); }
.task.status-claimed, .task.status-assigned { border-left: 3px solid var(--accent); }
.task.status-pending { border-left: 3px solid var(--warn); }

@media (min-width: 640px) {
  .task { grid-template-columns: auto 1fr auto; align-items: center; }
  .task-actions { grid-column: auto; }
  .task-actions .btn { flex: none; }
  .task-actions .btn.grab { min-width: 130px; }
}
.task.compact { grid-template-columns: auto 1fr auto; align-items: center; padding: 12px; }
.task.compact .task-actions { grid-column: auto; }
.task.compact .task-actions .btn { flex: none; padding: 0 14px; }
.task.compact .task-icon { width: 40px; height: 40px; border-radius: 12px; }
@media (max-width: 420px) {
  .task.compact { grid-template-columns: auto 1fr; }
  .task.compact .task-actions { grid-column: 1 / -1; }
  .task.compact .task-actions .btn { flex: 1; }
}

.fab {
  position: fixed; z-index: 35; right: max(16px, calc(50% - 524px)); bottom: calc(92px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 20px 0 16px;
  border: 0; border-radius: 999px; background: var(--grad); color: var(--on-accent);
  font-weight: 750; box-shadow: var(--glow), var(--shadow); cursor: pointer;
  transition: transform .2s var(--spring);
}
.fab .i { width: 24px; height: 24px; }
.fab:hover { transform: translateY(-2px) scale(1.04); }
@media (max-width: 480px) { .fab span { display: none; } .fab { width: 56px; padding: 0; justify-content: center; } }

/* ==========================================================================
   Leaderboard / podium
   ========================================================================== */

.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 8px; padding-top: 28px; }
.podium-spot { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; min-width: 0; }
.podium-name { font-weight: 700; font-size: .92rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-xp { font-size: .78rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.podium-block {
  width: 100%; margin-top: 6px; border-radius: 14px 14px 6px 6px;
  display: grid; place-items: start center; padding-top: 8px;
  font-size: 1.3rem; font-weight: 800; color: var(--muted); background: var(--surface-2);
}
.place-1 .podium-block { height: 92px; background: var(--grad); color: var(--on-accent); box-shadow: var(--glow); }
.place-2 .podium-block { height: 68px; }
.place-3 .podium-block { height: 50px; }
.place-1 .avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5.5px var(--accent); }
.crown { position: absolute; top: -26px; color: var(--accent); animation: float 3s ease-in-out infinite; }
.crown .i { width: 24px; height: 24px; }
.podium-spot.is-me .podium-name { color: var(--accent-ink); }

.rank-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.rank-list li.is-me { background: var(--accent-soft); }
.rank-n { width: 20px; text-align: center; font-weight: 800; color: var(--muted); }
.rank-name { flex: 1; font-weight: 600; }
.rank-xp, .rank-money { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.podium-money { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px dashed var(--border); display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .85rem; }
.podium-money li { display: flex; align-items: center; gap: 6px; }
.podium-money strong { color: var(--ok); }

/* Feed */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.feed-icon .i { width: 16px; height: 16px; }
.feed-icon.accent { background: var(--accent-soft); color: var(--accent-ink); }
.feed-icon.ok { background: var(--ok-soft); color: var(--ok); }
.feed-icon.warn { background: var(--warn-soft); color: var(--warn); }
.feed-text { font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
.feed time { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: live 2s infinite; }

/* Empty state */
.empty { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 22px; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 6px; }
.empty-icon .i { width: 30px; height: 30px; }
.empty h3 { font-size: 1.05rem; }
.empty p { color: var(--muted); font-size: .9rem; max-width: 36ch; }

/* ==========================================================================
   Me
   ========================================================================== */

.me-hero { display: grid; justify-items: center; gap: 18px; text-align: center; position: relative; overflow: hidden; }
.me-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 90% at 0% 0%, color-mix(in oklch, var(--accent) 20%, transparent), transparent 70%),
    radial-gradient(50% 80% at 100% 0%, color-mix(in oklch, var(--accent-2) 16%, transparent), transparent 70%);
}
.me-hero > * { position: relative; }
.me-hero .ring-track { stroke: var(--surface); }
.me-info { display: grid; gap: 8px; width: 100%; max-width: 440px; }
.me-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
@media (min-width: 720px) {
  .me-hero { grid-template-columns: auto 1fr; justify-items: start; text-align: left; padding: 24px; }
  .me-chips { justify-content: flex-start; }
}

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } .kpis.six { grid-template-columns: repeat(3, 1fr); } }
.kpi {
  display: grid; gap: 2px; padding: 14px; border-radius: 18px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi strong { font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi-money { justify-self: start; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: .78rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.kpi-money.bad { background: var(--bad-soft); color: var(--bad); }
.money-tag {
  display: inline-flex; align-items: center; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok); font-size: .75rem; font-weight: 750; letter-spacing: 0;
  text-transform: none; font-variant-numeric: tabular-nums; white-space: nowrap; vertical-align: middle;
}
.money-tag.bad { background: var(--bad-soft); color: var(--bad); }
.head-value { display: grid; justify-items: end; line-height: 1.15; }
.head-value strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; color: var(--ok); font-variant-numeric: tabular-nums; }
.head-value span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 6px; }
.kpi-icon .i { width: 18px; height: 18px; }
.kpi.bad { border-color: color-mix(in oklch, var(--bad) 40%, var(--border)); }
.kpi.bad .kpi-icon { background: var(--bad-soft); color: var(--bad); }
.kpi.bad strong { color: var(--bad); }
.kpi.warn .kpi-icon { background: var(--warn-soft); color: var(--warn); }
.kpi.warn strong { color: var(--warn); }

.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .badges { grid-template-columns: repeat(4, 1fr); } }
.badge {
  display: grid; justify-items: center; align-content: start; gap: 4px; padding: 16px 10px; text-align: center;
  border-radius: 18px; background: var(--surface-2); min-width: 0;
}
.badge strong { font-size: .88rem; }
.badge small { font-size: .74rem; color: var(--muted); line-height: 1.3; }
.badge-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; margin-bottom: 4px; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--border); }
.badge-icon .i { width: 26px; height: 26px; }
.badge.earned { background: var(--accent-soft); }
.badge.earned .badge-icon { background: var(--grad); color: var(--on-accent); box-shadow: var(--glow); animation: pop .5s var(--spring); }
.badge.locked .badge-icon .i { width: 20px; height: 20px; opacity: .7; }
.badge .bar { width: 80%; height: 6px; margin-top: 6px; }
.badge-prog { font-size: .7rem; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.badge-done { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: .72rem; font-weight: 700; color: var(--accent-ink); }
.badge-done .i { width: 14px; height: 14px; }

.month + .month { margin-top: 18px; }
.month-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 2px 8px; border-bottom: 1px solid var(--border); }
.month-head h3 { font-size: .95rem; }
.month-head span { font-size: .85rem; color: var(--muted); }
.month-head strong { color: var(--ok); }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid color-mix(in oklch, var(--border) 60%, transparent); }
.ledger li:last-child { border-bottom: 0; }
.ledger-main { display: grid; gap: 2px; min-width: 0; justify-items: start; }
.ledger-main strong { font-weight: 620; font-size: .92rem; }
.ledger-main small { color: var(--muted); font-size: .78rem; }
.ledger-amt { font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums; }
.ledger-amt.capped { color: var(--warn); }

/* ==========================================================================
   Admin
   ========================================================================== */

.admin-body { display: grid; gap: 16px; }
.admin-body > .card + .card, .admin-body > .kpis, .admin-body > .grid-2 { margin: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.confirm-item { display: grid; gap: 0; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 14px 14px 0 0; font-size: .86rem; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner + .task { border-top-left-radius: 0; border-top-right-radius: 0; }

details.completed { margin-top: 8px; }
details.completed summary {
  display: flex; align-items: center; gap: 8px; padding: 12px 4px; cursor: pointer; list-style: none;
  font-weight: 650; color: var(--muted);
}
details.completed summary::-webkit-details-marker { display: none; }
details.completed summary .i { transition: transform .2s var(--ease); }
details.completed[open] summary .i { transform: rotate(90deg); }

.invites { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.invites li { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--surface-2); }
.invite-code { font-family: var(--mono); font-size: 1.1rem; font-weight: 700; letter-spacing: .08em; }
.invites small { margin-left: auto; font-size: .75rem; }

.members { list-style: none; margin: 0; padding: 0; display: grid; }
.members li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.members li:last-child { border-bottom: 0; }
.member-main { flex: 1; display: grid; min-width: 140px; }
.member-main small { color: var(--muted); font-size: .8rem; }
.member-actions { display: flex; align-items: center; gap: 4px; }

/* ==========================================================================
   Sheets (dialog), toasts, misc
   ========================================================================== */

dialog.sheet {
  width: 100%; max-width: 560px; max-height: min(92dvh, 860px); margin: auto auto 0;
  padding: 0; border: 0; border-radius: 26px 26px 0 0;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  animation: sheet-up .32s var(--ease);
}
dialog.sheet.wide { max-width: 720px; }
dialog.sheet.small { max-width: 420px; }
dialog.sheet::backdrop { background: oklch(.15 .02 var(--h1) / .45); backdrop-filter: blur(4px); animation: fade .25s var(--ease); }
dialog.sheet.closing { animation: sheet-down .18s var(--ease) forwards; }
dialog.sheet.closing::backdrop { animation: fade .18s var(--ease) reverse forwards; }
@media (min-width: 640px) {
  dialog.sheet { margin: auto; border-radius: 26px; animation: pop-in .28s var(--spring); }
  dialog.sheet.closing { animation: fade .16s var(--ease) reverse forwards; }
}
.sheet-inner { display: flex; flex-direction: column; max-height: inherit; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 14px 10px 22px; position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.sheet-head h2 { font-size: 1.2rem; }
.sheet-body { padding: 4px 22px calc(22px + env(safe-area-inset-bottom)); overflow-y: auto; display: grid; gap: 18px; }
.confirm-text { color: var(--muted); }

.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h3 { font-size: 1.3rem; }
.pin-details summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 650; padding: 8px 0; list-style: none; }
.pin-details summary::-webkit-details-marker { display: none; }
.pin-details .form { margin-top: 10px; }

.toasts {
  position: fixed; z-index: 1000; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%);
  display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 18px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-weight: 600; font-size: .92rem;
  animation: toast-in .35s var(--spring); pointer-events: auto;
}
.toast.leaving { animation: toast-out .25s var(--ease) forwards; }
.toast-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; flex: none; background: color-mix(in oklch, var(--bg) 18%, transparent); }
.toast-icon .i { width: 18px; height: 18px; }
.toast-success .toast-icon { background: var(--grad); color: var(--on-accent); }
.toast-error .toast-icon { background: var(--bad); color: #fff; }
.toast-warn .toast-icon { background: var(--warn); color: #fff; }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 999; }
.fatal { min-height: 80dvh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 24px; }
.fatal > .i { width: 48px; height: 48px; color: var(--bad); }

.shake { animation: shake .45s var(--ease); }

/* ==========================================================================
   Motion
   ========================================================================== */

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.96); } }
@keyframes shimmer { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes wiggle { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.88); opacity: .7; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--ok) 60%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
