/* The Artifacts Lab — shared UI tokens + components (ui.css). UX 1 · Foundations, PR 2.
 * House rules: .claude/skills/tal-ui (identity §1, hard rules §2). Check page: /ui-kit.html.
 *
 * OPT-IN ONLY (risk R2). Linked on the 13 main pages BEFORE each page's own <style>, so:
 *  - tokens are CSS variables; where a page still defines a variable with the same name
 *    (e.g. Meal's --text), the page's own value wins until that page is converted (UX 6);
 *  - components are `ui-`-prefixed classes (pages already use .btn / .card / .chip / .label …
 *    with their own looks) and do nothing until a page puts the class on an element;
 *  - no element selectors (button, body, h1 …), no resets, no @import.
 * Type sizes are in rem so they follow the phone's font size (the 130% check).
 */

:root {
  /* Colour (tal-ui §1) */
  --bg:          #0B0F1A;  /* page background */
  --surface:     #111827;  /* cards, sheets, bars */
  --raised:      #1A2235;  /* inputs, chips, icon tiles */
  --line:        #2A3B55;  /* borders, dividers */
  --text:        #E8EDF5;  /* main text */
  --text-2:      #9BAAC4;  /* secondary text */
  --muted:       #7A8AA8;  /* small / quiet text (never #5A6A8A: fails contrast) */
  --accent:      #F5A623;  /* main button fill, active tab, focus ring. The only accent */
  --accent-deep: #D4920A;  /* borders / hover of accent things only */
  --on-accent:   #0B0F1A;  /* text on an accent fill */
  --good:        #2ECC8A;  /* "on track / done" states only, never a button */
  --bad:         #FB7185;  /* overdue / problem states only */
  --data-blue:   #4A90D9;  /* chart series only */
  --data-purple: #9B72CF;
  --data-teal:   #2DD4BF;

  /* Type */
  --font-title: 'Playfair Display', Georgia, serif;          /* page titles + the one hero number */
  --font-body:  'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num:   'JetBrains Mono', ui-monospace, monospace;  /* numbers in tables only, never words */
  --fs-12: 0.75rem;   /* smallest allowed */
  --fs-14: 0.875rem;
  --fs-16: 1rem;      /* body */
  --fs-18: 1.125rem;  /* tool name, sheet titles */
  --fs-22: 1.375rem;
  --fs-28: 1.75rem;   /* page title / hero number */

  /* Space: 4 / 8 px steps; 16 px side margins */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* Shape */
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   16px;
  --radius-pill: 999px;
  --tap:         44px;  /* minimum height of anything tappable */
  --shadow:      0 12px 32px rgba(0, 0, 0, 0.45);
  --app-menu-w:  0px;   /* width of the left menu; 200px only while it shows (body.has-app-bar, ≥ 1024 px) */
  --app-bar-h:   0px;   /* height the bottom app bar takes; > 0 only while it shows (body.has-app-bar, < 1024 px) */
}

/* ── Buttons: one primary (amber) per screen; the rest secondary / quiet ───────────── */
.ui-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: var(--sp-2) var(--sp-5); box-sizing: border-box;
  border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--text);
  font: 600 var(--fs-16)/1.25 var(--font-body); text-align: center; text-decoration: none;
  white-space: normal; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, border-color .15s, color .15s;
}
.ui-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ui-btn:disabled, .ui-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.ui-btn--primary   { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ui-btn--primary:hover:not(:disabled) { background: var(--accent-deep); border-color: var(--accent-deep); }
.ui-btn--secondary { border-color: var(--line); color: var(--text); }
.ui-btn--secondary:hover:not(:disabled) { border-color: var(--text-2); }
.ui-btn--quiet     { color: var(--text-2); padding-left: var(--sp-3); padding-right: var(--sp-3); }
.ui-btn--quiet:hover:not(:disabled) { color: var(--text); }
.ui-btn--danger    { border-color: var(--bad); color: var(--bad); }
.ui-btn--block     { display: flex; width: 100%; }

/* ── Card (groups only; items are rows) ─────────────────────────────────────────────── */
.ui-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--sp-4); box-sizing: border-box; color: var(--text);
}

