/*
 * RemoteUI design tokens: the single source of every colour, size, radius and shadow of the UI.
 *
 * Components never hard-code values: they read these custom properties, so a theme is just a different set of
 * values. The sign-in page reads the same tokens (login.css).
 *
 * ACCENT. --accent-base* and --orb-* are the default product blue. /tema.css (internal/loginscreen PaletteFor, the
 * colour chosen in Administración → Apariencia → Pantalla de acceso) overrides them for the whole product, and a
 * company's /marca/{slug}/tema.css overrides them again on its users' pages. Themes never set an accent of their
 * own: they map --accent, --accent-soft and --accent-text from the base, so a new accent reaches every theme.
 *
 * THEMES. Each theme is one [data-theme="<id>"]:not([data-viewer-tokens]) block below (on <html>, or on any element
 * to scope it: the Apariencia previews) plus one entry in ui.Themes (internal/platform/ui/themes.go). A test checks
 * that every theme defines every token and meets WCAG AA for text with the default accent and with sample accents.
 * static/js/theme.js applies the user's choice (or the organization default) before first paint.
 *
 * VIEWER. The application viewer (/app/{id}) keeps its own look (its UX is a separate track): its <html> carries
 * data-viewer-tokens, which switches the theme blocks off and the [data-viewer-tokens] blocks at the end on (the
 * palette before the redesign). Its own style.css also defines --bg, --accent and --muted on :root.
 *
 * The --color-* names exist only in the viewer's blocks.
 */

