/* GoSkeleton — Bootstrap 5 theme layer.
 *
 * web/static/vendor/bootstrap/bootstrap-5.3.9.min.css ships unmodified; this
 * file maps the palette onto Bootstrap's CSS variables and adds the console
 * shell plus the few composite widgets templates need (dot chart, KPI card,
 * command palette, auth split, landing hero). Everything else in the views is
 * plain Bootstrap 5 markup and utility classes.
 *
 * The look follows the dens-ui "Mars Green" dashboard block (MIT, © Denslab):
 * a framed shell, a light sidebar, Figtree for UI text, JetBrains Mono for
 * data, pill buttons, 22px cards, and orange kept for things that need you.
 */

/* ---- Self-hosted fonts (no CDN: the CSP only allows font-src 'self') ----
 * Both are variable fonts, so one file per subset covers every weight. */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../vendor/figtree/figtree-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: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../vendor/figtree/figtree-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";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../vendor/jetbrains-mono/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;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../vendor/jetbrains-mono/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;
}

/* ---- Palette (Mars Green default + Mars Red / Orange / Purple / Blue / Black) ---- */
:root,
[data-bs-theme="light"] {
  --gs-font-sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gs-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* dens-ui tokens (Mars Green) */
  --gs-page: #e3e8e6;          /* outside the app frame */
  --gs-rail: #092c2d;          /* the icon rail column */
  --gs-rail-accent: #38d6d6;   /* active rail marker & dark-mode rail rim */
  --gs-ink: #0f1716;           /* foreground; ink buttons and the brand tile */
  --gs-ink-fg: #ffffff;
  --gs-panel: #f5f7f6;         /* the framed main panel ("surface") */
  --gs-surface: #ffffff;       /* cards, inputs, popovers */
  --gs-surface-muted: #f5f7f6;
  --gs-input: #cfd8d5;
  --gs-accent: #e3efeb;
  --gs-brand: #008c8d;
  --gs-brand-fg: #ffffff;
  --gs-primary-fg: #ffffff;
  --gs-primary-hover: color-mix(in srgb, var(--bs-primary) 88%, #000);
  --gs-primary-active: color-mix(in srgb, var(--bs-primary) 80%, #000);
  --gs-highlight: #ff8a00;     /* orange: only for things that need attention */
  --gs-highlight-rgb: 255, 138, 0;
  --gs-highlight-fg: #1f1100;
  --gs-soft: #c0ebd7;
  --gs-soft-fg: #0a4a44;
  --gs-shadow-panel: 0 1px 2px rgb(15 23 22 / 0.04), 0 10px 28px -14px rgb(15 23 22 / 0.14);
  --gs-shadow-raised: 0 2px 6px rgb(15 23 22 / 0.06), 0 18px 40px -16px rgb(15 23 22 / 0.24);
  --gs-shadow-control: 0 1px 2px rgb(15 23 22 / 0.05);

  --gs-auth-glow-1: #d9ece6;
  --gs-auth-glow-2: #fbe9d4;
  --gs-auth-base: #edf0ef;
  --gs-hero-from: #0f1716;
  --gs-hero-via: #0d3b3a;
  --gs-hero-to: #00797a;
  --gs-hero-soft: #c0ebd7;
  --gs-hero-muted: #8cc8c3;
  --gs-hero-text: #d5e2df;
  --gs-toast-primary: #00797a;
  --gs-chart-total: #0f1716;
  --gs-chart-errors: #ff8a00;
  --gs-table-head-bg: transparent;
  --gs-row-hover: #f5f7f6;
  --gs-mark-from: #008c8d;
  --gs-mark-to: #00797a;

  --bs-body-font-family: var(--gs-font-sans);
  --bs-body-font-size: 0.875rem;
  --bs-body-line-height: 1.55;
  --bs-body-bg: #edf0ef;
  --bs-body-color: #0f1716;
  --bs-body-color-rgb: 15, 23, 22;
  --bs-emphasis-color: #0f1716;
  --bs-emphasis-color-rgb: 15, 23, 22;
  --bs-secondary-color: #566361;
  --bs-secondary-color-rgb: 86, 99, 97;
  --bs-secondary-bg: #f5f7f6;
  --bs-secondary-bg-rgb: 245, 247, 246;
  --bs-tertiary-bg: #e6ebe9;
  --bs-tertiary-bg-rgb: 230, 235, 233;
  --bs-border-color: #dbe2df;
  --bs-border-color-translucent: rgba(15, 23, 22, 0.08);
  --bs-heading-color: #0f1716;

  --bs-link-color: #00797a;
  --bs-link-color-rgb: 0, 121, 122;
  --bs-link-hover-color: #005f60;
  --bs-link-hover-color-rgb: 0, 95, 96;

  --bs-primary: #00797a;
  --bs-primary-rgb: 0, 121, 122;
  --bs-primary-text-emphasis: #0a4a44;
  --bs-primary-bg-subtle: #e3efeb;
  --bs-primary-border-subtle: #c0ebd7;
  --bs-secondary: #566361;
  --bs-secondary-rgb: 86, 99, 97;
  --bs-secondary-text-emphasis: #36403f;
  --bs-secondary-bg-subtle: #e6ebe9;
  --bs-secondary-border-subtle: #dbe2df;
  --bs-success: #009267;
  --bs-success-rgb: 0, 146, 103;
  --bs-success-text-emphasis: #0a4a44;
  --bs-success-bg-subtle: #dcf3e8;
  --bs-success-border-subtle: #c0ebd7;
  --bs-info: #2d54bc;
  --bs-info-rgb: 45, 84, 188;
  --bs-info-text-emphasis: #0b3289;
  --bs-info-bg-subtle: #e7edfa;
  --bs-info-border-subtle: #cbd7f3;
  --bs-warning: #e07800;
  --bs-warning-rgb: 224, 120, 0;
  --bs-warning-text-emphasis: #8a4600;
  --bs-warning-bg-subtle: #fff1e0;
  --bs-warning-border-subtle: #ffd9a8;
  --bs-danger: #a42423;
  --bs-danger-rgb: 164, 36, 35;
  --bs-danger-text-emphasis: #8c1d1c;
  --bs-danger-bg-subtle: #fbeaea;
  --bs-danger-border-subtle: #f2c8c7;
  --bs-light: #f5f7f6;
  --bs-light-rgb: 245, 247, 246;
  --bs-dark: #0f1716;
  --bs-dark-rgb: 15, 23, 22;

  --bs-border-radius: 0.875rem;
  --bs-border-radius-sm: 0.625rem;
  --bs-border-radius-lg: 1.375rem;
  --bs-border-radius-xl: 1.75rem;
  --bs-box-shadow-sm: var(--gs-shadow-control);
  --bs-box-shadow: var(--gs-shadow-raised);
  --bs-focus-ring-color: rgba(0, 140, 141, 0.3);
  color-scheme: light;
}

[data-bs-theme="dark"] {
  --gs-page: #050505;
  --gs-rail: #0d2324;
  --gs-rail-accent: #2ec4c6;
  --gs-ink: #ecf2f0;
  --gs-ink-fg: #0c0b0b;
  --gs-panel: #121514;
  --gs-surface: #161918;
  --gs-surface-muted: #121514;
  --gs-input: #303736;
  --gs-accent: #1f2b29;
  --gs-primary-fg: #031414;
  --gs-highlight: #ff9a1f;
  --gs-highlight-rgb: 255, 154, 31;
  --gs-soft: #123f3a;
  --gs-soft-fg: #c0ebd7;
  --gs-shadow-panel: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -16px rgb(0 0 0 / 0.7);
  --gs-shadow-raised: 0 2px 6px rgb(0 0 0 / 0.5), 0 20px 44px -16px rgb(0 0 0 / 0.8);
  --gs-shadow-control: 0 1px 2px rgb(0 0 0 / 0.3);
  --gs-auth-glow-1: #0f2a27;
  --gs-auth-glow-2: #2a1a08;
  --gs-auth-base: #0c0b0b;
  --gs-chart-total: #ecf2f0;
  --gs-chart-errors: #ff9a1f;
  --gs-row-hover: #1b1f1e;

  --bs-body-bg: #0c0b0b;
  --bs-body-color: #ecf2f0;
  --bs-body-color-rgb: 236, 242, 240;
  --bs-emphasis-color: #ffffff;
  --bs-emphasis-color-rgb: 255, 255, 255;
  --bs-secondary-color: #9aa8a5;
  --bs-secondary-color-rgb: 154, 168, 165;
  --bs-secondary-bg: #1b1f1e;
  --bs-secondary-bg-rgb: 27, 31, 30;
  --bs-tertiary-bg: #1e2322;
  --bs-tertiary-bg-rgb: 30, 35, 34;
  --bs-border-color: #262c2b;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.08);
  --bs-heading-color: #ecf2f0;

  --bs-link-color: #19a3a4;
  --bs-link-color-rgb: 25, 163, 164;
  --bs-link-hover-color: #4cc3c4;
  --bs-link-hover-color-rgb: 76, 195, 196;

  --bs-primary: #19a3a4;
  --bs-primary-rgb: 25, 163, 164;
  --bs-primary-text-emphasis: #c0ebd7;
  --bs-primary-bg-subtle: #1f2b29;
  --bs-primary-border-subtle: #123f3a;
  --bs-secondary: #9aa8a5;
  --bs-secondary-rgb: 154, 168, 165;
  --bs-secondary-text-emphasis: #c9d3d1;
  --bs-secondary-bg-subtle: #1e2322;
  --bs-secondary-border-subtle: #2c3332;
  --bs-success: #24ab7e;
  --bs-success-rgb: 36, 171, 126;
  --bs-success-text-emphasis: #c0ebd7;
  --bs-success-bg-subtle: #123f3a;
  --bs-success-border-subtle: #1a5249;
  --bs-info: #6f93ec;
  --bs-info-rgb: 111, 147, 236;
  --bs-info-text-emphasis: #bccdfa;
  --bs-info-bg-subtle: #141f40;
  --bs-info-border-subtle: #233463;
  --bs-warning: #ff9a1f;
  --bs-warning-rgb: 255, 154, 31;
  --bs-warning-text-emphasis: #ffc47d;
  --bs-warning-bg-subtle: #2b1d0b;
  --bs-warning-border-subtle: #4b3212;
  --bs-danger: #f74835;
  --bs-danger-rgb: 247, 72, 53;
  --bs-danger-text-emphasis: #ff9d91;
  --bs-danger-bg-subtle: #2c1311;
  --bs-danger-border-subtle: #4d211c;
  --bs-light: #1b1f1e;
  --bs-light-rgb: 27, 31, 30;
  --bs-dark: #ecf2f0;
  --bs-dark-rgb: 236, 242, 240;
  --bs-focus-ring-color: rgba(25, 163, 164, 0.35);
  color-scheme: dark;
}

/* ---- Palette: Mars Red ---- */
:root:not([data-bs-theme="dark"])[data-palette="mars-red"],
[data-bs-theme="light"][data-palette="mars-red"] {
  --gs-page: #eae2e3;
  --gs-rail: #471117;
  --gs-rail-accent: #ff7b84;
  --gs-ink: #1a1012;
  --gs-ink-fg: #ffffff;
  --gs-panel: #f8f5f5;
  --gs-surface: #ffffff;
  --gs-surface-muted: #f8f5f5;
  --gs-input: #dec8ca;
  --gs-accent: #f7e6e7;
  --gs-brand: #c92a35;
  --gs-brand-fg: #ffffff;
  --gs-primary-fg: #ffffff;
  --gs-soft: #f7cfd3;
  --gs-soft-fg: #6e1018;
  --gs-shadow-panel: 0 1px 2px rgb(26 16 18 / 0.04), 0 10px 28px -14px rgb(26 16 18 / 0.14);
  --gs-shadow-raised: 0 2px 6px rgb(26 16 18 / 0.06), 0 18px 40px -16px rgb(26 16 18 / 0.24);
  --gs-shadow-control: 0 1px 2px rgb(26 16 18 / 0.05);
  --gs-auth-glow-1: #f5d8da;
  --gs-auth-glow-2: #fbe8d8;
  --gs-auth-base: #f2ecec;
  --gs-hero-from: #1a1012;
  --gs-hero-via: #54141b;
  --gs-hero-to: #b91c28;
  --gs-hero-soft: #f7cfd3;
  --gs-hero-muted: #e6a8ae;
  --gs-hero-text: #f3e6e7;
  --gs-toast-primary: #b91c28;
  --gs-chart-total: #1a1012;
  --gs-row-hover: #f8f5f5;
  --gs-mark-from: #c92a35;
  --gs-mark-to: #b91c28;

  --bs-body-bg: #f2ecec;
  --bs-body-color: #1a1012;
  --bs-body-color-rgb: 26, 16, 18;
  --bs-emphasis-color: #1a1012;
  --bs-emphasis-color-rgb: 26, 16, 18;
  --bs-secondary-color: #6b5658;
  --bs-secondary-color-rgb: 107, 86, 88;
  --bs-secondary-bg: #f8f5f5;
  --bs-secondary-bg-rgb: 248, 245, 245;
  --bs-tertiary-bg: #ede5e6;
  --bs-tertiary-bg-rgb: 237, 229, 230;
  --bs-border-color: #e6d6d8;
  --bs-border-color-translucent: rgba(26, 16, 18, 0.08);
  --bs-heading-color: #1a1012;

  --bs-link-color: #b91c28;
  --bs-link-color-rgb: 185, 28, 40;
  --bs-link-hover-color: #8f141e;
  --bs-link-hover-color-rgb: 143, 20, 30;

  --bs-primary: #b91c28;
  --bs-primary-rgb: 185, 28, 40;
  --bs-primary-text-emphasis: #6e1018;
  --bs-primary-bg-subtle: #f7e6e7;
  --bs-primary-border-subtle: #f2bfc3;
  --bs-secondary: #6b5658;
  --bs-secondary-rgb: 107, 86, 88;
  --bs-secondary-text-emphasis: #453537;
  --bs-secondary-bg-subtle: #ede5e6;
  --bs-secondary-border-subtle: #e6d6d8;
  --bs-light: #f8f5f5;
  --bs-light-rgb: 248, 245, 245;
  --bs-dark: #1a1012;
  --bs-dark-rgb: 26, 16, 18;
  --bs-focus-ring-color: rgba(201, 42, 53, 0.3);
}

[data-bs-theme="dark"][data-palette="mars-red"] {
  --gs-page: #060405;
  --gs-rail: #2d0d11;
  --gs-rail-accent: #f26b74;
  --gs-ink: #f5ecec;
  --gs-ink-fg: #0d090a;
  --gs-panel: #151011;
  --gs-surface: #1a1415;
  --gs-surface-muted: #151011;
  --gs-input: #422e31;
  --gs-accent: #2e1b1d;
  --gs-brand: #e0414c;
  --gs-brand-fg: #ffffff;
  --gs-primary-fg: #ffffff;
  --gs-soft: #4d1b21;
  --gs-soft-fg: #f7cfd3;
  --gs-auth-glow-1: #361217;
  --gs-auth-glow-2: #2a1a08;
  --gs-auth-base: #0d090a;
  --gs-hero-from: #1a1012;
  --gs-hero-via: #54141b;
  --gs-hero-to: #b91c28;
  --gs-hero-soft: #f7cfd3;
  --gs-hero-muted: #e6a8ae;
  --gs-hero-text: #f3e6e7;
  --gs-toast-primary: #b91c28;
  --gs-chart-total: #f5ecec;
  --gs-row-hover: #211819;

  --bs-body-bg: #0d090a;
  --bs-body-color: #f5ecec;
  --bs-body-color-rgb: 245, 236, 236;
  --bs-secondary-color: #b0989a;
  --bs-secondary-color-rgb: 176, 152, 154;
  --bs-secondary-bg: #211819;
  --bs-secondary-bg-rgb: 33, 24, 25;
  --bs-tertiary-bg: #261b1d;
  --bs-tertiary-bg-rgb: 38, 27, 29;
  --bs-border-color: #332426;
  --bs-heading-color: #f5ecec;

  --bs-link-color: #f26b74;
  --bs-link-color-rgb: 242, 107, 116;
  --bs-link-hover-color: #ff949b;
  --bs-link-hover-color-rgb: 255, 148, 155;

  --bs-primary: #e0414c;
  --bs-primary-rgb: 224, 65, 76;
  --bs-primary-text-emphasis: #f7cfd3;
  --bs-primary-bg-subtle: #2e1b1d;
  --bs-primary-border-subtle: #572127;
  --bs-secondary: #b0989a;
  --bs-secondary-rgb: 176, 152, 154;
  --bs-secondary-text-emphasis: #d9c7c9;
  --bs-secondary-bg-subtle: #261b1d;
  --bs-secondary-border-subtle: #38272a;
  --bs-light: #211819;
  --bs-light-rgb: 33, 24, 25;
  --bs-dark: #f5ecec;
  --bs-dark-rgb: 245, 236, 236;
  --bs-focus-ring-color: rgba(224, 65, 76, 0.35);
}

/* ---- Palette: Mars Orange ---- */
:root:not([data-bs-theme="dark"])[data-palette="mars-orange"],
[data-bs-theme="light"][data-palette="mars-orange"] {
  --gs-page: #ece5df;
  --gs-rail: #4a2007;
  --gs-rail-accent: #ff9e44;
  --gs-ink: #1a130e;
  --gs-ink-fg: #ffffff;
  --gs-panel: #f9f6f3;
  --gs-surface: #ffffff;
  --gs-surface-muted: #f9f6f3;
  --gs-input: #e2cfc0;
  --gs-accent: #faede2;
  --gs-brand: #d96006;
  --gs-brand-fg: #ffffff;
  --gs-primary-fg: #ffffff;
  --gs-soft: #fde0c2;
  --gs-soft-fg: #702d00;
  --gs-shadow-panel: 0 1px 2px rgb(26 19 14 / 0.04), 0 10px 28px -14px rgb(26 19 14 / 0.14);
  --gs-shadow-raised: 0 2px 6px rgb(26 19 14 / 0.06), 0 18px 40px -16px rgb(26 19 14 / 0.24);
  --gs-shadow-control: 0 1px 2px rgb(26 19 14 / 0.05);
  --gs-auth-glow-1: #fae0c8;
  --gs-auth-glow-2: #f7e6cf;
  --gs-auth-base: #f3eee9;
  --gs-hero-from: #1a130e;
  --gs-hero-via: #5c2808;
  --gs-hero-to: #c45100;
  --gs-hero-soft: #fde0c2;
  --gs-hero-muted: #f0b884;
  --gs-hero-text: #f5ebe2;
  --gs-toast-primary: #c45100;
  --gs-chart-total: #1a130e;
  --gs-row-hover: #f9f6f3;
  --gs-mark-from: #d96006;
  --gs-mark-to: #c45100;

  --bs-body-bg: #f3eee9;
  --bs-body-color: #1a130e;
  --bs-body-color-rgb: 26, 19, 14;
  --bs-emphasis-color: #1a130e;
  --bs-emphasis-color-rgb: 26, 19, 14;
  --bs-secondary-color: #6e5c4f;
  --bs-secondary-color-rgb: 110, 92, 79;
  --bs-secondary-bg: #f9f6f3;
  --bs-secondary-bg-rgb: 249, 246, 243;
  --bs-tertiary-bg: #efe8e1;
  --bs-tertiary-bg-rgb: 239, 232, 225;
  --bs-border-color: #eadcd0;
  --bs-border-color-translucent: rgba(26, 19, 14, 0.08);
  --bs-heading-color: #1a130e;

  --bs-link-color: #c45100;
  --bs-link-color-rgb: 196, 81, 0;
  --bs-link-hover-color: #993f00;
  --bs-link-hover-color-rgb: 153, 63, 0;

  --bs-primary: #c45100;
  --bs-primary-rgb: 196, 81, 0;
  --bs-primary-text-emphasis: #702d00;
  --bs-primary-bg-subtle: #faede2;
  --bs-primary-border-subtle: #f5cea8;
  --bs-secondary: #6e5c4f;
  --bs-secondary-rgb: 110, 92, 79;
  --bs-secondary-text-emphasis: #473a31;
  --bs-secondary-bg-subtle: #efe8e1;
  --bs-secondary-border-subtle: #eadcd0;
  --bs-light: #f9f6f3;
  --bs-light-rgb: 249, 246, 243;
  --bs-dark: #1a130e;
  --bs-dark-rgb: 26, 19, 14;
  --bs-focus-ring-color: rgba(217, 96, 6, 0.3);
}

[data-bs-theme="dark"][data-palette="mars-orange"] {
  --gs-page: #060504;
  --gs-rail: #2e1506;
  --gs-rail-accent: #f7953b;
  --gs-ink: #f5efe9;
  --gs-ink-fg: #0d0a08;
  --gs-panel: #16120e;
  --gs-surface: #1b1612;
  --gs-surface-muted: #16120e;
  --gs-input: #423327;
  --gs-accent: #2e2014;
  --gs-brand: #f28524;
  --gs-brand-fg: #1c0c00;
  --gs-primary-fg: #1c0c00;
  --gs-soft: #4d2c10;
  --gs-soft-fg: #fde0c2;
  --gs-auth-glow-1: #361d0a;
  --gs-auth-glow-2: #24180d;
  --gs-auth-base: #0d0a08;
  --gs-hero-from: #1a130e;
  --gs-hero-via: #5c2808;
  --gs-hero-to: #c45100;
  --gs-hero-soft: #fde0c2;
  --gs-hero-muted: #f0b884;
  --gs-hero-text: #f5ebe2;
  --gs-toast-primary: #c45100;
  --gs-chart-total: #f5efe9;
  --gs-row-hover: #211a14;

  --bs-body-bg: #0d0a08;
  --bs-body-color: #f5efe9;
  --bs-body-color-rgb: 245, 239, 233;
  --bs-secondary-color: #b09e8f;
  --bs-secondary-color-rgb: 176, 158, 143;
  --bs-secondary-bg: #211a14;
  --bs-secondary-bg-rgb: 33, 26, 20;
  --bs-tertiary-bg: #261e17;
  --bs-tertiary-bg-rgb: 38, 30, 23;
  --bs-border-color: #33271e;
  --bs-heading-color: #f5efe9;

  --bs-link-color: #f7953b;
  --bs-link-color-rgb: 247, 149, 59;
  --bs-link-hover-color: #ffb46e;
  --bs-link-hover-color-rgb: 255, 180, 110;

  --bs-primary: #f28524;
  --bs-primary-rgb: 242, 133, 36;
  --bs-primary-text-emphasis: #fde0c2;
  --bs-primary-bg-subtle: #2e2014;
  --bs-primary-border-subtle: #593616;
  --bs-secondary: #b09e8f;
  --bs-secondary-rgb: 176, 158, 143;
  --bs-secondary-text-emphasis: #d9cbbd;
  --bs-secondary-bg-subtle: #261e17;
  --bs-secondary-border-subtle: #382c22;
  --bs-light: #211a14;
  --bs-light-rgb: 33, 26, 20;
  --bs-dark: #f5efe9;
  --bs-dark-rgb: 245, 239, 233;
  --bs-focus-ring-color: rgba(242, 133, 36, 0.35);
}

/* ---- Palette: Mars Purple ---- */
:root:not([data-bs-theme="dark"])[data-palette="mars-purple"],
[data-bs-theme="light"][data-palette="mars-purple"] {
  --gs-page: #e6e3ee;
  --gs-rail: #271352;
  --gs-rail-accent: #b794ff;
  --gs-ink: #14101c;
  --gs-ink-fg: #ffffff;
  --gs-panel: #f7f5fa;
  --gs-surface: #ffffff;
  --gs-surface-muted: #f7f5fa;
  --gs-input: #d5cbe6;
  --gs-accent: #efeafa;
  --gs-brand: #7444d6;
  --gs-brand-fg: #ffffff;
  --gs-primary-fg: #ffffff;
  --gs-soft: #e0d4fa;
  --gs-soft-fg: #3b1982;
  --gs-shadow-panel: 0 1px 2px rgb(20 16 28 / 0.04), 0 10px 28px -14px rgb(20 16 28 / 0.14);
  --gs-shadow-raised: 0 2px 6px rgb(20 16 28 / 0.06), 0 18px 40px -16px rgb(20 16 28 / 0.24);
  --gs-shadow-control: 0 1px 2px rgb(20 16 28 / 0.05);
  --gs-auth-glow-1: #e4d9fa;
  --gs-auth-glow-2: #fbe8d8;
  --gs-auth-base: #efedf5;
  --gs-hero-from: #14101c;
  --gs-hero-via: #351b6b;
  --gs-hero-to: #6638c7;
  --gs-hero-soft: #e0d4fa;
  --gs-hero-muted: #b9a1eb;
  --gs-hero-text: #ede8f7;
  --gs-toast-primary: #6638c7;
  --gs-chart-total: #14101c;
  --gs-row-hover: #f7f5fa;
  --gs-mark-from: #7444d6;
  --gs-mark-to: #6638c7;

  --bs-body-bg: #efedf5;
  --bs-body-color: #14101c;
  --bs-body-color-rgb: 20, 16, 28;
  --bs-emphasis-color: #14101c;
  --bs-emphasis-color-rgb: 20, 16, 28;
  --bs-secondary-color: #5f5770;
  --bs-secondary-color-rgb: 95, 87, 112;
  --bs-secondary-bg: #f7f5fa;
  --bs-secondary-bg-rgb: 247, 245, 250;
  --bs-tertiary-bg: #eae6f2;
  --bs-tertiary-bg-rgb: 234, 230, 242;
  --bs-border-color: #e1daed;
  --bs-border-color-translucent: rgba(20, 16, 28, 0.08);
  --bs-heading-color: #14101c;

  --bs-link-color: #6638c7;
  --bs-link-color-rgb: 102, 56, 199;
  --bs-link-hover-color: #4e26a3;
  --bs-link-hover-color-rgb: 78, 38, 163;

  --bs-primary: #6638c7;
  --bs-primary-rgb: 102, 56, 199;
  --bs-primary-text-emphasis: #3b1982;
  --bs-primary-bg-subtle: #efeafa;
  --bs-primary-border-subtle: #d5c4f7;
  --bs-secondary: #5f5770;
  --bs-secondary-rgb: 95, 87, 112;
  --bs-secondary-text-emphasis: #3c364a;
  --bs-secondary-bg-subtle: #eae6f2;
  --bs-secondary-border-subtle: #e1daed;
  --bs-light: #f7f5fa;
  --bs-light-rgb: 247, 245, 250;
  --bs-dark: #14101c;
  --bs-dark-rgb: 20, 16, 28;
  --bs-focus-ring-color: rgba(116, 68, 214, 0.3);
}

[data-bs-theme="dark"][data-palette="mars-purple"] {
  --gs-page: #050408;
  --gs-rail: #1d103b;
  --gs-rail-accent: #a986f7;
  --gs-ink: #f1eef7;
  --gs-ink-fg: #0b0910;
  --gs-panel: #13101a;
  --gs-surface: #181421;
  --gs-surface-muted: #13101a;
  --gs-input: #38304a;
  --gs-accent: #241d36;
  --gs-brand: #9b72f2;
  --gs-brand-fg: #110824;
  --gs-primary-fg: #110824;
  --gs-soft: #352459;
  --gs-soft-fg: #e0d4fa;
  --gs-auth-glow-1: #231442;
  --gs-auth-glow-2: #2a1a08;
  --gs-auth-base: #0b0910;
  --gs-hero-from: #14101c;
  --gs-hero-via: #351b6b;
  --gs-hero-to: #6638c7;
  --gs-hero-soft: #e0d4fa;
  --gs-hero-muted: #b9a1eb;
  --gs-hero-text: #ede8f7;
  --gs-toast-primary: #6638c7;
  --gs-chart-total: #f1eef7;
  --gs-row-hover: #1c1826;

  --bs-body-bg: #0b0910;
  --bs-body-color: #f1eef7;
  --bs-body-color-rgb: 241, 238, 247;
  --bs-secondary-color: #a399b8;
  --bs-secondary-color-rgb: 163, 153, 184;
  --bs-secondary-bg: #1c1826;
  --bs-secondary-bg-rgb: 28, 24, 38;
  --bs-tertiary-bg: #211c2e;
  --bs-tertiary-bg-rgb: 33, 28, 46;
  --bs-border-color: #2c253b;
  --bs-heading-color: #f1eef7;

  --bs-link-color: #a986f7;
  --bs-link-color-rgb: 169, 134, 247;
  --bs-link-hover-color: #c5adfa;
  --bs-link-hover-color-rgb: 197, 173, 250;

  --bs-primary: #9b72f2;
  --bs-primary-rgb: 155, 114, 242;
  --bs-primary-text-emphasis: #e0d4fa;
  --bs-primary-bg-subtle: #241d36;
  --bs-primary-border-subtle: #432f70;
  --bs-secondary: #a399b8;
  --bs-secondary-rgb: 163, 153, 184;
  --bs-secondary-text-emphasis: #cfc7e0;
  --bs-secondary-bg-subtle: #211c2e;
  --bs-secondary-border-subtle: #332c45;
  --bs-light: #1c1826;
  --bs-light-rgb: 28, 24, 38;
  --bs-dark: #f1eef7;
  --bs-dark-rgb: 241, 238, 247;
  --bs-focus-ring-color: rgba(155, 114, 242, 0.35);
}

/* ---- Palette: Mars Blue ---- */
:root:not([data-bs-theme="dark"])[data-palette="mars-blue"],
[data-bs-theme="light"][data-palette="mars-blue"] {
  --gs-page: #e1e6ee;
  --gs-rail: #0f295e;
  --gs-rail-accent: #6ea3ff;
  --gs-ink: #0e1420;
  --gs-ink-fg: #ffffff;
  --gs-panel: #f4f6fa;
  --gs-surface: #ffffff;
  --gs-surface-muted: #f4f6fa;
  --gs-input: #c8d4e6;
  --gs-accent: #e8effc;
  --gs-brand: #1d5fd6;
  --gs-brand-fg: #ffffff;
  --gs-primary-fg: #ffffff;
  --gs-soft: #d2e3fc;
  --gs-soft-fg: #0e3175;
  --gs-shadow-panel: 0 1px 2px rgb(14 20 32 / 0.04), 0 10px 28px -14px rgb(14 20 32 / 0.14);
  --gs-shadow-raised: 0 2px 6px rgb(14 20 32 / 0.06), 0 18px 40px -16px rgb(14 20 32 / 0.24);
  --gs-shadow-control: 0 1px 2px rgb(14 20 32 / 0.05);
  --gs-auth-glow-1: #d5e4fc;
  --gs-auth-glow-2: #fbe8d8;
  --gs-auth-base: #ebeff5;
  --gs-hero-from: #0e1420;
  --gs-hero-via: #122d63;
  --gs-hero-to: #1a56c4;
  --gs-hero-soft: #d2e3fc;
  --gs-hero-muted: #98b9f2;
  --gs-hero-text: #e6eefb;
  --gs-toast-primary: #1a56c4;
  --gs-chart-total: #0e1420;
  --gs-row-hover: #f4f6fa;
  --gs-mark-from: #1d5fd6;
  --gs-mark-to: #1a56c4;

  --bs-body-bg: #ebeff5;
  --bs-body-color: #0e1420;
  --bs-body-color-rgb: 14, 20, 32;
  --bs-emphasis-color: #0e1420;
  --bs-emphasis-color-rgb: 14, 20, 32;
  --bs-secondary-color: #525f75;
  --bs-secondary-color-rgb: 82, 95, 117;
  --bs-secondary-bg: #f4f6fa;
  --bs-secondary-bg-rgb: 244, 246, 250;
  --bs-tertiary-bg: #e5ebf5;
  --bs-tertiary-bg-rgb: 229, 235, 245;
  --bs-border-color: #d7e0ed;
  --bs-border-color-translucent: rgba(14, 20, 32, 0.08);
  --bs-heading-color: #0e1420;

  --bs-link-color: #1a56c4;
  --bs-link-color-rgb: 26, 86, 196;
  --bs-link-hover-color: #123f94;
  --bs-link-hover-color-rgb: 18, 63, 148;

  --bs-primary: #1a56c4;
  --bs-primary-rgb: 26, 86, 196;
  --bs-primary-text-emphasis: #0e3175;
  --bs-primary-bg-subtle: #e8effc;
  --bs-primary-border-subtle: #c2d6fa;
  --bs-secondary: #525f75;
  --bs-secondary-rgb: 82, 95, 117;
  --bs-secondary-text-emphasis: #333c4d;
  --bs-secondary-bg-subtle: #e5ebf5;
  --bs-secondary-border-subtle: #d7e0ed;
  --bs-light: #f4f6fa;
  --bs-light-rgb: 244, 246, 250;
  --bs-dark: #0e1420;
  --bs-dark-rgb: 14, 20, 32;
  --bs-focus-ring-color: rgba(29, 95, 214, 0.3);
}

[data-bs-theme="dark"][data-palette="mars-blue"] {
  --gs-page: #04060a;
  --gs-rail: #0e1e42;
  --gs-rail-accent: #6ea3ff;
  --gs-ink: #ecf1fa;
  --gs-ink-fg: #090c12;
  --gs-panel: #10141d;
  --gs-surface: #141924;
  --gs-surface-muted: #10141d;
  --gs-input: #2d384f;
  --gs-accent: #1a2640;
  --gs-brand: #4d8eff;
  --gs-brand-fg: #071226;
  --gs-primary-fg: #071226;
  --gs-soft: #18315e;
  --gs-soft-fg: #d2e3fc;
  --gs-auth-glow-1: #10244a;
  --gs-auth-glow-2: #2a1a08;
  --gs-auth-base: #090c12;
  --gs-hero-from: #0e1420;
  --gs-hero-via: #122d63;
  --gs-hero-to: #1a56c4;
  --gs-hero-soft: #d2e3fc;
  --gs-hero-muted: #98b9f2;
  --gs-hero-text: #e6eefb;
  --gs-toast-primary: #1a56c4;
  --gs-chart-total: #ecf1fa;
  --gs-row-hover: #1a2130;

  --bs-body-bg: #090c12;
  --bs-body-color: #ecf1fa;
  --bs-body-color-rgb: 236, 241, 250;
  --bs-secondary-color: #95a4bf;
  --bs-secondary-color-rgb: 149, 164, 191;
  --bs-secondary-bg: #161c28;
  --bs-secondary-bg-rgb: 22, 28, 40;
  --bs-tertiary-bg: #1b2230;
  --bs-tertiary-bg-rgb: 27, 34, 48;
  --bs-border-color: #232c3d;
  --bs-heading-color: #ecf1fa;

  --bs-link-color: #6ea3ff;
  --bs-link-color-rgb: 110, 163, 255;
  --bs-link-hover-color: #9ec0ff;
  --bs-link-hover-color-rgb: 158, 192, 255;

  --bs-primary: #4d8eff;
  --bs-primary-rgb: 77, 142, 255;
  --bs-primary-text-emphasis: #d2e3fc;
  --bs-primary-bg-subtle: #1a2640;
  --bs-primary-border-subtle: #244075;
  --bs-secondary: #95a4bf;
  --bs-secondary-rgb: 149, 164, 191;
  --bs-secondary-text-emphasis: #c8d3e6;
  --bs-secondary-bg-subtle: #1b2230;
  --bs-secondary-border-subtle: #2b364d;
  --bs-light: #161c28;
  --bs-light-rgb: 22, 28, 40;
  --bs-dark: #ecf1fa;
  --bs-dark-rgb: 236, 241, 250;
  --bs-focus-ring-color: rgba(77, 142, 255, 0.35);
}

/* ---- Palette: Mars Black ---- */
:root:not([data-bs-theme="dark"])[data-palette="mars-black"],
[data-bs-theme="light"][data-palette="mars-black"] {
  --gs-page: #e2e2e5;
  --gs-rail: #09090b;
  --gs-rail-accent: #ffffff;
  --gs-rail-brand-bg: #ffffff;
  --gs-rail-brand-fg: #09090b;
  --gs-ink: #09090b;
  --gs-ink-fg: #ffffff;
  --gs-panel: #f5f5f7;
  --gs-surface: #ffffff;
  --gs-surface-muted: #f5f5f7;
  --gs-input: #c6c6cc;
  --gs-accent: #eaeaee;
  --gs-brand: #18181b;
  --gs-brand-fg: #ffffff;
  --gs-primary-fg: #ffffff;
  --gs-primary-hover: #2c2c32;
  --gs-primary-active: #3a3a42;
  --gs-soft: #e0e0e5;
  --gs-soft-fg: #18181b;
  --gs-shadow-panel: 0 1px 2px rgb(9 9 11 / 0.04), 0 10px 28px -14px rgb(9 9 11 / 0.14);
  --gs-shadow-raised: 0 2px 6px rgb(9 9 11 / 0.06), 0 18px 40px -16px rgb(9 9 11 / 0.24);
  --gs-shadow-control: 0 1px 2px rgb(9 9 11 / 0.05);
  --gs-auth-glow-1: #dcdce2;
  --gs-auth-glow-2: #eaeaef;
  --gs-auth-base: #ececef;
  --gs-hero-from: #09090b;
  --gs-hero-via: #1c1c21;
  --gs-hero-to: #32323a;
  --gs-hero-soft: #e4e4e7;
  --gs-hero-muted: #a1a1aa;
  --gs-hero-text: #e4e4e7;
  --gs-toast-primary: #141416;
  --gs-chart-total: #09090b;
  --gs-row-hover: #f5f5f7;
  --gs-mark-from: #27272a;
  --gs-mark-to: #09090b;

  --bs-body-bg: #ececef;
  --bs-body-color: #111113;
  --bs-body-color-rgb: 17, 17, 19;
  --bs-emphasis-color: #09090b;
  --bs-emphasis-color-rgb: 9, 9, 11;
  --bs-secondary-color: #57575e;
  --bs-secondary-color-rgb: 87, 87, 94;
  --bs-secondary-bg: #f5f5f7;
  --bs-secondary-bg-rgb: 245, 245, 247;
  --bs-tertiary-bg: #e7e7eb;
  --bs-tertiary-bg-rgb: 231, 231, 235;
  --bs-border-color: #d6d6dc;
  --bs-border-color-translucent: rgba(9, 9, 11, 0.09);
  --bs-heading-color: #09090b;

  --bs-link-color: #18181b;
  --bs-link-color-rgb: 24, 24, 27;
  --bs-link-hover-color: #3f3f46;
  --bs-link-hover-color-rgb: 63, 63, 70;

  --bs-primary: #141416;
  --bs-primary-rgb: 20, 20, 22;
  --bs-primary-text-emphasis: #141416;
  --bs-primary-bg-subtle: #ebebee;
  --bs-primary-border-subtle: #ceced4;
  --bs-secondary: #57575e;
  --bs-secondary-rgb: 87, 87, 94;
  --bs-secondary-text-emphasis: #35353a;
  --bs-secondary-bg-subtle: #e7e7eb;
  --bs-secondary-border-subtle: #d6d6dc;
  --bs-light: #f5f5f7;
  --bs-light-rgb: 245, 245, 247;
  --bs-dark: #09090b;
  --bs-dark-rgb: 9, 9, 11;
  --bs-focus-ring-color: rgba(24, 24, 27, 0.28);
}

[data-bs-theme="dark"][data-palette="mars-black"] {
  --gs-page: #000000;
  --gs-rail: #141417;
  --gs-rail-accent: #f4f4f5;
  --gs-ink: #f4f4f5;
  --gs-ink-fg: #09090b;
  --gs-panel: #101012;
  --gs-surface: #151518;
  --gs-surface-muted: #101012;
  --gs-input: #36363d;
  --gs-accent: #222227;
  --gs-brand: #e4e4e7;
  --gs-brand-fg: #09090b;
  --gs-primary-fg: #09090b;
  --gs-primary-hover: #d8d8de;
  --gs-primary-active: #c8c8d0;
  --gs-soft: #27272c;
  --gs-soft-fg: #f4f4f5;
  --gs-auth-glow-1: #1f1f24;
  --gs-auth-glow-2: #16161a;
  --gs-auth-base: #080809;
  --gs-hero-from: #09090b;
  --gs-hero-via: #1c1c21;
  --gs-hero-to: #32323a;
  --gs-hero-soft: #e4e4e7;
  --gs-hero-muted: #a1a1aa;
  --gs-hero-text: #e4e4e7;
  --gs-toast-primary: #27272a;
  --gs-chart-total: #f4f4f5;
  --gs-row-hover: #1b1b1f;

  --bs-body-bg: #080809;
  --bs-body-color: #f4f4f5;
  --bs-body-color-rgb: 244, 244, 245;
  --bs-secondary-color: #a1a1aa;
  --bs-secondary-color-rgb: 161, 161, 170;
  --bs-secondary-bg: #18181b;
  --bs-secondary-bg-rgb: 24, 24, 27;
  --bs-tertiary-bg: #1e1e22;
  --bs-tertiary-bg-rgb: 30, 30, 34;
  --bs-border-color: #27272c;
  --bs-heading-color: #f4f4f5;

  --bs-link-color: #e4e4e7;
  --bs-link-color-rgb: 228, 228, 231;
  --bs-link-hover-color: #ffffff;
  --bs-link-hover-color-rgb: 255, 255, 255;

  --bs-primary: #f4f4f5;
  --bs-primary-rgb: 244, 244, 245;
  --bs-primary-text-emphasis: #f4f4f5;
  --bs-primary-bg-subtle: #222227;
  --bs-primary-border-subtle: #3d3d45;
  --bs-secondary: #a1a1aa;
  --bs-secondary-rgb: 161, 161, 170;
  --bs-secondary-text-emphasis: #d4d4d8;
  --bs-secondary-bg-subtle: #1e1e22;
  --bs-secondary-border-subtle: #323238;
  --bs-light: #18181b;
  --bs-light-rgb: 24, 24, 27;
  --bs-dark: #f4f4f5;
  --bs-dark-rgb: 244, 244, 245;
  --bs-focus-ring-color: rgba(244, 244, 245, 0.3);
}

/* ---- Sidebar palettes (theme dialog → Sidebar color) ----
 * "mint" is the dens-ui light sidebar and the default; it follows the color
 * mode. "ink", "teal", "graphite", "ruby" and "blue" are dark rails in both
 * modes. --gs-sidebar-bg may be a gradient; --gs-sidebar-solid is always a
 * plain color, because Bootstrap's .offcanvas-lg forces the background color
 * to transparent on desktop and only a solid color can override it. */
:root,
html[data-sidebar-theme="mint"] {
  --gs-sidebar-bg: var(--gs-panel);
  --gs-sidebar-solid: var(--gs-panel);
  --gs-sidebar-text: rgba(var(--bs-body-color-rgb), 0.75);
  --gs-sidebar-text-strong: var(--bs-body-color);
  --gs-sidebar-muted: var(--bs-secondary-color);
  --gs-sidebar-label: var(--bs-secondary-color);
  --gs-sidebar-border: var(--bs-border-color);
  --gs-sidebar-hover: rgba(255, 255, 255, 0.75);
  --gs-sidebar-active-bg: var(--gs-surface);
  --gs-sidebar-active-shadow: 0 1px 2px rgba(var(--bs-body-color-rgb), 0.06), 0 4px 12px -6px rgba(var(--bs-body-color-rgb), 0.16);
  --gs-sidebar-mark-bg: var(--gs-ink);
  --gs-sidebar-mark-fg: var(--gs-ink-fg);
  --gs-sidebar-card: var(--gs-surface);
  --gs-sidebar-scroll: rgba(var(--bs-body-color-rgb), 0.18);
  --gs-sidebar-art-line: rgba(var(--bs-body-color-rgb), 0.07);
  --gs-sidebar-art-line-strong: rgba(var(--bs-primary-rgb), 0.22);
  --gs-sidebar-art-dot: rgba(var(--bs-body-color-rgb), 0.08);
  --gs-sidebar-art-node: var(--bs-primary);
}
[data-bs-theme="dark"]:not([data-sidebar-theme]),
html[data-bs-theme="dark"][data-sidebar-theme="mint"] {
  --gs-sidebar-bg: var(--gs-panel);
  --gs-sidebar-solid: var(--gs-panel);
  --gs-sidebar-text: rgba(var(--bs-body-color-rgb), 0.72);
  --gs-sidebar-text-strong: var(--bs-body-color);
  --gs-sidebar-muted: var(--bs-secondary-color);
  --gs-sidebar-label: var(--bs-secondary-color);
  --gs-sidebar-border: var(--bs-border-color);
  --gs-sidebar-hover: rgba(var(--bs-secondary-bg-rgb), 0.85);
  --gs-sidebar-active-bg: var(--bs-secondary-bg);
  --gs-sidebar-active-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 4px 12px -6px rgb(0 0 0 / 0.6);
  --gs-sidebar-mark-bg: var(--gs-ink);
  --gs-sidebar-mark-fg: var(--gs-ink-fg);
  --gs-sidebar-card: var(--bs-secondary-bg);
  --gs-sidebar-scroll: rgba(var(--bs-body-color-rgb), 0.18);
  --gs-sidebar-art-line: rgba(var(--bs-body-color-rgb), 0.06);
  --gs-sidebar-art-line-strong: rgba(var(--bs-primary-rgb), 0.24);
  --gs-sidebar-art-dot: rgba(var(--bs-body-color-rgb), 0.07);
  --gs-sidebar-art-node: var(--bs-primary);
}
html[data-sidebar-theme="ink"],
html[data-sidebar-theme="teal"],
html[data-sidebar-theme="graphite"],
html[data-sidebar-theme="ruby"],
html[data-sidebar-theme="blue"] {
  --gs-sidebar-bg: #0f1716;
  --gs-sidebar-solid: #0f1716;
  --gs-sidebar-text: rgba(236, 242, 240, 0.66);
  --gs-sidebar-text-strong: #ecf2f0;
  --gs-sidebar-muted: #93a19e;
  --gs-sidebar-label: #7c8a87;
  --gs-sidebar-border: rgba(236, 242, 240, 0.1);
  --gs-sidebar-hover: rgba(236, 242, 240, 0.08);
  --gs-sidebar-active-bg: rgba(236, 242, 240, 0.14);
  --gs-sidebar-active-shadow: none;
  --gs-sidebar-mark-bg: var(--gs-brand);
  --gs-sidebar-mark-fg: var(--gs-brand-fg);
  --gs-sidebar-card: rgba(236, 242, 240, 0.07);
  --gs-sidebar-scroll: rgba(236, 242, 240, 0.2);
  --gs-sidebar-art-line: rgba(236, 242, 240, 0.08);
  --gs-sidebar-art-line-strong: rgba(var(--bs-primary-rgb), 0.35);
  --gs-sidebar-art-dot: rgba(236, 242, 240, 0.09);
  --gs-sidebar-art-node: var(--bs-primary);
}
html[data-sidebar-theme="teal"] {
  --gs-sidebar-bg: linear-gradient(170deg, #00797a 0%, #005556 60%, #003b3c 100%);
  --gs-sidebar-solid: #005556;
  --gs-sidebar-text: rgba(255, 255, 255, 0.74);
  --gs-sidebar-muted: #a8d8d4;
  --gs-sidebar-label: #8cc8c3;
  --gs-sidebar-border: rgba(255, 255, 255, 0.14);
  --gs-sidebar-hover: rgba(255, 255, 255, 0.1);
  --gs-sidebar-active-bg: rgba(255, 255, 255, 0.18);
  --gs-sidebar-mark-bg: #ffffff;
  --gs-sidebar-mark-fg: #00797a;
  --gs-sidebar-card: rgba(255, 255, 255, 0.1);
  --gs-sidebar-art-line: rgba(255, 255, 255, 0.1);
  --gs-sidebar-art-line-strong: rgba(192, 235, 215, 0.3);
  --gs-sidebar-art-dot: rgba(255, 255, 255, 0.1);
  --gs-sidebar-art-node: #c0ebd7;
}
html[data-sidebar-theme="graphite"] {
  --gs-sidebar-bg: #22282a;
  --gs-sidebar-solid: #22282a;
  --gs-sidebar-mark-bg: #ecf2f0;
  --gs-sidebar-mark-fg: #0f1716;
}
html[data-sidebar-theme="ruby"] {
  --gs-sidebar-bg: linear-gradient(170deg, #7a1c1f 0%, #561316 60%, #380b0d 100%);
  --gs-sidebar-solid: #561316;
  --gs-sidebar-text: rgba(255, 255, 255, 0.74);
  --gs-sidebar-muted: #e3b1b1;
  --gs-sidebar-label: #d39a9a;
  --gs-sidebar-border: rgba(255, 255, 255, 0.14);
  --gs-sidebar-hover: rgba(255, 255, 255, 0.1);
  --gs-sidebar-active-bg: rgba(255, 255, 255, 0.18);
  --gs-sidebar-mark-bg: #ffffff;
  --gs-sidebar-mark-fg: #7a1c1f;
  --gs-sidebar-card: rgba(255, 255, 255, 0.1);
  --gs-sidebar-art-line: rgba(255, 255, 255, 0.1);
  --gs-sidebar-art-line-strong: rgba(255, 196, 196, 0.3);
  --gs-sidebar-art-dot: rgba(255, 255, 255, 0.1);
  --gs-sidebar-art-node: #ffb4b4;
}
html[data-sidebar-theme="blue"] {
  --gs-sidebar-bg: linear-gradient(170deg, #1f4fa3 0%, #173a7c 60%, #0f2554 100%);
  --gs-sidebar-solid: #173a7c;
  --gs-sidebar-text: rgba(255, 255, 255, 0.76);
  --gs-sidebar-muted: #b3c6ee;
  --gs-sidebar-label: #9ab3e6;
  --gs-sidebar-border: rgba(255, 255, 255, 0.14);
  --gs-sidebar-hover: rgba(255, 255, 255, 0.1);
  --gs-sidebar-active-bg: rgba(255, 255, 255, 0.18);
  --gs-sidebar-mark-bg: #ffffff;
  --gs-sidebar-mark-fg: #1f4fa3;
  --gs-sidebar-card: rgba(255, 255, 255, 0.1);
  --gs-sidebar-art-line: rgba(255, 255, 255, 0.1);
  --gs-sidebar-art-line-strong: rgba(191, 212, 255, 0.32);
  --gs-sidebar-art-dot: rgba(255, 255, 255, 0.1);
  --gs-sidebar-art-node: #bfd4ff;
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-family: var(--bs-body-font-family);
  font-size: var(--bs-body-font-size);
  line-height: var(--bs-body-line-height);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4, h5 {
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--bs-heading-color);
}
h1, h2 { font-size: 1.375rem; letter-spacing: -0.025em; }
h3 { font-size: 0.9375rem; letter-spacing: -0.01em; }
h4 { font-size: 0.9375rem; }
h5 { font-size: 0.875rem; }
p { margin-bottom: 0; }
/* Links never get an underline, including on hover and focus. */
a,
a:hover,
a:focus,
a:active { text-decoration: none; }
code, kbd, pre, samp { font-family: var(--gs-font-mono); }
code { font-size: 0.75rem; background: var(--bs-tertiary-bg); padding: 1px 6px; border-radius: 6px; color: var(--bs-secondary-color); }
kbd {
  display: inline-flex;
  align-items: center;
  height: 1.25rem;
  padding: 0 0.375rem;
  border: 1px solid var(--bs-border-color);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--gs-surface);
  color: var(--bs-secondary-color);
  font-size: 0.6875rem;
  font-weight: 500;
  box-shadow: none;
}
pre { margin: 0; padding: 0.75rem 0.875rem; background: #0f1716; color: #d5e2df; border-radius: 12px; font-size: 0.75rem; overflow-x: auto; }
[hidden] { display: none !important; }
.font-monospace { font-family: var(--gs-font-mono) !important; }
.tabular-nums { font-variant-numeric: tabular-nums; }

/* Bootstrap 5.3 has no min-width utility; flex children that truncate need it. */
.min-w-0 { min-width: 0; }

/* Templates draw icons inline; one rule keeps their stroke weight uniform. */
svg[viewBox] {
  width: 1.0625rem;
  height: 1.0625rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.swal2-icon svg { width: auto; height: auto; }

/* ---- Bootstrap component tuning ---- */
/* Buttons are pills, as in dens-ui. */
.btn {
  --bs-btn-font-size: 0.8125rem;
  --bs-btn-font-weight: 600;
  --bs-btn-padding-y: 0.5rem;
  --bs-btn-padding-x: 1.1rem;
  --bs-btn-border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm {
  --bs-btn-font-size: 0.78rem;
  --bs-btn-padding-y: 0.32rem;
  --bs-btn-padding-x: 0.85rem;
  --bs-btn-border-radius: 999px;
}
.btn-lg {
  --bs-btn-font-size: 0.9375rem;
  --bs-btn-padding-y: 0.7rem;
  --bs-btn-padding-x: 1.6rem;
  --bs-btn-border-radius: 999px;
}
.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--gs-primary-hover);
  --bs-btn-hover-border-color: var(--gs-primary-hover);
  --bs-btn-active-bg: var(--gs-primary-active);
  --bs-btn-active-border-color: var(--gs-primary-active);
  --bs-btn-disabled-bg: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
  --bs-btn-color: var(--gs-primary-fg);
  --bs-btn-hover-color: var(--gs-primary-fg);
  --bs-btn-active-color: var(--gs-primary-fg);
  --bs-btn-disabled-color: var(--gs-primary-fg);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18), 0 1px 2px rgb(0 0 0 / 0.12);
}
.btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-bg: var(--gs-surface);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-color: var(--gs-primary-fg);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
  --bs-btn-active-color: var(--gs-primary-fg);
  --bs-btn-active-bg: var(--gs-primary-active);
  --bs-btn-active-border-color: var(--gs-primary-active);
  --bs-btn-disabled-color: var(--bs-primary);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--bs-primary);
  box-shadow: var(--gs-shadow-control);
}
.nav-pills {
  --bs-nav-pills-link-active-bg: var(--bs-primary);
  --bs-nav-pills-link-active-color: var(--gs-primary-fg);
}
/* Ink: the dark pill dens-ui uses for the main action of a page. */
.gs-btn-ink {
  --bs-btn-bg: var(--gs-ink);
  --bs-btn-border-color: var(--gs-ink);
  --bs-btn-color: var(--gs-ink-fg);
  --bs-btn-hover-bg: color-mix(in srgb, var(--gs-ink) 85%, transparent);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-hover-color: var(--gs-ink-fg);
  --bs-btn-active-bg: var(--gs-ink);
  --bs-btn-active-color: var(--gs-ink-fg);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12), 0 1px 2px rgb(0 0 0 / 0.16);
}
.btn-outline-secondary,
.btn-light {
  --bs-btn-color: var(--bs-body-color);
  --bs-btn-bg: var(--gs-surface);
  --bs-btn-border-color: var(--gs-input);
  --bs-btn-hover-bg: var(--gs-accent);
  --bs-btn-hover-color: var(--bs-body-color);
  --bs-btn-hover-border-color: var(--gs-input);
  --bs-btn-active-bg: var(--gs-accent);
  --bs-btn-active-color: var(--bs-body-color);
  --bs-btn-active-border-color: var(--gs-input);
  box-shadow: var(--gs-shadow-control);
}
.btn-outline-danger {
  --bs-btn-color: var(--bs-danger);
  --bs-btn-bg: var(--gs-surface);
  --bs-btn-border-color: var(--bs-danger-border-subtle);
  --bs-btn-hover-bg: var(--bs-danger-bg-subtle);
  --bs-btn-hover-color: var(--bs-danger-text-emphasis);
  --bs-btn-hover-border-color: var(--bs-danger-border-subtle);
  --bs-btn-active-bg: var(--bs-danger-bg-subtle);
  --bs-btn-active-color: var(--bs-danger-text-emphasis);
  --bs-btn-active-border-color: var(--bs-danger-border-subtle);
}
.btn-link {
  --bs-btn-color: var(--bs-link-color);
  --bs-btn-hover-color: var(--bs-link-hover-color);
  --bs-btn-font-weight: 600;
  text-decoration: none;
}
.btn-link:hover,
.btn-link:focus,
.btn-link:active { text-decoration: none; }
.btn svg { width: 0.9375rem; height: 0.9375rem; }

.form-control, .form-select {
  font-size: 0.875rem;
  background-color: var(--gs-surface);
  border-color: var(--gs-input);
  border-radius: 0.75rem;
  box-shadow: var(--gs-shadow-control);
}
.form-control { padding: 0.5rem 0.85rem; }
.form-control-sm, .form-select-sm { border-radius: 0.625rem; }
.form-control:disabled, .form-select:disabled { background-color: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }
.input-group > .form-control, .input-group > .form-select, .input-group > .btn { box-shadow: none; }

/* Focus feedback is only the thin border in the theme colour: no glow, no
   ring, and the field keeps its own surface (Bootstrap repaints it). */
.form-control:focus,
.form-control:focus-visible,
.form-select:focus,
.form-select:focus-visible,
.form-check-input:focus,
.form-check-input:focus-visible,
.form-range:focus,
.input-group:focus-within > .form-control,
.input-group:focus-within > .form-select {
  border-color: var(--gs-brand);
  outline: 0;
  box-shadow: none;
}
.form-control:focus,
.form-control:focus-visible,
.form-select:focus,
.form-select:focus-visible { background-color: var(--gs-surface); }
.form-range::-webkit-slider-thumb { background-color: var(--bs-primary); }
.form-range::-moz-range-thumb { background-color: var(--bs-primary); }
.form-range:focus::-webkit-slider-thumb { box-shadow: none; }
.form-range:focus::-moz-range-thumb { box-shadow: none; }

/* Checkboxes follow the palette: 17px, soft corners, the theme primary when
   checked, and the same thin-border focus as the text fields. */
.form-check-input {
  --bs-form-check-bg: var(--gs-surface);
  width: 1.0625rem;
  height: 1.0625rem;
  margin-top: 0.1rem;
  border: 1.5px solid var(--gs-input);
}
.form-check-input[type="checkbox"] { border-radius: 0.3125rem; }
.form-check-input:hover { border-color: var(--bs-primary); }
.form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.form-check-input[type="checkbox"]:indeterminate {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.form-switch .form-check-input:focus:not(:checked) {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28128, 128, 128, 0.55%29'/%3e%3c/svg%3e");
}
[data-bs-theme="dark"][data-palette="mars-black"] .form-check-input:checked[type="checkbox"] {
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2309090b' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}
[data-bs-theme="dark"][data-palette="mars-black"] .form-check-input:checked[type="radio"] {
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%2309090b'/%3e%3c/svg%3e");
}
[data-bs-theme="dark"][data-palette="mars-black"] .form-switch .form-check-input:checked {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2309090b'/%3e%3c/svg%3e");
}

/* Settings boolean rows: the row itself is the card, so the box lines up with
   the title and the whole surface reads as one control. */
.gs-check-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--bs-border-color) 70%, transparent);
  border-radius: 1rem;
  background: var(--gs-panel);
}
.gs-check-card .form-check-input { flex: none; margin: 0.15rem 0 0; }
.gs-check-card .form-check-label { flex: 1; min-width: 0; cursor: pointer; }
.gs-check-card:hover { border-color: rgba(var(--bs-primary-rgb), 0.45); }
/* The Show/hide toggle and other buttons inside a field share that ring. */
.btn:focus-visible,
.btn-check:focus-visible + .btn {
  --bs-btn-focus-box-shadow: 0 0 0 2px var(--gs-surface), 0 0 0 4px rgba(var(--bs-primary-rgb), 0.55);
  box-shadow: var(--bs-btn-focus-box-shadow);
}
.form-label { font-size: 0.8125rem; font-weight: 600; color: var(--bs-body-color); margin-bottom: 0.35rem; }
.form-text { font-size: 0.75rem; }
.form-check-label { font-size: 0.8125rem; }