/* ── Row: one item in a list. Wraps instead of cutting text ─────────────────────────── */
.ui-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
  min-height: var(--tap); padding: var(--sp-3) 0; box-sizing: border-box;
  border-bottom: 1px solid var(--line); color: var(--text);
  font: 400 var(--fs-16)/1.4 var(--font-body); text-decoration: none;
}
.ui-row:last-child { border-bottom: 0; }
.ui-row__main { flex: 1 1 12rem; min-width: 0; }
.ui-row__sub  { display: block; color: var(--text-2); font-size: var(--fs-14); }
.ui-row--tap  { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ui-row--tap:hover { background: var(--raised); }
.ui-row--tap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.ui-row { width: 100%; background: none; border-width: 0 0 1px; border-style: solid; border-color: var(--line); text-align: left; cursor: pointer; }

/* ── Chip: a choice or a filter ─────────────────────────────────────────────────────── */
.ui-chip {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  min-height: var(--tap); padding: var(--sp-1) var(--sp-4); box-sizing: border-box;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-pill);
  color: var(--text); font: 500 var(--fs-14)/1.3 var(--font-body);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ui-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ui-chip--on, .ui-chip[aria-pressed="true"] { border-color: var(--accent); background: rgba(245, 166, 35, .12); }

/* ── Section label: Outfit, semibold, sentence case (never mono UPPERCASE) ──────────── */
.ui-label {
  display: block; margin: 0 0 var(--sp-2);
  color: var(--text-2); font: 600 var(--fs-14)/1.3 var(--font-body);
  letter-spacing: normal; text-transform: none;
}

/* ── Tabs: at most 4, text only, sentence case ──────────────────────────────────────── */
.ui-tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line); }
.ui-tab {
  flex: 1 1 0; min-width: 0; min-height: var(--tap); padding: var(--sp-2) var(--sp-2);
  background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--text-2); font: 500 var(--fs-16)/1.25 var(--font-body); text-align: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ui-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ui-tab--on, .ui-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
/* Four labels that do not fit (360 px at 130 % font, or long words): the strip scrolls sideways instead of squashing the labels.
   TAL.shell.tabs() adds .is-overflow-start / .is-overflow-end so the edge that has more fades out. */
.ui-tabs--scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ui-tabs--scroll::-webkit-scrollbar { display: none; }
.ui-tabs--scroll .ui-tab { flex: 1 0 auto; padding-left: var(--sp-4); padding-right: var(--sp-4); white-space: nowrap; }
.ui-tabs--scroll.is-overflow-end { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.ui-tabs--scroll.is-overflow-start { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent); }
.ui-tabs--scroll.is-overflow-start.is-overflow-end { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }

/* Signed in = the app bar is up = no website footer inside a tool (tal-ui: no website material for signed-in users;
   legal links live in Profile). Signed-out visitors (pSEO / landing) keep it. */
body.has-app-bar .tool-footer { display: none; }

/* ── Segmented switch: 2–3 options (instead of tabs inside tabs) ────────────────────── */
.ui-segmented {
  display: flex; gap: var(--sp-1); padding: 2px; box-sizing: border-box;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius);
}
.ui-segmented__opt {
  flex: 1 1 0; min-width: 0; min-height: var(--tap); padding: var(--sp-1) var(--sp-3);
  background: transparent; border: 0; border-radius: calc(var(--radius) - 3px);
  color: var(--text-2); font: 500 var(--fs-14)/1.25 var(--font-body); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ui-segmented__opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.ui-segmented__opt--on, .ui-segmented__opt[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; }

/* ── Empty state: icon · one-sentence title · one line of help · one button ─────────── */
.ui-empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--text);
}
.ui-empty__icon  { font-size: var(--fs-28); line-height: 1; }
.ui-empty__title { margin: 0; font: 600 var(--fs-18)/1.3 var(--font-body); }
.ui-empty__help  { margin: 0; max-width: 32ch; color: var(--text-2); font: 400 var(--fs-14)/1.45 var(--font-body); }
.ui-empty .ui-btn { margin-top: var(--sp-2); }

