/* ==========================================================================
   Proxuno — application stylesheet
   Owner: F2 (UI design system). See CONTRACT.md for markup snippets.

   Table of contents
   01. Fonts
   02. Design tokens (light, dark)
   03. Reset & base
   04. Typography
   05. Layout primitives (container, grid, stack, cluster, section)
   06. Utilities (small, documented set)
   07. Logo, icons, flags
   08. Buttons
   09. Forms
   10. Cards, stat cards, definition lists
   11. Badges, pills, status pill, crypto badges, carrier chips
   12. Alerts, flash, toasts
   13. Tables
   14. Tabs, accordion, segmented control
   15. Dropdown menu, tooltip, modal
   16. Code blocks, code tabs, credential chip, kbd
   17. Progress / usage, empty states, skeleton
   18. Breadcrumbs, pagination, year navigation, timeline
   19. Uptime bars
   20. Announcement bar & site header (dropdowns, mega menu, drawer)
   21. Hero, page hero, section header, CTA band
   22. Pricing, comparison table, feature grid
   23. Country grid & coverage
   24. Docs layout & prose
   25. Site footer & language switcher
   26. Dashboard shell
   27. Admin layout
   28. Auth layout
   29. Error pages & styleguide
   30. Motion preferences
   31. Print
   ========================================================================== */

/* 01. Fonts ================================================================ */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/vendor/inter/files/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/vendor/inter/files/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("/vendor/inter/files/inter-latin-ext-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("/vendor/inter/files/inter-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/vendor/jetbrains-mono/files/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/vendor/jetbrains-mono/files/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 02. Design tokens ======================================================== */

:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #F0F2F5;
  --surface-3: #E8EBF0;
  --surface-raised: #FFFFFF;
  --border: #E3E6EB;
  --border-strong: #CDD2DA;

  /* Text */
  --text: #0E1726;
  --text-muted: #5B6576;
  --text-subtle: #8A93A3; /* decorative / large text only (3:1) */
  --text-inverse: #FFFFFF;

  /* Brand */
  --brand: #2448E8;
  --brand-hover: #1B39C4;
  --brand-solid: #2448E8; /* background of primary buttons (white text) */
  --brand-solid-hover: #1B39C4;
  --brand-soft: #EAEFFF;
  --brand-soft-border: #C9D4FF;
  --brand-text: #2448E8; /* brand-coloured TEXT (links, active nav, chips on --brand-soft): AA in both themes */
  --on-brand: #FFFFFF;

  /* Ink bands (hero, footer, auth panel) — identical in both themes */
  --ink: #0B1426;
  --ink-2: #111D35;
  --ink-3: #18264A;
  --ink-border: rgba(255, 255, 255, 0.10);
  --ink-border-strong: rgba(255, 255, 255, 0.18);
  --ink-text: #E6EAF2;
  --ink-muted: #A3AEC2;
  --ink-brand: #8FA6FF;

  /* Semantic */
  --signal: #0FA968;
  --signal-text: #087A4A;
  --signal-soft: #E5F6EE;
  --signal-border: #B5E4CD;
  --warn: #E58A00;
  --warn-text: #8C5300;
  --warn-soft: #FDF2E0;
  --warn-border: #F5D29C;
  --danger: #E23D3D;
  --danger-text: #B42323;
  --danger-soft: #FDECEC;
  --danger-border: #F6C3C3;
  --info: #2448E8;
  --info-text: #1B39C4;
  --info-soft: #EAEFFF;
  --info-border: #C9D4FF;

  /* Code */
  --code-bg: #0F1A2E;
  --code-bg-2: #16233D;
  --code-text: #DCE3EF;
  --code-muted: #8794AB;
  --code-border: #1F2D4A;
  --inline-code-bg: #EEF1F6;
  --inline-code-text: #1C2B4A;

  /* Charts */
  --chart-1: #2448E8;
  --chart-2: #0FA968;
  --chart-3: #E58A00;
  --chart-4: #7A5AF8;
  --chart-5: #E23D3D;
  --chart-grid: #E8EBF0;
  --chart-text: #5B6576;

  /* Uptime */
  --uptime-ok: #0FA968;
  --uptime-minor: #E5B200;
  --uptime-partial: #E58A00;
  --uptime-major: #E23D3D;
  --uptime-none: #D5DAE2;

  /* Typography */
  --font-sans: "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-2xs: 0.6875rem;  /* 11 */
  --fs-xs: 0.75rem;     /* 12 */
  --fs-sm: 0.8125rem;   /* 13 */
  --fs-base: 0.9375rem; /* 15 */
  --fs-md: 1rem;        /* 16 */
  --fs-lg: 1.125rem;    /* 18 */
  --fs-xl: 1.25rem;     /* 20 */
  --fs-2xl: 1.5rem;     /* 24 */
  --fs-3xl: 1.875rem;   /* 30 */
  --fs-4xl: 2.25rem;    /* 36 */
  --fs-5xl: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem); /* 36 → 56 */
  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-base: 1.6;
  --tracking-tight: -0.02em;
  --tracking-wide: 0.06em;

  /* Spacing (4px grid) */
  --s-0: 0;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 28px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-14: 56px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;

  /* Radius, borders, shadows */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;      /* controls */
  --radius-lg: 12px;  /* cards */
  --radius-xl: 16px;
  --radius-full: 999px;
  --shadow-xs: 0 1px 1px rgba(14, 23, 38, 0.04);
  --shadow-sm: 0 1px 2px rgba(14, 23, 38, 0.06), 0 1px 1px rgba(14, 23, 38, 0.03);
  --shadow-md: 0 4px 12px rgba(14, 23, 38, 0.08), 0 1px 3px rgba(14, 23, 38, 0.06);
  --shadow-lg: 0 16px 40px rgba(14, 23, 38, 0.14), 0 2px 6px rgba(14, 23, 38, 0.06);
  --focus-ring: 0 0 0 3px rgba(36, 72, 232, 0.28);
  --focus-outline: 2px solid var(--brand);
  --overlay: rgba(11, 20, 38, 0.52);

  /* Layout */
  --container: 1200px;
  --container-narrow: 760px;
  --container-wide: 1360px;
  --gutter: 16px;
  --header-h: 64px;
  --announce-h: 36px;
  --sidebar-w: 248px;
  --topbar-h: 60px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 160ms;
}

/* Dark tokens (explicit choice) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1220;
  --surface: #111A2B;
  --surface-2: #16213A;
  --surface-3: #1C2946;
  --surface-raised: #142036;
  --border: #22304A;
  --border-strong: #31415F;
  --text: #E6EAF2;
  --text-muted: #9AA6BA;
  --text-subtle: #75819A;
  --text-inverse: #0B1220;
  --brand: #5B7CFF;
  --brand-hover: #7A95FF;
  --brand-solid: #3D5FF5;
  --brand-solid-hover: #5272FF;
  --brand-soft: #18244A;
  --brand-soft-border: #2A3D7A;
  --brand-text: #8FA6FF;
  --on-brand: #FFFFFF;
  --ink: #070D19;
  --ink-2: #0D1628;
  --ink-3: #142039;
  --signal: #19C27B;
  --signal-text: #4FD69C;
  --signal-soft: #0F2A22;
  --signal-border: #1B4A39;
  --warn: #F29A1A;
  --warn-text: #F5B656;
  --warn-soft: #2D2312;
  --warn-border: #5A4220;
  --danger: #F05252;
  --danger-text: #FF8A8A;
  --danger-soft: #2F1619;
  --danger-border: #5C2A2F;
  --info: #5B7CFF;
  --info-text: #9FB2FF;
  --info-soft: #18244A;
  --info-border: #2A3D7A;
  --code-bg: #080F1D;
  --code-bg-2: #0E182B;
  --code-text: #DCE3EF;
  --code-muted: #8794AB;
  --code-border: #1E2B45;
  --inline-code-bg: #1A2640;
  --inline-code-text: #D5DDF0;
  --chart-1: #6B89FF;
  --chart-2: #2BCB86;
  --chart-3: #F2A33A;
  --chart-4: #9D86FF;
  --chart-5: #F26D6D;
  --chart-grid: #1F2C45;
  --chart-text: #9AA6BA;
  --uptime-none: #2A3752;
  --shadow-xs: 0 1px 1px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --focus-ring: 0 0 0 3px rgba(91, 124, 255, 0.4);
  --overlay: rgba(3, 7, 15, 0.66);
}

/* Dark tokens (system preference, no explicit choice) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B1220;
    --surface: #111A2B;
    --surface-2: #16213A;
    --surface-3: #1C2946;
    --surface-raised: #142036;
    --border: #22304A;
    --border-strong: #31415F;
    --text: #E6EAF2;
    --text-muted: #9AA6BA;
    --text-subtle: #75819A;
    --text-inverse: #0B1220;
    --brand: #5B7CFF;
    --brand-hover: #7A95FF;
    --brand-solid: #3D5FF5;
    --brand-solid-hover: #5272FF;
    --brand-soft: #18244A;
    --brand-soft-border: #2A3D7A;
    --brand-text: #8FA6FF;
    --on-brand: #FFFFFF;
    --ink: #070D19;
    --ink-2: #0D1628;
    --ink-3: #142039;
    --signal: #19C27B;
    --signal-text: #4FD69C;
    --signal-soft: #0F2A22;
    --signal-border: #1B4A39;
    --warn: #F29A1A;
    --warn-text: #F5B656;
    --warn-soft: #2D2312;
    --warn-border: #5A4220;
    --danger: #F05252;
    --danger-text: #FF8A8A;
    --danger-soft: #2F1619;
    --danger-border: #5C2A2F;
    --info: #5B7CFF;
    --info-text: #9FB2FF;
    --info-soft: #18244A;
    --info-border: #2A3D7A;
    --code-bg: #080F1D;
    --code-bg-2: #0E182B;
    --code-text: #DCE3EF;
    --code-muted: #8794AB;
    --code-border: #1E2B45;
    --inline-code-bg: #1A2640;
    --inline-code-text: #D5DDF0;
    --chart-1: #6B89FF;
    --chart-2: #2BCB86;
    --chart-3: #F2A33A;
    --chart-4: #9D86FF;
    --chart-5: #F26D6D;
    --chart-grid: #1F2C45;
    --chart-text: #9AA6BA;
    --uptime-none: #2A3752;
    --shadow-xs: 0 1px 1px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
    --focus-ring: 0 0 0 3px rgba(91, 124, 255, 0.4);
    --overlay: rgba(3, 7, 15, 0.66);
  }
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
}
@media (min-width: 1280px) {
  :root { --gutter: 32px; }
}

/* 03. Reset & base ========================================================= */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  font-feature-settings: "cv11", "ss01";
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
svg.icon { display: inline-block; flex-shrink: 0; vertical-align: middle; }

input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }

p, h1, h2, h3, h4, h5, h6, figure, blockquote, dl, dd { margin: 0; }
:where(ul, ol)[class] { margin: 0; padding: 0; list-style: none; }

a {
  color: var(--brand-text);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--brand-hover); text-decoration: underline; }

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--brand-soft); color: var(--text); }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s-8) 0;
}

table { border-collapse: collapse; }

[hidden] { display: none !important; }

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 1000;
  padding: var(--s-2) var(--s-4);
  background: var(--brand-solid);
  color: var(--on-brand);
  border-radius: var(--radius);
  font-weight: 600;
}
.skip-link:focus { top: var(--s-3); color: var(--on-brand); text-decoration: none; }

