/* Syok components — import after tokens.css.
   <link rel="stylesheet" href="tokens.css">
   <link rel="stylesheet" href="components.css">
   Behaviour for the drawer and sidebar lives in components.js (no dependencies).
   Every value comes from a token; see DESIGN.md and layout.html. */

/* =========================================================================
   Base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* the hidden attribute always wins over component display rules */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  text-wrap: balance;
  margin: 0;
}
p { margin: 0; max-width: var(--measure); }
a { color: var(--color-link); text-underline-offset: 3px; }
code, .mono { font-family: var(--font-mono); font-size: 0.875em; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }

.label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.sr-only { 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; left: var(--space-3); top: -100px; z-index: var(--z-toast); padding: var(--space-2) var(--space-4); background: var(--color-surface); color: var(--color-text); border-radius: var(--radius-md); box-shadow: var(--shadow-md); font-weight: var(--weight-semibold); }
.skip-link:focus { top: var(--space-3); }

/* =========================================================================
   Layout: container, grid, visibility
   Breakpoints: tablet >= 600px, desktop >= 1024px, wide >= 1440px.
   ========================================================================= */
.container { width: 100%; max-width: var(--container-max); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: var(--container-narrow); }
.container-wide { max-width: var(--container-wide); }

/* 4 / 8 / 12-column grid. Children span the full row unless given a .col-*:
   .col-N on every screen, .col-t-N from tablet, .col-d-N from desktop. */
.grid { display: grid; grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr)); gap: var(--grid-gap); }
.grid > * { grid-column: 1 / -1; min-width: 0; }
.col-1 { grid-column: span 1; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }
@media (min-width: 600px) {
  .col-t-1 { grid-column: span 1; }
  .col-t-2 { grid-column: span 2; }
  .col-t-3 { grid-column: span 3; }
  .col-t-4 { grid-column: span 4; }
  .col-t-5 { grid-column: span 5; }
  .col-t-6 { grid-column: span 6; }
  .col-t-7 { grid-column: span 7; }
  .col-t-8 { grid-column: span 8; }
}
@media (min-width: 1024px) {
  .col-d-1 { grid-column: span 1; }
  .col-d-2 { grid-column: span 2; }
  .col-d-3 { grid-column: span 3; }
  .col-d-4 { grid-column: span 4; }
  .col-d-5 { grid-column: span 5; }
  .col-d-6 { grid-column: span 6; }
  .col-d-7 { grid-column: span 7; }
  .col-d-8 { grid-column: span 8; }
  .col-d-9 { grid-column: span 9; }
  .col-d-10 { grid-column: span 10; }
  .col-d-11 { grid-column: span 11; }
  .col-d-12 { grid-column: span 12; }
}
/* Card grids that fill themselves: as many columns as fit, each at least --auto-min wide */
.auto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--auto-min, 14rem)), 1fr)); gap: var(--grid-gap); }

/* Show / hide by breakpoint */
@media (max-width: 599.98px)  { .from-tablet { display: none !important; } }
@media (max-width: 1023.98px) { .from-desktop { display: none !important; } }
@media (min-width: 600px)     { .phone-only { display: none !important; } }
@media (min-width: 1024px)    { .below-desktop { display: none !important; } }

/* =========================================================================
   Brand: the SYOK mark, product lockups, product O, colour tile
   Rendered by assets/syok-mark.js from data-syok-mark / data-lockup / data-o-glyph.
   ========================================================================= */
/* The wordmark is a bespoke drawn mark, not set in any font (DESIGN.md §5.1, logos/).
   S / Y / O / K each carry one brand colour. K is Malam, the night navy: three bright
   letters for energy, one grounded letter for "tech comes from humanity". */
.syok-mark { display: inline-block; line-height: 0; }
.syok-mark svg { display: block; width: auto; }
.syok-mark .syok-letter { fill: none; }
.syok-mark .syok-s { stroke: var(--color-primary); }
.syok-mark .syok-y { stroke: var(--color-secondary); }
.syok-mark .syok-o { stroke: var(--color-accent); }
.syok-mark .syok-k { stroke: var(--color-night); }
.syok-mark.mono .syok-letter { stroke: var(--color-text) !important; }
.syok-lockup { display: inline-block; line-height: 0; }
.syok-lockup svg { display: block; width: auto; max-width: 100%; overflow: visible; } /* let descenders (y, p) hang below the mark box */
.syok-lockup .lockup-name { font-family: var(--font-display); font-weight: 500; fill: var(--color-night); }
.syok-lockup .syok-letter { fill: none; }
.syok-lockup .syok-s { stroke: var(--color-primary); }
.syok-lockup .syok-y { stroke: var(--color-secondary); }
.syok-lockup .syok-o { stroke: var(--color-accent); }
.syok-lockup .syok-k { stroke: var(--color-night); }
.syok-lockup .syok-o-glyph { fill: var(--color-accent); stroke: none; }
.o-glyph { display: inline-block; line-height: 0; }
.o-glyph svg { display: block; width: 100%; height: 100%; }
.o-glyph path { fill: var(--color-accent); }
.o-glyph.lg { width: 88px; height: 88px; flex-shrink: 0; }
.o-glyph.xs { width: 16px; height: 16px; }
.brand-strip { display: grid; grid-template-columns: repeat(4, 1fr); height: 4px; }
.brand-strip > i:nth-child(1) { background: var(--color-primary); }
.brand-strip > i:nth-child(2) { background: var(--color-secondary); }
.brand-strip > i:nth-child(3) { background: var(--color-accent); }
.brand-strip > i:nth-child(4) { background: var(--color-night); }

