/* Handled · the one token file. Seva, 2026-11-17: "In fact just copy storybecomes." This is Story Becomes'
   app-frontend/assets/brand.8c930adc.css (the storybecomes.com design system at a working density: black and white,
   lowercase Manrope with negative tracking, folder-tab shapes with square left corners and rounded right corners,
   extruded "3D tab" primary buttons, one red accent), plus the dark theme Story Becomes never had ("Ensure there's
   dark mode too"). The token names stay Story Becomes' own (--sb-*) on purpose, so a rule copied from
   ~/storybecomes/app-frontend/assets/account/account.css works here once its raw #000 and #fff become tokens.
   Every colour, radius, shadow and curve lives here and only here: tools/test/layout.test.mjs fails on a raw hex
   value anywhere else in app-frontend, and tools/test/brand-tokens.test.mjs fails when a light colour token has no
   dark counterpart, when the two dark blocks differ, or when a text colour falls under 4.5:1 in either theme.

   Themes. The phone's setting decides by default (prefers-color-scheme). Settings > Appearance can pin Light or
   Dark on this phone: the inline stamp at the top of index.html reads localStorage "handled.theme" and sets
   <html data-theme="light|dark"> before the first paint, so a pinned theme never flashes the other one. Dark is
   designed, not inverted: near-black paper (not pure black, which smears on OLED when scrolling), a soft white
   ink, the same red for fills (white on it still 5.0:1), a lifted red for red text, and a mid-grey extrusion so the
   3D tabs and cards still read as raised keys on black (an ink-coloured extrusion would vanish into the page).

   Rules of use: ink-3 sits only on paper (on grey it is 4.1:1); red text uses --sb-bad, red fills --sb-ribbon;
   text on an ink surface (tips, toasts, the primary button) uses --sb-paper and --sb-paper-2; a filled panel uses
   --sb-hero with --sb-on-hero and --sb-on-hero-2 (the white face stays only for the 3D primary and the Ask tab).
   Owner: ui-core (after the foundation). ui-feed never edits it: a token it needs is asked for. The other
   stylesheets (css/shell.css, components.css, core.css, feed.css) use these variables only. */

/* ---------- 0. Manrope, self-hosted (SIL OFL 1.1, fonts/OFL.txt), variable 200 to 800 ---------- */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/manrope-latin.e310b55a.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/manrope-latin-ext.ce093b34.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* metric-matched fallback, so text does not jump when Manrope arrives */
@font-face { font-family: "Manrope Fallback"; src: local("Arial"); size-adjust: 104%; }

/* ---------- 1. Tokens: light (the default) ---------- */
@property --sb-d { syntax: "<length>"; inherits: false; initial-value: 0px; }