.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 04. Typography =========================================================== */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5 {
  color: var(--text);
  font-weight: 650;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1, .h1 { font-size: var(--fs-4xl); font-weight: 700; }
h2, .h2 { font-size: var(--fs-3xl); }
h3, .h3 { font-size: var(--fs-xl); line-height: var(--lh-snug); }
h4, .h4 { font-size: var(--fs-lg); line-height: var(--lh-snug); }
h5, .h5 { font-size: var(--fs-md); line-height: var(--lh-snug); }
.display { font-size: var(--fs-5xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }

@media (max-width: 640px) {
  h1, .h1 { font-size: var(--fs-3xl); }
  h2, .h2 { font-size: var(--fs-2xl); }
}

.lead { font-size: var(--fs-lg); color: var(--text-muted); line-height: 1.55; text-wrap: pretty; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--brand-text);
}
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-lg { font-size: var(--fs-lg); }
small, .small { font-size: var(--fs-sm); }
strong, b { font-weight: 600; }

code, kbd, samp, pre, .mono { font-family: var(--font-mono); font-size: 0.875em; font-variant-ligatures: none; }
:not(pre) > code {
  padding: 0.12em 0.4em;
  border-radius: var(--radius-xs);
  background: var(--inline-code-bg);
  color: var(--inline-code-text);
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Main layout: keep the footer at the bottom of short pages */
body.layout-main { display: flex; flex-direction: column; }
body.layout-main > main { flex: 1 0 auto; }

/* 05. Layout primitives ==================================================== */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--container-narrow) + var(--gutter) * 2); }
.container--wide { max-width: calc(var(--container-wide) + var(--gutter) * 2); }

.section { padding-block: var(--s-16); }
.section--tight { padding-block: var(--s-10); }
.section--loose { padding-block: var(--s-24); }
.section--alt { background: var(--surface); border-block: 1px solid var(--border); }
@media (max-width: 767px) {
  .section { padding-block: var(--s-12); }
  .section--loose { padding-block: var(--s-16); }
}
.section.section--flush-top { padding-top: 0; } /* after the media query so phones keep it flush too */

/* Grid — use .grid--2/3/4 (responsive) or .grid--auto (auto-fit, min 260px) */
.grid { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); }
.grid--gap-sm { gap: var(--s-3); }
.grid--gap-lg { gap: var(--s-8); }
@media (min-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid--auto-sm { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }

/* Split: content + aside (aside 340px on desktop) */
.split { display: grid; gap: var(--s-8); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) {
  .split { grid-template-columns: minmax(0, 1fr) 340px; }
  .split--reverse { grid-template-columns: 340px minmax(0, 1fr); }
  .split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Stack: vertical rhythm; --stack-gap overridable */
.stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--s-4)); }
.stack--xs { --stack-gap: var(--s-1); }
.stack--sm { --stack-gap: var(--s-2); }
.stack--md { --stack-gap: var(--s-6); }
.stack--lg { --stack-gap: var(--s-8); }
.stack--xl { --stack-gap: var(--s-12); }

/* Cluster: horizontal wrap */
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--s-3)); }
.cluster--sm { --cluster-gap: var(--s-2); }
.cluster--lg { --cluster-gap: var(--s-5); }
.cluster--between { justify-content: space-between; }
.cluster--end { justify-content: flex-end; }
.cluster--start { align-items: flex-start; }

.divider { height: 1px; background: var(--border); border: 0; margin: var(--s-6) 0; }

/* 06. Utilities ============================================================
   Kept intentionally small. Prefer components.
   .u-mono .u-num .u-muted .u-subtle .u-strong .u-center .u-right .u-nowrap
   .u-truncate .u-break .u-sm .u-xs .u-mt-0/2/4/6/8 .u-mb-0/2/4/6/8
   .u-hide-mobile .u-hide-desktop .u-full .u-flex-1 .u-gap-2
   ========================================================================== */

.u-mono { font-family: var(--font-mono); font-size: 0.92em; font-variant-ligatures: none; }
.u-num { font-variant-numeric: tabular-nums; }
.u-muted { color: var(--text-muted); }
.u-subtle { color: var(--text-subtle); }
.u-strong { font-weight: 600; color: var(--text); }
.u-success { color: var(--signal-text); }
.u-warning { color: var(--warn-text); }
.u-danger { color: var(--danger-text); }
.u-brand { color: var(--brand-text); }
.u-center { text-align: center; }
.u-right { text-align: right; }
.u-nowrap { white-space: nowrap; }
.u-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.u-break { overflow-wrap: anywhere; word-break: break-word; }
.u-sm { font-size: var(--fs-sm); }
.u-xs { font-size: var(--fs-xs); }
.u-mt-0 { margin-top: 0 !important; }
.u-mt-2 { margin-top: var(--s-2) !important; }
.u-mt-4 { margin-top: var(--s-4) !important; }
.u-mt-6 { margin-top: var(--s-6) !important; }
.u-mt-8 { margin-top: var(--s-8) !important; }
.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-2 { margin-bottom: var(--s-2) !important; }
.u-mb-4 { margin-bottom: var(--s-4) !important; }
.u-mb-6 { margin-bottom: var(--s-6) !important; }
.u-mb-8 { margin-bottom: var(--s-8) !important; }
.u-full { width: 100%; }
.u-flex-1 { flex: 1 1 0; min-width: 0; }
.u-gap-2 { gap: var(--s-2); }
@media (max-width: 767px) { .u-hide-mobile { display: none !important; } }
@media (min-width: 768px) { .u-hide-desktop { display: none !important; } }

/* 07. Logo, icons, flags =================================================== */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.logo:hover { color: var(--text); text-decoration: none; }
.logo__mark { width: 28px; height: 28px; flex-shrink: 0; }
.logo__mark .logo-bg { fill: var(--brand-solid); }
.logo__mark .logo-bar { fill: #FFFFFF; }
.logo__mark .logo-bar--dim { fill: #FFFFFF; opacity: 0.55; }
.logo--on-ink { color: #FFFFFF; }
.logo--on-ink:hover { color: #FFFFFF; }
.logo--sm .logo__mark { width: 24px; height: 24px; }
.logo--sm { font-size: 1rem; }

.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand-text);
  border: 1px solid var(--brand-soft-border);
  flex-shrink: 0;
}
.icon-tile--sm { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.icon-tile--neutral { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
.icon-tile--success { background: var(--signal-soft); color: var(--signal-text); border-color: var(--signal-border); }
.icon-tile--warning { background: var(--warn-soft); color: var(--warn-text); border-color: var(--warn-border); }
.icon-tile--danger { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-border); }

/* flag-icons: soften edges, keep 4:3 */
.fi {
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(14, 23, 38, 0.08);
  flex-shrink: 0;
}
.fi.fis { border-radius: 50%; }
.fi-lg { font-size: 1.5em; }
.fi-xl { font-size: 2.25em; border-radius: 3px; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--brand-soft-border);
  flex-shrink: 0;
}
.avatar--lg { width: 44px; height: 44px; font-size: var(--fs-sm); }

/* 08. Buttons ============================================================== */

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  --btn-bg-hover: var(--surface-2);
  --btn-border-hover: var(--border-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  user-select: none;
  box-shadow: var(--shadow-xs);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-border-hover);
  color: var(--btn-fg);
  text-decoration: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; box-shadow: none; }
.btn .icon { width: 16px; height: 16px; }

.btn--primary {
  --btn-bg: var(--brand-solid);
  --btn-fg: var(--on-brand);
  --btn-border: var(--brand-solid);
  --btn-bg-hover: var(--brand-solid-hover);
  --btn-border-hover: var(--brand-solid-hover);
  box-shadow: 0 1px 2px rgba(36, 72, 232, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn--secondary {
  --btn-bg: var(--surface);
  --btn-border: var(--border-strong);
}
.btn--soft {
  --btn-bg: var(--brand-soft);
  --btn-fg: var(--brand);
  --btn-border: var(--brand-soft-border);
  --btn-bg-hover: var(--brand-soft);
  --btn-border-hover: var(--brand);
  box-shadow: none;
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-border: transparent;
  --btn-bg-hover: var(--surface-2);
  --btn-border-hover: transparent;
  box-shadow: none;
}
.btn--danger {
  --btn-bg: #C93434;
  --btn-fg: #FFFFFF;
  --btn-border: #C93434;
  --btn-bg-hover: #AE2828;
  --btn-border-hover: #AE2828;
}
.btn--danger-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--danger-text);
  --btn-border: var(--danger-border);
  --btn-bg-hover: var(--danger-soft);
  --btn-border-hover: var(--danger);
  box-shadow: none;
}
.btn--link {
  --btn-bg: transparent;
  --btn-border: transparent;
  --btn-bg-hover: transparent;
  --btn-border-hover: transparent;
  --btn-fg: var(--brand);
  padding-inline: 0;
  min-height: auto;
  box-shadow: none;
}
.btn--link:hover { text-decoration: underline; color: var(--brand-hover); }

/* On ink bands */
.btn--on-ink {
  --btn-bg: rgba(255, 255, 255, 0.06);
  --btn-fg: #FFFFFF;
  --btn-border: rgba(255, 255, 255, 0.22);
  --btn-bg-hover: rgba(255, 255, 255, 0.12);
  --btn-border-hover: rgba(255, 255, 255, 0.36);
  box-shadow: none;
}
.btn--white {
  --btn-bg: #FFFFFF;
  --btn-fg: #0B1426;
  --btn-border: #FFFFFF;
  --btn-bg-hover: #E9EDF5;
  --btn-border-hover: #E9EDF5;
}

.btn--xs { min-height: 28px; padding: 3px 10px; font-size: var(--fs-xs); border-radius: var(--radius-sm); gap: 6px; }
.btn--xs .icon { width: 14px; height: 14px; }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: var(--fs-sm); }
.btn--lg { min-height: 48px; padding: 12px 22px; font-size: var(--fs-base); }
.btn--lg .icon { width: 18px; height: 18px; }
.btn--block { display: flex; width: 100%; }

.btn--icon { padding: 0; width: 40px; min-height: 40px; }
.btn--icon.btn--sm { width: 34px; min-height: 34px; }
.btn--icon.btn--xs { width: 28px; min-height: 28px; }

/* Loading state (added by JS for [data-loading]) */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--btn-fg);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-group { display: inline-flex; flex-wrap: wrap; gap: var(--s-2); }

/* Generic icon button (toolbar) */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.icon-btn--bordered { border-color: var(--border); background: var(--surface); }

/* Theme toggle: shows the icon of the theme you would switch to */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: inline-block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* 09. Forms ================================================================ */

.form { display: flex; flex-direction: column; gap: var(--s-5); }
.form-grid { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) {
  .form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid .span-2 { grid-column: span 2; }
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  padding-top: var(--s-2);
}
.form-actions--end { justify-content: flex-end; }
.form-actions--between { justify-content: space-between; }

.fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
  margin: 0;
  min-width: 0;
}
.fieldset > legend { padding: 0 var(--s-2); font-weight: 600; font-size: var(--fs-sm); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label, .field > label:not(.checkbox):not(.radio):not(.switch) {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.label__aside { font-weight: 500; font-size: var(--fs-xs); color: var(--text-muted); }
.label__optional { font-weight: 400; color: var(--text-muted); font-size: var(--fs-xs); }

.input,
.select,
.textarea {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.4;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-subtle); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}
.input:disabled, .select:disabled, .textarea:disabled,
.input[readonly] {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}
.input[readonly] { cursor: text; }
.input--mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
.input--sm, .select--sm { min-height: 34px; padding: 5px 10px; font-size: var(--fs-sm); }
.input--lg { min-height: 48px; font-size: var(--fs-md); }
.textarea { min-height: 112px; resize: vertical; line-height: 1.55; }
.textarea--mono { font-family: var(--font-mono); font-size: var(--fs-sm); }

.select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235B6576' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}
:root[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239AA6BA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239AA6BA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
}
.select[multiple] { background-image: none; padding-right: 12px; }

.field__hint, .help { font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.5; }
.field__error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--danger-text);
  line-height: 1.45;
}
.field__error .icon { width: 14px; height: 14px; margin-top: 1px; }
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea,
.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--danger);
}
.field.has-error .input:focus,
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(226, 61, 61, 0.22); }