:root {
  /* Typography. --font-ui is the product's font (served by RemoteUI: fonts.css); --font-sans the viewer's. */
  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 26px;
  /* The interior's scale: an administration console, dense and calm (density pass, owner rules A, 2026-11-22).
   * Sentence case everywhere, no sustained capitals. 12 px is the floor. */
  --fs-small: 12px; /* hints, status text */
  --fs-secondary: 12px; /* descriptions, table headers, labels */
  --fs-body: 13px;
  --fs-block: 14px; /* title of a settings block or row (700) */
  --fs-section: 15px; /* section title, application name (700) */
  --fs-figure: 22px; /* key figures (800) */
  --fs-title: 24px; /* page title (800) */
  --fs-title-sm: 22px; /* page title on a phone */
  --fs-hero: 32px; /* the portal's greeting (800) */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heavy: 800;
  --heading-weight: var(--weight-bold); /* section titles (h2) */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-body: 1.5;
  --tracking-title: -0.025em;
  --tracking-hero: -0.03em;

  /* Spacing (4px scale) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --radius-item: 8px; /* menu items, small buttons */
  --radius-control: 8px; /* buttons and fields */
  --radius-card: 12px; /* cards and the metrics' chart boxes */
  --radius-app: 18px; /* the portal's application cards */
  --radius-panel: 24px; /* the accent panels */

  /* Sizes */
  --control-h: 36px; /* fields, selects, search boxes */
  --search-h: 34px; /* the top bar's search */
  --btn-h: 36px; /* primary and secondary buttons */
  --btn-h-sm: 30px; /* row actions, icon buttons («Más») */
  --pill-h: 22px; /* only states that change behaviour: Retirado, Apagada, Inactiva */
  --switch-w: 40px;
  --switch-h: 22px;
  --kpi-icon: 32px;
  --kpi-h: 72px; /* the key figures' row */
  --nav-item-h: 36px;
  --dot: 8px; /* the state dot */
  --icon-sm: 14px; /* icons beside a text: warning, error, verified identity */
  --radius-menu: 10px; /* menus and lists that float */
  --radius-menu-item: var(--radius-item);
  --menu-fs: var(--fs-body);
  --btn-pad: 14px;
  --btn-fs: var(--fs-body);
  --btn-fs-sm: var(--fs-secondary);
  --btn-weight: var(--weight-semibold);
  --btn-icon: 16px;
  --btn-icon-sm: 14px;

  /* Rhythm (multiples of 4) */
  --card-pad: 20px;
  --section-gap: 24px; /* between sections */
  --form-gap: 16px; /* between the rows of a form; also the air around a divider */

  /* Layout */
  --topbar-h: 60px;
  --viewer-bar-h: 40px;
  --sidebar-w: 264px;
  --drawer-w: 480px;
  --content-max: 1180px; /* portal and generic pages */
  --content-max-admin: 1280px; /* administration: left-aligned under the header */

  /* Motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;

  /* Layers */
  --z-topbar: 50;
  --z-menu: 60;
  --z-drawer: 70;
  --z-dialog: 80;
  --z-toast: 90;

  /* The accent and the tones derived from it (defaults: the product blue; /tema.css replaces them). */
  --accent-base: #0068DF; /* the brand's blue, white text 5.2:1 */
  --accent-base-strong: #005CC4;
  --accent-base-soft: #EBF3FC;
  --accent-base-tint: #FCFDFF; /* text on the accent: the nearest light tone with 4.5:1 */
  --accent-base-icon: #B3D2F5; /* icons on the accent */
  --accent-base-hover: #1474E2; /* a menu item hovered on the accent: lighter, white text still 4.5:1 */
  --accent-base-focus: #73ACED; /* focus ring on the accent */
  --accent-base-shadow: rgba(0,92,196,0.28);
  --on-accent-base: #FFFFFF; /* white, or dark when that reads better on the accent */
  --accent-base-text: #005CC4; /* the accent as text on light surfaces */
  --accent-base-text-grey: #004899; /* the accent as text on gris's surfaces */
  --orb-1: #3386E5;
  --orb-2: #0F71E1;
  --orb-3: #005EC9;
  --orb-4: #1F7AE3;
  /* The brand gradient around the accent (the brand's cyan → blue → dark blue, each readable under white text):
   * the administration menu, the sign-in panel and the portal's welcome. /tema.css replaces them with tones of
   * another accent. */
  --brand-grad-start: #007DB0;
  --brand-grad-end: #101840;
  --logo-on-accent-white: block; /* which logo sits on the accent: white under white text, colour under dark text */
  --logo-on-accent-colour: none;

  --switch-knob: #FFFFFF; /* the switch's knob, white on its grey or accent track in every theme */
  --nav-active-bg: #FFFFFF; /* the active item of the administration menu, white on the accent */
}