.badge {
  --bs-badge-font-size: 0.72rem;
  --bs-badge-font-weight: 600;
  --bs-badge-padding-y: 0.22em;
  --bs-badge-padding-x: 0.75em;
  --bs-badge-border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
/* Badge palette: Bootstrap's text-bg-* utilities are solid, these keep the
   dens-ui look (soft green, outline, orange highlight) for roles, HTTP
   methods, and status codes. */
.badge.text-bg-primary { color: var(--bs-primary-text-emphasis) !important; background-color: var(--bs-primary-bg-subtle) !important; border: 1px solid var(--bs-primary-border-subtle); }
.badge.text-bg-secondary { color: var(--bs-body-color) !important; background-color: var(--gs-surface) !important; border: 1px solid var(--bs-border-color); }
.badge.text-bg-success { color: var(--gs-soft-fg) !important; background-color: var(--gs-soft) !important; border: 1px solid transparent; }
.badge.text-bg-info { color: var(--bs-info-text-emphasis) !important; background-color: var(--bs-info-bg-subtle) !important; border: 1px solid var(--bs-info-border-subtle); }
.badge.text-bg-warning { color: var(--bs-warning-text-emphasis) !important; background-color: var(--bs-warning-bg-subtle) !important; border: 1px solid var(--bs-warning-border-subtle); }
.badge.text-bg-danger { color: var(--bs-danger-text-emphasis) !important; background-color: var(--bs-danger-bg-subtle) !important; border: 1px solid var(--bs-danger-border-subtle); }
.badge.text-bg-dark { color: var(--gs-ink-fg) !important; background-color: var(--gs-ink) !important; }
/* "violet" is the historical name of the accent badge (versions, defaults,
   primary keys); in the Mars Green palette it is the ink pill. */
.badge.gs-badge-violet { color: var(--gs-ink-fg); background-color: var(--gs-ink); border: 1px solid transparent; font-family: var(--gs-font-mono); font-weight: 500; }
.badge.gs-badge-highlight { color: var(--gs-highlight-fg); background-color: var(--gs-highlight); }
.badge.gs-badge-soft { color: var(--gs-soft-fg); background-color: var(--gs-soft); }
.badge.gs-badge-outline { color: var(--bs-body-color); background-color: var(--gs-surface); border: 1px solid var(--bs-border-color); }

/* Status dot, used inside badges or next to text (dens-ui StatusDot). */
.gs-status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--gs-brand); }
.gs-status-dot--highlight { background: var(--gs-highlight); }
.gs-status-dot--danger { background: var(--bs-danger); }
.gs-status-dot--muted { background: color-mix(in srgb, var(--bs-secondary-color) 60%, transparent); }