/* =========================================================================
   Controls: buttons, chips, fields, badges, alerts
   ========================================================================= */
/* Buttons: flat fills, 1px hairlines, soft elevation, a clear focus ring.
   Heights 32 / 40 / 48 — the sizes product UI uses, so buttons line up
   with inputs and table rows. */
.btn {
  font: inherit; font-weight: var(--weight-semibold); font-size: 0.9375rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 40px; padding: 0 var(--space-4);
  border-radius: var(--radius-md); border: var(--border-width) solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap; letter-spacing: 0.005em;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), color var(--duration-fast);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.btn-primary { background: var(--color-primary); color: var(--color-on-primary); box-shadow: var(--shadow-xs), inset 0 1px 0 rgb(255 255 255 / .14); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary-brand { background: var(--color-secondary); color: var(--color-on-secondary); box-shadow: var(--shadow-xs), inset 0 1px 0 rgb(255 255 255 / .12); }
.btn-secondary-brand:hover { background: var(--color-secondary-hover); }
.btn-night { background: var(--color-night); color: var(--color-text-inverse); box-shadow: var(--shadow-xs), inset 0 1px 0 rgb(255 255 255 / .10); }
.btn-night:hover { background: color-mix(in srgb, var(--color-night) 86%, var(--color-text)); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--color-surface-muted); border-color: color-mix(in srgb, var(--color-border) 60%, var(--color-text-muted)); }
.btn-ghost { background: transparent; color: var(--color-text); }
.btn-ghost:hover { background: var(--color-surface-muted); }
.btn-danger { background: var(--color-danger); color: var(--color-on-primary); box-shadow: var(--shadow-xs); }
.btn-danger:hover { background: color-mix(in srgb, var(--color-danger) 85%, #000); }
.btn-sm { height: 32px; padding: 0 var(--space-3); font-size: var(--text-sm); border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 var(--space-5); font-size: var(--text-base); }
.btn-icon { width: 40px; padding: 0; }
/* Compact sizes for dense UI (tables, toolbars, chips). Desktop only as a
   visible size; on touch screens the hit area is padded out to 44px. */
.btn-xs { height: 24px; padding: 0 var(--space-2); font-size: var(--text-xs); gap: var(--space-1); border-radius: var(--radius-sm); }
.btn-xs svg { width: 12px; height: 12px; }
.btn-2xs { height: 16px; width: 16px; padding: 0; border-radius: 4px; }
.btn-2xs svg { width: 10px; height: 10px; }
.btn-xs, .btn-2xs { position: relative; }
@media (pointer: coarse) {
  .btn-xs::after, .btn-2xs::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
}
.chip { display: inline-flex; align-items: center; gap: var(--space-1); height: 24px; padding: 0 4px 0 var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text); background: var(--color-surface-muted); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-pill); }
.chip .btn-2xs { border-radius: var(--radius-pill); color: var(--color-text-muted); }
.chip .btn-2xs:hover { background: var(--color-border); color: var(--color-text); }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-label { font-size: var(--text-xs); color: var(--color-text-muted); font-family: var(--font-mono); }

.field { display: grid; gap: var(--space-2); }
.field label { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.input {
  font: inherit; color: var(--color-text); background: var(--color-surface);
  padding: 0 var(--space-3); height: 40px;
  border: var(--border-width) solid var(--color-border); border-radius: var(--radius-md); width: 100%; box-shadow: var(--shadow-xs);
}
.input:focus { outline: none; border-color: var(--color-focus); box-shadow: var(--ring-focus); }
.hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.hint.err { color: var(--color-danger-text); font-weight: var(--weight-semibold); }
.input.is-error { border-color: var(--color-danger); }

.badge { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-bold); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); }
.badge-primary { background: var(--color-primary); color: var(--color-on-primary); }
.badge-secondary { background: var(--color-secondary); color: var(--color-on-secondary); }
.badge-success { background: var(--color-success-soft); color: var(--color-success-text); }
.badge-warning { background: var(--color-warning-soft); color: var(--color-warning-text); }
.badge-danger { background: var(--color-danger-soft); color: var(--color-danger-text); }
.badge-info { background: var(--color-info-soft); color: var(--color-info); }

