/* ==========================================================================
   deacald.css — a soft-light UI style
   Blue and green on cool paper: crisp 1px edges, small even radii, small
   shadows, one large gentle glow inside surfaces. Light and dark follow the
   system. Behaviour lives in deacald.js.

   Fonts: <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geologica:wght@100..900&family=JetBrains+Mono:wght@400..700&display=swap">

   Conventions
   - Blocks, __elements, --modifiers; states are .is-* (is-on, is-error…).
   - --tone colours a component and everything inside it. It is blue unless a
     --blue, --green, --red, --gold or tier modifier sets it (.badge--green,
     .widget--green, .tier--gold…), or you set it inline: style="--tone: var(--green)".
   - Edges: neutral surfaces have a 1px --line border; filled ones --edge-fill.
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Paper and ink */
  --paper:     light-dark(#f4f6fa, #0b0f17);
  --paper-2:   light-dark(#f2f5f9, #111722); /* grouped backgrounds */
  --card:      light-dark(#ffffff, #151b27);
  --card-2:    light-dark(#f3f6fa, #1b2230); /* wells */
  --track:     light-dark(#e3e8ef, #283141); /* empty tracks */
  --line:      light-dark(#e3e8ef, #263042); /* edges */
  --line-soft: light-dark(#eef2f6, #1e2635); /* separators */
  --ink:       light-dark(#0f172a, #e8edf5);
  --ink-soft:  light-dark(#475569, #a3adbf);
  --ink-mute:  light-dark(#64748b, #8591a6);
  --ink-faint: light-dark(#94a3b8, #5b6577);

  /* Blue and green: the only colours that appear without asking */
  --blue:       light-dark(#2f6fed, #5b93ff);
  --blue-2:     light-dark(#9dc0ff, #2f5ea8);
  --blue-tint:  light-dark(#eef4ff, #16233d);
  --blue-ink:   light-dark(#1d4ed8, #9cc0ff);
  --green:      light-dark(#1fa971, #34c78a);
  --green-2:    light-dark(#a7ebcb, #1f6b4c);
  --green-tint: light-dark(#e8f7f0, #12291f);
  --green-ink:  light-dark(#0b7a4f, #7fe0b4);
  --on-green:   light-dark(#ffffff, #06231a);

  /* Other colours: only through modifiers */
  --red:       light-dark(#d4351c, #ff6b6f);
  --red-tint:  light-dark(#fdeced, #3a1d20);
  --gold:      light-dark(#f2b100, #ffc83a);
  --gold-tint: light-dark(#fff6d9, #3a3016);
  --bronze:    #c26b3c;
  --silver:    #b8c2cf;
  --platinum:  #8fc8ff;
  --night:     #0b1730;
  --night-2:   #1b2a44;

  --hover: color-mix(in srgb, var(--blue) 7%, transparent);            /* row and item hover */
  --ring:  0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); /* field focus */

  /* Type */
  --font:       "Geologica", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, monospace;
  --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --fs-xs: .78rem;
  --fs-sm: .875rem;

  /* Shape */
  --r-sm:     8px;
  --r-md:     10px;  /* controls */
  --r-pop:    12px;  /* menus, tooltips, toasts */
  --r-card:   14px;  /* cards, lists */
  --r-widget: 20px;  /* tiles, modals */
  --r-pill:   999px;
  --control:  40px;  /* control height */

  /* Edges and shadows: small outside; only a lifted element casts a large one */
  --edge-fill:  inset 0 0 0 1px rgb(255 255 255 / .14);
  --shadow-sm:  0 1px 2px light-dark(rgb(15 23 42 / .06), rgb(0 0 0 / .4));
  --shadow:     0 1px 2px light-dark(rgb(15 23 42 / .05), rgb(0 0 0 / .4)), 0 3px 8px -4px light-dark(rgb(15 23 42 / .1), rgb(0 0 0 / .5));
  --shadow-pop: 0 1px 2px light-dark(rgb(15 23 42 / .06), rgb(0 0 0 / .4)), 0 8px 20px -10px light-dark(rgb(15 23 42 / .22), rgb(0 0 0 / .7));
  --shadow-lg:  0 2px 4px light-dark(rgb(15 23 42 / .06), rgb(0 0 0 / .4)), 0 18px 36px -10px light-dark(rgb(30 58 138 / .28), rgb(0 0 0 / .7));

  /* Motion */
  --lift:  translateY(-2px);
  --press: translateY(0) scale(.98);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out:    cubic-bezier(.2, .7, .2, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-in:     cubic-bezier(.5, 0, .75, 0);
}

/* The pointer glow fades in and out */
@property --glow-on { syntax: "<percentage>"; inherits: false; initial-value: 0%; }

/* ---------- 2. Base ------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; background-origin: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); font-variant-numeric: tabular-nums; color: var(--ink); background: var(--paper); }

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .4em; }
h1 { font-weight: 800; letter-spacing: -.035em; }
h2 { font-weight: 700; letter-spacing: -.02em; }
h3, h4 { font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
b, strong { font-weight: 650; }
a { color: var(--blue-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--ink); text-decoration-thickness: 2.5px; }
code { font-family: var(--font-mono); font-size: .82em; background: var(--card-2); border: 1px solid var(--line-soft); padding: .05em .35em; border-radius: 6px; }
::selection { background: var(--blue-2); color: var(--ink); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 70%, transparent); outline-offset: 2px; }

.muted  { color: var(--ink-soft); }
.mono   { font-family: var(--font-mono); }
.lede   { font-size: 1.12rem; font-weight: 300; line-height: 1.6; color: var(--ink-soft); }
.row    { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }
/* Read by screen readers, invisible on screen (e.g. an "Error:" prefix) */
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* One style for every small label: kickers, list headers, stat, menu and table heads */
.kicker, .list-header, .menu__title, .stat__label, .ach__kicker, .table__head {
  font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute);
}
.kicker { display: block; }

.page { max-width: var(--page-width, 820px); margin: 0 auto; padding: 18px 24px 80px; }
@media (max-width: 480px) { .page { padding: 14px 16px 64px; } }

.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* Emoji: a 1em box. deacald.js draws each one centred on its ink, since emoji
   fonts sit glyphs off-centre differently on every platform. */
.emoji { display: inline-block; width: 1em; height: 1em; overflow: hidden; vertical-align: -.15em; font-family: var(--font-emoji); font-style: normal; line-height: 1; text-align: center; background: center / 100% 100% no-repeat; }
.emoji__glyph { opacity: 0; }

/* ---------- 3. Surfaces -------------------------------------------------- */
/* Light surfaces: the card colour, a --line border, a small shadow. Dark
   surfaces: night blue with light inks and the light rim. Every surface has
   one large, gentle glow inside, tinted by --tone (strength: --tone-mix). */

.card, .widget, .list, .menu, .toast, .modal, .art-card, .error-summary, .tooltip, .ach {
  --surface-glow: radial-gradient(160% 140% at 0% 0%, color-mix(in srgb, var(--tone) var(--tone-mix, 7%), transparent), transparent 72%);
  background-image: var(--surface-glow);
}
.card, .widget, .list, .menu, .toast, .modal, .art-card, .error-summary {
  color: var(--ink);
  background-color: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.menu, .toast, .modal { box-shadow: var(--shadow-pop); }

.widget--night, .tooltip, .ach {
  --ink: #f1f5fb;
  --ink-soft: #a3b3cc;
  --ink-mute: #8494b0;
  --track: rgb(255 255 255 / .12);
  --tone: #6ea2ff;
  --tone-ink: #a9cbff;
  --tone-mix: 30%;
  color: var(--ink);
  background-color: var(--night);
  border: 0;
  box-shadow: var(--edge-fill), 0 6px 16px -8px rgb(11 23 48 / .6);
}
.tooltip, .ach { background-color: rgb(11 23 48 / .92); backdrop-filter: blur(20px) saturate(1.4); }

/* .glow adds a pointer light in the surface's tone */
.glow {
  background-image: radial-gradient(560px circle at var(--gx, 50%) var(--gy, 50%), color-mix(in srgb, var(--tone) var(--glow-on), transparent), transparent 70%), var(--surface-glow, none);
  transition: --glow-on .5s ease, transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.glow:hover { --glow-on: 9%; }

.card { padding: 20px; border-radius: var(--r-card); }

/* ---------- 4. Hover ----------------------------------------------------- */
/* Standalone pressables rise and their shadow grows (--lift-shadow for a
   coloured one). Things in a tight container only tint. */

.btn, a.widget, button.widget, a.art-card, a.chip, .app__icon {
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), background-color .15s, color .15s;
}
:is(.btn, a.widget, button.widget, a.art-card, a.chip):hover, .app:hover .app__icon {
  position: relative; z-index: 2; transform: var(--lift); box-shadow: var(--lift-shadow, var(--shadow-lg));
}
:is(.btn, a.widget, button.widget, a.art-card, a.chip):active, .app:active .app__icon { transform: var(--press); }

/* ---------- 5. Buttons --------------------------------------------------- */

.btn {
  --btn-bg: var(--card);
  --btn-ink: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  min-height: var(--control);
  padding: 0 16px;
  font: inherit;
  font-size: .94rem;
  font-weight: 600;
  line-height: 1;
  color: var(--btn-ink);
  background: var(--btn-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-decoration: none;
}
/* Filled with the tone: primary (blue), green, danger (red), start (green) */
.btn--primary, .btn--green, .btn--danger, .btn--start {
  --btn-bg: var(--tone);
  --btn-ink: var(--on-tone);
  --lift-shadow: var(--edge-fill), 0 16px 30px -10px color-mix(in srgb, var(--tone) 85%, transparent);
  border-color: transparent;
  box-shadow: var(--edge-fill), 0 2px 5px -2px color-mix(in srgb, var(--tone) 70%, transparent);
}
/* The one way in: large, green, with an arrow */
.btn--start { min-height: 52px; padding: 0 22px; font-size: 1.1rem; font-weight: 700; border-radius: 12px; }
.btn--start .icon { transition: transform .2s var(--ease-out); }
.btn--start:hover .icon { transform: translateX(3px); }
.btn--tinted { --btn-bg: var(--tone-tint); --btn-ink: var(--tone-ink); border-color: transparent; box-shadow: none; }
.btn--ghost  { --btn-bg: transparent; --lift-shadow: none; box-shadow: none; }
.btn--ghost:hover { background: var(--hover); }
.btn--plain  { --btn-bg: transparent; --btn-ink: var(--blue-ink); --lift-shadow: none; padding-inline: 6px; border-color: transparent; box-shadow: none; text-decoration: underline 1.5px; text-underline-offset: 3px; }
.btn--plain:hover { text-decoration-thickness: 2.5px; }

.btn--sm   { min-height: 32px; padding: 0 12px; font-size: .84rem; border-radius: var(--r-sm); }
.btn--lg   { min-height: 50px; padding: 0 24px; font-size: 1.06rem; border-radius: 12px; }
.btn--icon { width: var(--control); padding: 0; border-radius: 50%; }
.btn--icon.btn--sm { width: 32px; }
/* Prefer a clear message over a disabled button; when one is needed, it stays still */
.btn:disabled, .btn:disabled:hover { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Buttons and a text link on one line, aligned */
.btn-group { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }

/* ---------- 6. Segmented control, switch, stepper, slider ---------------- */

/* Fires deacald:change */
.segmented { display: inline-flex; gap: 4px; padding: 4px; background: color-mix(in srgb, var(--track) 80%, transparent); border-radius: var(--r-md); }
.segmented button { min-height: calc(var(--control) - 8px); padding: 0 14px; font: inherit; font-size: .9rem; font-weight: 600; line-height: 1; color: var(--ink-mute); background: transparent; border: 0; border-radius: 7px; cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { color: var(--tone-ink); background: var(--card); box-shadow: var(--shadow-sm); }
.segmented--sm { padding: 3px; gap: 3px; }
.segmented--sm button { min-height: 26px; padding: 0 10px; font-size: .8rem; border-radius: 6px; }
.segmented--block { display: flex; }
.segmented--block button { flex: 1; }

.switch { display: inline-flex; align-items: center; gap: .6em; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; flex: none; width: 46px; height: 28px; background: var(--track); border-radius: var(--r-pill); transition: background-color .2s, box-shadow .2s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgb(15 23 42 / .25); transition: transform .3s var(--ease-bounce); }
.switch input:checked + .switch__track { background: var(--green); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--ring); }

/* Fires deacald:change */
.stepper { display: inline-flex; height: var(--control); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.stepper button { display: grid; place-items: center; width: var(--control); font: inherit; color: var(--ink); background: transparent; border: 0; cursor: pointer; transition: background-color .15s; }
.stepper button:hover  { background: var(--hover); }
.stepper button:active { background: var(--tone-tint); }
.stepper output { display: grid; place-items: center; min-width: 44px; padding: 0 6px; font-weight: 600; border-inline: 1px solid var(--line-soft); }

.range { --p: 50; -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
.range:focus-visible { outline: none; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--tone) calc(var(--p) * 1%), var(--track) 0); }
.range::-moz-range-track    { height: 6px; background: var(--track); border-radius: var(--r-pill); }
.range::-moz-range-progress { height: 6px; background: var(--tone); border-radius: var(--r-pill); }
.range { --thumb-shadow: 0 0 0 1px var(--line), 0 2px 6px rgb(15 23 42 / .2); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; background: #fff; border: 0; border-radius: 50%; box-shadow: var(--thumb-shadow); }
.range::-moz-range-thumb     { width: 22px; height: 22px; background: #fff; border: 0; border-radius: 50%; box-shadow: var(--thumb-shadow); }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--line), var(--ring); }

/* ---------- 7. Fields, errors, inset and warning text -------------------- */
/* Order: label, hint, error message, input. An error marks the message with
   a "!" and rings the input red, like focus; the message says what to do. */

.field { display: grid; gap: 6px; }
.field__label { font-size: .9rem; font-weight: 600; }
.field__hint  { margin-top: -3px; font-size: .86rem; color: var(--ink-mute); }
.field__error { display: flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 600; color: var(--red); }
.field.is-error .input { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 16%, transparent); }

.input, .search { width: 100%; min-height: var(--control); padding: 0 12px; font: inherit; font-size: .95rem; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); transition: border-color .15s, box-shadow .15s; }
.input:focus, .search:focus-within { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.input::placeholder, .search input::placeholder { color: var(--ink-faint); }
select.input { padding-right: 8px; }
.search { display: flex; align-items: center; gap: 8px; color: var(--ink-mute); }
.search input { flex: 1; min-width: 0; font: inherit; color: var(--ink); background: transparent; border: 0; outline: none; }

/* The "!" mark: errors in red, warnings in ink */
.field__error::before, .error-summary__title::before, .warning::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: var(--mark, 18px);
  height: var(--mark, 18px);
  font-size: calc(var(--mark, 18px) * .62);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--red);
  border-radius: 50%;
  box-shadow: var(--edge-fill);
}

/* All of a form's errors at the top, each linking to its field */
.error-summary { --tone-mix: 9%; display: grid; gap: 8px; padding: 16px 18px; border-color: color-mix(in srgb, var(--red) 35%, var(--line)); border-radius: var(--r-card); }
.error-summary__title { --mark: 22px; display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.05rem; font-weight: 700; }
.error-summary ul { display: grid; gap: 4px; margin: 0; padding: 0 0 0 32px; list-style: none; }
.error-summary a { color: var(--red); font-weight: 600; }

/* Inset text: an aside or example, never the only place for key information */
.inset { margin: 0; padding: 12px 16px; color: var(--ink-soft); background: var(--blue-tint); border-radius: var(--r-md); }

/* Warning text: a consequence the reader must not miss */
.warning { --mark: 26px; display: flex; align-items: center; gap: 12px; margin: 0; font-weight: 600; }
.warning::before { color: var(--card); background: var(--ink); box-shadow: none; }

/* ---------- 8. Chips ----------------------------------------------------- */
/* Neutral by default; a tone modifier tints one (.chip--green, .chip--gold…) */

.chip { display: inline-flex; align-items: center; gap: .35em; height: 26px; padding: 0 10px; font-size: .8rem; font-weight: 600; line-height: 1; color: var(--ink-soft); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-pill); white-space: nowrap; text-decoration: none; }
.chip .icon { width: 1.1em; height: 1.1em; vertical-align: 0; }
.chip[class*="chip--"] { color: var(--tone-ink); background: var(--tone-tint); border-color: transparent; }
.chip[class*="chip--"] .icon { color: var(--tone); }

/* ---------- 9. Tiles: badges, list, launcher and popup icons ------------- */
/* One flat tile: the tone with the light rim. --plain is the neutral card. */

.badge, .list__icon, .app__icon, .ach__icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  line-height: 1;
  color: var(--on-tone);
  background: var(--tone);
  border-radius: 50%;
  box-shadow: var(--edge-fill);
}
.badge--plain, .app--plain .app__icon { color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); --lift-shadow: inset 0 0 0 1px var(--line), var(--shadow-lg); }
.badge.is-locked { color: var(--ink-faint); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); }

.badge { width: 56px; height: 56px; }
.badge .icon { width: 26px; height: 26px; vertical-align: 0; }
.badge .emoji { font-size: 28px; }
.badge--sm { width: 42px; height: 42px; }
.badge--sm .icon { width: 20px; height: 20px; }
.badge--sm .emoji { font-size: 22px; }
.badge--lg { width: 84px; height: 84px; }
.badge--lg .icon { width: 40px; height: 40px; }
.badge--lg .emoji { font-size: 42px; }

/* Count: a small number, always blue unless told otherwise */
.count { --tone: var(--blue); --on-tone: #fff; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; font-size: .74rem; font-weight: 700; line-height: 1; color: var(--on-tone); background: var(--tone); border-radius: var(--r-pill); box-shadow: var(--edge-fill); }

/* ---------- 10. Lists, navigation, menu, launcher ------------------------ */

.list-header { margin: 20px 14px 6px; }
.list-footer { margin: 6px 14px 0; font-size: var(--fs-xs); line-height: 1.35; color: var(--ink-mute); }

/* Rows highlight as a rounded tile inset from the list's edge */
.list { margin: 0; padding: 4px; list-style: none; border-radius: var(--r-card); }
.list__row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 6px 10px; font: inherit; text-align: left; color: inherit; text-decoration: none; background: transparent; border: 0; border-radius: calc(var(--r-card) - 4px); transition: background-color .15s; }
.list__row:hover { background: var(--hover); }
:is(a, button, label).list__row { cursor: pointer; }
.list > li + li > .list__row::before { content: ""; position: absolute; top: 0; right: 10px; left: 52px; border-top: 1px solid var(--line-soft); transition: opacity .15s; }
.list > li:hover > .list__row::before, .list > li:hover + li > .list__row::before { opacity: 0; }
.list__icon { width: 30px; height: 30px; border-radius: 8px; }
.list__icon .icon { width: 17px; height: 17px; }
.list__label { flex: 1; min-width: 0; line-height: 1.25; }
.list__label small { display: block; font-size: var(--fs-xs); color: var(--ink-mute); }
.list__value { color: var(--ink-mute); white-space: nowrap; }
.list__chev  { width: 18px; height: 18px; color: var(--ink-faint); }
.list__row.is-danger { justify-content: center; font-weight: 500; color: var(--red); }

.navbar { display: flex; align-items: center; justify-content: space-between; height: var(--control); }
.navbar a, .navbar button { display: inline-flex; align-items: center; gap: 2px; height: 100%; padding: 0; font: inherit; line-height: 1; color: var(--blue-ink); text-decoration: none; background: none; border: 0; cursor: pointer; }
.navbar .icon { width: 1.25em; height: 1.25em; margin-left: -.3em; }
.large-title { margin: 2px 2px 12px; font-size: 1.9rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }

.tabbar { display: grid; grid-template-columns: repeat(var(--tabs, 4), 1fr); padding: 8px 6px 12px; background: var(--card); border-top: 1px solid var(--line); }
.tabbar__tab { position: relative; display: grid; justify-items: center; gap: 2px; font-size: .72rem; font-weight: 500; color: var(--ink-mute); text-decoration: none; transition: color .15s; }
.tabbar__tab:hover { color: var(--ink); }
.tabbar__tab.is-active { color: var(--tone); }
.tabbar__tab .icon { width: 24px; height: 24px; }

.menu { min-width: 230px; padding: 5px; border-radius: var(--r-pop); }
.menu button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 36px; padding: 0 11px; font: inherit; font-size: .92rem; text-align: left; color: var(--ink); background: none; border: 0; border-radius: 7px; cursor: pointer; transition: background-color .15s; }
.menu button .icon { color: var(--ink-mute); }
.menu button.is-danger, .menu button.is-danger .icon { color: var(--red); }
.menu hr { margin: 5px -5px; border: 0; border-top: 1px solid var(--line-soft); }
.menu__title { padding: 6px 11px 4px; }

/* Danger rows tint red, other rows and items blue */
.menu button:hover { background: var(--hover); }
:is(.list__row, .menu button).is-danger:hover { background: var(--red-tint); }

/* Launcher: squircle tiles with a soft same-hue gradient and a bold glyph */
.launcher { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 20px 10px; }
.app { position: relative; display: grid; justify-items: center; gap: 8px; font-size: .8rem; font-weight: 500; line-height: 1.15; text-align: center; color: inherit; text-decoration: none; }
.app__icon { --lift-shadow: var(--edge-fill), 0 16px 28px -10px color-mix(in srgb, var(--tone) 85%, transparent); width: 62px; height: 62px; background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 78%, #fff), var(--tone)); border-radius: 22.5%; }
.app__icon .icon { width: 30px; height: 30px; stroke-width: 2.2; }
.app--plain .app__icon { color: var(--tone); }
.app .count { position: absolute; z-index: 3; top: -8px; left: calc(50% + 19px); min-width: 24px; height: 24px; font-size: .8rem; transition: transform .2s var(--ease-out); }
.app:hover .count { transform: var(--lift); }
/* A count over an icon gets a cut-out ring in the surface colour */
:is(.app, .tabbar__tab) .count { box-shadow: 0 0 0 2px var(--card); }
.tabbar__tab .count { position: absolute; top: -6px; left: calc(50% + 4px); }
@supports (corner-shape: squircle) {
  .app__icon  { border-radius: 34%; corner-shape: squircle; }
  .list__icon { border-radius: 36%; corner-shape: squircle; }
}

/* ---------- 11. Progress -------------------------------------------------- */
/* Filled parts take the tone and glow a little. */

.segbar { display: flex; gap: 3px; width: 100%; height: 12px; }
.segbar > i { flex: 1; min-width: 0; background: var(--track); border-radius: 3px; transition: background-color .3s; }
.segbar > i.is-on   { background: var(--tone); box-shadow: 0 0 4px -1px color-mix(in srgb, var(--tone) 80%, transparent); }
.segbar > i.is-half { background: linear-gradient(90deg, var(--tone) 50%, var(--track) 50%); }
.segbar > i.is-pop  { animation: seg-pop .35s var(--ease-bounce); }
.segbar--thin   { height: 8px; gap: 2px; }
.segbar--thin > i { border-radius: 2px; }
.segbar--chunky { height: 22px; gap: 5px; }
.segbar--chunky > i { border-radius: 5px; }
@keyframes seg-pop { 50% { transform: scaleY(1.45); } }

/* Parts: <span style="--w: 45; --tone: var(--green)"> */
.stackbar { display: flex; gap: 2px; height: 14px; background: var(--track); border-radius: var(--r-pill); overflow: hidden; }
.stackbar > span { flex: none; width: calc(var(--w) * 1%); background: var(--tone); animation: dc-wipe .9s var(--ease-in-out) both; }
.stackbar--lg { height: 22px; }

.bar { height: 10px; background: var(--track); border-radius: var(--r-pill); }
.bar > span { display: block; width: calc(var(--p, 0) * 1%); height: 100%; background: var(--tone); border-radius: inherit; box-shadow: 0 0 4px -1px color-mix(in srgb, var(--tone) 80%, transparent); transition: width .6s var(--ease-out); }

.rings { display: block; width: 100%; height: auto; overflow: visible; }
.ring-track { fill: none; stroke: var(--track); stroke-width: 9; }
.ring { fill: none; stroke: var(--tone); stroke-width: 9; stroke-linecap: round; stroke-dasharray: var(--p) 100; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dasharray .8s var(--ease-out); }

.legend { display: inline-flex; align-items: center; gap: .4em; font-size: .84rem; color: var(--ink-mute); white-space: nowrap; }
.legend i { width: 10px; height: 10px; background: var(--tone); border-radius: 3px; }
.legend b { font-weight: 650; color: var(--ink); }
.legend-row { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; }

/* ---------- 12. Widgets -------------------------------------------------- */

.widget-grid { --cell: 160px; --gap: 20px; display: grid; grid-template-columns: repeat(auto-fill, var(--cell)); grid-auto-rows: var(--cell); grid-auto-flow: dense; gap: var(--gap); }
@media (max-width: 480px) { .widget-grid { --gap: 14px; --cell: calc((100vw - 32px - var(--gap)) / 2); } }

.widget { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 14px 16px; text-decoration: none; border-radius: var(--r-widget); }
button.widget { font: inherit; text-align: left; cursor: pointer; }
.widget--md   { grid-column: span 2; }
.widget--lg   { grid-column: span 2; grid-row: span 2; }
.widget--tall { grid-row: span 2; }
.widget--blue, .widget--green { --tone-mix: 16%; }
/* Filled with the tone; the light rim instead of a border */
.widget--fill {
  --ink: #fff;
  --ink-soft: rgb(255 255 255 / .8);
  --ink-mute: rgb(255 255 255 / .7);
  --track: rgb(255 255 255 / .25);
  --surface-glow: radial-gradient(160% 140% at 0% 0%, rgb(255 255 255 / .26), transparent 72%);
  --lift-shadow: var(--edge-fill), 0 22px 36px -12px color-mix(in srgb, var(--tone) 85%, #000);
  background-color: var(--tone);
  border: 0;
  box-shadow: var(--edge-fill), 0 3px 8px -4px color-mix(in srgb, var(--tone) 80%, #000);
}
.widget--night, .widget--fill { padding: 15px 17px; }

.widget__label { display: flex; align-items: center; gap: .4em; min-width: 0; font-size: .82rem; font-weight: 500; line-height: 1.15; color: var(--ink-soft); }
.widget__label .icon { width: 1.2em; height: 1.2em; vertical-align: 0; color: var(--tone-ink); }
.widget--fill .widget__label .icon { color: inherit; }
.widget__title  { font-size: 1.05rem; font-weight: 650; letter-spacing: -.01em; line-height: 1.15; }
.widget__value  { font-size: 2.9rem; font-weight: 300; line-height: .95; letter-spacing: -.04em; }
.widget__figure { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.widget__unit   { font-size: .95rem; color: var(--ink-soft); }
.widget__note   { font-size: .82rem; line-height: 1.25; color: var(--ink-soft); }

.seglist { display: grid; gap: 10px; }
.seglist__row { display: grid; grid-template-columns: 64px 1fr 34px; align-items: center; gap: 10px; font-size: .86rem; line-height: 1; }
.seglist__row b { font-family: var(--font-mono); font-size: .8rem; font-weight: 600; text-align: right; color: var(--ink-mute); }

.dots { display: flex; justify-content: space-between; }
.dots > span { display: grid; justify-items: center; gap: 3px; font-size: .68rem; font-weight: 500; color: var(--ink-mute); }
.dots i { width: 14px; height: 14px; border: 1.5px solid var(--ink-faint); border-radius: 50%; }
.dots i.is-on { background: var(--tone); border-color: transparent; box-shadow: 0 0 4px -1px color-mix(in srgb, var(--tone) 80%, transparent); }

/* Heatmap: <div class="heat"><i style="--v: .6"></i>…</div>, filled down 7-day columns */
.heat { flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.heat > i { min-height: 0; background: color-mix(in srgb, var(--tone) calc(var(--v, 0) * 100%), var(--track)); border-radius: 3px; }

/* Split-flap digits, filled by deacald.digits(el, "0:15"). Size: --d. */
.digits { --d: 2.6rem; display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: var(--d); font-weight: 700; line-height: 1; color: #fff; }
.digit { position: relative; width: .78em; height: 1.16em; perspective: 4em; border-radius: 6px; box-shadow: 0 0 0 1px rgb(255 255 255 / .08), 0 2px 5px -2px rgb(0 0 0 / .45); }
.digit::after { content: ""; position: absolute; z-index: 3; left: 0; right: 0; top: calc(50% - .5px); height: 1px; background: rgb(0 0 0 / .55); }
.digit__half, .digit__flap { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; backface-visibility: hidden; }
.digit__half > span, .digit__flap > span { display: block; height: 1.16em; line-height: 1.16em; text-align: center; }
.digit__half--top, .digit__flap--top { top: 0; background: var(--night-2); border-radius: 6px 6px 0 0; }
.digit__half--bottom, .digit__flap--bottom { bottom: 0; background: #0f1b30; border-radius: 0 0 6px 6px; }
.digit__half--bottom > span, .digit__flap--bottom > span { margin-top: -.58em; }
.digit__flap--top { z-index: 2; transform-origin: bottom; animation: flap-top .28s var(--ease-in) forwards; }
.digit__flap--bottom { z-index: 2; transform-origin: top; transform: rotateX(90deg); animation: flap-bottom .3s var(--ease-out) .26s forwards; }
@keyframes flap-top    { to { transform: rotateX(-90deg); filter: brightness(.6); } }
@keyframes flap-bottom { from { filter: brightness(1.5); } to { transform: rotateX(0); filter: none; } }
/* The colon: two dots on the tiles' middle, the tiles' colour on the page and light on a dark surface */
.digits__sep { position: relative; width: .3em; height: 1.16em; color: transparent; animation: blink 2s steps(1) infinite; }
.digits__sep::before, .digits__sep::after { content: ""; position: absolute; left: 50%; top: 36%; width: .12em; height: .12em; background: var(--digits-sep, light-dark(var(--night-2), #c9d4e6)); border-radius: 50%; transform: translate(-50%, -50%); }
.digits__sep::after { top: 64%; }
:is(.widget--night, .widget--fill, .hero) .digits { --digits-sep: rgb(255 255 255 / .8); }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- 13. Achievement popups --------------------------------------- */
/* .ach.ach--pill | --corner | --banner, coloured by its tier. CSS plays the
   whole visit: in, the name flashes, the explanation rises, out after
   --ach-stay. .is-static shows one inline; --popup-lift keeps bottom popups
   clear of a page's bottom bar. */

.ach { position: fixed; z-index: 1100; display: flex; align-items: center; line-height: 1.2; pointer-events: none; animation: var(--ach-in), ach-out .3s var(--ease-in) var(--ach-stay, 6s) forwards; }
.ach .icon   { stroke-width: 2.2; vertical-align: 0; }
.ach__icon   { width: 46px; height: 46px; }
.ach__icon .icon  { width: 24px; height: 24px; }
.ach__icon .emoji { font-size: 25px; }
.ach__text   { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ach__kicker { color: var(--ink-soft); }
.ach__title  { font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; transform-origin: left center; animation: ach-flash 1.2s var(--ease-out) var(--flash, .35s) both; }
.ach__body   { font-size: .84rem; color: var(--ink-soft); animation: dc-rise .5s var(--ease-out) var(--reveal, 1.35s) both; }

/* Pill: pops up bottom centre, then widens to show the name */
.ach--pill { --ach-in: ach-pill-in 1.2s var(--ease-out) both; --flash: 1s; --reveal: 2s; left: 0; right: 0; bottom: calc(28px + var(--popup-lift, 0px)); width: max-content; max-width: min(560px, 100vw - 32px); height: 68px; margin-inline: auto; padding: 8px 28px 8px 8px; gap: 12px; overflow: hidden; border-radius: var(--r-pill); }
.ach--pill .ach__icon { width: 52px; height: 52px; }
.ach--pill .ach__icon .icon { width: 26px; height: 26px; }
.ach--pill .ach__kicker { display: none; }
.ach--pill .ach__text { white-space: nowrap; animation: dc-fade-in .3s ease-out .85s both; }
/* Corner: rises in at the bottom right */
.ach--corner { --ach-in: ach-rise .5s var(--ease-out) both; right: 24px; bottom: calc(24px + var(--popup-lift, 0px)); width: min(340px, calc(100vw - 32px)); padding: 12px 14px; gap: 14px; border-radius: 16px; }
.ach--corner .ach__icon { width: 60px; height: 60px; border-radius: 13px; }
.ach--corner .ach__icon .icon { width: 30px; height: 30px; }
.ach--corner .ach__icon .emoji { font-size: 32px; }
/* Banner: drops in at the top left */
.ach--banner { --ach-in: ach-drop .4s var(--ease-out) both; left: 24px; top: 24px; max-width: calc(100vw - 48px); padding: 8px 20px 8px 8px; gap: 12px; border-radius: 16px; }
@media (max-width: 480px) {
  .ach--corner { right: 16px; bottom: calc(16px + var(--popup-lift, 0px)); }
  .ach--banner { left: 16px; top: 16px; max-width: calc(100vw - 32px); }
}
.ach.is-static { position: relative; inset: auto; z-index: auto; margin: 0; animation: none; }
.ach--pill.is-static { display: inline-flex; width: auto; max-width: none; }

@keyframes ach-pill-in { 0% { transform: scale(0); max-width: 68px; } 35% { transform: scale(1); max-width: 68px; } }
@keyframes ach-rise { from { transform: translateY(calc(100% + 40px)); } }
@keyframes ach-drop { from { transform: translateY(-150%); opacity: 0; } }
@keyframes ach-out  { to { transform: scale(.96); opacity: 0; } }
@keyframes ach-flash {
  0%   { opacity: 0; transform: scale(.9); }
  25%  { opacity: 1; transform: scale(1.08); text-shadow: 0 0 22px rgb(140 190 255 / .95), 0 0 6px #fff; }
  55%  { transform: scale(1); text-shadow: 0 0 14px rgb(140 190 255 / .6); }
}

/* ---------- 14. Toasts, tooltips, modal, confetti, fade ------------------ */

.toast-stack { position: fixed; left: 50%; top: 20px; z-index: 1000; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); transform: translateX(-50%); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: var(--r-pop); pointer-events: auto; cursor: pointer; animation: toast-in .45s var(--ease-bounce); }
.toast.is-leaving { animation: toast-out .3s ease-in forwards; }
.toast__title { font-weight: 650; line-height: 1.2; }
.toast__body  { font-size: .86rem; line-height: 1.3; color: var(--ink-soft); }
@keyframes toast-in  { from { transform: translateY(-130%); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-40%) scale(.95); opacity: 0; } }

.tooltip { display: inline-grid; gap: 6px; min-width: 180px; padding: 10px 12px; font-size: .82rem; border-radius: var(--r-pop); }
.tooltip__title { font-weight: 700; }
.tooltip__grid { display: grid; grid-template-columns: auto auto; gap: 3px 16px; font-family: var(--font-mono); font-size: .76rem; }
.tooltip__grid > :nth-child(odd)  { color: var(--ink-soft); }
.tooltip__grid > :nth-child(even) { font-weight: 700; text-align: right; }

.modal { width: min(420px, calc(100vw - 32px)); padding: 24px 24px 20px; border-radius: var(--r-widget); }
.modal[open] { animation: modal-in .22s var(--ease-out); }
.modal::backdrop { background: rgb(11 23 48 / .46); backdrop-filter: blur(6px); animation: dc-fade-in .25s var(--ease-out); }
.modal__icon  { margin-bottom: 12px; font-size: 2.4rem; }
.modal__icon .emoji { display: block; }
.modal__title { margin: 0 0 6px; font-size: 1.2rem; }
.modal__body  { margin: 0 0 18px; color: var(--ink-soft); }
.modal__list  { display: grid; gap: 8px; margin: -4px 0 20px; padding: 0; list-style: none; }
.modal__list li { position: relative; padding-left: 20px; line-height: 1.4; }
.modal__list li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 7px; height: 7px; background: var(--tone); border-radius: 50%; }
.modal__warning { margin: -6px 0 20px; }
.modal__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.confetti { position: fixed; z-index: 1001; width: 10px; height: 6px; background: var(--tone); border-radius: 2px; pointer-events: none; animation: confetti 1.1s var(--ease-out) forwards; }
@keyframes confetti { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }

.screen-fade { position: fixed; inset: 0; z-index: 1050; background: var(--paper); pointer-events: none; opacity: 0; }

/* ---------- 15. Art cards ------------------------------------------------ */

.art-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 24px; }
.art-card { position: relative; display: flex; flex-direction: column; color: inherit; text-decoration: none; border-radius: var(--r-widget); }
.art-card__art { display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--tone-tint); border-bottom: 1px solid var(--line); border-radius: var(--r-widget) var(--r-widget) 0 0; }
.art-card__art > svg { width: 82%; height: auto; overflow: visible; }
.art-card__body  { display: grid; gap: 4px; padding: 14px 18px 16px; }
.art-card__title { font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.art-card__note  { font-size: .92rem; line-height: 1.4; color: var(--ink-soft); }
.art-card__bob   { transform-box: fill-box; transform-origin: center; transition: transform .4s var(--ease-out); }
a.art-card:hover .art-card__bob { transform: translateY(-5px); }
/* A placeholder for something to come */
.art-card--soon { background: transparent; box-shadow: none; }
.art-card--soon .art-card__art { color: var(--ink-faint); background: var(--card-2); }
.art-card--soon .art-card__art .icon { width: 40px; height: 40px; }
.art-card--soon .art-card__title { color: var(--ink-soft); }

/* ---------- 16. Page chrome: glass bar, foil hero, stats, table ---------- */

.glass-bar { position: sticky; top: 0; z-index: 50; background: linear-gradient(90deg, color-mix(in srgb, var(--card) 86%, transparent), color-mix(in srgb, var(--blue-tint) 86%, transparent) 50%, color-mix(in srgb, var(--card) 86%, transparent)); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(1100px 420px at 88% -12%, rgb(255 255 255 / .38), transparent 60%),
    radial-gradient(900px 520px at 6% 118%, color-mix(in srgb, var(--green) 42%, transparent), transparent 62%),
    linear-gradient(118deg, #0f2e9e 0%, #1f55e0 38%, #3f84fa 66%, #7fb0ff 100%);
}
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(560px circle at var(--hx, 75%) var(--hy, 10%), rgb(255 255 255 / .16), transparent 60%); }
.hero::after { content: ""; position: absolute; inset: -40% -20%; pointer-events: none; background: linear-gradient(100deg, transparent 38%, rgb(255 255 255 / .1) 46%, rgb(186 230 253 / .14) 50%, rgb(255 255 255 / .08) 54%, transparent 62%); animation: hero-sheen 16s ease-in-out infinite alternate; }
.hero > * { position: relative; z-index: 1; }
.hero .kicker, .hero .stat__label { color: #d6e4ff; }
.hero h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 3.8rem); line-height: 1.02; letter-spacing: -.04em; }
.hero .lede { max-width: 46ch; margin: 0; color: #fff; }
@keyframes hero-sheen { from { transform: translateX(-35%) skewX(-12deg); } to { transform: translateX(35%) skewX(-12deg); } }

.stat { display: grid; gap: 2px; }
.stat__value { font-size: 2.5rem; font-weight: 300; line-height: 1.1; letter-spacing: -.03em; }
.stat__value--mono { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 700; letter-spacing: 0; }

/* Columns: --cols */
.table { --cols: minmax(0, 1fr) auto; display: grid; }
.table__head, .table__row { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 12px; padding: 0 8px; }
.table__head { padding-bottom: 6px; font-family: var(--font-mono); letter-spacing: .08em; border-bottom: 1px solid var(--line); }
.table__row { min-height: 40px; font-size: .9rem; border-bottom: 1px solid var(--line-soft); border-radius: 6px; transition: background-color .15s; }
.table__row:hover { background: var(--hover); }
.table__cell { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.table .num { font-family: var(--font-mono); font-size: .82rem; text-align: right; }

/* ---------- 17. Effects (deacald.js) ------------------------------------- */

/* A laminated card that tilts toward the pointer, with a gloss */
.tilt { --tilt: perspective(1200px) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg)); position: relative; transform: var(--tilt); transition: transform .35s var(--ease-out); }
.tilt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(420px circle at var(--lx, 30%) var(--ly, 0%), rgb(255 255 255 / .4), transparent 60%); mix-blend-mode: soft-light; }
.tilt:is(.btn, a.widget, button.widget, a.art-card):hover { transform: var(--tilt) var(--lift); }
/* Parallax: the contents drift toward the pointer as one layer floating above
   the card. Only direct children move, so everything inside moves the same. */
.tilt > * { translate: calc(var(--px, 0) * var(--depth, 8.4px)) calc(var(--py, 0) * var(--depth, 8.4px)); transition: translate .35s var(--ease-out); }

/* .reveal containers get .is-in once seen; their children play after --d */
.reveal:not(.is-in) :is(.reveal-up, .reveal-fade, .reveal-wipe, .reveal-pop) { opacity: 0; }
.reveal.is-in .reveal-up   { animation: dc-rise .6s var(--ease-out) var(--d, 0ms) backwards; }
.reveal.is-in .reveal-fade { animation: dc-fade-in .5s ease-out var(--d, 0ms) backwards; }
.reveal.is-in .reveal-wipe { animation: dc-wipe 1.1s var(--ease-in-out) var(--d, 0ms) backwards; }
.reveal.is-in .reveal-pop  { animation: dc-pop-in .45s var(--ease-bounce) var(--d, 0ms) backwards; }

/* ---------- 18. Charts (deacald.chart), drawn in the tone ---------------- */

.lc, .tc { --delay: 0s; display: block; height: auto; overflow: visible; }
.lc { width: 100%; }
.tc { width: min(100%, 380px); }
.lc text, .tc text { font-family: var(--font-mono); }

.lc-grid  { stroke: var(--line); stroke-width: .75; }
.lc-axis, .lc-x { font-size: 11px; fill: var(--ink-mute); }
.lc-area  { opacity: 0; animation: dc-fade-in .8s var(--ease-out) calc(var(--delay) + .6s) forwards; }
.lc-halo, .lc-line { fill: none; stroke: var(--tone); stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: dc-draw 1.1s var(--ease-in-out) var(--delay) forwards; }
.lc-halo  { stroke-opacity: .2; stroke-width: 8; }
.lc-line  { stroke-width: 2.5; }
.lc-marker { stroke: var(--ink-faint); stroke-width: .75; stroke-dasharray: 2 3; opacity: 0; animation: dc-fade-in .4s var(--ease-out) calc(var(--delay) + 1s) forwards; }
.lc-label { font-size: 12px; fill: var(--ink-mute); opacity: 0; transform-box: fill-box; animation: dc-rise .45s var(--ease-out) calc(var(--delay) + .25s + var(--i) * .14s) forwards; }
.lc-label.is-last { font-size: 14px; font-weight: 700; fill: var(--tone-ink); }
.lc-glow  { fill: var(--tone); opacity: 0; transform-box: fill-box; transform-origin: center; animation: dc-glow 1.4s var(--ease-out) calc(var(--delay) + 1.05s) forwards; }
.lc-end   { fill: var(--card); stroke: var(--tone); stroke-width: 3; transform-box: fill-box; transform-origin: center; transform: scale(0); animation: dc-pop .5s var(--ease-bounce) calc(var(--delay) + 1.05s) forwards; }

.tc-rung  { transform: scale(0); animation: dc-pop .75s var(--ease-bounce) calc(var(--delay) + var(--i, 0) * .1s) forwards; }
.tc-edge  { fill: none; stroke: color-mix(in srgb, var(--tone) 45%, transparent); stroke-width: 1; }
.tc-spoke { stroke: var(--card); stroke-opacity: .75; stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; animation: dc-draw .5s var(--ease-out) calc(var(--delay) + .35s) forwards; }
.tc-ring-label { font-size: 11px; fill: var(--tone-ink); opacity: 0; animation: dc-fade-in .4s var(--ease-out) calc(var(--delay) + .55s) forwards; }
.tc-label { font-size: 13px; fill: var(--ink); opacity: 0; transform-box: fill-box; animation: dc-rise .4s var(--ease-out) calc(var(--delay) + .7s + var(--i) * .12s) forwards; }
.tc-glow  { fill: var(--card); opacity: 0; animation: dc-fade-in .5s var(--ease-out) calc(var(--delay) + 1.05s + var(--i) * .12s) forwards; }
.tc-dot   { fill: var(--card); stroke: var(--tone-ink); stroke-width: 2.6; transform-box: fill-box; transform-origin: center; transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; animation: dc-fly .6s var(--ease-bounce) calc(var(--delay) + .7s + var(--i) * .12s) forwards; }

@keyframes dc-draw    { to { stroke-dashoffset: 0; } }
@keyframes dc-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dc-rise    { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes dc-wipe    { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes dc-pop     { to { transform: scale(1); } }
@keyframes dc-pop-in  { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
@keyframes dc-fly     { to { transform: none; opacity: 1; } }
@keyframes dc-glow    { 0% { opacity: 0; transform: scale(.4); } 45% { opacity: .65; transform: scale(1.35); } 100% { opacity: .4; transform: scale(1); } }

/* ---------- 19. Tones ---------------------------------------------------- */
/* Last, so a modifier wins over a component's own default. Any class
   containing --blue, --green, --red, --gold or a tier name sets the tone. */

:root, [class*="--blue"] { --tone: var(--blue); --tone-tint: var(--blue-tint); --tone-ink: var(--blue-ink); --on-tone: #fff; }
[class*="--green"], .btn--start { --tone: var(--green); --tone-tint: var(--green-tint); --tone-ink: var(--green-ink); --on-tone: var(--on-green); }
[class*="--red"], .btn--danger, .error-summary { --tone: var(--red); --tone-tint: var(--red-tint); --tone-ink: var(--red); --on-tone: #fff; }
[class*="--gold"]     { --tone: var(--gold);     --tone-tint: var(--gold-tint); --tone-ink: light-dark(#8a6100, var(--gold)); --on-tone: #3a2a00; }
[class*="--bronze"]   { --tone: var(--bronze);   --on-tone: #3b2210; }
[class*="--silver"]   { --tone: var(--silver);   --on-tone: #262c36; }
[class*="--platinum"] { --tone: var(--platinum); --on-tone: #0d2a44; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .hero::after { animation: none; }
  .tilt { transform: none !important; }
}
