/* ===========================================================================
   Sendegel web — design system

   The palette is the mobile client's `shared/theme/tokens.ts`, role for role,
   so the two products look like one product. Both themes are fully defined:
   nothing is computed, so no token can exist in light and go missing in dark.

   Layout uses logical properties throughout (`margin-inline-start`, not
   `margin-left`). Arabic is a launch locale, not a later pass, and physical
   properties are exactly what makes an RTL pass into a rewrite.
   =========================================================================== */

:root {
  color-scheme: light dark;

  /* grounds, back to front */
  --canvas: #f4f2ec;
  --surface: #fbfaf6;
  --surface-muted: #eceae3;
  --overlay: rgba(28, 27, 23, 0.55);

  /* content */
  --ink: #2b2b2b;
  --ink-soft: #676767;
  --ink-faint: #8b887e;
  --ink-inverse: #ffffff;

  /* lines */
  --hair: #d8d5cb;
  --hair-strong: #bbb6a8;

  /* brand */
  --accent: #6d5eb4;
  --accent-soft: #e6e1f5;
  --accent-pressed: #5a4c9c;

  /* semantic: a fill for backgrounds, an ink for text on canvas */
  --success: #386f36;
  --success-soft: #dde7dc;
  --warning: #895e1a;
  --warning-soft: #f5e8cf;
  --danger: #a53e39;
  --danger-soft: #f3d9d5;
  --info: #3f6b8a;
  --info-soft: #dce7ee;
  --positive: #41803f;

  /* 4-pt spacing scale */
  --s-xxs: 2px;
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 12px;
  --s-lg: 16px;
  --s-xl: 20px;
  --s-xxl: 24px;
  --s-section: 32px;

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-pill: 999px;

  --shadow-card: 0 2px 8px rgba(28, 27, 23, 0.06);

  --maxw: 1120px;
  --nav-h: 60px;
  --tabbar-h: 58px;
  /* Minimum touch target — enforced here so no control can opt out. */
  --touch: 44px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #1a1a15;
    --surface: #23231e;
    --surface-muted: #2c2c25;
    --overlay: rgba(0, 0, 0, 0.66);

    --ink: #e8e5da;
    --ink-soft: #9d9a8e;
    --ink-faint: #746f66;
    --ink-inverse: #1a1a15;

    --hair: #3d3d34;
    --hair-strong: #4c4c42;

    --accent: #a99adf;
    --accent-soft: #2e2947;
    --accent-pressed: #bcafe8;

    --success: #8fc68d;
    --success-soft: #243025;
    --warning: #d6b169;
    --warning-soft: #382e1c;
    --danger: #e5a79f;
    --danger-soft: #42221e;
    --info: #8fb4cc;
    --info-soft: #1e2b33;
    --positive: #8fc68d;

    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.35);
  }
}

/* The light-mode foregrounds are a few percent darker than the mobile palette
   they came from. Measured against their own backgrounds, the originals sat
   below WCAG AA: error/success/warning alert text at 3.8–4.1:1 against its own
   tint, chip text at 4.2:1, and placeholders at 2.6:1 against a 3:1 floor. The
   hues are unchanged and the shift is invisible side by side; `contrast.test.ts`
   holds every pairing the stylesheet actually uses. The dark palette already
   passed and is untouched.

   Text on a saturated fill uses --ink-inverse, never a literal white.
   The dark palette lightens --accent and --danger considerably, so white on
   them measures 2.5:1 and 2.0:1 — both well under the 4.5:1 floor. The token
   is #ffffff in light mode, so this costs nothing there and takes dark mode to
   7.0:1 and 8.6:1. The two literal whites that remain are deliberate: the
   banner's text sits on a dark scrim, and a QR code needs a white quiet zone
   whatever the theme. */

/* --------------------------------------------------------------- reset --- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  /* Azerbaijani (ə ğ ş descenders, İ's dot) and Arabic diacritics both need
     generous leading; 1.5 is the floor, not a starting point to trim. */
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 { margin: 0 0 0.4em; line-height: 1.25; font-weight: 700; letter-spacing: -0.011em; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 19px; }
h4 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 0.8em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