/* Input group (addons / buttons) */
.input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}
.input-group > .input,
.input-group > .select { flex: 1 1 auto; min-width: 0; box-shadow: none; border-radius: 0; }
.input-group > :first-child { border-top-left-radius: var(--radius); border-bottom-left-radius: var(--radius); }
.input-group > :last-child { border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.input-group > * + * { margin-left: -1px; }
.input-group > .input:focus, .input-group > .select:focus { position: relative; z-index: 1; }
.input-group__addon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.input-group > .btn { border-radius: 0; box-shadow: none; flex-shrink: 0; }
.input-group > .btn:last-child { border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.input-group__toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
}
.input-group__toggle:hover { color: var(--text); background: var(--surface-2); }
.input-group__toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); position: relative; z-index: 2; }
.input-group__toggle .icon-eye-off { display: none; }
.input-group__toggle[aria-pressed="true"] .icon-eye-off { display: inline-block; }
.input-group__toggle[aria-pressed="true"] .icon-eye { display: none; }

/* Input with leading icon */
.input-icon { position: relative; }
.input-icon > .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
  width: 16px;
  height: 16px;
}
.input-icon > .input { padding-left: 38px; }

/* Checkbox, radio */
.checkbox, .radio {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
  line-height: 1.45;
}
.checkbox input, .radio input {
  appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.checkbox input { border-radius: 5px; }
.radio input { border-radius: 50%; }
.checkbox input::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform 120ms var(--ease);
  background: #FFFFFF;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.radio input::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 120ms var(--ease);
  background: #FFFFFF;
}
.checkbox input:checked, .radio input:checked { background: var(--brand-solid); border-color: var(--brand-solid); }
.checkbox input:checked::before, .radio input:checked::before { transform: scale(1); }
.checkbox input:focus-visible, .radio input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.checkbox input:disabled, .radio input:disabled { opacity: 0.5; cursor: not-allowed; }
.checkbox__text small, .radio__text small { display: block; color: var(--text-muted); font-size: var(--fs-xs); }

/* Switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: var(--fs-sm);
}
.switch input {
  appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  margin: 0;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}
.switch input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked { background: var(--brand-solid); }
.switch input:checked::before { transform: translateX(16px); }
.switch input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.switch input:disabled { opacity: 0.5; }

/* Choice cards (radio/checkbox as selectable card) */
.choice {
  position: relative;
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.choice:hover { border-color: var(--border-strong); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--brand-soft); }
.choice:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.choice__title { display: block; font-weight: 600; font-size: var(--fs-sm); }
.choice__text { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.choice__aside { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 10. Cards ================================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
}
.card__title { font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.card__subtitle { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
.card__body { padding: var(--s-5); }
.card__body > * + * { margin-top: var(--s-4); }
.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: var(--fs-sm);
}
.card--flush > .card__body { padding: 0; }
.card--pad { padding: var(--s-6); }
.card--muted { background: var(--surface-2); box-shadow: none; }
.card--outline { box-shadow: none; }
.card--brand { border-color: var(--brand-soft-border); background: var(--brand-soft); box-shadow: none; }
.card--link {
  display: block;
  color: inherit;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card--link:hover { color: inherit; text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.card--link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.card .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.card > .table-wrap:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* Stat card */
.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.stat__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.stat__label { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 500; }
.stat__icon { color: var(--text-subtle); }
.stat__value {
  font-size: var(--fs-2xl);
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.stat__value small { font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.stat__hint { font-size: var(--fs-xs); color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stat__trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat__trend--up { color: var(--signal-text); }
.stat__trend--down { color: var(--danger-text); }
.stat__trend .icon { width: 14px; height: 14px; }
.stat--link { color: inherit; }
.stat--link:hover { color: inherit; text-decoration: none; border-color: var(--border-strong); }
.stats { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
@media (max-width: 479px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .stats .stat { padding: var(--s-4); }
  .stats .stat__value { font-size: var(--fs-xl); }
  .stats .stat__label { overflow-wrap: anywhere; hyphens: auto; }
}

/* Key/value list (spec sheets, order details) */
.dl { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: var(--s-3) var(--s-6); font-size: var(--fs-sm); }
.dl dt { color: var(--text-muted); }
.dl dd { color: var(--text); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 479px) {
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: var(--s-3); }
}
.spec-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.spec-list__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-sm);
}
.spec-list__row + .spec-list__row { border-top: 1px solid var(--border); }
.spec-list__key { color: var(--text-muted); }
.spec-list__value { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* Check list */
.check-list { display: flex; flex-direction: column; gap: var(--s-2); font-size: var(--fs-sm); }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .icon { color: var(--signal); margin-top: 3px; width: 16px; height: 16px; }
.check-list--muted .icon { color: var(--text-subtle); }

/* 11. Badges, pills, status ================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  vertical-align: middle;
}
.badge .icon { width: 12px; height: 12px; }
.badge--success { background: var(--signal-soft); color: var(--signal-text); border-color: var(--signal-border); }
.badge--warning { background: var(--warn-soft); color: var(--warn-text); border-color: var(--warn-border); }
.badge--danger { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-border); }
.badge--info, .badge--brand { background: var(--brand-soft); color: var(--info-text); border-color: var(--brand-soft-border); }
.badge--neutral { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
.badge--solid { background: var(--brand-solid); color: var(--on-brand); border-color: var(--brand-solid); }
.badge--outline { background: transparent; }
.badge--mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0; }
.badge--dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.pill--brand { color: var(--brand-text); background: var(--brand-soft); border-color: var(--brand-soft-border); }
.pill--on-ink { color: var(--ink-text); background: rgba(255, 255, 255, 0.06); border-color: var(--ink-border-strong); }
a.pill:hover { text-decoration: none; border-color: var(--border-strong); color: var(--text); }

/* Status pill with live dot */
.status-pill {
  --dot: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
a.status-pill:hover { text-decoration: none; color: var(--text); border-color: var(--border-strong); }
.status-pill__dot, .live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, var(--signal));
  flex-shrink: 0;
}
.status-pill__dot::after, .live-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--dot, var(--signal));
  opacity: 0;
  animation: pulse 2.4s var(--ease) infinite;
}
.status-pill--degraded, .status-pill--partial_outage { --dot: var(--warn); }
.status-pill--major_outage { --dot: var(--danger); }
.status-pill--maintenance { --dot: var(--brand); }
.status-pill--unknown { --dot: var(--text-subtle); }
.status-pill--unknown .status-pill__dot::after { display: none; }
.status-pill--on-ink { background: rgba(255, 255, 255, 0.05); border-color: var(--ink-border-strong); color: var(--ink-text); }
a.status-pill--on-ink:hover { color: #FFFFFF; border-color: rgba(255, 255, 255, 0.36); }
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.7; }
  70% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Crypto ticker badges (text only, never brand logos) */
.crypto-list { display: flex; flex-wrap: wrap; gap: 6px; }
.crypto {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  line-height: 1.5;
}
.crypto__net { font-weight: 400; color: var(--text-muted); font-size: 0.68rem; }
.crypto--on-ink { border-color: var(--ink-border-strong); background: rgba(255, 255, 255, 0.04); color: var(--ink-text); }
.crypto--on-ink .crypto__net { color: var(--ink-muted); }

/* Carrier chips */
.carrier-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.carrier-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.5;
}
a.carrier-chip:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-text); }
.carrier-chip__tech {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.carrier-chip__tech--5g { color: var(--brand-text); border-color: var(--brand-soft-border); background: var(--brand-soft); }
.carrier-chip--plain { padding-right: 9px; }

/* Tag/category labels */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--brand-text);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
a.tag:hover { text-decoration: none; color: var(--brand-hover); }

/* Chip: small bordered link/label (filters, city lists, related links). .tag is a plain label. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}
.chip .icon { width: 14px; height: 14px; color: var(--text-muted); }
a.chip:hover { text-decoration: none; color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
a.chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.chip[aria-current="page"], .chip.is-active { background: var(--brand-soft); border-color: var(--brand-soft-border); color: var(--brand-text); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* 12. Alerts, flash, toasts ================================================ */

.alert {
  --alert-fg: var(--info-text);
  --alert-bg: var(--info-soft);
  --alert-border: var(--info-border);
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  border: 1px solid var(--alert-border);
  background: var(--alert-bg);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.alert > .icon { color: var(--alert-fg); margin-top: 2px; width: 18px; height: 18px; }
.alert__body { flex: 1 1 auto; min-width: 0; }
.alert__body > * + * { margin-top: 4px; }
.alert__title { font-weight: 600; color: var(--text); }
.alert__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.alert__close {
  margin: -4px -6px -4px 0;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}
.alert__close:hover { background: rgba(0, 0, 0, 0.05); color: var(--text); }
.alert__close:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.alert a { color: var(--text); text-decoration: underline; font-weight: 500; }
.alert--success { --alert-fg: var(--signal-text); --alert-bg: var(--signal-soft); --alert-border: var(--signal-border); }
.alert--warning { --alert-fg: var(--warn-text); --alert-bg: var(--warn-soft); --alert-border: var(--warn-border); }
.alert--error, .alert--danger { --alert-fg: var(--danger-text); --alert-bg: var(--danger-soft); --alert-border: var(--danger-border); }
.alert--neutral { --alert-fg: var(--text-muted); --alert-bg: var(--surface-2); --alert-border: var(--border); }

.flash-stack { display: flex; flex-direction: column; gap: var(--s-2); }
.flash-region { padding-top: var(--s-4); }
.flash-region:empty { display: none; }
.flash.is-leaving { opacity: 0; transform: translateY(-4px); transition: opacity 220ms var(--ease), transform 220ms var(--ease); }

/* Banner (full-width notice under topbar/header) */
.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  padding: var(--s-2) var(--gutter);
  font-size: var(--fs-sm);
  background: var(--warn-soft);
  color: var(--text);
  border-bottom: 1px solid var(--warn-border);
  text-align: center;
}
.banner .icon { color: var(--warn-text); }
.banner--info { background: var(--brand-soft); border-color: var(--brand-soft-border); }
.banner--info .icon { color: var(--brand-text); }
.banner form { display: inline; }