/* ── Sheet: details on tap; bottom sheet on phones, right-hand panel on ≥ 1024 px.
      Opening/closing and back handling come from shell.js (UX 1 item 4 / UX 2). ─────── */
.ui-sheet-backdrop {
  position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .55);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.ui-sheet-backdrop--open { opacity: 1; pointer-events: auto; }
.ui-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; box-sizing: border-box;
  max-height: 85vh; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--sp-2) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow); color: var(--text);
  transform: translateY(100%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s;
}
/* visibility flips at once on open (so it can take focus and counts as open), after the slide on close */
.ui-sheet--open { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; }
.ui-sheet__handle { width: 36px; height: 4px; margin: 0 auto var(--sp-3); border-radius: 2px; background: var(--line); }
.ui-sheet__title  { margin: 0 0 var(--sp-3); font: 600 var(--fs-18)/1.3 var(--font-body); color: var(--text); }
@media (min-width: 1024px) {
  .ui-sheet {
    left: auto; top: 0; width: 420px; max-height: none; height: 100%;
    border-top: 0; border-left: 1px solid var(--line); border-radius: 0;
    padding-top: var(--sp-5); transform: translateX(100%);
  }
  .ui-sheet--open { transform: none; }
  .ui-sheet__handle { display: none; }
}

/* ── Notice: at most one per screen, below the main content, always dismissible ─────── */
.ui-notice {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2) var(--sp-3) var(--sp-4); box-sizing: border-box;
  background: var(--raised); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); color: var(--text); font: 400 var(--fs-14)/1.45 var(--font-body);
}
.ui-notice--good { border-left-color: var(--good); }
.ui-notice--bad  { border-left-color: var(--bad); }
.ui-notice__body { flex: 1; min-width: 0; padding-top: var(--sp-1); }
.ui-notice__close {
  flex: none; width: var(--tap); height: var(--tap); margin: calc(-1 * var(--sp-2)) 0;
  background: transparent; border: 0; border-radius: var(--radius-sm);
  color: var(--text-2); font: 400 var(--fs-22)/1 var(--font-body); cursor: pointer;
}
.ui-notice__close:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ── Toast: short confirmation, bottom centre, above the bottom bar ─────────────────── */
.ui-toast {
  position: fixed; left: calc(50% + var(--app-menu-w) / 2); bottom: calc(var(--sp-4) + env(safe-area-inset-bottom, 0px) + var(--app-bar-h)); z-index: 1100;
  box-sizing: border-box; width: max-content; max-width: calc(100% - 2 * var(--sp-4));
  padding: var(--sp-3) var(--sp-4); background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text);
  font: 500 var(--fs-14)/1.4 var(--font-body);
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.ui-toast--show { transform: translate(-50%, 0); opacity: 1; }

/* ── Tool header: ‹ back · tool name · ⋯ (built by shell.js; UX 1 PR 4) ──────────────
      The bar is the sticky element (same top:0 / z-index:100 every tool had); rows a tool keeps
      in it (Expense's tabs, Pregnancy's tabs) follow the head row. */