hr { border: none; border-block-start: 1px solid var(--hair); margin-block: var(--s-xl); }

/* A visible focus ring on every interactive element. Removing it is how a
   keyboard user loses track of where they are on the page. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--accent-soft); color: var(--ink); }

/* An icon whose meaning is "that way" has to point the other way in Arabic.
   Marked at the icon definition (see shared/ui/icons.tsx) and mirrored here,
   so no call site has to think about it. Icons that merely contain an arrow —
   a refresh loop, a download — are not marked: their meaning does not depend
   on which way the page runs. */
[dir='rtl'] .rtl-flip { transform: scaleX(-1); }

/* ------------------------------------------------------------- helpers --- */

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--s-lg); }
.page { padding-block: var(--s-xxl) calc(var(--tabbar-h) + var(--s-section)); }
@media (min-width: 861px) { .page { padding-block-end: var(--s-section); } }

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.tiny { font-size: 12.5px; line-height: 1.36; }
.label { font-size: 13.5px; font-weight: 600; }
.strong { font-weight: 600; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.spacer { flex: 1 1 auto; }
.stack { display: flex; flex-direction: column; gap: var(--s-md); }
.stack-lg { display: flex; flex-direction: column; gap: var(--s-xl); }
.row { display: flex; align-items: center; gap: var(--s-md); }
.row-wrap { display: flex; align-items: center; gap: var(--s-sm); flex-wrap: wrap; }
.between { justify-content: space-between; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; inset-block-start: -100px; inset-inline-start: var(--s-lg);
  z-index: 100; background: var(--surface); color: var(--ink);
  padding: var(--s-sm) var(--s-md); border-radius: var(--r-md); border: 1px solid var(--hair);
}
.skip-link:focus { inset-block-start: var(--s-sm); }

.hide-sm { display: none; }
@media (min-width: 700px) { .hide-sm { display: revert; } }
.only-sm { display: revert; }
@media (min-width: 700px) { .only-sm { display: none; } }

/* --------------------------------------------------------------- chrome --- */

.topbar {
  position: sticky; inset-block-start: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-block-end: 1px solid var(--hair);
}
.topbar .inner { display: flex; align-items: center; gap: var(--s-lg); height: var(--nav-h); }

.brand { display: inline-flex; align-items: center; gap: var(--s-sm); font-weight: 700; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark {
  display: grid; place-items: center; inline-size: 30px; block-size: 30px;
  border-radius: 9px; background: var(--accent); color: var(--ink-inverse); font-weight: 700; font-size: 16px;
}

.navlinks { display: flex; align-items: center; gap: var(--s-xs); }
.navlinks > a {
  display: inline-flex; align-items: center; gap: 6px;
  min-block-size: var(--touch); padding-inline: var(--s-md);
  border-radius: var(--r-md); color: var(--ink-soft); font-weight: 600; font-size: 14px;
}
.navlinks > a:hover { background: var(--surface-muted); color: var(--ink); text-decoration: none; }
.navlinks > a.active { color: var(--ink); background: var(--accent-soft); }

.nav-badge {
  display: inline-grid; place-items: center; min-inline-size: 18px; block-size: 18px;
  padding-inline: 5px; border-radius: var(--r-pill);
  background: var(--danger); color: var(--ink-inverse); font-size: 11px; font-weight: 700; line-height: 1;
}
.bell { position: relative; display: inline-flex; }
.bell .nav-badge { position: absolute; inset-block-start: -6px; inset-inline-start: 11px; }

.tabbar {
  position: fixed; inset-block-end: 0; inset-inline: 0; z-index: 40;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  block-size: var(--tabbar-h); padding-block-end: env(safe-area-inset-bottom);
  background: var(--surface); border-block-start: 1px solid var(--hair);
}
.tabbar a { display: grid; place-items: center; color: var(--ink-faint); }
.tabbar a.active { color: var(--accent); }
@media (min-width: 861px) { .tabbar { display: none; } }

.footer {
  border-block-start: 1px solid var(--hair); margin-block-start: var(--s-section);
  padding-block: var(--s-xl) calc(var(--tabbar-h) + var(--s-xl)); color: var(--ink-soft); font-size: 13px;
}
@media (min-width: 861px) { .footer { padding-block-end: var(--s-xl); } }
.footer nav { display: flex; flex-wrap: wrap; gap: var(--s-md); }
.footer a { color: var(--ink-soft); }

/* --------------------------------------------------------------- cards --- */

.card {
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
}
.card > .body { padding: var(--s-lg); }
.card-link { display: block; color: inherit; overflow: hidden; transition: transform .12s ease, box-shadow .12s ease; }
.card-link:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(28,27,23,.10); }
.card-link:hover h3 { color: var(--accent); }

.section { margin-block-end: var(--s-section); }
.section > header { display: flex; align-items: baseline; gap: var(--s-md); margin-block-end: var(--s-md); }
.section > header h2 { margin: 0; }
.section > header a { font-size: 13.5px; font-weight: 600; }

.grid { display: grid; gap: var(--s-lg); grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.grid.tight { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cols-2 { display: grid; gap: var(--s-lg); grid-template-columns: 1fr; }
@media (min-width: 861px) { .cols-2 { grid-template-columns: 2fr 1fr; align-items: start; } }

/* Horizontal rails scroll rather than wrap — a carousel of five that reflows
   to two rows reads as a broken grid. */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr); gap: var(--s-lg);
  overflow-x: auto; scroll-snap-type: x mandatory; padding-block-end: var(--s-sm); scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 861px) { .rail { grid-auto-columns: minmax(320px, 1fr); } }

/* ---------------------------------------------------------- event card --- */

.event-card .cover {
  position: relative; display: flex; align-items: flex-start;
  block-size: 148px; padding: var(--s-sm);
  background-color: var(--surface-muted); background-size: cover; background-position: center;
}
.event-card .cover .badges { display: flex; gap: var(--s-xs); flex-wrap: wrap; }
.event-card .cover .price { position: absolute; inset-block-end: var(--s-sm); inset-inline-end: var(--s-sm); }
.event-card h3 { font-size: 16px; margin: 0 0 2px; }
.event-meta { display: flex; flex-direction: column; gap: 3px; color: var(--ink-soft); font-size: 12.5px; }
.event-meta .line { display: flex; align-items: center; gap: 5px; min-width: 0; }
.event-meta .line > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cal-tile {
  display: grid; place-items: center; inline-size: 46px; padding-block: 5px;
  border: 1px solid var(--hair); border-radius: var(--r-md); background: var(--surface-muted); flex: none;
}
.cal-tile .d { font-size: 17px; font-weight: 700; line-height: 1; }
.cal-tile .m { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }

.banner {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-block-size: 168px; padding: var(--s-lg); border-radius: var(--r-lg);
  color: #fff; overflow: hidden; background: var(--accent); background-size: cover; background-position: center;
}
.banner::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.65)); }
.banner > * { position: relative; z-index: 1; }
.banner:hover { text-decoration: none; }
.banner .t { font-size: 19px; font-weight: 700; }
.banner .m { font-size: 13px; opacity: .9; }