/* Toasts */
.toast-region {
  position: fixed;
  z-index: 900;
  right: var(--s-4);
  bottom: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  background: var(--ink);
  color: #FFFFFF;
  font-size: var(--fs-sm);
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--ink-border-strong);
  pointer-events: auto;
  animation: toast-in 200ms var(--ease);
}
.toast .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--ink-brand); }
.toast--success .icon { color: #4FD69C; }
.toast--error .icon { color: #FF8A8A; }
.toast--warning .icon { color: #F5B656; }
.toast__msg { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.toast__close { color: var(--ink-muted); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; }
.toast__close:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.08); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 13. Tables =============================================================== */

.table-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.table-wrap--scroll { max-height: 520px; overflow-y: auto; }
/* Phones: wide tables (5+ columns) scroll horizontally inside .table-wrap instead of squeezing every cell into 3-line rows */
@media (max-width: 767px) {
  .table-wrap > .data-table:has(thead th:nth-child(5)) { min-width: 640px; }
  .receipt { padding: var(--s-5); }
}
/* Short structured values never wrap (dates, amounts, refs, statuses); prose cells still do */
.data-table .num, .data-table td.mono, .data-table .badge, .data-table .cell-stack, .data-table .cell-flag, .data-table td.actions { white-space: nowrap; }
.table-wrap:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.data-table caption { caption-side: top; text-align: left; padding: var(--s-3) var(--s-4); font-weight: 600; color: var(--text); }
.data-table th,
.data-table td {
  padding: 11px var(--s-4);
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.data-table thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding-top: 9px;
  padding-bottom: 9px;
}
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr { transition: background-color 80ms linear; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.data-table tfoot td, .data-table tfoot th { background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--border); border-bottom: 0; }
.data-table th[scope="row"] { font-weight: 600; color: var(--text); }
.data-table .num, .data-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table .mono { font-family: var(--font-mono); font-size: 0.8rem; white-space: nowrap; }
.data-table .actions { text-align: right; white-space: nowrap; width: 1%; }
.data-table .shrink { width: 1%; white-space: nowrap; }
.data-table .muted { color: var(--text-muted); }
.data-table a.row-link { color: var(--text); font-weight: 600; }
.data-table a.row-link:hover { color: var(--brand-text); }
.data-table--sticky thead th { position: sticky; top: 0; z-index: 2; }
.data-table--compact th, .data-table--compact td { padding: 7px var(--s-3); }
.data-table--striped tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.data-table--bordered td + td, .data-table--bordered th + th { border-left: 1px solid var(--border); }
.data-table__empty td { text-align: center; color: var(--text-muted); padding: var(--s-10) var(--s-4); }
.data-table .cell-stack { display: flex; flex-direction: column; gap: 1px; }
.data-table .cell-stack small { color: var(--text-muted); font-size: var(--fs-xs); }
.data-table .cell-flag { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.data-table input[type="checkbox"] { vertical-align: middle; }

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.table-toolbar__filters { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.table-toolbar .input, .table-toolbar .select { width: auto; min-width: 160px; }
@media (max-width: 639px) {
  .table-toolbar .input, .table-toolbar .select { width: 100%; min-width: 0; }
  .table-toolbar__filters { width: 100%; }
}

/* 14. Tabs, accordion, segmented =========================================== */

.tabs__list {
  display: flex;
  gap: var(--s-1);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs__list::-webkit-scrollbar { display: none; }
.tabs__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  text-decoration: none;
}
.tabs__tab:hover { color: var(--text); text-decoration: none; }
.tabs__tab:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.tabs__tab[aria-selected="true"],
.tabs__tab.is-active,
.tabs__tab[aria-current="page"] { color: var(--text); font-weight: 600; }
.tabs__tab[aria-selected="true"]::after,
.tabs__tab.is-active::after,
.tabs__tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}
.tabs__count { font-size: var(--fs-2xs); padding: 0 6px; border-radius: var(--radius-full); background: var(--surface-2); color: var(--text-muted); font-variant-numeric: tabular-nums; border: 1px solid var(--border); }
.tabs__panel { padding-top: var(--s-5); }
.tabs__panel:focus-visible { outline: none; }

/* Pill-style tabs */
.tabs--pills .tabs__list { border: 0; gap: var(--s-2); }
.tabs--pills .tabs__tab { border-radius: var(--radius-full); padding: 6px 14px; border: 1px solid var(--border); background: var(--surface); }
.tabs--pills .tabs__tab[aria-selected="true"], .tabs--pills .tabs__tab.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabs--pills .tabs__tab::after { display: none; }

/* Accordion (details/summary) */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.accordion__item + .accordion__item { border-top: 1px solid var(--border); }
.accordion__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: var(--fs-base);
  line-height: 1.4;
}
.accordion__summary::-webkit-details-marker { display: none; }
.accordion__summary::marker { content: ""; }
.accordion__summary:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.accordion__summary:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.accordion__summary .icon { color: var(--text-muted); transition: transform var(--dur) var(--ease); }
.accordion__item[open] > .accordion__summary .icon { transform: rotate(180deg); }
.accordion__content { padding: 0 var(--s-5) var(--s-5); color: var(--text-muted); font-size: var(--fs-base); }
.accordion__content > * + * { margin-top: var(--s-3); }
.accordion--flush { border: 0; border-radius: 0; background: transparent; }
.accordion--flush .accordion__summary, .accordion--flush .accordion__content { padding-inline: 0; }
.accordion--flush .accordion__item { border-bottom: 1px solid var(--border); }
.accordion--flush .accordion__item + .accordion__item { border-top: 0; }

/* Segmented control (radio-based) */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  max-width: 100%;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label,
.segmented a,
.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.segmented label:hover, .segmented a:hover, .segmented button:hover { color: var(--text); text-decoration: none; }
.segmented input:checked + label,
.segmented a[aria-current],
.segmented a.is-active,
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.segmented input:focus-visible + label { box-shadow: var(--focus-ring); }
.segmented--block { display: flex; }
.segmented--block > label, .segmented--block > a, .segmented--block > button { flex: 1 1 0; }
.segmented__save { font-size: var(--fs-2xs); color: var(--signal-text); font-weight: 600; }

/* 15. Dropdown menu, tooltip, modal ======================================== */

.dropdown { position: relative; display: inline-block; }
.dropdown__menu, .menu {
  position: absolute;
  z-index: 300;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 6px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
}
.dropdown__menu--left, .menu--left { right: auto; left: 0; }
.dropdown.is-open > .dropdown__menu,
.dropdown.is-open > .menu { display: block; animation: pop-in 120ms var(--ease); }
.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  line-height: 1.35;
}
.menu__item .icon { color: var(--text-muted); width: 16px; height: 16px; }
.menu__item:hover, .menu__item:focus-visible { background: var(--surface-2); color: var(--text); text-decoration: none; outline: none; }
.menu__item--danger { color: var(--danger-text); }
.menu__item--danger .icon { color: var(--danger-text); }
.menu__item[aria-current="page"] { font-weight: 600; }
.menu__sep { height: 1px; margin: 6px -6px; background: var(--border); }
.menu__label { padding: 6px 10px 4px; font-size: var(--fs-2xs); font-weight: 600; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); }
.menu__header { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin: -6px -6px 6px; }
.menu__header strong { display: block; font-size: var(--fs-sm); }
.menu__header span { display: block; font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu form { margin: 0; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Tooltip (CSS only): <span data-tooltip="Text" tabindex="0"> */
[data-tooltip] { position: relative; }
/* The pseudo-element only exists while shown (no content otherwise), so hidden
   tooltips never widen the page. */
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 400;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(260px, 80vw);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #FFFFFF;
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  letter-spacing: 0;
  text-transform: none;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  animation: tip-in 120ms var(--ease);
}
[data-tooltip-pos="bottom"]:hover::after,
[data-tooltip-pos="bottom"]:focus-visible::after { bottom: auto; top: calc(100% + 8px); }
[data-tooltip-pos="left"]:hover::after,
[data-tooltip-pos="left"]:focus-visible::after { left: auto; right: 0; transform: none; }
[data-tooltip-pos="right"]:hover::after,
[data-tooltip-pos="right"]:focus-visible::after { left: 0; transform: none; }
@keyframes tip-in { from { opacity: 0; } to { opacity: 1; } }

/* Modal (native <dialog>) */
.modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal[open] { display: flex; flex-direction: column; animation: modal-in 180ms var(--ease); }
.modal::backdrop { background: var(--overlay); }
.modal--sm { width: min(420px, calc(100vw - 32px)); }
.modal--lg { width: min(760px, calc(100vw - 32px)); }
.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-6) var(--s-4);
  border-bottom: 1px solid var(--border);
}
.modal__title { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.01em; }
.modal__body { padding: var(--s-5) var(--s-6); overflow-y: auto; }
.modal__body > * + * { margin-top: var(--s-4); }
.modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-6);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
body.modal-open { overflow: hidden; }

/* 16. Code blocks, code tabs, credential chip, kbd ========================= */

.code-block {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  color: var(--code-text);
  overflow: hidden;
  min-width: 0;
}
.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 6px 8px 6px 14px;
  background: var(--code-bg-2);
  border-bottom: 1px solid var(--code-border);
  font-size: var(--fs-xs);
  color: var(--code-muted);
}
.code-block__lang { font-family: var(--font-mono); font-weight: 500; text-transform: lowercase; }
.code-block pre,
pre.code {
  margin: 0;
  padding: var(--s-4) var(--s-5);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--code-text);
  background: var(--code-bg);
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}
pre.code { border-radius: var(--radius-lg); border: 1px solid var(--code-border); }
.code-block pre code, pre.code code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.code-block--floating-copy .code-copy { position: absolute; top: 8px; right: 8px; }

.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--code-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
}
.code-copy:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.08); }
.code-copy:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(143, 166, 255, 0.6); }
.code-copy .icon { width: 14px; height: 14px; }

/* Copy buttons swap icons when [data-copied] is set by JS */
[data-copy] .icon-check, [data-copy-target] .icon-check, [data-copy-tabs] .icon-check { display: none; }
[data-copied] .icon-check { display: inline-block; color: var(--signal); }
[data-copied] .icon-copy { display: none; }

/* Simple tokens for hand-marked snippets: <span class="tok-k">…</span> */
.tok-k { color: #8FA6FF; }
.tok-s { color: #7FD8A8; }
.tok-n { color: #F5B656; }
.tok-c { color: #6F7B90; font-style: italic; }
.tok-f { color: #E3A8FF; }

/* Code tabs (cURL / Python / Node.js / PHP) */
.code-tabs { border-radius: var(--radius-lg); background: var(--code-bg); border: 1px solid var(--code-border); overflow: hidden; min-width: 0; }
.code-tabs__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: 0 8px 0 6px;
  background: var(--code-bg-2);
  border-bottom: 1px solid var(--code-border);
}
.code-tabs__list { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.code-tabs__list::-webkit-scrollbar { display: none; }
.code-tabs__tab {
  position: relative;
  padding: 10px 12px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--code-muted);
  white-space: nowrap;
}
.code-tabs__tab:hover { color: #FFFFFF; }
.code-tabs__tab:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(143, 166, 255, 0.6); border-radius: 4px; }
.code-tabs__tab[aria-selected="true"] { color: #FFFFFF; }
.code-tabs__tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--ink-brand);
  border-radius: 2px;
}
.code-tabs__panel pre { margin: 0; padding: var(--s-4) var(--s-5); overflow-x: auto; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.7; color: var(--code-text); }
.code-tabs__panel code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

/* Credential chip */
.cred {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: var(--fs-sm);
}
.cred__label {
  flex-shrink: 0;
  min-width: 72px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cred__value {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
}
.cred__actions { display: inline-flex; gap: 2px; flex-shrink: 0; }
.cred__btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}
.cred__btn:hover { background: var(--surface); color: var(--text); }
.cred__btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cred__btn .icon { width: 15px; height: 15px; }
.cred__secret { display: none; }
.cred.is-revealed .cred__secret { display: inline; }
.cred.is-revealed .cred__mask { display: none; }
.cred__btn .icon-eye-off { display: none; }
.cred.is-revealed .cred__btn .icon-eye-off { display: inline-block; }
.cred.is-revealed .cred__btn .icon-eye { display: none; }
.cred--stacked { flex-wrap: wrap; padding: 8px 6px 8px 12px; }
.cred--stacked .cred__label { width: 100%; }
.cred--wrap .cred__value { white-space: normal; overflow-wrap: anywhere; }
.cred-list { display: flex; flex-direction: column; gap: var(--s-2); }
@media (max-width: 479px) {
  .cred { flex-wrap: wrap; }
  .cred__label { width: 100%; }
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  background: var(--surface);
  font-size: 0.75rem;
  color: var(--text);
  line-height: 1.4;
}

/* 17. Progress / usage, empty states, skeleton ============================= */

.progress {
  --progress-color: var(--brand);
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--progress-color);
  transition: width 400ms var(--ease);
}
.progress--sm { height: 4px; }
.progress--lg { height: 12px; }
.progress--success { --progress-color: var(--signal); }
.progress--warning { --progress-color: var(--warn); }
.progress--danger { --progress-color: var(--danger); }

.usage { display: flex; flex-direction: column; gap: 8px; }
.usage__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; font-size: var(--fs-sm); }
.usage__label { color: var(--text-muted); }
.usage__value { font-weight: 600; font-variant-numeric: tabular-nums; }
.usage__value small { color: var(--text-muted); font-weight: 400; }
.usage__meta { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-xs); color: var(--text-muted); flex-wrap: wrap; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-3);
  padding: var(--s-12) var(--s-6);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.empty__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.empty__title { font-size: var(--fs-md); font-weight: 600; }