/* Cards: 22px panels with a hairline ring and the panel shadow. */
.card {
  --bs-card-bg: var(--gs-surface);
  --bs-card-border-color: color-mix(in srgb, var(--bs-border-color) 60%, transparent);
  --bs-card-border-radius: var(--bs-border-radius-lg);
  --bs-card-inner-border-radius: calc(var(--bs-border-radius-lg) - 1px);
  --bs-card-spacer-y: 1.25rem;
  --bs-card-spacer-x: 1.25rem;
  --bs-card-cap-bg: transparent;
  --bs-card-cap-padding-y: 1.15rem;
  --bs-card-cap-padding-x: 1.25rem;
  box-shadow: var(--gs-shadow-panel);
}
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
  border-bottom: 0;
  padding-bottom: 0.35rem;
}
.card-header > * { min-width: 0; }
.card-title { margin-bottom: 0; font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.card-subtitle, .gs-card-sub { color: var(--bs-secondary-color); font-size: 0.8125rem; }
.card-footer { background: transparent; border-top-color: color-mix(in srgb, var(--bs-border-color) 70%, transparent); }
/* An inset well inside a card (dens-ui "inset" card). */
.gs-well {
  padding: 1rem;
  border-radius: 1rem;
  background: var(--gs-panel);
  border: 1px solid color-mix(in srgb, var(--bs-border-color) 70%, transparent);
}

/* Flush table cards read better without the body padding. */
.card > .table-responsive:last-child > .table:last-child { margin-bottom: 0; }

/* Bootstrap paints cells through `.table > :not(caption) > * > *` (specificity
   0,2,0); the doubled class below wins without !important. Headers are the
   dens-ui mono caps; rows are separated by a soft hairline. */
.table.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: var(--gs-row-hover);
  --bs-table-border-color: color-mix(in srgb, var(--bs-border-color) 70%, transparent);
  margin-bottom: 0;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}
