/* Tour Guide: tokens, base and UI kit, on Asuma UI.
 *
 * Asuma UI is the design system of the customer portal (asuma-client,
 * app/assets/ds/tokens.css and app/components/ds). The `--a-*` tokens below carry its
 * names and values unchanged, so the two apps read as one product. The kit classes
 * (`.btn`, `.field`, `.a-*`) are its components redone without Vue; public/core/ui.mjs
 * builds them. Rules for screen builders: docs/UI.md.
 *
 * The older `--ui-*` names stay defined as aliases onto the `--a-*` values.
 * Light is the default. Dark is a stored choice: the `dark` class on <html>.
 */

/* Unageo (SIL Open Font License 1.1, see fonts/LICENSE). One variable file, upright only:
   the italic would add 55 KB to the shell and nothing here is set in italic. */
@font-face {
  font-family: "Unageo";
  src: url("fonts/unageo.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- tokens ---------------------------------------------------------------------- */

:root {
  --a-ink: #12151b;
  --a-ink-2: #3a404a;
  --a-muted: #5a606b;
  --a-line: #e4e6ea;
  --a-line-2: #cdd1d7;
  --a-ground: #ffffff;
  --a-layer: #f4f5f7;
  --a-layer-2: #eceef1;
  --a-track: #c5cad2;
  --a-edge: #8a8e94; /* the edge of a control: 3:1 on ground and layer */

  --a-azure: #305cb0; /* brand, links, selection, focus */
  --a-azure-hover: #274a8d;
  --a-azure-ink: #1d376a;
  --a-azure-tint: #eef2fb;
  --a-azure-text: #305cb0;
  --a-saffron: #ed780d; /* only actions that move money; text on it is --a-on-pay */
  --a-saffron-hover: #f08a2c;
  --a-saffron-text: #b35407;
  --a-saffron-tint: #fff3e6;
  --a-coin: #b7791f; /* coins only: the gold of the coin mark, readable on the ground and on a layer */
  --a-paid: #1f7a4d; /* only money received */
  --a-paid-tint: #e7f4ed;
  --a-danger: #c0392b;
  --a-danger-tint: #fbeceb;
  --a-trip: #306fbf;
  --a-trip-tint: #e9f1fb;
  --a-on-fill: #ffffff;
  --a-on-pay: #12151b; /* dark in both modes: light text on saffron fails AA */
  /* Tag text: a shade past the tone, to keep 5:1 on the tag's own fill. */
  --a-tag-paid: #155a38;
  --a-tag-due: #8a4204;
  --a-tag-danger: #962a1f;

  --a-glass: rgba(255, 255, 255, 0.74);
  --a-glass-bar: rgba(255, 255, 255, 0.94);
  --a-glass-dark: rgba(18, 21, 27, 0.42);
  --a-blur: blur(22px) saturate(170%);
  --a-shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 10px 30px -14px rgba(16, 24, 40, 0.28);
  --a-shadow-float: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 14px 34px -14px rgba(16, 24, 40, 0.4);

  /* Space. Compact (owner, 2026-12-04: "Make the ui compact"): the names keep the Fibonacci
     step they started as, the values are tighter, and tighter again on 2026-12-05 ("Make the ui more compact"):
     5 is 4, 8 is 6, 13 is 8, 21 is 12, 34 is 18, 55 is 30, 89 is 48. Text fields stay 16px
     (an iPhone zooms the page on anything smaller). Touch rows are 40px. */
  --a-s-2: 2px;
  --a-s-3: 3px;
  --a-s-5: 4px;
  --a-s-8: 6px;
  --a-s-13: 8px;
  --a-s-21: 12px;
  --a-s-34: 18px;
  --a-s-55: 30px;
  --a-s-89: 48px;

  /* Radius: a card (21) holding an 8 gap nests a 13 corner. */
  --a-r-xs: 5px;
  --a-r-sm: 8px;
  --a-r-md: 8px;
  --a-r-lg: 8px;
  --a-r-card: 12px;
  --a-r-card-inner: 8px;
  --a-r-sheet: 18px;
  --a-r-pill: 999px;

  --a-font: "Unageo", system-ui, -apple-system, sans-serif;

  /* Type. 12 tags and counts, 13 supporting text, 14 controls and body, 16 section
     heads and text fields, 18 titles, 23 and up the one figure that matters. */
  --a-fs-xs: 11px;
  --a-fs-sm: 12px;
  --a-fs-md: 13px;
  --a-fs-body: 13px;
  --a-fs-h3: 14px;
  --a-fs-input: 16px;
  --a-fs-h2: 16px;
  --a-fs-h1: 18px;
  --a-fs-display: 21px;
  --a-fs-hero: 24px;

  /* Weight. 700 only at 18px and up. */
  --a-fw-regular: 400;
  --a-fw-medium: 500;
  --a-fw-semibold: 600;
  --a-fw-bold: 700;

  /* Control heights. 44 is the touch minimum. */
  --a-h-sm: 30px;
  --a-h-md: 40px;
  --a-h-lg: 44px;
  --a-hit: 40px;
  --a-page-w: 1128px;

  --a-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --a-spring: cubic-bezier(0.34, 1.36, 0.64, 1);
  --a-dur-fast: 160ms;
  --a-dur: 260ms;
  --a-dur-slow: 480ms;
  --a-focus: 0 0 0 3px var(--a-ground), 0 0 0 5px var(--a-azure);
  --a-focus-field: inset 0 0 0 1.5px var(--a-azure);

  /* This app's own: the header's height and the room the phone tab bar takes.
     A screen with its own sticky row sits at `top: var(--top-h)`. */
  --top-h: 55px;
  --nav-h: 78px;
  /* The menu: its width open, its width folded to icons, and `--side-w`, the room it
     takes beside the page right now (nothing below 1024 px, where it lies over the page). */
  --drawer-w: 264px;
  --rail-w: 68px;
  --side-w: 0px;
  --a-scrim: rgba(10, 12, 16, 0.45);

  /* The older names, kept for screens written against them. */
  --ui-font: var(--a-font);
  --ui-ink: var(--a-ink);
  --ui-ink-2: var(--a-ink-2);
  --ui-ink-3: var(--a-muted);
  --ui-ink-4: var(--a-muted);
  --ui-ink-rgb: 18, 21, 27;
  --ui-accent-rgb: 48, 92, 176;
  --ui-shadow-rgb: 16, 24, 40;
  --ui-on-role: #ffffff;
  --ui-bg: var(--a-ground);
  --ui-bg-sunken: var(--a-layer);
  --ui-bg-raised: var(--a-ground);
  --ui-bg-hover: var(--a-layer);
  --ui-bg-active: var(--a-layer-2);
  --ui-line: var(--a-line);
  --ui-line-strong: var(--a-line-2);
  --ui-accent: var(--a-azure);
  --ui-accent-ink: var(--a-azure-text);
  --ui-success: var(--a-paid);
  --ui-warning: var(--a-saffron-text);
  --ui-danger: var(--a-danger);
  --ui-info: var(--a-azure-text);
  --ui-wash: 0.09;
  --ui-wash-soft: 0.045;
  --ui-r-sm: var(--a-r-xs);
  --ui-r: var(--a-r-sm);
  --ui-r-ctl: var(--a-r-md);
  --ui-r-lg: var(--a-r-md);
  --ui-r-sheet: var(--a-r-sheet);
  --ui-r-pill: var(--a-r-pill);
  --ui-s1: var(--a-s-5);
  --ui-s2: var(--a-s-8);
  --ui-s3: var(--a-s-13);
  --ui-s4: var(--a-s-13);
  --ui-s5: var(--a-s-21);
  --ui-s6: var(--a-s-34);
  --ui-h-sm: var(--a-h-sm);
  --ui-h: var(--a-h-md);
  --ui-h-lg: var(--a-h-lg);
  --ui-fs-xs: var(--a-fs-xs);
  --ui-fs-sm: var(--a-fs-sm);
  --ui-fs: var(--a-fs-body);
  --ui-fs-md: var(--a-fs-h3);
  --ui-fs-lg: var(--a-fs-h2);
  --ui-fs-xl: var(--a-fs-h1);
  --ui-fs-2xl: var(--a-fs-display);
  --ui-fw-med: var(--a-fw-medium);
  --ui-fw-bold: var(--a-fw-semibold);
  --ui-pop: var(--a-shadow-float);
  --ui-t: var(--a-dur-fast);
  --ui-ease: var(--a-ease-out);
  --ui-focus: var(--a-focus);
}

html.dark {
  --a-ink: #f2f3f5;
  --a-ink-2: #d3d6dc;
  --a-muted: #a3a9b4;
  --a-line: #2b2f37;
  --a-line-2: #3a3f49;
  --a-ground: #121417;
  --a-layer: #1b1e23;
  --a-layer-2: #252930;
  --a-track: #454c57;
  --a-edge: #656971;

  --a-azure: #3d6cc4;
  --a-azure-hover: #4a78cf;
  --a-azure-text: #7fa6e8;
  --a-azure-ink: #c5d6f5;
  --a-azure-tint: #1b2740;
  --a-saffron-text: #f5a25a;
  --a-saffron-tint: #33230f;
  --a-coin: #f0c36a;
  --a-paid: #5cc08c;
  --a-paid-tint: #14291f;
  --a-danger: #f07a6e;
  --a-danger-tint: #33191a;
  --a-trip: #3a6fb8;
  --a-trip-tint: #1a2638;
  --a-tag-paid: #8fdcb2;
  --a-tag-due: #f5a25a;
  --a-tag-danger: #f7a59c;

  --a-glass: rgba(27, 30, 35, 0.72);
  --a-glass-bar: rgba(27, 30, 35, 0.94);
  --a-shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  --a-shadow-float: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 14px 34px -14px rgba(0, 0, 0, 0.8);

  /* The older accent was a light blue with dark text on it in dark mode; keep that
     pairing, so a `--ui-accent` fill with `--ui-on-role` text still passes AA. */
  --ui-ink-rgb: 242, 243, 245;
  --ui-accent-rgb: 127, 166, 232;
  --ui-shadow-rgb: 0, 0, 0;
  --ui-on-role: #12151b;
  --ui-accent: var(--a-azure-text);
  --ui-bg-raised: var(--a-layer);
  --ui-wash: 0.16;
  --ui-wash-soft: 0.09;
}

/* Reduced motion keeps the feedback, drops the travel. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --a-spring: linear;
    --a-dur-fast: 1ms;
    --a-dur: 1ms;
    --a-dur-slow: 1ms;
  }
}

/* --- reset (asuma-client app/assets/ds/reset.css) ------------------------------------ */

*, ::before, ::after, ::backdrop, ::file-selector-button { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
html { line-height: 1.4; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; tab-size: 4; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
small { font-size: 80%; }
code, kbd, samp, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1em; }
ol, ul, menu { list-style: none; }
table { border-collapse: collapse; border-color: inherit; text-indent: 0; }
hr { height: 0; color: inherit; border-top-width: 1px; }
img, svg, video, canvas, audio, iframe, embed, object { display: block; vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
button, input, select, optgroup, textarea, ::file-selector-button {
  font: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  letter-spacing: inherit;
  color: inherit;
  border-radius: 0;
  background-color: transparent;
  opacity: 1;
}
button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button { -webkit-appearance: button; appearance: button; }
button, [role="button"] { cursor: pointer; }
::placeholder { opacity: 1; color: var(--a-muted); }
textarea { resize: vertical; }
summary { display: list-item; }
::-webkit-search-decoration { -webkit-appearance: none; }
::-webkit-inner-spin-button, ::-webkit-outer-spin-button { height: auto; }
:-moz-ui-invalid { box-shadow: none; }
[hidden]:where(:not([hidden="until-found"])) { display: none !important; }

/* --- base ---------------------------------------------------------------------------- */

/* Native controls, the caret and scrollbars follow this app's mode, not the phone's. */
html { color-scheme: light; background: var(--a-ground); color: var(--a-ink); font-family: var(--a-font); -webkit-tap-highlight-color: transparent; }
html.dark { color-scheme: dark; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-size: var(--a-fs-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none; /* Y only: the X axis is the browser's swipe back */
  touch-action: manipulation; /* no double-tap zoom, no 300ms tap delay; pinch still works */
}
b, strong { font-weight: var(--a-fw-semibold); }
/* A bare heading still reads as one. Zero specificity: any class wins. */
:where(h1) { font-size: var(--a-fs-h1); font-weight: var(--a-fw-bold); line-height: 1.2; letter-spacing: -0.01em; }
:where(h2) { font-size: var(--a-fs-h2); font-weight: var(--a-fw-bold); line-height: 1.3; letter-spacing: -0.01em; }
:where(h3) { font-size: var(--a-fs-h3); font-weight: var(--a-fw-semibold); line-height: 1.3; }
:where(.screen a:not([class])) { color: var(--a-azure-text); font-weight: var(--a-fw-semibold); }
:focus { outline: none; }
:where(a, button, summary, [tabindex]):focus-visible { box-shadow: var(--a-focus); border-radius: var(--a-r-xs); }
/* Like a native app: a long press on a link or button shows no preview. Text on the
   page stays selectable, because guides copy phone numbers and booking codes. */
@media (hover: none) and (pointer: coarse) {
  a, a *, button, button *, [role="button"], [role="button"] * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.noscript { padding: var(--a-s-21); }
/* Icons: 24 grid, 1.75 round stroke, drawn on the client's rules (see index.html). */
.icon { display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.muted, .faint { color: var(--a-muted); }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Coins: the mark in gold before the number (ui.mjs `coins`). Never the word. */
.a-coins { display: inline-flex; align-items: center; gap: var(--a-s-2); white-space: nowrap; font-variant-numeric: tabular-nums; vertical-align: bottom; }
.a-coins__mark { flex: none; color: var(--a-coin); fill: color-mix(in srgb, var(--a-coin) 20%, transparent); }
/* Expands a small control's tap area to 44 without changing how big it looks. */
.a-hit { position: relative; }
.a-hit::after {
  content: "";
  position: absolute;
  top: min(0px, calc((100% - var(--a-hit)) / 2));
  bottom: min(0px, calc((100% - var(--a-hit)) / 2));
  left: min(0px, calc((100% - var(--a-hit)) / 2));
  right: min(0px, calc((100% - var(--a-hit)) / 2));
}

@keyframes a-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes a-fade { from { opacity: 0; } }
@keyframes a-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@keyframes a-spin { to { transform: rotate(360deg); } }
@keyframes a-nudge { 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }

/* --- layout -------------------------------------------------------------------------- */

#app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
#screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--a-s-13) var(--a-s-13) calc(var(--nav-h) + var(--a-s-34) + env(safe-area-inset-bottom));
}
body[data-nav="off"] #screen { padding-top: calc(var(--a-s-13) + env(safe-area-inset-top)); padding-bottom: calc(var(--a-s-21) + env(safe-area-inset-bottom)); }
/* One column, phone first. `screen--wide` takes the page width on a big screen. */
.screen { display: flex; flex-direction: column; gap: var(--a-s-21); width: 100%; max-width: 640px; margin: 0 auto; flex: 1 0 auto; }
.screen--wide { max-width: var(--a-page-w); }
.stack { display: flex; flex-direction: column; gap: var(--a-s-13); }
.row { display: flex; align-items: center; gap: var(--a-s-13); min-width: 0; }
.row > .grow, .grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A screen's title block and a section inside it. */
.a-title { font-size: var(--a-fs-h1); font-weight: var(--a-fw-bold); line-height: 1.2; letter-spacing: -0.02em; }
.a-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--a-s-13); min-width: 0; }
.a-section__h { font-size: var(--a-fs-h3); font-weight: var(--a-fw-semibold); letter-spacing: -0.01em; }
/* Rows that belong together, inside one hairline box. */
.a-group { padding: 0 var(--a-s-13); border-radius: var(--a-r-card); box-shadow: inset 0 0 0 1px var(--a-line); }

@media (min-width: 768px) {
  :root { --top-h: 68px; --nav-h: 0px; }
  #screen { padding: var(--a-s-34) var(--a-s-21) var(--a-s-55); }
}

/* --- header and navigation --------------------------------------------------------------
   The client's frame: a glass bar on top with the brand, and on phones a floating tab
   bar in the thumb's row. From 768 the same links move up into the header. The raised
   camera button is this app's own: recording an expense is the thing done most. */

.top { position: sticky; top: 0; z-index: 60; flex: none; padding-top: env(safe-area-inset-top); border-bottom: 1px solid transparent; transition: border-color var(--a-dur) var(--a-ease-out), box-shadow var(--a-dur) var(--a-ease-out); }
/* The glass is a layer of its own: a filter on the bar itself would trap the fixed tab bar inside it. */
.top::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--a-glass); -webkit-backdrop-filter: var(--a-blur); backdrop-filter: var(--a-blur); }
.top.is-scrolled { border-bottom-color: var(--a-line); box-shadow: 0 8px 24px -20px rgba(16, 24, 40, 0.5); }
.top__bar { display: flex; align-items: center; gap: var(--a-s-8); max-width: var(--a-page-w); height: var(--top-h); margin: 0 auto; padding: 0 var(--a-s-13); }
.top__brand { display: inline-flex; align-items: center; gap: var(--a-s-8); flex: none; padding: var(--a-s-5); margin-left: calc(var(--a-s-5) * -1); border-radius: var(--a-r-sm); font-size: var(--a-fs-h3); font-weight: var(--a-fw-semibold); letter-spacing: -0.01em; color: var(--a-ink); }
.top__mark { width: var(--a-h-sm); height: var(--a-h-sm); border-radius: var(--a-r-sm); }
.top__spacer { flex: 1; }
.top__menu { display: inline-grid; place-items: center; flex: none; width: var(--a-hit); height: var(--a-hit); margin-left: calc(var(--a-s-8) * -1); border-radius: var(--a-r-pill); color: var(--a-ink); transition: background-color var(--a-dur-fast); }
.top__menu:focus-visible { border-radius: var(--a-r-pill); }
.top__menu:active { background: var(--a-layer-2); }
@media (hover: hover) { .top__menu:hover { background: var(--a-layer); } }
/* The person's own picture beside the bell, at every width: it opens the profile dialog. The name joins it from 768. */
.top__acct { display: inline-flex; align-items: center; justify-content: center; gap: var(--a-s-8); flex: none; min-width: var(--a-hit); height: var(--a-hit); padding: 0 var(--a-s-2); margin-right: calc(var(--a-s-5) * -1); border-radius: var(--a-r-pill); font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); color: var(--a-ink); transition: background-color var(--a-dur-fast); }
.top__acct[hidden] { display: none; }
.top__acct:active, .top__acct[aria-current="page"] { background: var(--a-layer); }
.top__acct:focus-visible, .top__brand:focus-visible { border-radius: var(--a-r-pill); }
.top__acct-name { display: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The picture wearing the level (asuma-app components/performance/LevelAvatar.vue): a ring that
   fills with the progress to the next level, and the level's number on a badge. Without a level
   the ring is clear and takes the same room, so nothing moves when the level arrives. */
.lvav { position: relative; display: inline-block; flex: none; line-height: 0; }
.lvav__ring { display: block; padding: var(--a-s-2); border-radius: 50%; }
.lvav.has-level .lvav__ring { background: conic-gradient(var(--a-azure-text) var(--lv, 6deg), var(--a-line-2) 0deg); }
.lvav__inner { display: block; padding: var(--a-s-2); border-radius: 50%; background: var(--lvav-bg, var(--a-ground)); }
.lvav .a-av { overflow: hidden; }
.lvav__img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.lvav__lvl { position: absolute; right: calc(var(--a-s-3) * -1); bottom: calc(var(--a-s-2) * -1); display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 var(--a-s-3); border-radius: var(--a-r-pill); background: var(--a-azure); color: var(--a-on-fill); font-size: 11px; font-weight: var(--a-fw-semibold); line-height: 1; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--lvav-bg, var(--a-ground)); }
.lvav--sm .a-av { width: var(--a-h-sm); height: var(--a-h-sm); }
@media (hover: hover) { .top__acct:hover { background: var(--a-layer); } }
/* Pull to refresh (screens/settings/pull.mjs): the mark that follows the finger down from under the header. */
.pull { position: fixed; top: calc(env(safe-area-inset-top) + var(--top-h, 56px)); left: 50%; z-index: 55; display: grid; place-items: center; width: var(--a-h-sm); height: var(--a-h-sm); border-radius: var(--a-r-pill); background: var(--a-ground); color: var(--a-muted); box-shadow: var(--a-shadow-lift); opacity: 0; transform: translate(-50%, -48px); transition: transform var(--a-dur) var(--a-ease-out), opacity var(--a-dur) var(--a-ease-out); pointer-events: none; }
.pull.is-ready { color: var(--a-azure-text); }
.pull.is-busy { opacity: 1 !important; transform: translate(-50%, 13px) !important; }
.pull.is-busy .icon { animation: pull-spin 0.8s linear infinite; }
@keyframes pull-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pull.is-busy .icon { animation: none; } }
html { overscroll-behavior-y: contain; }
.top__bell { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--a-hit); height: var(--a-hit); border-radius: var(--a-r-pill); color: var(--a-ink); }
.top__bell[hidden] { display: none; }
.top__bell:focus-visible { border-radius: var(--a-r-pill); }
.top__bell:active, .top__bell[aria-current="page"] { background: var(--a-layer); }
.top__bell-count { position: absolute; top: var(--a-s-3); right: var(--a-s-2); min-width: 18px; height: 18px; padding: 0 var(--a-s-3); border-radius: var(--a-r-pill); background: var(--a-danger); color: var(--a-on-fill); font-size: 11px; font-weight: var(--a-fw-bold); line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--a-ground); }
.top__bell-count[hidden] { display: none; }
@media (hover: hover) { .top__bell:hover { background: var(--a-layer); } }