/* ------------------------------------------------------------- avatars --- */

.avatar {
  display: grid; place-items: center; flex: none;
  inline-size: 40px; block-size: 40px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-pressed);
  font-weight: 700; font-size: 14px; background-size: cover; background-position: center;
  border: 1px solid var(--hair);
}
.avatar.sm { inline-size: 30px; block-size: 30px; font-size: 11.5px; }
.avatar.lg { inline-size: 72px; block-size: 72px; font-size: 24px; }
.avatar.xl { inline-size: 96px; block-size: 96px; font-size: 30px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar + .avatar { margin-inline-start: -10px; }

/* -------------------------------------------------------------- badges --- */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px var(--s-sm); border-radius: var(--r-pill);
  background: var(--surface-muted); color: var(--ink-soft);
  font-size: 11.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  border: 1px solid var(--hair);
}
.badge.accent  { background: var(--accent-soft);  color: var(--accent-pressed); border-color: transparent; }
.badge.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge.danger  { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.badge.info    { background: var(--info-soft);    color: var(--info);    border-color: transparent; }
.badge.solid   { background: var(--ink); color: var(--ink-inverse); border-color: transparent; }

/* ------------------------------------------------------------ controls --- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-block-size: var(--touch); padding-inline: var(--s-lg);
  border: 1px solid var(--hair-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--surface-muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .55; cursor: not-allowed; pointer-events: none; }

.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--ink-inverse); }
.btn.primary:hover { background: var(--accent-pressed); border-color: var(--accent-pressed); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--ink-inverse); }
.btn.danger:hover { filter: brightness(.94); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn.ghost:hover { background: var(--surface-muted); color: var(--ink); }
.btn.sm { min-block-size: 34px; padding-inline: var(--s-md); font-size: 13.5px; }
.btn.block { display: flex; inline-size: 100%; }
.btn.icon { padding-inline: 0; inline-size: var(--touch); }

/* An inline form whose only child is a button should not add layout. */
form.inline { display: inline; }

.chip-row { display: flex; gap: var(--s-sm); overflow-x: auto; padding-block-end: var(--s-xs); scrollbar-width: thin; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  min-block-size: 34px; padding-inline: var(--s-md);
  border: 1px solid var(--hair); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-soft); font-size: 13.5px; font-weight: 600;
}
.chip:hover { text-decoration: none; background: var(--surface-muted); color: var(--ink); }
.chip.active { background: var(--accent-soft); border-color: transparent; color: var(--accent-pressed); }

