/* ==========================================================================
   MASAR PLATFORM THEME — the single source of every day/night palette.
   Mode lives in html[data-theme], the chosen palette in html[data-palette];
   both are applied before first paint by public/js/workspace-theme.js.
   Loaded by every layout: delivery workspace, platform admin, and login/selection pages.
   ========================================================================== */

/* ---- LIGHT · L1 IQ BIDAYA brand (default) ---- */
:root[data-theme="light"] {
  color-scheme: light;
  --d-ink: #17302f;
  --d-ink-soft: #3f5a58;
  --d-muted: #6b8280;
  --d-muted-soft: #93a8a5;
  --d-line: #e3e8e4;
  --d-line-soft: #eef1ec;
  --d-surface: #ffffff;
  --d-surface-2: #f5f3ec;
  --d-surface-3: #ece9df;
  --d-field-bg: #faf9f4;
  --d-primary: #1e6563;
  --d-primary-strong: #0e3c3b;
  --d-primary-2: #27908d;
  --d-primary-soft: #e1f0ee;
  --d-primary-ink: #ffffff;
  --d-gold: #c7a45e;
  --d-gold-soft: #e0d08e;
  --d-ring: rgba(30, 101, 99, .24);
  --d-glow: rgba(30, 101, 99, .08);
  --d-topbar-bg: rgba(255, 255, 255, .94);
  --d-sidebar-bg: #0e3c3b;
  --d-sidebar-ink: #eaf4f2;
  --d-sidebar-muted: #8fb3ae;
  --d-sidebar-line: rgba(255, 255, 255, .08);
  --d-sidebar-hover: rgba(255, 255, 255, .07);
  --d-sidebar-active-bg: rgba(199, 164, 94, .18);
  --d-sidebar-active-ink: #e0d08e;
  --d-sidebar-accent: #c7a45e;
  --d-danger: #b4453c;
  --d-danger-soft: #fdeeec;
  --d-danger-line: #f3d7d3;
  --d-success: #14795e;
  --d-success-soft: #e8f6f1;
  --d-success-line: #c7eadc;
  --d-warn: #9a6a0b;
  --d-warn-soft: #fff6e6;
  --d-warn-line: #f3dcb0;
  --d-info: #2f6fb0;
  --d-info-soft: #eaf2fb;
  --d-shadow-1: 0 1px 2px rgba(16, 36, 46, .05), 0 1px 3px rgba(16, 36, 46, .04);
  --d-shadow-2: 0 10px 28px rgba(16, 36, 46, .07);
  --d-shadow-3: 0 24px 60px rgba(16, 36, 46, .12);
}

/* ---- LIGHT · Royal Violet (delivery workspace default) ---- */
:root[data-theme="light"][data-palette="violet"] {
  --d-ink: #1d1a39; --d-ink-soft: #45416a; --d-muted: #65627f; --d-muted-soft: #85829e;
  --d-line: #e8e7f0; --d-line-soft: #f0eff6;
  --d-surface: #ffffff; --d-surface-2: #f4f4f8; --d-surface-3: #ebeaf3; --d-field-bg: #f4f4f8;
  --d-primary: #4f2fd8; --d-primary-strong: #3b1a9e; --d-primary-2: #6d4fe6;
  --d-primary-soft: #ece8fd; --d-primary-ink: #ffffff; --d-primary-fill: #4f2fd8;
  --d-gold: #ff9b3f; --d-gold-soft: #ffd3a6;
  --d-ring: rgba(79, 47, 216, .22); --d-glow: rgba(79, 47, 216, 0);
  --d-topbar-bg: #f4f4f8;
  --d-sidebar-bg: #3d1a9e; --d-sidebar-ink: #ffffff; --d-sidebar-muted: #cfc4f4;
  --d-sidebar-line: rgba(255, 255, 255, .12); --d-sidebar-hover: rgba(255, 255, 255, .1);
  --d-sidebar-active-bg: #f4f4f8; --d-sidebar-active-ink: #2b1470; --d-sidebar-accent: #ffffff;
  --d-danger: #c4263c; --d-danger-soft: #fdecef; --d-danger-line: #f8d0d6;
  --d-success: #0a7a4b; --d-success-soft: #e3f8ee; --d-success-line: #bdeed6;
  --d-warn: #a35304; --d-warn-soft: #fff1e2; --d-warn-line: #fbdcb9;
  --d-info: #1869bb; --d-info-soft: #e6f2fd;
  --d-shadow-1: 0 6px 24px rgba(45, 32, 110, .06);
  --d-shadow-2: 0 12px 32px rgba(45, 32, 110, .09);
  --d-shadow-3: 0 24px 60px rgba(45, 32, 110, .16);
}