.nav {
  position: fixed;
  left: 50%;
  bottom: calc(var(--a-s-13) + env(safe-area-inset-bottom));
  z-index: 50;
  transform: translateX(-50%);
  width: min(calc(100% - var(--a-h-sm)), 400px);
  padding: var(--a-s-5);
  border-radius: var(--a-r-pill);
  /* The bar token, not plain glass: text scrolling underneath showed through the labels. */
  background: var(--a-glass-bar);
  -webkit-backdrop-filter: var(--a-blur);
  backdrop-filter: var(--a-blur);
  box-shadow: var(--a-shadow-float);
}
/* The office space (Manage): a dark bar and a tag by the brand, so nobody mistakes the
   team's records for their own pages. Two links: back to your own work, and the guides. */
.top__space { flex: none; height: 26px; padding: 0 var(--a-s-8); border-radius: var(--a-r-pill); background: var(--a-ink); color: var(--a-ground); font-size: var(--a-fs-xs); font-weight: var(--a-fw-semibold); line-height: 26px; }
.top__space[hidden] { display: none; }
.nav--office, html.dark .nav--office { background: var(--a-ink); }
.nav--office .nav__bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nav--office .nav__item, html.dark .nav--office .nav__item { color: var(--a-ground); opacity: 0.72; }
.nav--office .nav__item[aria-current="page"], html.dark .nav--office .nav__item[aria-current="page"] { background: color-mix(in srgb, var(--a-ground) 16%, transparent); color: var(--a-ground); opacity: 1; }