:root {
  color-scheme: light;
  --sb-font: "Manrope", "Manrope Fallback", Arial, sans-serif;
  --sb-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* colour: black and white with one accent */
  --sb-ink: #000;               /* text on paper 21:1 */
  --sb-paper: #fff;             /* the page; also text on an ink surface 21:1 */
  --sb-ink-2: #5c5c5c;          /* secondary text on paper 6.7:1, on grey 6.0:1, on grey-2 5.5:1 */
  --sb-ink-3: #767676;          /* placeholders, on paper only 4.5:1 */
  --sb-paper-2: #a3a3a3;        /* secondary text on an ink surface 8.3:1 */
  --sb-grey: #f5f3f3;           /* the one grey: hover, pressed rows, quiet panels (non-text) */
  --sb-grey-2: #ebe8e8;         /* one step darker for hover on grey (non-text) */
  --sb-line: #000;              /* the 1px and 1.5px rules (non-text) */
  --sb-line-soft: #d9d6d6;      /* dividers inside a bordered block (non-text) */
  --sb-chrome-line: #000;       /* the hairline under the top bar and over the tab bar (non-text) */
  --sb-extrude: #000;           /* the 3D tab's and the card's hard shadow (non-text) */
  --sb-ribbon: #d7261e;         /* the only accent, as a fill: "now", overdue, destructive. White text on it 5.0:1 */
  --sb-on-ribbon: #fff;         /* text on a ribbon fill 5.0:1 */
  /* the hero: a filled panel (the net worth card, a "do by" chip, a picked toggle). Black in light, as Story
     Becomes draws it; in dark it stays a dark lifted panel with a soft rule, never a white slab (2026-11-17 review) */
  --sb-hero: #000;              /* the panel fill (non-text) */
  --sb-hero-line: #000;         /* its border (non-text) */
  --sb-on-hero: #fff;           /* text on the hero 21:1 */
  --sb-on-hero-2: #a3a3a3;      /* secondary text on the hero 8.3:1 */
  --sb-stage: #0b0b0b;          /* a picture area, dark in both themes (non-text) */
  --sb-scrim: rgba(0, 0, 0, 0.45);          /* behind a sheet or dialog (non-text) */
  --sb-glass: rgba(255, 255, 255, 0.94);    /* the sticky top bar over scrolling content (non-text) */
  --sb-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E");

  /* state colours: text on paper, and soft fills behind them */
  --sb-ok: #0b7a3e;             /* text on paper 5.4:1, on ok-soft 4.8:1, on grey 4.9:1 */
  --sb-warn: #9a5200;           /* text on paper 5.9:1, on warn-soft 5.2:1, on grey 5.3:1 */
  --sb-bad: #c0221a;            /* red text on paper 6.0:1, on bad-soft 5.3:1, on grey 5.5:1 */
  --sb-ok-soft: #e8f3ec;
  --sb-warn-soft: #fbefdd;
  --sb-bad-soft: #fcecea;
  /* status dots on an ink surface (toasts): non-text */
  --sb-ok-on-ink: #4ade80;
  --sb-warn-on-ink: #fbbf24;
  --sb-bad-on-ink: #ff6b5f;

  /* shape: folder tabs, square left corners and rounded right corners */
  --sb-r-xs: 0 3px 3px 0;
  --sb-r-sm: 0 5px 5px 0;
  --sb-r: 0 8px 8px 0;
  --sb-r-lg: 0 12px 12px 0;
  --sb-r-xl: 0 16px 16px 0;
  --sb-bw: 1.5px;               /* the tab and field border */

  /* depth: hard extrusions down-left, never a blur */
  --sb-x-sm: -2px 2px 0 var(--sb-extrude);
  --sb-x: -4px 4px 0 var(--sb-extrude);
  --sb-x-lg: -8px 8px 0 var(--sb-extrude);

  /* motion */
  --sb-ease-snap: cubic-bezier(0.001, 0, 0, 1);
  --sb-ease-fill: cubic-bezier(0.65, 0, 0.35, 1);

  /* 3D tab button: face depth and hover lift */
  --sb-depth: 4px;
  --sb-lift: 2px;

  /* phone chrome */
  --sb-tabbar: 64px;            /* the bottom tab bar, plus env(safe-area-inset-bottom) */
  --sb-top: 56px;               /* the sticky top bar */
  --sb-gutter: 20px;            /* phone gutter; 40px from the desktop breakpoint */
}
@media (min-width: 900px) { :root { --sb-gutter: 40px; } }