/* ---- DARK · Royal Violet (delivery workspace default) ---- */
:root[data-theme="dark"][data-palette="violet"] {
  color-scheme: dark;
  --d-ink: #eeecfb; --d-ink-soft: #c9c6e6; --d-muted: #9a97bd; --d-muted-soft: #77749a;
  --d-line: #322d5a; --d-line-soft: #2a264d;
  --d-surface: #1f1b3d; --d-surface-2: #15122c; --d-surface-3: #2a264d; --d-field-bg: #15122c;
  --d-primary: #8b74f5; --d-primary-strong: #a795fa; --d-primary-2: #a795fa;
  --d-primary-soft: #2e2763; --d-primary-ink: #ffffff; --d-primary-fill: #6549e6;
  --d-gold: #ff9b3f; --d-gold-soft: #ffd3a6;
  --d-ring: rgba(139, 116, 245, .3); --d-glow: rgba(139, 116, 245, 0);
  --d-topbar-bg: #15122c;
  --d-sidebar-bg: #2a1472; --d-sidebar-ink: #ffffff; --d-sidebar-muted: #bdb0ee;
  --d-sidebar-line: rgba(255, 255, 255, .12); --d-sidebar-hover: rgba(255, 255, 255, .09);
  --d-sidebar-active-bg: #15122c; --d-sidebar-active-ink: #ffffff; --d-sidebar-accent: #ffffff;
  --d-danger: #f4707f; --d-danger-soft: #3d1b2a; --d-danger-line: #5e2a3c;
  --d-success: #3ed598; --d-success-soft: #14352c; --d-success-line: #1f5243;
  --d-warn: #ffa95c; --d-warn-soft: #3b2a18; --d-warn-line: #5a3f22;
  --d-info: #5cb2f7; --d-info-soft: #15304a;
  --d-shadow-1: 0 6px 24px rgba(0, 0, 0, .25);
  --d-shadow-2: 0 12px 32px rgba(0, 0, 0, .32);
  --d-shadow-3: 0 24px 60px rgba(0, 0, 0, .45);
}

/* ---- LIGHT · L6 Cream Sage (design-kit) ---- */
:root[data-theme="light"][data-palette="cream"] {
  --d-ink: #2a2620; --d-ink-soft: #4b4337; --d-muted: #8b8070; --d-muted-soft: #a89d8b;
  --d-line: #e7ddc8; --d-line-soft: #efe6d3;
  --d-surface: #fffcf5; --d-surface-2: #f6efe1; --d-surface-3: #efe6d3; --d-field-bg: #faf4e7;
  --d-primary: #3f7255; --d-primary-strong: #2c5240; --d-primary-2: #4f8a68;
  --d-primary-soft: #dfe9d6; --d-primary-ink: #ffffff;
  --d-ring: rgba(63, 114, 85, .24); --d-glow: rgba(63, 114, 85, .08);
  --d-topbar-bg: rgba(255, 252, 245, .94);
  --d-sidebar-bg: #1f3d2f; --d-sidebar-ink: #f6efe1; --d-sidebar-muted: #a9bfae;
  --d-sidebar-line: rgba(255, 255, 255, .09); --d-sidebar-hover: rgba(255, 255, 255, .07);
  --d-sidebar-active-bg: #d9b88a; --d-sidebar-active-ink: #3a2418; --d-sidebar-accent: #d9b88a;
  --d-danger: #a5473a; --d-danger-soft: #f6ded8; --d-danger-line: #ebc3ba;
  --d-success: #3f7a55; --d-success-soft: #dfebd8; --d-success-line: #c3d9bb;
  --d-warn: #8a5a3c; --d-warn-soft: #f3e4cc; --d-warn-line: #e3cba3;
  --d-info: #3e6f8c; --d-info-soft: #dfeaf0;
  --d-shadow-1: 0 2px 6px -2px rgba(58, 47, 32, .12);
  --d-shadow-2: 0 4px 14px -4px rgba(58, 47, 32, .14);
  --d-shadow-3: 0 14px 34px -12px rgba(58, 47, 32, .28);
  --kit-accent: #8a5a3c; --kit-accent2: #d9b88a;
}