/* Dark: a near-solid raised surface with a light edge, or the bar sinks into the page. */
html.dark .nav { background: #262a32; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 14px 34px -10px rgba(0, 0, 0, 0.7); }
.nav__bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; }
.nav__item {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  /* The bottom bar keeps its own, larger sizes: it is the one thing pressed all day, with a
     thumb (owner, 2026-12-05: "Footer maintain and can be bigger in mobile"). */
  height: 56px;
  border-radius: var(--a-r-pill);
  font-size: 12px;
  font-weight: var(--a-fw-semibold);
  color: var(--a-ink-2);
  transition: color var(--a-dur), background-color var(--a-dur);
}
.nav__item .icon { width: 24px; height: 24px; transition: transform var(--a-dur) var(--a-spring); }
.nav__item:active .icon { transform: scale(0.88); }
.nav__item[aria-current="page"], .nav__item.is-lit { background: var(--a-azure-tint); color: var(--a-azure-ink); }
html.dark .nav__item { color: #c2c7d0; }
html.dark .nav__item[aria-current="page"], html.dark .nav__item.is-lit { background: rgba(120, 160, 230, 0.24); color: #ffffff; }
/* More is a button (it opens the menu): it fills its slot the way the links do. */
button.nav__item { width: 100%; }
.nav__item:focus-visible, .nav__fab:focus-visible { border-radius: var(--a-r-pill); }
.nav__slot { display: flex; justify-content: center; min-width: 0; }
.nav__fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--a-s-8);
  width: 60px;
  height: 60px;
  margin-top: -18px;
  border-radius: var(--a-r-pill);
  background: var(--a-azure);
  color: var(--a-on-fill);
  font-size: var(--a-fs-sm);
  font-weight: var(--a-fw-semibold);
  box-shadow: 0 0 0 3px var(--a-ground), 0 10px 21px -8px rgba(16, 24, 40, 0.55);
  transition: transform var(--a-dur) var(--a-spring), background-color var(--a-dur-fast) var(--a-ease-out);
}
html.dark .nav__fab { box-shadow: 0 0 0 3px #262a32, 0 10px 21px -8px rgba(0, 0, 0, 0.8); }
.nav__fab:active { transform: scale(0.94); transition-duration: 80ms; }
.nav__fab:focus-visible { box-shadow: var(--a-focus); }
.nav__fab .icon { width: 26px; height: 26px; }
.nav__fab-label { display: none; }
@media (hover: hover) { .nav__fab:hover { background: var(--a-azure-hover); } }

@media (min-width: 768px) {
  .top__bar { padding: 0 var(--a-s-21); }
  .top__mark { width: var(--a-h-md); height: var(--a-h-md); }
  .top__acct { padding: 0 var(--a-s-13) 0 var(--a-s-3); margin-right: 0; }
  .top__acct-name { display: block; }
  .top__spacer { display: none; }
  .nav, html.dark .nav { position: static; transform: none; width: auto; margin-left: var(--a-s-13); padding: 0; border-radius: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; flex: 1; }
  .nav__bar { display: flex; align-items: center; gap: var(--a-s-2); }
  .nav__item, html.dark .nav__item { display: inline-flex; align-items: center; height: var(--a-h-sm); padding: 0 var(--a-s-13); font-size: var(--a-fs-sm); color: var(--a-muted); }
  .nav__item .icon { display: none; }
  /* The menu button in the header does More's job here. After the rule above, or that one wins. */
  .nav__slot:empty, html .nav .nav__item--more { display: none; }
  .nav__item[aria-current="page"], html.dark .nav__item[aria-current="page"] { background: var(--a-layer-2); color: var(--a-ink); }
  .nav__slot--camera { order: 9; margin-left: auto; }
  .nav__fab, html.dark .nav__fab { width: auto; height: var(--a-h-sm); margin: 0; padding: 0 var(--a-s-13); box-shadow: none; }
  .nav__fab:focus-visible, html.dark .nav__fab:focus-visible { box-shadow: var(--a-focus); }
  .nav__fab .icon { width: 17px; height: 17px; }
  .nav__fab-label { display: inline; }
  @media (hover: hover) { .nav__item:not([aria-current="page"]):hover { color: var(--a-ink); } }
}

/* --- the menu: a drawer over the page, a sidebar from 1024 ---------------------------------
   Behaviour after asuma-app's: who you are, every place you may open in groups, the device's
   own settings and the way out. Below 1024 it slides in from the left over a scrim; from
   1024 it is always there beside the page, and folds to a rail of icons (`html.rail`). */

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(var(--drawer-w), calc(100% - var(--a-s-55)));
  box-sizing: content-box;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--a-ground);
  color: var(--a-ink);
  box-shadow: var(--a-shadow-float);
  /* Closed, it is off the page and out of the tab order. */
  visibility: hidden;
  transform: translateX(-105%);
  transition: transform var(--a-dur) var(--a-ease-out), visibility 0s linear var(--a-dur);
}
html.dark .drawer { background: var(--a-layer); }
.drawer:focus-visible { box-shadow: var(--a-shadow-float); border-radius: 0; }
body[data-drawer="open"] .drawer { visibility: visible; transform: none; transition: transform var(--a-dur-slow) var(--a-ease-out), visibility 0s; }
.drawer-scrim { position: fixed; inset: 0; z-index: 89; background: var(--a-scrim); opacity: 0; pointer-events: none; touch-action: none; transition: opacity var(--a-dur) var(--a-ease-out); }
body[data-drawer="open"] .drawer-scrim { opacity: 1; pointer-events: auto; }

/* Who is signed in and how they are doing (asuma-app components/nav/XpWidget.vue): the picture
   wearing the level, the name, the level's title and the role, the bar to the next level, XP and
   coins. One button: it opens the profile dialog. */