/* ---------- 1b. Tokens: dark. Two blocks with the same lines: the phone in dark mode (unless pinned light), and
   dark pinned by hand. tools/test/brand-tokens.test.mjs holds them equal and complete. ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --sb-ink: #f4f4f4;            /* text on paper 17.7:1 */
    --sb-paper: #0d0d0d;          /* the page; also text on an ink surface 17.7:1 */
    --sb-ink-2: #a8a8a8;          /* secondary text on paper 8.2:1, on grey 7.3:1, on grey-2 6.4:1 */
    --sb-ink-3: #8c8c8c;          /* placeholders, on paper 5.8:1 */
    --sb-paper-2: #5c5c5c;        /* secondary text on an ink surface 6.1:1 */
    --sb-grey: #1a1a1a;
    --sb-grey-2: #262626;
    --sb-line: #f4f4f4;
    --sb-line-soft: #333333;
    --sb-chrome-line: #2e2e2e;    /* the bars recede in dark: a soft rule instead of a white one */
    --sb-extrude: #6e6e6e;        /* a mid-grey key shadow, 3.8:1 against the page so the 3D tab reads */
    --sb-ribbon: #d7261e;         /* fills keep the brand red; white text on it 5.0:1 */
    --sb-on-ribbon: #fff;         /* text on a ribbon fill 5.0:1 */
    --sb-hero: #1c1c1c;           /* a lifted dark panel (non-text) */
    --sb-hero-line: #3d3d3d;      /* its soft rule (non-text) */
    --sb-on-hero: #f4f4f4;        /* text on the hero 15.5:1 */
    --sb-on-hero-2: #a8a8a8;      /* secondary text on the hero 7.2:1 */
    --sb-stage: #0b0b0b;
    --sb-scrim: rgba(0, 0, 0, 0.6);
    --sb-glass: rgba(13, 13, 13, 0.92);
    --sb-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f4f4f4' stroke-width='1.5'/%3E%3C/svg%3E");
    --sb-ok: #4ade80;             /* text on paper 11.2:1, on ok-soft 9.4:1, on grey 10.0:1 */
    --sb-warn: #fbbf24;           /* text on paper 11.6:1, on warn-soft 9.6:1, on grey 10.4:1 */
    --sb-bad: #ff6b5f;            /* red text on paper 7.0:1, on bad-soft 6.2:1, on grey 6.2:1 */
    --sb-ok-soft: #0f2418;
    --sb-warn-soft: #2a2010;
    --sb-bad-soft: #2c1414;
    --sb-ok-on-ink: #0b7a3e;
    --sb-warn-on-ink: #9a5200;
    --sb-bad-on-ink: #c0221a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --sb-ink: #f4f4f4;            /* text on paper 17.7:1 */
  --sb-paper: #0d0d0d;          /* the page; also text on an ink surface 17.7:1 */
  --sb-ink-2: #a8a8a8;          /* secondary text on paper 8.2:1, on grey 7.3:1, on grey-2 6.4:1 */
  --sb-ink-3: #8c8c8c;          /* placeholders, on paper 5.8:1 */
  --sb-paper-2: #5c5c5c;        /* secondary text on an ink surface 6.1:1 */
  --sb-grey: #1a1a1a;
  --sb-grey-2: #262626;
  --sb-line: #f4f4f4;
  --sb-line-soft: #333333;
  --sb-chrome-line: #2e2e2e;    /* the bars recede in dark: a soft rule instead of a white one */
  --sb-extrude: #6e6e6e;        /* a mid-grey key shadow, 3.8:1 against the page so the 3D tab reads */
  --sb-ribbon: #d7261e;         /* fills keep the brand red; white text on it 5.0:1 */
  --sb-on-ribbon: #fff;         /* text on a ribbon fill 5.0:1 */
  --sb-hero: #1c1c1c;           /* a lifted dark panel (non-text) */
  --sb-hero-line: #3d3d3d;      /* its soft rule (non-text) */
  --sb-on-hero: #f4f4f4;        /* text on the hero 15.5:1 */
  --sb-on-hero-2: #a8a8a8;      /* secondary text on the hero 7.2:1 */
  --sb-stage: #0b0b0b;
  --sb-scrim: rgba(0, 0, 0, 0.6);
  --sb-glass: rgba(13, 13, 13, 0.92);
  --sb-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f4f4f4' stroke-width='1.5'/%3E%3C/svg%3E");
  --sb-ok: #4ade80;             /* text on paper 11.2:1, on ok-soft 9.4:1, on grey 10.0:1 */
  --sb-warn: #fbbf24;           /* text on paper 11.6:1, on warn-soft 9.6:1, on grey 10.4:1 */
  --sb-bad: #ff6b5f;            /* red text on paper 7.0:1, on bad-soft 6.2:1, on grey 6.2:1 */
  --sb-ok-soft: #0f2418;
  --sb-warn-soft: #2a2010;
  --sb-bad-soft: #2c1414;
  --sb-ok-on-ink: #0b7a3e;
  --sb-warn-on-ink: #9a5200;
  --sb-bad-on-ink: #c0221a;
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------- 2. Base ---------- */
html { -webkit-text-size-adjust: 100%; background: var(--sb-paper); overflow-x: clip; }
body {
  margin: 0; min-height: 100dvh; overflow-x: clip;
  background: var(--sb-paper); color: var(--sb-ink);
  font-family: var(--sb-font); font-size: 16px; line-height: 1.45; font-weight: 500;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video, canvas, svg { max-width: 100%; }
::selection { background: var(--sb-ink); color: var(--sb-paper); }
:focus-visible { outline: 2px solid var(--sb-ink); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
strong, b { font-weight: 700; }
button, a, input, select, textarea, [role="button"] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* every figure lines up */
.num, time, [data-num] { font-variant-numeric: tabular-nums; }

/* ---------- 3. Buttons ---------- */
.btn {
  --btn-h: 44px;                /* a phone touch target; .btn-sm and .btn-xs are for dense desktop rows only */
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--btn-h); padding: 0 16px;
  border: var(--sb-bw) solid var(--sb-ink); border-radius: var(--sb-r-sm);
  background: var(--sb-paper); color: var(--sb-ink);
  font-family: var(--sb-font); font-size: 16px; font-weight: 600; letter-spacing: -0.02em;
  white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, --sb-d 0.333s var(--sb-ease-snap), transform 0.333s var(--sb-ease-snap);
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--sb-ink); outline-offset: 3px; box-shadow: none; }
.btn:disabled, .btn.is-disabled { cursor: not-allowed; color: var(--sb-ink-3); border-color: var(--sb-ink-3); background: var(--sb-paper); }