/* ---------- Claro (organization default) ---------- */
[data-theme="claro"]:not([data-viewer-tokens]) {
  --logo-light: block; /* which logo a bar shows (partials/logo.html): the files on a light bar */
  --logo-dark: none;
  color-scheme: light;

  --accent: var(--accent-base);
  --accent-strong: var(--accent-base-strong);
  --accent-soft: var(--accent-base-soft);
  --accent-text: var(--accent-base-text);
  --on-accent: var(--on-accent-base);

  --ink: #101840; /* the brand's dark blue */
  --text: #1F2A44;
  --muted: #5B6478;
  --subtle: #6E7686;
  --border: #E3E8F2;
  --border-input: #D3DAE8;
  --border-strong: #B4BED2;
  --divider: #EDF1F7;
  --bg: #F1F4FA;
  --surface: #FFFFFF;
  --table-head: #F7F9FD;
  --overlay: rgba(15, 30, 70, 0.45);
  --focus: var(--accent-base-text);

  --success-bg: #ECFDF3;
  --success-text: #067647;
  --success-dot: #12B76A;
  --warning-bg: #FFFAEB;
  --warning-text: #B54708;
  --warning-dot: #F79009;
  --error-bg: #FEF3F2;
  --error-text: #B42318;
  --error-dot: #F04438;
  --neutral-bg: #F1F4FA;
  --neutral-text: #475467;
  --neutral-dot: #98A2B3;
  --danger-border: #FECDCA;

  /* Slots of a calendar (F-002): «ink» on «tint» is text (AA), «edge» marks a block or a bar (3:1 on the surface). */
  --slot-laboral-edge: #1D5FD0;
  --slot-laboral-tint: #E4EEFD;
  --slot-laboral-ink: #123A7D;
  --slot-noche-edge: #5B3FC4;
  --slot-noche-tint: #ECE8FB;
  --slot-noche-ink: #35227F;
  --slot-finde-edge: #0F7D73;
  --slot-finde-tint: #DCF2EE;
  --slot-finde-ink: #0A4F49;
  --slot-festivo-edge: #B35C00;
  --slot-festivo-tint: #FDEEDD;
  --slot-festivo-ink: #6E3800;
  /* The mark of each calendar when several are shown at once. */
  --cal-mark-0: #1D5FD0;
  --cal-mark-1: #C2185B;
  --cal-mark-2: #2E7D32;
  --cal-mark-3: #B35C00;
  --cal-mark-4: #6D4C9F;
  --cal-mark-5: #00838F;

  --shadow-btn: 0 6px 16px -6px var(--accent-base-shadow);
  --shadow-panel: 0 18px 40px -18px var(--accent-base-shadow);
  --shadow-menu: 0 16px 40px -12px rgba(15, 30, 70, 0.22);
  --shadow-dialog: 0 24px 64px -16px rgba(15, 30, 70, 0.35);
  --shadow-lift: 0 12px 28px -14px rgba(15, 30, 70, 0.28);
}