.drawer__who { flex: none; display: flex; align-items: flex-start; gap: var(--a-s-3); min-height: var(--top-h); padding: var(--a-s-8); }
.drawer__me { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--a-s-13); min-height: var(--a-hit); padding: var(--a-s-8) var(--a-s-8) var(--a-s-8) var(--a-s-13); border-radius: var(--a-r-md); color: var(--a-ink); text-align: left; transition: background-color var(--a-dur-fast); }
.drawer__me:active { background: var(--a-layer-2); }
.drawer__me:focus-visible { border-radius: var(--a-r-md); }
html.dark .drawer { --lvav-bg: var(--a-layer); }
.drawer__id { flex: 1; min-width: 0; display: grid; gap: var(--a-s-2); }
.drawer__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--a-fs-h3); font-weight: var(--a-fw-semibold); letter-spacing: -0.01em; line-height: 1.3; }
.drawer__mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--a-fs-sm); line-height: 1.4; color: var(--a-muted); }
.drawer__bar { display: block; height: var(--a-s-3); margin-top: var(--a-s-3); border-radius: var(--a-r-pill); background: var(--a-line-2); overflow: hidden; }
.drawer__fill { display: block; height: 100%; border-radius: inherit; background: var(--a-azure-text); }
.drawer__xp { display: flex; align-items: center; gap: var(--a-s-8); min-width: 0; font-size: var(--a-fs-xs); line-height: 1.5; color: var(--a-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.drawer__xp-n { color: var(--a-ink-2); font-weight: var(--a-fw-semibold); }
.drawer__next { margin-left: auto; overflow: hidden; text-overflow: ellipsis; }
.drawer__nav { flex: none; }
.drawer__foot { flex: none; margin-top: auto; }
.drawer__group { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--a-s-2); padding: var(--a-s-8); border-top: 1px solid var(--a-line); }
.drawer__h { padding: var(--a-s-5) var(--a-s-13) var(--a-s-3); font-size: var(--a-fs-xs); font-weight: var(--a-fw-semibold); line-height: 1.5; color: var(--a-muted); white-space: nowrap; }
.drawer__group.is-active > .drawer__h { color: var(--a-ink); }
.drawer__row { display: flex; align-items: center; gap: var(--a-s-13); width: 100%; min-height: var(--a-hit); padding: 0 var(--a-s-13); border-radius: var(--a-r-md); font-size: var(--a-fs-md); font-weight: var(--a-fw-medium); color: var(--a-ink-2); text-align: left; transition: background-color var(--a-dur-fast), color var(--a-dur-fast); }
.drawer__row .icon { width: 20px; height: 20px; color: var(--a-muted); }
.drawer__row:focus-visible { border-radius: var(--a-r-md); }
.drawer__row:active { background: var(--a-layer-2); }
.drawer__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer__row[aria-current="page"] { background: var(--a-azure-tint); color: var(--a-azure-ink); font-weight: var(--a-fw-semibold); }
.drawer__row[aria-current="page"] .icon { color: var(--a-azure-text); }
html.dark .drawer__row[aria-current="page"] { background: color-mix(in srgb, var(--a-azure-text) 22%, transparent); }
/* The office wears the same ink as its tag in the header: it is not the person's own work. */
.drawer__group--office .drawer__row[aria-current="page"], html.dark .drawer__group--office .drawer__row[aria-current="page"] { background: var(--a-ink); color: var(--a-ground); }
.drawer__group--office .drawer__row[aria-current="page"] .icon { color: var(--a-ground); }
.drawer__row--danger, .drawer__row--danger .icon { color: var(--a-danger); }
.drawer__row--danger:active { background: var(--a-danger-tint); }
.drawer__count { display: inline-flex; flex: none; }
.drawer__look { padding: var(--a-s-5) var(--a-s-5) var(--a-s-8); }
.drawer__flip { display: none; }
@media (hover: hover) {
  .drawer__row:not([aria-current="page"]):hover, .drawer__me:hover { background: var(--a-layer); color: var(--a-ink); }
  html.dark .drawer__row:not([aria-current="page"]):hover, html.dark .drawer__me:hover { background: var(--a-layer-2); }
  .drawer__row--danger:hover, html.dark .drawer__row--danger:hover { background: var(--a-danger-tint); color: var(--a-danger); }
}

@media (min-width: 1024px) {
  body[data-nav="on"] { --side-w: var(--drawer-w); }
  html.rail body[data-nav="on"] { --side-w: var(--rail-w); }
  /* The page keeps its own width and sits in what is left beside the menu. */
  #screen { padding-left: calc(var(--side-w) + var(--a-s-21)); }
  .top__bar { max-width: none; padding: 0 var(--a-s-21) 0 var(--a-s-13); }
  .top__menu { margin-left: 0; }
  /* The sidebar carries the links; the header keeps the brand, Record and the account. */
  html .nav .nav__item, .nav__slot:not(.nav__slot--camera) { display: none; }
  .drawer, html.dark .drawer, body[data-drawer="open"] .drawer {
    top: calc(var(--top-h) + env(safe-area-inset-top));
    z-index: 55;
    width: var(--side-w);
    box-sizing: border-box;
    padding-top: 0;
    background: var(--a-ground);
    border-right: 1px solid var(--a-line);
    box-shadow: none;
    visibility: visible;
    transform: none;
    transition: none;
  }
  .drawer-scrim, .drawer .drawer__close { display: none; }
  html.dark .drawer { --lvav-bg: var(--a-ground); }
  .drawer__nav .drawer__group:first-child { border-top: 0; padding-top: 0; }

  /* Folded: icons only, each row a square target, names on hover (title). */
  html.rail .drawer__who { justify-content: center; padding: var(--a-s-8) 0; }
  html.rail .drawer__me { flex: none; padding: var(--a-s-3); border-radius: var(--a-r-pill); }
  html.rail .drawer__id, html.rail .drawer__label, html.rail .drawer__h, html.rail .drawer__look, html.rail .drawer__count { display: none; }
  html.rail .drawer__row { justify-content: center; padding: 0; }
  html.rail .drawer__flip { display: flex; }
  /* Something is waiting: a dot on the icon, since the count has nowhere to go. */
  html.rail .drawer__row.has-count { position: relative; }
  html.rail .drawer__row.has-count::after { content: ""; position: absolute; top: var(--a-s-8); right: var(--a-s-13); width: var(--a-s-8); height: var(--a-s-8); border-radius: 50%; background: var(--a-azure); box-shadow: 0 0 0 2px var(--a-ground); }
}

/* Waiting to send: sits just above the tab bar, only while something is queued. */
.outbox-pill {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--a-s-21) + env(safe-area-inset-bottom));
  z-index: 51;
  display: inline-flex;
  align-items: center;
  gap: var(--a-s-5);
  height: var(--a-h-sm);
  padding: 0 var(--a-s-13);
  border-radius: var(--a-r-pill);
  background: var(--a-ground);
  color: var(--a-ink);
  font-size: var(--a-fs-sm);
  font-weight: var(--a-fw-semibold);
  white-space: nowrap;
  box-shadow: var(--a-shadow-float);
}
html.dark .outbox-pill { background: var(--a-layer-2); }
.outbox-pill--failed { color: var(--a-danger); }
.outbox-pill:focus-visible { box-shadow: var(--a-focus); border-radius: var(--a-r-pill); }
.outbox-row { flex: 1; min-width: 0; }
.outbox-row__state { font-size: var(--a-fs-sm); color: var(--a-muted); }
.outbox-row__state--failed { color: var(--a-danger); }
@media (min-width: 768px) { .outbox-pill { left: var(--a-s-21); transform: none; bottom: var(--a-s-21); } }

/* --- buttons (AButton, AIconButton) ----------------------------------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--a-s-8);
  height: var(--a-h-md);
  padding: 0 var(--a-s-13);
  border-radius: var(--a-r-md);
  background: var(--a-layer-2);
  color: var(--a-ink);
  font-size: var(--a-fs-md);
  font-weight: var(--a-fw-semibold);
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--a-dur) var(--a-spring), background-color var(--a-dur-fast) var(--a-ease-out), box-shadow var(--a-dur-fast) var(--a-ease-out), color var(--a-dur-fast);
}
.btn:active:not(:disabled) { transform: scale(0.97); transition-duration: 80ms; }
.btn:focus-visible { box-shadow: var(--a-focus); border-radius: var(--a-r-md); }
.btn:disabled { cursor: not-allowed; opacity: 0.45; }
.btn__in { display: inline-flex; align-items: center; gap: inherit; min-width: 0; }
.btn .icon { width: 18px; height: 18px; }
.btn--sm { height: var(--a-h-sm); gap: var(--a-s-5); font-size: var(--a-fs-sm); border-radius: var(--a-r-sm); }
.btn--sm .icon { width: 16px; height: 16px; }
.btn--lg { height: var(--a-h-lg); padding: 0 var(--a-s-21); }
.btn--lg .icon { width: 20px; height: 20px; }
.btn--block { display: flex; width: 100%; }
.btn--primary { background: var(--a-azure); color: var(--a-on-fill); }
/* Pay: saffron, with dark text. Only on an action that moves money. */
.btn--pay { background: var(--a-saffron); color: var(--a-on-pay); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset; }
.btn--outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--a-line-2); }
.btn--quiet, .btn--text { background: transparent; color: var(--a-azure-text); }
/* White on a tinted card: grey on a tint reads muddy. */
.btn--surface { background: var(--a-ground); box-shadow: inset 0 0 0 1px var(--a-line-2), 0 1px 2px rgba(16, 24, 40, 0.06); }
/* Danger is red text on its own tint, never a filled red button. */
.btn--danger { background: var(--a-danger-tint); color: var(--a-danger); }
@media (hover: hover) {
  .btn:hover:not(:disabled) { background: var(--a-line); }
  .btn--primary:hover:not(:disabled) { background: var(--a-azure-hover); }
  .btn--pay:hover:not(:disabled) { background: var(--a-saffron-hover); }
  .btn--outline:hover:not(:disabled) { background: var(--a-layer); }
  .btn--quiet:hover:not(:disabled), .btn--text:hover:not(:disabled) { background: var(--a-azure-tint); }
  .btn--surface:hover:not(:disabled) { background: var(--a-ground); box-shadow: inset 0 0 0 1px var(--a-muted), 0 2px 6px -2px rgba(16, 24, 40, 0.12); }
  .btn--danger:hover:not(:disabled) { background: var(--a-danger-tint); box-shadow: inset 0 0 0 1px var(--a-danger); }
}
.btn--loading .btn__in { opacity: 0; }
.btn__spin, .btn .spinner { position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: a-spin 0.7s linear infinite; }