/* outline: the flat folder tab. Hover is the grey; ink means chosen or primary, never hover. */
@media (hover: hover) { .btn-outline:hover:not(:disabled):not(.is-disabled) { background: var(--sb-grey); } }

/* ghost: no frame until hover */
.btn-ghost { border-color: transparent; background: transparent; }
@media (hover: hover) { .btn-ghost:hover:not(:disabled):not(.is-disabled) { background: var(--sb-grey); border-color: transparent; color: var(--sb-ink); } }
.btn-ghost:disabled { border-color: transparent; }

/* primary (and "confirm send", the same tab in the accent): the 3D tab. An ink face on its extrusion down-left; it
   lifts on hover and presses into its slot on tap. The margin reserves the extrusion so it never covers a
   neighbour. In dark the face is the soft white ink and the extrusion a mid grey. */
.btn-primary { background: var(--sb-ink); color: var(--sb-paper); --btn-h: 52px; font-size: 17px; }
.btn-primary, .btn-confirm {
  --sb-d: var(--sb-depth);
  margin: 0 0 var(--sb-depth) var(--sb-depth);
  text-transform: lowercase;
  box-shadow:
    calc(var(--sb-d) * -0.25) calc(var(--sb-d) * 0.25) 0 var(--sb-extrude), calc(var(--sb-d) * -0.5) calc(var(--sb-d) * 0.5) 0 var(--sb-extrude),
    calc(var(--sb-d) * -0.75) calc(var(--sb-d) * 0.75) 0 var(--sb-extrude), calc(var(--sb-d) * -1) var(--sb-d) 0 var(--sb-extrude);
}
.btn-confirm { background: var(--sb-ribbon); border-color: var(--sb-ribbon); color: var(--sb-on-ribbon); }
@media (hover: hover) {
  .btn-primary:hover:not(:disabled):not(.is-disabled), .btn-confirm:hover:not(:disabled) { --sb-d: calc(var(--sb-depth) + var(--sb-lift)); transform: translate(var(--sb-lift), calc(var(--sb-lift) * -1)); }
}
.btn-primary:active:not(:disabled):not(.is-disabled), .btn-confirm:active:not(:disabled) { --sb-d: 0px; transform: translate(calc(var(--sb-depth) * -1), var(--sb-depth)); }
.btn-primary:disabled, .btn-primary.is-disabled { background: var(--sb-grey); border-color: var(--sb-ink-3); color: var(--sb-ink-3); --sb-d: 0px; transform: translate(calc(var(--sb-depth) * -1), var(--sb-depth)); }
.btn-primary:focus-visible { outline-offset: 4px; }