/* ---- LIGHT · L5 Royal Lavender ---- */
:root[data-theme="light"][data-palette="lavender"] {
  --d-ink: #221a3d;
  --d-ink-soft: #463c63;
  --d-muted: #7a7194;
  --d-muted-soft: #a29bb8;
  --d-line: #e6e1f3;
  --d-line-soft: #efebf8;
  --d-surface: #ffffff;
  --d-surface-2: #f5f3fb;
  --d-surface-3: #ece8f7;
  --d-field-bg: #faf9fd;
  --d-primary: #6d4fd8;
  --d-primary-strong: #5236b8;
  --d-primary-2: #8b70ec;
  --d-primary-soft: #eee9fd;
  --d-ring: rgba(109, 79, 216, .22);
  --d-glow: rgba(109, 79, 216, .08);
  --d-sidebar-bg: #2e1a5e;
  --d-sidebar-ink: #f1edff;
  --d-sidebar-muted: #b3a6dc;
  --d-sidebar-active-bg: rgba(139, 112, 236, .3);
  --d-sidebar-active-ink: #e6deff;
  --d-sidebar-accent: #a48bff;
}

/* ---- DARK · shared semantics ---- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --d-danger: #fb8a8a;
  --d-danger-soft: rgba(244, 63, 94, .14);
  --d-danger-line: rgba(244, 63, 94, .32);
  --d-success: #6ee7a8;
  --d-success-soft: rgba(34, 197, 94, .14);
  --d-success-line: rgba(34, 197, 94, .3);
  --d-warn: #fcd34d;
  --d-warn-soft: rgba(245, 158, 11, .14);
  --d-warn-line: rgba(245, 158, 11, .3);
  --d-info: #93c5fd;
  --d-info-soft: rgba(59, 130, 246, .15);
  --d-shadow-1: 0 1px 2px rgba(0, 0, 0, .25);
  --d-shadow-2: 0 12px 30px rgba(0, 0, 0, .3);
  --d-shadow-3: 0 24px 60px rgba(0, 0, 0, .45);
  --d-sidebar-line: rgba(255, 255, 255, .07);
  --d-sidebar-hover: rgba(255, 255, 255, .06);

  /* D2 Midnight Blue (default night palette) */
  --d-ink: #e2e8f0;
  --d-ink-soft: #cbd5e1;
  --d-muted: #94a3b8;
  --d-muted-soft: #7c8aa0;
  --d-line: #1e293b;
  --d-line-soft: #172136;
  --d-surface: #111a2e;
  --d-surface-2: #0b1220;
  --d-surface-3: #17223a;
  --d-field-bg: #0e1628;
  --d-primary: #3b82f6;
  --d-primary-strong: #93c5fd;
  --d-primary-2: #60a5fa;
  --d-primary-soft: rgba(59, 130, 246, .16);
  --d-primary-ink: #ffffff;
  --d-ring: rgba(59, 130, 246, .32);
  --d-glow: rgba(59, 130, 246, .12);
  --d-topbar-bg: rgba(17, 26, 46, .92);
  --d-sidebar-bg: #070c17;
  --d-sidebar-ink: #e2e8f0;
  --d-sidebar-muted: #7c8aa0;
  --d-sidebar-active-bg: rgba(59, 130, 246, .18);
  --d-sidebar-active-ink: #93c5fd;
  --d-sidebar-accent: #3b82f6;
}

/* ---- DARK · D4 Nordic Frost ---- */
:root[data-theme="dark"][data-palette="nordic"] {
  --d-ink: #eceff4;
  --d-ink-soft: #d8dee9;
  --d-muted: #a3adbf;
  --d-muted-soft: #8b95a8;
  --d-line: #4c566a;
  --d-line-soft: #434c5e;
  --d-surface: #3b4252;
  --d-surface-2: #2e3440;
  --d-surface-3: #434c5e;
  --d-field-bg: #353c4a;
  --d-primary: #88c0d0;
  --d-primary-strong: #8fbcbb;
  --d-primary-2: #8fbcbb;
  --d-primary-soft: rgba(136, 192, 208, .16);
  --d-primary-ink: #2e3440;
  --d-ring: rgba(136, 192, 208, .32);
  --d-glow: rgba(136, 192, 208, .1);
  --d-topbar-bg: rgba(59, 66, 82, .94);
  --d-danger: #e0868e;
  --d-success: #a3be8c;
  --d-warn: #ebcb8b;
  --d-info: #81a1c1;
  --d-sidebar-bg: #242933;
  --d-sidebar-ink: #eceff4;
  --d-sidebar-muted: #8b95a8;
  --d-sidebar-active-bg: rgba(136, 192, 208, .16);
  --d-sidebar-active-ink: #88c0d0;
  --d-sidebar-accent: #88c0d0;
}