.ui-tool-bar {
  position: sticky; top: 0; z-index: 100; display: block;
  background: rgba(11, 15, 26, .92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.ui-tool-head {
  display: flex; align-items: center; gap: var(--sp-1);
  min-height: 56px; padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-1); box-sizing: border-box;
}
.ui-tool-head__back, .ui-tool-head__more {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); border-radius: var(--radius);
  background: transparent; border: 0; color: var(--text-2); text-decoration: none; cursor: pointer;
  font-family: var(--font-body); -webkit-tap-highlight-color: transparent;
}
.ui-tool-head__back:hover, .ui-tool-head__more:hover { color: var(--text); background: var(--raised); }
.ui-tool-head__back:focus-visible, .ui-tool-head__more:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ui-tool-head__chev { font-size: max(28px, var(--fs-28)); line-height: 1; margin-top: -3px; }
.ui-tool-head__more { font-size: max(22px, var(--fs-22)); line-height: 1; }
/* Signed out: the ⚗️ logo mark (→ home) instead of ‹ */
.ui-tool-head__mark {
  display: none; width: 32px; height: 32px; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); background: var(--raised); border: 1px solid var(--line); font-size: var(--fs-16);
}
.ui-tool-bar.is-signed-out .ui-tool-head__chev { display: none; }
.ui-tool-bar.is-signed-out .ui-tool-head__mark { display: inline-flex; }
/* Tool name: 18 px, may wrap to two lines, never cut to "…" */
.ui-tool-head__name {
  flex: 1 1 auto; min-width: 0; padding: 0 var(--sp-1);
  color: var(--text); font: 600 max(18px, var(--fs-18))/1.25 var(--font-body);   /* max(): Meal sets html{font-size:15px} */
  overflow-wrap: anywhere; white-space: normal; text-transform: none; letter-spacing: normal;
}
.ui-tool-head__status { flex: none; display: inline-flex; align-items: center; padding: 0 var(--sp-2); }
.ui-tool-head__status .sync-dot { cursor: default; pointer-events: none; }
/* pSEO embeds — the one rule shell.js applies (EMBED_HEADER): */
.ui-tool-bar--embed .ui-tool-head__back { display: none !important; }
.ui-tool-bar--embed-hidden { display: none !important; }

/* ⋯ menu (a .ui-sheet). The tool's own language control and plan badge are moved in as rows. */
.ui-tool-menu:focus { outline: none; }
.ui-tool-menu__list { margin: 0 0 var(--sp-3); }
.ui-tool-menu__item {
  width: 100%; box-sizing: border-box; background: none; border: 0; border-bottom: 1px solid var(--line);
  color: var(--text); font: 400 var(--fs-16)/1.4 var(--font-body); text-align: left; text-decoration: none;
}
.ui-tool-menu__item[hidden] { display: none; }
#toolMenu .translate-wrap { position: static; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; flex: 1 1 auto; }
#toolMenu .translate-btn {
  width: var(--tap); height: var(--tap); min-width: var(--tap); min-height: var(--tap); padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
#toolMenu .translate-tooltip {
  position: static; transform: none; width: 100%; max-width: none; margin: var(--sp-2) 0 0; box-sizing: border-box;
  left: auto; right: auto; top: auto; bottom: auto;
}
#toolMenu .translate-tooltip::before, #toolMenu .translate-tooltip::after { display: none; }
#toolMenu #toolTierBadge {
  background: none; border: 0; padding: 0; margin: 0; box-shadow: none;
  color: var(--text); font: 600 var(--fs-16)/1.4 var(--font-body); text-transform: none; letter-spacing: normal;
}
.ui-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── App bar: Today · Tools · Progress · Profile (built by shell.js; UX 2 PR 1) ────────────
      Same markup at every size; only this CSS decides where it sits. < 1024 px: fixed bottom bar.
      ≥ 1024 px: a fixed left menu (UX 3 PR 1): Today · Tools · Progress at the top, Profile at the bottom; the page
      shifts right by --app-menu-w (body padding), so every in-flow header and column moves as one.
      z-index 90: under every sheet, pop-up and backdrop (≥ 500) and under sticky headers (100). */