.iconbtn, .a-ib {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--a-h-md);
  height: var(--a-h-md);
  border-radius: var(--a-r-pill);
  background: var(--a-layer-2);
  color: var(--a-ink);
  cursor: pointer;
  transition: transform var(--a-dur) var(--a-spring), background-color var(--a-dur-fast);
}
.a-ib:active, .iconbtn:active { transform: scale(0.92); transition-duration: 80ms; }
.a-ib:focus-visible, .iconbtn:focus-visible { box-shadow: var(--a-focus); border-radius: var(--a-r-pill); }
.a-ib:disabled { opacity: 0.45; cursor: not-allowed; }
.a-ib .icon, .iconbtn .icon { width: 20px; height: 20px; }
/* The small one is drawn at 34 and still takes a 44 tap (`.a-hit`). */
.a-ib--sm { width: var(--a-h-sm); height: var(--a-h-sm); }
.a-ib--sm .icon { width: 17px; height: 17px; }
.a-ib--lg { width: var(--a-h-lg); height: var(--a-h-lg); }
.a-ib--ghost, .iconbtn { background: transparent; }
.a-ib--outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--a-line-2); }
.a-ib--solid { background: var(--a-azure); color: var(--a-on-fill); }
.a-ib--glass { background: rgba(255, 255, 255, 0.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.a-ib__badge { position: absolute; top: calc(var(--a-s-3) * -1); right: calc(var(--a-s-3) * -1); display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 var(--a-s-5); border-radius: var(--a-r-pill); background: var(--a-azure); color: #fff; font-size: var(--a-fs-xs); font-weight: var(--a-fw-semibold); font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--a-ground); }
@media (hover: hover) {
  .a-ib:hover:not(:disabled) { background: var(--a-line); }
  .a-ib--ghost:hover:not(:disabled), .iconbtn:hover { background: var(--a-layer); }
  .a-ib--solid:hover:not(:disabled) { background: var(--a-azure-hover); }
  .a-ib--glass:hover:not(:disabled) { background: rgba(255, 255, 255, 0.26); }
}

/* --- card, list, row (ACard, AListRow) -------------------------------------------------- */

.card { display: block; padding: var(--a-s-13); border-radius: var(--a-r-card); background: var(--a-layer); color: var(--a-ink); }
.card--p0 { padding: 0; }
.card--psm { padding: var(--a-s-8); }
.card--raised { background: var(--a-ground); box-shadow: 0 0 0 1px var(--a-line), var(--a-shadow-lift); }
.card--tint { background: var(--a-trip-tint); }
.card--press { width: 100%; text-align: left; cursor: pointer; transition: transform var(--a-dur) var(--a-spring), box-shadow var(--a-dur) var(--a-ease-out); }
.card--press:active { transform: scale(0.985); transition-duration: 80ms; }
.card--press:focus-visible { box-shadow: var(--a-focus); border-radius: var(--a-r-card); }
@media (hover: hover) { .card--press:hover { transform: translateY(-2px); } }

.list__row { display: flex; align-items: center; gap: var(--a-s-13); min-height: 60px; padding: var(--a-s-8) 0; border-bottom: 1px solid var(--a-line); }
.list__row:last-child { border-bottom: 0; }

.a-row { display: flex; align-items: center; gap: var(--a-s-13); width: 100%; min-height: 60px; padding: var(--a-s-8) 0; text-align: left; color: var(--a-ink); border-bottom: 1px solid var(--a-line); }
.a-row:last-child, .list__row > .a-row { border-bottom: 0; }
.list__row > .a-row { min-height: 0; padding: 0; }
.a-row--link { cursor: pointer; }
.a-row--link:active .a-row__lead { transform: scale(0.92); }
.a-row--link:focus-visible { box-shadow: var(--a-focus); border-radius: var(--a-r-xs); }
.a-row__lead { display: grid; place-items: center; flex: none; width: var(--a-h-md); height: var(--a-h-md); border-radius: var(--a-r-md); background: var(--a-layer-2); transition: transform var(--a-dur) var(--a-spring); }
.a-row__lead .icon { width: 20px; height: 20px; }
.a-row__lead--info { background: var(--a-azure-tint); color: var(--a-azure-text); }
.a-row__lead--due { background: var(--a-saffron-tint); color: var(--a-saffron-text); }
.a-row__lead--paid { background: var(--a-paid-tint); color: var(--a-paid); }
.a-row__lead--danger { background: var(--a-danger-tint); color: var(--a-danger); }
.a-row--danger .a-row__title { color: var(--a-danger); }
.a-row__main { flex: 1; min-width: 0; display: grid; }
.a-row__title { font-size: var(--a-fs-md); font-weight: var(--a-fw-semibold); overflow-wrap: anywhere; }
.a-row__sub { font-size: var(--a-fs-sm); color: var(--a-muted); overflow-wrap: anywhere; }
.a-row__trail { flex: none; display: inline-flex; align-items: center; gap: var(--a-s-8); font-weight: var(--a-fw-semibold); font-variant-numeric: tabular-nums; }
.a-row__chev { width: 18px; height: 18px; color: var(--a-muted); transition: transform var(--a-dur) var(--a-spring), color var(--a-dur-fast); }
@media (hover: hover) { .a-row--link:hover .a-row__chev { transform: translateX(3px); color: var(--a-ink); } }

/* --- tag, avatar (ATag, AAvatar) -------------------------------------------------------- */

.a-tag { display: inline-flex; align-items: center; gap: var(--a-s-5); flex: none; height: 26px; padding: 0 var(--a-s-8); border-radius: var(--a-r-pill); background: var(--a-layer-2); background: color-mix(in srgb, var(--a-ink) 9%, transparent); color: var(--a-ink); font-size: var(--a-fs-xs); font-weight: var(--a-fw-semibold); line-height: 1; white-space: nowrap; }
.a-tag--sm { height: 22px; }
.a-tag .icon { width: 14px; height: 14px; }
/* The tone at 18% over whatever is behind, so a tag reads on white and on grey alike. */
.a-tag--info { background: var(--a-azure-tint); background: color-mix(in srgb, var(--a-azure) 18%, transparent); color: var(--a-azure-ink); }
.a-tag--paid { background: var(--a-paid-tint); background: color-mix(in srgb, var(--a-paid) 18%, transparent); color: var(--a-tag-paid); }
.a-tag--due { background: var(--a-saffron-tint); background: color-mix(in srgb, var(--a-saffron) 18%, transparent); color: var(--a-tag-due); }
.a-tag--danger { background: var(--a-danger-tint); background: color-mix(in srgb, var(--a-danger) 18%, transparent); color: var(--a-tag-danger); }

.avatar, .a-av { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--a-h-md); height: var(--a-h-md); border-radius: 50%; background: var(--a-azure-tint); color: var(--a-azure-ink); font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); }
.a-av--sm { width: var(--a-h-sm); height: var(--a-h-sm); }
.a-av--lg { width: var(--a-h-lg); height: var(--a-h-lg); font-size: var(--a-fs-body); }
.a-av--trip { background: var(--a-trip); color: #fff; }
.a-av--empty { background: var(--a-ground); color: var(--a-muted); box-shadow: inset 0 0 0 2px var(--a-line-2); }
.a-av > .icon { width: 45%; height: 45%; }
.a-av__done { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--a-azure); color: #fff; box-shadow: 0 0 0 2px var(--a-ground); }
.a-av__done .icon { width: 11px; height: 11px; }

/* --- tabs, segmented (ATabs, ASegmented) ------------------------------------------------- */

.a-tabs { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; box-shadow: inset 0 -1px 0 var(--a-line); }
.a-tabs::-webkit-scrollbar { display: none; }
.a-tabs__track { position: relative; display: inline-flex; gap: var(--a-s-21); }
.a-tabs__pill { position: absolute; bottom: 0; left: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--a-azure); transition: transform var(--a-dur-slow) var(--a-spring), width var(--a-dur-slow) var(--a-spring); }
.a-tabs__tab { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: var(--a-s-5); height: var(--a-hit); border-radius: var(--a-r-xs); font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); color: var(--a-ink-2); white-space: nowrap; transition: color var(--a-dur); }
.a-tabs__tab[aria-selected="true"] { color: var(--a-azure-text); }
.a-tabs__n { font-variant-numeric: tabular-nums; font-weight: var(--a-fw-regular); }
@media (hover: hover) { .a-tabs__tab:not([aria-selected="true"]):hover { color: var(--a-ink); } }

.a-seg { position: relative; display: inline-flex; padding: var(--a-s-3); border-radius: var(--a-r-pill); background: var(--a-layer-2); }
.a-seg--block { display: flex; }
.a-seg--block .a-seg__opt { flex: 1; }
.a-seg__pill { position: absolute; top: var(--a-s-3); bottom: var(--a-s-3); left: 0; border-radius: var(--a-r-pill); background: var(--a-ground); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1), 0 0 0 0.5px rgba(16, 24, 40, 0.06); transition: transform var(--a-dur-slow) var(--a-spring), width var(--a-dur-slow) var(--a-spring); }
html.dark .a-seg__pill { background: var(--a-track); }
.a-seg__opt { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: var(--a-s-5); height: var(--a-h-sm); padding: 0 var(--a-s-13); border-radius: var(--a-r-pill); font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); color: var(--a-muted); white-space: nowrap; transition: color var(--a-dur); }
.a-seg__opt[aria-checked="true"] { color: var(--a-ink); }
.a-seg__opt:focus-visible { border-radius: var(--a-r-pill); }
.a-seg__opt .icon { width: 16px; height: 16px; }

/* --- alert, empty state, skeleton, spinner (AAlert, AEmptyState, ASkeleton, ASpinner) ---- */

.a-alert, .stale { display: flex; align-items: flex-start; gap: var(--a-s-8); padding: var(--a-s-13); border-radius: var(--a-r-md); --tone: var(--a-azure); background: var(--a-azure-tint); color: var(--a-ink); animation: a-rise var(--a-dur) var(--a-ease-out) backwards; }
.a-alert > .icon, .stale > .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--a-azure-text); }
.a-alert--paid { --tone: var(--a-paid); background: var(--a-paid-tint); }
.a-alert--paid > .icon { color: var(--a-paid); }
.a-alert--warn, .stale { --tone: var(--a-saffron-text); background: var(--a-saffron-tint); }
.a-alert--warn > .icon, .stale > .icon { color: var(--a-saffron-text); }
.a-alert--danger { --tone: var(--a-danger); background: var(--a-danger-tint); }
.a-alert--danger > .icon { color: var(--a-danger); }
.a-alert--neutral { --tone: var(--a-muted); background: var(--a-layer); }
.a-alert--neutral > .icon { color: var(--a-muted); }
.a-alert__body { flex: 1; min-width: 0; display: grid; gap: var(--a-s-2); }
.a-alert__title { font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); }
.a-alert__text, .stale > span { font-size: var(--a-fs-sm); line-height: 1.45; color: var(--a-ink-2); }
.a-alert__actions { display: flex; flex-wrap: wrap; gap: var(--a-s-8); margin-top: var(--a-s-8); }
/* Buttons in an alert take the alert's own tone: white, edged by it. */
.a-alert__actions .btn { background: var(--a-ground); color: var(--a-ink); box-shadow: inset 0 0 0 1px var(--a-line-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 38%, transparent); }
.a-alert > .a-ib { margin: -5px -5px -5px 0; }