/* destructive and "last step" actions use the accent */
.btn-danger { background: var(--sb-ribbon); border-color: var(--sb-ribbon); color: var(--sb-on-ribbon); }
@media (hover: hover) { .btn-danger:hover:not(:disabled) { background: var(--sb-ink); border-color: var(--sb-ink); color: var(--sb-paper); } }
.btn-danger-outline { color: var(--sb-bad); border-color: var(--sb-ribbon); }
@media (hover: hover) { .btn-danger-outline:hover:not(:disabled):not(.is-disabled) { background: var(--sb-ribbon); border-color: var(--sb-ribbon); color: var(--sb-on-ribbon); } }

.btn-sm { --btn-h: 36px; padding: 0 12px; font-size: 14px; }
.btn-xs { --btn-h: 30px; padding: 0 9px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary.btn-block { width: calc(100% - var(--sb-depth)); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 44px; min-height: 44px;
  border: 0; border-radius: var(--sb-r-sm); background: transparent; color: var(--sb-ink-2); cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
@media (hover: hover) { .icon-btn:hover:not(:disabled) { background: var(--sb-grey); color: var(--sb-ink); } }
.icon-btn:focus-visible { outline: 2px solid var(--sb-ink); outline-offset: 1px; box-shadow: none; }
.ic { display: inline-flex; width: 20px; height: 20px; }
.ic svg { width: 100%; height: 100%; }

.link-btn { border: 0; background: none; padding: 0; color: var(--sb-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (hover: hover) { .link-btn:hover { text-decoration-thickness: 2px; } }

/* ---------- 4. Fields (16px, or iOS zooms on focus) ---------- */
.input, .select, .textarea {
  border: var(--sb-bw) solid var(--sb-ink); border-radius: var(--sb-r-sm);
  background: var(--sb-paper); color: var(--sb-ink); box-shadow: none;
  font-family: var(--sb-font); font-size: 16px; font-weight: 500; letter-spacing: -0.01em;
  min-height: 44px; padding: 0 12px;
  transition: box-shadow 0.25s var(--sb-ease-snap), border-color 0.2s ease;
}
.textarea { padding: 10px 12px; }
.input::placeholder, .textarea::placeholder { color: var(--sb-ink-3); opacity: 1; }
/* focus: a 2px ink edge, no glow and no extrusion (the extrusion belongs to the primary button) */
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--sb-ink); box-shadow: inset 0 0 0 1px var(--sb-ink); }
.input[aria-invalid="true"] { border-color: var(--sb-ribbon); }
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 30px;
  background-image: var(--sb-chevron); background-repeat: no-repeat; background-position: right 10px center; background-size: 10px;
}
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--sb-ink); }

/* ---------- 5. Tags, chips, badges ---------- */
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--sb-ink-3); border-radius: var(--sb-r-xs); margin: 0 2px;
  background: var(--sb-paper); color: var(--sb-ink-2); font: 600 11px var(--sb-font);
}
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sb-spin 0.8s linear infinite; }
@keyframes sb-spin { to { transform: rotate(360deg); } }