.alert { display: grid; gap: var(--space-1); padding: var(--space-4); border-radius: var(--radius-md); font-size: var(--text-sm); border: var(--border-width) solid; }
.alert strong { font-weight: var(--weight-bold); }
.alert-success { background: var(--color-success-soft); border-color: var(--color-success); }
.alert-warning { background: var(--color-warning-soft); border-color: var(--color-warning); }
.alert-danger { background: var(--color-danger-soft); border-color: var(--color-danger); }

/* Page sections and headings */
.section { padding-block: var(--space-7); }
.section-alt { background: var(--color-surface); }   /* alternate bands: plain, alt, plain … */
.section-head { display: grid; gap: var(--space-2); margin-bottom: var(--space-6); max-width: var(--measure); }
.section-head h2 { font-size: var(--text-2xl); font-weight: var(--weight-bold); }
.section-head p { color: var(--color-text-muted); }
.display { font-size: clamp(2.25rem, 6vw, var(--text-5xl)); font-weight: var(--weight-bold); }
.lead { font-size: var(--text-lg); color: var(--color-text-muted); }
@media (min-width: 600px) { .section { padding-block: var(--space-8); } .section-head h2 { font-size: var(--text-3xl); } }

/* Avatar: initials or a photo, 32px (40px with .avatar-lg) */
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; overflow: hidden; background: var(--color-secondary-soft); color: var(--color-secondary); font-size: var(--text-xs); font-weight: var(--weight-bold); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 40px; height: 40px; font-size: var(--text-sm); }

/* Simple list rows */
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list > li { display: flex; align-items: center; gap: var(--space-3); padding-block: var(--space-3); border-bottom: var(--border-width) solid var(--color-border); min-width: 0; }
.list > li:last-child { border-bottom: 0; }
.list .meta { color: var(--color-text-muted); font-size: var(--text-xs); }
.list .end { margin-left: auto; flex-shrink: 0; }

.card { display: grid; gap: var(--space-3); align-content: start; padding: var(--space-5); background: var(--color-surface); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--color-text); color: var(--color-bg); font-size: var(--text-sm); font-weight: var(--weight-semibold);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill); z-index: var(--z-toast);
}

/* =========================================================================
   Header
   Desktop (>= 1024): brand, inline nav, actions.
   Below desktop: brand, actions, menu button that opens the nav drawer.
   ========================================================================= */
.app-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: var(--color-bg); border-bottom: var(--border-width) solid var(--color-border);
}
.app-header-inner { display: flex; align-items: center; gap: var(--space-5); height: var(--header-height); }
.app-header .brand { display: inline-flex; flex-shrink: 0; text-decoration: none; }
.app-header .brand svg { height: 20px !important; }      /* 20px phone, 24px from tablet */
.app-nav { display: none; align-items: center; gap: var(--space-1); }
.app-nav a {
  display: inline-flex; align-items: center; height: 40px; padding: 0 var(--space-3);
  border-radius: var(--radius-md); color: var(--color-text-muted); text-decoration: none;
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
}
.app-nav a:hover { color: var(--color-text); background: var(--color-surface-muted); }
.app-nav a[aria-current="page"] { color: var(--color-text); box-shadow: inset 0 -2px 0 var(--color-primary); border-radius: 0; }
.app-header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.icon { width: 20px; height: 20px; flex-shrink: 0; }
@media (min-width: 600px) { .app-header .brand svg { height: 24px !important; } }
@media (min-width: 1024px) { .app-nav { display: flex; } .menu-btn { display: none; } }

/* =========================================================================
   Drawer (menu on phones and tablets) and scrim
   ========================================================================= */
.drawer {
  position: fixed; inset: 0 auto 0 0; width: var(--drawer-width); z-index: var(--z-drawer);
  display: flex; flex-direction: column; background: var(--color-surface); box-shadow: var(--shadow-lg);
  transform: translateX(-100%); visibility: hidden;
  transition: transform var(--duration-base) var(--ease-out), visibility 0s linear var(--duration-base);
}
.drawer.is-open { transform: none; visibility: visible; transition: transform var(--duration-base) var(--ease-out); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); height: var(--header-height); padding-inline: var(--space-4); border-bottom: var(--border-width) solid var(--color-border); }
.drawer-body { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: var(--space-1); padding: var(--space-3); }
.drawer-body a {
  display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-3);
  border-radius: var(--radius-md); color: var(--color-text); text-decoration: none; font-weight: var(--weight-semibold);
}
.drawer-body a:hover { background: var(--color-surface-muted); }
.drawer-body a[aria-current="page"] { background: var(--color-surface-muted); box-shadow: inset 3px 0 0 var(--color-primary); }
.drawer-body .side-section { padding: var(--space-4) var(--space-3) var(--space-1); }
.drawer-foot { display: grid; gap: var(--space-2); padding: var(--space-4); border-top: var(--border-width) solid var(--color-border); }
.scrim { position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); background: var(--color-scrim); opacity: 0; pointer-events: none; transition: opacity var(--duration-base) var(--ease-out); }
.scrim.is-open { opacity: 1; pointer-events: auto; }
body.drawer-open { overflow: hidden; }