.empty, .a-empty { display: grid; justify-items: center; gap: var(--a-s-5); padding: var(--a-s-34) var(--a-s-21); text-align: center; animation: a-rise var(--a-dur-slow) var(--a-ease-out) backwards; }
.a-empty__ic { display: grid; place-items: center; width: var(--a-h-lg); height: var(--a-h-lg); margin-bottom: var(--a-s-8); border-radius: var(--a-r-md); background: var(--a-azure-tint); color: var(--a-azure-text); }
.a-empty__ic .icon { width: 26px; height: 26px; }
.a-empty__title, .empty > p:first-child { font-size: var(--a-fs-body); font-weight: var(--a-fw-semibold); }
.a-empty__text { max-width: 42ch; font-size: var(--a-fs-sm); line-height: 1.5; color: var(--a-muted); }
.a-empty__actions, .empty > .btn { margin-top: var(--a-s-13); }
.a-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--a-s-8); }

.a-sk { display: block; background: linear-gradient(90deg, var(--a-layer-2) 30%, var(--a-layer) 50%, var(--a-layer-2) 70%); background-size: 300% 100%; animation: a-shimmer 1.4s ease-in-out infinite; }

.spinner { display: flex; align-items: center; justify-content: center; gap: var(--a-s-8); margin: var(--a-s-34) auto; color: var(--a-azure); }
.spinner svg { width: 21px; height: 21px; animation: a-spin 0.8s linear infinite; }
.spinner--sm svg { width: 16px; height: 16px; }
.spinner--lg svg { width: 34px; height: 34px; }
.spinner--inline { display: inline-flex; margin: 0; }
.spinner circle { fill: none; stroke: currentColor; stroke-width: 2.5; }
.spinner circle:first-child { opacity: 0.18; }
.spinner circle:last-child { stroke-linecap: round; stroke-dasharray: 60; stroke-dashoffset: 42; }
.spinner__label { font-size: var(--a-fs-sm); font-weight: var(--a-fw-medium); color: var(--a-muted); }

/* --- fields (AField, AInput, ASelect, ADateInput) ---------------------------------------- */

.field { display: grid; align-content: start; min-width: 0; gap: var(--a-s-5); }
.field__label { font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); color: var(--a-ink); }
.field__opt { font-weight: var(--a-fw-regular); color: var(--a-muted); }
.field__box { display: flex; align-items: center; gap: var(--a-s-8); min-height: var(--a-h-md); padding: 0 var(--a-s-13); border-radius: var(--a-r-md); background: var(--a-ground); box-shadow: inset 0 0 0 1px var(--a-edge); transition: box-shadow var(--a-dur) var(--a-ease-out), background-color var(--a-dur) var(--a-ease-out); }
.field__box:focus-within { box-shadow: var(--a-focus-field); }
.field--error .field__box, .field--error .field__box:focus-within { box-shadow: inset 0 0 0 1.5px var(--a-danger); }
.field--nudge .field__box { animation: a-nudge var(--a-dur-slow) var(--a-ease-out); }
.field__box--multi { align-items: flex-start; padding-top: var(--a-s-13); padding-bottom: var(--a-s-13); }
.field__box > .icon { width: 18px; height: 18px; color: var(--a-muted); }
.field__prefix { flex: none; font-size: var(--a-fs-input); font-weight: var(--a-fw-semibold); color: var(--a-muted); }
/* 16px, or iOS zooms the page on focus. */
.input { flex: 1; width: 100%; min-width: 0; font-size: var(--a-fs-input); color: var(--a-ink); resize: none; -webkit-appearance: none; appearance: none; }
/* The control fills the box, so a tap anywhere in the box lands on it. */
input.input, select.input { align-self: stretch; min-height: 40px; margin-block: 2px; }
textarea.input { line-height: 1.5; }
select.input { cursor: pointer; text-overflow: ellipsis; }
select.input:invalid { color: var(--a-muted); }
.field__box--select { position: relative; padding-right: var(--a-s-34); }
.field__chev { position: absolute; right: var(--a-s-13); pointer-events: none; }
input.input::-webkit-date-and-time-value { text-align: left; }
input.input::-webkit-calendar-picker-indicator { opacity: 0.6; cursor: pointer; }
html.dark input.input::-webkit-calendar-picker-indicator { filter: invert(1); }
/* Autofill paints its own blue on the inner input only: keep the box's own colours. */
input.input:-webkit-autofill, input.input:-webkit-autofill:hover, input.input:-webkit-autofill:focus { -webkit-text-fill-color: var(--a-ink); caret-color: var(--a-ink); -webkit-box-shadow: 0 0 0 1000px var(--a-ground) inset; transition: background-color 9999s ease-out 0s; }
.field__box.is-off { background: var(--a-layer); cursor: not-allowed; }
.field__box.is-off .input { color: var(--a-muted); cursor: not-allowed; }
.field__reveal { display: grid; place-items: center; flex: none; width: var(--a-h-sm); height: var(--a-h-sm); margin-right: calc(var(--a-s-8) * -1); border-radius: var(--a-r-sm); color: var(--a-muted); }
.field__reveal:focus-visible { border-radius: var(--a-r-sm); }
.field__reveal .icon { width: 18px; height: 18px; }
.field__hint, .field__msg { display: flex; align-items: flex-start; gap: var(--a-s-5); font-size: var(--a-fs-sm); line-height: 1.4; color: var(--a-muted); }
.field__msg--error { color: var(--a-danger); }
.field__msg .icon { width: 15px; height: 15px; margin-top: 1px; }
@media (hover: hover) { .field:not(.field--error) .field__box:hover:not(:focus-within):not(.is-off) { box-shadow: inset 0 0 0 1px var(--a-ink-2); } }

/* --- switch, checkbox, radio (ASwitch, ACheckbox, ARadioGroup) --------------------------- */

.a-sw { position: relative; display: flex; align-items: center; gap: var(--a-s-13); min-height: var(--a-h-md); cursor: pointer; }
.a-sw__text { flex: 1; display: grid; }
.a-sw__label { font-size: var(--a-fs-md); font-weight: var(--a-fw-semibold); }
.a-sw__hint { font-size: var(--a-fs-sm); color: var(--a-muted); }
/* The real input stays inside its own row, so focusing it never scrolls the page away. */
.a-sw__input, .a-cb__input, .a-rg__input, .a-up__input { position: absolute; top: 50%; right: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.a-sw__track { flex: none; width: var(--a-h-md); height: 28px; border-radius: var(--a-r-pill); background: var(--a-edge); transition: background-color var(--a-dur) var(--a-ease-out); }
.a-sw__knob { position: absolute; top: var(--a-s-3); left: var(--a-s-3); width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(16, 24, 40, 0.25); transition: transform var(--a-dur-slow) var(--a-spring), width var(--a-dur) var(--a-ease-out); }
.a-sw:active .a-sw__knob { width: 27px; }
.a-sw__input:checked + .a-sw__track { background: var(--a-azure); }
.a-sw__input:checked + .a-sw__track .a-sw__knob { transform: translateX(16px); }
.a-sw:active .a-sw__input:checked + .a-sw__track .a-sw__knob { transform: translateX(11px); }
.a-sw__input:focus-visible + .a-sw__track { box-shadow: var(--a-focus); }
.a-sw__input:disabled + .a-sw__track { opacity: 0.45; }

.a-cb { position: relative; display: flex; align-items: flex-start; gap: var(--a-s-13); min-height: var(--a-h-md); padding: var(--a-s-8) 0; cursor: pointer; font-size: var(--a-fs-sm); line-height: 1.45; }
.a-cb--boxed { padding: var(--a-s-13); border-radius: var(--a-r-lg); box-shadow: inset 0 0 0 1.5px var(--a-edge); transition: box-shadow var(--a-dur), background-color var(--a-dur); }
.a-cb--boxed:has(:checked) { background: var(--a-azure-tint); box-shadow: inset 0 0 0 1.5px var(--a-azure); }
.a-cb__box { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: var(--a-r-sm); background: var(--a-ground); box-shadow: inset 0 0 0 2px var(--a-edge); transition: background-color var(--a-dur-fast), box-shadow var(--a-dur-fast), transform var(--a-dur) var(--a-spring); }
.a-cb:active .a-cb__box { transform: scale(0.88); }
.a-cb__box .icon { width: 15px; height: 15px; color: #fff; stroke-width: 2.5; transform: scale(0); transition: transform var(--a-dur-slow) var(--a-spring); }
.a-cb__input:checked + .a-cb__box { background: var(--a-azure); box-shadow: none; }
.a-cb__input:checked + .a-cb__box .icon { transform: scale(1); }
.a-cb__input:focus-visible + .a-cb__box { box-shadow: var(--a-focus); }
.a-cb.is-off { opacity: 0.55; cursor: not-allowed; }
.a-cb__label { padding-top: 1px; }

.a-rg { min-width: 0; }
.a-rg__legend { margin-bottom: var(--a-s-5); font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); }
.a-rg__list { display: grid; gap: var(--a-s-8); }
.a-rg__opt { position: relative; display: flex; align-items: center; gap: var(--a-s-13); min-height: var(--a-h-md); cursor: pointer; }
.a-rg--card .a-rg__opt { min-height: var(--a-h-lg); padding: var(--a-s-13); border-radius: var(--a-r-md); background: var(--a-ground); box-shadow: inset 0 0 0 1px var(--a-line-2); transition: box-shadow var(--a-dur-fast), background-color var(--a-dur-fast), transform var(--a-dur) var(--a-spring); }
.a-rg--card .a-rg__opt:active { transform: scale(0.99); }
.a-rg--card .a-rg__opt.is-on { background: var(--a-azure-tint); box-shadow: inset 0 0 0 1.5px var(--a-azure); }
.a-rg__opt.is-off { opacity: 0.5; cursor: not-allowed; }
.a-rg__dot { display: grid; place-items: center; flex: none; width: 21px; height: 21px; border-radius: var(--a-r-pill); background: var(--a-ground); box-shadow: inset 0 0 0 1.5px var(--a-edge); transition: box-shadow var(--a-dur-fast); }
.a-rg__dot i { width: 8px; height: 8px; border-radius: var(--a-r-pill); background: var(--a-azure); transform: scale(0); transition: transform var(--a-dur) var(--a-spring); }
.a-rg__opt.is-on .a-rg__dot { box-shadow: inset 0 0 0 1.5px var(--a-azure); }
.a-rg__opt.is-on .a-rg__dot i { transform: scale(1); }
html.dark .a-rg__opt.is-on .a-rg__dot i { background: var(--a-azure-text); }
.a-rg__input:focus-visible + .a-rg__dot { box-shadow: var(--a-focus); }
.a-rg__text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.a-rg__text b { font-size: var(--a-fs-body); font-weight: var(--a-fw-semibold); }
.a-rg__text small { font-size: var(--a-fs-sm); color: var(--a-muted); }
.a-rg__trail { flex: none; font-weight: var(--a-fw-semibold); font-variant-numeric: tabular-nums; }
.a-rg__opt.is-on .a-rg__trail { color: var(--a-azure-text); }

/* --- stepper, steps (AStepper, ASteps) --------------------------------------------------- */

.a-step { display: inline-flex; align-items: center; justify-self: start; gap: var(--a-s-2); padding: var(--a-s-3); border-radius: var(--a-r-pill); background: var(--a-layer); }
.a-step__btn { display: grid; place-items: center; width: var(--a-h-sm); height: var(--a-h-sm); border-radius: var(--a-r-pill); background: var(--a-ground); color: var(--a-ink); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08); transition: transform var(--a-dur) var(--a-spring); }
html.dark .a-step__btn { background: var(--a-layer-2); }
.a-step__btn:active:not(:disabled) { transform: scale(0.94); }
.a-step__btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.a-step__btn:focus-visible { border-radius: var(--a-r-pill); }
.a-step__btn .icon { width: 16px; height: 16px; }
.a-step__value { min-width: var(--a-h-sm); text-align: center; font-weight: var(--a-fw-semibold); font-variant-numeric: tabular-nums; }
.a-step--sm .a-step__btn { width: 28px; height: 28px; }
.a-step--sm .a-step__value { min-width: 28px; font-size: var(--a-fs-sm); }