.empty__text { max-width: 46ch; color: var(--text-muted); font-size: var(--fs-sm); }
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); margin-top: var(--s-2); }
.empty--compact { padding: var(--s-8) var(--s-4); }
.empty--plain { border: 0; background: transparent; }

.skeleton {
  display: block;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton--text { height: 12px; margin: 6px 0; }
.skeleton--title { height: 20px; width: 40%; margin-bottom: 12px; }
.skeleton--block { height: 120px; border-radius: var(--radius-lg); }
.skeleton--circle { width: 32px; height: 32px; border-radius: 50%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* 18. Breadcrumbs, pagination, year nav, timeline ========================== */

.breadcrumbs ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.breadcrumbs li + li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--text-subtle);
  border-top: 1.5px solid var(--text-subtle);
  transform: rotate(45deg);
  margin-right: 4px;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.crumbbar { border-bottom: 1px solid var(--border); background: var(--surface); padding-block: 10px; }
.breadcrumbs--on-ink, .breadcrumbs--on-ink a { color: var(--ink-muted); }
.breadcrumbs--on-ink a:hover, .breadcrumbs--on-ink [aria-current] { color: #FFFFFF; }

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-6);
}
.pagination__list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.pagination__link:hover { text-decoration: none; border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.pagination__link[aria-current="page"] { background: var(--brand-solid); border-color: var(--brand-solid); color: var(--on-brand); font-weight: 600; }
.pagination__link[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.pagination__gap { color: var(--text-subtle); padding: 0 4px; }
.pagination__summary { font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 559px) {
  .pagination__num:not([aria-current="page"]) { display: none; }
  .pagination__gap { display: none; }
}

/* Year archive navigation (2021 → 2026) */
.year-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.year-nav__item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.year-nav__item:hover { text-decoration: none; border-color: var(--border-strong); color: var(--text); }
.year-nav__item small { font-weight: 500; color: var(--text-muted); font-size: var(--fs-xs); }
.year-nav__item[aria-current="page"], .year-nav__item.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.year-nav__item[aria-current="page"] small, .year-nav__item.is-active small { color: inherit; opacity: 0.7; }
.year-nav--vertical { flex-direction: column; gap: 2px; }
.year-nav--vertical .year-nav__item { border-color: transparent; background: transparent; justify-content: space-between; }
.year-nav--vertical .year-nav__item:hover { background: var(--surface-2); }
.year-nav--vertical .year-nav__item[aria-current="page"], .year-nav--vertical .year-nav__item.is-active { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
.year-nav--vertical .year-nav__item[aria-current="page"] small, .year-nav--vertical .year-nav__item.is-active small { opacity: 1; }

/* Timeline (vertical, with year markers) */
.timeline { position: relative; display: flex; flex-direction: column; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
}
.timeline__year {
  position: relative;
  margin: var(--s-8) 0 var(--s-4) -28px;
  padding-left: 28px;
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.timeline__year:first-child { margin-top: 0; }
.timeline__year::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 4px;
  background: var(--brand-solid);
  box-shadow: 0 0 0 4px var(--bg);
}
.timeline__item { position: relative; padding-bottom: var(--s-6); }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--brand);
}
.timeline__item--muted::before { border-color: var(--border-strong); }
.timeline__item--success::before { border-color: var(--signal); }
.timeline__item--warning::before { border-color: var(--warn); }
.timeline__item--danger::before { border-color: var(--danger); }
.timeline__date { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-variant-numeric: tabular-nums; }
.timeline__title { font-size: var(--fs-md); font-weight: 600; margin-top: 2px; letter-spacing: -0.01em; }
.timeline__body { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 4px; }
.timeline__body > * + * { margin-top: var(--s-2); }
.timeline__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-2); }
.timeline--compact .timeline__item { padding-bottom: var(--s-4); }

/* 19. Uptime bars ========================================================== */

.uptime { display: flex; flex-direction: column; gap: 8px; }
.uptime__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.uptime__name { font-weight: 600; font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: 8px; }
.uptime__pct { font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.uptime__bars {
  display: grid;
  grid-template-columns: repeat(90, minmax(0, 1fr));
  gap: 2px;
  height: 32px;
  align-items: stretch;
}
.uptime__bars--30 { grid-template-columns: repeat(30, minmax(0, 1fr)); }
.uptime__bar {
  position: relative;
  border-radius: 2px;
  background: var(--uptime-ok);
  min-width: 0;
  transition: opacity 80ms linear, transform 80ms linear;
}
.uptime__bar:hover, .uptime__bar:focus-visible { opacity: 0.75; outline: none; transform: scaleY(1.08); }
.uptime__bar.is-ok { background: var(--uptime-ok); }
.uptime__bar.is-minor { background: var(--uptime-minor); }
.uptime__bar.is-partial { background: var(--uptime-partial); }
.uptime__bar.is-major { background: var(--uptime-major); }
.uptime__bar.is-nodata { background: var(--uptime-none); }
.uptime__bar.is-maintenance { background: var(--brand); }
.uptime__bar[data-tooltip]:hover::after { font-variant-numeric: tabular-nums; }
.uptime__bar:nth-child(-n+12):hover::after { left: 0; transform: none; }
.uptime__bar:nth-last-child(-n+12):hover::after { left: auto; right: 0; transform: none; }
.uptime__axis { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-xs); color: var(--text-muted); }
.uptime__axis span:nth-child(2) { flex: 1; height: 1px; background: var(--border); align-self: center; }
.uptime__legend { display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: var(--fs-xs); color: var(--text-muted); }
.uptime__legend span { display: inline-flex; align-items: center; gap: 6px; }
.uptime__legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
@media (max-width: 639px) {
  /* Show the last 45 days on phones */
  .uptime__bars { grid-template-columns: repeat(45, minmax(0, 1fr)); height: 28px; }
  .uptime__bars:not(.uptime__bars--30) > .uptime__bar:nth-child(-n+45) { display: none; }
}

/* 20. Announcement bar & site header ======================================= */

.announce {
  position: relative;
  background: var(--ink);
  color: var(--ink-text);
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--ink-border);
}
.announce__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  min-height: var(--announce-h);
  padding-block: 6px;
  padding-right: 44px;
  text-align: center;
}
.announce__badge {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: var(--radius-xs);
  background: rgba(143, 166, 255, 0.16);
  color: var(--ink-brand);
  font-size: var(--fs-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.announce__text { color: var(--ink-text); line-height: 1.4; }
.announce--maintenance { background: #3A2606; border-bottom-color: rgba(245, 182, 86, 0.35); }
.announce--maintenance .announce__badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(245, 182, 86, 0.18); color: #F5B656; }
.announce a { color: #FFFFFF; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.announce a:hover { color: #FFFFFF; text-decoration: underline; }
.announce__close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
}
.announce__close:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.08); }
.announce__close:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(143, 166, 255, 0.7); }
@media (max-width: 639px) {
  .announce__badge { display: none; }
  .announce__inner { justify-content: flex-start; text-align: left; font-size: var(--fs-xs); }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  min-height: var(--header-h);
}
.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-left: auto;
  flex-shrink: 0;
}
.site-header__burger { display: none; }

.site-nav { flex: 1 1 auto; min-width: 0; }
.site-nav__list { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.site-nav__item { position: relative; }
.site-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.3;
  text-decoration: none;
}
.site-nav__link:hover, .site-nav__item.is-open > .site-nav__link { color: var(--text); background: var(--surface-2); text-decoration: none; }
.site-nav__link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.site-nav__link.is-active, .site-nav__link[aria-current="page"] { color: var(--text); font-weight: 600; }
.site-nav__link .icon-chevron-down { width: 14px; height: 14px; transition: transform var(--dur) var(--ease); opacity: 0.7; }
.site-nav__item.is-open > .site-nav__link .icon-chevron-down { transform: rotate(180deg); }
.site-nav__mobile-actions { display: none; }