/* =========================================================================
   App shell: header across the top, sidebar on the left, main content.
   Phone: no sidebar (its links open from the header menu as a drawer).
   Tablet: sidebar collapsed to icons (72px). Desktop: full sidebar (256px),
   which the user can collapse (.app-shell.is-collapsed).
   ========================================================================= */
.app-shell { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100dvh; }
.app-shell > .app-header { grid-column: 1 / -1; }
.app-sidebar {
  display: none; flex-direction: column; gap: var(--space-1);
  position: sticky; top: var(--header-height); height: calc(100dvh - var(--header-height)); overflow-y: auto;
  padding: var(--space-3); background: var(--color-surface); border-right: var(--border-width) solid var(--color-border);
}
.side-section { padding: var(--space-4) var(--space-3) var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-text-muted); }
.side-link {
  display: flex; align-items: center; gap: var(--space-3); min-height: 40px; padding: 0 var(--space-3);
  border-radius: var(--radius-md); color: var(--color-text-muted); text-decoration: none; white-space: nowrap;
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
}
.side-link:hover { background: var(--color-surface-muted); color: var(--color-text); }
.side-link[aria-current="page"] { background: var(--color-surface-muted); color: var(--color-text); box-shadow: inset 3px 0 0 var(--color-primary); }
.side-link .count { margin-left: auto; font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.app-sidebar .sidebar-foot { margin-top: auto; }
.app-main { min-width: 0; display: grid; grid-template-rows: 1fr auto; }
.app-content { display: grid; align-content: start; gap: var(--space-6); padding: var(--space-6) var(--gutter); width: 100%; max-width: var(--container-wide); }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-4); }
.page-head h1 { font-size: var(--text-2xl); font-weight: var(--weight-bold); }
.page-head p { color: var(--color-text-muted); font-size: var(--text-sm); margin-top: var(--space-1); }
@media (min-width: 600px) {
  .app-shell { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }
  .app-sidebar { display: flex; }
}
@media (min-width: 1024px) {
  .app-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .app-shell.is-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }
}
/* Collapsed sidebar: icons only, labels available as tooltips (title) and to screen readers */
@media (min-width: 600px) and (max-width: 1023.98px) {
  .app-sidebar .side-link { justify-content: center; padding: 0; }
  .app-sidebar .side-link > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .app-sidebar .side-section, .app-sidebar .side-link .count, .app-sidebar .collapse-btn { display: none; }
}
@media (min-width: 1024px) {
  .app-shell.is-collapsed .side-link { justify-content: center; padding: 0; }
  .app-shell.is-collapsed .side-link > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .app-shell.is-collapsed .side-section, .app-shell.is-collapsed .side-link .count { display: none; }
  .app-shell.is-collapsed .collapse-btn .icon { transform: scaleX(-1); }
}

/* =========================================================================
   Footers
   .site-footer: marketing sites (4 columns desktop, 2 tablet, 1 phone)
   .app-footer:  inside apps (one quiet row)
   ========================================================================= */
.site-footer { background: var(--color-surface-muted); font-size: var(--text-sm); }
.site-footer-grid { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr); padding-block: var(--space-8) var(--space-6); }
.site-footer-brand { display: grid; gap: var(--space-3); align-content: start; }
.site-footer-brand p { color: var(--color-text-muted); max-width: 32ch; }
.site-footer h2 { font-family: var(--font-body); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.site-footer a { color: var(--color-text); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer-base { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); padding-block: var(--space-5); border-top: var(--border-width) solid var(--color-border); color: var(--color-text-muted); font-size: var(--text-xs); }
.site-footer-base nav { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.site-footer-base a { color: var(--color-text-muted); }
@media (min-width: 600px)  { .site-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .site-footer-grid { grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); } }
.app-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-5); padding: var(--space-4) var(--gutter); border-top: var(--border-width) solid var(--color-border); font-size: var(--text-xs); color: var(--color-text-muted); }
.app-footer a { color: var(--color-text-muted); }

/* Showing SYOK inside someone else's product (DESIGN.md §5.4)
   .powered-by: "Powered by SYOK" in a footer. The mark is rendered by syok-mark.js
                (<span class="syok-mark" data-syok-mark>); outside this system use logos/badges/.
   .btn-syok:   "Sign in with SYOK". The plain master ring, never a product O. */