.table.table > thead { --bs-table-bg: var(--gs-table-head-bg); }
.table.table > thead > tr > th {
  font-family: var(--gs-font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  padding: 0.6rem 1.25rem;
  border-bottom-color: var(--bs-border-color);
}
.table.table > tbody > tr > td { padding: 0.8rem 1.25rem; vertical-align: middle; }
.table.table > tbody > tr:last-child > td { border-bottom: 0; }
.table.table-sm > :not(caption) > * > * { padding: 0.5rem 1.25rem; font-size: 0.78rem; }
.table-responsive { border-radius: inherit; }
/* A table whose only row is the empty-state placeholder drops its minimum
   width so the message stays centred inside the card instead of scrolling. */
.table-responsive:has(> .table > tbody > tr > td[colspan] > .gs-empty) > .table { min-width: 0; }

.alert { --bs-alert-padding-y: 0.75rem; --bs-alert-padding-x: 0.9rem; --bs-alert-font-size: 0.8125rem; --bs-alert-border-radius: 1rem; display: flex; align-items: flex-start; gap: 0.6rem; }
.alert > p { flex: 1; }
/* Flash payloads use the short names success/error/info/warning. */
.alert--success { --bs-alert-color: var(--bs-success-text-emphasis); --bs-alert-bg: var(--bs-success-bg-subtle); --bs-alert-border-color: var(--bs-success-border-subtle); }
.alert--error, .alert--danger { --bs-alert-color: var(--bs-danger-text-emphasis); --bs-alert-bg: var(--bs-danger-bg-subtle); --bs-alert-border-color: var(--bs-danger-border-subtle); }
.alert--warning { --bs-alert-color: var(--bs-warning-text-emphasis); --bs-alert-bg: var(--bs-warning-bg-subtle); --bs-alert-border-color: var(--bs-warning-border-subtle); }
.alert--info { --bs-alert-color: var(--bs-info-text-emphasis); --bs-alert-bg: var(--bs-info-bg-subtle); --bs-alert-border-color: var(--bs-info-border-subtle); }

.dropdown-menu {
  --bs-dropdown-bg: var(--gs-surface);
  --bs-dropdown-font-size: 0.8125rem;
  --bs-dropdown-border-color: color-mix(in srgb, var(--bs-border-color) 70%, transparent);
  --bs-dropdown-border-radius: 1rem;
  --bs-dropdown-link-hover-bg: var(--gs-accent);
  --bs-dropdown-link-active-bg: var(--bs-primary);
  box-shadow: var(--gs-shadow-raised);
  padding: 0.35rem;
}
.dropdown-item { border-radius: 0.625rem; }
.modal { --bs-modal-bg: var(--gs-surface); --bs-modal-border-radius: var(--bs-border-radius-xl); --bs-modal-border-color: var(--bs-border-color); }
.progress { --bs-progress-bg: var(--bs-tertiary-bg); --bs-progress-bar-bg: var(--gs-ink); --bs-progress-border-radius: 999px; }

/* Pagination: separate pill buttons with no shared borders, a muted label,
   and the ink pill for the current page. */
.pagination {
  --bs-pagination-font-size: 0.78rem;
  --bs-pagination-padding-x: 0.5rem;
  --bs-pagination-padding-y: 0.25rem;
  --bs-pagination-border-width: 1px;
  --bs-pagination-border-color: transparent;
  --bs-pagination-border-radius: 999px;
  --bs-pagination-color: var(--bs-secondary-color);
  --bs-pagination-bg: transparent;
  --bs-pagination-hover-color: var(--bs-body-color);
  --bs-pagination-hover-bg: var(--gs-accent);
  --bs-pagination-hover-border-color: transparent;
  --bs-pagination-focus-color: var(--bs-body-color);
  --bs-pagination-focus-bg: var(--gs-accent);
  --bs-pagination-focus-box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.4);
  --bs-pagination-active-color: var(--gs-ink-fg);
  --bs-pagination-active-bg: var(--gs-ink);
  --bs-pagination-active-border-color: var(--gs-ink);
  --bs-pagination-disabled-color: var(--bs-secondary-color);
  --bs-pagination-disabled-bg: transparent;
  --bs-pagination-disabled-border-color: transparent;
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0;
}
.pagination .page-item:not(:first-child) .page-link { margin-left: 0; }
.pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.6rem;
  border-radius: 999px;
  font-family: var(--gs-font-mono);
  font-weight: 500;
}
.pagination .page-item.active .page-link { font-weight: 600; }
.pagination .page-item.disabled .page-link { opacity: 0.5; }
.nav-link { --bs-nav-link-font-size: 0.85rem; }