/* ---------------------------------------------------------------- form --- */

.field { display: flex; flex-direction: column; gap: 5px; margin-block-end: var(--s-lg); }
.field > label { font-size: 13.5px; font-weight: 600; }
.field .hint { font-size: 12.5px; color: var(--ink-soft); }
.field .err { font-size: 12.5px; color: var(--danger); font-weight: 600; }

input[type='text'], input[type='email'], input[type='tel'], input[type='search'],
input[type='number'], input[type='password'], input[type='url'],
input[type='date'], input[type='time'], input[type='datetime-local'],
select, textarea {
  inline-size: 100%; min-block-size: var(--touch);
  padding: 10px var(--s-md);
  border: 1px solid var(--hair-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 15px;
}
textarea { min-block-size: 110px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: var(--danger); }
select { appearance: none; background-image: none; padding-inline-end: var(--s-xl); }

/* Numeric one-time codes: wide tracking so a six-digit code reads as six. */
.otp { text-align: center; font-size: 24px; letter-spacing: .4em; font-weight: 700; text-indent: .4em; }

.checkline { display: flex; align-items: flex-start; gap: var(--s-sm); margin-block-end: var(--s-md); }
.checkline input { inline-size: 18px; block-size: 18px; min-block-size: 0; margin-block-start: 3px; flex: none; }
.checkline label { font-size: 14px; }

fieldset { border: 1px solid var(--hair); border-radius: var(--r-md); padding: var(--s-lg); margin: 0 0 var(--s-lg); }
legend { padding-inline: var(--s-sm); font-size: 13.5px; font-weight: 600; }

/* --------------------------------------------------------------- state --- */

.state {
  display: grid; place-items: center; gap: var(--s-sm);
  padding: var(--s-section) var(--s-lg); text-align: center;
  border: 1px dashed var(--hair-strong); border-radius: var(--r-lg); color: var(--ink-soft);
}
.state .mark { font-size: 30px; line-height: 1; }
.state .t { font-weight: 700; color: var(--ink); }
.state .b { font-size: 13.5px; max-inline-size: 42ch; }
.state.inline { padding: var(--s-lg); }

.alert {
  display: flex; align-items: flex-start; gap: var(--s-sm);
  padding: var(--s-md) var(--s-lg); border-radius: var(--r-md);
  border: 1px solid transparent; font-size: 14px; margin-block-end: var(--s-lg);
}
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--success-soft); color: var(--success); }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert.warning { background: var(--warning-soft); color: var(--warning); }
.alert .req { font-family: var(--font-mono); font-size: 11px; opacity: .75; }