/* ---- DARK · D7 Amber Espresso ---- */
:root[data-theme="dark"][data-palette="amber"] {
  --d-ink: #f3eadf;
  --d-ink-soft: #ddcfbf;
  --d-muted: #b5a594;
  --d-muted-soft: #94857a;
  --d-line: #362b20;
  --d-line-soft: #2b2219;
  --d-surface: #211a13;
  --d-surface-2: #17120d;
  --d-surface-3: #2a2119;
  --d-field-bg: #1c1610;
  --d-primary: #f59e0b;
  --d-primary-strong: #fbbf24;
  --d-primary-2: #fbbf24;
  --d-primary-soft: rgba(245, 158, 11, .14);
  --d-primary-ink: #17120d;
  --d-ring: rgba(245, 158, 11, .32);
  --d-glow: rgba(245, 158, 11, .09);
  --d-topbar-bg: rgba(33, 26, 19, .94);
  --d-sidebar-bg: #0f0b08;
  --d-sidebar-ink: #f3eadf;
  --d-sidebar-muted: #94857a;
  --d-sidebar-active-bg: rgba(245, 158, 11, .15);
  --d-sidebar-active-ink: #fcd34d;
  --d-sidebar-accent: #f59e0b;
}

/* ---- DARK · D8 Dracula ---- */
:root[data-theme="dark"][data-palette="dracula"] {
  --d-ink: #f8f8f2;
  --d-ink-soft: #e2e2dc;
  --d-muted: #a0a4c0;
  --d-muted-soft: #8589a6;
  --d-line: #3a3c4e;
  --d-line-soft: #313342;
  --d-surface: #282a36;
  --d-surface-2: #1e1f29;
  --d-surface-3: #303241;
  --d-field-bg: #232530;
  --d-primary: #bd93f9;
  --d-primary-strong: #d6bcfa;
  --d-primary-2: #ff79c6;
  --d-primary-soft: rgba(189, 147, 249, .15);
  --d-primary-ink: #1e1f29;
  --d-ring: rgba(189, 147, 249, .32);
  --d-glow: rgba(189, 147, 249, .1);
  --d-topbar-bg: rgba(40, 42, 54, .94);
  --d-danger: #ff6e6e;
  --d-success: #50fa7b;
  --d-warn: #f1fa8c;
  --d-info: #8be9fd;
  --d-sidebar-bg: #191a21;
  --d-sidebar-ink: #f8f8f2;
  --d-sidebar-muted: #8589a6;
  --d-sidebar-active-bg: rgba(189, 147, 249, .16);
  --d-sidebar-active-ink: #d6bcfa;
  --d-sidebar-accent: #bd93f9;
}

/* ---- DARK · D9 Steel Slate ---- */
:root[data-theme="dark"][data-palette="steel"] {
  --d-ink: #e6ebef;
  --d-ink-soft: #c9d2d9;
  --d-muted: #98a4ae;
  --d-muted-soft: #7d8993;
  --d-line: #2a333b;
  --d-line-soft: #222a31;
  --d-surface: #1a2025;
  --d-surface-2: #121619;
  --d-surface-3: #212930;
  --d-field-bg: #161b1f;
  --d-primary: #38bdf8;
  --d-primary-strong: #7dd3fc;
  --d-primary-2: #7dd3fc;
  --d-primary-soft: rgba(56, 189, 248, .14);
  --d-primary-ink: #082f49;
  --d-ring: rgba(56, 189, 248, .32);
  --d-glow: rgba(56, 189, 248, .09);
  --d-topbar-bg: rgba(26, 32, 37, .94);
  --d-sidebar-bg: #0c0f12;
  --d-sidebar-ink: #e6ebef;
  --d-sidebar-muted: #7d8993;
  --d-sidebar-active-bg: rgba(56, 189, 248, .14);
  --d-sidebar-active-ink: #7dd3fc;
  --d-sidebar-accent: #38bdf8;
}

/* ==========================================================================
   BRIDGES — feed the active palette into the admin console and the workspace
   login/selection stylesheets so the whole platform follows one theme.
   ========================================================================== */