/* ---- Console shell: a framed app, as in the dens-ui dashboard block ---- */
.gs-app { min-height: 100vh; padding: 0.75rem; }
.gs-rail-col { display: none; }

/* Icon rail (xl and up): brand tile, one icon per area, a 24h meter and the
   preferences button. Follows the active theme color unless overridden in Settings. */
.gs-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem;
  border-radius: 1.375rem;
  background: var(--gs-rail);
  color: #ffffff;
  box-shadow: var(--gs-shadow-raised);
}
[data-bs-theme="dark"] .gs-rail,
[data-bs-theme="dark"] .gs-rail-prefs {
  border: 1px solid color-mix(in srgb, var(--gs-rail-accent) 22%, transparent);
}
.gs-rail-brand {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 0.25rem;
  border-radius: 0.875rem;
  background: var(--gs-rail-brand, var(--gs-rail-brand-bg, var(--gs-brand)));
  color: var(--gs-rail-brand-fg, var(--gs-brand-fg, #ffffff));
  font-size: 0.8125rem;
  font-weight: 700;
  order: -1;
}
.gs-rail-brand:hover { color: var(--gs-rail-brand-fg, var(--gs-brand-fg, #ffffff)); filter: brightness(1.08); }
.gs-rail-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 0.875rem;
  color: var(--gs-rail-icon, rgba(255, 255, 255, 0.65));
  transition: background-color 0.15s ease, color 0.15s ease;
}
.gs-rail-item:hover { background: color-mix(in srgb, var(--gs-rail-icon-active, #ffffff) 12%, transparent); color: var(--gs-rail-icon-active, #ffffff); }
.gs-rail-item:focus-visible, .gs-rail-brand:focus-visible, .gs-rail-prefs:focus-visible, .gs-meter-rail:focus-visible { outline: 2px solid var(--gs-brand); outline-offset: 2px; }
.gs-rail-item svg { width: 18px; height: 18px; }
.gs-rail-item.is-active { background: var(--gs-rail-active-bg, rgba(255, 255, 255, 0.18)); color: var(--gs-rail-icon-active, #ffffff); }
.gs-rail-item.is-active::before {
  content: "";
  position: absolute;
  left: -0.5rem;
  top: 50%;
  width: 4px;
  height: 1rem;
  border-radius: 999px;
  background: var(--gs-rail-marker, var(--gs-rail-accent));
  transform: translateY(-50%);
}
.gs-rail-dot {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gs-rail-marker, var(--gs-highlight));
  box-shadow: 0 0 0 2px var(--gs-rail);
}
.gs-meter-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  border-radius: 1.375rem;
  background: var(--gs-sidebar-bg);
  border: 1px solid var(--gs-sidebar-border);
  color: var(--gs-sidebar-text-strong);
  transition: border-color 0.15s ease;
}
.gs-meter-rail:hover { color: var(--gs-sidebar-text-strong); border-color: var(--bs-primary); }
.gs-meter-rail-label { font-family: var(--gs-font-mono); font-size: 0.6875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gs-sidebar-muted); }
.gs-meter-rail-total { font-family: var(--gs-font-mono); font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.gs-meter-rail-ticks { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; }
.gs-meter-rail-ticks > span { height: 2px; border-radius: 999px; background: color-mix(in srgb, var(--bs-primary) 55%, var(--gs-sidebar-text-strong)); }
.gs-meter-rail-ticks > span.is-zero { background: var(--gs-sidebar-border); }
.gs-meter-rail-ticks > span.is-current { background: var(--bs-primary); }
.gs-rail-prefs {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-top: auto;
  padding: 0;
  border: 0;
  border-radius: 1.375rem;
  background: var(--gs-rail);
  color: var(--gs-rail-icon, rgba(255, 255, 255, 0.75));
  box-shadow: var(--gs-shadow-raised);
  cursor: pointer;
  transition: color 0.15s ease;
}
.gs-rail-prefs:hover { color: var(--gs-rail-icon-active, #ffffff); }
.gs-rail-prefs svg { width: 22px; height: 22px; }

/* The rail column never squeezes the icon rail or the preferences button:
   the button keeps its 56px square at the bottom, level with the end of the
   sidebar. The 24h meter absorbs short viewports instead, dropping its oldest
   ticks from the top (the current hour stays visible at the bottom). */
.gs-rail-col > .gs-rail,
.gs-rail-col > .gs-rail-prefs { flex: none; }
.gs-rail-col > .gs-meter-rail { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.gs-meter-rail-label, .gs-meter-rail-total { flex: none; }
.gs-meter-rail-ticks { flex: 0 1 auto; min-height: 0; overflow: hidden; justify-content: flex-end; }
.gs-meter-rail-ticks > span { flex: none; }
@media (max-height: 720px) {
  .gs-rail-col > .gs-meter-rail { display: none; }
}
@media (max-height: 600px) {
  .gs-rail-col > .gs-rail { flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; }
}
.gs-sidebar {
  --bs-offcanvas-width: 264px;
  --bs-offcanvas-bg: var(--gs-sidebar-bg);
  --bs-offcanvas-color: var(--gs-sidebar-text);
  --bs-nav-link-color: var(--gs-sidebar-text);
  --bs-nav-link-hover-color: var(--gs-sidebar-text-strong);
  --bs-nav-link-padding-y: 0;
  --bs-nav-link-padding-x: 0.75rem;
  /* `.offcanvas-lg` only supplies display:flex below lg, so the rail has to
     declare it itself or it falls back to block and the nav overflows. */
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem 0.625rem 0.625rem;
  background: var(--gs-sidebar-bg);
  color: var(--gs-sidebar-text);
  border: 1px solid var(--gs-sidebar-border);
  border-radius: 1.75rem;
  /* The rail is exactly one viewport tall; its nav scrolls instead. */
  overflow: hidden;
}
.gs-sidebar > :not(.gs-sidebar-art) { position: relative; z-index: 1; }

/* Optional decorative vector background behind the navigation. */
.gs-sidebar-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.gs-sidebar-art svg { display: block; width: 100%; height: 100%; stroke-width: 1.3; }

/* Only the groups belonging to the selected pattern are painted; "none" (the
   default) keeps the plain dens-ui sidebar. */
.gs-sidebar-art svg > [class^="gs-sidebar-art-"] { display: none; }
html[data-sidebar-pattern="mesh"] .gs-sidebar-art-dots,
html[data-sidebar-pattern="mesh"] .gs-sidebar-art-flow,
html[data-sidebar-pattern="mesh"] .gs-sidebar-art-nodes,
html[data-sidebar-pattern="mesh"] .gs-sidebar-art-signal,
html[data-sidebar-pattern="mesh"] .gs-sidebar-art-shield { display: block; }
html[data-sidebar-pattern="grid"] .gs-sidebar-art-grid,
html[data-sidebar-pattern="grid"] .gs-sidebar-art-rings { display: block; }
html[data-sidebar-pattern="waves"] .gs-sidebar-art-waves,
html[data-sidebar-pattern="waves"] .gs-sidebar-art-signal { display: block; }
html[data-sidebar-pattern="orbit"] .gs-sidebar-art-rings,
html[data-sidebar-pattern="orbit"] .gs-sidebar-art-nodes,
html[data-sidebar-pattern="orbit"] .gs-sidebar-art-shield { display: block; }

.gs-sidebar-art-dots { fill: url(#gsSidebarArtDots); stroke: none; }
.gs-sidebar-art-dot { fill: var(--gs-sidebar-art-dot); stroke: none; }
.gs-sidebar-art-grid { fill: url(#gsSidebarArtGrid); stroke: none; }
.gs-sidebar-art-grid-line { fill: none; stroke: var(--gs-sidebar-art-line); stroke-width: 1; }
.gs-sidebar-art-rings circle {
  fill: none;
  stroke: var(--gs-sidebar-art-line);
  stroke-dasharray: 3 9;
  animation: gsArtSpin 60s linear infinite;
  transform-box: view-box;
  transform-origin: 228px 112px;
}
.gs-sidebar-art-rings circle:nth-child(2) { animation-duration: 44s; animation-direction: reverse; }
.gs-sidebar-art-rings circle:nth-child(3) { animation-duration: 30s; }
.gs-sidebar-art-waves path {
  fill: none;
  stroke: var(--gs-sidebar-art-line-strong);
  stroke-dasharray: 3 11;
  animation: gsArtFlow 18s linear infinite;
}
.gs-sidebar-art-waves path:nth-child(2n) { animation-duration: 24s; animation-direction: reverse; }
.gs-sidebar-art-waves path:nth-child(3n) { animation-duration: 30s; }
.gs-sidebar-art-beam {
  fill: none;
  stroke: var(--gs-sidebar-art-line-strong);
  stroke-dasharray: 8 14;
  animation: gsArtFlow 9s linear infinite;
}
.gs-sidebar-art-beam--slow { animation-duration: 14s; animation-direction: reverse; }
.gs-sidebar-art-nodes circle {
  fill: var(--gs-sidebar-art-node);
  stroke: none;
  opacity: 0.5;
  animation: gsArtPulse 4.2s ease-in-out infinite;
}
.gs-sidebar-art-nodes circle:nth-child(2n) { animation-delay: 1.4s; }
.gs-sidebar-art-nodes circle:nth-child(3n) { animation-delay: 2.6s; }
.gs-sidebar-art-signal path { fill: none; stroke: var(--gs-sidebar-art-line-strong); }
.gs-sidebar-art-signal circle { fill: var(--gs-sidebar-art-node); stroke: none; animation: gsArtPulse 3.4s ease-in-out infinite; }
.gs-sidebar-art-shield path { fill: none; stroke: var(--gs-sidebar-art-line-strong); }
.gs-sidebar-art-shield path:first-child { stroke: var(--gs-sidebar-art-line); }

@keyframes gsArtFlow { to { stroke-dashoffset: -220; } }
@keyframes gsArtSpin { to { transform: rotate(360deg); } }
@keyframes gsArtPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .gs-sidebar-art * { animation: none !important; }
}
.gs-sidebar .offcanvas-header { padding: 0; }
/* Bootstrap's .offcanvas-lg sets background-color: transparent !important from
   992px up, which wiped every solid sidebar color (gradients survived because
   they live in background-image). Win it back with the solid token. */
html .gs-sidebar { background-color: var(--gs-sidebar-solid) !important; }
html:is([data-sidebar-theme="ink"], [data-sidebar-theme="teal"], [data-sidebar-theme="graphite"], [data-sidebar-theme="ruby"], [data-sidebar-theme="blue"]) .gs-sidebar .btn-close,
[data-bs-theme="dark"] .gs-sidebar .btn-close { filter: invert(1) grayscale(1); }

/* Brand: the 36px ink tile with the app initials, name over tagline. */
.gs-brand { display: flex; align-items: center; gap: 0.75rem; padding: 0.25rem 0.375rem 0; color: var(--gs-sidebar-text-strong); flex: none; }
.gs-brand:hover { text-decoration: none; color: var(--gs-sidebar-text-strong); }
.gs-brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 0.75rem;
  background: var(--gs-sidebar-mark-bg, var(--gs-ink));
  color: var(--gs-sidebar-mark-fg, var(--gs-ink-fg));
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  flex: none;
}
.gs-brand-mark--sm { width: 30px; height: 30px; font-size: 0.7rem; border-radius: 0.625rem; }
.gs-brand-mark--lg { width: 52px; height: 52px; border-radius: 1rem; font-size: 1.2rem; }
.gs-brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.gs-brand-text strong { font-size: 0.875rem; font-weight: 600; }
.gs-brand-text small { color: var(--gs-sidebar-muted); font-size: 0.75rem; }

/* min-height:0 lets the nav shrink to the space left in the rail so long menus
   scroll inside the sidebar. nowrap overrides Bootstrap's `.nav` wrap, which
   would otherwise lay the items out in extra columns. */
.gs-nav {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.125rem;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -0.25rem;
  padding: 0 0.25rem 0.25rem;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--gs-sidebar-scroll) transparent;
}
.gs-nav > * { flex: none; }
/* A soft fade at the bottom edge hints that a long menu scrolls. */
.gs-nav:not(.gs-nav--footer) { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.75rem), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 1.75rem), transparent); padding-bottom: 1.25rem; }
.gs-nav::-webkit-scrollbar { width: 6px; }
.gs-nav::-webkit-scrollbar-thumb { background: var(--gs-sidebar-scroll); border-radius: 999px; }
.gs-nav::-webkit-scrollbar-track { background: transparent; }
.gs-nav-label {
  margin: 1rem 0 0;
  padding: 0 0.75rem 0.375rem;
  font-family: var(--gs-font-mono);
  font-size: 0.65625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gs-sidebar-label);
}
.gs-nav-label:first-child { margin-top: 0.25rem; }
.gs-nav .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gs-sidebar-text);
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.gs-nav .nav-link > span:not(.gs-nav-count):not(.gs-nav-status) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 0.5rem; }
.gs-nav .nav-link > .gs-nav-count,
.gs-nav .nav-link > .gs-nav-status { flex: none; }
.gs-nav .nav-link:hover { background-color: var(--gs-sidebar-hover); color: var(--gs-sidebar-text-strong); }
.gs-nav .nav-link:focus-visible { outline: 2px solid var(--gs-brand); outline-offset: -2px; }
.gs-nav .nav-link.active {
  background: var(--gs-sidebar-active-bg);
  color: var(--gs-sidebar-text-strong);
  font-weight: 600;
  box-shadow: var(--gs-sidebar-active-shadow);
}
.gs-nav .nav-link svg { width: 18px; height: 18px; }
/* Sidebar counts: plain muted number, or the orange pill when it needs you. */
.gs-nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: auto;
  padding: 0 0.375rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--gs-sidebar-muted);
}
.gs-nav-count--highlight { background: var(--gs-highlight); color: var(--gs-highlight-fg); }

/* Collapsible menu groups (dens-ui SidebarFolder): icon, chevron, left guide line. */
.gs-nav-folder { display: flex; flex-direction: column; width: 100%; }
.gs-nav-folder-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--gs-sidebar-text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.gs-nav-folder-toggle:hover {
  background-color: var(--gs-sidebar-hover);
  color: var(--gs-sidebar-text-strong);
}
.gs-nav-folder-toggle:focus-visible { outline: 2px solid var(--gs-brand); outline-offset: -2px; }
.gs-nav-folder.is-open > .gs-nav-folder-toggle,
.gs-nav-folder.has-active > .gs-nav-folder-toggle { color: var(--gs-sidebar-text-strong); }
.gs-nav-folder.has-active:not(.is-open) > .gs-nav-folder-toggle {
  background: var(--gs-sidebar-active-bg);
  font-weight: 600;
  box-shadow: var(--gs-sidebar-active-shadow);
}
.gs-nav-folder-toggle > svg:first-child { width: 18px; height: 18px; flex: none; }
.gs-nav-folder-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gs-nav-folder-badge { display: inline-flex; align-items: center; flex: none; margin-left: auto; }
.gs-nav-folder-badge .gs-nav-count,
.gs-nav-folder-badge .gs-nav-status { margin-left: 0; }
.gs-nav-folder.is-open > .gs-nav-folder-toggle > .gs-nav-folder-badge { display: none; }
.gs-nav-folder-chevron {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--gs-sidebar-muted);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
}
.gs-nav-folder-toggle:hover > .gs-nav-folder-chevron,
.gs-nav-folder.is-open > .gs-nav-folder-toggle > .gs-nav-folder-chevron { color: var(--gs-sidebar-text-strong); }
.gs-nav-folder.is-open > .gs-nav-folder-toggle > .gs-nav-folder-chevron { transform: rotate(90deg); }
.gs-nav-folder-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.16s ease,
              visibility 0s linear 0.22s;
}
.gs-nav-folder.is-open > .gs-nav-folder-panel {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.18s ease,
              visibility 0s linear 0s;
}
.gs-nav--no-anim .gs-nav-folder-panel,
.gs-nav--no-anim .gs-nav-folder-chevron { transition: none !important; }
.gs-nav-folder-list { overflow: hidden; min-height: 0; }
.gs-nav-folder-items {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin-left: 21px;
  padding: 0.125rem 0 0.25rem 0.625rem;
}
.gs-nav-folder-items::before {
  content: "";
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0;
  width: 1px;
  background: var(--gs-sidebar-border);
}
.gs-nav .gs-nav-folder-items .nav-link {
  height: 2rem;
  padding: 0 0.625rem;
  border-radius: 0.625rem;
  font-size: 0.8125rem;
  gap: 0.5rem;
}
.gs-nav .gs-nav-folder-items .nav-link svg { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) {
  .gs-nav-folder-panel,
  .gs-nav-folder-chevron { transition: none !important; }
}

/* Footer: the signed-in user card, as in the dens-ui block. */
.gs-sidebar-footer { display: flex; flex-direction: column; gap: 0.5rem; flex: none; }
.gs-nav--footer { flex: none; overflow: visible; margin: 0; padding: 0; }
.gs-user-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem;
  border-radius: 1.125rem;
  background: var(--gs-sidebar-card);
  border: 1px solid var(--gs-sidebar-border);
  color: var(--gs-sidebar-text-strong);
}
.gs-user-card-link { display: flex; align-items: center; gap: 0.625rem; flex: 1; min-width: 0; color: inherit; }
.gs-user-card-link:hover { color: inherit; }
.gs-user-card-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.gs-user-card-meta strong { font-size: 0.8125rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-user-card-meta small { font-size: 0.75rem; color: var(--gs-sidebar-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-user-card .gs-icon-btn { width: 32px; height: 32px; border-color: transparent; background: transparent; box-shadow: none; color: var(--gs-sidebar-muted); }
.gs-user-card .gs-icon-btn:hover { background: var(--gs-sidebar-hover); color: var(--gs-sidebar-text-strong); }

/* Main panel: the rounded "surface" frame that holds header, page, footer. */
.gs-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(100vh - 1.5rem);
  padding: 0.5rem;
  border-radius: 2.125rem;
  background: var(--gs-panel);
  border: 1px solid color-mix(in srgb, var(--bs-border-color) 70%, transparent);
}
.gs-topbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 0.75rem 0.25rem;
}
.gs-topbar-title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 16rem; }
.gs-topbar-crumbs { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: var(--bs-secondary-color); }
.gs-topbar-crumbs a { color: inherit; }
.gs-topbar-crumbs a:hover { color: var(--bs-body-color); }
.gs-topbar-title h1 {
  margin: 0.4rem 0 0;
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gs-topbar-sub { margin-top: 0.4rem; font-size: 0.8125rem; color: var(--bs-secondary-color); }
.gs-topbar-sub:empty { display: none; }
.gs-topbar-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; flex-wrap: wrap-reverse; justify-content: flex-end; }
/* Page actions sit left of the global tools; when they do not fit, wrap-reverse
   keeps search, bell and globe together on the top line and drops the page
   actions to the line below. */