/* A failed mutation is not a failed page: it belongs beside the control that
   failed, not in place of the content. */
.mutation-error {
  display: block; margin-block-start: var(--s-sm);
  font-size: 13px; font-weight: 600; color: var(--danger);
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-muted), var(--hair), var(--surface-muted));
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-md);
}
@keyframes shimmer { to { background-position: -200% 0; } }
/* The only rule here with a direction baked in: a 90deg gradient swept by
   `background-position`, neither of which has a logical form. Cosmetic — a
   loading placeholder sweeping the wrong way is not a defect anyone reports —
   but it is one line, and leaving it would make this stylesheet's claim to be
   direction-agnostic not quite true. */
[dir='rtl'] .skeleton { animation-direction: reverse; }

/* ---------------------------------------------------------------- misc --- */

.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s-sm) var(--s-lg); font-size: 14px; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; text-align: end; font-weight: 600; }

.list { display: flex; flex-direction: column; }
.list > * { padding-block: var(--s-md); border-block-end: 1px solid var(--hair); }
.list > *:last-child { border-block-end: none; }

.list-row { display: flex; align-items: center; gap: var(--s-md); color: inherit; }
.list-row:hover { text-decoration: none; }
.list-row .grow { min-inline-size: 0; flex: 1; }
.list-row.unread { background: var(--accent-soft); border-radius: var(--r-md); padding-inline: var(--s-md); }

.pagination { display: flex; align-items: center; justify-content: center; gap: var(--s-md); margin-block-start: var(--s-xl); }

.progress { block-size: 6px; border-radius: var(--r-pill); background: var(--surface-muted); overflow: hidden; }
.progress > i { display: block; block-size: 100%; background: var(--accent); }

.qr { display: grid; place-items: center; padding: var(--s-lg); background: #fff; border-radius: var(--r-lg); }
.qr img { inline-size: min(260px, 70vw); image-rendering: pixelated; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .n { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat .l { font-size: 12.5px; color: var(--ink-soft); }
.stats { display: flex; gap: var(--s-xxl); flex-wrap: wrap; }

.amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.amount.credit { color: var(--positive); }
.amount.debit { color: var(--ink); }

.bubble { max-inline-size: 74%; padding: var(--s-sm) var(--s-md); border-radius: var(--r-lg); font-size: 14.5px; }
.bubble.them { background: var(--surface-muted); border-start-start-radius: var(--r-sm); }
.bubble.me { background: var(--accent); color: var(--ink-inverse); border-start-end-radius: var(--r-sm); }
.bubble.system { background: transparent; color: var(--ink-faint); font-size: 12.5px; text-align: center; max-inline-size: none; }
.msg { display: flex; gap: var(--s-sm); margin-block-end: var(--s-sm); }
.msg.me { justify-content: flex-end; }
.thread { display: flex; flex-direction: column; gap: var(--s-xs); padding: var(--s-lg); overflow-y: auto; max-block-size: 62vh; }

.toast-wrap { position: fixed; inset-block-end: calc(var(--tabbar-h) + var(--s-lg)); inset-inline: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-sm); pointer-events: none; }
.toast { pointer-events: auto; padding: var(--s-md) var(--s-lg); border-radius: var(--r-pill);
  background: var(--ink); color: var(--ink-inverse); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-card); }

details.disclosure { border: 1px solid var(--hair); border-radius: var(--r-md); padding: var(--s-md) var(--s-lg); margin-block-end: var(--s-md); background: var(--surface); }
details.disclosure > summary { cursor: pointer; font-weight: 600; min-block-size: 28px; }
details.disclosure[open] > summary { margin-block-end: var(--s-md); }


/* Tables scroll inside their own box rather than pushing the page sideways. */
.table-scroll { overflow-x: auto; }
table.data { inline-size: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: var(--s-sm) var(--s-md); text-align: start; border-block-end: 1px solid var(--hair); }
table.data th { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