.powered-by { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text-muted); text-decoration: none; white-space: nowrap; }
.powered-by .syok-mark svg { height: 14px; }
.powered-by:hover { color: var(--color-text); }
.powered-by:focus-visible { outline: none; box-shadow: var(--ring-focus); border-radius: var(--radius-sm); }
.btn-syok { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); box-shadow: var(--shadow-xs); }
.btn-syok:hover { background: var(--color-surface-muted); border-color: color-mix(in srgb, var(--color-border) 60%, var(--color-text-muted)); }
.btn-syok svg circle { fill: none; stroke: var(--color-accent); stroke-width: 22; }

/* =========================================================================
   Cards
   .card is the base. Variants: .card-link (whole card clickable),
   .listing-card (photo on top), .stat-card (one number).
   ========================================================================= */
.card-link { position: relative; transition: box-shadow var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out); }
.card-link:hover { box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--color-border) 50%, var(--color-text-muted)); }
.card-link a.stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* one real link, whole card clickable */
.card-link a.stretched { color: inherit; text-decoration: none; }
.card-link a.stretched:focus-visible { outline: none; }
.card-link:has(a.stretched:focus-visible) { box-shadow: var(--ring-focus); }
.card-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-bold); line-height: var(--leading-snug); }
.card-text { color: var(--color-text-muted); font-size: var(--text-sm); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: auto; padding-top: var(--space-2); }

.listing-card { padding: 0; gap: 0; overflow: hidden; }
.listing-card .media { position: relative; aspect-ratio: 4 / 3; background: var(--color-surface-muted); }
.listing-card .media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-card .media .badge { position: absolute; left: var(--space-3); top: var(--space-3); }
.listing-card .media .fav { position: absolute; right: var(--space-2); top: var(--space-2); z-index: 1; background: var(--color-surface); box-shadow: var(--shadow-sm); border-radius: 50%; }
.listing-card .fav[aria-pressed="true"] { color: var(--color-primary); }
.listing-card .fav[aria-pressed="true"] svg { fill: currentColor; }
.listing-card .body { display: grid; gap: var(--space-1); padding: var(--space-4); }
.listing-card .price { font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.listing-card .meta { color: var(--color-text-muted); font-size: var(--text-sm); }

.stat-card { gap: var(--space-1); }
.stat-card .value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; line-height: 1.1; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.delta.up { color: var(--color-success-text); }
.delta.down { color: var(--color-danger-text); }
.delta.flat { color: var(--color-text-muted); }

/* =========================================================================
   Table
   Desktop: full table. Tablet: .table-wrap scrolls sideways with the first
   column fixed. Phone (.table-stack): each row becomes a card; cells show
   their data-label.
   ========================================================================= */
.table-wrap { overflow-x: auto; border: var(--border-width) solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--text-sm); }
.table th, .table td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: var(--border-width) solid var(--color-border); vertical-align: middle; white-space: nowrap; background: var(--color-surface); }
.table thead th { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--color-surface-muted); color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--color-surface-muted) 60%, var(--color-surface)); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .wrap-cell { white-space: normal; min-width: 14rem; }
.table th:first-child, .table td:first-child { position: sticky; left: 0; z-index: 1; }
.table thead th:first-child { z-index: calc(var(--z-sticky) + 1); }
.table tr.is-selected td { background: var(--color-secondary-soft); }
.sort-btn { all: unset; display: inline-flex; align-items: center; gap: var(--space-1); cursor: pointer; border-radius: var(--radius-sm); }
.sort-btn:focus-visible { box-shadow: var(--ring-focus); }
.sort-btn::after { content: "↕"; opacity: .45; font-size: 11px; }
[aria-sort="ascending"] .sort-btn::after { content: "↑"; opacity: 1; }
[aria-sort="descending"] .sort-btn::after { content: "↓"; opacity: 1; }
.table-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-top: var(--border-width) solid var(--color-border); font-size: var(--text-sm); color: var(--color-text-muted); background: var(--color-surface); }
@media (max-width: 599.98px) {
  .table-stack { border: 0; background: none; overflow: visible; }
  .table-stack .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-stack .table, .table-stack .table tbody, .table-stack .table tr, .table-stack .table td, .table-stack .table th[scope="row"] { display: block; width: 100%; }
  .table-stack .table tr { margin-bottom: var(--space-3); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface); }
  .table-stack .table td, .table-stack .table th[scope="row"] { position: static; display: flex; justify-content: space-between; gap: var(--space-4); white-space: normal; text-align: right; border-bottom: var(--border-width) solid var(--color-border); }
  .table-stack .table td::before, .table-stack .table th[scope="row"]::before { content: attr(data-label); color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); text-align: left; }
  .table-stack .table td:first-child, .table-stack .table th[scope="row"] { text-align: right; font-weight: var(--weight-semibold); background: var(--color-surface-muted); }
  .table-stack .table tr > :last-child { border-bottom: 0; }
  .table-stack .table-bar { border: 0; background: none; padding-inline: 0; }
}

/* =========================================================================
   Navigation pieces: tabs, breadcrumbs, pagination, list items
   ========================================================================= */