.gs-topbar-page-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.5rem; }
.gs-topbar-page-actions:empty { display: none; }
.gs-topbar-page-actions > .d-flex { justify-content: flex-end; }
.gs-topbar-tools { display: flex; align-items: center; gap: 0.5rem; }

.gs-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--gs-input);
  border-radius: 999px;
  background: var(--gs-surface);
  color: var(--bs-body-color);
  line-height: 1;
  box-shadow: var(--gs-shadow-control);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.gs-icon-btn:hover { background: var(--gs-accent); color: var(--bs-body-color); text-decoration: none; }
.gs-icon-btn:focus-visible { outline: 2px solid var(--gs-brand); outline-offset: 2px; }
.gs-icon-btn--ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--bs-secondary-color); }
.gs-icon-btn--ghost:hover { background: var(--gs-accent); }
.gs-icon-btn svg { width: 1.0625rem; height: 1.0625rem; }
.gs-theme-toggle .icon-sun { display: none; }
.gs-theme-toggle .icon-moon { display: block; }
[data-bs-theme="dark"] .gs-theme-toggle .icon-sun { display: block; }
[data-bs-theme="dark"] .gs-theme-toggle .icon-moon { display: none; }
.gs-theme-launcher-fill { fill: currentColor; stroke: none; }

.gs-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gs-soft);
  color: var(--gs-soft-fg);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: none;
  overflow: hidden;
}
img.gs-avatar { object-fit: cover; display: block; border: 1px solid var(--bs-border-color); }
.gs-avatar--sm { width: 28px; height: 28px; font-size: 0.65rem; }
.gs-avatar--xl { width: 64px; height: 64px; font-size: 1.25rem; }

.gs-content { flex: 1; display: flex; flex-direction: column; gap: 0.875rem; width: 100%; max-width: 1480px; margin: 0 auto; padding: 0.75rem; }
.gs-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem 0.375rem;
  font-family: var(--gs-font-mono);
  font-size: 0.6875rem;
  color: var(--bs-secondary-color);
}

@media (min-width: 992px) {
  /* The outer frame holds rail, sidebar and main panel, as in the block. */
  body:has(> .gs-app) { background: var(--gs-page); }
  .gs-app {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    gap: 0.75rem;
    min-height: calc(100vh - 1.5rem);
    margin: 0.75rem;
    border-radius: 2.5rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
  }
  .gs-sidebar { position: sticky; top: 1.5rem; height: calc(100vh - 3rem); max-height: calc(100vh - 3rem); }
  .gs-main { min-height: calc(100vh - 3rem); }
}
@media (min-width: 1200px) {
  .gs-app { grid-template-columns: 56px 252px minmax(0, 1fr); }
  .gs-app:has(.gs-rail-col--labels) { grid-template-columns: 76px 252px minmax(0, 1fr); }
  .gs-rail-col {
    position: sticky;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: calc(100vh - 3rem);
  }
}

/* ---- Page head ---- */
.gs-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.gs-page-head h2 { margin: 0; font-size: 1.25rem; }
.gs-page-head-sub { color: var(--bs-secondary-color); font-size: 0.8125rem; margin-top: 0.2rem; }
/* Filter bars that used to sit in the page head stay in the content, right-aligned. */
.gs-page-toolbar { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.gs-page-toolbar > * { min-width: 0; }

/* ---- Dashboard: KPI card, dot chart, attention strip, queue, tiles ---- */
.gs-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; font-family: var(--gs-font-mono); font-size: 0.6875rem; color: var(--bs-secondary-color); }
.gs-legend-item { display: inline-flex; align-items: center; gap: 0.375rem; }
.gs-legend-dot { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--gs-ink) 80%, transparent); }
.gs-legend-dot--errors { background: var(--gs-highlight); }
.gs-legend-dot--future { background: transparent; border: 1px solid var(--bs-secondary-color); }

.gs-kpi { display: grid; gap: 1.25rem; }
@media (min-width: 1200px) { .gs-kpi { grid-template-columns: 220px minmax(0, 1fr); } }
.gs-kpi-value {
  font-size: 4rem;
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.gs-kpi-caption { font-size: 0.8125rem; color: var(--bs-secondary-color); }
.gs-kpi-facts { margin: 0; border-top: 1px solid var(--bs-border-color); border-bottom: 1px solid var(--bs-border-color); }
.gs-kpi-facts > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; font-size: 0.8125rem; }
.gs-kpi-facts > div + div { border-top: 1px solid var(--bs-border-color); }
.gs-kpi-facts dt { font-weight: 400; color: var(--bs-secondary-color); }
.gs-kpi-facts dd { margin: 0; font-family: var(--gs-font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }

/* svg.gs-dotchart outranks the global svg[viewBox] icon sizing. */
svg.gs-dotchart { display: block; width: 100%; height: auto; overflow: visible; stroke: none; }
.gs-dotchart .gs-dot-ok { fill: color-mix(in srgb, var(--gs-ink) 80%, transparent); stroke: none; }
.gs-dotchart .gs-dot-err { fill: var(--gs-highlight); stroke: none; }
.gs-dotchart .gs-dot-future { fill: none; stroke: color-mix(in srgb, var(--bs-secondary-color) 55%, transparent); stroke-width: 1.2; }
.gs-dotchart .gs-dot-col:hover .gs-dot-ok { fill: var(--bs-primary); }
.gs-dotchart .gs-dot-hit { fill: transparent; stroke: none; }
.gs-dotchart .gs-now-line { stroke: var(--gs-ink); stroke-width: 1.5; }
.gs-dotchart .gs-now-pill { fill: var(--gs-ink); stroke: none; }
.gs-dotchart .gs-now-text { fill: var(--gs-ink-fg); stroke: none; font-family: var(--gs-font-mono); font-size: 8.5px; font-weight: 500; }
.gs-dotchart .gs-axis { fill: var(--bs-secondary-color); stroke: none; font-family: var(--gs-font-mono); font-size: 8.5px; }
.gs-dotchart .gs-baseline { stroke: var(--bs-border-color); stroke-width: 1; }

.gs-attention {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 1rem;
  background: rgba(var(--gs-highlight-rgb), 0.1);
  border: 1px solid rgba(var(--gs-highlight-rgb), 0.3);
}
.gs-attention-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--gs-highlight); color: var(--gs-highlight-fg); flex: none; }
.gs-attention-icon svg { width: 16px; height: 16px; }
.gs-attention p { flex: 1 1 14rem; font-size: 0.8125rem; }

.gs-tile {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 0.625rem;
  background: var(--gs-panel);
  border: 1px solid var(--bs-border-color);
  font-size: 0.75rem;
  font-weight: 700;
  flex: none;
}
.gs-mono-sub { font-family: var(--gs-font-mono); font-size: 0.6875rem; color: var(--bs-secondary-color); }

/* Run strip: one thin bar per period (dens-ui RunStrip). */
.gs-strip { display: flex; align-items: flex-end; gap: 3px; height: 1.5rem; }
.gs-strip > span { width: 6px; min-height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--gs-ink) 55%, transparent); }
.gs-strip > span.is-err { background: var(--gs-highlight); }
.gs-strip > span.is-empty { background: transparent; border: 1px dashed var(--bs-border-color); height: 100% !important; }

/* Queue items ("Needs you" in dens-ui): the first one is raised. */
.gs-queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.gs-queue-item {
  display: flex;
  gap: 0.625rem;
  padding: 0.75rem;
  border-radius: 1rem;
  background: var(--gs-panel);
  border: 1px solid color-mix(in srgb, var(--bs-border-color) 70%, transparent);
}
.gs-queue-item:first-child { background: var(--gs-surface); border-color: var(--bs-border-color); box-shadow: var(--gs-shadow-raised); }
.gs-queue-item strong { display: block; font-size: 0.875rem; font-weight: 600; line-height: 1.35; }
.gs-queue-item small { display: block; font-size: 0.78rem; color: var(--bs-secondary-color); }
.gs-id-pill { display: inline-block; padding: 0.05rem 0.4rem; border-radius: 0.375rem; background: var(--bs-tertiary-bg); font-family: var(--gs-font-mono); font-size: 0.65625rem; color: var(--bs-body-color); }

.gs-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.gs-bars li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 2rem; align-items: center; gap: 0.75rem; font-size: 0.8125rem; }
.gs-bars-track { height: 6px; border-radius: 999px; background: var(--bs-tertiary-bg); overflow: hidden; }
.gs-bars-track > span { display: block; height: 100%; border-radius: inherit; background: var(--gs-ink); }
.gs-bars-value { font-family: var(--gs-font-mono); font-weight: 500; text-align: right; }

/* ---- Small composite widgets ---- */
.gs-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--gs-surface);
  border: 1px solid var(--bs-border-color);
  font-size: 0.75rem;
  color: var(--bs-body-color);
  box-shadow: var(--bs-box-shadow-sm);
}
.gs-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.gs-dot--live { background: var(--gs-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gs-brand) 18%, transparent); }
.gs-dot--ok { width: 8px; height: 8px; background: var(--gs-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gs-brand) 15%, transparent); }
.gs-dot--warn { width: 8px; height: 8px; background: var(--gs-highlight); box-shadow: 0 0 0 3px rgba(var(--gs-highlight-rgb), 0.18); }

.gs-empty { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 2rem 1rem; color: var(--bs-secondary-color); font-size: 0.8125rem; text-align: center; }

.gs-error-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.6rem; padding: 3.5rem 1.25rem; }
.gs-error-code { font-size: 4.5rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; background: linear-gradient(135deg, var(--gs-ink), var(--gs-brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gs-error-message { color: var(--bs-secondary-color); max-width: 520px; }
.gs-error-meta { color: var(--bs-secondary-color); font-size: 0.68rem; margin-top: 0.5rem; }

.gs-meta > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px dashed var(--bs-border-color); }
.gs-meta > div:last-child { border-bottom: 0; }
.gs-meta dt { color: var(--bs-secondary-color); font-size: 0.75rem; font-weight: 400; }
.gs-meta dd { margin: 0; text-align: right; font-size: 0.78rem; font-weight: 500; overflow-wrap: anywhere; }

.gs-user-cell { display: flex; align-items: center; gap: 0.7rem; }
.gs-user-cell > div { display: flex; flex-direction: column; min-width: 0; }
.gs-user-cell small { color: var(--bs-secondary-color); font-size: 0.72rem; }
.gs-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.35rem; flex-wrap: wrap; }

.gs-code { margin: 0; padding: 0.85rem 1rem; border-radius: 0.625rem; background: var(--bs-secondary-bg); border: 1px solid var(--bs-border-color); font-family: var(--gs-font-mono); font-size: 0.75rem; color: var(--bs-body-color); overflow-x: auto; }
.gs-email-preview { border: 1px solid var(--bs-border-color); border-radius: 0.625rem; overflow: hidden; }
.gs-email-preview-subject { margin: 0; padding: 0.6rem 0.875rem; background: var(--bs-secondary-bg); border-bottom: 1px solid var(--bs-border-color); font-size: 0.75rem; font-weight: 600; }
.gs-email-preview-body { margin: 0; padding: 1rem; font-size: 0.78rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow-y: auto; }
.gs-recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; }
.gs-recovery-codes code { padding: 0.5rem 0.6rem; border: 1px dashed var(--bs-border-color); border-radius: 0.5rem; background: var(--bs-secondary-bg); font-size: 0.78rem; text-align: center; }

.gs-meter { height: 6px; border-radius: 999px; background: var(--bs-tertiary-bg); overflow: hidden; }
.gs-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--bs-primary); transition: width 0.3s ease; }
.gs-meter--memory > span { background: var(--gs-ink); }
.gs-meter--disk > span { background: var(--gs-brand); }

.gs-count { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.75rem 0.875rem; border-radius: var(--bs-border-radius); background: var(--bs-secondary-bg); border: 1px solid var(--bs-border-color); }
.gs-count span { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.gs-count small { color: var(--bs-secondary-color); font-size: 0.7rem; }

.gs-version-hero {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem 1.5rem;
  border-radius: var(--bs-border-radius-lg);
  background: linear-gradient(120deg, var(--gs-hero-from), var(--gs-hero-via) 45%, var(--gs-hero-to));
  color: var(--gs-hero-text);
  box-shadow: var(--gs-shadow-raised);
  flex-wrap: wrap;
}
.gs-version-hero-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gs-hero-muted); }
.gs-version-hero-value { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; color: #ffffff; line-height: 1.15; }
.gs-version-hero-meta { font-size: 0.75rem; color: var(--gs-hero-soft); }
.gs-version-hero-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1.75rem; margin: 0; align-content: center; }
.gs-version-hero-facts dt { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gs-hero-muted); }
.gs-version-hero-facts dd { margin: 0.1rem 0 0; font-size: 0.78rem; color: #ffffff; }

/* ---- Timeline (changelog) ---- */
.gs-timeline { list-style: none; margin: 0; padding: 0.35rem 1.35rem 0.35rem 1.6rem; position: relative; }
.gs-timeline::before { content: ""; position: absolute; left: 0.75rem; top: 0.75rem; bottom: 0.75rem; width: 2px; background: var(--bs-border-color); }
.gs-timeline-item { position: relative; padding: 0.6rem 0 0.6rem 1.1rem; }
.gs-timeline-marker { position: absolute; left: -1.2rem; top: 1.1rem; width: 12px; height: 12px; border-radius: 50%; background: var(--gs-surface); border: 3px solid var(--gs-brand); }
.gs-timeline-body { border-bottom: 1px dashed var(--bs-border-color); padding-bottom: 0.875rem; }
.gs-timeline-item:last-child .gs-timeline-body { border-bottom: 0; }
.gs-timeline-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.72rem; }
.gs-timeline-head h4 { margin: 0.5rem 0 0.25rem; font-size: 0.9rem; }
.gs-timeline-notes { color: var(--bs-body-color); font-size: 0.84rem; line-height: 1.55; margin-bottom: 0.45rem; }
.gs-timeline-list {
  margin: 0 0 0.5rem;
  padding-left: 1.15rem;
  color: var(--bs-body-color);
  font-size: 0.84rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.gs-timeline-list li::marker { color: var(--gs-brand); }
/* Release groups: only the newest version is expanded, older ones collapse. */
.gs-release-group { border-bottom: 1px solid var(--bs-border-color); }
.gs-release-group:last-child { border-bottom: 0; }
.gs-release-summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.25rem;
  font-size: 0.8rem;
  cursor: pointer;
  list-style: none;
}
.gs-release-summary::-webkit-details-marker { display: none; }
.gs-release-summary:hover { background: var(--bs-secondary-bg); }
.gs-release-summary:focus-visible { outline: 2px solid var(--bs-link-color); outline-offset: -2px; }
.gs-release-chevron { width: 16px; height: 16px; margin-left: auto; transition: transform 0.15s ease; }
.gs-release-group[open] .gs-release-chevron { transform: rotate(180deg); }
.gs-release-group .gs-timeline { padding-top: 0; }