:root[data-theme] {
  /* Admin console (public/css/admin.css) */
  --bg-page: var(--d-surface-2);
  --bg-canvas: var(--d-surface-3);
  --surface-hover: var(--d-surface-2);
  --surface-active: var(--d-surface-3);
  --surface-alt: var(--d-surface-2);
  --surface-muted: var(--d-surface-3);
  --surface-glass: color-mix(in srgb, var(--d-surface) 94%, transparent);
  --sidebar-bg: var(--d-sidebar-bg);
  --sidebar-surface: color-mix(in srgb, var(--d-sidebar-bg) 92%, #ffffff);
  --sidebar-border: var(--d-sidebar-line);
  --sidebar-text: var(--d-sidebar-muted);
  --sidebar-text-strong: var(--d-sidebar-ink);
  --sidebar-active-bg: var(--d-sidebar-active-bg);
  --sidebar-active-border: var(--d-sidebar-accent);
  --border: var(--d-line);
  --border-light: var(--d-line-soft);
  --border-subtle: var(--d-line-soft);
  --border-focus: var(--d-primary);
  --border-hover: color-mix(in srgb, var(--d-primary) 35%, var(--d-line));
  --text-main: var(--d-ink);
  --text-body: var(--d-ink-soft);
  --text-muted: var(--d-muted);
  --text-subtle: var(--d-muted-soft);
  --primary-hover: var(--d-primary-strong);
  --primary-active: var(--d-primary-strong);
  --primary-light: var(--d-primary-soft);
  --primary-border: color-mix(in srgb, var(--d-primary) 30%, var(--d-line));
  --primary-glow: var(--d-ring);
  --primary-text: var(--d-primary-ink);
  --emerald: var(--d-success);
  --emerald-bg: var(--d-success-soft);
  --emerald-text: var(--d-success);
  --emerald-border: color-mix(in srgb, var(--d-success) 30%, var(--d-line));
  --amber: var(--d-warn);
  --amber-bg: var(--d-warn-soft);
  --amber-text: var(--d-warn);
  --amber-border: color-mix(in srgb, var(--d-warn) 30%, var(--d-line));
  --rose: var(--d-danger);
  --rose-bg: var(--d-danger-soft);
  --rose-text: var(--d-danger);
  --rose-border: color-mix(in srgb, var(--d-danger) 30%, var(--d-line));
  --sky: var(--d-info);
  --sky-bg: var(--d-info-soft);
  --sky-text: var(--d-info);
  --sky-border: color-mix(in srgb, var(--d-info) 30%, var(--d-line));

  /* Workspace login and console (workspace-login.css, console.css, workspace-console.css) */
  --surface: var(--d-surface);
  --primary: var(--d-primary);
  --page: var(--d-surface-2);
  --surface-2: var(--d-surface-2);
  --surface-3: var(--d-surface-3);
  --field-bg: var(--d-field-bg);
  --ink: var(--d-ink);
  --ink-soft: var(--d-ink-soft);
  --muted: var(--d-muted);
  --muted-soft: var(--d-muted-soft);
  --line: var(--d-line);
  --line-soft: var(--d-line-soft);
  --line-strong: color-mix(in srgb, var(--d-ink) 18%, var(--d-line));
  --primary-strong: var(--d-primary-strong);
  --primary-2: var(--d-primary-2);
  --primary-ink: var(--d-primary-ink);
  --primary-soft: var(--d-primary-soft);
  --ring: var(--d-ring);
  --navy-1: var(--d-sidebar-bg);
  --navy-2: color-mix(in srgb, var(--d-sidebar-bg) 88%, #ffffff);
  --navy-3: color-mix(in srgb, var(--d-sidebar-bg) 78%, #ffffff);
  --navy: var(--d-sidebar-bg);
  --navy2: color-mix(in srgb, var(--d-sidebar-bg) 88%, #ffffff);
  --teal: var(--d-primary);
  --teal-bg: var(--d-primary-soft);
  --card: var(--d-surface);
}

/* ---- THEME PICKER ---- */
.d-theme-picker { position: relative; }
.d-theme-picker > .d-theme-toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 0; border: 1px solid var(--d-line); border-radius: 11px; background: var(--d-surface); color: var(--d-ink-soft); cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.d-theme-picker > .d-theme-toggle:hover { border-color: var(--d-primary); background: var(--d-primary-soft); }
.d-theme-picker > .d-theme-toggle:focus-visible, .d-theme-menu button:focus-visible { outline: 2px solid var(--d-primary); outline-offset: 2px; }
.d-theme-swatch-dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(var(--d-primary) 0 50%, var(--d-sidebar-bg) 0); box-shadow: 0 0 0 2px var(--d-surface), 0 0 0 3px var(--d-line); }
.d-theme-menu {
  position: absolute;
  direction: rtl;
  text-align: start;
  font-family: var(--d-font, 'IBM Plex Sans Arabic', Tahoma, sans-serif);
  inset-inline-end: 0;
  top: calc(100% + 10px);
  z-index: 60;
  width: min(340px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--d-line);
  border-radius: 18px;
  background: var(--d-surface);
  box-shadow: var(--d-shadow-3);
  color: var(--d-ink);
}
.d-theme-menu[hidden] { display: none; }
.d-theme-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--d-surface-2); border: 1px solid var(--d-line-soft); }
.d-theme-mode button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--d-muted); font: 700 12px var(--d-font, inherit); cursor: pointer; }
.d-theme-mode button svg { width: 16px; height: 16px; }
.d-theme-mode button[aria-pressed="true"] { color: var(--d-ink); background: var(--d-surface); box-shadow: var(--d-shadow-1); }
.d-theme-group { margin-top: 14px; }
.d-theme-group h3 { margin: 0 0 8px; font-size: 11px; font-weight: 800; color: var(--d-muted); }
.d-theme-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.d-theme-option { display: grid; gap: 7px; padding: 7px; border: 1px solid var(--d-line); border-radius: 12px; background: var(--d-surface); color: var(--d-ink); font: 700 11.5px var(--d-font, inherit); text-align: start; cursor: pointer; transition: border-color .2s ease, transform .2s ease; }
.d-theme-option:hover { border-color: var(--d-primary); transform: translateY(-1px); }
.d-theme-option[aria-pressed="true"] { border-color: var(--d-primary); box-shadow: 0 0 0 2px var(--d-ring); }
.d-theme-preview { display: flex; height: 44px; overflow: hidden; border-radius: 8px; background: var(--p-bg); }
.d-theme-preview i { width: 26%; background: var(--p-side); }
.d-theme-preview span { flex: 1; display: grid; align-content: center; gap: 4px; padding: 6px; }
.d-theme-preview b { display: block; height: 5px; width: 70%; border-radius: 3px; background: var(--p-primary); }
.d-theme-preview em { display: block; height: 12px; border-radius: 4px; background: var(--p-surface); }
.d-theme-option-name { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.d-theme-option-name svg { width: 14px; height: 14px; color: var(--d-primary); opacity: 0; }
.d-theme-option[aria-pressed="true"] .d-theme-option-name svg { opacity: 1; }

/* Floating corner placement for standalone pages (login, project and organization selection). */
.d-theme-picker--floating { position: fixed; top: 16px; inset-inline-start: 16px; z-index: 60; }
.d-theme-picker--floating .d-theme-menu { inset-inline-end: auto; inset-inline-start: 0; }
:root[data-theme="dark"] { --primary-hover: var(--d-primary-2); }

/* ---- LIVE NAVIGATION (public/js/live-navigation.js) ---- */
.live-progress { position: fixed; inset-inline: 0; top: 0; z-index: 2000; height: 3px; background: var(--d-primary); transform: scaleX(0); transform-origin: right; opacity: 0; pointer-events: none; transition: transform .6s cubic-bezier(.16, 1, .3, 1), opacity .3s ease; }
html[dir="ltr"] .live-progress { transform-origin: left; }
.live-progress.is-active { opacity: 1; transform: scaleX(.85); transition: transform 2.5s cubic-bezier(.16, 1, .3, 1), opacity .1s ease; }
[data-live-region].is-live-loading [data-live-target], [data-live-region].is-live-loading:not(:has([data-live-target])) { opacity: .55; pointer-events: none; transition: opacity .15s ease; }
@media (prefers-reduced-motion: reduce) { .live-progress, .live-progress.is-active { transition: none; } }
.live-notice, .live-updated { position: fixed; z-index: 1900; inset-inline-start: 50%; bottom: 22px; transform: translateX(50%); padding: 10px 18px; border-radius: 999px; font: 700 12.5px var(--d-font, inherit); box-shadow: var(--d-shadow-3); }
html[dir="ltr"] .live-notice, html[dir="ltr"] .live-updated { transform: translateX(-50%); }
.live-notice { border: 0; background: var(--d-primary); color: var(--d-primary-ink); cursor: pointer; }
.live-notice[hidden] { display: none; }
.live-updated { border: 1px solid var(--d-line); background: var(--d-surface); color: var(--d-success); pointer-events: none; animation: live-updated 2.2s ease forwards; }
@keyframes live-updated { 0% { opacity: 0; } 12%, 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live-updated { animation: none; } }