.tabs { display: flex; gap: var(--space-1); border-bottom: var(--border-width) solid var(--color-border); overflow-x: auto; scrollbar-width: none; }
.tab { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: var(--space-2); height: 44px; padding: 0 var(--space-3); cursor: pointer; white-space: nowrap; color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-semibold); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.tab:hover { color: var(--color-text); background: var(--color-surface-muted); }
.tab[aria-selected="true"] { color: var(--color-text); box-shadow: inset 0 -2px 0 var(--color-primary); }
.tab:focus-visible { box-shadow: var(--ring-focus); }
.tab .count { font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.tab-panel { padding-top: var(--space-5); }
.tab-panel[hidden] { display: none; }

.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); }
.breadcrumb li { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); }
.breadcrumb li + li::before { content: "/"; color: var(--color-border-strong); opacity: .3; }
.breadcrumb a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-text); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--color-text); font-weight: var(--weight-semibold); }

.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 var(--space-2); border-radius: var(--radius-md); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); text-decoration: none; font-variant-numeric: tabular-nums; }
.pagination a:hover { background: var(--color-surface-muted); }
.pagination [aria-current="page"] { background: var(--color-text); color: var(--color-bg); }
.pagination .gap { color: var(--color-text-muted); }
.pagination .btn { height: 32px; }

.list-item { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-2) var(--space-4); color: inherit; text-decoration: none; border-bottom: var(--border-width) solid var(--color-border); }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, button.list-item:hover { background: var(--color-surface-muted); }
.list-item .lead-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius-md); background: var(--color-surface-muted); color: var(--color-text); }
.list-item .text { display: grid; min-width: 0; }
.list-item .title { font-weight: var(--weight-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .sub { color: var(--color-text-muted); font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .trail { margin-left: auto; flex-shrink: 0; display: flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); font-size: var(--text-sm); }
.list-box { border: var(--border-width) solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); overflow: hidden; }

/* =========================================================================
   Overlays: dialog, menu, tooltip, toast
   ========================================================================= */
.dialog { width: min(560px, calc(100vw - 2 * var(--space-4))); max-height: min(85dvh, 720px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: var(--color-scrim); }
.dialog[open] { display: flex; flex-direction: column; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) var(--space-5) 0; }
.dialog-head h2 { font-size: var(--text-xl); font-weight: var(--weight-bold); }
.dialog-body { padding: var(--space-4) var(--space-5); overflow-y: auto; color: var(--color-text-muted); }
.dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); padding: 0 var(--space-5) var(--space-5); }
@media (max-width: 599.98px) {   /* phones: bottom sheet */
  .dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .dialog-foot { flex-direction: column-reverse; }
  .dialog-foot .btn { width: 100%; }
}

.menu-wrap { position: relative; display: inline-block; }
.menu { position: absolute; z-index: var(--z-dialog); top: calc(100% + var(--space-1)); right: 0; min-width: 200px; padding: var(--space-1); background: var(--color-surface); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); display: grid; }
.menu[hidden] { display: none; }
.menu-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-sm); font-size: var(--text-sm); cursor: pointer; color: var(--color-text); }
.menu-item:hover, .menu-item:focus-visible { background: var(--color-surface-muted); }
.menu-item.danger { color: var(--color-danger-text); }
.menu-sep { height: 1px; margin: var(--space-1) 0; background: var(--color-border); }

[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--color-text); color: var(--color-bg);
  font-size: var(--text-xs); font-weight: var(--weight-semibold); white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--duration-fast) var(--ease-out); z-index: var(--z-toast);
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; transition-delay: 300ms; }

.toast-stack { position: fixed; z-index: var(--z-toast); left: 50%; bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: var(--space-2); width: min(420px, calc(100vw - 2 * var(--space-4))); }
.toast-stack .toast { position: static; transform: none; display: flex; align-items: center; gap: var(--space-3); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); box-shadow: var(--shadow-lg); }
.toast-stack .toast .btn { margin-left: auto; height: 28px; color: var(--color-bg); }
.toast-stack .toast.success::before, .toast-stack .toast.error::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.toast-stack .toast.success::before { background: var(--syok-segar-400); }
.toast-stack .toast.error::before { background: var(--syok-bahaya-400); }

/* =========================================================================
   Form controls
   ========================================================================= */
.field .req { color: var(--color-danger-text); margin-left: 2px; }
.field .optional { color: var(--color-text-muted); font-weight: var(--weight-regular); }
textarea.input { height: auto; min-height: 96px; padding-block: var(--space-2); resize: vertical; line-height: var(--leading-body); }
.input:disabled, .select:disabled { opacity: .55; cursor: not-allowed; background: var(--color-surface-muted); }
.input.is-success { border-color: var(--color-success); }
.hint.ok { color: var(--color-success-text); font-weight: var(--weight-semibold); }
.select {
  appearance: none; font: inherit; color: var(--color-text); background-color: var(--color-surface); width: 100%; height: 40px;
  padding: 0 36px 0 var(--space-3); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.select:focus { outline: none; border-color: var(--color-focus); box-shadow: var(--ring-focus); }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--color-text-muted); pointer-events: none; }