/* ---- Auth pages ---- */
.gs-auth-body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 1.75rem 1.125rem;
  background:
    radial-gradient(1000px 500px at 10% -10%, var(--gs-auth-glow-1) 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 100%, var(--gs-auth-glow-2) 0%, transparent 55%),
    var(--gs-auth-base);
}
.gs-auth-theme { position: fixed; top: 1.1rem; right: 1.1rem; z-index: 10; }
.gs-auth-theme .gs-icon-btn { background: var(--gs-surface); box-shadow: var(--bs-box-shadow-sm); }

/* ---- Theme dialog: color mode, sidebar color and sidebar pattern ---- */
.gs-theme-dialog {
  width: min(28rem, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  background: var(--gs-surface);
  color: var(--bs-body-color);
  box-shadow: var(--gs-shadow-raised);
}
.gs-theme-dialog::backdrop { background: rgba(12, 11, 11, 0.5); backdrop-filter: blur(2px); }
.gs-theme-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem 0;
}
.gs-theme-dialog-head h2 { font-size: 1.06rem; }
.gs-theme-dialog-close {
  display: grid;
  place-items: center;
  width: 1.875rem;
  height: 1.875rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--bs-secondary-color);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.gs-theme-dialog-close:hover { background: var(--bs-secondary-bg); color: var(--bs-body-color); }
.gs-theme-dialog-section { padding: 1rem 1.25rem 0; }
.gs-theme-dialog-section:last-of-type { padding-bottom: 1.25rem; }
.gs-theme-dialog-label {
  margin: 0 0 0.5rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}
.gs-theme-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.gs-theme-choice {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.625rem;
  background: var(--gs-surface);
  color: var(--bs-secondary-color);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.gs-theme-choice:hover { background: var(--bs-secondary-bg); color: var(--bs-body-color); }
.gs-theme-choice.is-active {
  border-color: var(--bs-primary);
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
}
.gs-theme-choice-icon { width: 1.125rem; height: 1.125rem; flex: none; }
.gs-theme-palettes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.gs-theme-palette {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.625rem;
  background: var(--gs-surface);
  color: var(--bs-secondary-color);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.gs-theme-palette:hover { background: var(--bs-secondary-bg); color: var(--bs-body-color); }
.gs-theme-palette.is-active {
  border-color: var(--bs-primary);
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
}
.gs-theme-palette-dot {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 999px;
  flex: none;
  background: linear-gradient(145deg, var(--swatch-from), var(--swatch-to));
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
[data-bs-theme="dark"] .gs-theme-palette-dot { border-color: rgba(255, 255, 255, 0.22); }
.gs-theme-palette:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.gs-theme-swatches { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.gs-theme-swatch {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.625rem;
  background: linear-gradient(150deg, var(--swatch-from), var(--swatch-to));
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gs-theme-swatch:hover { transform: translateY(-1px) scale(1.05); }
.gs-theme-swatch.is-active { box-shadow: 0 0 0 2px var(--gs-surface), 0 0 0 4px var(--bs-primary); }
.gs-theme-patterns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; }
.gs-theme-pattern {
  display: grid;
  gap: 0.3rem;
  padding: 0.3rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.625rem;
  background: var(--gs-surface);
  color: var(--bs-secondary-color);
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.gs-theme-pattern:hover { border-color: var(--bs-secondary-color); color: var(--bs-body-color); }
.gs-theme-pattern.is-active { border-color: var(--bs-primary); color: var(--bs-primary-text-emphasis); }
.gs-theme-pattern-canvas {
  --gs-pattern-ink: color-mix(in srgb, var(--gs-sidebar-text-strong) 38%, transparent);
  position: relative;
  display: block;
  height: 2.6rem;
  border-radius: 0.5rem;
  background: var(--gs-sidebar-bg);
  border: 1px solid var(--gs-sidebar-border);
  overflow: hidden;
}
.gs-theme-pattern-canvas::after { content: ""; position: absolute; inset: 0; }
.gs-theme-pattern-canvas--mesh::after {
  background-image: radial-gradient(circle, var(--gs-pattern-ink) 1px, transparent 1.4px);
  background-size: 9px 9px;
}
.gs-theme-pattern-canvas--grid::after {
  background-image:
    linear-gradient(var(--gs-pattern-ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--gs-pattern-ink) 1px, transparent 1px);
  background-size: 10px 10px, 10px 10px;
}
.gs-theme-pattern-canvas--waves::after {
  background-image: repeating-radial-gradient(circle at 50% 130%, transparent 0 8px, var(--gs-pattern-ink) 8px 9px);
}
.gs-theme-pattern-canvas--orbit::after {
  background-image:
    radial-gradient(circle at 50% 50%, transparent 0 7px, var(--gs-pattern-ink) 7px 8px, transparent 8px),
    radial-gradient(circle at 50% 50%, transparent 0 14px, var(--gs-pattern-ink) 14px 15px, transparent 15px),
    radial-gradient(circle at 50% 50%, var(--gs-sidebar-art-node) 1.5px, transparent 2px);
}
.gs-theme-pattern-name { line-height: 1.1; text-align: center; }
.gs-theme-swatch:focus-visible,
.gs-theme-choice:focus-visible,
.gs-theme-pattern:focus-visible,
.gs-theme-dialog-close:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.gs-theme-dialog-hint { margin: 0.625rem 0 0; font-size: 0.72rem; color: var(--bs-secondary-color); }
.gs-auth-shell {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  width: min(1020px, 100%);
  min-height: 560px;
  background: var(--gs-surface);
  border: 1px solid var(--bs-border-color);
  border-radius: 1.625rem;
  overflow: hidden;
  box-shadow: var(--gs-shadow-raised);
}
.gs-auth-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.875rem;
  padding: 3.25rem 3rem;
  background: linear-gradient(160deg, var(--gs-hero-from) 0%, var(--gs-hero-via) 55%, var(--gs-hero-to) 100%);
  color: var(--gs-hero-text);
  overflow: hidden;
  --gs-auth-art-line: color-mix(in srgb, var(--gs-hero-soft) 16%, transparent);
  --gs-auth-art-line-strong: color-mix(in srgb, var(--gs-hero-soft) 30%, transparent);
  --gs-auth-art-dot: color-mix(in srgb, var(--gs-hero-soft) 14%, transparent);
  --gs-auth-art-node: var(--gs-hero-soft);
}
.gs-auth-hero::after {
  content: "";
  position: absolute;
  inset: auto -60px -120px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 0, 0.28), transparent 65%);
}
.gs-auth-hero h1 { font-size: 2.125rem; letter-spacing: -0.03em; color: #ffffff; margin: 0; }
.gs-auth-hero > p { color: var(--gs-hero-soft); font-size: 0.84rem; max-width: 34ch; margin: 0; }
.gs-auth-hero-list { list-style: none; margin: 0.35rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.625rem; font-size: 0.78rem; color: var(--gs-hero-text); }
.gs-auth-hero-list li { position: relative; padding-left: 1.375rem; }
.gs-auth-hero-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.38rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gs-hero-soft);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gs-hero-soft) 18%, transparent);
}
.gs-auth-hero-version { position: absolute; z-index: 1; bottom: 1.375rem; left: 3rem; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gs-hero-muted); font-family: var(--gs-font-mono); }
/* Animated vector backdrop on the sign-in hero: signal rings, data mesh, shield. */
.gs-auth-hero-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.gs-auth-hero-art svg { display: block; width: 100%; height: 100%; stroke-width: 1.3; }
.gs-auth-hero > :not(.gs-auth-hero-art):not(.gs-auth-hero-version) { position: relative; z-index: 1; }
.gs-auth-art-dots { fill: url(#gsAuthArtDots); stroke: none; }
.gs-auth-art-dot { fill: var(--gs-auth-art-dot); stroke: none; }
.gs-auth-art-rings circle {
  fill: none;
  stroke: var(--gs-auth-art-line);
  stroke-dasharray: 3 10;
  animation: gsArtSpin 70s linear infinite;
  transform-box: view-box;
  transform-origin: 512px 132px;
}
.gs-auth-art-rings circle:nth-child(2) { animation-duration: 50s; animation-direction: reverse; }
.gs-auth-art-rings circle:nth-child(3) { animation-duration: 34s; }
.gs-auth-art-wave path {
  fill: none;
  stroke: var(--gs-auth-art-line-strong);
  animation: gsArtPulse 5s ease-in-out infinite;
}
.gs-auth-art-wave path:nth-child(2) { animation-delay: 0.6s; }
.gs-auth-art-wave path:nth-child(3) { animation-delay: 1.2s; }
.gs-auth-art-wave circle { fill: var(--gs-auth-art-node); stroke: none; animation: gsArtPulse 3.6s ease-in-out infinite; }
.gs-auth-art-mesh path { fill: none; stroke: var(--gs-auth-art-line); }
.gs-auth-art-mesh .gs-auth-art-flow {
  stroke: var(--gs-auth-art-line-strong);
  stroke-dasharray: 10 12;
  animation: gsArtFlow 8s linear infinite;
}
.gs-auth-art-mesh .gs-auth-art-flow--slow { animation-duration: 13s; animation-direction: reverse; }
.gs-auth-art-mesh .gs-auth-art-node {
  fill: var(--gs-auth-art-node);
  stroke: rgba(15, 23, 22, 0.55);
  stroke-width: 2;
  opacity: 0.75;
  animation: gsArtPulse 4s ease-in-out infinite;
}
.gs-auth-art-mesh .gs-auth-art-node:nth-of-type(2n) { animation-delay: 1.2s; }
.gs-auth-art-mesh .gs-auth-art-node:nth-of-type(3n) { animation-delay: 2.4s; }
.gs-auth-art-shield path { fill: none; stroke: var(--gs-auth-art-line-strong); }
.gs-auth-art-shield path:first-child { stroke: var(--gs-auth-art-line); }

.gs-auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 3rem 2.75rem; }
.gs-auth-panel-footer { margin-top: 1.75rem; text-align: center; font-size: 0.68rem; color: var(--bs-secondary-color); }
.gs-auth-head { margin-bottom: 1.375rem; }
.gs-auth-head h2 { font-size: 1.5rem; letter-spacing: -0.025em; margin: 0; }
.gs-auth-head p { color: var(--bs-secondary-color); font-size: 0.8125rem; margin-top: 0.25rem; }
.gs-auth-alt { margin-top: 0.875rem; text-align: center; font-size: 0.78rem; }
.gs-demo-box { margin-top: 1.375rem; padding: 0.875rem 1rem; border-radius: var(--bs-border-radius); background: var(--bs-secondary-bg); border: 1px dashed var(--bs-border-color); font-size: 0.75rem; }
.gs-demo-box-title { font-weight: 700; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--bs-secondary-color); margin-bottom: 0.5rem; }
.gs-demo-box ul { list-style: none; margin: 0 0 0.5rem; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.gs-demo-box li { display: flex; justify-content: space-between; gap: 0.6rem; }
.gs-demo-box li span { color: var(--bs-secondary-color); font-size: 0.72rem; }

/* ---- Public landing page ---- */
.gs-landing-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--gs-surface);
  background: color-mix(in srgb, var(--gs-surface) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bs-border-color);
}
/* The brand block is built for the dark sidebar; the landing navbar re-colours it. */
.gs-landing-nav .gs-brand,
.gs-landing-nav .gs-brand:hover { color: var(--bs-body-color); }
.gs-landing-nav .gs-brand-text small { color: var(--bs-secondary-color); }
.gs-landing-nav-inner { max-width: 1120px; margin: 0 auto; padding: 0.875rem 1.5rem; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.gs-landing-links { display: flex; align-items: center; gap: 1.125rem; margin-left: 0.5rem; flex: 1; flex-wrap: wrap; }
.gs-landing-links a { color: var(--bs-secondary-color); font-size: 0.8125rem; font-weight: 500; }
.gs-landing-links a:hover { color: var(--bs-body-color); }
.gs-landing-actions { display: flex; align-items: center; gap: 0.5rem; }
.gs-landing { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.5rem 4rem; }
.gs-hero { position: relative; padding: 4.5rem 0 3.5rem; text-align: center; overflow: hidden; }
.gs-hero-glow {
  position: absolute;
  inset: -30% 10% auto;
  height: 420px;
  z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--gs-brand) 22%, transparent), transparent 75%);
  filter: blur(10px);
  pointer-events: none;
}
.gs-hero-inner { max-width: 760px; margin: 0 auto; }
.gs-hero-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.75rem; border-radius: 999px; border: 1px solid var(--bs-border-color); background: var(--gs-surface); color: var(--bs-secondary-color); font-size: 0.75rem; font-weight: 600; }
.gs-hero-title { margin: 1.375rem 0 0.875rem; font-size: clamp(1.875rem, 4.4vw, 3rem); line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; }
.gs-hero-sub { margin: 0 auto; max-width: 640px; color: var(--bs-secondary-color); font-size: 0.9375rem; line-height: 1.65; }
.gs-hero-actions { display: flex; justify-content: center; gap: 0.75rem; margin-top: 1.75rem; flex-wrap: wrap; }
.gs-hero-facts { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 0.625rem; margin: 2.5rem 0 0; padding: 0; }
.gs-hero-facts li { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.75rem 1.125rem; min-width: 130px; border: 1px solid var(--bs-border-color); border-radius: 0.75rem; background: var(--gs-surface); }
.gs-hero-facts strong { font-size: 0.8125rem; }
.gs-hero-facts span { color: var(--bs-secondary-color); font-size: 0.72rem; }