/* Desktop dropdown panels */
.nav-panel {
  position: absolute;
  z-index: 300;
  top: calc(100% + 10px);
  left: -8px;
  display: none;
  min-width: 320px;
  padding: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.nav-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.site-nav__item.is-open > .nav-panel { display: block; animation: pop-in 140ms var(--ease); }
.nav-panel__link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}
.nav-panel__link:hover, .nav-panel__link:focus-visible { background: var(--surface-2); text-decoration: none; color: var(--text); outline: none; }
.nav-panel__link[aria-current="page"] .nav-panel__title { color: var(--brand-text); }
.nav-panel__link .icon-tile { width: 34px; height: 34px; }
.nav-panel__title { display: block; font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; }
.nav-panel__desc { display: block; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.45; margin-top: 2px; }
.nav-panel__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  margin: 6px -8px -8px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  flex-wrap: wrap;
}
.nav-panel__footer a { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* Mega menu (locations) */
.nav-panel--mega { width: min(760px, calc(100vw - 48px)); padding: 0; left: -160px; }
.mega { display: grid; grid-template-columns: minmax(0, 1fr) 220px; }
.mega__main { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-5); }
.mega__group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  margin-bottom: var(--s-2);
}
.mega__group-title .badge { text-transform: none; letter-spacing: 0; }
.mega__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px var(--s-2); }
.mega__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--text);
  min-width: 0;
}
.mega__link span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mega__link:hover, .mega__link:focus-visible { background: var(--surface-2); text-decoration: none; color: var(--text); outline: none; }
.mega__link[aria-current="page"] { color: var(--brand-text); font-weight: 600; }
.mega__aside {
  padding: var(--s-5);
  background: var(--surface-2);
  border-left: 1px solid var(--border);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.mega__aside strong { color: var(--text); font-size: var(--fs-sm); }
.mega__aside .btn { margin-top: auto; }

/* Mobile / tablet: drawer */
@media (max-width: 1199px) { /* header drawer (tolerates +40 % nav labels down to 1200 px) */
  .site-header__burger { display: inline-grid; }
  .site-header__actions .hide-in-drawer-mode { display: none; }
  .site-nav {
    position: fixed;
    z-index: 190;
    left: 0;
    right: 0;
    top: var(--nav-top, var(--header-h));
    bottom: 0;
    display: none;
    flex-direction: column;
    padding: var(--s-3) var(--gutter) var(--s-8);
    background: var(--surface);
    border-top: 1px solid var(--border);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.nav-open { overflow: hidden; }
  /* backdrop-filter would make the header the containing block of the fixed drawer */
  body.nav-open .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
  body.nav-open .site-nav { display: flex; }
  .site-nav__list { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0; }
  .site-nav__item { border-bottom: 1px solid var(--border); }
  .site-nav__link {
    width: 100%;
    justify-content: space-between;
    padding: 14px 4px;
    font-size: var(--fs-md);
    color: var(--text);
    border-radius: 0;
  }
  .site-nav__link:hover, .site-nav__item.is-open > .site-nav__link { background: transparent; }
  .nav-panel,
  .nav-panel--mega {
    position: static;
    width: auto;
    min-width: 0;
    padding: 0 0 var(--s-3);
    border: 0;
    box-shadow: none;
    background: transparent;
    animation: none !important;
  }
  .nav-panel::before { display: none; }
  .nav-panel__link { padding: 10px 4px; }
  .nav-panel__footer { margin: 4px 0 0; padding: 10px 4px; background: transparent; border-radius: 0; }
  .mega { grid-template-columns: minmax(0, 1fr); }
  .mega__main { padding: var(--s-2) 0; }
  .mega__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mega__aside { border-left: 0; border-radius: var(--radius); padding: var(--s-4); }
  .site-nav__mobile-actions { display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-5); }
}
@media (max-width: 339px) {
  .mega__list { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1200px) and (max-width: 1319px) {
  .site-nav__link { padding-inline: 9px; }
  .site-header__inner { gap: var(--s-4); }
}

/* 21. Hero, page hero, section header, CTA band ============================ */

.on-ink, .hero, .cta-band, .page-hero--ink {
  --text: var(--ink-text);
  --text-muted: var(--ink-muted);
  --border: var(--ink-border);
  --border-strong: var(--ink-border-strong);
  --brand: var(--ink-brand);
  --brand-text: var(--ink-brand);
  --brand-hover: #B3C2FF;
  --surface: var(--ink-2);
  --surface-2: var(--ink-3);
  color: var(--ink-text);
}

/* Grid pattern + soft single-hue glow, CSS only */
.bg-grid {
  position: relative;
  isolation: isolate;
}
.bg-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
  pointer-events: none;
}
.bg-grid--light::before {
  background-image:
    linear-gradient(color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px);
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(36, 72, 232, 0.35), transparent 70%),
    var(--ink);
  padding-block: var(--s-20) var(--s-20);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 60% 20%, #000 25%, transparent 80%);
  mask-image: radial-gradient(ellipse 75% 85% at 60% 20%, #000 25%, transparent 80%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(143, 166, 255, 0.35), transparent);
}
.hero__grid { display: grid; gap: var(--s-12); grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 1024px) {
  .hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}
.hero__content { display: flex; flex-direction: column; gap: var(--s-5); max-width: 640px; }
.hero__eyebrow { display: inline-flex; align-self: flex-start; }
.hero__title {
  font-size: var(--fs-5xl);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: #FFFFFF;
}
.hero__title em { font-style: normal; color: var(--ink-brand); }
.hero__lead { font-size: var(--fs-lg); color: var(--ink-muted); line-height: 1.6; max-width: 56ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-2); }
.hero__meta { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--fs-sm); color: var(--ink-muted); margin-top: var(--s-2); }
.hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero__meta .icon { color: var(--signal); width: 16px; height: 16px; }
.hero__figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 1px;
  margin-top: var(--s-10);
  border: 1px solid var(--ink-border);
  border-radius: var(--radius-lg);
  background: var(--ink-border);
  overflow: hidden;
}
.hero__figure { padding: var(--s-4) var(--s-5); background: color-mix(in srgb, var(--ink) 88%, #FFFFFF); }
.hero__figure strong { display: block; font-size: var(--fs-2xl); font-weight: 650; color: #FFFFFF; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero__figure span { font-size: var(--fs-xs); color: var(--ink-muted); }
.hero__visual {
  position: relative;
  border: 1px solid var(--ink-border-strong);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--ink-2) 92%, transparent);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  min-width: 0;
}
@media (max-width: 767px) {
  .hero { padding-block: var(--s-12) var(--s-14); }
  .hero__lead { font-size: var(--fs-md); }
}

/* Generic ink band */
.ink-band { background: var(--ink); color: var(--ink-text); }

/* Page hero (subpages) */
.page-hero {
  position: relative;
  isolation: isolate;
  padding-block: var(--s-14) var(--s-12);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(color-mix(in srgb, var(--text) 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--text) 5%, transparent) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
  opacity: 0.7;
}
.page-hero__inner { display: flex; flex-direction: column; gap: var(--s-4); max-width: 760px; }
.page-hero__title { font-size: var(--fs-4xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.page-hero__lead { font-size: var(--fs-lg); color: var(--text-muted); line-height: 1.6; max-width: 62ch; }
.page-hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-2); }
.page-hero__meta { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--fs-sm); color: var(--text-muted); }
.page-hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
.page-hero--center .page-hero__inner { margin-inline: auto; align-items: center; text-align: center; }
.page-hero--compact { padding-block: var(--s-10) var(--s-8); }
.page-hero--ink {
  background: radial-gradient(700px 300px at 90% -20%, rgba(36, 72, 232, 0.3), transparent 70%), var(--ink);
  border-bottom-color: var(--ink-border);
}
.page-hero--ink::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  opacity: 1;
}
.page-hero--ink .page-hero__title { color: #FFFFFF; }
@media (max-width: 767px) {
  .page-hero { padding-block: var(--s-10) var(--s-8); }
  .page-hero__title { font-size: var(--fs-3xl); }
  .page-hero__lead { font-size: var(--fs-md); }
}

/* Section header */
.section-header { display: flex; flex-direction: column; gap: var(--s-3); max-width: 720px; margin-bottom: var(--s-10); }
.section-header__title { font-size: var(--fs-3xl); font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; }
.section-header__lead { color: var(--text-muted); font-size: var(--fs-md); line-height: 1.6; }
.section-header--center { margin-inline: auto; text-align: center; align-items: center; }
.section-header--split {
  max-width: none;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4);
}
.section-header--split > div { max-width: 720px; display: flex; flex-direction: column; gap: var(--s-3); }
.section-header--sm { margin-bottom: var(--s-6); }
.section-header--sm .section-header__title { font-size: var(--fs-xl); }
@media (max-width: 767px) {
  .section-header { margin-bottom: var(--s-8); }
  .section-header__title { font-size: var(--fs-2xl); }
}

/* CTA band */
.cta-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: radial-gradient(600px 260px at 100% 0%, rgba(36, 72, 232, 0.38), transparent 70%), var(--ink);
  padding: var(--s-12) var(--s-10);
  border: 1px solid var(--ink-border);
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000);
  mask-image: linear-gradient(90deg, transparent 40%, #000);
}
.cta-band__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-6); }
.cta-band__text { max-width: 620px; display: flex; flex-direction: column; gap: var(--s-2); }
.cta-band__title { font-size: var(--fs-3xl); font-weight: 650; color: #FFFFFF; letter-spacing: -0.025em; line-height: 1.15; }
.cta-band__lead { color: var(--ink-muted); font-size: var(--fs-md); }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
@media (max-width: 767px) {
  .cta-band { padding: var(--s-8) var(--s-6); border-radius: var(--radius-lg); }
  .cta-band__title { font-size: var(--fs-2xl); }
}

/* 22. Pricing, comparison, features ======================================= */

.price {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.price__amount { font-size: var(--fs-4xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--text); }
.price__unit { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 500; white-space: normal; }
.price__from { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: var(--tracking-wide); font-weight: 600; }
.price--sm .price__amount { font-size: var(--fs-2xl); }

.price-cards { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: stretch; }
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  padding: var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.price-card__head { display: flex; flex-direction: column; gap: var(--s-2); }
.price-card__name { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.01em; }
.price-card__desc { font-size: var(--fs-sm); color: var(--text-muted); }
.price-card__features { display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-sm); }
.price-card__features li { display: flex; gap: 10px; align-items: flex-start; }
.price-card__features .icon { color: var(--signal); width: 16px; height: 16px; margin-top: 3px; }
.price-card__footer { margin-top: auto; display: flex; flex-direction: column; gap: var(--s-2); }
.price-card__note { font-size: var(--fs-xs); color: var(--text-muted); text-align: center; }
.price-card--featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow-md); }
.price-card__ribbon {
  position: absolute;
  top: -11px;
  left: var(--s-6);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--brand-solid);
  color: var(--on-brand);
  font-size: var(--fs-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.price-table td.num { font-family: var(--font-mono); font-size: 0.8125rem; }
.price-table td.num strong { font-family: var(--font-sans); font-size: var(--fs-sm); }
.price-table .price-table__best { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.price-table__country { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; white-space: nowrap; }
.price-table__saving { display: block; font-size: var(--fs-2xs); color: var(--signal-text); font-family: var(--font-sans); font-weight: 600; }

/* Comparison table */
.compare-table th:first-child, .compare-table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 180px; }
.compare-table thead th:first-child { background: var(--surface-2); }
.compare-table td { text-align: center; }
.compare-table td:first-child { text-align: left; font-weight: 500; }
.compare-table thead th { text-align: center; }
.compare-table thead th:first-child { text-align: left; }
.compare-table .is-yes { color: var(--signal); }
.compare-table .is-no { color: var(--text-subtle); }
.compare-table .is-partial { color: var(--warn); }
.compare-table .col-highlight { background: color-mix(in srgb, var(--brand-soft) 50%, transparent); }
.compare-table__group td { background: var(--surface-2); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); text-align: left !important; }

/* Feature grid */
.feature-grid { display: grid; gap: var(--s-6) var(--s-8); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.feature { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.feature .icon-tile { margin-bottom: var(--s-2); }
.feature__title { font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.01em; }
.feature__text { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.6; }
.feature__link { font-size: var(--fs-sm); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; margin-top: var(--s-1); }
.feature-grid--bordered { gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.feature-grid--bordered .feature { padding: var(--s-6); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 -1px -1px 0; }

/* Steps */
.steps { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); counter-reset: step; }
.step { position: relative; padding-top: var(--s-10); counter-increment: step; }
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--brand-text);
  padding: 2px 8px;
  border: 1px solid var(--brand-soft-border);
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
}
.step__title { font-weight: 600; margin-bottom: 4px; }
.step__text { font-size: var(--fs-sm); color: var(--text-muted); }

/* 23. Country grid & coverage ============================================= */

.country-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.country-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
a.country-card:hover { text-decoration: none; color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
a.country-card:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.country-card__head { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.country-card__head .fi { font-size: 1.6rem; }
.country-card__name { font-weight: 650; font-size: var(--fs-md); letter-spacing: -0.01em; line-height: 1.3; min-width: 0; }
.country-card__sub { display: block; font-size: var(--fs-xs); color: var(--text-muted); font-weight: 400; letter-spacing: 0; }
.country-card__arrow { margin-left: auto; color: var(--text-subtle); transition: transform var(--dur) var(--ease), color var(--dur) var(--ease); }
a.country-card:hover .country-card__arrow { color: var(--brand-text); transform: translateX(2px); }
.country-card__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.country-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: auto;
}
.country-card__price { font-size: var(--fs-sm); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.country-card__extra { font-size: var(--fs-sm); color: var(--text-muted); min-width: 0; }
.country-card__meta strong { display: block; color: var(--text); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.country-card--compact { flex-direction: row; align-items: center; padding: var(--s-3) var(--s-4); }

.coverage-legend { display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: var(--fs-sm); color: var(--text-muted); }
.coverage-legend span { display: inline-flex; align-items: center; gap: 8px; }
.coverage-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* 24. Docs layout & prose ================================================= */

.docs-layout {
  display: grid;
  gap: var(--s-8);
  grid-template-columns: minmax(0, 1fr);
  padding-block: var(--s-8) var(--s-16);
}
@media (min-width: 900px) {
  .docs-layout { grid-template-columns: 240px minmax(0, 1fr); }
}
@media (min-width: 1240px) {
  .docs-layout { grid-template-columns: 240px minmax(0, 1fr) 200px; gap: var(--s-10); }
}
.docs-sidebar { position: relative; }
@media (min-width: 900px) {
  .docs-sidebar, .docs-toc { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; }
}
.docs-toc { display: none; }
@media (min-width: 1240px) { .docs-toc { display: block; } }
.docs-nav { display: flex; flex-direction: column; gap: var(--s-5); font-size: var(--fs-sm); }
.docs-nav__group-title { font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); margin-bottom: 6px; padding-inline: 10px; }
.docs-nav__list { display: flex; flex-direction: column; gap: 1px; }
.docs-nav__link {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  line-height: 1.4;
}
.docs-nav__link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.docs-nav__link[aria-current="page"], .docs-nav__link.is-active { color: var(--brand-text); background: var(--brand-soft); font-weight: 600; }
.docs-nav-toggle { display: none; }
@media (max-width: 899px) {
  .docs-sidebar > details > summary { display: flex; }
  .docs-nav-toggle { display: flex; }
}
.docs-mobile-nav { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.docs-mobile-nav > summary { padding: 10px 14px; font-weight: 600; font-size: var(--fs-sm); cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.docs-mobile-nav > summary::-webkit-details-marker { display: none; }
.docs-mobile-nav[open] > summary { border-bottom: 1px solid var(--border); }
.docs-mobile-nav > .docs-nav { padding: var(--s-4) var(--s-2); }
@media (min-width: 900px) {
  .docs-mobile-nav { border: 0; background: transparent; }
  .docs-mobile-nav > summary { display: none; }
  .docs-mobile-nav > .docs-nav { padding: 0; }
}
.docs-content { min-width: 0; }
.docs-content__header { padding-bottom: var(--s-6); margin-bottom: var(--s-8); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--s-3); }
.docs-content__footer { margin-top: var(--s-12); padding-top: var(--s-6); border-top: 1px solid var(--border); display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.docs-pager { display: flex; flex-direction: column; gap: 2px; padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); }
.docs-pager:hover { text-decoration: none; border-color: var(--brand); color: var(--text); }
.docs-pager small { color: var(--text-muted); font-size: var(--fs-xs); }
.docs-pager strong { color: var(--brand-text); }
.docs-pager--next { text-align: right; }
.toc { font-size: var(--fs-sm); }
.toc__title { font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); margin-bottom: var(--s-2); }
.toc__list { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--border); }
.toc__link { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-muted); line-height: 1.4; }
.toc__link:hover { color: var(--text); text-decoration: none; }
.toc__link.is-active { color: var(--brand-text); border-left-color: var(--brand); font-weight: 500; }
.toc__link--sub { padding-left: 24px; font-size: var(--fs-xs); }