/* ---------- 6. The data-tip popover (ui.js initTips: one delegated listener, no delay, tap pins it on a phone) ---------- */
.tip {
  position: fixed; z-index: 1000; margin: 0; padding: 8px 10px; pointer-events: none;
  max-width: min(320px, calc(100vw - 16px)); white-space: pre-line; overflow-wrap: anywhere;
  background: var(--sb-ink); color: var(--sb-paper);
  border-radius: var(--sb-r-sm); box-shadow: none;
  font-family: var(--sb-font); font-weight: 500; font-size: 13px; letter-spacing: -0.01em; line-height: 1.45;
}
/* a figure that carries a tip: dotted underline, focusable (ui.js num()) */
.num[data-tip], .tipd { cursor: help; text-decoration: underline dotted currentColor; text-decoration-thickness: 1px; text-underline-offset: 4px; }
[data-tip] { cursor: help; }
button[data-tip], a[data-tip] { cursor: pointer; }

/* ---------- 7. Toasts: the black tip bar, above the bottom tab bar on phones ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--sb-tabbar) + env(safe-area-inset-bottom) + 16px); z-index: 900; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 16px; font-size: 15px;
  background: var(--sb-ink); color: var(--sb-paper); border: 0; border-radius: var(--sb-r); box-shadow: none;
  font-weight: 600; letter-spacing: -0.02em;
}
.toast-text { flex: 1; }
.toast::before { content: ""; flex: none; align-self: center; width: 7px; height: 7px; border-radius: 50%; background: var(--sb-paper-2); }
.toast.tone-ok::before { background: var(--sb-ok-on-ink); }
.toast.tone-warn::before { background: var(--sb-warn-on-ink); }
.toast.tone-bad::before { background: var(--sb-bad-on-ink); }
.toast a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.toast .icon-btn { color: var(--sb-paper-2); }
@media (hover: hover) { .toast .icon-btn:hover { background: transparent; color: var(--sb-paper); } }

/* ---------- 8. Skeleton: drawn by index.html itself, before any script runs ---------- */
.skeleton {
  border-radius: var(--sb-r-xl);
  background: linear-gradient(90deg, var(--sb-grey) 25%, var(--sb-grey-2) 50%, var(--sb-grey) 75%);
  background-size: 200% 100%;
  animation: sb-shimmer 1.4s ease-in-out infinite;
}
@keyframes sb-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
/* the boot skeleton's shapes (index.html) live in css/shell.css with the rest of the shell. */

/* ---------- 9. Dialogs: a bottom sheet on phones, a dialog on desktop (ui.js openDialog) ---------- */
dialog.dlg {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh;
  background: var(--sb-paper); color: var(--sb-ink);
  border-top: var(--sb-bw) solid var(--sb-line); border-radius: 0 18px 0 0; overflow: auto;
}
dialog.dlg::backdrop { background: var(--sb-scrim); }
dialog.dlg[open] { animation: sb-sheet-up 0.36s var(--sb-ease-snap) backwards; }
@keyframes sb-sheet-up { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }
.dlg-grab { display: block; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--sb-line-soft); }
dialog.dlg--tall { min-height: min(72dvh, 640px); }
@media (min-width: 700px) {
  dialog.dlg { margin: auto; border: var(--sb-bw) solid var(--sb-line); border-radius: 0 18px 18px 0; box-shadow: -10px 10px 0 var(--sb-extrude); }
  dialog.dlg--tall { min-height: 0; }
  .dlg-grab { display: none; }
}
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 8px 4px var(--sb-gutter); }
.dlg-title { margin: 0; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; text-transform: lowercase; }
.dlg-body { padding: 8px var(--sb-gutter) 16px; }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 12px var(--sb-gutter) calc(16px + env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) {
  .btn, .input, .select, .textarea { transition: none; }
  dialog.dlg[open] { animation: none; }
  .skeleton, .spinner { animation: none; }
}