.gs-section { padding: 3rem 0; }
.gs-section--alt { border-top: 1px solid var(--bs-border-color); }
.gs-section-head { max-width: 620px; margin-bottom: 1.625rem; }
.gs-section-head h2 { margin: 0 0 0.35rem; font-size: 1.375rem; letter-spacing: -0.01em; }
.gs-section-head p { margin: 0; color: var(--bs-secondary-color); font-size: 0.84rem; }
.gs-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 0.625rem;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  flex: none;
}
.gs-panel-icon svg { width: 1.1875rem; height: 1.1875rem; }
.gs-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  padding: 1.875rem;
  border-radius: 1.125rem;
  border: 1px solid var(--bs-border-color);
  background: var(--gs-surface);
  background: linear-gradient(135deg, color-mix(in srgb, var(--gs-brand) 14%, var(--gs-surface)), var(--gs-surface));
}
.gs-cta h2 { margin: 0 0 0.35rem; font-size: 1.25rem; }
.gs-cta p { margin: 0; color: var(--bs-secondary-color); font-size: 0.8125rem; }
.gs-landing-footer { border-top: 1px solid var(--bs-border-color); background: var(--gs-surface); }
.gs-landing-footer-inner { max-width: 1120px; margin: 0 auto; padding: 1.75rem 1.5rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.gs-landing-footer-brand { display: flex; gap: 0.75rem; align-items: flex-start; max-width: 420px; }
.gs-landing-footer-brand strong { font-size: 0.84rem; }
.gs-landing-footer-brand p { margin: 0.25rem 0 0; color: var(--bs-secondary-color); font-size: 0.75rem; line-height: 1.55; }
.gs-landing-footer-links { display: flex; flex-direction: column; gap: 0.45rem; }
.gs-landing-footer-links a { color: var(--bs-secondary-color); font-size: 0.78rem; }
.gs-landing-footer-links a:hover { color: var(--bs-body-color); }
.gs-landing-footer-meta { display: flex; flex-direction: column; gap: 0.35rem; color: var(--bs-secondary-color); font-size: 0.72rem; text-align: right; }

/* ---- Command palette ---- */
.gs-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 40px;
  min-width: 15rem;
  padding: 0 0.5rem 0 0.875rem;
  border: 1px solid var(--gs-input);
  border-radius: 999px;
  background: var(--gs-surface);
  color: var(--bs-secondary-color);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  box-shadow: var(--gs-shadow-control);
}
.gs-search-trigger:hover { color: var(--bs-body-color); }
.gs-search-trigger:focus-visible { outline: 2px solid var(--gs-brand); outline-offset: 2px; }
.gs-search-trigger svg { width: 1rem; height: 1rem; }
.gs-search-trigger span { flex: 1; text-align: left; }
.gs-search-trigger kbd { margin-left: auto; }
.gs-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(12, 11, 11, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1rem 1rem;
  backdrop-filter: blur(2px);
}
.gs-search-overlay[hidden] { display: none; }
.gs-search-dialog { width: 100%; max-width: 620px; background: var(--gs-surface); border: 1px solid var(--bs-border-color); border-radius: 1.375rem; box-shadow: var(--gs-shadow-raised); overflow: hidden; }
.gs-search-field { display: flex; align-items: center; gap: 0.625rem; padding: 0.875rem 1rem; border-bottom: 1px solid var(--bs-border-color); }
.gs-search-field svg { width: 1.0625rem; height: 1.0625rem; color: var(--bs-secondary-color); }
.gs-search-field input { flex: 1; border: none; background: transparent; color: var(--bs-body-color); font: inherit; font-size: 0.875rem; outline: none; }
.gs-search-results { list-style: none; margin: 0; padding: 0.35rem; max-height: 50vh; overflow-y: auto; }
.gs-search-result { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.625rem 0.75rem; border-radius: 0.625rem; text-decoration: none; color: inherit; }
.gs-search-result:hover, .gs-search-result.is-active { background: var(--bs-secondary-bg); text-decoration: none; color: inherit; }
.gs-search-type { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bs-secondary-color); border: 1px solid var(--bs-border-color); border-radius: 6px; padding: 2px 6px; margin-top: 2px; white-space: nowrap; }
.gs-search-body strong { display: block; font-size: 0.8125rem; }
.gs-search-body small { color: var(--bs-secondary-color); font-size: 0.72rem; }
.gs-search-hint { margin: 0; padding: 1rem; color: var(--bs-secondary-color); font-size: 0.75rem; }
html.search-open { overflow: hidden; }

/* ---- Notifications dropdown ---- */
.gs-notif-menu { width: 340px; padding: 0; overflow: hidden; }
.gs-notif-item.is-unread strong::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 0.375rem; border-radius: 50%; background: var(--gs-highlight); vertical-align: middle; }
.gs-notif-head, .gs-notif-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--bs-border-color); }
.gs-notif-foot { border-bottom: none; border-top: 1px solid var(--bs-border-color); }
.gs-notif-list { list-style: none; margin: 0; padding: 0.35rem; max-height: 320px; overflow-y: auto; }
.gs-notif-item { display: flex; gap: 0.625rem; align-items: flex-start; padding: 0.625rem; border-radius: 0.625rem; }
.gs-notif-item.is-unread { background: var(--bs-secondary-bg); }
.gs-notif-item strong { display: block; font-size: 0.78rem; }
.gs-notif-item small { display: block; color: var(--bs-secondary-color); font-size: 0.72rem; }
.gs-notif-open { margin-left: auto; color: var(--bs-secondary-color); font-size: 0.9375rem; }
.gs-notif-empty { padding: 1.125rem 0.875rem; color: var(--bs-secondary-color); font-size: 0.75rem; margin: 0; }
.gs-notif-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; flex: 0 0 auto; background: var(--bs-primary); }
.gs-notif-dot--success { background: var(--bs-success); }
.gs-notif-dot--warning { background: var(--bs-warning); }
.gs-notif-dot--error { background: var(--bs-danger); }
.gs-notif-dot--info { background: var(--bs-primary); }
/* Orange count on the bell: it is the one thing in the header that needs you. */
.gs-notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gs-highlight);
  color: var(--gs-highlight-fg);
  box-shadow: 0 0 0 2px var(--gs-panel);
  font-size: 0.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gs-notif-btn { position: relative; }

/* ---- Impersonation, bulk actions, saved filters ---- */
.gs-impersonation {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  background: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-text-emphasis);
  font-size: 0.78rem;
  border-bottom: 1px solid var(--bs-border-color);
}
.gs-impersonation p { margin: 0; flex: 1; }
.gs-impersonation-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bs-warning); flex: 0 0 auto; }

.gs-bulk-bar { display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem 1.25rem; border-top: 1px solid var(--bs-border-color); background: var(--bs-secondary-bg); flex-wrap: wrap; }
.gs-bulk-count { font-size: 0.75rem; color: var(--bs-secondary-color); }

.gs-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.5rem; border-radius: 999px; border: 1px solid var(--bs-border-color); background: var(--bs-secondary-bg); font-size: 0.72rem; }
.gs-chip a { color: inherit; text-decoration: none; }
.gs-chip-remove { border: none; background: transparent; color: var(--bs-secondary-color); cursor: pointer; font-size: 0.8125rem; line-height: 1; padding: 0; }
.gs-chip-remove:hover { color: var(--bs-danger); }

.gs-file-input { position: relative; overflow: hidden; cursor: pointer; }
.gs-file-input input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---- Feedback widgets ---- */
.gs-flash-data { display: none; }
.gs-pre { white-space: pre-wrap; word-break: break-word; }

/* Toasts (toastr) and confirmations (SweetAlert2) */
#toast-container > div {
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow);
  font-size: 0.8125rem;
  line-height: 1.5;
  opacity: 1;
  padding: 0.875rem 1rem 0.875rem 2.875rem;
  width: 340px;
  max-height: 45vh;
  overflow-y: auto;
  font-family: var(--gs-font-sans);
}
#toast-container > div:hover { box-shadow: var(--gs-shadow-raised); }
#toast-container > div { color: #ffffff; }
#toast-container > .toast-success { background-color: var(--gs-toast-primary); }
#toast-container > .toast-info { background-color: var(--gs-rail); }
#toast-container > .toast-warning { background-color: #b45f00; }
#toast-container > .toast-error { background-color: #a42423; }
#toast-container > div .toast-title { font-weight: 600; margin-bottom: 2px; }
#toast-container > div .toast-message { word-break: break-word; }
#toast-container > div .toast-progress { opacity: 0.35; }
#toast-container .toast-close-button { opacity: 0.85; font-weight: 400; }
#toast-container.toast-bottom-right { right: 20px; bottom: 20px; }

.swal2-popup.gs-swal {
  background: var(--gs-surface);
  color: var(--bs-body-color);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow);
  font-family: inherit;
  padding: 1.5rem 1.5rem 1.25rem;
  width: min(440px, calc(100vw - 32px));
}
.swal2-popup.gs-swal .swal2-icon { width: 3rem; height: 3rem; margin: 0 auto 0.75rem; border-width: 3px; }
.swal2-popup.gs-swal .swal2-icon .swal2-icon-content { font-size: 1.7rem; }
.swal2-popup.gs-swal .swal2-html-container,
.swal2-popup.gs-swal .swal2-title { color: var(--bs-body-color); font-size: 0.875rem; line-height: 1.6; margin: 0; padding: 0 0.25rem; }
.swal2-popup.gs-swal .swal2-actions { gap: 0.5rem; margin-top: 1.125rem; width: 100%; }
/* Confirm is the filled action, cancel a neutral outline: never the same look. */
.swal2-popup.gs-swal .swal2-confirm,
.swal2-popup.gs-swal .swal2-cancel { border-radius: var(--bs-border-radius-sm); font-size: 0.8125rem; font-weight: 600; margin: 0; min-width: 8.25rem; box-shadow: none; }
.swal2-popup.gs-swal .swal2-close { color: var(--bs-secondary-color); }

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
  .gs-app { padding: 0.5rem; }
  .gs-main { min-height: calc(100vh - 1rem); border-radius: 1.75rem; }
  .gs-sidebar { border-radius: 0 1.75rem 1.75rem 0; }
  .gs-topbar-title h1 { font-size: 1.5rem; }
  .gs-auth-shell { grid-template-columns: 1fr; }
  .gs-auth-hero { display: none; }
  .gs-auth-panel { padding: 2.25rem 1.625rem; }
  .gs-search-trigger span, .gs-search-trigger kbd { display: none; }
  .gs-search-trigger { min-width: 0; width: 40px; padding: 0; justify-content: center; }
  .gs-landing-links { display: none; }
  .gs-hero { padding: 3.25rem 0 2.5rem; }
  .gs-landing-footer-meta { text-align: left; }
}

@media (max-width: 575.98px) {
  .gs-page-head { flex-direction: column; align-items: stretch; }
  .gs-kpi-value { font-size: 3.25rem; }
  .gs-footer { flex-direction: column; }
  .gs-version-hero-facts { grid-template-columns: 1fr; }
  .gs-topbar { gap: 0.75rem; padding: 0.5rem 0.5rem 0; }
  .gs-topbar-actions { gap: 0.375rem; margin-left: 0; }
  .gs-content { padding: 0.5rem; }
  .gs-hero-facts li { flex: 1 1 44%; }
  .gs-cta { padding: 1.375rem; }
  #toast-container > div { width: calc(100vw - 32px); }
  #toast-container.toast-bottom-right { right: 16px; bottom: 16px; }
}

/* Mini sidebar with text labels (Settings → Mini sidebar). */
.gs-rail-label { display: none; }
.gs-rail-col--labels .gs-rail { padding: 0.5rem 0.35rem; }
.gs-rail-col--labels .gs-rail-item { width: 100%; height: auto; min-height: 48px; padding: 0.4rem 0.15rem; gap: 0.2rem; align-content: center; }
.gs-rail-col--labels .gs-rail-label { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.5625rem; font-weight: 600; line-height: 1.1; letter-spacing: 0.01em; }
.gs-rail-col--labels .gs-rail-item.is-active::before { left: -0.35rem; }
.gs-rail-col--labels .gs-rail-prefs { width: 100%; }
.gs-rail-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; }
.gs-rail-color { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); }
.gs-rail-color .form-control-color { flex: none; width: 2.75rem; height: 2.25rem; padding: 0.2rem; }

/* Layout utilities: a main column with a fixed-width aside, and equal grids. */
.gs-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.gs-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; align-items: start; }
.gs-cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.gs-cols-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; align-items: start; }
@media (max-width: 1199.98px) { .gs-split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 991.98px) { .gs-cols-3, .gs-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .gs-cols-2, .gs-cols-3, .gs-cols-4 { grid-template-columns: minmax(0, 1fr); } }
/* Small mono caption above a group of fields or a value. */
.gs-stat-label { font-family: var(--gs-font-mono); font-size: 0.6875rem; font-weight: 500; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: 0.08em; }
/* Two-factor setup: QR code beside the steps and setup key. */
.gs-2fa-setup { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.gs-2fa-qr { flex: none; width: 208px; height: 208px; padding: 8px; border-radius: 14px; background: #ffffff; border: 1px solid var(--bs-border-color); image-rendering: pixelated; }
.gs-2fa-setup > div { flex: 1 1 16rem; }
.gs-2fa-steps { padding-left: 1.1rem; font-size: 0.8125rem; color: var(--bs-secondary-color); display: flex; flex-direction: column; gap: 0.25rem; }
.gs-2fa-method.is-active { border-color: color-mix(in srgb, var(--bs-success) 55%, var(--bs-border-color)); }

/* Mobile sidebar close: the dialog's × button in sidebar colours, centred on
   the brand row so it clears the rounded corner. */
.gs-sidebar .offcanvas-header { position: absolute; top: 1.125rem; right: 0.875rem; z-index: 3; padding: 0; }
.gs-sidebar-close { width: 2rem; height: 2rem; font-size: 1.375rem; color: var(--gs-sidebar-muted); }
.gs-sidebar-close:hover { background: color-mix(in srgb, var(--gs-sidebar-text-strong) 10%, transparent); color: var(--gs-sidebar-text-strong); }
.gs-sidebar-close:focus { outline: 0; box-shadow: none; }
.gs-sidebar-close:focus-visible { outline: 1px solid var(--gs-sidebar-text-strong); outline-offset: 1px; }
@media (max-width: 991.98px) { .gs-sidebar .gs-brand { padding-right: 2.75rem; } }

/* ---- Aikuadrat.id extensions (logo tile, back-to-home pill, portal shell, copy state, AI stat cards) ---- */
.gs-brand-mark--logo {
  background: #ffffff;
  padding: 3px;
  object-fit: contain;
  box-shadow: 0 4px 12px -6px rgba(15, 23, 22, 0.35);
}
.gs-brand-mark--lg.gs-brand-mark--logo { width: 64px; height: 64px; border-radius: 1.125rem; padding: 6px; }
.gs-brand-mark--sm.gs-brand-mark--logo { width: 30px; height: 30px; padding: 2px; }

.gs-auth-home {
  position: fixed;
  top: 1.1rem;
  left: 1.1rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 40px;
  padding: 0 0.9rem 0 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--gs-input);
  background: var(--gs-surface);
  color: var(--bs-body-color);
  box-shadow: var(--gs-shadow-control);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.gs-auth-home:hover { background: var(--gs-accent); color: var(--bs-body-color); }
.gs-auth-home svg { width: 1rem; height: 1rem; }
@media (max-width: 575.98px) {
  .gs-auth-home span { display: none; }
  .gs-auth-home { width: 40px; padding: 0; justify-content: center; }
}

[data-copy].is-copied {
  border-color: var(--bs-success) !important;
  color: var(--bs-success) !important;
}

.gs-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.15rem;
  border-radius: var(--bs-border-radius-lg);
  background: var(--gs-surface);
  border: 1px solid color-mix(in srgb, var(--bs-border-color) 65%, transparent);
  box-shadow: var(--gs-shadow-panel);
}
.gs-stat-card-value {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.gs-stat-card-hint {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
}

/* Client portal uses the exact same framed shell without the admin icon rail. */
@media (min-width: 1200px) {
  .gs-app.gs-portal-app { grid-template-columns: 252px minmax(0, 1fr); }
}

/* Compact inline bar chart for token usage history on model/client/portal pages. */
.gs-usage-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  height: 120px;
  padding-top: 0.5rem;
}
.gs-usage-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  height: 100%;
}
.gs-usage-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.gs-usage-bar {
  width: 100%;
  max-width: 24px;
  min-height: 3px;
  border-radius: 4px 4px 2px 2px;
  background: var(--bs-primary);
  opacity: 0.85;
  transition: opacity 0.15s ease;
}
.gs-usage-col:hover .gs-usage-bar { opacity: 1; }
.gs-usage-label {
  font-family: var(--gs-font-mono);
  font-size: 0.65rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

/* ---- Hermes Agent integrated console ---- */
.gs-hermes-chat {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 280px;
  max-height: 460px;
  overflow-y: auto;
  padding: 1rem;
  border-radius: 1rem;
  background: var(--gs-panel);
  border: 1px solid color-mix(in srgb, var(--bs-border-color) 75%, transparent);
}
.gs-hermes-empty {
  margin: auto;
  text-align: center;
  max-width: 28rem;
}
.gs-hermes-msg {
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--bs-border-color) 75%, transparent);
  background: var(--gs-surface);
  color: var(--bs-body-color);
  font-size: 0.875rem;
}
.gs-hermes-msg--user {
  margin-left: auto;
  max-width: 85%;
  background: color-mix(in srgb, var(--bs-primary) 10%, var(--gs-surface));
  border-color: color-mix(in srgb, var(--bs-primary) 30%, transparent);
}
.gs-hermes-msg--assistant {
  margin-right: auto;
  max-width: 92%;
}
.gs-hermes-msg--error {
  margin-right: auto;
  max-width: 92%;
  background: var(--bs-danger-bg-subtle);
  border-color: var(--bs-danger-border-subtle);
  color: var(--bs-danger-text-emphasis);
}
.gs-hermes-msg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
}
.gs-hermes-msg-meta {
  font-family: var(--gs-font-mono);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.gs-hermes-msg-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.gs-hermes-msg-body.is-streaming::after {
  content: "▍";
  display: inline-block;
  margin-left: 2px;
  color: var(--bs-primary);
  animation: gsHermesBlink 0.9s steps(2, start) infinite;
}
@keyframes gsHermesBlink {
  to { visibility: hidden; }
}
.gs-hermes-pre {
  max-height: 220px;
  overflow: auto;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: var(--gs-panel);
  color: var(--bs-body-color);
  border: 1px solid color-mix(in srgb, var(--bs-border-color) 70%, transparent);
  font-family: var(--gs-font-mono);
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