/* Prose (markdown: blog, docs, legal) */
.prose {
  max-width: 72ch;
  font-size: var(--fs-md);
  line-height: 1.75;
  color: var(--text);
  overflow-wrap: break-word;
}
.prose--wide { max-width: none; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: var(--fs-2xl); margin-top: 2.2em; margin-bottom: -0.2em; scroll-margin-top: calc(var(--header-h) + 16px); }
.prose h3 { font-size: var(--fs-lg); margin-top: 1.8em; margin-bottom: -0.3em; scroll-margin-top: calc(var(--header-h) + 16px); }
.prose h4 { font-size: var(--fs-md); margin-top: 1.6em; margin-bottom: -0.4em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose h2 > a.anchor, .prose h3 > a.anchor { color: var(--text-subtle); margin-left: 6px; opacity: 0; text-decoration: none; }
.prose h2:hover > a.anchor, .prose h3:hover > a.anchor { opacity: 1; }
.prose p, .prose li { color: var(--text); }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--text-subtle); }
.prose ol > li::marker { font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 600; }
.prose strong { font-weight: 650; }
.prose blockquote {
  padding: var(--s-3) var(--s-5);
  border-left: 3px solid var(--brand);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
}
.prose pre {
  padding: var(--s-4) var(--s-5);
  border-radius: var(--radius-lg);
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--code-border);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.7;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
/* code-block / code-tabs already draw the frame: their <pre> must not draw a second one */
.prose .code-block pre, .prose .code-tabs pre { margin: 0; border: 0; border-radius: 0; padding: var(--s-4) var(--s-5); }
.prose .code-tabs pre { background: transparent; }
.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  font-size: var(--fs-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
/* lib/content wraps markdown tables in .table-wrap (which draws the frame): real table layout, no second frame */
.prose .table-wrap > table { display: table; width: 100%; border: 0; border-radius: 0; overflow: visible; }
.prose th, .prose td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose img { border-radius: var(--radius-lg); border: 1px solid var(--border); }
.prose hr { margin: 2.5em 0; }
.prose figure figcaption { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--s-2); text-align: center; }
.prose .callout, .prose .alert { margin-block: 1.5em; font-size: var(--fs-sm); }
.prose--legal { font-size: var(--fs-base); line-height: 1.7; }
.prose--legal h2 { font-size: var(--fs-xl); counter-increment: legal; }
.prose--sm { font-size: var(--fs-base); }

/* Article meta (blog) */
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); font-size: var(--fs-sm); color: var(--text-muted); }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.post-card { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); min-width: 0; }
a.post-card:hover { text-decoration: none; color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.post-card__title { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.015em; line-height: 1.3; }
.post-card__excerpt { font-size: var(--fs-sm); color: var(--text-muted); }
.post-card__meta { margin-top: auto; font-size: var(--fs-xs); color: var(--text-muted); display: flex; gap: var(--s-3); flex-wrap: wrap; }

/* Version note (legal pages) */
.version-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.version-note strong { color: var(--text); }

/* 25. Site footer & language switcher ===================================== */

.site-footer {
  --text: var(--ink-text);
  --text-muted: var(--ink-muted);
  --border: var(--ink-border);
  --border-strong: var(--ink-border-strong);
  background: var(--ink);
  color: var(--ink-text);
  margin-top: var(--s-20);
  font-size: var(--fs-sm);
}
.site-footer--flush { margin-top: 0; }
.site-footer__top {
  display: grid;
  gap: var(--s-10) var(--s-8);
  grid-template-columns: minmax(0, 1fr);
  padding-block: var(--s-16) var(--s-12);
}
/* two link columns on every phone (the stacked single column made the footer ~2 screens tall) */
@media (min-width: 360px) {
  .site-footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .site-footer__top { grid-template-columns: minmax(0, 1.5fr) repeat(5, minmax(0, 1fr)); }
  .site-footer__brand { grid-column: auto; }
}
.site-footer__brand { display: flex; flex-direction: column; gap: var(--s-4); max-width: 340px; }
.site-footer__tagline { color: var(--ink-muted); line-height: 1.6; }
.site-footer__contact { display: flex; flex-direction: column; gap: 6px; color: var(--ink-muted); }
.site-footer__contact a, .site-footer__contact span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-muted); }
.site-footer__contact a:hover { color: #FFFFFF; text-decoration: none; }
.site-footer__contact .icon { width: 15px; height: 15px; opacity: 0.8; }
.site-footer__heading {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: #FFFFFF;
  margin-bottom: var(--s-4);
}
.site-footer__links { display: flex; flex-direction: column; gap: 10px; }
.site-footer__links a { color: var(--ink-muted); display: inline-flex; align-items: center; gap: 8px; line-height: 1.4; }
.site-footer__links a:hover { color: #FFFFFF; text-decoration: none; }
.site-footer__links .fi { font-size: 0.95em; }
.site-footer__payments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-4);
  padding-block: var(--s-5);
  border-top: 1px solid var(--ink-border);
}
.site-footer__payments-label { color: var(--ink-muted); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3) var(--s-6);
  padding-block: var(--s-5) var(--s-8);
  border-top: 1px solid var(--ink-border);
  color: var(--ink-muted);
  font-size: var(--fs-xs);
}
.site-footer__bottom-left, .site-footer__bottom-right { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); }
.site-footer__bottom a { color: var(--ink-muted); }
.site-footer__bottom a:hover { color: #FFFFFF; }
.site-footer__version { font-family: var(--font-mono); font-size: 0.7rem; padding: 1px 6px; border: 1px solid var(--ink-border-strong); border-radius: 4px; }

/* Language switcher (details/summary) */
.lang-switch { position: relative; display: inline-block; }
.lang-switch > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
  list-style: none;
  font-size: var(--fs-xs);
  font-weight: 500;
}
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.lang-switch__menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  z-index: 50;
  min-width: 180px;
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.site-footer .lang-switch__menu { background: var(--ink-2); }
.lang-switch__menu a {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--text);
}
.lang-switch__menu a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.site-footer .lang-switch__menu a:hover { background: var(--ink-3); }
.lang-switch__menu a[aria-current="true"] { font-weight: 600; }
.lang-switch__menu a[aria-current="true"]::after { content: ""; width: 6px; height: 10px; border-right: 2px solid var(--signal); border-bottom: 2px solid var(--signal); transform: rotate(45deg); margin-right: 4px; }
.lang-switch--down .lang-switch__menu { bottom: auto; top: calc(100% + 6px); }

/* 26. Dashboard shell ===================================================== */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 250;
  overflow: hidden;
}
.app-sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  height: var(--topbar-h);
  padding: 0 var(--s-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.app-sidebar__close { display: none; }
.app-sidebar__scroll { flex: 1 1 auto; overflow-y: auto; padding: var(--s-4) var(--s-3); overscroll-behavior: contain; }
.app-nav { display: flex; flex-direction: column; gap: 2px; }
.app-nav__section { margin-top: var(--s-5); padding: 0 var(--s-3) 6px; font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); }
.app-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}
.app-nav__link .icon { width: 18px; height: 18px; color: var(--text-subtle); transition: color var(--dur) var(--ease); }
.app-nav__link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.app-nav__link:hover .icon { color: var(--text-muted); }
.app-nav__link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-nav__link.is-active, .app-nav__link[aria-current="page"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.app-nav__link.is-active .icon, .app-nav__link[aria-current="page"] .icon { color: var(--brand-text); }
.app-nav__count { margin-left: auto; font-size: var(--fs-2xs); font-weight: 600; padding: 0 6px; border-radius: var(--radius-full); background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.app-nav__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: var(--s-2) 0;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--brand-solid);
  color: var(--on-brand);
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(36, 72, 232, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.app-nav__cta:hover { background: var(--brand-solid-hover); color: var(--on-brand); text-decoration: none; }
.app-nav__cta:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-nav__cta .icon { width: 16px; height: 16px; }
.app-nav__cta.is-active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand); }
.app-sidebar__foot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-4);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
}
.app-sidebar__foot a:not(.status-pill) { color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.app-sidebar__foot a:not(.status-pill):hover { color: var(--text); text-decoration: none; }
.app-sidebar__foot .status-pill { align-self: flex-start; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  height: var(--topbar-h);
  padding: 0 var(--s-6);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
}
.app-topbar__toggle { display: none; }
.app-topbar__brand { display: none; }
.app-topbar__spacer { flex: 1 1 auto; }
.app-topbar__actions { display: flex; align-items: center; gap: var(--s-2); }
.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 6px 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.balance-chip:hover { border-color: var(--border-strong); text-decoration: none; color: var(--text); }
.balance-chip__label { color: var(--text-muted); font-size: var(--fs-xs); }
.balance-chip__value { font-weight: 650; font-variant-numeric: tabular-nums; }
.balance-chip__add { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-text); }
.balance-chip__add .icon { width: 14px; height: 14px; }
.app-topbar__add { gap: 6px; padding-inline: 10px; }
.app-topbar__add .icon { width: 16px; height: 16px; }
.user-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
}
.user-menu__trigger:hover { border-color: var(--border-strong); }
.user-menu__trigger:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.user-menu__trigger .avatar { width: 28px; height: 28px; }
.user-menu__trigger .icon { width: 14px; height: 14px; color: var(--text-muted); }

.app-content {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1320px;
  padding: var(--s-6) var(--s-6) var(--s-16);
}
.app-content > .flash-stack { margin-bottom: var(--s-5); }
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}
.page-header__main { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 760px; }
.page-header__title { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.page-header__lead { color: var(--text-muted); font-size: var(--fs-sm); }
.page-header__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.page-header .breadcrumbs { margin-bottom: 2px; }
.app-section { margin-top: var(--s-8); }
.app-section__title { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.015em; margin-bottom: var(--s-4); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.app-backdrop { display: none; }

@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 86vw);
    transform: translateX(-100%);
    transition: transform 220ms var(--ease), visibility 0s linear 220ms;
    box-shadow: var(--shadow-lg);
    visibility: hidden;
  }
  body.sidebar-open .app-sidebar { transform: none; visibility: visible; transition: transform 220ms var(--ease), visibility 0s; }
  body.sidebar-open { overflow: hidden; }
  .app-backdrop {
    position: fixed;
    inset: 0;
    z-index: 240;
    background: var(--overlay);
  }
  body.sidebar-open .app-backdrop { display: block; }
  .app-sidebar__close { display: inline-grid; }
  .app-topbar { padding: 0 var(--gutter); }
  .app-topbar__toggle { display: inline-grid; }
  .app-topbar__brand { display: inline-flex; }
  .app-content { padding: var(--s-5) var(--gutter) var(--s-12); }
}
@media (max-width: 639px) {
  .balance-chip__label { display: none; }
  .app-topbar__add-label { display: none; }
  .app-topbar__add { padding-inline: 8px; }
  .app-topbar__docs { display: none; }
  .page-header__title { font-size: var(--fs-xl); }
  .page-header__actions { width: 100%; }
}
/* Phones: the menu toggle and the actions never shrink; the wordmark gives way first. */
.app-topbar__toggle, .app-topbar__actions > * { flex-shrink: 0; }
.app-topbar__brand { min-width: 0; }
@media (max-width: 479px) {
  .app-topbar { gap: var(--s-2); }
  .app-topbar__brand .logo__word { display: none; }
  .app-topbar__actions { gap: 6px; }
  .balance-chip { padding-inline: 8px 4px; gap: 6px; }
}