/* ---------- Oscuro ---------- */
[data-theme="oscuro"]:not([data-viewer-tokens]) {
  color-scheme: dark;
  --logo-light: none; /* a dark bar: the white logo (partials/logo.html) */
  --logo-dark: block;

  --accent: var(--accent-base);
  --accent-strong: var(--accent-base-strong);
  --accent-soft: color-mix(in srgb, var(--accent-base) 22%, #151D30);
  --accent-text: color-mix(in srgb, var(--accent-base) 35%, #FFFFFF);
  --on-accent: var(--on-accent-base);

  --ink: #F3F6FC;
  --text: #DCE3F0;
  --muted: #A3AEC4;
  --subtle: #8591A8;
  --border: #283350;
  --border-input: #3A4767;
  --border-strong: #51608A;
  --divider: #212B45;
  --bg: #0C1220;
  --surface: #151D30;
  --table-head: #1A2338;
  --overlay: rgba(3, 6, 14, 0.65);
  --focus: color-mix(in srgb, var(--accent-base) 35%, #FFFFFF);

  --success-bg: #0E2E22;
  --success-text: #75E0A7;
  --success-dot: #17B26A;
  --warning-bg: #33250C;
  --warning-text: #FDB022;
  --warning-dot: #F79009;
  --error-bg: #3B1714;
  --error-text: #FDA29B;
  --error-dot: #F04438;
  --neutral-bg: #1F2840;
  --neutral-text: #B9C2D6;
  --neutral-dot: #8792A8;
  --danger-border: #7A2E26;

  /* Slots of a calendar (F-002): «ink» on «tint» is text (AA), «edge» marks a block or a bar (3:1 on the surface). */
  --slot-laboral-edge: #6FA4FF;
  --slot-laboral-tint: #18294A;
  --slot-laboral-ink: #D3E3FF;
  --slot-noche-edge: #A493FF;
  --slot-noche-tint: #251E4C;
  --slot-noche-ink: #E3DDFF;
  --slot-finde-edge: #3CC7B5;
  --slot-finde-tint: #0F3431;
  --slot-finde-ink: #C2F1EA;
  --slot-festivo-edge: #F2A65A;
  --slot-festivo-tint: #3A2812;
  --slot-festivo-ink: #FFE2C2;
  /* The mark of each calendar when several are shown at once. */
  --cal-mark-0: #6FA4FF;
  --cal-mark-1: #F06292;
  --cal-mark-2: #66BB6A;
  --cal-mark-3: #F2A65A;
  --cal-mark-4: #B39DDB;
  --cal-mark-5: #4DD0E1;

  --shadow-btn: 0 6px 16px -6px rgba(0, 0, 0, 0.6);
  --shadow-panel: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  --shadow-menu: 0 16px 40px -12px rgba(0, 0, 0, 0.7);
  --shadow-dialog: 0 24px 64px -16px rgba(0, 0, 0, 0.8);
  --shadow-lift: 0 12px 28px -14px rgba(0, 0, 0, 0.7);
}

/* ---------- Gris: medium grey, neither white nor black, dark text ---------- */
[data-theme="gris"]:not([data-viewer-tokens]) {
  --logo-light: block; /* which logo a bar shows (partials/logo.html): the files on a light bar */
  --logo-dark: none;
  color-scheme: light;

  --accent: var(--accent-base);
  --accent-strong: var(--accent-base-strong);
  --accent-soft: color-mix(in srgb, var(--accent-base) 14%, #CBD0D7);
  --accent-text: var(--accent-base-text-grey);
  --on-accent: var(--on-accent-base);

  --ink: #0A0F1F;
  --text: #121826;
  --muted: #333B4A;
  --subtle: #424A59;
  --border: #A2A8B3;
  --border-input: #8B929E;
  --border-strong: #6F7785;
  --divider: #B3B9C2;
  --bg: #B7BCC5;
  --surface: #CBD0D7;
  --table-head: #C1C6CE;
  --overlay: rgba(20, 24, 30, 0.45);
  --focus: var(--accent-base-text-grey);

  --success-bg: #D3E9DC;
  --success-text: #054F31;
  --success-dot: #0E9F5A;
  --warning-bg: #EEDFC2;
  --warning-text: #6B2F05;
  --warning-dot: #DC6803;
  --error-bg: #EBCFCC;
  --error-text: #7A1610;
  --error-dot: #D92D20;
  --neutral-bg: #C1C6CE;
  --neutral-text: #2B3342;
  --neutral-dot: #6B7486;
  --danger-border: #C9837C;

  /* Slots of a calendar (F-002): «ink» on «tint» is text (AA), «edge» marks a block or a bar (3:1 on the surface). */
  --slot-laboral-edge: #1A4FB0;
  --slot-laboral-tint: #E4EEFD;
  --slot-laboral-ink: #123A7D;
  --slot-noche-edge: #4A2FB0;
  --slot-noche-tint: #ECE8FB;
  --slot-noche-ink: #35227F;
  --slot-finde-edge: #0B5F57;
  --slot-finde-tint: #DCF2EE;
  --slot-finde-ink: #0A4F49;
  --slot-festivo-edge: #8F4700;
  --slot-festivo-tint: #FDEEDD;
  --slot-festivo-ink: #6E3800;
  /* The mark of each calendar when several are shown at once. */
  --cal-mark-0: #1A4FB0;
  --cal-mark-1: #A0144B;
  --cal-mark-2: #1F5F23;
  --cal-mark-3: #8F4700;
  --cal-mark-4: #563A85;
  --cal-mark-5: #006570;

  --shadow-btn: 0 6px 16px -6px rgba(20, 24, 30, 0.35);
  --shadow-panel: 0 18px 40px -18px rgba(20, 24, 30, 0.45);
  --shadow-menu: 0 16px 40px -12px rgba(20, 24, 30, 0.35);
  --shadow-dialog: 0 24px 64px -16px rgba(20, 24, 30, 0.45);
  --shadow-lift: 0 12px 28px -14px rgba(20, 24, 30, 0.4);
}

/* ---------- Tokens of every themed element but the viewer ---------- */
[data-theme]:not([data-viewer-tokens]) {
  /* Component tokens that the viewer keeps at their previous values. */
  --btn-bg: var(--surface);
  --btn-border: var(--border-input);
  --input-bg: var(--surface);
  --menu-border: var(--border); /* what floats: menus, dialogs, toasts */
  --shadow-card: none;
  --shadow-knob: 0 1px 3px rgba(15, 30, 70, 0.25);
}

/* No shadows on cards, buttons or panels in the interior (density pass, rule D); only what floats keeps one. The
 * sign-in page and its family keep theirs (the login does not change). */
body:not(.login-page):not(:has(.auth)):not(.viewer) {
  --shadow-btn: none;
  --shadow-lift: none;
  --shadow-panel: none;
}

/* ======================================================================================================== */
/* The viewer's palette (unchanged by the redesign): only on <html data-viewer-tokens>.                     */
/* ======================================================================================================== */

/* ---------- Oscuro (the original RemoteUI look; also the fallback) ---------- */
[data-viewer-tokens][data-theme="oscuro"] {
  --logo-light: none; /* a dark bar: the white logo (partials/logo.html) */
  --logo-dark: block;
  color-scheme: dark;

  --color-bg: #1f2023;
  --color-surface: #2a2c30;
  --color-surface-2: #34373c;
  --color-surface-sunken: #1b1c1f;
  --color-topbar: #111214;
  --color-overlay: rgba(0, 0, 0, 0.55);

  --color-border: #3a3d42;
  --color-border-strong: #4a4e55;
  --color-divider: #2f3135;

  --color-text: #e8eaed;
  --color-text-muted: #a3a9b0;
  --color-text-subtle: #858b92;
  --color-text-on-accent: #ffffff;

  --color-accent: #216ff3; /* same hue as before, darkened for 4.5:1 white text */
  --color-accent-hover: #1b62d9;
  --color-accent-soft: rgba(76, 139, 245, 0.18);
  --color-accent-text: #8ab4f8;

  --color-danger: #d93025;
  --color-danger-hover: #ea4335;
  --color-danger-soft: #3a2a2c;
  --color-danger-text: #f28b82;

  --color-success: #5bb974;
  --color-success-soft: rgba(52, 168, 83, 0.16);
  --color-warning: #e0b24a;
  --color-warning-soft: rgba(224, 178, 74, 0.16);

  --color-chip-user-border: #3b5bdb;
  --color-chip-user-text: #9ab2ff;
  --color-chip-group-border: #2f6b43;
  --color-chip-group-text: #8fe0a8;
  --color-chip-all-border: #8a6d22;
  --color-chip-all-text: #e0b24a;

  --color-focus: #8ab4f8;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);

  /* App viewer: area behind the app windows and the window frames */
  --color-stage: #18191c;
  --color-stage-pattern: rgba(255, 255, 255, 0.035);
  --color-window-frame: #2b2d31;
  --color-window-frame-text: #e8eaed;
  --color-window-frame-border: #1f2023;
  --shadow-window: 0 6px 24px rgba(0, 0, 0, 0.6);
}

/* ---------- Claro (organization default): light neutral, no pure white ---------- */
[data-viewer-tokens][data-theme="claro"] {
  --logo-light: block; /* which logo a bar shows (partials/logo.html): the files on a light bar */
  --logo-dark: none;
  color-scheme: light;

  --color-bg: #eceff3;
  --color-surface: #f7f8fa;
  --color-surface-2: #e4e8ed;
  --color-surface-sunken: #f1f3f6;
  --color-topbar: #f7f8fa;
  --color-overlay: rgba(15, 23, 42, 0.35);

  --color-border: #d3d8df;
  --color-border-strong: #b6bdc7;
  --color-divider: #dfe3e8;

  --color-text: #1b1f24;
  --color-text-muted: #4f5661;
  --color-text-subtle: #6b727d;
  --color-text-on-accent: #ffffff;

  --color-accent: #2563d6;
  --color-accent-hover: #1d4fb0;
  --color-accent-soft: rgba(37, 99, 214, 0.12);
  --color-accent-text: #1f56bd;

  --color-danger: #c62828;
  --color-danger-hover: #a52020;
  --color-danger-soft: #fae6e5;
  --color-danger-text: #a52020;

  --color-success: #1b7a3a;
  --color-success-soft: rgba(27, 122, 58, 0.12);
  --color-warning: #875800;
  --color-warning-soft: rgba(224, 178, 74, 0.2);

  --color-chip-user-border: #9db2f5;
  --color-chip-user-text: #2a49b8;
  --color-chip-group-border: #8cc9a3;
  --color-chip-group-text: #1f6b3a;
  --color-chip-all-border: #dcbd72;
  --color-chip-all-text: #7a5000;

  --color-focus: #2563d6;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.18);

  /* App viewer: area behind the app windows and the window frames */
  --color-stage: #dde1e7;
  --color-stage-pattern: rgba(15, 23, 42, 0.07);
  --color-window-frame: #f2f4f7;
  --color-window-frame-text: #1b1f24;
  --color-window-frame-border: #d3d8df;
  --shadow-window: 0 6px 24px rgba(15, 23, 42, 0.18);
}

/* ---------- Gris: medium grey, neither white nor black, dark text ---------- */
[data-viewer-tokens][data-theme="gris"] {
  --logo-light: block; /* which logo a bar shows (partials/logo.html): the files on a light bar */
  --logo-dark: none;
  color-scheme: light;

  --color-bg: #b4b9c0;
  --color-surface: #c6cad0;
  --color-surface-2: #b8bcc3;
  --color-surface-sunken: #d0d3d8;
  --color-topbar: #a9aeb6;
  --color-overlay: rgba(20, 24, 30, 0.4);

  --color-border: #9fa4ac;
  --color-border-strong: #868c95;
  --color-divider: #adb2b9;

  --color-text: #121519;
  --color-text-muted: #343a41;
  --color-text-subtle: #484e56;
  --color-text-on-accent: #ffffff;

  --color-accent: #1c4fae;
  --color-accent-hover: #163f8c;
  --color-accent-soft: rgba(28, 79, 174, 0.16);
  --color-accent-text: #163f8c;

  --color-danger: #b02a22;
  --color-danger-hover: #8e211b;
  --color-danger-soft: #dcbcb9;
  --color-danger-text: #7f1d18;

  --color-success: #155f2c;
  --color-success-soft: rgba(21, 95, 44, 0.14);
  --color-warning: #5f3e00;
  --color-warning-soft: rgba(160, 120, 30, 0.2);

  --color-chip-user-border: #5370c4;
  --color-chip-user-text: #1b3690;
  --color-chip-group-border: #4c8a62;
  --color-chip-group-text: #144d29;
  --color-chip-all-border: #9a7a2c;
  --color-chip-all-text: #553800;

  --color-focus: #1c4fae;

  --shadow-sm: 0 1px 2px rgba(20, 24, 30, 0.15);
  --shadow-md: 0 6px 18px rgba(20, 24, 30, 0.2);
  --shadow-lg: 0 16px 48px rgba(20, 24, 30, 0.28);

  /* App viewer: area behind the app windows and the window frames */
  --color-stage: #a2a7af;
  --color-stage-pattern: rgba(20, 24, 30, 0.08);
  --color-window-frame: #c6cad0;
  --color-window-frame-text: #121519;
  --color-window-frame-border: #959aa2;
  --shadow-window: 0 6px 24px rgba(20, 24, 30, 0.3);
}

/* The new token names on the viewer, mapped to its palette above, so the components it shares (button, select,
 * card, tooltip) look as they did. Its sizes too. */
[data-viewer-tokens] {
  --font-ui: var(--font-sans);
  --leading-body: var(--leading-normal);
  --fs-section: var(--text-lg);
  --fs-title: var(--text-xl);
  --heading-weight: var(--weight-semibold);
  --accent: var(--color-accent);
  --accent-strong: var(--color-accent-hover);
  --accent-soft: var(--color-accent-soft);
  --accent-text: var(--color-accent-text);
  --on-accent: var(--color-text-on-accent);
  --ink: var(--color-text);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --subtle: var(--color-text-subtle);
  --border: var(--color-divider);
  --border-input: var(--color-border);
  --border-strong: var(--color-border-strong);
  --divider: var(--color-divider);
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --table-head: var(--color-surface-2); /* hovers of its menu and buttons */
  --overlay: var(--color-overlay);
  --focus: var(--color-focus);
  --success-bg: var(--color-success-soft);
  --success-text: var(--color-success);
  --success-dot: var(--color-success);
  --warning-bg: var(--color-warning-soft);
  --warning-text: var(--color-warning);
  --warning-dot: var(--color-warning);
  --error-bg: var(--color-danger-soft);
  --error-text: var(--color-danger-text);
  --error-dot: var(--color-danger);
  --neutral-bg: var(--color-surface-sunken);
  --neutral-text: var(--color-text-muted);
  --neutral-dot: var(--color-text-subtle);
  --danger-border: var(--color-danger);
  --shadow-btn: none;
  --shadow-card: var(--shadow-sm);
  --shadow-menu: var(--shadow-md); /* its toasts */
  --shadow-dialog: var(--shadow-lg);
  --shadow-lift: var(--shadow-md);
  --shadow-panel: var(--shadow-md);
  --shadow-knob: var(--shadow-sm);

  /* The sizes the interior changed in the density pass, as they were: the viewer does not change. */
  --fs-small: 12px;
  --fs-secondary: 13px;
  --fs-body: 14px;
  --fs-block: 15px;
  --fs-figure: 26px;
  --fs-title-sm: 24px;
  --fs-hero: 36px;
  --pill-h: 26px;
  --switch-w: 48px;
  --switch-h: 28px;
  --kpi-icon: 44px;
  --nav-item-h: 38px;
  --topbar-h: 68px;
  --content-max-admin: 1440px;
  --btn-icon: 18px;
  --btn-icon-sm: 16px;
  --card-pad: 24px;
  --btn-h: 36px;
  --btn-h-sm: 30px;
  --btn-pad: 16px;
  --btn-fs: 13px;
  --btn-fs-sm: 12px;
  --btn-weight: 600;
  --btn-bg: var(--color-surface-2);
  --btn-border: transparent;
  --input-bg: var(--color-surface-sunken);
  --menu-border: var(--color-border);
  --control-h: 38px;
  --radius-control: 8px;
  --radius-item: 8px;
  --radius-card: 12px;
  --radius-menu: 8px;
  --radius-menu-item: 6px;
  --menu-fs: 13px;
}

/* The sign-in page (body.login-page) and its family (<main class="auth">) keep the sizes they had before the density
 * pass: the login and its pages do not change (owner, 2026-11-22). On <body>, so the text they inherit keeps them too. */
.login-page,
body:has(.auth),
.auth {
  --fs-secondary: 13px;
  --fs-body: 14px;
  --fs-block: 15px;
  --fs-section: 17px;
  --fs-title: 28px;
  --fs-title-sm: 24px;
  --leading-body: 1.6;
  --control-h: 46px;
  --btn-h: 44px;
  --btn-h-sm: 36px;
  --btn-pad: 18px;
  --btn-fs: 14px; /* a var() is resolved where it is declared (:root): restated here */
  --btn-fs-sm: 13px;
  --btn-icon: 18px;
  --btn-icon-sm: 16px;
  --menu-fs: 14px;
  --btn-weight: var(--weight-bold);
  --radius-item: 10px;
  --radius-control: 12px;
  --radius-card: 16px;
  --switch-w: 48px;
  --switch-h: 28px;
}