.a-steps { display: flex; }
.a-steps__item { position: relative; flex: 1; display: grid; justify-items: center; align-content: start; gap: var(--a-s-5); text-align: center; }
/* The line to the next step, filled once this one is done. */
.a-steps__item:not(:last-child)::after { content: ""; position: absolute; top: 12px; left: calc(50% + 17px); right: calc(-50% + 17px); height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--a-azure) 50%, var(--a-line-2) 50%) right / 200% 100%; transition: background-position var(--a-dur-slow) var(--a-ease-out); }
.a-steps__item.is-done:not(:last-child)::after { background-position: left; }
.a-steps__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--a-r-pill); background: var(--a-ground); box-shadow: inset 0 0 0 1.5px var(--a-line-2); font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); color: var(--a-muted); transition: background-color var(--a-dur), box-shadow var(--a-dur), color var(--a-dur); }
.a-steps__item.is-now .a-steps__dot { background: var(--a-azure); box-shadow: 0 0 0 4px var(--a-azure-tint); color: #fff; }
.a-steps__item.is-done .a-steps__dot { background: var(--a-azure-tint); box-shadow: none; color: var(--a-azure-text); }
.a-steps__dot .icon { width: 14px; height: 14px; stroke-width: 2.25; }
.a-steps__label { font-size: var(--a-fs-sm); font-weight: var(--a-fw-medium); color: var(--a-muted); }
.a-steps__item.is-now .a-steps__label { color: var(--a-ink); font-weight: var(--a-fw-semibold); }

/* --- accordion (AAccordion) --------------------------------------------------------------- */

.a-acc__item { border-bottom: 1px solid var(--a-line); }
.a-acc__item:last-child { border-bottom: 0; }
.a-acc__btn { display: flex; align-items: center; gap: var(--a-s-13); width: 100%; min-height: var(--a-h-lg); padding: var(--a-s-8) 0; color: var(--a-ink); text-align: left; }
.a-acc__btn:focus-visible { border-radius: var(--a-r-sm); }
.a-acc__title { flex: 1; min-width: 0; font-size: var(--a-fs-body); font-weight: var(--a-fw-semibold); }
.a-acc__meta { flex: none; font-size: var(--a-fs-sm); font-weight: var(--a-fw-regular); color: var(--a-muted); }
.a-acc__btn .icon { width: 18px; height: 18px; color: var(--a-muted); transition: transform var(--a-dur) var(--a-spring); }
.a-acc__item.is-open .a-acc__btn .icon { transform: rotate(180deg); color: var(--a-azure-text); }
/* Height animates through a 0fr to 1fr grid row: no measuring, no jump. */
.a-acc__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--a-dur) var(--a-ease-out); }
.a-acc__item.is-open .a-acc__panel { grid-template-rows: 1fr; }
.a-acc__inner { min-height: 0; overflow: hidden; }
.a-acc__body { padding-bottom: var(--a-s-13); font-size: var(--a-fs-sm); line-height: 1.55; color: var(--a-ink-2); opacity: 0; transition: opacity var(--a-dur) var(--a-ease-out); }
.a-acc__item.is-open .a-acc__body { opacity: 1; }

/* --- file upload (AFileUpload) ------------------------------------------------------------ */

.a-up { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--a-s-13); padding: var(--a-s-13); border-radius: var(--a-r-md); background: var(--a-layer); box-shadow: inset 0 0 0 1px var(--a-line-2); transition: background-color var(--a-dur-fast), box-shadow var(--a-dur-fast); }
.a-up.is-over { background: var(--a-azure-tint); box-shadow: inset 0 0 0 1.5px var(--a-azure); }
.field--error .a-up { box-shadow: inset 0 0 0 1.5px var(--a-danger); }
.a-up__ic { display: grid; place-items: center; flex: none; width: var(--a-h-md); height: var(--a-h-md); border-radius: var(--a-r-md); background: var(--a-ground); color: var(--a-azure-text); }
.a-up__ic .icon { width: 20px; height: 20px; }
.a-up__text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.a-up__text b { font-weight: var(--a-fw-semibold); }
.a-up__text small { font-size: var(--a-fs-sm); color: var(--a-muted); }
.a-up > .btn { width: 100%; }
.a-up__list { display: grid; gap: var(--a-s-5); }
.a-up__file { display: flex; align-items: center; gap: var(--a-s-13); padding: var(--a-s-5); border-radius: var(--a-r-md); box-shadow: inset 0 0 0 1px var(--a-line); animation: a-rise var(--a-dur) var(--a-ease-out) backwards; }
.a-up__thumb { display: grid; place-items: center; flex: none; width: var(--a-h-md); height: var(--a-h-md); border-radius: var(--a-r-sm); object-fit: cover; background: var(--a-layer); color: var(--a-muted); }
button.a-up__thumb { padding: 0; overflow: hidden; }
.a-up__thumb img { width: 100%; height: 100%; object-fit: cover; }
.a-up__thumb .icon { width: 20px; height: 20px; }
.a-up__meta { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.a-up__meta b { font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-up__meta small { font-size: var(--a-fs-sm); color: var(--a-muted); }
@media (min-width: 640px) { .a-up { flex-wrap: nowrap; } .a-up > .btn { width: auto; } }

/* --- sheet (ASheet): a bottom sheet on phones, a centred dialog from 768 ------------------- */

.sheet { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; transition: opacity var(--a-dur) cubic-bezier(0.4, 0, 0.2, 1); }
.sheet__scrim { position: absolute; inset: 0; background: rgba(10, 12, 16, 0.45); touch-action: none; }
.sheet__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 88vh;
  max-height: 88dvh;
  overflow: hidden;
  --pad: var(--a-s-21); /* 21 inside a 34 corner leaves a 13 corner for anything inset */
  border-radius: var(--a-r-sheet) var(--a-r-sheet) 0 0;
  background: var(--a-ground);
  color: var(--a-ink);
  box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, 0.3);
  transition: transform var(--a-dur-slow) var(--a-ease-out);
}
html.dark .sheet__panel { background: var(--a-layer); }
.sheet__panel:focus-visible { box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, 0.3); border-radius: var(--a-r-sheet) var(--a-r-sheet) 0 0; }
.sheet.is-closed { opacity: 0; pointer-events: none; }
.sheet.is-closed .sheet__panel { transform: translateY(105%); transition-duration: var(--a-dur); }
.sheet__top { flex: none; padding: var(--a-s-8) var(--pad) var(--a-s-13); box-shadow: 0 1px 0 transparent; transition: box-shadow var(--a-dur-fast); }
.sheet__top.is-scrolled { box-shadow: 0 1px 0 var(--a-line); }
.sheet__grab { display: block; width: var(--a-h-sm); height: 5px; margin: 0 auto var(--a-s-8); border-radius: var(--a-r-sm); background: var(--a-line-2); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--a-s-13); }
.sheet__title { flex: 1; min-width: 0; font-size: var(--a-fs-h2); font-weight: var(--a-fw-bold); letter-spacing: -0.02em; line-height: 1.3; }
.sheet__desc { margin-top: var(--a-s-5); font-size: var(--a-fs-sm); color: var(--a-muted); }
/* Only the body scrolls, and its scrolling never carries on into the page. */
.sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: var(--a-s-8) var(--pad) calc(var(--pad) + env(safe-area-inset-bottom)); }
.sheet__body:empty { display: none; }
.sheet__body.has-foot { padding-bottom: var(--a-s-21); }
/* The fixed footer: the action always in reach, never part of the scroll. */
.sheet__actions { flex: none; display: flex; flex-direction: column; gap: var(--a-s-8); padding: var(--a-s-13) var(--pad) calc(var(--pad) + env(safe-area-inset-bottom)); border-top: 1px solid var(--a-line); }
.sheet__body:empty + .sheet__actions { border-top: 0; padding-top: 0; }
@media (max-width: 767.98px) { .sheet__top.is-draggable { touch-action: none; cursor: grab; } }
@media (min-width: 768px) {
  .sheet { align-items: center; }
  .sheet__panel, .sheet__panel:focus-visible { width: min(100% - 16px, 480px); border-radius: var(--a-r-sheet); transition-timing-function: var(--a-spring); }
  .sheet.is-closed .sheet__panel { transform: translateY(var(--a-s-13)) scale(0.97); }
  .sheet__top { padding-top: var(--pad); }
  .sheet__grab { display: none; }
  .sheet__actions { flex-direction: row-reverse; }
  .sheet__actions .btn { flex: 1; }
}