/* Demo badge */
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn-text);
  border: 1px solid var(--warn-border);
  font-size: var(--fs-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

/* 27. Admin layout ======================================================== */

.layout-admin {
  --brand: #5B3FD9;
  --brand-hover: #4A2FC4;
  --brand-solid: #5B3FD9;
  --brand-solid-hover: #4A2FC4;
  --brand-soft: #F0ECFF;
  --brand-soft-border: #D8CEFF;
  --brand-text: #5B3FD9;
  --focus-ring: 0 0 0 3px rgba(91, 63, 217, 0.28);
}
:root[data-theme="dark"] .layout-admin {
  --brand: #A08CFF;
  --brand-hover: #B9A9FF;
  --brand-solid: #6B4FE6;
  --brand-solid-hover: #7C62F0;
  --brand-soft: #231B45;
  --brand-soft-border: #3A2D72;
  --brand-text: #B9A9FF;
  --focus-ring: 0 0 0 3px rgba(160, 140, 255, 0.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .layout-admin {
    --brand: #A08CFF;
    --brand-hover: #B9A9FF;
    --brand-solid: #6B4FE6;
    --brand-solid-hover: #7C62F0;
    --brand-soft: #231B45;
    --brand-soft-border: #3A2D72;
    --brand-text: #B9A9FF;
    --focus-ring: 0 0 0 3px rgba(160, 140, 255, 0.4);
  }
}
.layout-admin .app-sidebar { background: var(--ink); border-right-color: var(--ink-border); }
.layout-admin .app-sidebar__brand { border-bottom-color: var(--ink-border); }
.layout-admin .app-sidebar .logo { color: #FFFFFF; }
.layout-admin .app-nav__section { color: var(--ink-muted); }
.layout-admin .app-nav__link { color: var(--ink-muted); }
.layout-admin .app-nav__link .icon { color: #6F7B90; }
.layout-admin .app-nav__link:hover { background: rgba(255, 255, 255, 0.06); color: #FFFFFF; }
.layout-admin .app-nav__link:hover .icon { color: var(--ink-muted); }
.layout-admin .app-nav__link.is-active, .layout-admin .app-nav__link[aria-current="page"] { background: rgba(160, 140, 255, 0.16); color: #FFFFFF; }
.layout-admin .app-nav__link.is-active .icon, .layout-admin .app-nav__link[aria-current="page"] .icon { color: #B9A9FF; }
.layout-admin .app-nav__link.is-active::before, .layout-admin .app-nav__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #A08CFF;
}
.layout-admin .app-sidebar__foot { border-top-color: var(--ink-border); }
.layout-admin .app-sidebar__foot a:not(.status-pill) { color: var(--ink-muted); }
.layout-admin .app-sidebar__foot a:not(.status-pill):hover { color: #FFFFFF; }
.layout-admin .app-sidebar .icon-btn { color: var(--ink-muted); }
.layout-admin .app-sidebar .icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: #A08CFF;
  color: #140B33;
  font-size: var(--fs-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.layout-admin .app-topbar { border-top: 3px solid var(--brand-solid); }
.layout-admin .app-content { max-width: 1480px; padding-top: var(--s-5); }
.layout-admin .page-header { margin-bottom: var(--s-5); }
.layout-admin .page-header__title { font-size: var(--fs-xl); }
.layout-admin .data-table th, .layout-admin .data-table td { padding: 8px var(--s-3); }
.layout-admin .data-table thead th { padding-top: 7px; padding-bottom: 7px; }
.layout-admin .card__body { padding: var(--s-4); }
.layout-admin .card__header { padding: var(--s-3) var(--s-4); }
.layout-admin .stat { padding: var(--s-4); }
.layout-admin .stat__value { font-size: var(--fs-xl); }

/* 28. Auth layout ========================================================= */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
}
@media (min-width: 1024px) {
  .auth { grid-template-columns: minmax(0, 1fr) minmax(420px, 0.85fr); }
}
.auth__main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.auth__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) var(--gutter);
}
.auth__header-actions { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); }
.auth__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--s-6) var(--gutter) var(--s-10);
}
.auth__form { width: 100%; max-width: 420px; margin-inline: auto; display: flex; flex-direction: column; gap: var(--s-6); }
.auth__form > .flash-stack { margin-bottom: 0; }
.auth-title { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.auth-lead { color: var(--text-muted); font-size: var(--fs-base); margin-top: var(--s-2); }
.auth-card {
  padding: var(--s-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.auth-switch { text-align: center; font-size: var(--fs-sm); color: var(--text-muted); }
.auth-divider { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  padding: var(--s-5) var(--gutter);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.auth__footer nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
.auth__footer a { color: var(--text-muted); }
.auth__footer a:hover { color: var(--text); }

.auth__panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s-10);
  padding: var(--s-12) var(--s-12);
  background: radial-gradient(700px 400px at 100% 0%, rgba(36, 72, 232, 0.4), transparent 70%), var(--ink);
  color: var(--ink-text);
}
@media (min-width: 1024px) { .auth__panel { display: flex; } }
.auth__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 80% 10%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 70% at 80% 10%, #000 20%, transparent 75%);
}
.auth-panel__head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-4); max-width: 480px; }
.auth-panel__title { font-size: var(--fs-3xl); font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; color: #FFFFFF; }
.auth-panel__lead { color: var(--ink-muted); font-size: var(--fs-md); }
.auth-panel__facts { display: flex; flex-direction: column; gap: var(--s-5); max-width: 460px; }
.auth-fact { display: flex; gap: var(--s-4); align-items: flex-start; }
.auth-fact__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: rgba(143, 166, 255, 0.12);
  border: 1px solid rgba(143, 166, 255, 0.24);
  color: var(--ink-brand);
  flex-shrink: 0;
}
.auth-fact__title { font-weight: 600; color: #FFFFFF; font-size: var(--fs-sm); }
.auth-fact__text { color: var(--ink-muted); font-size: var(--fs-sm); line-height: 1.55; }
.auth-panel__figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--s-4); padding-top: var(--s-6); border-top: 1px solid var(--ink-border); max-width: 520px; }
.auth-panel__figures strong { display: block; font-size: var(--fs-xl); color: #FFFFFF; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.auth-panel__figures span { font-size: var(--fs-xs); color: var(--ink-muted); }
.auth-panel__foot { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; font-size: var(--fs-xs); color: var(--ink-muted); }

/* 29. Error pages & styleguide ============================================ */

.error-page { padding-block: var(--s-20) var(--s-16); }
.error-page__code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--brand-text);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-border);
}
.error-page__title { font-size: var(--fs-4xl); font-weight: 700; letter-spacing: -0.03em; margin-top: var(--s-4); }
.error-page__lead { color: var(--text-muted); font-size: var(--fs-lg); margin-top: var(--s-3); max-width: 60ch; }
.error-page__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.error-page__links { margin-top: var(--s-12); }
.error-page__ref { margin-top: var(--s-6); font-size: var(--fs-sm); color: var(--text-muted); }

.sg-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-section { padding-block: var(--s-10); border-top: 1px solid var(--border); scroll-margin-top: calc(var(--header-h) + 16px); }
.sg-section:first-of-type { border-top: 0; }
.sg-section__title { font-size: var(--fs-xl); margin-bottom: var(--s-2); }
.sg-section__lead { color: var(--text-muted); font-size: var(--fs-sm); margin-bottom: var(--s-6); }
.sg-demo { padding: var(--s-6); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); }
.sg-demo--surface { background: var(--surface); }
.sg-demo--ink { background: var(--ink); border-color: var(--ink-border); }
.sg-swatches { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sg-swatch { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); font-size: var(--fs-xs); }
.sg-swatch__chip { height: 52px; border-bottom: 1px solid var(--border); }
.sg-swatch__name { padding: 6px 10px; font-family: var(--font-mono); color: var(--text-muted); }
.sg-label { font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); margin-bottom: var(--s-3); }
.chart-box { position: relative; height: 260px; }
.chart-box--sm { height: 180px; }
.chart-box--lg { height: 340px; }

/* 30. Motion preferences ================================================== */

@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;
  }
  .status-pill__dot::after, .live-dot::after { display: none; }
}

/* 31. Print =============================================================== */

.print-only { display: none !important; }

@media print {
  :root {
    --bg: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #F4F5F7;
    --text: #000000;
    --text-muted: #444444;
    --border: #CCCCCC;
  }
  @page { margin: 16mm; }
  body { background: #FFFFFF; color: #000000; font-size: 11pt; }
  .announce, .site-header, .site-footer, .app-sidebar, .app-topbar, .app-backdrop,
  .toast-region, .flash-stack, .no-print, .btn, .icon-btn, .cred__actions,
  .breadcrumbs, .pagination, .crumbbar, .banner { display: none !important; }
  .print-only { display: block !important; }
  .app { display: block; }
  .app-content { padding: 0; max-width: none; }
  .card, .table-wrap, .stat { box-shadow: none !important; border-color: #CCCCCC; break-inside: avoid; }
  .data-table thead th { background: #F4F5F7 !important; color: #000000; }
  a { color: #000000; text-decoration: none; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444444; }
  .code-block, pre, .code-tabs { background: #F7F7F7 !important; color: #000000 !important; border: 1px solid #CCCCCC; }
  .badge { border: 1px solid #999999 !important; background: transparent !important; color: #000000 !important; }

  /* Receipt / invoice */
  .receipt { max-width: none; border: 0; padding: 0; }
  .receipt__header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000000; padding-bottom: 12pt; margin-bottom: 16pt; }
}

/* Receipt (screen + print) */
.receipt {
  max-width: 820px;
  overflow-x: auto; /* long (translated) line items must not widen the page on phones */
  padding: var(--s-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.receipt__header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-6); padding-bottom: var(--s-6); margin-bottom: var(--s-6); border-bottom: 1px solid var(--border); }
.receipt__title { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; }
.receipt__meta { font-size: var(--fs-sm); color: var(--text-muted); text-align: right; }
.receipt__parties { display: grid; gap: var(--s-6); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: var(--s-6); font-size: var(--fs-sm); }
.receipt__parties h4 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); margin-bottom: 6px; }
.receipt__totals { margin-left: auto; width: min(320px, 100%); margin-top: var(--s-5); font-size: var(--fs-sm); }
.receipt__totals div { display: flex; justify-content: space-between; padding: 6px 0; font-variant-numeric: tabular-nums; }
.receipt__totals div:last-child { border-top: 2px solid var(--text); font-weight: 700; font-size: var(--fs-md); padding-top: 10px; margin-top: 4px; }
.receipt__foot { margin-top: var(--s-8); font-size: var(--fs-xs); color: var(--text-muted); }

/* Header: extra-small phones keep only the essentials */
@media (max-width: 359px) {
  .site-header__actions .hide-xs { display: none; }
}

.code-tabs__bar .code-copy { flex-shrink: 0; }

/* Burger: swap menu / close icons */
.site-header__burger .icon-x { display: none; }
.site-header__burger[aria-expanded="true"] .icon-x { display: inline-block; }
.site-header__burger[aria-expanded="true"] .icon-menu { display: none; }
.low-balance { margin-bottom: var(--s-6); }