.input-icon > .input { padding-left: 36px; }

.check, .radio { display: inline-flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-sm); cursor: pointer; min-height: 24px; }
.check input, .radio input {
  appearance: none; flex-shrink: 0; width: 20px; height: 20px; margin: 0; border: 1.5px solid color-mix(in srgb, var(--color-border) 30%, var(--color-text-muted));
  background: var(--color-surface); display: inline-grid; place-items: center; cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.check input { border-radius: var(--radius-sm); }
.radio input { border-radius: 50%; }
.check input:checked { background: var(--color-secondary); border-color: var(--color-secondary); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--color-on-secondary); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.radio input:checked { border: 6px solid var(--color-secondary); }
.check input:focus-visible, .radio input:focus-visible, .switch input:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.check input:disabled, .radio input:disabled { opacity: .5; cursor: not-allowed; }
.check .sub, .radio .sub { display: block; color: var(--color-text-muted); font-size: var(--text-xs); }

.switch { display: inline-flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); cursor: pointer; }
.switch input {
  appearance: none; flex-shrink: 0; position: relative; width: 40px; height: 24px; margin: 0; border-radius: var(--radius-pill); cursor: pointer;
  background: color-mix(in srgb, var(--color-border) 40%, var(--color-text-muted)); transition: background var(--duration-fast) var(--ease-out);
}
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: var(--shadow-sm); transition: transform var(--duration-fast) var(--ease-out); }
.switch input:checked { background: var(--color-secondary); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:disabled { opacity: .5; cursor: not-allowed; }
fieldset.group { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
fieldset.group legend { font-size: var(--text-sm); font-weight: var(--weight-semibold); margin-bottom: var(--space-2); padding: 0; }

/* =========================================================================
   Avatars (sizes, group, status)
   ========================================================================= */
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-xl { width: 64px; height: 64px; font-size: var(--text-lg); }
.avatar-group { display: inline-flex; }
.avatar-group .avatar { box-shadow: 0 0 0 2px var(--color-surface); }
.avatar-group .avatar + .avatar { margin-left: -8px; }
.avatar-status { position: relative; display: inline-flex; }
.avatar-status::after { content: ""; position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--color-text-muted); box-shadow: 0 0 0 2px var(--color-surface); }
.avatar-status.online::after { background: var(--syok-segar-400); }
.avatar-status.busy::after { background: var(--syok-bahaya-400); }

/* =========================================================================
   States: empty, loading, error
   ========================================================================= */
.empty { display: grid; justify-items: center; gap: var(--space-3); text-align: center; padding: var(--space-8) var(--space-5); }
.empty .o-glyph { width: 56px; height: 56px; opacity: .9; }
.empty h3 { font-size: var(--text-lg); }
.empty p { color: var(--color-text-muted); font-size: var(--text-sm); max-width: 36ch; }
/* Spinner: the O as a loader (an Emas arc on a faint ring). Size follows the font size;
   put it in a button with a label ("Saving…"), or alone with role="status" and an aria-label. */
.spinner { display: inline-block; width: 1.25em; height: 1.25em; flex-shrink: 0; border-radius: 50%; vertical-align: -0.2em;
  border: 0.26em solid color-mix(in srgb, var(--color-accent) 22%, transparent); border-top-color: var(--color-accent);
  animation: syok-spin 1s linear infinite; }
.spinner-lg { width: 40px; height: 40px; border-width: 9px; }
@keyframes syok-spin { to { transform: rotate(360deg); } }
/* With reduced motion the global rule stops it: a still arc, still clearly "loading" with its label. */
.skeleton { display: block; border-radius: var(--radius-sm); background: var(--color-surface-muted); animation: syok-pulse 1.4s ease-in-out infinite; }
@keyframes syok-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.skeleton.line { height: 12px; }
.skeleton.title { height: 20px; width: 60%; }
.skeleton.box { aspect-ratio: 4 / 3; border-radius: var(--radius-md); }
.skeleton.circle { width: 40px; height: 40px; border-radius: 50%; }
.error-page { display: grid; place-items: center; min-height: 70dvh; text-align: center; padding: var(--space-8) var(--gutter); }
.error-page .code { display: inline-flex; align-items: center; gap: .06em; font-family: var(--font-display); font-size: clamp(4rem, 14vw, 7rem); font-weight: var(--weight-bold); line-height: 1; color: var(--color-night); }
.error-page .code .o-glyph { width: .78em; height: .78em; }
.error-page h1 { font-size: var(--text-2xl); margin-top: var(--space-3); }
.error-page p { color: var(--color-text-muted); margin: var(--space-3) auto var(--space-5); }
.error-page .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }

/* =========================================================================
   Theme switch: System / Light / Dark (a radio group).
   Pair with the head snippet in DESIGN.md §8.1 so the saved theme applies
   before the first paint.
   ========================================================================= */
.theme-switch { display: inline-flex; padding: 2px; gap: 2px; border: var(--border-width) solid var(--color-border); border-radius: var(--radius-pill); background: var(--color-surface-muted); }
.theme-switch label { position: relative; display: inline-flex; align-items: center; gap: var(--space-1); height: 28px; padding: 0 var(--space-3); border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text-muted); cursor: pointer; }
.theme-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.theme-switch label:has(input:checked) { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-xs); }
.theme-switch label:has(input:focus-visible) { box-shadow: var(--ring-focus); }

/* =========================================================================
   Forced colours (Windows contrast themes): the OS picks the colours, so
   anything that relied on fills or shadows gets a real border or outline.
   ========================================================================= */
@media (forced-colors: active) {
  .btn, .input, .select, .card, .chip, .badge, .alert, .menu, .dialog, .toast, .theme-switch label:has(input:checked) { border: 1px solid CanvasText; }
  :focus-visible, .btn:focus-visible, .input:focus, .select:focus { outline: 3px solid Highlight; outline-offset: 2px; }
  .tab[aria-selected="true"], .app-nav a[aria-current="page"] { border-bottom: 3px solid Highlight; }
  .side-link[aria-current="page"], .drawer-body a[aria-current="page"] { outline: 2px solid Highlight; }
  .switch input { border: 1px solid CanvasText; }
  .switch input::after { background: CanvasText; forced-color-adjust: none; }
  .switch input:checked::after { background: Canvas; }
  .check input:checked, .radio input:checked, .switch input:checked { background: Highlight; border-color: Highlight; forced-color-adjust: none; }
  .syok-mark .syok-letter, .syok-lockup .syok-letter { stroke: CanvasText !important; }
  .syok-lockup .syok-o-glyph, .o-glyph path, .syok-lockup .lockup-name { fill: CanvasText; }
  .skeleton { border: 1px dashed CanvasText; }
  .brand-strip { forced-color-adjust: none; }
}

/* =========================================================================
   Charts (plain SVG). Colours: --chart-1…5 in order; see DESIGN.md §1.6.
   ========================================================================= */
.chart { margin: 0; }
.chart-title { font-weight: var(--weight-semibold); }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-3); font-size: var(--text-xs); color: var(--color-text-muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: var(--space-2); }
.chart-legend i { width: 12px; height: 4px; border-radius: 2px; }
.chart-plot { position: relative; margin-top: var(--space-4); }
.chart-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.c-grid { stroke: var(--chart-grid); stroke-width: 1; }
.c-axis { fill: var(--chart-axis); font-size: 11px; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.c-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.c-end { stroke: var(--color-surface); stroke-width: 2; }
.c-label { fill: var(--color-text); font-size: 12px; font-weight: 600; font-family: var(--font-body); }
.c-cross { stroke: var(--color-text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.c-hit { fill: transparent; cursor: crosshair; touch-action: pan-y; }
.c-bar { rx: 4px; }
.chart-tip { position: absolute; top: 0; z-index: var(--z-sticky); display: grid; gap: var(--space-1); min-width: 160px; padding: var(--space-2) var(--space-3); background: var(--color-surface); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); font-size: var(--text-xs); pointer-events: none; }
.chart-tip span { display: flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); }
.chart-tip span b { margin-left: auto; color: var(--color-text); font-variant-numeric: tabular-nums; }
.chart-tip i { width: 8px; height: 8px; border-radius: 50%; }
.chart-table { margin-top: var(--space-4); font-size: var(--text-sm); }
.chart-table summary { cursor: pointer; color: var(--color-link); font-weight: var(--weight-semibold); }

/* =========================================================================
   Bottom navigation (phones): 3–5 destinations, icon + label, always both.
   Hidden from desktop up, where the header or sidebar takes over.
   ========================================================================= */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-header);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--color-surface); border-top: var(--border-width) solid var(--color-border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: var(--space-1) 0; color: var(--color-text-muted); text-decoration: none; font-size: 11px; font-weight: var(--weight-semibold); }
.bottom-nav a .pill { display: grid; place-items: center; width: 56px; height: 28px; border-radius: var(--radius-pill); }
.bottom-nav a .icon { width: 22px; height: 22px; }
.bottom-nav a[aria-current="page"] { color: var(--color-text); }
.bottom-nav a[aria-current="page"] .pill { background: var(--color-surface-muted); box-shadow: inset 0 0 0 1px var(--color-border); }
.bottom-nav a .badge-dot { position: relative; }
.has-bottom-nav { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1024px) { .bottom-nav { display: none; } .has-bottom-nav { padding-bottom: 0; } }
@media (forced-colors: active) { .bottom-nav a[aria-current="page"] .pill { outline: 2px solid Highlight; } }