/* --- toaster (AToaster): a light card at the bottom, where the thumb is --------------------- */

.toasts { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--a-s-21) + env(safe-area-inset-bottom)); z-index: 150; transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--a-s-8); width: min(calc(100% - var(--a-s-21)), 420px); pointer-events: none; }
body[data-nav="off"] .toasts { bottom: calc(var(--a-s-21) + env(safe-area-inset-bottom)); }
.toast { display: flex; align-items: center; gap: var(--a-s-13); min-height: 56px; padding: var(--a-s-8) var(--a-s-5) var(--a-s-8) var(--a-s-8); border-radius: var(--a-r-md); border: 1px solid var(--a-line); background: var(--a-ground); color: var(--a-ink); box-shadow: var(--a-shadow-float); pointer-events: auto; touch-action: none; transition: transform var(--a-dur-slow) var(--a-spring), opacity var(--a-dur) var(--a-ease-out); }
html.dark .toast { background: var(--a-layer-2); }
.toast.is-out { opacity: 0; transform: translateY(13px) scale(0.97); }
/* Colour only where it means something: green for money received, red for errors. */
.toast > .icon { width: 20px; height: 20px; margin-left: var(--a-s-5); color: var(--a-ink-2); }
.toast--paid > .icon { color: var(--a-paid); }
.toast--error > .icon { color: var(--a-danger); }
.toast--warn > .icon { color: var(--a-saffron-text); }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); line-height: 1.3; }
.toast__text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--a-fs-sm); line-height: 1.35; color: var(--a-muted); }
.toast__action { flex: none; display: inline-flex; align-items: center; align-self: stretch; padding: 0 var(--a-s-13); border-radius: var(--a-r-sm); font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); color: var(--a-azure-text); }
.toast__x { flex: none; display: grid; place-items: center; align-self: stretch; width: var(--a-hit); min-height: 38px; border-radius: var(--a-r-sm); color: var(--a-muted); }
.toast__x .icon { width: 18px; height: 18px; }
@media (hover: hover) { .toast__action:hover, .toast__x:hover { background: var(--a-layer); } }

/* --- lightbox (ALightbox): full screen, every control in the bottom bar --------------------- */

.a-lb { position: fixed; inset: 0; z-index: 140; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: rgba(6, 10, 18, 0.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; transition: opacity var(--a-dur) var(--a-ease-out); }
.a-lb.is-closed { opacity: 0; pointer-events: none; }
.a-lb:focus-visible { box-shadow: none; }
.a-lb__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--a-s-13); padding: calc(var(--a-s-13) + env(safe-area-inset-top)) var(--a-s-13) var(--a-s-8); }
.a-lb__title { font-weight: var(--a-fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-lb__count { flex: none; font-size: var(--a-fs-sm); color: rgba(255, 255, 255, 0.7); font-variant-numeric: tabular-nums; }
.a-lb__stage { display: grid; place-items: center; min-height: 0; padding: var(--a-s-8) var(--a-s-13); overflow: hidden; touch-action: pan-y pinch-zoom; }
.a-lb__img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: var(--a-r-lg); object-fit: contain; transition: transform 320ms var(--a-spring); -webkit-touch-callout: default; }
.a-lb.is-closed .a-lb__img { transform: scale(0.94); }
.a-lb__thumbs { display: flex; gap: var(--a-s-8); justify-content: safe center; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: var(--a-s-5) var(--a-s-13); }
.a-lb__thumbs::-webkit-scrollbar { display: none; }
.a-lb__thumb { flex: none; width: 56px; height: 56px; overflow: hidden; border-radius: var(--a-r-sm); background: rgba(255, 255, 255, 0.08); opacity: 0.5; transition: opacity var(--a-dur-fast) var(--a-ease-out); }
.a-lb__thumb img { width: 100%; height: 100%; object-fit: cover; }
.a-lb__thumb[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px #fff; }
.a-lb__thumb:focus-visible { box-shadow: none; outline: 2px solid #fff; outline-offset: 2px; border-radius: var(--a-r-sm); }
.a-lb__bar { display: flex; align-items: center; justify-content: space-between; padding: var(--a-s-8) var(--a-s-13) calc(var(--a-s-13) + env(safe-area-inset-bottom)); }
.a-lb__arrows { display: flex; gap: var(--a-s-8); }
.a-lb .a-ib:focus-visible { box-shadow: 0 0 0 2px #fff; }
@media (hover: hover) { .a-lb__thumb:hover { opacity: 0.85; } }

/* --- sign-in: the client's auth shell ------------------------------------------------------
   The picture carries the first screen and the form sits under it, low where the thumb
   is. From 900: brand and picture left, form right. */

html.is-auth #screen { padding: 0; }
.signin { max-width: none; gap: 0; min-height: 100vh; min-height: 100dvh; }
.signin__brand { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; gap: var(--a-s-8); padding: calc(var(--a-s-13) + env(safe-area-inset-top)) var(--a-s-21) 0; }
.signin__id { display: flex; align-items: center; gap: var(--a-s-8); align-self: stretch; }
.signin__mark { width: var(--a-s-34); height: var(--a-s-34); border-radius: var(--a-r-sm); }
.signin__app { padding-left: var(--a-s-8); border-left: 1px solid var(--a-line); font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); color: var(--a-muted); }
/* The picture shrinks before the form does: on a short phone the button stays on the first screen. */
.signin__art { flex: 0 1 auto; width: 100%; max-width: 420px; min-height: 0; max-height: 40vh; max-height: 40dvh; margin-block: auto; }
.signin__col { flex: none; display: flex; flex-direction: column; padding: var(--a-s-13) var(--a-s-21) calc(var(--a-s-21) + env(safe-area-inset-bottom)); }
.signin__panel { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 420px; margin-inline: auto; padding-top: var(--a-s-13); }
.signin__head { margin-bottom: var(--a-s-21); }
.signin__sub { margin-top: var(--a-s-5); line-height: 1.5; color: var(--a-muted); }
.signin form { display: grid; gap: var(--a-s-13); }
.signin__foot { margin-top: var(--a-s-13); font-size: var(--a-fs-xs); line-height: 1.6; color: var(--a-muted); text-align: center; }
@media (min-width: 900px) {
  .signin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(440px, 40%); }
  .signin__brand { position: sticky; top: 0; height: 100vh; height: 100svh; justify-content: center; padding: var(--a-s-34) var(--a-s-55); }
  .signin__id { position: absolute; top: var(--a-s-34); left: var(--a-s-55); }
  .signin__mark { width: var(--a-s-55); height: var(--a-s-55); border-radius: var(--a-r-md); }
  .signin__art { flex: none; max-width: 560px; max-height: 70vh; max-height: 70svh; }
  .signin__col { padding: var(--a-s-34) var(--a-s-55); border-left: 1px solid var(--a-line); }
  .signin__panel { justify-content: center; max-width: 380px; padding-top: 0; }
}

/* --- home (placeholder) and more ----------------------------------------------------------- */

.greeting { display: flex; align-items: center; gap: var(--a-s-13); min-width: 0; }
.greeting__name { font-size: var(--a-fs-h1); font-weight: var(--a-fw-bold); line-height: 1.2; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.more__mail { margin-top: var(--a-s-3); color: var(--a-muted); overflow-wrap: anywhere; }
.more__hint { padding: 0 var(--a-s-3); font-size: var(--a-fs-sm); color: var(--a-muted); }
.more__look { display: grid; gap: var(--a-s-8); }
.more__out { display: flex; align-items: center; justify-content: center; gap: var(--a-s-8); width: 100%; min-height: var(--a-h-md); margin-top: var(--a-s-21); border-radius: var(--a-r-md); font-size: var(--a-fs-md); font-weight: var(--a-fw-semibold); color: var(--a-danger); }
.more__out:active { background: var(--a-danger-tint); }
@media (min-width: 768px) { .screen.more { gap: var(--a-s-34); } }

/* --- motion off --------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .spinner svg, .btn__spin, .btn .spinner { animation-duration: 2.4s; }
  .a-alert, .stale, .empty, .a-empty, .a-sk, .a-up__file, .field--nudge .field__box { animation: none; }
  .drawer { transition: none; }
  .sheet.is-closed .sheet__panel, .toast.is-out, .a-lb.is-closed .a-lb__img, .btn:active:not(:disabled), .a-ib:active, .card--press:hover, .card--press:active { transform: none; }
}

/* From 768 the office links sit in the light header like the others; the "Office" tag by the brand carries the difference. */
@media (min-width: 768px) {
  .nav--office .nav__item, html.dark .nav--office .nav__item { color: var(--a-muted); opacity: 1; }
  .nav--office .nav__item[aria-current="page"], html.dark .nav--office .nav__item[aria-current="page"] { background: var(--a-layer); color: var(--a-ink); }
}

/* Beside the sidebar, what floats over the page floats over the page's own part of the window. */
@media (min-width: 1024px) {
  .outbox-pill { left: calc(var(--side-w) + var(--a-s-21)); }
  .toasts { left: calc(50% + var(--side-w) / 2); }
}

/* Compact on a desktop with a mouse: rows and controls drop from the 40px touch height to 32.
   A phone or tablet (coarse pointer) keeps 40. */
@media (min-width: 1024px) and (pointer: fine) {
  :root { --a-hit: 32px; --a-h-md: 32px; --a-h-lg: 38px; --a-h-sm: 28px; }
}