.ui-app-bar[hidden] { display: none !important; }
.ui-app-bar {
  display: flex; align-items: stretch; box-sizing: border-box; z-index: 90;
  background: var(--surface); border-top: 1px solid var(--line);
}
.ui-app-bar__item {
  flex: 1 1 0; min-width: 0; min-height: var(--tap);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: var(--sp-1) var(--sp-1); color: var(--text-2); text-decoration: none; text-align: center;
  font: 500 max(12px, var(--fs-12))/1.2 var(--font-body); -webkit-tap-highlight-color: transparent;
}
.ui-app-bar__icon { font-size: max(20px, 1.25rem); line-height: 1; }
.ui-app-bar__item:hover { color: var(--text); }
.ui-app-bar__item[aria-current="page"] { color: var(--accent); font-weight: 600; }
.ui-app-bar__item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 1023.98px) {
  .ui-app-bar {
    position: fixed; left: 0; right: 0; bottom: 0; min-height: 56px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  body.has-app-bar { --app-bar-h: calc(56px + env(safe-area-inset-bottom, 0px)); }
  body.has-app-bar::after { content: ''; display: block; height: var(--app-bar-h); }   /* last content never hidden */
}
@media (min-width: 1024px) {
  body.has-app-bar { --app-menu-w: 200px; padding-left: var(--app-menu-w); }
  .ui-app-bar {
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--app-menu-w);
    flex-direction: column; justify-content: flex-start; gap: var(--sp-1);
    padding: var(--sp-4) var(--sp-2); border-top: 0; border-right: 1px solid var(--line);
    overflow-y: auto;
  }
  .ui-app-bar__item {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: var(--sp-3);
    min-height: 48px; padding: 0 var(--sp-3); border-radius: var(--radius); text-align: left;
    font-size: var(--fs-14); border-left: 3px solid transparent;
  }
  .ui-app-bar__icon { font-size: var(--fs-16); width: 1.5em; text-align: center; }
  .ui-app-bar__item:hover { background: var(--raised); }
  .ui-app-bar__item[aria-current="page"] { border-left-color: var(--accent); background: var(--raised); }
  .ui-app-bar__item[data-place="profile"] { margin-top: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .ui-btn, .ui-sheet, .ui-sheet-backdrop, .ui-toast { transition: none; }
}

/* ── UX 9: filter chips (Mine / Goals / Household), fold header (one goal), floating add button ──
      Used by the To-Do List and the Habit Tracker. A chip that is on carries a tick, so colour is never the only cue. ── */
.ui-filter { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ui-filter[hidden] { display: none; }
.ui-filter__opt {
  flex: 1 1 0; min-width: 6.5rem; min-height: var(--tap); padding: 0 var(--sp-3); box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--muted); font: 500 var(--fs-14)/1.2 var(--font-body); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ui-filter__opt[aria-pressed="true"] { background: var(--raised); color: var(--text); border-color: var(--text-2); font-weight: 600; }
.ui-filter__opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ui-filter__ck { display: inline-block; width: 14px; text-align: center; }

.ui-fold {
  display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: 48px; margin: var(--sp-3) 0 var(--sp-2); padding: 0 var(--sp-3); box-sizing: border-box;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); font: 600 var(--fs-14)/1.25 var(--font-body); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ui-fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ui-fold__title { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.ui-fold__count { flex: none; font-weight: 400; font-size: var(--fs-12); color: var(--text-2); }
.ui-fold__chev { flex: none; width: 18px; text-align: center; color: var(--text-2); font-size: var(--fs-18); transition: transform .2s; }
.ui-fold[aria-expanded="true"] .ui-fold__chev { transform: rotate(90deg); }
.ui-fold-all { display: flex; align-items: center; justify-content: space-between; margin: var(--sp-3) 0 calc(-1 * var(--sp-2)); font: 600 var(--fs-14)/1.3 var(--font-body); color: var(--text-2); }
.ui-fold-all button { min-height: var(--tap); padding: 0 var(--sp-1); background: none; border: 0; color: var(--text-2); font: 500 var(--fs-14)/1.2 var(--font-body); text-decoration: underline; cursor: pointer; }

.ui-fab {
  position: fixed; right: var(--sp-4); bottom: calc(var(--sp-4) + var(--app-bar-h)); z-index: 140;
  display: flex; align-items: center; gap: var(--sp-2); min-height: 56px; padding: 0 var(--sp-5) 0 var(--sp-4);
  background: var(--accent); color: var(--on-accent); border: 0; border-radius: 28px; box-shadow: var(--shadow);
  font: 600 var(--fs-16)/1 var(--font-body); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ui-fab__plus { font-size: var(--fs-22); line-height: 1; }
.ui-fab:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
body.ui-sheet-open .ui-fab, .ui-fab[hidden] { display: none; }
@media (min-width: 1024px) { .ui-fab { right: var(--sp-5); } }
@media (prefers-reduced-motion: reduce) { .ui-fold__chev { transition: none; } }
