/*! Gigant UI 0.1.0 — built 2026-10-31T18:48Z */

/* ---- css/tokens/gigant.css ---- */
/*
 * Gigant UI — "Gigant" theme tokens.
 *
 * Two tiers, the same structure as the Gigant Fluent file:
 *   1. Palette (--gg-*): the only place a colour literal appears. Neutrals are named by HSL
 *      lightness like Fluent's grey ramp (--gg-cool-94 is ~94% light); the brand ramp is ordinal
 *      10 (darkest) … 160 (lightest) like Fluent's brand ramp, with 80 the brand colour; status
 *      ramps are Tailwind's (green, amber, red, sky) with Tailwind step numbers.
 *   2. Semantic (--g-*): what components use. Each one references the palette.
 * tools/tokens-check.js enforces both tiers and every contrast pair below.
 *
 * Built on the Tailwind CSS design scale (palette, 4px spacing, shadows) as custom properties, so no
 * Tailwind build step or runtime is needed. Keeps the Gigant look: #eceef2 page, white 16px-radius
 * surfaces with a hairline border, the #35C2DA accent, 38px controls (32 compact, 44 comfortable), 10px fields,
 * pill buttons.
 *
 * Contrast (WCAG 2.1 AA, checked by tools/tokens-check.js):
 *   - #35C2DA on white is 2:1: never text, never the only signal. Filled accent controls carry dark
 *     text (8.4:1); accent text is brand-40 #0e7490 (5.4:1).
 *   - Field and checkbox outlines are cool-55 #808997: 3.5:1 on white, 3:1 on the page. (The old
 *     Gigant #969FAD was 2.7:1 / 2.3:1 and failed WCAG 1.4.11.)
 *   - Muted text is cool-42 #616977: 4.8:1 on the page (the old #6b7280 was 4.2:1 there).
 *
 * Activate with  <html data-gui-theme="gigant" data-gui-mode="light|dark" data-gui-density="compact|standard|comfortable">.
 */
:root,
[data-gui-theme="gigant"] {
  /* ================================================================ palette */
  --gg-white: #ffffff;
  --gg-black: #000000;

  /* cool grey (light mode), Tailwind "gray" + the Gigant page, hairline and outline steps */
  --gg-cool-98: #f9fafb;
  --gg-cool-96: #f3f4f6;
  --gg-cool-94: #eceef2;   /* Gigant page */
  --gg-cool-91: #e5e7eb;
  --gg-cool-90: #e1e4e9;   /* Gigant hairline */
  --gg-cool-84: #d1d5db;
  --gg-cool-80: #c4c9d2;
  --gg-cool-65: #9ca3af;
  --gg-cool-55: #808997;   /* field outline */
  --gg-cool-46: #6b7280;
  --gg-cool-42: #616977;   /* muted text */
  --gg-cool-34: #4b5563;
  --gg-cool-27: #374151;
  --gg-cool-17: #1f2937;
  --gg-cool-11: #111827;

  /* neutral grey (dark mode), Tailwind "neutral" + the Gigant dark surface steps */
  --gg-neutral-96: #f5f5f5;
  --gg-neutral-83: #d4d4d4;
  --gg-neutral-64: #a3a3a3;
  --gg-neutral-45: #737373;
  --gg-neutral-42: #6b6b6b;
  --gg-neutral-29: #4a4a4a;
  --gg-neutral-23: #3a3a3a;
  --gg-neutral-20: #333333;
  --gg-neutral-18: #2d2d2d;
  --gg-neutral-16: #2a2a2a;
  --gg-neutral-15: #262626;
  --gg-neutral-12: #1f1f1f;
  --gg-neutral-8: #141414;

  /* brand cyan around #35C2DA */
  --gg-brand-10: #10353c;
  --gg-brand-20: #164a54;
  --gg-brand-30: #155e75;
  --gg-brand-40: #0e7490;  /* accent text */
  --gg-brand-50: #0e8ea3;  /* focus */
  --gg-brand-60: #22a2b4;  /* pressed */
  --gg-brand-70: #2db3c1;  /* hover */
  --gg-brand-80: #35c2da;  /* brand */
  --gg-brand-100: #5ccfe2;
  --gg-brand-110: #7fdae9;
  --gg-brand-140: #cdeff5;
  --gg-brand-150: #e6f7fa;

  /* status (Tailwind) */
  --gg-green-50: #f0fdf4;  --gg-green-400: #4ade80; --gg-green-700: #15803d; --gg-green-950: #052e16;
  --gg-amber-50: #fffbeb;  --gg-amber-400: #fbbf24; --gg-amber-500: #f59e0b; --gg-amber-700: #b45309; --gg-amber-950: #451a03;
  --gg-red-50: #fef2f2;    --gg-red-400: #f87171;   --gg-red-600: #dc2626;   --gg-red-700: #b91c1c;   --gg-red-950: #450a0a;
  --gg-sky-50: #f0f9ff;    --gg-sky-400: #38bdf8;   --gg-sky-700: #0369a1;   --gg-sky-950: #082f49;

  /* ================================================================ type */
  --g-font: "Inter", "IBM Plex Sans Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --g-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --g-fs-2xs: 0.6875rem; /* 11 — badges, axis ticks, counters */
  --g-fs-xs: 0.75rem;    /* 12 */
  --g-fs-sm: 0.8125rem;  /* 13 */
  --g-fs-md: 0.875rem;   /* 14 — body / controls */
  --g-fs-lg: 1rem;       /* 16 */
  --g-fs-xl: 1.125rem;   /* 18 */
  --g-fs-2xl: 1.375rem;  /* 22 */
  --g-fw-regular: 400; --g-fw-medium: 500; --g-fw-semibold: 600; --g-fw-bold: 700;
  --g-lh: 1.45;
  --g-lh-tight: 1.2;

  /* ================================================================ spacing (Tailwind 4px scale; theme-independent) */
  /* Density scales the whole ramp (compact 0.75x, comfortable 1.25x: the blocks at the end of this file).
     --g-space-scale is the same factor for page CSS whose values sit off the ramp: calc(10px * var(--g-space-scale)). */
  --g-space-0: 0; --g-space-1: 4px; --g-space-2: 8px; --g-space-3: 12px; --g-space-4: 16px;
  --g-space-5: 20px; --g-space-6: 24px; --g-space-8: 32px; --g-space-10: 40px;
  --g-space-scale: 1;

  /* ================================================================ shape */
  --g-radius-2xs: 2px;     /* hairline marks: legend swatches, progress bars, splitter grips */
  --g-radius-xs: 4px;
  --g-radius-sm: 6px;
  --g-radius-md: 10px;
  --g-radius-lg: 12px;
  --g-radius-xl: 16px;
  --g-radius-pill: 999px;
  --g-control-radius: 10px;   /* text fields, selects, pickers */
  --g-button-radius: 999px;   /* pill buttons — the Gigant signature */
  --g-surface-radius: 16px;   /* cards, dialogs, sidebar, appbar */
  --g-popup-radius: 12px;

  /* ================================================================ sizing (density: see the blocks at the end) */
  --g-control-h: 38px;
  --g-control-h-sm: 32px;
  --g-control-h-lg: 44px;
  --g-row-h: 40px;            /* grid / list row */
  --g-row-h-compact: 32px;
  --g-icon-size: 16px;        /* glyphs keep their size in every density */
  --g-border-w: 1px;
  --g-check-size: 18px;       /* checkbox / radio box */
  --g-check-radius: 5px;
  --g-input-btn: 28px;        /* icon button inside a field (clear, arrow, calendar, spin) and other inline icon buttons */
  --g-input-btn-sm: 24px;     /* the same in a small field */
  --g-icon-btn: 24px;         /* the smallest icon-only buttons: close, remove, clear, header menu */
  --g-target-min: 24px;       /* WCAG 2.5.8 minimum pointer target: check / radio / switch labels */
  --g-switch-w: 40px;
  --g-switch-h: 22px;
  --g-header-h: 56px;         /* dialog / drawer header */
  --g-card-header-h: 48px;

  /* ================================================================ elevation (Tailwind shadows) */
  --g-shadow-1: 0 1px 3px rgba(16, 24, 40, .06);
  --g-shadow-2: 0 1px 3px rgba(0, 0, 0, .10), 0 1px 2px -1px rgba(0, 0, 0, .10);
  --g-shadow-3: 0 10px 15px -3px rgba(0, 0, 0, .10), 0 4px 6px -4px rgba(0, 0, 0, .10);
  --g-shadow-4: 0 20px 25px -5px rgba(0, 0, 0, .12), 0 8px 10px -6px rgba(0, 0, 0, .10);
  /* the shell (sidebar, top bar, the collapsed menu's peek): both themes use THESE soft Gigant shadows */
  --g-shadow-shell: 0 1px 3px rgba(16, 24, 40, .06);
  --g-shadow-shell-raised: 0 20px 25px -5px rgba(0, 0, 0, .12), 0 8px 10px -6px rgba(0, 0, 0, .10);

  /* ================================================================ layers (theme-independent) */
  --g-z-sticky: 10;
  --g-z-sidebar: 900;
  --g-z-dropdown: 1100;
  --g-z-dialog: 1200;
  --g-z-popover-over-dialog: 1300;
  --g-z-toast: 1400;
  --g-z-tooltip: 1500;

  /* ================================================================ motion */
  --g-dur-fast: 120ms;
  --g-dur: 200ms;
  --g-dur-slow: 320ms;
  --g-ease: cubic-bezier(.2, 0, 0, 1);

  /* ================================================================ colour: light */
  --g-bg: var(--gg-cool-94);
  --g-surface: var(--gg-white);
  --g-surface-2: var(--gg-cool-98);       /* subtle fill: headers, zebra, read-only */
  --g-surface-3: var(--gg-cool-96);       /* hover */
  --g-surface-4: var(--gg-cool-91);       /* pressed */
  --g-surface-raised: var(--gg-white);    /* popups, menus */
  --g-border: var(--gg-cool-90);          /* hairline: surfaces, rows */
  --g-border-input: var(--gg-cool-55);    /* field / checkbox outline (>= 3:1) */
  --g-border-strong: var(--gg-cool-34);
  --g-text: var(--gg-cool-11);
  --g-text-2: var(--gg-cool-27);
  --g-text-3: var(--gg-cool-42);          /* muted / placeholder */
  --g-text-disabled: var(--gg-cool-65);
  /* Primary fills (Imad, 2026-10-29): a cyan one step darker than the logo (#35c2da) with WHITE text. Dark text on
     the bright cyan read as a contrast problem; deep teal (#0e7490, #118295) passed 4.5:1 but was too far from the
     brand. brand-60 + white = 3.05:1: WCAG's 3:1 for large text / UI components, below 4.5:1 for body text (an
     accepted brand decision; tools/tokens-check.js holds this theme's primary to 3:1). Hover / pressed go darker
     (3.9:1, 5.4:1). The menu's current page is a light tint (--g-shell-nav-active-*). */
  --g-text-on-accent: var(--gg-white);
  --g-accent: var(--gg-brand-60);
  --g-accent-hover: var(--gg-brand-50);
  --g-accent-active: var(--gg-brand-40);
  --g-accent-subtle: var(--gg-brand-150); /* selected rows, active nav */
  --g-accent-subtle-2: var(--gg-brand-140);
  --g-accent-text: var(--gg-brand-40);    /* links, accent text, outlined-button text */
  --g-focus: var(--gg-brand-50);
  --g-focus-ring: 0 0 0 2px var(--g-surface), 0 0 0 4px var(--g-focus);
  --g-focus-ring-inset: inset 0 0 0 2px var(--g-focus);
  --g-check-bg: var(--gg-brand-40);       /* checked checkbox / radio / switch */
  --g-check-fg: var(--gg-white);          /* checkmark, switch knob when on */

  --g-success: var(--gg-green-700); --g-success-subtle: var(--gg-green-50); --g-success-text: var(--gg-green-700);
  --g-warning: var(--gg-amber-500); --g-warning-subtle: var(--gg-amber-50); --g-warning-text: var(--gg-amber-700);
  --g-danger:  var(--gg-red-600);   --g-danger-subtle:  var(--gg-red-50);   --g-danger-text:  var(--gg-red-700);
  --g-info:    var(--gg-sky-700);   --g-info-subtle:    var(--gg-sky-50);   --g-info-text:    var(--gg-sky-700);
  --g-on-solid: var(--gg-white);          /* text on success / danger / info solids */
  --g-on-warning: var(--gg-amber-950);    /* text on the warning solid */

  --g-overlay: rgba(15, 23, 42, .45);
  --g-row-hover: var(--gg-cool-96);
  --g-row-selected: var(--gg-brand-150);
  --g-row-stripe: var(--gg-cool-98);
  --g-scrollbar: var(--gg-cool-80);

  /* shell (sidebar + navbar) */
  --g-shell-sidebar-w: 268px;
  --g-shell-sidebar-w-collapsed: 72px;
  --g-shell-appbar-h: 60px;
  --g-shell-gutter: 16px;
  --g-shell-brand-h: 56px;
  --g-shell-nav-item-h: 40px;
  --g-shell-nav-subitem-h: 34px;
  --g-shell-avatar: 30px;
  /* the menu's current page: a light cyan tint with deep-teal text, as Gigant Fluent does with its blue (Imad, 2026-10-29) */
  --g-shell-nav-active-bg: var(--gg-brand-150);
  --g-shell-nav-active-text: var(--gg-brand-30);
  --g-shell-nav-hover: var(--gg-cool-96);

  color-scheme: light;
}

[data-gui-theme="gigant"][data-gui-mode="dark"],
:root[data-gui-mode="dark"]:not([data-gui-theme]) {
  --g-bg: var(--gg-neutral-8);
  --g-surface: var(--gg-neutral-12);
  --g-surface-2: var(--gg-neutral-15);
  --g-surface-3: var(--gg-neutral-18);
  --g-surface-4: var(--gg-neutral-23);
  --g-surface-raised: var(--gg-neutral-16);
  --g-border: var(--gg-neutral-20);
  --g-border-input: var(--gg-neutral-45);
  --g-border-strong: var(--gg-neutral-64);
  --g-text: var(--gg-neutral-96);
  --g-text-2: var(--gg-neutral-83);
  --g-text-3: var(--gg-neutral-64);
  --g-text-disabled: var(--gg-neutral-42);
  --g-text-on-accent: var(--gg-cool-11);
  --g-accent: var(--gg-brand-80);
  --g-accent-hover: var(--gg-brand-100);
  --g-accent-active: var(--gg-brand-110);
  --g-accent-subtle: var(--gg-brand-10);
  --g-accent-subtle-2: var(--gg-brand-20);
  --g-accent-text: var(--gg-brand-100);
  --g-focus: var(--gg-brand-100);
  --g-check-bg: var(--gg-brand-100);
  --g-check-fg: var(--gg-cool-11);
  --g-success: var(--gg-green-700); --g-success-subtle: var(--gg-green-950); --g-success-text: var(--gg-green-400);
  --g-warning: var(--gg-amber-500); --g-warning-subtle: var(--gg-amber-950); --g-warning-text: var(--gg-amber-400);
  --g-danger:  var(--gg-red-600);   --g-danger-subtle:  var(--gg-red-950);   --g-danger-text:  var(--gg-red-400);
  --g-info:    var(--gg-sky-700);   --g-info-subtle:    var(--gg-sky-950);   --g-info-text:    var(--gg-sky-400);
  --g-on-solid: var(--gg-white);
  --g-on-warning: var(--gg-amber-950);
  --g-overlay: rgba(0, 0, 0, .6);
  --g-row-hover: var(--gg-neutral-16);
  --g-row-selected: var(--gg-brand-10);
  --g-row-stripe: var(--gg-neutral-15);
  --g-scrollbar: var(--gg-neutral-29);
  --g-shadow-1: 0 1px 3px rgba(0, 0, 0, .5);
  --g-shadow-2: 0 1px 3px rgba(0, 0, 0, .5), 0 1px 2px -1px rgba(0, 0, 0, .5);
  --g-shadow-3: 0 10px 15px -3px rgba(0, 0, 0, .55), 0 4px 6px -4px rgba(0, 0, 0, .5);
  --g-shadow-4: 0 20px 25px -5px rgba(0, 0, 0, .6), 0 8px 10px -6px rgba(0, 0, 0, .5);
  --g-shadow-shell: 0 1px 3px rgba(0, 0, 0, .5);
  --g-shadow-shell-raised: 0 20px 25px -5px rgba(0, 0, 0, .6), 0 8px 10px -6px rgba(0, 0, 0, .5);
  --g-shell-nav-active-bg: var(--gg-brand-10);
  --g-shell-nav-active-text: var(--gg-brand-110);
  --g-shell-nav-hover: var(--gg-neutral-18);
  color-scheme: dark;
}

/* ================================================================ density
 * <html data-gui-density="compact|standard|comfortable"> (GUI.density.set). Standard is the blocks above: no
 * selector, so a page without the attribute looks exactly as before. Only SIZE tokens change — control and row
 * heights, inline buttons, the spacing ramp (paddings, gaps, margins), the shell's bars — never the font sizes,
 * radii or colours, and every pointer target stays >= 24px (WCAG 2.5.8; tools/tokens-check.js asserts it).
 * Compact is the density of SAP Fiori compact / Dynamics 365 compact, for mouse-driven data entry; comfortable is
 * for touch. These blocks also carry the theme-independent spacing ramp, so they apply under Gigant Fluent too;
 * gigant-fluent.css re-declares its own control sizes in [data-gui-theme="gigant-fluent"][data-gui-density=…].
 * Put data-gui-density on the same element as data-gui-theme (the <html>).
 */
[data-gui-density="compact"] {
  --g-space-1: 3px; --g-space-2: 6px; --g-space-3: 9px; --g-space-4: 12px;
  --g-space-5: 15px; --g-space-6: 18px; --g-space-8: 24px; --g-space-10: 30px;
  --g-space-scale: .75;
  --g-control-h: 32px;
  --g-control-h-sm: 26px;
  --g-control-h-lg: 38px;
  --g-row-h: 32px;
  --g-row-h-compact: 28px;
  --g-check-size: 16px;
  --g-input-btn: 26px;
  --g-input-btn-sm: 24px;
  --g-icon-btn: 24px;
  --g-target-min: 24px;
  --g-switch-w: 36px;
  --g-switch-h: 20px;
  --g-header-h: 48px;
  --g-card-header-h: 40px;
  --g-shell-appbar-h: 52px;
  --g-shell-gutter: 12px;
  --g-shell-brand-h: 48px;
  --g-shell-nav-item-h: 34px;
  --g-shell-nav-subitem-h: 30px;
  --g-shell-avatar: 26px;
}
/* Gigant only (Imad, 2026-10-29): compact also tightens the corners in proportion to the smaller controls. Pills
   (--g-radius-pill, --g-button-radius: the Gigant pill button) stay pills; standard and comfortable keep the radii
   above; Gigant Fluent keeps its own 2/4/6/8 ramp in every density (this selector never matches it). */
[data-gui-theme="gigant"][data-gui-density="compact"],
:root[data-gui-density="compact"]:not([data-gui-theme]) {
  --g-radius-sm: 4px;
  --g-radius-md: 8px;
  --g-radius-lg: 10px;
  --g-radius-xl: 12px;
  --g-control-radius: 8px;
  --g-surface-radius: 12px;
  --g-popup-radius: 10px;
}
[data-gui-density="comfortable"] {
  --g-space-1: 5px; --g-space-2: 10px; --g-space-3: 15px; --g-space-4: 20px;
  --g-space-5: 25px; --g-space-6: 30px; --g-space-8: 40px; --g-space-10: 50px;
  --g-space-scale: 1.25;
  --g-control-h: 44px;
  --g-control-h-sm: 36px;
  --g-control-h-lg: 50px;
  --g-row-h: 48px;
  --g-row-h-compact: 40px;
  --g-check-size: 20px;
  --g-input-btn: 32px;
  --g-input-btn-sm: 28px;
  --g-icon-btn: 28px;
  --g-target-min: 32px;
  --g-switch-w: 44px;
  --g-switch-h: 24px;
  --g-header-h: 64px;
  --g-card-header-h: 56px;
  --g-shell-appbar-h: 68px;
  --g-shell-gutter: 20px;
  --g-shell-brand-h: 64px;
  --g-shell-nav-item-h: 46px;
  --g-shell-nav-subitem-h: 40px;
  --g-shell-avatar: 34px;
}

/* ---- css/tokens/gigant-fluent.css ---- */
/*
 * Gigant UI — "Gigant Fluent" theme tokens.
 *
 * Built on Microsoft's Fluent 2 design language. Two tiers, as in Fluent 2 itself (global tokens → alias tokens), and the same structure as the
 * Gigant file:
 *   1. Palette (--gf-*): Fluent's grey ramp (named by lightness: --gf-grey-96 = Fluent grey96), the
 *      web brand ramp (--gf-brand-10 … 160, 80 = #0F6CBD) and the shared status colours (named by
 *      Fluent's shade/tint positions). The only place a colour literal appears.
 *   2. Semantic (--g-*): Fluent alias tokens mapped onto the library's names, e.g.
 *      neutralBackground1 → --g-surface, brandForeground1 → --g-accent-text.
 * Radii follow Fluent's ramp (small 2, medium 4, large 6, xLarge 8); type follows the Fluent web
 * ramp (10, 12, 14, 16, 20, 24 — there is no 13px step in Fluent); controls are 32px (28 compact, 40 comfortable).
 *
 * Activate with  <html data-gui-theme="gigant-fluent" data-gui-mode="light|dark" data-gui-density="compact|standard|comfortable">.
 * Load AFTER gigant.css: that file's :root block carries the theme-independent tokens
 * (spacing, layers) and the defaults this file overrides.
 */
[data-gui-theme="gigant-fluent"] {
  /* ================================================================ palette */
  --gf-white: #ffffff;
  --gf-black: #000000;
  --gf-grey-98: #fafafa;
  --gf-grey-96: #f5f5f5;
  --gf-grey-88: #e0e0e0;
  --gf-grey-84: #d6d6d6;
  --gf-grey-78: #c7c7c7;
  --gf-grey-74: #bdbdbd;
  --gf-grey-68: #adadad;
  --gf-grey-54: #8a8a8a;
  --gf-grey-38: #616161;
  --gf-grey-36: #5c5c5c;
  --gf-grey-26: #424242;
  --gf-grey-24: #3d3d3d;
  --gf-grey-20: #333333;
  --gf-grey-18: #2e2e2e;
  --gf-grey-16: #292929;
  --gf-grey-14: #242424;
  --gf-grey-12: #1f1f1f;
  --gf-grey-8: #141414;

  --gf-brand-20: #082338;
  --gf-brand-40: #0c3b5e;
  --gf-brand-50: #0e4775;
  --gf-brand-70: #115ea3;
  --gf-brand-80: #0f6cbd;
  --gf-brand-100: #479ef5;
  --gf-brand-110: #62abf5;
  --gf-brand-150: #cfe4fa;
  --gf-brand-160: #ebf3fc;

  --gf-green-shade40: #052505;  --gf-green-shade10: #0e700e;  --gf-green-primary: #107c10;
  --gf-green-tint30: #54b054;   --gf-green-tint60: #f1faf1;
  --gf-orange-shade40: #411200; --gf-orange-shade30: #8a3707; --gf-orange-primary: #f7630c;
  --gf-orange-tint30: #faa06b;  --gf-orange-tint60: #fff9f5;
  --gf-red-shade40: #3b0509;    --gf-red-shade10: #b10e1c;    --gf-red-primary: #c50f1f;
  --gf-red-tint30: #dc626d;     --gf-red-tint20: #e37d80;     --gf-red-tint60: #fdf3f4;

  /* ================================================================ type */
  --g-font: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  --g-font-mono: "Cascadia Code", Consolas, ui-monospace, Menlo, monospace;
  --g-fs-2xs: 0.625rem;  /* caption2 10 */
  --g-fs-xs: 0.75rem;    /* caption1 12 */
  --g-fs-sm: 0.75rem;    /* caption1 12 — Fluent has no 13px step */
  --g-fs-md: 0.875rem;   /* body1 14 */
  --g-fs-lg: 1rem;       /* subtitle2 16 */
  --g-fs-xl: 1.25rem;    /* subtitle1 20 */
  --g-fs-2xl: 1.5rem;    /* title3 24 */
  --g-fw-regular: 400; --g-fw-medium: 500; --g-fw-semibold: 600; --g-fw-bold: 700;
  --g-lh: 1.43;
  --g-lh-tight: 1.2;

  /* ================================================================ shape (Fluent borderRadius ramp) */
  --g-radius-2xs: 2px;   /* small */
  --g-radius-xs: 2px;    /* small */
  --g-radius-sm: 4px;    /* medium */
  --g-radius-md: 4px;    /* medium */
  --g-radius-lg: 6px;    /* large */
  --g-radius-xl: 8px;    /* xLarge */
  --g-radius-pill: 999px;
  --g-control-radius: 4px;
  --g-button-radius: 4px;
  --g-surface-radius: 8px;  /* dialog, card: xLarge */
  --g-popup-radius: 4px;    /* menu, listbox, popover: medium */

  /* ================================================================ sizing */
  --g-control-h: 32px;
  --g-control-h-sm: 24px;
  --g-control-h-lg: 40px;
  --g-row-h: 36px;
  --g-row-h-compact: 28px;
  --g-check-size: 16px;
  --g-check-radius: 2px;

  /* ================================================================ elevation (shadow2/4/8/28) */
  /* Resting surfaces (cards, panels, figure cards; levels 1–2) use Gigant's soft shadows (Imad, 2026-10-29: Fluent's
     two-layer shadow2/shadow4 read thick on cards); floating layers (menus, dialogs: levels 3–4) keep Fluent's ramp. */
  --g-shadow-1: 0 1px 3px rgba(16, 24, 40, .06);
  --g-shadow-2: 0 1px 3px rgba(0, 0, 0, .10), 0 1px 2px -1px rgba(0, 0, 0, .10);
  --g-shadow-3: 0 0 2px rgba(0, 0, 0, .12), 0 8px 16px rgba(0, 0, 0, .14);
  --g-shadow-4: 0 0 8px rgba(0, 0, 0, .20), 0 14px 28px rgba(0, 0, 0, .24);
  /* Imad, 2026-10-29: the shell keeps Gigant's soft shadows here too (Fluent's two-layer ones read thick on the
     sidebar and top bar); menus, dialogs and cards keep Fluent's elevation ramp above. */
  --g-shadow-shell: 0 1px 3px rgba(16, 24, 40, .06);
  --g-shadow-shell-raised: 0 20px 25px -5px rgba(0, 0, 0, .12), 0 8px 10px -6px rgba(0, 0, 0, .10);

  /* ================================================================ motion */
  --g-dur-fast: 100ms;
  --g-dur: 200ms;
  --g-dur-slow: 300ms;
  --g-ease: cubic-bezier(.33, 0, .67, 1);

  /* ================================================================ colour: light */
  --g-bg: var(--gf-grey-96);              /* neutralBackground3 */
  --g-surface: var(--gf-white);           /* neutralBackground1 */
  --g-surface-2: var(--gf-grey-98);       /* neutralBackground2 */
  --g-surface-3: var(--gf-grey-96);       /* neutralBackground1Hover */
  --g-surface-4: var(--gf-grey-88);       /* neutralBackground1Pressed */
  --g-surface-raised: var(--gf-white);
  --g-border: var(--gf-grey-88);          /* neutralStroke2 */
  --g-border-input: var(--gf-grey-54);    /* neutralStrokeAccessible */
  --g-border-strong: var(--gf-grey-38);
  --g-text: var(--gf-grey-14);            /* neutralForeground1 */
  --g-text-2: var(--gf-grey-26);          /* neutralForeground2 */
  --g-text-3: var(--gf-grey-38);          /* neutralForeground3 */
  --g-text-disabled: var(--gf-grey-74);   /* neutralForegroundDisabled */
  --g-text-on-accent: var(--gf-white);    /* neutralForegroundOnBrand */
  --g-accent: var(--gf-brand-80);         /* brandBackground */
  --g-accent-hover: var(--gf-brand-70);   /* brandBackgroundHover */
  --g-accent-active: var(--gf-brand-40);  /* brandBackgroundPressed */
  --g-accent-subtle: var(--gf-brand-160); /* brandBackground2 */
  --g-accent-subtle-2: var(--gf-brand-150);
  --g-accent-text: var(--gf-brand-70);    /* brandForeground1 */
  --g-focus: var(--gf-black);             /* strokeFocus2 */
  --g-focus-ring: 0 0 0 1px var(--gf-white), 0 0 0 3px var(--gf-black);
  --g-focus-ring-inset: inset 0 0 0 2px var(--gf-black);
  --g-check-bg: var(--gf-brand-80);       /* compoundBrandBackground */
  --g-check-fg: var(--gf-white);

  --g-success: var(--gf-green-primary); --g-success-subtle: var(--gf-green-tint60);  --g-success-text: var(--gf-green-shade10);
  --g-warning: var(--gf-orange-primary); --g-warning-subtle: var(--gf-orange-tint60); --g-warning-text: var(--gf-orange-shade30);
  --g-danger:  var(--gf-red-primary);   --g-danger-subtle:  var(--gf-red-tint60);    --g-danger-text:  var(--gf-red-shade10);
  --g-info:    var(--gf-brand-80);      --g-info-subtle:    var(--gf-brand-160);     --g-info-text:    var(--gf-brand-70);
  --g-on-solid: var(--gf-white);
  --g-on-warning: var(--gf-grey-14);

  --g-overlay: rgba(0, 0, 0, .4);
  --g-row-hover: var(--gf-grey-96);
  --g-row-selected: var(--gf-brand-160);
  --g-row-stripe: var(--gf-grey-98);
  --g-scrollbar: var(--gf-grey-78);

  --g-shell-sidebar-w: 260px;
  --g-shell-sidebar-w-collapsed: 64px;
  --g-shell-appbar-h: 52px;
  --g-shell-gutter: 12px;
  --g-shell-nav-active-bg: var(--gf-brand-160);
  --g-shell-nav-active-text: var(--gf-brand-50);
  --g-shell-nav-hover: var(--gf-grey-96);

  color-scheme: light;
}

[data-gui-theme="gigant-fluent"][data-gui-mode="dark"] {
  --g-bg: var(--gf-grey-12);
  --g-surface: var(--gf-grey-16);
  --g-surface-2: var(--gf-grey-14);
  --g-surface-3: var(--gf-grey-24);
  --g-surface-4: var(--gf-grey-12);
  --g-surface-raised: var(--gf-grey-18);
  --g-border: var(--gf-grey-24);
  --g-border-input: var(--gf-grey-54);
  --g-border-strong: var(--gf-grey-68);
  --g-text: var(--gf-white);
  --g-text-2: var(--gf-grey-84);
  --g-text-3: var(--gf-grey-68);
  --g-text-disabled: var(--gf-grey-36);
  --g-text-on-accent: var(--gf-white);
  --g-accent: var(--gf-brand-70);
  --g-accent-hover: var(--gf-brand-80);
  --g-accent-active: var(--gf-brand-40);
  --g-accent-subtle: var(--gf-brand-20);
  --g-accent-subtle-2: var(--gf-brand-40);
  --g-accent-text: var(--gf-brand-100);
  --g-focus: var(--gf-white);
  --g-focus-ring: 0 0 0 1px var(--gf-black), 0 0 0 3px var(--gf-white);
  --g-focus-ring-inset: inset 0 0 0 2px var(--gf-white);
  --g-check-bg: var(--gf-brand-100);
  --g-check-fg: var(--gf-grey-8);
  --g-success: var(--gf-green-primary); --g-success-subtle: var(--gf-green-shade40);  --g-success-text: var(--gf-green-tint30);
  --g-warning: var(--gf-orange-tint30); --g-warning-subtle: var(--gf-orange-shade40); --g-warning-text: var(--gf-orange-tint30);
  --g-danger:  var(--gf-red-primary);   --g-danger-subtle:  var(--gf-red-shade40);    --g-danger-text:  var(--gf-red-tint20);
  --g-info:    var(--gf-brand-80);      --g-info-subtle:    var(--gf-brand-20);       --g-info-text:    var(--gf-brand-110);
  --g-on-solid: var(--gf-white);
  --g-on-warning: var(--gf-grey-14);
  --g-overlay: rgba(0, 0, 0, .5);
  --g-row-hover: var(--gf-grey-20);
  --g-row-selected: var(--gf-brand-20);
  --g-row-stripe: var(--gf-grey-18);
  --g-scrollbar: var(--gf-grey-36);
  --g-shadow-1: 0 1px 3px rgba(0, 0, 0, .5);
  --g-shadow-2: 0 1px 3px rgba(0, 0, 0, .5), 0 1px 2px -1px rgba(0, 0, 0, .5);
  --g-shadow-3: 0 0 2px rgba(0, 0, 0, .24), 0 8px 16px rgba(0, 0, 0, .28);
  --g-shadow-4: 0 0 8px rgba(0, 0, 0, .40), 0 14px 28px rgba(0, 0, 0, .48);
  --g-shadow-shell: 0 1px 3px rgba(0, 0, 0, .5);
  --g-shadow-shell-raised: 0 20px 25px -5px rgba(0, 0, 0, .6), 0 8px 10px -6px rgba(0, 0, 0, .5);
  --g-shell-nav-active-bg: var(--gf-brand-20);
  --g-shell-nav-active-text: var(--gf-brand-110);
  --g-shell-nav-hover: var(--gf-grey-20);
  color-scheme: dark;
}

/* ================================================================ density (see gigant.css for the rules)
 * The spacing ramp comes from gigant.css's density blocks; these re-declare Gigant Fluent's own sizes, which the
 * standard block above sets for this theme. Compact follows Microsoft Fluent 2's "small" control size (24px) one
 * step up for data entry (28px fields), comfortable its "large" (40px).
 */
[data-gui-theme="gigant-fluent"][data-gui-density="compact"] {
  --g-control-h: 28px;
  --g-control-h-sm: 24px;
  --g-control-h-lg: 32px;
  --g-row-h: 30px;
  --g-row-h-compact: 24px;
  --g-check-size: 16px;
  --g-input-btn: 24px;
  --g-input-btn-sm: 24px;
  --g-icon-btn: 24px;
  --g-target-min: 24px;
  --g-switch-w: 36px;
  --g-switch-h: 20px;
  --g-header-h: 48px;
  --g-card-header-h: 40px;
  --g-shell-appbar-h: 44px;
  --g-shell-gutter: 8px;
  --g-shell-brand-h: 48px;
  --g-shell-nav-item-h: 32px;
  --g-shell-nav-subitem-h: 28px;
  --g-shell-avatar: 26px;
}
[data-gui-theme="gigant-fluent"][data-gui-density="comfortable"] {
  --g-control-h: 40px;
  --g-control-h-sm: 32px;
  --g-control-h-lg: 48px;
  --g-row-h: 44px;
  --g-row-h-compact: 36px;
  --g-check-size: 20px;
  --g-input-btn: 32px;
  --g-input-btn-sm: 28px;
  --g-icon-btn: 28px;
  --g-target-min: 32px;
  --g-switch-w: 44px;
  --g-switch-h: 24px;
  --g-header-h: 64px;
  --g-card-header-h: 56px;
  --g-shell-appbar-h: 60px;
  --g-shell-gutter: 16px;
  --g-shell-brand-h: 64px;
  --g-shell-nav-item-h: 44px;
  --g-shell-nav-subitem-h: 38px;
  --g-shell-avatar: 34px;
}

/* ---- css/base.css ---- */
/*
 * Gigant UI — primitives shared by every component.
 *
 * Components build on these classes instead of restyling the same thing twice, so a field, a
 * popup list or a checkbox looks identical in a dropdown, a grid filter and a dialog.
 *
 *   .g-root            opt-in base typography for a region (the shell sets it on <body>)
 *   .g-field           label + control + hint/error column
 *   .g-input           the bordered control box (TextBox, Numeric, DropDown, pickers)
 *   .g-btn             buttons (+ --primary/--outline/--subtle/--danger/--success, --sm/--lg, --icon)
 *   .g-popup           floating surface (menus, dropdown lists, picker panels)
 *   .g-list/.g-option  listbox rows (dropdowns, menus, autocomplete, column chooser)
 *   .g-check           native checkbox / radio, styled (grid, tree, multiselect, CheckBox)
 *   .g-switch          native checkbox as a switch
 *   .g-chip, .g-badge, .g-spinner, .g-skeleton, .g-scrim, .g-visually-hidden, .g-icon
 *
 * State classes are shared: .is-open .is-active .is-selected .is-disabled .is-invalid
 * .is-readonly .is-focused .is-loading. Logical properties throughout, so RTL needs no overrides.
 */

/* ------------------------------------------------------------------ root */
.g-root,
.g-portal {
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  line-height: var(--g-lh);
  color: var(--g-text);
  -webkit-font-smoothing: antialiased;
}
.g-root *,
.g-root *::before,
.g-root *::after,
.g-portal *,
.g-portal *::before,
.g-portal *::after,
[class^="g-"],
[class*=" g-"] {
  box-sizing: border-box;
}
.g-portal { position: relative; z-index: var(--g-z-dropdown); }

.g-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.g-icon {
  display: inline-block;
  width: var(--g-icon-size);
  height: var(--g-icon-size);
  flex: none;
  vertical-align: -0.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
[dir="rtl"] .g-icon--flip-rtl { transform: scaleX(-1); }
/* icon-font icons passed through GUI.renderIcon (e.g. the app's gicon classes) */
.g-icon-font { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--g-icon-size); height: var(--g-icon-size); font-size: var(--g-icon-size); line-height: 1; }

/* Thin scrollbars inside components */
.g-scroll {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--g-scrollbar) transparent;
}
.g-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.g-scroll::-webkit-scrollbar-thumb {
  background: var(--g-scrollbar);
  border-radius: var(--g-radius-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}

/* ------------------------------------------------------------------ focus */
.g-focusable:focus { outline: none; }
.g-focusable:focus-visible,
.g-btn:focus-visible,
.g-check:focus-visible,
.g-switch:focus-visible,
.g-chip:focus-visible,
.g-option.is-focused,
.g-option:focus-visible {
  outline: none;
  box-shadow: var(--g-focus-ring);
}
/* Rows inside a list/grid: inset ring so it is not clipped by the scroller */
.g-option.is-focused,
.g-option:focus-visible { box-shadow: var(--g-focus-ring-inset); }

/* ------------------------------------------------------------------ field */
.g-field {
  display: flex;
  flex-direction: column;
  gap: var(--g-space-1);
  min-width: 0;
}
.g-field__label {
  font-size: var(--g-fs-sm);
  font-weight: var(--g-fw-medium);
  color: var(--g-text-2);
}
.g-field__label .g-required { color: var(--g-danger-text); margin-inline-start: 2px; }
.g-field__hint { font-size: var(--g-fs-xs); color: var(--g-text-3); }
.g-field__error { font-size: var(--g-fs-xs); color: var(--g-danger-text); display: flex; gap: 4px; align-items: center; }
.g-field__error:empty { display: none; }

/* ------------------------------------------------------------------ input box */
.g-input {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--g-space-1);
  width: 100%;
  min-width: 0;
  min-height: var(--g-control-h);
  padding-inline: var(--g-space-3) var(--g-space-1);
  background: var(--g-surface);
  border: var(--g-border-w) solid var(--g-border-input);
  border-radius: var(--g-control-radius);
  color: var(--g-text);
  font: inherit;
  font-size: var(--g-fs-md);
  transition: border-color var(--g-dur-fast) var(--g-ease), box-shadow var(--g-dur-fast) var(--g-ease);
}
.g-input:hover { border-color: var(--g-border-strong); }
.g-input.is-focused,
.g-input:focus-within {
  border-color: var(--g-focus);
  box-shadow: 0 0 0 1px var(--g-focus);
}
.g-input.is-invalid { border-color: var(--g-danger); }
.g-input.is-invalid.is-focused,
.g-input.is-invalid:focus-within { box-shadow: 0 0 0 1px var(--g-danger); }
.g-input.is-disabled {
  background: var(--g-surface-2);
  border-color: var(--g-border);
  color: var(--g-text-disabled);
  cursor: not-allowed;
}
.g-input.is-readonly { background: var(--g-surface-2); }
.g-input--sm { min-height: var(--g-control-h-sm); font-size: var(--g-fs-sm); padding-inline-start: var(--g-space-2); }
.g-input--lg { min-height: var(--g-control-h-lg); }
.g-input--multiline { align-items: stretch; padding: var(--g-space-2) var(--g-space-3); }

/* Microsoft Fluent 2's own field (the "outline" appearance, Imad 2026-10-28): a light stroke on three sides and the
   accessible (darker) stroke at the bottom, which carries the 3:1 boundary contrast; focus draws no ring but a
   2px brand underline that grows from the centre. Gigant keeps its even box above. */
[data-gui-theme="gigant-fluent"] {
  --_fi-stroke: var(--gf-grey-84);   --_fi-stroke-h: var(--gf-grey-78);   /* neutralStroke1 / Hover */
  --_fi-bottom: var(--gf-grey-38);   --_fi-bottom-h: var(--gf-grey-36);   /* neutralStrokeAccessible / Hover */
  --_fi-focus: var(--gf-brand-80);                                        /* compoundBrandStroke */
}
[data-gui-theme="gigant-fluent"][data-gui-mode="dark"] {
  --_fi-stroke: var(--gf-grey-38);   --_fi-stroke-h: var(--gf-grey-54);
  --_fi-bottom: var(--gf-grey-68);   --_fi-bottom-h: var(--gf-grey-74);
  --_fi-focus: var(--gf-brand-100);
}
[data-gui-theme="gigant-fluent"] .g-input { border-color: var(--_fi-stroke); border-bottom-color: var(--_fi-bottom); }
[data-gui-theme="gigant-fluent"] .g-input:hover { border-color: var(--_fi-stroke-h); border-bottom-color: var(--_fi-bottom-h); }
[data-gui-theme="gigant-fluent"] .g-input.is-focused,
[data-gui-theme="gigant-fluent"] .g-input:focus-within { border-color: var(--_fi-stroke); border-bottom-color: var(--_fi-bottom); box-shadow: none; }
[data-gui-theme="gigant-fluent"] .g-input::after {
  content: ''; position: absolute; inset-inline: calc(-1 * var(--g-border-w)); bottom: calc(-1 * var(--g-border-w));
  box-sizing: border-box; height: max(2px, var(--g-control-radius));
  border-bottom: 2px solid var(--_fi-focus);
  border-end-start-radius: var(--g-control-radius); border-end-end-radius: var(--g-control-radius);
  clip-path: inset(calc(100% - 2px) 0 0 0);
  transform: scaleX(0); transition: transform var(--g-dur-fast) var(--g-ease);
  pointer-events: none;
}
[data-gui-theme="gigant-fluent"] .g-input.is-focused::after,
[data-gui-theme="gigant-fluent"] .g-input:focus-within::after { transform: scaleX(1); }
[data-gui-theme="gigant-fluent"] .g-input.is-invalid { border-color: var(--g-danger); }
[data-gui-theme="gigant-fluent"] .g-input.is-invalid::after { --_fi-focus: var(--g-danger); }
[data-gui-theme="gigant-fluent"] .g-input.is-invalid.is-focused,
[data-gui-theme="gigant-fluent"] .g-input.is-invalid:focus-within { box-shadow: none; }
[data-gui-theme="gigant-fluent"] .g-input.is-disabled { border-color: var(--g-border); }
[data-gui-theme="gigant-fluent"] .g-input.is-disabled::after { display: none; }
@media (prefers-reduced-motion: reduce) { [data-gui-theme="gigant-fluent"] .g-input::after { transition: none; } }

/* the native element inside the box */
.g-input__control {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: calc(var(--g-control-h) - 2px);
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-overflow: ellipsis;
}
.g-input--sm .g-input__control { min-height: calc(var(--g-control-h-sm) - 2px); }
textarea.g-input__control { resize: vertical; min-height: 4.5em; line-height: var(--g-lh); }
.g-input__control::placeholder { color: var(--g-text-3); opacity: 1; }
.g-input__control:disabled { cursor: not-allowed; color: var(--g-text-disabled); }
.g-input__control[type="number"] { -moz-appearance: textfield; }
.g-input__control::-webkit-outer-spin-button,
.g-input__control::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.g-input__prefix,
.g-input__suffix {
  display: inline-flex;
  align-items: center;
  flex: none;
  color: var(--g-text-3);
}
.g-input__prefix { margin-inline-end: var(--g-space-1); }
.g-input__prefix[hidden],
.g-input__suffix[hidden] { display: none; }

/* icon button inside a field: clear, dropdown arrow, calendar, spin */
.g-input__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--g-input-btn);
  height: var(--g-input-btn);
  padding: 0;
  border: 0;
  border-radius: var(--g-radius-sm);
  background: transparent;
  color: var(--g-text-3);
  cursor: pointer;
}
.g-input--sm .g-input__btn { width: var(--g-input-btn-sm); height: var(--g-input-btn-sm); }
.g-input__btn:hover { background: var(--g-surface-3); color: var(--g-text); }
.g-input__btn:focus-visible { outline: none; box-shadow: var(--g-focus-ring-inset); }
.g-input__btn[hidden] { display: none; }
.is-disabled .g-input__btn { pointer-events: none; color: var(--g-text-disabled); }

/* ------------------------------------------------------------------ button */
.g-btn {
  --_bg: var(--g-surface);
  --_fg: var(--g-text);
  --_bd: var(--g-border-input);
  --_bg-hover: var(--g-surface-3);
  --_bg-active: var(--g-surface-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--g-space-2);
  min-height: var(--g-control-h);
  padding: 0 var(--g-space-4);
  border: var(--g-border-w) solid var(--_bd);
  border-radius: var(--g-button-radius);
  background: var(--_bg);
  color: var(--_fg);
  font: inherit;
  font-size: var(--g-fs-md);
  font-weight: var(--g-fw-medium);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--g-dur-fast) var(--g-ease), border-color var(--g-dur-fast) var(--g-ease),
              color var(--g-dur-fast) var(--g-ease);
}
.g-btn:hover { background: var(--_bg-hover); }
.g-btn:active { background: var(--_bg-active); }
.g-btn:disabled,
.g-btn.is-disabled {
  background: var(--g-surface-2);
  border-color: var(--g-border);
  color: var(--g-text-disabled);
  cursor: not-allowed;
}
.g-btn--primary {
  --_bg: var(--g-accent); --_fg: var(--g-text-on-accent); --_bd: var(--g-accent);
  --_bg-hover: var(--g-accent-hover); --_bg-active: var(--g-accent-active);
}
.g-btn--success {
  --_bg: var(--g-success); --_fg: var(--g-on-solid); --_bd: var(--g-success);
  --_bg-hover: color-mix(in srgb, var(--g-success) 85%, #000); --_bg-active: color-mix(in srgb, var(--g-success) 72%, #000);
}
.g-btn--danger {
  --_bg: var(--g-danger); --_fg: var(--g-on-solid); --_bd: var(--g-danger);
  --_bg-hover: color-mix(in srgb, var(--g-danger) 85%, #000); --_bg-active: color-mix(in srgb, var(--g-danger) 72%, #000);
}
.g-btn--warning {
  --_bg: var(--g-warning-subtle); --_fg: var(--g-warning-text); --_bd: var(--g-warning);
  --_bg-hover: var(--g-warning-subtle); --_bg-active: var(--g-warning-subtle);
}
.g-btn--info {
  --_bg: var(--g-info-subtle); --_fg: var(--g-info-text); --_bd: var(--g-info);
  --_bg-hover: var(--g-info-subtle); --_bg-active: var(--g-info-subtle);
}
.g-btn--outline {
  --_bg: transparent; --_fg: var(--g-accent-text); --_bd: var(--g-accent-text);
  --_bg-hover: var(--g-accent-subtle); --_bg-active: var(--g-accent-subtle-2);
}
.g-btn--subtle,
.g-btn--flat {
  --_bg: transparent; --_fg: var(--g-text-2); --_bd: transparent;
  --_bg-hover: var(--g-surface-3); --_bg-active: var(--g-surface-4);
}
/* A borderless button stays borderless when disabled: only its text fades (a grey box appeared around icon buttons). */
.g-btn--subtle:disabled, .g-btn--subtle.is-disabled,
.g-btn--flat:disabled, .g-btn--flat.is-disabled,
.g-btn--link:disabled, .g-btn--link.is-disabled { background: transparent; border-color: transparent; }
.g-btn--link {
  --_bg: transparent; --_fg: var(--g-accent-text); --_bd: transparent;
  --_bg-hover: transparent; --_bg-active: transparent;
  padding-inline: 0; min-height: auto; text-decoration: underline; text-underline-offset: 2px;
}
.g-btn--sm { min-height: var(--g-control-h-sm); padding-inline: var(--g-space-3); font-size: var(--g-fs-sm); gap: var(--g-space-1); }
.g-btn--lg { min-height: var(--g-control-h-lg); padding-inline: var(--g-space-5); font-size: var(--g-fs-lg); }
.g-btn--block { width: 100%; }
.g-btn--icon { padding: 0; width: var(--g-control-h); }
.g-btn--icon.g-btn--sm { width: var(--g-control-h-sm); }
.g-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.g-btn.is-loading > .g-spinner {
  position: absolute; inset: 0; margin: auto;
  --g-spinner-color: var(--_fg);
}
.g-btn-group { display: inline-flex; }
.g-btn-group > .g-btn:not(:first-child) { border-start-start-radius: 0; border-end-start-radius: 0; margin-inline-start: -1px; }
.g-btn-group > .g-btn:not(:last-child) { border-start-end-radius: 0; border-end-end-radius: 0; }

/* ------------------------------------------------------------------ popup surface */
.g-popup {
  position: fixed;
  z-index: var(--g-z-dropdown);
  min-width: 160px;
  max-width: min(560px, calc(100vw - 16px));
  max-height: min(420px, calc(100vh - 16px));
  display: flex;
  flex-direction: column;
  background: var(--g-surface-raised);
  color: var(--g-text);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-popup-radius);
  box-shadow: var(--g-shadow-3);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  overflow: hidden;
  animation: g-pop-in var(--g-dur-fast) var(--g-ease);
}
.g-popup--over-dialog { z-index: var(--g-z-popover-over-dialog); }
.g-popup__header,
.g-popup__footer {
  flex: none;
  padding: var(--g-space-2);
  border-color: var(--g-border);
}
.g-popup__header { border-bottom: var(--g-border-w) solid var(--g-border); }
.g-popup__footer {
  border-top: var(--g-border-w) solid var(--g-border);
  display: flex; justify-content: flex-end; gap: var(--g-space-2);
}
.g-popup__body { flex: 1 1 auto; min-height: 0; overflow: auto; }
@keyframes g-pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ list / option */
.g-list {
  list-style: none;
  margin: 0;
  padding: var(--g-space-1);
  outline: none;
}
.g-option {
  display: flex;
  align-items: center;
  gap: var(--g-space-2);
  min-height: var(--g-control-h-sm);
  padding: var(--g-space-1) var(--g-space-3);
  border-radius: var(--g-radius-sm);
  color: var(--g-text);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-option:hover { background: var(--g-surface-3); }
.g-option.is-selected,
.g-option[aria-selected="true"] {
  background: var(--g-accent-subtle);
  color: var(--g-text);
  font-weight: var(--g-fw-medium);
}
.g-option.is-disabled,
.g-option[aria-disabled="true"] { color: var(--g-text-disabled); cursor: not-allowed; background: none; }
.g-option__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.g-option__meta { flex: none; color: var(--g-text-3); font-size: var(--g-fs-xs); }
.g-option__check { flex: none; width: 16px; color: var(--g-accent-text); visibility: hidden; }
.g-option.is-selected .g-option__check,
.g-option[aria-selected="true"] .g-option__check { visibility: visible; }
.g-option-group {
  padding: var(--g-space-2) var(--g-space-3) var(--g-space-1);
  font-size: var(--g-fs-xs);
  font-weight: var(--g-fw-semibold);
  color: var(--g-text-3);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.g-list-separator { height: 1px; margin: var(--g-space-1) 0; background: var(--g-border); border: 0; }
.g-list-empty { padding: var(--g-space-4) var(--g-space-3); color: var(--g-text-3); text-align: center; }
mark.g-match { background: transparent; color: inherit; font-weight: var(--g-fw-bold); text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------------------ check / radio */
.g-check {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: var(--g-check-size);
  height: var(--g-check-size);
  margin: 0;
  border: 1.5px solid var(--g-border-strong);
  border-radius: var(--g-check-radius);
  background: var(--g-surface);
  cursor: pointer;
  vertical-align: middle;
  transition: background-color var(--g-dur-fast) var(--g-ease), border-color var(--g-dur-fast) var(--g-ease);
}
.g-check[type="radio"] { border-radius: 50%; }
.g-check:hover { border-color: var(--g-text); }
.g-check:checked,
.g-check[type="checkbox"]:indeterminate {
  background: var(--g-check-bg);
  border-color: var(--g-check-bg);
}
.g-check:checked::after {
  content: "";
  position: absolute;
  inset-inline-start: 50%;
  top: 45%;
  width: 5px;
  height: 9px;
  border: solid var(--g-check-fg);
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}
[dir="rtl"] .g-check:checked::after { transform: translate(50%, -50%) rotate(45deg); }
.g-check[type="radio"]:checked { background: var(--g-surface); }
.g-check[type="radio"]:checked::after {
  width: 8px; height: 8px; border: 0; border-radius: 50%;
  background: var(--g-check-bg); top: 50%; transform: translate(-50%, -50%);
}
[dir="rtl"] .g-check[type="radio"]:checked::after { transform: translate(50%, -50%); }
.g-check[type="checkbox"]:indeterminate::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 2px;
  background: var(--g-check-fg);
}
.g-check:disabled { border-color: var(--g-text-disabled); background: var(--g-surface-2); cursor: not-allowed; }
.g-check:disabled:checked { background: var(--g-text-disabled); border-color: var(--g-text-disabled); }

.g-check-label {
  display: inline-flex;
  align-items: center;
  gap: var(--g-space-2);
  cursor: pointer;
  user-select: none;
  min-height: var(--g-target-min);
}
.g-check-label.is-disabled { color: var(--g-text-disabled); cursor: not-allowed; }

/* ------------------------------------------------------------------ switch */
.g-switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: var(--g-switch-w);
  height: var(--g-switch-h);
  margin: 0;
  border: 1.5px solid var(--g-border-strong);
  border-radius: var(--g-radius-pill);
  background: var(--g-surface);
  cursor: pointer;
  transition: background-color var(--g-dur) var(--g-ease), border-color var(--g-dur) var(--g-ease);
}
.g-switch::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-start: 3px;
  width: calc(var(--g-switch-h) - 8px);      /* 14px knob in the 22px track */
  height: calc(var(--g-switch-h) - 8px);
  border-radius: 50%;
  background: var(--g-border-strong);
  transform: translateY(-50%);
  transition: inset-inline-start var(--g-dur) var(--g-ease), background-color var(--g-dur) var(--g-ease);
}
.g-switch:checked { background: var(--g-check-bg); border-color: var(--g-check-bg); }
.g-switch:checked::after { inset-inline-start: calc(var(--g-switch-w) - var(--g-switch-h) + 2px); background: var(--g-check-fg); }
.g-switch:disabled { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------------------ chip / badge */
.g-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--g-space-1);
  max-width: 100%;
  min-height: 24px;
  padding: 0 var(--g-space-2);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-radius-pill);
  background: var(--g-surface-2);
  color: var(--g-text);
  font-size: var(--g-fs-sm);
  line-height: 1.2;
  white-space: nowrap;
}
.g-chip__text { overflow: hidden; text-overflow: ellipsis; }
.g-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  margin-inline-end: -4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--g-text-3);
  cursor: pointer;
}
.g-chip__remove:hover { background: var(--g-surface-4); color: var(--g-text); }
.g-chip__remove:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-chip.is-selected { background: var(--g-accent-subtle); border-color: var(--g-accent-text); }

.g-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--g-space-2);
  border-radius: var(--g-radius-pill);
  background: var(--g-surface-4);
  color: var(--g-text);
  font-size: var(--g-fs-xs);
  font-weight: var(--g-fw-semibold);
  line-height: 1;
  white-space: nowrap;
}
.g-badge--accent  { background: var(--g-accent-subtle);  color: var(--g-accent-text); }
.g-badge--success { background: var(--g-success-subtle); color: var(--g-success-text); }
.g-badge--warning { background: var(--g-warning-subtle); color: var(--g-warning-text); }
.g-badge--danger  { background: var(--g-danger-subtle);  color: var(--g-danger-text); }
.g-badge--info    { background: var(--g-info-subtle);    color: var(--g-info-text); }
.g-badge--solid-danger { background: var(--g-danger); color: var(--g-on-solid); }

/* ------------------------------------------------------------------ spinner / skeleton */
.g-spinner {
  --g-spinner-size: 18px;
  --g-spinner-color: var(--g-accent-text);
  display: inline-block;
  width: var(--g-spinner-size);
  height: var(--g-spinner-size);
  border: 2px solid color-mix(in srgb, var(--g-spinner-color) 25%, transparent);
  border-top-color: var(--g-spinner-color);
  border-radius: 50%;
  animation: g-spin .7s linear infinite;
  flex: none;
}
.g-spinner--lg { --g-spinner-size: 32px; border-width: 3px; }
@keyframes g-spin { to { transform: rotate(360deg); } }
.g-spinner[hidden] { display: none; } /* display:inline-block above would otherwise beat [hidden] */

/* overlay that covers a component while it loads */
.g-loading-mask {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--g-surface) 65%, transparent);
}

.g-skeleton {
  display: block;
  height: 1em;
  border-radius: var(--g-radius-sm);
  background: linear-gradient(90deg, var(--g-surface-3) 25%, var(--g-surface-2) 37%, var(--g-surface-3) 63%);
  background-size: 400% 100%;
  animation: g-shimmer 1.4s ease infinite;
}
@keyframes g-shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* ------------------------------------------------------------------ scrim */
.g-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--g-z-dialog);
  background: var(--g-overlay);
  animation: g-fade-in var(--g-dur) var(--g-ease);
}
@keyframes g-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------------ card (KPI + panels) */
.g-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--g-surface);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-surface-radius);
  box-shadow: var(--g-shadow-1);
  color: var(--g-text);
}
.g-card__header {
  display: flex;
  align-items: center;
  gap: var(--g-space-2);
  min-height: var(--g-card-header-h);
  padding: var(--g-space-2) var(--g-space-4);
  border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-card__title { margin: 0; font-size: var(--g-fs-lg); font-weight: var(--g-fw-semibold); flex: 1; min-width: 0; }
.g-card__body { padding: var(--g-space-3) var(--g-space-4); flex: 1 1 auto; min-height: 0; }
.g-card__footer {
  display: flex; justify-content: flex-end; gap: var(--g-space-2);
  padding: var(--g-space-3) var(--g-space-4);
  border-top: var(--g-border-w) solid var(--g-border);
}

/* ------------------------------------------------------------------ layout helpers */
.g-form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--g-space-3) var(--g-space-4);
}
.g-col-12 { grid-column: span 12; } .g-col-8 { grid-column: span 8; } .g-col-6 { grid-column: span 6; }
.g-col-4 { grid-column: span 4; }   .g-col-3 { grid-column: span 3; }
@media (max-width: 720px) {
  .g-col-8, .g-col-6, .g-col-4, .g-col-3 { grid-column: span 12; }
}

/* ------------------------------------------------------------------ motion */
@media (prefers-reduced-motion: reduce) {
  [class^="g-"], [class*=" g-"],
  [class^="g-"]::before, [class*=" g-"]::before,
  [class^="g-"]::after, [class*=" g-"]::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .g-spinner { animation-duration: 1.4s !important; animation-iteration-count: infinite !important; }
}

/* Windows High Contrast / forced colors: keep borders and focus visible */
@media (forced-colors: active) {
  .g-input, .g-btn, .g-popup, .g-check, .g-switch, .g-chip { border-color: CanvasText; }
  .g-option.is-focused, .g-focusable:focus-visible, .g-btn:focus-visible { outline: 2px solid Highlight; }
  .g-option.is-selected { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}

/* ---- css/shell.css ---- */
/*
 * Gigant UI — application shell: sidebar + navbar + content area.
 *
 * Keeps the current GigantV2 layout: a floating sidebar card (logo, pin, search, icon + label
 * menu with a filled active row) that collapses to an icon rail and widens on hover unless pinned,
 * and a floating top bar card (page title on the start side, actions on the end side). On phones
 * the sidebar becomes an off-canvas drawer opened from the top bar.
 */
.g-shell {
  display: flex;
  min-height: 100dvh;
  background: var(--g-bg);
  color: var(--g-text);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  line-height: var(--g-lh);
}
.g-shell__skip {
  position: absolute;
  inset-inline-start: var(--g-space-2);
  top: -100px;
  z-index: calc(var(--g-z-sidebar) + 10);
  padding: var(--g-space-2) var(--g-space-4);
  border-radius: var(--g-radius-md);
  background: var(--g-surface);
  color: var(--g-accent-text);
  font-weight: var(--g-fw-semibold);
  box-shadow: var(--g-shadow-3);
}
.g-shell__skip:focus { top: var(--g-space-2); outline: none; box-shadow: var(--g-focus-ring); }

/* ------------------------------------------------------------------ sidebar */
.g-shell__sidebar {
  position: sticky;
  top: 0;
  z-index: var(--g-z-sidebar);
  flex: none;
  width: var(--g-shell-sidebar-w);
  height: 100dvh;
  padding: var(--g-shell-gutter);
  padding-inline-end: 0;
  transition: width var(--g-dur-slow) var(--g-ease);
}
.g-shell__panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--g-surface);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-surface-radius);
  box-shadow: var(--g-shadow-shell);
  transition: width var(--g-dur-slow) var(--g-ease), box-shadow var(--g-dur) var(--g-ease);
}
.g-shell__brand {
  display: flex;
  align-items: center;
  gap: var(--g-space-2);
  min-height: var(--g-shell-brand-h);
  padding: var(--g-space-3) var(--g-space-3) var(--g-space-2) var(--g-space-4);
}
.g-shell__brand-link {
  display: flex;
  align-items: center;
  gap: var(--g-space-2);
  flex: 1 1 auto;
  min-width: 0;
  color: var(--g-text);
  text-decoration: none;
  border-radius: var(--g-radius-sm);
}
.g-shell__brand-link:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-shell__logo { flex: none; width: 28px; height: 28px; object-fit: contain; }
.g-shell__brand-text {
  font-size: var(--g-fs-xl);
  font-weight: var(--g-fw-semibold);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--g-dur) var(--g-ease);
}
.g-shell__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  position: relative;
  width: var(--g-control-h-sm);
  height: var(--g-control-h-sm);
  padding: 0;
  border: 0;
  border-radius: var(--g-button-radius);
  background: transparent;
  color: var(--g-text-2);
  cursor: pointer;
}
.g-shell__icon-btn:hover { background: var(--g-surface-3); color: var(--g-text); }
.g-shell__icon-btn:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-shell__icon-btn[aria-pressed="true"] { color: var(--g-accent-text); background: var(--g-accent-subtle); }
.g-shell__icon-btn .g-icon { width: 18px; height: 18px; }

.g-shell__search {
  padding: var(--g-space-1) var(--g-space-3) var(--g-space-2);
}
.g-shell__search .g-input { min-height: var(--g-control-h-sm); padding-inline-start: var(--g-space-2); }
.g-shell__search .g-input__control { min-height: calc(var(--g-control-h-sm) - 2px); font-size: var(--g-fs-sm); }

.g-shell__nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--g-space-1) var(--g-space-3) var(--g-space-4);
  scrollbar-width: thin;
  scrollbar-color: var(--g-scrollbar) transparent;
}
.g-shell__menu,
.g-shell__submenu { list-style: none; margin: 0; padding: 0; }
/* the guide line sits under the parent's icon centre (the item's --g-space-3 padding + 10px half icon - 1px line) */
.g-shell__submenu { padding-inline-start: var(--g-space-2); margin-inline-start: calc(var(--g-space-3) + 9px); border-inline-start: 1px solid var(--g-border); }
.g-shell__submenu .g-shell__submenu { margin-inline-start: var(--g-space-3); }
.g-shell__submenu[hidden] { display: none; }
.g-shell__menu > li + li { margin-top: 2px; }
.g-shell__submenu > li { margin-top: 2px; }

.g-shell__item {
  display: flex;
  align-items: center;
  gap: var(--g-space-3);
  width: 100%;
  min-height: var(--g-shell-nav-item-h);
  padding: var(--g-space-2) var(--g-space-3);
  border: 0;
  border-radius: var(--g-radius-lg);
  background: transparent;
  color: var(--g-text);
  font: inherit;
  font-size: var(--g-fs-md);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--g-dur-fast) var(--g-ease), color var(--g-dur-fast) var(--g-ease);
}
.g-shell__submenu .g-shell__item { min-height: var(--g-shell-nav-subitem-h); font-size: var(--g-fs-sm); padding-block: var(--g-space-1); }
.g-shell__item:hover { background: var(--g-shell-nav-hover); }
.g-shell__item:focus-visible { outline: none; box-shadow: var(--g-focus-ring-inset); }
.g-shell__item[aria-current="page"] {
  background: var(--g-shell-nav-active-bg);
  color: var(--g-shell-nav-active-text);
  font-weight: var(--g-fw-semibold);
}
/* parent of the current page: subtle hint, so the trail is visible when collapsed */
.g-shell__item.is-trail { color: var(--g-accent-text); font-weight: var(--g-fw-medium); }
.g-shell__item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
}
.g-shell__item-icon .g-icon,
.g-shell__item-icon svg { width: 20px; height: 20px; }
.g-shell__item-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--g-dur) var(--g-ease); }
.g-shell__item-badge { flex: none; }
.g-shell__chevron { flex: none; color: var(--g-text-3); transition: transform var(--g-dur) var(--g-ease); }
.g-shell__item[aria-expanded="true"] > .g-shell__chevron { transform: rotate(180deg); }
.g-shell__item mark { background: transparent; color: inherit; font-weight: var(--g-fw-bold); text-decoration: underline; }
.g-shell__empty { padding: var(--g-space-4) var(--g-space-2); color: var(--g-text-3); font-size: var(--g-fs-sm); text-align: center; }

.g-shell__sidebar-foot {
  flex: none;
  padding: var(--g-space-2) var(--g-space-3) var(--g-space-3);
  border-top: var(--g-border-w) solid var(--g-border);
  color: var(--g-text-3);
  font-size: var(--g-fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- collapsed rail (desktop) --------------------------------------------------- */
.g-shell.is-collapsed .g-shell__sidebar { width: calc(var(--g-shell-sidebar-w-collapsed) + var(--g-shell-gutter)); }
.g-shell.is-collapsed:not(.is-peek) .g-shell__item-badge,
.g-shell.is-collapsed:not(.is-peek) .g-shell__chevron,
.g-shell.is-collapsed:not(.is-peek) .g-shell__search,
.g-shell.is-collapsed:not(.is-peek) .g-shell__pin,
.g-shell.is-collapsed:not(.is-peek) .g-shell__submenu,
.g-shell.is-collapsed:not(.is-peek) .g-shell__sidebar-foot { display: none; }
.g-shell.is-collapsed:not(.is-peek) .g-shell__item { justify-content: center; padding-inline: 0; }
.g-shell.is-collapsed:not(.is-peek) .g-shell__brand { justify-content: center; padding-inline: var(--g-space-2); }
.g-shell.is-collapsed:not(.is-peek) .g-shell__brand-link { flex: none; }
/* labels stay in the accessibility tree: rail icons keep their names */
.g-shell.is-collapsed:not(.is-peek) .g-shell__brand-text,
.g-shell.is-collapsed:not(.is-peek) .g-shell__item-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
/* hover/focus "peek": the panel widens over the content without moving it */
.g-shell.is-collapsed.is-peek .g-shell__panel {
  width: calc(var(--g-shell-sidebar-w) - var(--g-shell-gutter));
  box-shadow: var(--g-shadow-shell-raised);
}

/* ---- touch rail (railLabels: true — the POS tills) ------------------------------
   Always the rail; each item is an icon over a short label (two lines at most), centred; nothing needs hover.
   Width = the rail token + a little room for the labels; items are >= 44px tall in every density. */
.g-shell--rail-labels.is-collapsed .g-shell__sidebar { width: calc(var(--g-shell-sidebar-w-collapsed) + var(--g-space-4) + var(--g-shell-gutter)); }
.g-shell--rail-labels .g-shell__nav { padding-inline: var(--g-space-2); }
.g-shell.g-shell--rail-labels.is-collapsed:not(.is-peek) .g-shell__item {
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: max(44px, calc(var(--g-shell-nav-item-h) + var(--g-space-4)));
  padding: var(--g-space-1) 2px;
  position: relative;
}
.g-shell.g-shell--rail-labels.is-collapsed:not(.is-peek) .g-shell__item-label {
  position: static; width: auto; height: auto; clip: auto;
  flex: none;
  max-width: 100%;
  font-size: var(--g-fs-2xs);
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
/* a count (held orders …) sits on the item's corner */
.g-shell.g-shell--rail-labels.is-collapsed:not(.is-peek) .g-shell__item-badge {
  display: inline-flex; position: absolute; top: 2px; inset-inline-end: 2px;
}

/* ------------------------------------------------------------------ main column */
.g-shell__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.g-shell__appbar-wrap {
  position: sticky;
  top: 0;
  z-index: calc(var(--g-z-sidebar) - 1);
  padding: var(--g-shell-gutter);
  padding-bottom: 0;
  background: linear-gradient(var(--g-bg) 70%, transparent);
}
.g-shell__appbar {
  display: flex;
  align-items: center;
  gap: var(--g-space-3);
  min-height: var(--g-shell-appbar-h);
  padding: var(--g-space-2) var(--g-space-3) var(--g-space-2) var(--g-space-5);
  background: var(--g-surface);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-surface-radius);
  box-shadow: var(--g-shadow-shell);
}
.g-shell__menu-toggle { display: none; }
.g-shell__title-wrap { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.g-shell__title {
  margin: 0;
  font-size: var(--g-fs-lg);
  font-weight: var(--g-fw-semibold);
  line-height: var(--g-lh-tight);
  color: var(--g-accent-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-shell__crumbs { display: flex; gap: var(--g-space-1); margin: 2px 0 0; padding: 0; list-style: none; font-size: var(--g-fs-xs); color: var(--g-text-3); white-space: nowrap; overflow: hidden; }
.g-shell__crumbs li + li::before { content: "/"; margin-inline-end: var(--g-space-1); }
.g-shell__actions { display: flex; align-items: center; gap: var(--g-space-2); flex: none; }
.g-shell__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--g-space-1);
  min-height: var(--g-control-h-sm);
  padding: 0 var(--g-space-3);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-button-radius);
  background: var(--g-surface);
  color: var(--g-text-2);
  font: inherit;
  font-size: var(--g-fs-sm);
  white-space: nowrap;
  cursor: pointer;
}
.g-shell__chip:hover { background: var(--g-surface-3); color: var(--g-text); }
.g-shell__chip:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-shell__chip--static { cursor: default; }
.g-shell__chip[hidden],
.g-shell__profile[hidden],
.g-shell__icon-btn[hidden] { display: none; }
.g-shell__chip--static:hover { background: var(--g-surface); color: var(--g-text-2); }
.g-shell__badge {
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--g-radius-pill);
  background: var(--g-danger);
  color: var(--g-on-solid);
  font-size: var(--g-fs-2xs);
  font-weight: var(--g-fw-semibold);
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--g-surface);
}
.g-shell__profile {
  display: inline-flex;
  align-items: center;
  gap: var(--g-space-2);
  min-height: var(--g-control-h);
  padding: 2px var(--g-space-2) 2px 2px;
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-button-radius);
  background: var(--g-surface);
  color: var(--g-text);
  font: inherit;
  cursor: pointer;
}
.g-shell__profile:hover { background: var(--g-surface-3); }
.g-shell__profile:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-shell__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--g-shell-avatar);
  height: var(--g-shell-avatar);
  border-radius: 50%;
  background: var(--g-accent-subtle-2);
  color: var(--g-text);
  font-size: var(--g-fs-xs);
  font-weight: var(--g-fw-semibold);
  overflow: hidden;
}
.g-shell__avatar img { width: 100%; height: 100%; object-fit: cover; }
.g-shell__profile-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: start; }
.g-shell__profile-name { font-size: var(--g-fs-sm); font-weight: var(--g-fw-semibold); }
.g-shell__profile-role { font-size: var(--g-fs-xs); color: var(--g-text-3); }

.g-shell__content {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--g-shell-gutter);
}
.g-shell__content:focus { outline: none; }

/* menus opened from the top bar (theme, language, profile) */
.g-shell-menu { min-width: 220px; padding: var(--g-space-1); }
.g-shell-menu .g-option { gap: var(--g-space-2); }
.g-shell-menu__group { padding: var(--g-space-2) var(--g-space-3) var(--g-space-1); font-size: var(--g-fs-xs); font-weight: var(--g-fw-semibold); color: var(--g-text-3); }
.g-shell-menu__head { padding: var(--g-space-2) var(--g-space-3); border-bottom: 1px solid var(--g-border); margin-bottom: var(--g-space-1); }
.g-shell-menu__head strong { display: block; }
.g-shell-menu__head span { color: var(--g-text-3); font-size: var(--g-fs-xs); }

/* ------------------------------------------------------------------ scrim + phones */
.g-shell__scrim { display: none; }
@media (max-width: 1023px) {
  .g-shell__sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(86vw, var(--g-shell-sidebar-w));
    padding-inline-end: var(--g-shell-gutter);
    transform: translateX(-105%);
    transition: transform var(--g-dur-slow) var(--g-ease);
    visibility: hidden;
  }
  [dir="rtl"] .g-shell__sidebar { transform: translateX(105%); }
  .g-shell.is-mobile-open .g-shell__sidebar { transform: none; visibility: visible; }
  .g-shell.is-mobile-open .g-shell__scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: calc(var(--g-z-sidebar) - 1);
    background: var(--g-overlay);
  }
  .g-shell .g-shell__pin { display: none; }
  .g-shell__menu-toggle { display: inline-flex; }
  /* the rail never applies on phones */
  .g-shell.is-collapsed .g-shell__sidebar { width: min(86vw, var(--g-shell-sidebar-w)); }
  .g-shell.is-collapsed .g-shell__brand-text,
  .g-shell.is-collapsed .g-shell__item-label,
  .g-shell.is-collapsed .g-shell__chevron,
  .g-shell.is-collapsed .g-shell__search,
  .g-shell.is-collapsed .g-shell__item-badge,
  .g-shell.is-collapsed .g-shell__sidebar-foot { display: revert; }
  .g-shell.is-collapsed .g-shell__item { justify-content: flex-start; padding-inline: var(--g-space-3); }
  .g-shell.is-collapsed .g-shell__submenu:not([hidden]) { display: block; }
}
/* the touch rail stays a rail on tablets and phones (no off-canvas drawer, no menu button) */
@media (max-width: 1023px) {
  .g-shell.g-shell--rail-labels.is-collapsed .g-shell__sidebar {
    position: sticky; inset: auto; top: 0; transform: none; visibility: visible; transition: none;
    width: calc(var(--g-shell-sidebar-w-collapsed) + var(--g-space-4) + var(--g-shell-gutter));
    padding-inline-end: 0;
  }
  .g-shell--rail-labels .g-shell__menu-toggle { display: none; }
  .g-shell.g-shell--rail-labels.is-collapsed .g-shell__brand-text,
  .g-shell.g-shell--rail-labels.is-collapsed .g-shell__search,
  .g-shell.g-shell--rail-labels.is-collapsed .g-shell__chevron,
  .g-shell.g-shell--rail-labels.is-collapsed .g-shell__submenu,
  .g-shell.g-shell--rail-labels.is-collapsed .g-shell__sidebar-foot { display: none; }
  .g-shell.g-shell--rail-labels.is-collapsed .g-shell__item { justify-content: center; padding-inline: 2px; }
}
@media (max-width: 640px) {
  .g-shell__appbar { padding-inline-start: var(--g-space-2); }
  .g-shell__profile-text,
  .g-shell__actions .g-shell__chip:not(.g-shell__chip--keep) { display: none; }
  /* also over a density's gutter (the [data-gui-theme][data-gui-density] blocks): phones keep the 8px edge */
  :root, :root[data-gui-density] { --g-shell-gutter: 8px; }
}
@media print {
  .g-shell__sidebar, .g-shell__appbar-wrap, .g-shell__skip { display: none; }
  .g-shell, .g-shell__content { background: #fff; padding: 0; }
}

/* ---- css/components/accordion.css ---- */
/*
 * Gigant UI — Accordion. Header buttons inside headings; the panel opens with a grid-row
 * transition (0fr → 1fr) so no height is measured in JS.
 */
.g-accordion {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-radius-lg);
  background: var(--g-surface);
  color: var(--g-text);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  overflow: hidden;
}
.g-accordion__item + .g-accordion__item { border-top: var(--g-border-w) solid var(--g-border); }
.g-accordion__item[hidden] { display: none; }
.g-accordion__heading { margin: 0; font: inherit; }
.g-accordion__header {
  display: flex;
  align-items: center;
  gap: var(--g-space-2);
  width: 100%;
  min-height: calc(44px * var(--g-space-scale));
  padding: var(--g-space-2) var(--g-space-4);
  border: 0;
  background: transparent;
  color: var(--g-text);
  font: inherit;
  font-weight: var(--g-fw-semibold);
  text-align: start;
  cursor: pointer;
  outline: none;
  transition: background-color var(--g-dur-fast) var(--g-ease);
}
.g-accordion__header:hover { background: var(--g-surface-3); }
.g-accordion__header:focus-visible { box-shadow: var(--g-focus-ring-inset); }
.g-accordion__item.is-expanded > .g-accordion__heading > .g-accordion__header { background: var(--g-surface-2); }
.g-accordion__item.is-disabled > .g-accordion__heading > .g-accordion__header { color: var(--g-text-disabled); cursor: not-allowed; background: none; }
.g-accordion__icon { display: inline-flex; color: var(--g-text-2); }
.g-accordion__title { flex: 1 1 auto; min-width: 0; }
.g-accordion__chevron { display: inline-flex; color: var(--g-text-3); transition: transform var(--g-dur) var(--g-ease); }
.g-accordion__item.is-expanded > .g-accordion__heading .g-accordion__chevron { transform: rotate(180deg); }
.g-accordion__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--g-dur) var(--g-ease);
}
.g-accordion__panel.is-open { grid-template-rows: 1fr; }
.g-accordion__panel[hidden] { display: none; }
.g-accordion__clip { min-height: 0; overflow: hidden; }
.g-accordion__content { padding: var(--g-space-3) var(--g-space-4) var(--g-space-4); border-top: var(--g-border-w) solid var(--g-border); }
@media (forced-colors: active) { .g-accordion__header:focus-visible { outline: 2px solid Highlight; outline-offset: -2px; } }

/* ---- css/components/applauncher.css ---- */
/*
 * Gigant UI — AppLauncher (top-bar "Apps" button + search popover) and the module icon tile it shares with
 * the ERP Module Explorer page (.g-app-tile). Tokens only: both themes, light/dark, the three densities and
 * RTL work without overrides.
 */

/* ------------------------------------------------------------------ module icon tile */
.g-app-tile {
  --_s: calc(var(--g-control-h) + var(--g-space-2));
  --_i: calc(var(--_s) * 0.5);
  --_hue: var(--g-accent);
  --_bg: color-mix(in srgb, var(--_hue) 13%, var(--g-surface));
  --_fg: color-mix(in srgb, var(--_hue) 78%, var(--g-text));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--_s);
  height: var(--_s);
  border-radius: var(--g-radius-lg);
  background: var(--_bg);
  color: var(--_fg);
  font-size: var(--_i);
  line-height: 1;
}
.g-app-tile--lg { --_s: calc(var(--g-control-h-lg) + var(--g-space-4)); border-radius: var(--g-radius-xl); }
.g-app-tile--sm { --_s: var(--g-control-h-sm); --_i: calc(var(--_s) * 0.56); border-radius: var(--g-radius-md); }
.g-app-tile--xs { --_s: calc(var(--g-control-h-sm) * 0.66); --_i: calc(var(--_s) * 0.64); border-radius: var(--g-radius-sm); }
/* Eight module colours = the categorical chart palette (both themes, light/dark): pages get a soft tint of their
   module's colour; MODULES get a solid "app icon" tile with a white glyph (Microsoft 365 / Odoo launchers). */
.g-app-tile--tone-0 { --_hue: var(--g-chart-1); }
.g-app-tile--tone-1 { --_hue: var(--g-chart-2); }
.g-app-tile--tone-2 { --_hue: var(--g-chart-3); }
.g-app-tile--tone-3 { --_hue: var(--g-chart-4); }
.g-app-tile--tone-4 { --_hue: var(--g-chart-5); }
.g-app-tile--tone-5 { --_hue: var(--g-chart-6); }
.g-app-tile--tone-6 { --_hue: var(--g-chart-7); }
.g-app-tile--tone-7 { --_hue: var(--g-chart-8); }
.g-app-tile--solid {
  --_bg: color-mix(in srgb, var(--_hue) 88%, #000);
  --_fg: #fff;
  --_i: calc(var(--_s) * 0.6);
  box-shadow: var(--g-shadow-1);
}
/* Gigant: a soft top-light on the tile; Gigant Fluent stays flat, as Fluent's app icons are */
[data-gui-theme="gigant"] .g-app-tile--solid {
  background: linear-gradient(160deg, color-mix(in srgb, var(--_hue) 100%, #fff 8%), color-mix(in srgb, var(--_hue) 80%, #000));
}
.g-app-tile > .g-icon,
.g-app-tile > svg,
.g-app-tile .gi,
.g-app-tile .gi svg,
.g-app-tile .g-icon-font { width: var(--_i); height: var(--_i); }
.g-app-tile .gi { display: inline-flex; align-items: center; justify-content: center; font-size: var(--_i); }
.g-app-tile i { font-size: calc(var(--_i) * 0.86); }

/* ------------------------------------------------------------------ trigger */
.g-applauncher__trigger.is-open,
.g-applauncher__trigger[aria-expanded="true"] { background: var(--g-accent-subtle); color: var(--g-accent-text); }

/* ------------------------------------------------------------------ centred overlay (macOS-launcher style) */
.g-applauncher-backdrop {
  position: fixed; inset: 0; z-index: var(--g-z-dialog);
  display: grid; place-items: center; padding: var(--g-space-4);
  background: color-mix(in srgb, #000 38%, transparent);
  -webkit-backdrop-filter: blur(6px) saturate(1.1); backdrop-filter: blur(6px) saturate(1.1);
  animation: g-al-fade var(--g-dur) var(--g-ease);
}
[data-gui-mode="dark"] .g-applauncher-backdrop { background: color-mix(in srgb, #000 55%, transparent); }
.g-popup.g-applauncher.g-applauncher--centered {
  position: relative !important; left: auto !important; top: auto !important; margin: 0;
  animation: g-al-in var(--g-dur) var(--g-ease);
}
.g-applauncher--centered.is-dragging { transition: none; user-select: none; }
.g-applauncher__grip {
  inline-size: 2.5rem; block-size: 4px; margin: 0 auto var(--g-space-2); border-radius: var(--g-radius-pill);
  background: var(--g-border-strong); opacity: .55; cursor: grab;
}
.g-applauncher--centered .g-applauncher__head { cursor: grab; }
.g-applauncher--centered.is-dragging .g-applauncher__head, .g-applauncher--centered.is-dragging .g-applauncher__grip { cursor: grabbing; }
.g-applauncher--centered .g-applauncher__head input, .g-applauncher--centered .g-applauncher__head button { cursor: auto; }
@keyframes g-al-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes g-al-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .g-applauncher-backdrop, .g-popup.g-applauncher.g-applauncher--centered { animation: none; }
  .g-applauncher-backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) { .g-applauncher-backdrop { background: transparent; } }

/* ------------------------------------------------------------------ popover */
.g-popup.g-applauncher {
  width: min(45rem, calc(100vw - 2 * var(--g-space-2)));
  max-width: min(45rem, calc(100vw - 2 * var(--g-space-2)));
  max-height: min(42rem, calc(100dvh - 4rem));
  display: flex; flex-direction: column;
  border-radius: var(--g-radius-xl);
  box-shadow: var(--g-shadow-4);
}
.g-applauncher__head {
  flex: none;
  padding: var(--g-space-3) var(--g-space-3) var(--g-space-2);
}
.g-applauncher__search { font-size: var(--g-fs-lg); border-radius: var(--g-radius-lg); }
.g-applauncher__search .g-input__prefix .g-icon { width: 20px; height: 20px; }
.g-applauncher__search .g-input__control { font-size: var(--g-fs-lg); }
.g-applauncher__search .g-input__control::placeholder { font-size: inherit; }
.g-applauncher__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 var(--g-space-3) var(--g-space-3);
  scrollbar-width: thin;
  scrollbar-color: var(--g-scrollbar) transparent;
}
.g-applauncher__body:focus { outline: none; }
.g-applauncher__list[hidden],
.g-applauncher__bar[hidden],
.g-applauncher__empty[hidden] { display: none; }

/* module drill-in bar */
.g-applauncher__bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--g-space-2);
  padding: var(--g-space-1) 0 var(--g-space-2);
  margin-bottom: var(--g-space-1);
  border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-applauncher__back { padding-inline: var(--g-space-2); }
.g-applauncher__bar-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: var(--g-fs-lg);
  font-weight: var(--g-fw-semibold);
  line-height: var(--g-lh-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* groups */
.g-applauncher__group + .g-applauncher__group { margin-top: var(--g-space-3); }
.g-applauncher__group-head {
  display: flex;
  align-items: center;
  gap: var(--g-space-2);
  padding: var(--g-space-2) var(--g-space-1) var(--g-space-1);
  color: var(--g-text-2);
  font-size: var(--g-fs-xs);
  font-weight: var(--g-fw-semibold);
  letter-spacing: 0.02em;
}
.g-applauncher__group-icon { display: inline-flex; color: var(--g-text-3); }
.g-applauncher__group-icon .g-icon { width: 14px; height: 14px; }
.g-applauncher__group-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-applauncher__count {
  flex: none;
  padding: 0 var(--g-space-2);
  border-radius: var(--g-radius-pill);
  background: var(--g-surface-3);
  color: var(--g-text-2);
  font-size: var(--g-fs-2xs);
  font-weight: var(--g-fw-semibold);
  line-height: 1.6;
}
.g-applauncher__items { display: grid; gap: 2px; }
.g-applauncher__grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.5rem), 1fr)); gap: var(--g-space-1); }
.g-applauncher__cols { grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); column-gap: var(--g-space-2); }
.g-applauncher__rows { grid-template-columns: minmax(0, 1fr); }

/* options */
.g-applauncher__option {
  position: relative;
  color: var(--g-text);
  text-decoration: none;
  border-radius: var(--g-radius-md);
  cursor: pointer;
  outline: none;
  transition: background-color var(--g-dur-fast) var(--g-ease);
}
.g-applauncher__option:hover { background: var(--g-surface-3); }
.g-applauncher__option.is-active {
  background: var(--g-accent-subtle);
  box-shadow: inset 0 0 0 2px var(--g-focus);
}
.g-applauncher__row {
  display: flex;
  align-items: center;
  gap: var(--g-space-3);
  min-height: var(--g-control-h);
  padding: var(--g-space-1) var(--g-space-2);
}
.g-applauncher__text { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.g-applauncher__label { font-size: var(--g-fs-md); font-weight: var(--g-fw-medium); }
.g-applauncher__trail {
  display: block;
  color: var(--g-text-3);
  font-size: var(--g-fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-applauncher__mark { margin-inline-start: var(--g-space-1); color: var(--g-accent-text); font-size: var(--g-fs-sm); }
.g-applauncher__fav { display: inline-flex; flex: none; color: var(--g-warning-text); }
.g-applauncher__fav .g-icon { width: 14px; height: 14px; }
.g-applauncher__option mark.g-match { color: var(--g-accent-text); }

.g-applauncher__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--g-space-2);
  min-width: 0;
  padding: var(--g-space-3) var(--g-space-2) var(--g-space-2);
  text-align: center;
}
.g-applauncher__tile-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  font-size: var(--g-fs-sm);
  font-weight: var(--g-fw-medium);
  line-height: var(--g-lh-tight);
  overflow-wrap: anywhere;
}
.g-applauncher__tile-meta { margin-top: calc(-1 * var(--g-space-1)); color: var(--g-text-3); font-size: var(--g-fs-xs); }

/* empty state */
.g-applauncher__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--g-space-2);
  padding: var(--g-space-8) var(--g-space-4);
  text-align: center;
}
.g-applauncher__empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--g-control-h-lg) + var(--g-space-2));
  height: calc(var(--g-control-h-lg) + var(--g-space-2));
  border-radius: 50%;
  background: var(--g-surface-3);
  color: var(--g-text-3);
}
.g-applauncher__empty-icon .g-icon { width: 24px; height: 24px; }
.g-applauncher__empty-title { margin: 0; font-weight: var(--g-fw-semibold); }
.g-applauncher__empty-hint { margin: 0 0 var(--g-space-2); color: var(--g-text-2); font-size: var(--g-fs-sm); }

/* footer */
.g-applauncher__foot {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--g-space-2);
  padding: var(--g-space-2) var(--g-space-3);
  border-top: var(--g-border-w) solid var(--g-border);
  background: var(--g-surface-2);
}
.g-applauncher__pin { max-width: 100%; min-width: 0; }
.g-applauncher__pin span { overflow: hidden; text-overflow: ellipsis; }
.g-applauncher__pin[aria-pressed="true"] .g-icon { color: var(--g-warning-text); }
.g-applauncher__keys {
  margin-inline-start: auto;
  color: var(--g-text-3);
  font-size: var(--g-fs-xs);
  white-space: nowrap;
}
.g-applauncher__keys kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 var(--g-space-1);
  border: var(--g-border-w) solid var(--g-border);
  border-bottom-width: 2px;
  border-radius: var(--g-radius-xs);
  background: var(--g-surface);
  color: var(--g-text-2);
  font-family: var(--g-font);
  font-size: var(--g-fs-2xs);
  line-height: 1.5;
  text-align: center;
}
.g-applauncher__explorer .g-icon { width: 16px; height: 16px; }

@media (max-width: 640px) {
  .g-popup.g-applauncher {
    width: calc(100vw - 2 * var(--g-space-1));
    max-width: calc(100vw - 2 * var(--g-space-1));
    max-height: calc(100dvh - 4.5rem);
    border-radius: var(--g-radius-lg);
  }
  .g-applauncher__keys { display: none; }
  .g-applauncher__explorer { margin-inline-start: auto; }
  .g-applauncher__grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 6.25rem), 1fr)); }
}
@media (forced-colors: active) {
  .g-applauncher__option.is-active { outline: 2px solid Highlight; outline-offset: -2px; }
  .g-app-tile { border: 1px solid CanvasText; }
}

/* ---- css/components/barcode.css ---- */
/*
 * Gigant UI — QRCodeGenerator + BarcodeGenerator.
 * The symbol itself keeps its own fore/background colours (black on white by default) in every
 * theme: a scanner needs the contrast, and a dark-mode inversion would not scan on many readers.
 */
.g-barcode { display: inline-block; max-width: 100%; line-height: 0; }
.g-barcode__svg,
.g-barcode__canvas { display: block; max-width: 100%; height: auto; }
.g-barcode--qr .g-barcode__svg { border-radius: var(--g-radius-xs); }
.g-barcode__error {
  display: inline-flex; align-items: center; min-height: var(--g-control-h-sm);
  padding: var(--g-space-1) var(--g-space-2);
  line-height: var(--g-lh-tight); font-size: var(--g-fs-sm);
  color: var(--g-danger-text); background: var(--g-danger-subtle);
  border: var(--g-border-w) dashed var(--g-danger); border-radius: var(--g-radius-sm);
}
@media (forced-colors: active) {
  .g-barcode__svg { forced-color-adjust: none; }
}

/* ---- css/components/breadcrumb.css ---- */
/* Gigant UI — Breadcrumb. */
.g-breadcrumb { display: block; min-width: 0; font-size: var(--g-fs-sm); color: var(--g-text-2); }
.g-breadcrumb__list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--g-space-1);
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}
.g-breadcrumb--wrap .g-breadcrumb__list { flex-wrap: wrap; row-gap: var(--g-space-1); }
.g-breadcrumb--scroll .g-breadcrumb__nav { overflow-x: auto; scrollbar-width: thin; }
.g-breadcrumb__item { display: inline-flex; align-items: center; gap: var(--g-space-1); min-width: 0; white-space: nowrap; }
.g-breadcrumb__item.is-active { color: var(--g-text); font-weight: var(--g-fw-semibold); }
.g-breadcrumb__separator { display: inline-flex; align-items: center; color: var(--g-text-3); }
/* the built-in chevron carries .g-icon--flip-rtl, so it points "forward" in RTL too */

.g-breadcrumb__link,
.g-breadcrumb__text {
  display: inline-flex;
  align-items: center;
  gap: var(--g-space-1);
  min-height: 24px;
  max-width: 16rem;
  padding: 2px var(--g-space-1);
  border-radius: var(--g-radius-sm);
  color: inherit;
  font: inherit;
  text-decoration: none;
}
.g-breadcrumb__label { overflow: hidden; text-overflow: ellipsis; }
.g-breadcrumb__link { color: var(--g-accent-text); cursor: pointer; }
.g-breadcrumb__link--button { border: 0; background: transparent; }
.g-breadcrumb__link:hover { text-decoration: underline; background: var(--g-surface-3); }
.g-breadcrumb__link:focus-visible,
.g-breadcrumb__more:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-breadcrumb__item.is-active .g-breadcrumb__link { color: var(--g-text); }
.g-breadcrumb__item.is-disabled .g-breadcrumb__text { color: var(--g-text-disabled); }
.g-breadcrumb__icon { display: inline-flex; color: var(--g-text-2); }
.g-breadcrumb__link .g-breadcrumb__icon { color: inherit; }

.g-breadcrumb__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  padding: 0 var(--g-space-1);
  border: var(--g-border-w) solid transparent;
  border-radius: var(--g-radius-sm);
  background: transparent;
  color: var(--g-text-2);
  font: inherit;
  font-weight: var(--g-fw-bold);
  letter-spacing: 0.08em;
  cursor: pointer;
}
.g-breadcrumb__more:hover,
.g-breadcrumb__more[aria-expanded="true"] { background: var(--g-surface-3); color: var(--g-text); }

.g-breadcrumb__menu { min-width: 12rem; max-height: 20rem; margin: 0; padding: var(--g-space-1); list-style: none; }
.g-breadcrumb__menu .g-option { width: 100%; border: 0; background: transparent; font: inherit; color: var(--g-text); text-decoration: none; text-align: start; gap: var(--g-space-2); }
.g-breadcrumb__menu .g-option:hover,
.g-breadcrumb__menu .g-option:focus { background: var(--g-row-hover); outline: none; }
.g-breadcrumb__menu .g-option:focus-visible { box-shadow: var(--g-focus-ring-inset); }

.g-breadcrumb.is-disabled { opacity: 0.7; }

/* ---- css/components/bulletchart.css ---- */
/*
 * Gigant UI — BulletChart. Shared base: viz.css (neutral bands --g-viz-band-1..3); palette, tooltip,
 * legend swatches and table: chart.css. Qualitative bands stay grey so the value bar (a series
 * colour) and the target (ink) carry the meaning; the darkest band is the lowest range.
 */
.g-viz--bulletchart { min-height: 80px; }
.g-bullet__range { stroke: none; }
.g-bullet__value { pointer-events: none; }
.g-bullet__target { fill: var(--g-text); pointer-events: none; }
.g-bullet__target--cross { fill: none; stroke: var(--g-text); stroke-linecap: round; }
.g-bullet__category { fill: var(--g-text); font-size: var(--g-fs-sm); font-weight: var(--g-fw-medium); }
.g-bullet__datalabel { pointer-events: none; }
.g-bullet__hit { fill: transparent; stroke: none; cursor: default; }
.g-bullet__hit.is-hover { fill: var(--g-chart-hover); }
.g-bullet__hit.g-viz__mark:focus-visible { stroke: var(--g-focus); stroke-width: 2; }
.g-bullet__swatch-target { width: 3px; height: 12px; border-radius: 1px; }

@media (forced-colors: active) {
  .g-bullet__range { forced-color-adjust: none; stroke: CanvasText; stroke-width: 0.5; }
  .g-bullet__target { forced-color-adjust: none; fill: CanvasText; }
  .g-bullet__hit.g-viz__mark:focus-visible { stroke: Highlight; }
}

/* ---- css/components/button.css ---- */
/* Gigant UI — Button. Builds on base .g-btn; only adds what the primitive lacks. */
.g-btn__icon { display: inline-flex; align-items: center; justify-content: center; flex: none; }
/* The label clips (ellipsis), so its line box must hold the whole glyph: with the button's line-height 1 the box was
   1em tall and cut the dots BELOW the baseline in Kurdish / Arabic (چ پ ژ ڕ ی, 2026-10-30). The button's height comes
   from --g-control-h (min-height), not from this line box, so sizes do not change. */
.g-btn__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.g-btn--icon-end { flex-direction: row-reverse; }
.g-btn--icon-stack { flex-direction: column; gap: 2px; padding-block: var(--g-space-2); }
.g-btn--icon-stack.g-btn--icon-end { flex-direction: column-reverse; }

/* Outline + meaning (EJ2 'e-danger e-outline'): transparent fill, coloured text and border */
.g-btn--outline.g-btn--primary { --_bg: transparent; --_fg: var(--g-accent-text); --_bd: var(--g-accent-text); --_bg-hover: var(--g-accent-subtle); --_bg-active: var(--g-accent-subtle-2); }
.g-btn--outline.g-btn--success { --_bg: transparent; --_fg: var(--g-success-text); --_bd: var(--g-success-text); --_bg-hover: var(--g-success-subtle); --_bg-active: var(--g-success-subtle); }
.g-btn--outline.g-btn--danger  { --_bg: transparent; --_fg: var(--g-danger-text);  --_bd: var(--g-danger-text);  --_bg-hover: var(--g-danger-subtle);  --_bg-active: var(--g-danger-subtle); }
.g-btn--outline.g-btn--warning { --_bg: transparent; --_fg: var(--g-warning-text); --_bd: var(--g-warning-text); --_bg-hover: var(--g-warning-subtle); --_bg-active: var(--g-warning-subtle); }
.g-btn--outline.g-btn--info    { --_bg: transparent; --_fg: var(--g-info-text);    --_bd: var(--g-info-text);    --_bg-hover: var(--g-info-subtle);    --_bg-active: var(--g-info-subtle); }
/* Flat + meaning: text only */
.g-btn--flat.g-btn--primary { --_bg: transparent; --_fg: var(--g-accent-text);  --_bd: transparent; --_bg-hover: var(--g-accent-subtle); }
.g-btn--flat.g-btn--success { --_bg: transparent; --_fg: var(--g-success-text); --_bd: transparent; --_bg-hover: var(--g-success-subtle); }
.g-btn--flat.g-btn--danger  { --_bg: transparent; --_fg: var(--g-danger-text);  --_bd: transparent; --_bg-hover: var(--g-danger-subtle); }
.g-btn--flat.g-btn--warning { --_bg: transparent; --_fg: var(--g-warning-text); --_bd: transparent; --_bg-hover: var(--g-warning-subtle); }
.g-btn--flat.g-btn--info    { --_bg: transparent; --_fg: var(--g-info-text);    --_bd: transparent; --_bg-hover: var(--g-info-subtle); }

/* Toggle: pressed = tinted fill + accent border (+ inset edge when not focused), so not colour alone */
.g-btn[aria-pressed="true"] {
  --_bg: var(--g-accent-subtle-2); --_fg: var(--g-text); --_bd: var(--g-accent-text);
  --_bg-hover: var(--g-accent-subtle); --_bg-active: var(--g-accent-subtle-2);
}
.g-btn[aria-pressed="true"]:not(:focus-visible) { box-shadow: inset 0 0 0 1px var(--_bd); }

/* Loading: the base .g-btn.is-loading hides the label and centres the spinner */
.g-btn[aria-disabled="true"]:not(.is-loading) { cursor: not-allowed; }
/* "busy buttons" on an element that is not a .g-btn */
.g-btn-busy { position: relative; pointer-events: none; }
.g-btn-busy:not(.g-btn) { color: transparent; }
.g-btn-busy:not(.g-btn) > .g-btn__spinner { position: absolute; inset: 0; margin: auto; }

@media (forced-colors: active) {
  .g-btn[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}

/* ---- css/components/calendars.css ---- */
/*
 * Gigant UI — calendars family: Calendar, DatePicker, TimePicker, DateTimePicker, DateRangePicker.
 *
 *   .g-cal              the calendar engine (inline Calendar and every picker popup)
 *   .g-calendar         inline Calendar host (a bordered surface)
 *   .g-picker           field wrapper of a picker (.g-field or .g-input, + --date/--time/--datetime/--range)
 *   .g-picker-popup     popup content (+ --time, --datetime, --range)
 *   .g-time-list        time step list (TimePicker, DateTimePicker)
 *   .g-range-presets    preset list of the DateRangePicker
 *
 * Tokens only. The one theme-specific rule is the day shape: Gigant draws round days (its pill
 * language), Gigant Fluent draws its calendar with softly squared days.
 */

/* ------------------------------------------------------------------ engine */
.g-cal {
  --_cell: max(28px, calc(var(--g-control-h) - 2px));   /* a day button (cell - 4px) never drops under 24px */
  --_day-radius: var(--g-radius-pill);
  display: inline-flex;
  flex-direction: column;
  gap: var(--g-space-2);
  padding: var(--g-space-3);
  color: var(--g-text);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  user-select: none;
  max-width: 100%;
}
/* Gigant Fluent calendars use squared days with a small radius (genuine design difference) */
[data-gui-theme="gigant-fluent"] .g-cal { --_day-radius: var(--g-radius-sm); }

.g-cal__header { display: flex; align-items: center; gap: var(--g-space-1); min-height: var(--g-control-h-sm); }
.g-cal__spacer { flex: 1 1 auto; }
.g-cal__title {
  display: inline-flex; align-items: center;
  min-height: var(--g-control-h-sm);
  padding: 0 var(--g-space-2);
  border: 0; border-radius: var(--g-radius-sm);
  background: transparent; color: var(--g-text);
  font: inherit; font-weight: var(--g-fw-semibold);
  cursor: pointer;
}
.g-cal__title:hover:not(:disabled) { background: var(--g-surface-3); }
.g-cal__title:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-cal__title:disabled { cursor: default; color: var(--g-text); }
.g-cal__nav:disabled { background: transparent; border-color: transparent; }

.g-cal__body { display: flex; flex-wrap: wrap; gap: var(--g-space-6); }
.g-cal__month { display: flex; flex-direction: column; gap: var(--g-space-1); }
.g-cal__caption { text-align: center; font-weight: var(--g-fw-semibold); font-size: var(--g-fs-sm); color: var(--g-text-2); }

.g-cal__grid { border-collapse: separate; border-spacing: 0 2px; table-layout: fixed; }
.g-cal__dow,
.g-cal__wk {
  width: var(--_cell);
  height: 24px;
  padding: 0;
  font-size: var(--g-fs-xs);
  font-weight: var(--g-fw-medium);
  color: var(--g-text-3);
  text-align: center;
}
.g-cal__wk { color: var(--g-text-3); font-weight: var(--g-fw-regular); }

.g-cal__cell {
  position: relative;
  width: var(--_cell);
  height: var(--_cell);
  padding: 0;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  outline: none;
}
.g-cal__num {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--_cell) - 4px);
  height: calc(var(--_cell) - 4px);
  border-radius: var(--_day-radius);
  font-variant-numeric: tabular-nums;
  transition: background-color var(--g-dur-fast) var(--g-ease);
}
.g-cal__cell:hover .g-cal__num { background: var(--g-surface-3); }
.g-cal__cell:focus-visible .g-cal__num { box-shadow: var(--g-focus-ring); }
.g-cal__cell.is-other { color: var(--g-text-3); }
.g-cal__cell.is-today .g-cal__num { font-weight: var(--g-fw-bold); box-shadow: inset 0 0 0 1.5px var(--g-accent-text); }
.g-cal__cell.is-today:focus-visible .g-cal__num { box-shadow: inset 0 0 0 1.5px var(--g-accent-text), var(--g-focus-ring); }
.g-cal__cell.is-selected .g-cal__num,
.g-cal__cell.is-selected:hover .g-cal__num {
  background: var(--g-accent);
  color: var(--g-text-on-accent);
  font-weight: var(--g-fw-semibold);
}
.g-cal__cell.is-disabled { color: var(--g-text-disabled); cursor: not-allowed; }
.g-cal__cell.is-disabled .g-cal__num { text-decoration: line-through; }
.g-cal__cell.is-disabled:hover .g-cal__num { background: transparent; }
.g-cal__cell.is-empty { cursor: default; }

/* year / decade cells */
.g-cal[data-view="year"] .g-cal__cell,
.g-cal[data-view="decade"] .g-cal__cell { width: calc(var(--_cell) * 1.85); height: calc(var(--_cell) * 1.5); }
.g-cal__mcell .g-cal__num { width: calc(100% - 8px); border-radius: var(--g-control-radius); }

/* range band: drawn behind the day number, stretched from the start to the end */
.g-cal__cell.is-in-range::before,
.g-cal__cell.is-range-start::before,
.g-cal__cell.is-range-end::before {
  content: "";
  position: absolute;
  top: 2px; bottom: 2px;
  inset-inline: 0;
  background: var(--g-accent-subtle);
}
.g-cal__cell.is-range-start::before { inset-inline-start: 50%; }
.g-cal__cell.is-range-end::before { inset-inline-end: 50%; }
.g-cal__cell.is-range-start.is-range-end::before { display: none; }
.g-cal__cell.is-preview::before { background: var(--g-accent-subtle); opacity: .7; border-block: 1px dashed var(--g-accent-text); }
.g-cal__cell.is-range-start .g-cal__num,
.g-cal__cell.is-range-end .g-cal__num { background: var(--g-accent); color: var(--g-text-on-accent); font-weight: var(--g-fw-semibold); }

.g-cal__footer {
  display: flex;
  justify-content: center;
  padding-top: var(--g-space-2);
  border-top: var(--g-border-w) solid var(--g-border);
}
.g-cal__today { color: var(--g-accent-text); }

/* ------------------------------------------------------------------ inline Calendar */
.g-calendar {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  background: var(--g-surface);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-surface-radius);
  box-shadow: var(--g-shadow-1);
}
.g-calendar.is-disabled { opacity: .6; }

/* ------------------------------------------------------------------ picker fields */
.g-picker .g-input__control { font-variant-numeric: tabular-nums; }
.g-picker.g-input,
.g-picker > .g-input { padding-inline-end: var(--g-space-1); }

/* ------------------------------------------------------------------ popups */
.g-popup.g-cal-popup { max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto; }
.g-picker-popup__row { display: flex; flex-wrap: wrap; align-items: stretch; }
.g-picker-popup__times {
  display: flex;
  flex-direction: column;
  width: 7.5rem;
  border-inline-start: var(--g-border-w) solid var(--g-border);
}
.g-picker-popup__times-head {
  padding: var(--g-space-3) var(--g-space-3) var(--g-space-1);
  font-size: var(--g-fs-xs);
  font-weight: var(--g-fw-semibold);
  color: var(--g-text-3);
}
.g-time-list { overflow: auto; max-height: 16rem; scrollbar-width: thin; scrollbar-color: var(--g-scrollbar) transparent; }
.g-picker-popup--datetime .g-time-list { flex: 1 1 0; min-height: 8rem; max-height: none; }
.g-time-list__item { justify-content: center; font-variant-numeric: tabular-nums; }

.g-range-presets {
  min-width: 9rem;
  padding: var(--g-space-2);
  border-inline-end: var(--g-border-w) solid var(--g-border);
}
.g-range-presets .g-option:focus-visible { box-shadow: var(--g-focus-ring-inset); outline: none; }
.g-range-status {
  padding: var(--g-space-2) var(--g-space-3);
  border-top: var(--g-border-w) solid var(--g-border);
  font-size: var(--g-fs-sm);
  color: var(--g-text-2);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .g-range-presets { min-width: 0; width: 100%; border-inline-end: 0; border-bottom: var(--g-border-w) solid var(--g-border); display: flex; flex-wrap: wrap; gap: var(--g-space-1); }
  .g-picker-popup__times { width: 100%; border-inline-start: 0; border-top: var(--g-border-w) solid var(--g-border); }
  .g-picker-popup--datetime .g-time-list { max-height: 10rem; }
}

@media (forced-colors: active) {
  .g-cal__cell.is-selected .g-cal__num,
  .g-cal__cell.is-range-start .g-cal__num,
  .g-cal__cell.is-range-end .g-cal__num { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .g-cal__cell.is-today .g-cal__num { outline: 1px solid CanvasText; }
  .g-cal__cell:focus-visible .g-cal__num { outline: 2px solid Highlight; }
}

/* ---- css/components/carousel.css ---- */
/* Gigant UI — Carousel. Slide offsets use --_i; the RTL rule only flips the travel direction. */
.g-carousel {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--g-surface-radius);
  background: var(--g-surface-2);
  color: var(--g-text);
}
.g-carousel__viewport { position: relative; overflow: hidden; height: var(--_h, auto); }
.g-carousel__track {
  display: flex;
  height: 100%;
  transform: translateX(calc(var(--_i, 0) * -100%));
  transition: transform var(--g-dur-slow) var(--g-ease);
}
[dir="rtl"] .g-carousel__track { transform: translateX(calc(var(--_i, 0) * 100%)); }
.g-carousel__slide { flex: 0 0 100%; min-width: 0; height: 100%; }
.g-carousel__slide > img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Fade: every slide in one grid cell, only the active one is opaque */
.g-carousel--fade .g-carousel__track { display: grid; transform: none; transition: none; }
.g-carousel--fade .g-carousel__slide { grid-area: 1 / 1; opacity: 0; transition: opacity var(--g-dur-slow) var(--g-ease); }
.g-carousel--fade .g-carousel__slide.is-active { opacity: 1; }
.g-carousel--none .g-carousel__track,
.g-carousel__track.no-anim,
.g-carousel__track.no-anim .g-carousel__slide { transition: none; }

/* previous / next */
.g-carousel__nav,
.g-carousel__play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: var(--g-border-w) solid var(--g-border);
  border-radius: 50%;
  background: var(--g-surface-raised);
  color: var(--g-text);
  box-shadow: var(--g-shadow-2);
  cursor: pointer;
  transition: opacity var(--g-dur-fast) var(--g-ease), background-color var(--g-dur-fast) var(--g-ease);
}
.g-carousel__nav { position: absolute; top: 50%; z-index: 2; translate: 0 -50%; }
.g-carousel__nav--prev { inset-inline-start: var(--g-space-3); }
.g-carousel__nav--next { inset-inline-end: var(--g-space-3); }
.g-carousel__nav[hidden] { display: none; }
.g-carousel__nav:hover:not(:disabled),
.g-carousel__play:hover { background: var(--g-surface-3); }
.g-carousel__nav:disabled { color: var(--g-text-disabled); cursor: not-allowed; box-shadow: none; }
.g-carousel__nav:focus-visible,
.g-carousel__play:focus-visible,
.g-carousel__dot:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-carousel--buttons-visibleonhover .g-carousel__nav { opacity: 0; }
.g-carousel--buttons-visibleonhover:hover .g-carousel__nav,
.g-carousel--buttons-visibleonhover:focus-within .g-carousel__nav { opacity: 1; }

/* rotation control (top end) */
.g-carousel__controls { position: absolute; top: var(--g-space-3); inset-inline-end: var(--g-space-3); z-index: 3; display: flex; gap: var(--g-space-2); }
.g-carousel__controls:empty { display: none; }
.g-carousel__play { width: 32px; height: 32px; }

/* indicators */
.g-carousel__indicators {
  position: absolute;
  bottom: var(--g-space-3);
  left: 50%;
  z-index: 2;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px var(--g-space-1);
  border-radius: var(--g-radius-pill);
  background: var(--g-surface-raised);
  box-shadow: var(--g-shadow-1);
}
.g-carousel__dot {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.g-carousel__dot::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border: var(--g-border-w) solid var(--g-text-2);
  border-radius: var(--g-radius-pill);
  background: transparent;
  transition: width var(--g-dur-fast) var(--g-ease), background-color var(--g-dur-fast) var(--g-ease);
}
.g-carousel__dot:hover::before { background: var(--g-text-3); }
.g-carousel__dot.is-active::before { width: 18px; background: var(--g-accent); border-color: var(--g-accent); }
.g-carousel__fraction { padding: 2px var(--g-space-2); font-size: var(--g-fs-sm); font-variant-numeric: tabular-nums; color: var(--g-text); }

@media (prefers-reduced-motion: reduce) {
  .g-carousel__track, .g-carousel__slide { transition: none; }
}
@media (forced-colors: active) {
  .g-carousel__dot.is-active::before { background: Highlight; border-color: Highlight; }
}

/* ---- css/components/chart.css ---- */
/*
 * Gigant UI — Chart + AccumulationChart.
 *
 * Categorical palette --g-chart-1..8 (assigned in this fixed order, never cycled; a 9th+ slice is
 * --g-chart-other). Validated with the dataviz palette checker against both themes' surfaces:
 *   light (#ffffff):          all 8 >= 3:1, worst adjacent CVD dE 8.7, normal-vision dE 18.5
 *   dark  (#1f1f1f, #292929): all 8 >= 3:1, all checks pass
 * The same values serve Gigant and Gigant Fluent (their chart surfaces are the same white / near-black),
 * so no theme-specific rule is needed.
 */
:root {
  --g-chart-1: #2a78d6;  /* blue */
  --g-chart-2: #c8531f;  /* orange */
  --g-chart-3: #0e8a6a;  /* aqua */
  --g-chart-4: #b37800;  /* yellow */
  --g-chart-5: #c2457a;  /* magenta */
  --g-chart-6: #008300;  /* green */
  --g-chart-7: #6250d6;  /* violet */
  --g-chart-8: #d03b3b;  /* red */
  --g-chart-other: #7a7f88;
  --g-chart-surface: var(--g-surface);
  --g-chart-grid: var(--g-border);
  --g-chart-axis: var(--g-border-input);
  --g-chart-hover: color-mix(in srgb, var(--g-text) 6%, transparent);
}
[data-gui-mode="dark"] {
  --g-chart-1: #3987e5;
  --g-chart-2: #d95926;
  --g-chart-3: #199e70;
  --g-chart-4: #c98500;
  --g-chart-5: #d55181;
  --g-chart-6: #1a9a1a;
  --g-chart-7: #9085e9;
  --g-chart-8: #e66767;
  --g-chart-other: #8b9099;
  --g-chart-hover: color-mix(in srgb, var(--g-text) 9%, transparent);
}

.g-chart {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 160px;
  color: var(--g-text);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
}
.g-chart--legend-left,
.g-chart--legend-right { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); }
.g-chart--legend-left { grid-template-columns: auto minmax(0, 1fr); }
.g-chart--legend-left .g-chart__header,
.g-chart--legend-right .g-chart__header { grid-column: 1 / -1; }
.g-chart--legend-left .g-chart__legend,
.g-chart--legend-right .g-chart__legend { flex-direction: column; align-items: stretch; justify-content: center; padding-inline: var(--g-space-2); }

.g-chart__header { display: flex; align-items: flex-start; gap: var(--g-space-2); padding-block-end: var(--g-space-1); }
.g-chart__titles { flex: 1 1 auto; min-width: 0; }
.g-chart__title { font-size: var(--g-fs-lg); font-weight: var(--g-fw-semibold); line-height: var(--g-lh-tight); color: var(--g-text); }
.g-chart__subtitle { font-size: var(--g-fs-sm); color: var(--g-text-3); margin-block-start: 2px; }
.g-chart__view-toggle { flex: none; margin-inline-start: auto; }
/* no title: the toggle floats in the top-end corner instead of taking a row */
.g-chart__header--bare { position: absolute; inset-block-start: 0; inset-inline-end: 0; z-index: 2; padding: 0; }
.g-chart__header--bare .g-chart__view-toggle { background: var(--g-surface); min-height: 26px; }

.g-chart__body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.g-chart__plot { position: relative; flex: 1 1 auto; min-height: 0; }
.g-chart__plot[hidden], .g-chart__table[hidden] { display: none; }
.g-chart__svg { position: absolute; inset: 0; display: block; overflow: visible; }

/* ---- axes + grid: recessive hairlines, readable labels */
.g-chart__gridline { stroke: var(--g-chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.g-chart__baseline { stroke: var(--g-chart-axis); stroke-width: 1; shape-rendering: crispEdges; }
.g-chart__tick { fill: var(--g-text-3); font-size: var(--g-fs-xs); font-variant-numeric: tabular-nums; }
.g-chart__axis-title { fill: var(--g-text-2); font-size: var(--g-fs-xs); font-weight: var(--g-fw-medium); }
.g-chart__hover-band { fill: var(--g-chart-hover); pointer-events: none; }
.g-chart__crosshair { stroke: var(--g-text-3); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }

/* ---- marks */
.g-chart__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.g-chart__area { stroke: none; pointer-events: none; }
.g-chart__bar { cursor: default; transition: filter var(--g-dur-fast) var(--g-ease); }
.g-chart__bar.is-hover { filter: brightness(1.08) saturate(1.1); }
.g-chart__marker { stroke: var(--g-chart-surface); stroke-width: 2; }
.g-chart__marker.is-hidden { fill-opacity: 0; stroke-opacity: 0; }
.g-chart__marker.is-hover,
.g-chart__marker.is-hidden.is-hover { fill-opacity: 1; stroke-opacity: 1; }
.g-chart__point { outline: none; }
.g-chart__point:focus-visible { stroke: var(--g-focus); stroke-width: 3; stroke-opacity: 1; fill-opacity: 1; }
.g-chart__datalabel { fill: var(--g-text-2); font-size: var(--g-fs-xs); font-weight: var(--g-fw-medium); font-variant-numeric: tabular-nums; pointer-events: none; }
.g-chart__datalabel.is-inside { fill: var(--g-on-solid); }
.g-chart__datalabel.is-inside.is-dark { fill: var(--g-text-on-accent); }
.g-chart__leader { fill: none; stroke: var(--g-text-3); stroke-width: 1; }

/* ---- pie / doughnut */
.g-chart__slice { stroke: var(--g-chart-surface); stroke-width: 2; stroke-linejoin: round; cursor: pointer; transition: transform var(--g-dur) var(--g-ease), filter var(--g-dur-fast) var(--g-ease); }
.g-chart__slice[role="img"] { cursor: default; }
.g-chart__slice.is-hover { filter: brightness(1.08) saturate(1.1); }
.g-chart__slice:focus-visible { stroke: var(--g-focus); stroke-width: 3; }
.g-chart__center-main { fill: var(--g-text); font-size: var(--g-fs-xl); font-weight: var(--g-fw-semibold); font-variant-numeric: tabular-nums; }
.g-chart__center-sub { fill: var(--g-text-3); font-size: var(--g-fs-xs); }

/* ---- entrance animation (first paint only; base.css shortens it under reduced motion) */
.g-chart--animate .g-chart__bar { transform-box: fill-box; transform-origin: 50% 100%; animation: g-chart-grow var(--g-dur-slow) var(--g-ease) both; }
.g-chart--animate .g-chart__series--bar .g-chart__bar,
.g-chart--animate .g-chart__series--stackingbar .g-chart__bar { transform-origin: 0 50%; animation-name: g-chart-grow-x; }
.g-chart--animate .g-chart__line[pathLength] { stroke-dasharray: 1; animation: g-chart-draw calc(var(--g-dur-slow) * 2) var(--g-ease) both; }
.g-chart--animate .g-chart__area,
.g-chart--animate .g-chart__marker,
.g-chart--animate .g-chart__labels,
.g-chart--animate .g-chart__line:not([pathLength]) { animation: g-chart-fade var(--g-dur-slow) var(--g-ease) both; }
.g-chart--animate .g-chart__slices { transform-box: fill-box; transform-origin: 50% 50%; animation: g-chart-pop var(--g-dur-slow) var(--g-ease) both; }
@keyframes g-chart-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes g-chart-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes g-chart-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes g-chart-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes g-chart-pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }

/* ---- legend: toggle buttons */
.g-chart__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--g-space-1) var(--g-space-2); padding-block: var(--g-space-2) 0; }
.g-chart--legend-top .g-chart__legend { padding-block: 0 var(--g-space-2); }
.g-chart__legend[hidden] { display: none; }
.g-chart__legend.is-disabled { opacity: .6; pointer-events: none; }
.g-chart__legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 24px; padding: 2px 8px;
  border: 0; border-radius: var(--g-radius-sm);
  background: transparent; color: var(--g-text-2);
  font: inherit; font-size: var(--g-fs-sm); cursor: pointer; text-align: start;
}
.g-chart__legend-item:hover { background: var(--g-surface-3); color: var(--g-text); }
.g-chart__legend-item:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-chart__legend-item.is-off { color: var(--g-text-3); }
.g-chart__legend-item.is-off .g-chart__legend-text { text-decoration: line-through; }
.g-chart__swatch { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: var(--g-radius-2xs); background: var(--_c, currentColor); }
.g-chart__swatch--dot { border-radius: 50%; }
.g-chart__swatch--line { width: 14px; height: 3px; border-radius: var(--g-radius-2xs); }
.g-chart__swatch--area { border-radius: var(--g-radius-2xs); box-shadow: inset 0 3px 0 0 var(--_c); background: color-mix(in srgb, var(--_c) 30%, transparent); }
.g-chart__legend-item.is-off .g-chart__swatch { background: transparent; box-shadow: inset 0 0 0 1.5px var(--_c); }

/* ---- tooltip */
.g-chart__tooltip {
  position: absolute; z-index: 3; pointer-events: none;
  min-width: 120px; max-width: min(280px, 90%);
  padding: var(--g-space-2) var(--g-space-3);
  background: var(--g-surface-raised); color: var(--g-text);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-radius-md);
  box-shadow: var(--g-shadow-3);
  font-size: var(--g-fs-sm); line-height: var(--g-lh-tight);
}
.g-chart__tooltip[hidden] { display: none; }
.g-chart__tip-head { font-weight: var(--g-fw-semibold); margin-block-end: 6px; }
.g-chart__tip-row { display: flex; align-items: center; gap: 6px; }
.g-chart__tip-row + .g-chart__tip-row { margin-block-start: 4px; }
.g-chart__tip-name { flex: 1 1 auto; color: var(--g-text-2); }
.g-chart__tip-value { margin-inline-start: auto; font-weight: var(--g-fw-semibold); font-variant-numeric: tabular-nums; }

/* ---- empty state */
.g-chart__empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--g-space-2);
  color: var(--g-text-3); font-size: var(--g-fs-sm); text-align: center; padding: var(--g-space-4);
}
.g-chart__empty[hidden] { display: none; }
.g-chart__empty .g-icon { width: 24px; height: 24px; }

/* ---- table view */
.g-chart__table { flex: 1 1 auto; min-height: 0; overflow: auto; border: var(--g-border-w) solid var(--g-border); border-radius: var(--g-radius-md); }
.g-chart__table:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-chart__datatable { width: 100%; border-collapse: collapse; font-size: var(--g-fs-sm); }
.g-chart__datatable th,
.g-chart__datatable td { padding: 6px 10px; border-bottom: var(--g-border-w) solid var(--g-border); text-align: start; white-space: nowrap; }
.g-chart__datatable thead th { position: sticky; top: 0; background: var(--g-surface-2); color: var(--g-text-2); font-weight: var(--g-fw-semibold); }
.g-chart__datatable tbody th { font-weight: var(--g-fw-regular); color: var(--g-text); }
.g-chart__datatable .is-num { text-align: end; font-variant-numeric: tabular-nums; }

@media (forced-colors: active) {
  .g-chart__bar, .g-chart__slice { forced-color-adjust: none; stroke: CanvasText; stroke-width: 1; }
  .g-chart__line { forced-color-adjust: none; }
  .g-chart__point:focus-visible { stroke: Highlight; }
}

/* ---- css/components/checkbox.css ---- */
/* Gigant UI — CheckBox / RadioButton / Switch. The controls are the base .g-check / .g-switch. */
.g-check-label__text { min-width: 0; }
.g-check-label__text[hidden] { display: none; }
.g-check-label--before { flex-direction: row-reverse; justify-content: flex-end; }
.g-check-label.is-readonly,
.g-check-label.is-readonly .g-check,
.g-check-label.is-readonly .g-switch { cursor: default; }
.g-check-label.is-disabled .g-check-label__text { color: var(--g-text-disabled); }

.g-switch-label__state { min-width: 2em; font-size: var(--g-fs-sm); color: var(--g-text-2); }
.g-switch-label__state[hidden] { display: none; }
.g-switch-label.is-disabled .g-switch-label__state { color: var(--g-text-disabled); }

/* Layout helper for a set of radios / checkboxes */
.g-choice-group { display: flex; flex-wrap: wrap; gap: var(--g-space-2) var(--g-space-5); border: 0; margin: 0; padding: 0; min-width: 0; }
.g-choice-group--vertical { flex-direction: column; gap: var(--g-space-1); }
.g-choice-group > legend { padding: 0; margin-bottom: var(--g-space-1); font-size: var(--g-fs-sm); font-weight: var(--g-fw-medium); color: var(--g-text-2); }

/* ---- css/components/chips.css ---- */
/* Gigant UI — ChipList. Chips are the base .g-chip; this adds interaction states. */
.g-chiplist { display: flex; flex-wrap: wrap; align-items: center; gap: var(--g-space-2); min-width: 0; }
.g-chiplist__chip {
  min-height: var(--g-input-btn);
  padding-inline: var(--g-space-3);
  cursor: pointer;
  user-select: none;
  transition: background-color var(--g-dur-fast) var(--g-ease), border-color var(--g-dur-fast) var(--g-ease);
}
.g-chiplist__chip:hover { background: var(--g-surface-3); border-color: var(--g-border-input); }
.g-chiplist__chip.is-selected { font-weight: var(--g-fw-medium); }
.g-chiplist__chip.is-selected:hover { background: var(--g-accent-subtle-2); border-color: var(--g-accent-text); }
.g-chiplist__chip.is-disabled { color: var(--g-text-disabled); background: var(--g-surface-2); border-color: var(--g-border); cursor: not-allowed; }
.g-chiplist.is-disabled .g-chiplist__chip { cursor: not-allowed; }
.g-chip__icon { display: inline-flex; align-items: center; color: var(--g-text-2); }
.g-chip__check { display: none; color: var(--g-accent-text); }
.g-chiplist__chip.is-selected .g-chip__check { display: inline-flex; }
/* the × is a pointer shortcut (Delete key is the keyboard path): 24px target */
.g-chiplist__remove { width: var(--g-icon-btn); height: var(--g-icon-btn); margin-inline: -2px -8px; }
.g-chiplist__chip:has(.g-chiplist__remove) { padding-inline-end: var(--g-space-2); }

/* ---- css/components/colorpicker.css ---- */
/* Gigant UI — ColorPicker. Trigger is a .g-btn, the popup a .g-popup, the hex field a .g-input. */
.g-colorpicker { display: inline-flex; max-width: 100%; min-width: 0; }
.g-colorpicker__trigger { gap: var(--g-space-2); padding-inline: var(--g-space-2); font-weight: var(--g-fw-regular); }
.g-colorpicker__swatch {
  width: 20px; height: 20px; flex: none;
  border-radius: var(--g-radius-xs);
  border: 1px solid var(--g-border-strong);
}
.g-colorpicker__hex { font-family: var(--g-font-mono); font-size: var(--g-fs-sm); color: var(--g-text-2); }
.g-colorpicker__caret { color: var(--g-text-3); }
/* "no colour": a struck-through empty swatch */
.g-colorpicker__swatch.is-none,
.g-colorpicker__tile.is-none {
  background: linear-gradient(to top right, transparent calc(50% - 1px), var(--g-danger) 50%, transparent calc(50% + 1px)), var(--g-surface);
}

.g-colorpicker__panel {
  display: flex; flex-direction: column; gap: var(--g-space-3);
  width: min(344px, calc(100vw - 16px));
  padding: var(--g-space-3);
}
.g-popup.g-colorpicker__panel { max-height: none; overflow: visible; }
.g-colorpicker--inline .g-colorpicker__panel {
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-popup-radius);
  background: var(--g-surface);
}
.g-colorpicker--inline.is-disabled .g-colorpicker__panel { opacity: .6; }

.g-colorpicker__palette {
  display: grid;
  grid-template-columns: repeat(var(--_cols, 10), minmax(0, 1fr));
  gap: 6px;
  padding: 2px;
}
.g-colorpicker__tile {
  position: relative;
  aspect-ratio: 1;
  min-width: 24px;
  border-radius: var(--g-radius-xs);
  border: 1px solid var(--g-border);
  cursor: pointer;
}
.g-colorpicker__tile:hover { transform: scale(1.08); }
.g-colorpicker__tile.is-selected { z-index: 1; box-shadow: 0 0 0 2px var(--g-surface-raised), 0 0 0 4px var(--g-text); }
/* the selected swatch also carries a centre dot (white with a dark rim, visible on any colour), so
   selection never depends on the ring alone — in Fluent dark the focus ring is white too */
.g-colorpicker__tile.is-selected::after {
  content: ""; position: absolute; inset: 32%;
  border-radius: 50%;
  background: var(--g-on-solid);
  box-shadow: 0 0 0 1.5px var(--g-overlay);
}
.g-colorpicker__tile.is-none.is-selected::after { inset: 36%; }
.g-colorpicker__tile:focus-visible { outline: none; z-index: 2; box-shadow: var(--g-focus-ring); }

.g-colorpicker__picker { display: flex; flex-direction: column; gap: var(--g-space-3); }
.g-colorpicker__sv {
  position: relative;
  height: 160px;
  border-radius: var(--g-radius-sm);
  cursor: crosshair;
  touch-action: none;
}
.g-colorpicker__hue { position: relative; height: 14px; margin-inline: 7px; border-radius: var(--g-radius-pill); cursor: pointer; touch-action: none; }
.g-colorpicker__sv:focus-visible,
.g-colorpicker__hue:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-colorpicker__thumb {
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px var(--g-on-solid), 0 0 0 3px var(--g-overlay), inset 0 0 0 1px var(--g-overlay);
  pointer-events: none;
}
.g-colorpicker__thumb--hue { top: 50%; }
.g-colorpicker__row { display: flex; align-items: center; gap: var(--g-space-2); }
.g-colorpicker__preview {
  display: inline-flex; flex: none;
  width: 48px; height: 28px;
  border: 1px solid var(--g-border-strong);
  border-radius: var(--g-radius-sm);
  overflow: hidden;
}
.g-colorpicker__preview > span { flex: 1; }
.g-colorpicker__hexlabel { font-size: var(--g-fs-sm); color: var(--g-text-2); }
.g-colorpicker__hexbox { flex: 1 1 auto; }
.g-colorpicker__hexbox .g-input__control { font-family: var(--g-font-mono); }
.g-colorpicker__footer {
  display: flex; align-items: center; gap: var(--g-space-2);
  padding-top: var(--g-space-2);
  border-top: var(--g-border-w) solid var(--g-border);
}
.g-colorpicker__spacer { flex: 1; }
@media (forced-colors: active) {
  .g-colorpicker__tile, .g-colorpicker__swatch { forced-color-adjust: none; }
  .g-colorpicker__tile.is-selected { outline: 3px solid Highlight; }
}

/* ---- css/components/diagram.css ---- */
/* Gigant UI — Diagram (read-only workflow diagram). */
:root {
  --g-diagram-forward: var(--g-text-2);
  --g-diagram-backward: var(--g-warning-text);
  --g-diagram-jump: var(--g-info-text);
}
.g-diagram { display: flex; flex-direction: column; min-width: 0; color: var(--g-text); font-family: var(--g-font); }
.g-diagram__canvas {
  position: relative; overflow: hidden; min-height: 12rem;
  background-color: var(--g-surface);
  background-image: radial-gradient(circle, var(--g-border) 1px, transparent 1.2px);
  background-size: 20px 20px;
  border: var(--g-border-w) solid var(--g-border); border-radius: var(--g-radius-lg);
}
.g-diagram__svg { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; user-select: none; }
.g-diagram__svg.is-panning { cursor: grabbing; }
.g-diagram__empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--g-text-3); font-size: var(--g-fs-sm); padding: var(--g-space-4); text-align: center; }

/* nodes */
.g-diagram__node { cursor: pointer; outline: none; }
.g-diagram__shape { fill: var(--g-surface); stroke: var(--g-border-input); stroke-width: 1.5; transition: stroke var(--g-dur-fast) var(--g-ease); }
.g-diagram__node:hover .g-diagram__shape { stroke: var(--g-border-strong); }
.g-diagram__node--initial .g-diagram__shape { fill: var(--g-success-subtle); stroke: var(--g-success-text); stroke-width: 2.5; }
.g-diagram__node--done .g-diagram__shape,
.g-diagram__node--terminal .g-diagram__shape { fill: var(--g-surface-2); stroke: var(--g-success-text); stroke-width: 2.5; stroke-dasharray: 6 3; }
.g-diagram__node--rejected .g-diagram__shape { fill: var(--g-danger-subtle); stroke: var(--g-danger-text); stroke-width: 2.5; stroke-dasharray: 6 3; }
.g-diagram__node--decision .g-diagram__shape { fill: var(--g-info-subtle); stroke: var(--g-info-text); }
.g-diagram__text { fill: var(--g-text); font-size: var(--g-fs-sm); font-weight: var(--g-fw-semibold); pointer-events: none; }
.g-diagram__focus { fill: none; stroke: none; pointer-events: none; }
.g-diagram__node:focus-visible .g-diagram__focus { stroke: var(--g-focus); stroke-width: 2.5; }
.g-diagram__node.is-selected .g-diagram__shape { stroke: var(--g-accent-text); stroke-width: 3; stroke-dasharray: none; }
.g-diagram__node.is-selected .g-diagram__focus { stroke: var(--g-accent-text); stroke-width: 1.5; stroke-dasharray: 3 3; }

/* connectors: kind is carried by dash pattern AND colour (legend explains both) */
.g-diagram__connector { fill: none; stroke: var(--g-diagram-forward); stroke-width: 2; stroke-linejoin: round; transition: opacity var(--g-dur-fast) var(--g-ease); }
.g-diagram__connector--backward { stroke: var(--g-diagram-backward); stroke-dasharray: 7 4; }
.g-diagram__connector--jump { stroke: var(--g-diagram-jump); stroke-dasharray: 2 4; stroke-linecap: round; }
.g-diagram__arrow { fill: var(--g-diagram-forward); }
.g-diagram__arrow--backward { fill: var(--g-diagram-backward); }
.g-diagram__arrow--jump { fill: var(--g-diagram-jump); }
.g-diagram__svg.has-selection .g-diagram__connector:not(.is-related) { opacity: .3; }
.g-diagram__connector.is-related { stroke-width: 2.5; }
.g-diagram__clabel rect { fill: var(--g-surface); stroke: var(--g-border); }
.g-diagram__clabel text { fill: var(--g-text-2); font-size: var(--g-fs-2xs); }

/* zoom tools */
.g-diagram__tools {
  position: absolute; inset-block-start: var(--g-space-2); inset-inline-end: var(--g-space-2); z-index: 2;
  display: flex; align-items: center; gap: 2px; padding: 2px;
  background: var(--g-surface-raised); border: var(--g-border-w) solid var(--g-border); border-radius: var(--g-radius-md); box-shadow: var(--g-shadow-2);
}
.g-diagram__tool { border-color: transparent; }
.g-diagram__zoom { min-width: 3.2em; text-align: center; font-size: var(--g-fs-xs); color: var(--g-text-2); font-variant-numeric: tabular-nums; }
.g-diagram__tooltip {
  position: absolute; z-index: 3; pointer-events: none; max-width: 16rem;
  padding: 4px 8px; font-size: var(--g-fs-xs);
  background: var(--g-surface-raised); color: var(--g-text);
  border: var(--g-border-w) solid var(--g-border); border-radius: var(--g-radius-sm); box-shadow: var(--g-shadow-2);
}
.g-diagram__tooltip[hidden] { display: none; }

/* legend + text alternative */
.g-diagram__footer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--g-space-2) var(--g-space-4); padding-block: var(--g-space-2) 0; }
.g-diagram__legend { display: flex; flex-wrap: wrap; gap: var(--g-space-1) var(--g-space-4); margin: 0; padding: 0; list-style: none; font-size: var(--g-fs-xs); color: var(--g-text-2); flex: 1 1 auto; }
.g-diagram__legend-item { display: inline-flex; align-items: center; gap: 6px; }
.g-diagram__legend-line .g-diagram__connector { stroke-width: 2; }
.g-diagram__legend-node { display: inline-block; width: 16px; height: 12px; border-radius: var(--g-radius-xs); border: 2px solid var(--g-border-input); background: var(--g-surface); }
.g-diagram__legend-node--initial { border-color: var(--g-success-text); background: var(--g-success-subtle); }
.g-diagram__legend-node--done, .g-diagram__legend-node--terminal { border: 2px dashed var(--g-success-text); border-radius: var(--g-radius-sm); background: var(--g-surface-2); }
.g-diagram__legend-node--rejected { border: 2px dashed var(--g-danger-text); border-radius: var(--g-radius-sm); background: var(--g-danger-subtle); }
.g-diagram__list-toggle { margin-inline-start: auto; }
.g-diagram__list { margin: var(--g-space-2) 0 0; padding: var(--g-space-2) var(--g-space-3) var(--g-space-2) var(--g-space-8); font-size: var(--g-fs-sm); color: var(--g-text-2); background: var(--g-surface-2); border-radius: var(--g-radius-md); }
.g-diagram__list[hidden] { display: none; }
.g-diagram__list li + li { margin-block-start: 2px; }

@media (forced-colors: active) {
  .g-diagram__shape { stroke: CanvasText; }
  .g-diagram__node:focus-visible .g-diagram__focus { stroke: Highlight; }
  .g-diagram__connector { stroke: CanvasText; }
  .g-diagram__arrow { fill: CanvasText; }
}

/* ---- css/components/dialog.css ---- */
/*
 * Gigant UI — Dialog + DialogUtility.
 *
 *   .g-dialog-layer            fixed (or contained) full-cover layer; owns z-index, centres the dialog
 *   .g-dialog-layer__scrim     modal scrim (.g-scrim)
 *   .g-dialog                  the surface: header / content (scrolls) / error / footer (both sticky)
 *   .g-dialog.is-placed        dragged/resized: absolute at --g-dialog-x/y
 *   .g-dialog.is-maximized     fills the layer minus a gutter
 * Sizes come from custom properties set by JS (--g-dialog-w/-h/-min-h/-min-w/-max-w/-max-h) so the
 * phone breakpoint can override them without !important.
 */
.g-dialog-layer {
  position: fixed;
  inset: 0;
  z-index: var(--g-z-dialog);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--g-space-4);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  line-height: var(--g-lh);
  color: var(--g-text);
}
.g-dialog-layer[hidden] { display: none; }
.g-dialog-layer--contained { position: absolute; }
.g-dialog-layer__scrim { position: absolute; inset: 0; z-index: auto; }
.g-dialog-layer__scrim[hidden] { display: none; }
.g-dialog-layer--modeless { pointer-events: none; }
.g-dialog-layer--modeless > .g-dialog { pointer-events: auto; }
.g-dialog-layer[data-x="start"] { justify-content: flex-start; }
.g-dialog-layer[data-x="end"] { justify-content: flex-end; }
.g-dialog-layer[data-y="start"] { align-items: flex-start; }
.g-dialog-layer[data-y="end"] { align-items: flex-end; }

.g-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: var(--g-dialog-w, auto);
  min-width: min(var(--g-dialog-min-w, 320px), 100%);
  max-width: var(--g-dialog-max-w, 100%);
  height: var(--g-dialog-h, auto);
  min-height: var(--g-dialog-min-h, 0);
  max-height: var(--g-dialog-max-h, 100%);
  background: var(--g-surface-raised);
  color: var(--g-text);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-surface-radius);
  box-shadow: var(--g-shadow-4);
  outline: none;
  overflow: hidden;
}
.g-dialog:focus-visible { box-shadow: var(--g-shadow-4), var(--g-focus-ring); }
.g-dialog.is-placed {
  position: absolute;
  left: var(--g-dialog-x, 0);
  top: var(--g-dialog-y, 0);
  margin: 0;
}

/* ---------------------------------------------------------------- header */
.g-dialog__header {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--g-space-2);
  min-height: var(--g-header-h);
  padding: var(--g-space-3) var(--g-space-4) var(--g-space-3) var(--g-space-5);
  border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-dialog__header[hidden] { display: none; }
.g-dialog__header.is-draggable { cursor: move; user-select: none; touch-action: none; }
.g-dialog__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: var(--g-fs-lg);
  font-weight: var(--g-fw-semibold);
  line-height: var(--g-lh-tight);
  text-align: start;
  overflow-wrap: anywhere;
}
.g-dialog__title[hidden] { display: none; }
.g-dialog__title:empty + .g-dialog__actions { margin-inline-start: auto; }
.g-dialog__actions { flex: none; display: inline-flex; align-items: center; gap: var(--g-space-1); margin-inline-end: calc(-1 * var(--g-space-1)); }
.g-dialog__icon-btn { color: var(--g-text-2); cursor: pointer; }

/* ---------------------------------------------------------------- body */
.g-dialog__content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: var(--g-space-4) var(--g-space-5);
}
.g-dialog.is-busy .g-dialog__content { pointer-events: none; }
/* The body's padding is the only inset: content starts and ends flush with it. */
.g-dialog__content > :first-child { margin-block-start: 0; }
.g-dialog__content > :last-child { margin-block-end: 0; }
.g-dialog__error { display: none; }
.g-dialog__error.is-visible {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: var(--g-space-2);
  margin: 0 var(--g-space-5) var(--g-space-3);
  padding: var(--g-space-2) var(--g-space-3);
  border: var(--g-border-w) solid var(--g-danger);
  border-radius: var(--g-radius-md);
  background: var(--g-danger-subtle);
  color: var(--g-danger-text);
  font-size: var(--g-fs-sm);
}
.g-dialog__error-icon { margin-top: 2px; }

/* ---------------------------------------------------------------- footer */
.g-dialog__footer {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--g-space-2);
  padding: var(--g-space-3) var(--g-space-5);
  border-top: var(--g-border-w) solid var(--g-border);
}
.g-dialog__footer[hidden] { display: none; }
.g-dialog__footer .g-btn.is-disabled { pointer-events: none; }
.g-dialog__btn--push { margin-inline-start: auto; }
/* e-danger + e-flat: a quiet destructive action (Delete on the leading side of a form footer) */
.g-btn--danger.g-btn--subtle { --_fg: var(--g-danger-text); --_bg-hover: var(--g-danger-subtle); --_bg-active: var(--g-danger-subtle); }

/* Gigant Fluent dialogs: no dividers, 24px surface padding, subtitle1 (20/28 semibold) title. */
[data-gui-theme="gigant-fluent"] .g-dialog__header { border-bottom: 0; padding: var(--g-space-6) var(--g-space-5) var(--g-space-2) var(--g-space-6); min-height: 0; }
[data-gui-theme="gigant-fluent"] .g-dialog__title { font-size: var(--g-fs-xl); line-height: 28px; }
[data-gui-theme="gigant-fluent"] .g-dialog__content { padding: var(--g-space-2) var(--g-space-6); }
[data-gui-theme="gigant-fluent"] .g-dialog__error.is-visible { margin-inline: var(--g-space-6); }
[data-gui-theme="gigant-fluent"] .g-dialog__footer { border-top: 0; padding: var(--g-space-6); padding-top: var(--g-space-4); }

/* ---------------------------------------------------------------- resize */
.g-dialog__resize { position: absolute; z-index: 2; touch-action: none; }
.g-dialog__resize--n, .g-dialog__resize--s { left: 12px; right: 12px; height: 8px; cursor: ns-resize; }
.g-dialog__resize--n { top: 0; } .g-dialog__resize--s { bottom: 0; }
.g-dialog__resize--e, .g-dialog__resize--w { top: 12px; bottom: 12px; width: 8px; cursor: ew-resize; }
.g-dialog__resize--e { right: 0; } .g-dialog__resize--w { left: 0; }
.g-dialog__resize--ne, .g-dialog__resize--nw, .g-dialog__resize--se, .g-dialog__resize--sw { width: 14px; height: 14px; }
.g-dialog__resize--ne { top: 0; right: 0; cursor: nesw-resize; }
.g-dialog__resize--sw { bottom: 0; left: 0; cursor: nesw-resize; }
.g-dialog__resize--nw { top: 0; left: 0; cursor: nwse-resize; }
.g-dialog__resize--se { bottom: 0; right: 0; cursor: nwse-resize; }
.g-dialog__grip {
  position: absolute;
  z-index: 3;
  bottom: 0;
  inset-inline-end: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  border: 0;
  border-end-end-radius: var(--g-surface-radius);
  background: transparent;
  color: var(--g-text-3);
  cursor: nwse-resize;
  touch-action: none;
}
[dir="rtl"] .g-dialog__grip { cursor: nesw-resize; }
.g-dialog__grip svg { width: 10px; height: 10px; margin: 0 5px 5px 0; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; }
[dir="rtl"] .g-dialog__grip svg { transform: scaleX(-1); margin: 0 0 5px 5px; }
.g-dialog__grip:hover { color: var(--g-text); }
.g-dialog__grip:focus-visible { outline: none; box-shadow: var(--g-focus-ring-inset); }
.g-dialog.is-dragging, .g-dialog.is-resizing { user-select: none; }
.g-dialog.is-maximized .g-dialog__resize,
.g-dialog.is-maximized .g-dialog__grip { display: none; }

/* ---------------------------------------------------------------- maximized (after .is-placed: wins on order) */
.g-dialog.is-maximized {
  position: absolute;
  inset: var(--g-space-4);
  width: auto;
  height: auto;
  min-width: 0;
  max-width: none;
  max-height: none;
  margin: 0;
}

/* ---------------------------------------------------------------- motion */
.g-dialog.is-entering.g-dialog--fx-zoom { animation: g-dialog-zoom-in var(--g-dialog-dur, 200ms) var(--g-ease) both; }
.g-dialog.is-leaving.g-dialog--fx-zoom { animation: g-dialog-zoom-out var(--g-dialog-dur, 200ms) var(--g-ease) both; }
.g-dialog.is-entering.g-dialog--fx-fade { animation: g-fade-in var(--g-dialog-dur, 200ms) var(--g-ease) both; }
.g-dialog.is-leaving.g-dialog--fx-fade { animation: g-dialog-fade-out var(--g-dialog-dur, 200ms) var(--g-ease) both; }
.g-dialog.is-entering.g-dialog--fx-slidetop { animation: g-dialog-slide-in var(--g-dialog-dur, 200ms) var(--g-ease) both; }
.g-dialog.is-leaving.g-dialog--fx-slidetop { animation: g-dialog-fade-out var(--g-dialog-dur, 200ms) var(--g-ease) both; }
.g-dialog.is-entering.g-dialog--fx-slidebottom { animation: g-dialog-slide-up var(--g-dialog-dur, 200ms) var(--g-ease) both; }
.g-dialog.is-leaving.g-dialog--fx-slidebottom { animation: g-dialog-fade-out var(--g-dialog-dur, 200ms) var(--g-ease) both; }
.g-dialog-layer:has(> .g-dialog.is-leaving) > .g-dialog-layer__scrim { animation: g-dialog-fade-out var(--g-dur) var(--g-ease) both; }
@keyframes g-dialog-zoom-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes g-dialog-zoom-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.97); } }
@keyframes g-dialog-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes g-dialog-slide-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes g-dialog-slide-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- DialogUtility (alert / confirm / prompt) */
.g-dialog-utility { display: flex; align-items: flex-start; gap: var(--g-space-3); }
.g-dialog-utility__icon { width: 24px; height: 24px; flex: none; color: var(--g-info-text); }
.g-dialog-utility--danger .g-dialog-utility__icon,
.g-dialog-utility--error .g-dialog-utility__icon { color: var(--g-danger-text); }
.g-dialog-utility--warning .g-dialog-utility__icon { color: var(--g-warning-text); }
.g-dialog-utility--success .g-dialog-utility__icon { color: var(--g-success-text); }
.g-dialog-utility--question .g-dialog-utility__icon { color: var(--g-accent-text); }
.g-dialog-utility__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--g-space-3); padding-top: 2px; }
.g-dialog-utility__message { color: var(--g-text-2); overflow-wrap: anywhere; }
.g-dialog-utility__message p { margin: 0 0 var(--g-space-2); }
.g-dialog-utility__message p:last-child { margin-bottom: 0; }
.g-dialog--utility .g-dialog__header { min-height: 0; border-bottom: 0; padding-bottom: 0; }
.g-dialog--utility .g-dialog__footer { border-top: 0; padding-top: var(--g-space-2); }

/* ---------------------------------------------------------------- phones: form dialogs go full screen */
@media (max-width: 600px) {
  .g-dialog-layer { padding: var(--g-space-2); }
  .g-dialog-layer--mobile-full { padding: 0; }
  .g-dialog.g-dialog--mobile-full,
  .g-dialog.g-dialog--mobile-full.is-placed,
  .g-dialog.g-dialog--mobile-full.is-maximized {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: 0;
  }
  .g-dialog--mobile-full .g-dialog__header.is-draggable { cursor: default; }
  .g-dialog--mobile-full .g-dialog__resize,
  .g-dialog--mobile-full .g-dialog__grip,
  .g-dialog--mobile-full .g-dialog__max { display: none; }
  .g-dialog:not(.g-dialog--mobile-full) { width: 100%; }
}

@media (forced-colors: active) {
  .g-dialog { border: 1px solid CanvasText; }
  .g-dialog__header, .g-dialog__footer { border-color: CanvasText; }
}

/* ---- css/components/drawer.css ---- */
/* Gigant UI — Drawer (slide-in side panel). */
.g-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: var(--g-z-sidebar);
  display: flex;
  flex-direction: column;
  width: min(var(--g-drawer-w, 380px), 100vw);
  max-width: 100vw;
  background: var(--g-surface-raised);
  color: var(--g-text);
  box-shadow: var(--g-shadow-4);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  line-height: var(--g-lh);
  outline: none;
  overflow: hidden;
  visibility: hidden;
  transition: transform var(--g-dur-slow) var(--g-ease), visibility 0s linear var(--g-dur-slow);
}
.g-drawer--right { right: 0; transform: translateX(100%); border-left: var(--g-border-w) solid var(--g-border); border-radius: var(--g-surface-radius) 0 0 var(--g-surface-radius); }
.g-drawer--left { left: 0; transform: translateX(-100%); border-right: var(--g-border-w) solid var(--g-border); border-radius: 0 var(--g-surface-radius) var(--g-surface-radius) 0; }
.g-drawer.is-open { transform: none; visibility: visible; transition: transform var(--g-dur-slow) var(--g-ease), visibility 0s; }
.g-drawer--no-anim { transition: none; }
.g-drawer.g-scroll { overflow: auto; }
.g-drawer__header {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--g-space-2);
  min-height: var(--g-header-h);
  padding: var(--g-space-3) var(--g-space-4) var(--g-space-3) var(--g-space-5);
  border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-drawer__title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: var(--g-fs-lg); font-weight: var(--g-fw-semibold); line-height: var(--g-lh-tight); }
.g-drawer__body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: var(--g-space-4) var(--g-space-5); }
.g-drawer__close { margin-inline-end: calc(-1 * var(--g-space-1)); color: var(--g-text-2); }
[data-gui-theme="gigant-fluent"] .g-drawer__header { border-bottom: 0; padding: var(--g-space-6) var(--g-space-5) var(--g-space-2) var(--g-space-6); min-height: 0; }
[data-gui-theme="gigant-fluent"] .g-drawer__title { font-size: var(--g-fs-xl); line-height: 28px; }
[data-gui-theme="gigant-fluent"] .g-drawer__body { padding: var(--g-space-2) var(--g-space-6) var(--g-space-6); }
.g-drawer__scrim.is-leaving { animation: g-drawer-fade-out var(--g-dur) var(--g-ease) both; pointer-events: none; }
@keyframes g-drawer-fade-out { from { opacity: 1; } to { opacity: 0; } }
.g-drawer-main { transition: margin var(--g-dur-slow) var(--g-ease); }
@media (max-width: 600px) {
  .g-drawer { width: 100vw; border-radius: 0; }
}
@media (forced-colors: active) { .g-drawer { border: 1px solid CanvasText; } }

/* ---- css/components/dropdowns.css ---- */
/*
 * Gigant UI — dropdowns (DropDownList, ComboBox, AutoComplete, MultiSelect, DropDownTree, ListBox).
 *
 * Builds on the primitives: the field is .g-input, the popup .g-popup, rows .g-option, chips .g-chip.
 * Only tokens; logical properties so RTL needs no overrides.
 */

/* ------------------------------------------------------------------ field */
.g-dd { min-width: 0; }
.g-dd .g-dd__box { cursor: text; }
.g-dd--ddl .g-dd__box,
.g-dd--tree .g-dd__box,
.g-dd--mode-checkbox .g-dd__box { cursor: pointer; }
.g-dd__select { cursor: pointer; caret-color: transparent; }
.g-dd__select::selection { background: transparent; }
.g-dd .is-disabled .g-dd__select,
.g-dd .g-dd__box.is-disabled { cursor: not-allowed; }

.g-dd__caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--g-icon-btn);
  height: var(--g-icon-btn);
  color: var(--g-text-3);
  cursor: pointer;
  transition: transform var(--g-dur-fast) var(--g-ease);
}
.g-dd.is-open .g-dd__caret { transform: rotate(180deg); color: var(--g-text); }
.g-dd .is-disabled .g-dd__caret { color: var(--g-text-disabled); cursor: not-allowed; }
.g-dd__clear { width: var(--g-icon-btn); height: var(--g-icon-btn); }
.g-dd__spinner { --g-spinner-size: 14px; margin-inline: 4px; }
.g-dd__spinner[hidden] { display: none; }
.g-dd__hidden { display: none; }

/* a value whose text has not arrived yet (FK shown before its lookup loaded) */
.g-dd.is-resolving .g-input__control { color: var(--g-text-3); }

/* ------------------------------------------------------------------ multiselect field */
/* mounted on a bare <input> the field box and .g-dd are one element */
.g-dd--multi .g-dd__box,
.g-dd--multi.g-dd__box {
  flex-wrap: wrap;
  row-gap: var(--g-space-1);
  padding-block: 3px;
}
.g-dd--multi .g-input__control { flex: 1 1 4em; min-width: 4em; width: auto; min-height: calc(var(--g-control-h) - 8px); }
.g-dd--mode-checkbox .g-input__control { flex-basis: 6em; }
.g-dd__chips {
  display: contents;
}
.g-dd__chips[hidden] { display: none; }
.g-dd__chip { max-width: 100%; min-height: 24px; }
.g-dd__chip:focus-within { box-shadow: var(--g-focus-ring); }
.g-dd__chip .g-chip__remove { width: var(--g-icon-btn); height: var(--g-icon-btn); margin-inline-end: -6px; }
.g-dd__chip .g-chip__remove:focus-visible { box-shadow: none; background: var(--g-surface-4); color: var(--g-text); }
.g-dd__chip.is-loading .g-chip__text { color: var(--g-text-3); }
.g-dd__delim {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--g-text);
}

/* ------------------------------------------------------------------ popup */
.g-dd-popup { min-width: 0; max-width: min(560px, calc(100vw - 16px)); }
.g-dd-popup--multi,
.g-dd-popup--tree { max-width: min(640px, calc(100vw - 16px)); }
.g-dd__head { padding: var(--g-space-2); }
.g-dd__filter { padding-inline: var(--g-space-2); }
.g-dd__filter-icon { color: var(--g-text-3); flex: none; }
.g-dd__header-tpl,
.g-dd__footer-tpl { flex: none; }
.g-dd__header-tpl { border-bottom: var(--g-border-w) solid var(--g-border); }
.g-dd__selectall {
  flex: none;
  display: flex;
  min-height: var(--g-row-h-compact);
  padding: var(--g-space-1) var(--g-space-4);
  border-bottom: var(--g-border-w) solid var(--g-border);
  font-weight: var(--g-fw-medium);
}
.g-dd__scroller {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.g-dd__list { position: relative; }
.g-dd__list[hidden] { display: none; }
.g-dd__list--virtual { padding: 0; }
.g-dd__list--virtual > .g-option,
.g-dd__list--virtual > .g-option-group { inset-inline: 0; }
.g-dd__list--virtual > .g-option { border-radius: 0; }

/* options: a little roomier than menu rows, so touch targets stay >= 24px in every theme */
.g-dd__option { min-height: max(28px, calc(var(--g-control-h) - 6px)); }
.g-dd__option .g-option__text { white-space: nowrap; }
.g-dd-popup .g-option.is-focused { box-shadow: var(--g-focus-ring-inset); }
.g-dd-popup .g-option:not(.is-disabled):hover { background: var(--g-surface-3); }
.g-dd-popup .g-option.is-selected:not(.is-disabled):hover { background: var(--g-accent-subtle-2); }
.g-dd-popup--multi .g-option.is-selected,
.g-dd-popup--tree .g-option.is-checked { font-weight: var(--g-fw-regular); }
/* with checkboxes the box is the selection signal; a filled row on top of it reads as stripes */
.g-dd-popup--checkbox .g-option.is-selected,
.g-listbox--checkbox .g-option.is-selected { background: none; }
.g-dd-popup--checkbox .g-option.is-selected:not(.is-disabled):hover,
.g-listbox--checkbox .g-option.is-selected:not(.is-disabled):hover { background: var(--g-surface-3); }

/* sticky group headers: each header sticks until the next one slides over it */
.g-dd__group {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  margin: 0;
  background: var(--g-surface-raised);
}
.g-dd__list > .g-dd__group:not(:first-child) { margin-block-start: var(--g-space-1); }
.g-dd__sticky { z-index: 2; position: sticky; top: 0; }
.g-dd__sticky[hidden] { display: none; }
.g-dd__option--grouped { padding-inline-start: var(--g-space-5); }

/* status: loading / no records / error */
.g-dd__status {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--g-space-2);
  padding: var(--g-space-4) var(--g-space-3);
  color: var(--g-text-3);
  text-align: center;
}
.g-dd__status[hidden] { display: none; }
.g-dd__status--error { color: var(--g-danger-text); }
.g-dd__status .g-btn { color: var(--g-accent-text); }

/* refreshing while rows are already shown: thin bar under the header, no layout shift */
.g-dd-popup.is-loading::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--g-accent-text), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: g-dd-bar 1s linear infinite;
}
@keyframes g-dd-bar { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* visual checkbox inside options (same look as input.g-check) */
.g-dd-check {
  position: relative;
  flex: none;
  width: var(--g-check-size);
  height: var(--g-check-size);
  border: 1.5px solid var(--g-border-strong);
  border-radius: var(--g-check-radius);
  background: var(--g-surface);
}
.g-dd-check.is-checked,
.g-dd-check.is-mixed { background: var(--g-check-bg); border-color: var(--g-check-bg); }
.g-dd-check.is-checked::after {
  content: "";
  position: absolute;
  inset-inline-start: 50%;
  top: 45%;
  width: 5px;
  height: 9px;
  border: solid var(--g-check-fg);
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}
[dir="rtl"] .g-dd-check.is-checked::after { transform: translate(50%, -50%) rotate(45deg); }
.g-dd-check.is-mixed::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 2px;
  background: var(--g-check-fg);
}
.g-option.is-disabled .g-dd-check { border-color: var(--g-text-disabled); background: var(--g-surface-2); }

/* ------------------------------------------------------------------ tree */
.g-ddt__node { padding-inline-start: calc(var(--g-space-1) + var(--g-ddt-level, 0) * 20px); gap: var(--g-space-1); }
.g-ddt__node .g-dd-check { margin-inline-end: var(--g-space-1); }
.g-ddt__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--g-icon-btn);
  height: var(--g-icon-btn);
  border-radius: var(--g-radius-sm);
  color: var(--g-text-3);
  transition: transform var(--g-dur-fast) var(--g-ease);
}
.g-ddt__toggle:not(.is-leaf):hover { background: var(--g-surface-4); color: var(--g-text); }
.g-ddt__node[aria-expanded="true"] > .g-ddt__toggle { transform: rotate(90deg); }
[dir="rtl"] .g-ddt__node[aria-expanded="true"] > .g-ddt__toggle { transform: rotate(-90deg); }

/* ------------------------------------------------------------------ listbox */
.g-listbox {
  display: flex;
  align-items: stretch;
  gap: var(--g-space-2);
  min-width: 0;
}
.g-listbox__panel {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--g-surface);
  border: var(--g-border-w) solid var(--g-border-input);
  border-radius: var(--g-control-radius);
  overflow: hidden;
}
.g-listbox__panel:focus-within { border-color: var(--g-focus); box-shadow: 0 0 0 1px var(--g-focus); }
.g-listbox__filter { margin: var(--g-space-2); width: auto; }
.g-listbox__list {
  flex: 1 1 auto;
  min-height: 6rem;
  overflow: auto;
}
.g-listbox__list[hidden] { display: none; }
.g-listbox__list:focus-visible { outline: none; }
.g-listbox__list:not(:focus) .g-option.is-focused { box-shadow: none; }
.g-listbox__option { min-height: max(28px, calc(var(--g-control-h) - 6px)); }
.g-listbox__toolbar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--g-space-2);
  flex: none;
}
.g-listbox__toolbar .g-btn:disabled { opacity: 1; }
.g-listbox.is-disabled .g-listbox__panel { background: var(--g-surface-2); }
.g-listbox.is-disabled .g-option { color: var(--g-text-disabled); cursor: not-allowed; }

/* ------------------------------------------------------------------ narrow screens */
@media (max-width: 600px) {
  .g-dd-popup { max-height: min(60vh, 420px); }
  .g-dd__option { min-height: 40px; }
  .g-listbox { flex-direction: column; }
  .g-listbox__toolbar { flex-direction: row; }
  .g-listbox__toolbar .g-icon--chevron-right,
  .g-listbox__toolbar .g-icon--chevrons-right { transform: rotate(90deg); }
  .g-listbox__toolbar .g-icon--chevron-left,
  .g-listbox__toolbar .g-icon--chevrons-left { transform: rotate(90deg); }
}

@media (forced-colors: active) {
  .g-dd-check { border-color: CanvasText; }
  .g-dd-check.is-checked, .g-dd-check.is-mixed { background: Highlight; border-color: Highlight; }
  .g-listbox__panel { border-color: CanvasText; }
}

/* ---- css/components/fab.css ---- */
/* Gigant UI — Fab. A .g-btn (colours from its modifiers) that floats; Left/Right are inline start/end. */
.g-fab {
  --_off: var(--g-space-4);
  z-index: var(--g-z-sticky);
  min-height: 48px;
  padding: 0 var(--g-space-5);
  border-radius: var(--g-radius-pill);
  box-shadow: var(--g-shadow-3);
  font-size: var(--g-fs-md);
  transition: box-shadow var(--g-dur-fast) var(--g-ease), background-color var(--g-dur-fast) var(--g-ease), transform var(--g-dur-fast) var(--g-ease);
}
.g-fab:hover:not(:disabled) { box-shadow: var(--g-shadow-4); }
.g-fab:active:not(:disabled) { transform: scale(0.97); }
.g-fab:disabled { box-shadow: var(--g-shadow-1); }
.g-fab[hidden] { display: none; }
.g-fab--icon-only { width: 56px; min-height: 56px; padding: 0; }
.g-fab__icon { display: inline-flex; align-items: center; justify-content: center; }
.g-fab__icon .g-icon-font { font-size: 20px; width: 20px; height: 20px; }
.g-fab__text { white-space: nowrap; }

.g-fab--fixed { position: fixed; }
.g-fab--absolute { position: absolute; }
.g-fab--top-left, .g-fab--top-center, .g-fab--top-right { top: var(--_off); }
.g-fab--bottom-left, .g-fab--bottom-center, .g-fab--bottom-right { bottom: var(--_off); }
.g-fab--middle-left, .g-fab--middle-center, .g-fab--middle-right { top: 50%; translate: 0 -50%; }
.g-fab--top-left, .g-fab--middle-left, .g-fab--bottom-left { inset-inline-start: var(--_off); }
.g-fab--top-right, .g-fab--middle-right, .g-fab--bottom-right { inset-inline-end: var(--_off); }
.g-fab--top-center, .g-fab--bottom-center { left: 50%; translate: -50% 0; }
.g-fab--middle-center { left: 50%; translate: -50% -50%; }
.g-fab-host:empty { display: none; }

@media (forced-colors: active) { .g-fab { border: 2px solid ButtonText; } }

/* ---- css/components/feedback.css ---- */
/* Gigant UI — spinners on targets, Skeleton, count badges, ProgressBar. */

/* ---------------------------------------------------------------- inline spinner (buttons, small targets) */
.g-is-spinning { color: transparent; }
.g-is-spinning > :not(.g-spinner-inline) { visibility: hidden; }
.g-spinner-inline {
  position: absolute;
  inset: 0;
  margin: auto;
  --g-spinner-size: 16px;
  --g-spinner-color: var(--g-text-2);
}
.g-btn--primary > .g-spinner-inline, .g-btn--primary > .g-spinner { --g-spinner-color: var(--g-text-on-accent); }
.g-btn--danger > .g-spinner-inline, .g-btn--success > .g-spinner-inline,
.g-btn--danger > .g-spinner, .g-btn--success > .g-spinner { --g-spinner-color: var(--g-on-solid); }

/* ---------------------------------------------------------------- Skeleton */
.g-skel { display: flex; flex-direction: column; gap: var(--g-space-2); min-width: 0; }
.g-skel[hidden] { display: none; }
.g-skel__text { height: .9em; }
.g-skel__circle { border-radius: 50%; }
.g-skel__square { border-radius: var(--g-radius-sm); }
.g-skel__rectangle { border-radius: var(--g-radius-md); }
.g-skel__table { display: flex; flex-direction: column; border: var(--g-border-w) solid var(--g-border); border-radius: var(--g-radius-md); overflow: hidden; }
.g-skel__row { display: grid; grid-template-columns: repeat(var(--g-skel-cols, 4), minmax(0, 1fr)); gap: var(--g-space-4); align-items: center; min-height: var(--g-row-h); padding: 0 var(--g-space-3); border-top: var(--g-border-w) solid var(--g-border); }
.g-skel__row--head { border-top: 0; background: var(--g-surface-2); }
.g-skel__row--head .g-skel__cell { height: .7em; }
.g-skel__cell { height: .8em; }
.g-skel--pulse .g-skel__bone { animation: g-skel-pulse 1.4s ease-in-out infinite; background: var(--g-surface-4); }
.g-skel--none .g-skel__bone { animation: none; background: var(--g-surface-3); }
@keyframes g-skel-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------------------------------------------------------------- count badge */
.g-badge-count {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: var(--g-fs-2xs);
  border: 2px solid var(--g-surface);
  box-sizing: content-box;
  pointer-events: none;
}

/* ---------------------------------------------------------------- ProgressBar */
.g-progress { --g-progress-color: var(--g-accent-text); position: relative; display: flex; align-items: center; gap: var(--g-space-2); }
.g-progress--linear { width: 100%; }
.g-progress--linear .g-progress__track { position: relative; flex: 1 1 auto; height: var(--g-progress-h, 6px); border-radius: var(--g-radius-pill); background: var(--g-surface-4); overflow: hidden; }
.g-progress--linear .g-progress__fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: calc(var(--g-progress, 0) * 1%); border-radius: inherit; background: var(--g-progress-color); transition: width var(--g-dur) var(--g-ease); }
.g-progress--indeterminate.g-progress--linear .g-progress__fill { width: 35%; animation: g-progress-slide 1.2s var(--g-ease) infinite; }
@keyframes g-progress-slide { from { inset-inline-start: -35%; } to { inset-inline-start: 100%; } }
.g-progress--circular { display: inline-flex; justify-content: center; width: var(--g-progress-h, 48px); height: var(--g-progress-h, 48px); }
.g-progress--circular svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.g-progress__track { fill: none; stroke: var(--g-surface-4); stroke-width: 3.5; }
.g-progress__arc { fill: none; stroke: var(--g-progress-color); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: var(--g-progress, 0) 100; transition: stroke-dasharray var(--g-dur) var(--g-ease); }
.g-progress--indeterminate .g-progress__arc { stroke-dasharray: 30 100; }
.g-progress--indeterminate.g-progress--circular svg { animation: g-progress-turn 1s linear infinite; }
@keyframes g-progress-turn { to { transform: rotate(270deg); } }
.g-progress__label { flex: none; font-size: var(--g-fs-xs); font-weight: var(--g-fw-semibold); color: var(--g-text-2); font-variant-numeric: tabular-nums; }
.g-progress--circular .g-progress__label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* ---- css/components/gantt.css ---- */
/*
 * Gigant UI — Gantt.
 *
 *   .g-gantt              root (toolbar + body); --auto when height is 'auto'
 *   .g-gantt__toolbar     role=toolbar: zoom, expand / collapse, export, custom items
 *   .g-gantt__body        CSS grid: task list | splitter | chart (the list width is --_gw)
 *   .g-gantt__grid        task list pane → .g-gantt__gscroll → role=treegrid (.g-gantt__ghead + .g-gantt__gbody)
 *   .g-gantt__splitter    role=separator, drag or arrow keys
 *   .g-gantt__chart       chart pane → .g-gantt__cscroll (THE vertical scroller) → .g-gantt__chead (tiers) + .g-gantt__cbody
 *   .g-gantt__cbody       bands (weekends, holidays) · connector SVG · rows with bars · marks (today, event markers)
 *   .g-gantt-bar          a task bar (--child / --parent / --milestone), with __progress and edit __handle s
 *   .g-gantt-tip          the taskbar tooltip (in <body>)
 *
 * Bar colour: --_bar (queryTaskbarInfo's taskbarBgColor) is the solid progress fill; the remaining part is a
 * 28 % tint of it over the surface with a solid border, so a bar reads in both modes whatever colour a page
 * supplies, and progress is shown by length as well as by colour.
 */
.g-gantt {
  --g-gantt-row-h: 36px;
  --g-gantt-head-h: 60px;
  --g-gantt-bar-h: calc(var(--g-gantt-row-h) * 0.56);
  --g-gantt-ms: calc(var(--g-gantt-row-h) * 0.4);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 100%;
  background: var(--g-surface);
  color: var(--g-text);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-surface-radius);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  overflow: hidden;
}
.g-gantt.is-dragging,
.g-gantt.is-dragging * { cursor: grabbing; user-select: none; }

/* ------------------------------------------------------------------ toolbar */
.g-gantt__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--g-space-1);
  padding: var(--g-space-1) var(--g-space-2);
  border-bottom: var(--g-border-w) solid var(--g-border);
  background: var(--g-surface);
}
.g-gantt__tbtn { gap: var(--g-space-1); }
.g-gantt__ticon { display: inline-flex; }
.g-gantt__ticon .g-icon { width: 16px; height: 16px; }
.g-gantt__tsep { width: var(--g-border-w); align-self: stretch; margin-block: var(--g-space-1); background: var(--g-border); }
.g-gantt__tspacer { flex: 1 1 auto; }
@media (max-width: 640px) { .g-gantt__ttext { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }

/* ------------------------------------------------------------------ panes */
.g-gantt__body {
  --_gw: 40%;
  display: grid;
  grid-template-columns: var(--_gw) auto minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
}
.g-gantt--grid-only .g-gantt__body { grid-template-columns: minmax(0, 1fr); }
.g-gantt--grid-only .g-gantt__splitter,
.g-gantt--grid-only .g-gantt__chart,
.g-gantt--chart-only .g-gantt__grid,
.g-gantt--chart-only .g-gantt__splitter { display: none; }
.g-gantt--chart-only .g-gantt__body { grid-template-columns: minmax(0, 1fr); }
.g-gantt__grid,
.g-gantt__chart { position: relative; display: flex; min-width: 0; min-height: 0; }
.g-gantt__gscroll,
.g-gantt__cscroll { position: relative; flex: 1 1 auto; min-width: 0; overscroll-behavior: contain; }
/* both panes reserve a horizontal scrollbar, so their last rows line up */
.g-gantt__gscroll { overflow-x: scroll; overflow-y: hidden; }
.g-gantt__cscroll { overflow: scroll; }
.g-gantt--auto .g-gantt__cscroll { overflow-y: hidden; }

/* ------------------------------------------------------------------ splitter */
.g-gantt__splitter {
  position: relative;
  width: 7px;
  cursor: col-resize;
  background: var(--g-surface-2);
  border-inline: var(--g-border-w) solid var(--g-border);
  touch-action: none;
  outline: none;
}
.g-gantt__splitter::after {
  content: '';
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  width: 3px;
  height: 28px;
  transform: translate(-50%, -50%);
  border-radius: var(--g-radius-pill);
  background: var(--g-border-strong);
}
[dir="rtl"] .g-gantt__splitter::after { transform: translate(50%, -50%); }
.g-gantt__splitter:hover,
.g-gantt__splitter:focus-visible { background: var(--g-accent-subtle); }
.g-gantt__splitter:focus-visible { box-shadow: var(--g-focus-ring-inset); }

/* ------------------------------------------------------------------ task list */
.g-gantt__table { position: relative; width: max-content; min-width: 100%; outline: none; }
.g-gantt__grow { display: grid; grid-template-columns: var(--_gcols, 1fr); height: var(--g-gantt-row-h); }
.g-gantt__ghead {
  position: sticky;
  top: 0;
  z-index: 3;
  height: var(--g-gantt-head-h);
  background: var(--g-surface-2);
  border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-gantt__grow--head { height: 100%; }
.g-gantt__hcell {
  display: flex;
  align-items: flex-end;
  min-width: 0;
  padding: var(--g-space-2) var(--g-space-3);
  color: var(--g-text-2);
  font-size: var(--g-fs-sm);
  font-weight: var(--g-fw-semibold);
  border-inline-end: var(--g-border-w) solid var(--g-border);
}
.g-gantt__htext { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-gantt__hcell.g-align-end .g-gantt__htext { text-align: end; }
.g-gantt__hcell.g-align-center .g-gantt__htext { text-align: center; }
.g-gantt__gbody { position: relative; }
.g-gantt__gbody .g-gantt__grow { position: absolute; inset-inline: 0; background: var(--g-surface); }
.g-gantt__gcell {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 var(--g-space-3);
  border-bottom: var(--g-border-w) solid var(--g-border);
  font-size: var(--g-fs-sm);
  outline: none;
  cursor: default;
}
.g-gantt__gcell:focus-visible { box-shadow: var(--g-focus-ring-inset); }
.g-gantt__ctext { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-gantt__gcell.g-align-end .g-gantt__ctext { text-align: end; }
.g-gantt__gcell.g-align-center .g-gantt__ctext { text-align: center; }
.g-gantt__tcell { padding-inline-start: var(--g-space-2); gap: 2px; }
.g-gantt__indent { display: inline-block; flex: none; height: 1px; }
.g-gantt__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: var(--g-radius-sm);
  color: var(--g-text-2);
  cursor: pointer;
}
.g-gantt__toggle:hover { background: var(--g-surface-4); color: var(--g-text); }
.g-gantt__toggle .g-icon { width: 14px; height: 14px; transition: transform var(--g-dur-fast) var(--g-ease); }
.g-gantt__toggle.is-expanded .g-icon { transform: rotate(90deg); }
[dir="rtl"] .g-gantt__toggle.is-expanded .g-icon { transform: scaleX(-1) rotate(90deg); }
.g-gantt__toggle--leaf { cursor: default; }
.g-gantt__toggle--leaf:hover { background: transparent; }
.g-gantt__grow.is-parent .g-gantt__tcell .g-gantt__ctext { font-weight: var(--g-fw-semibold); }

/* row states, shared by both panes */
.g-gantt__gbody .g-gantt__grow:hover,
.g-gantt__crow:hover { background: var(--g-row-hover); }
.g-gantt__gbody .g-gantt__grow.is-selected,
.g-gantt__crow.is-selected { background: var(--g-row-selected); }

/* ------------------------------------------------------------------ chart: timeline header */
.g-gantt__chead {
  position: sticky;
  top: 0;
  z-index: 3;
  height: var(--g-gantt-head-h);
  background: var(--g-surface-2);
  border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-gantt__tier { position: absolute; inset-inline: 0; }
.g-gantt__tier--top { border-bottom: var(--g-border-w) solid var(--g-border); }
.g-gantt__tcell2 {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--g-text-2);
  font-size: var(--g-fs-xs);
  border-inline-end: var(--g-border-w) solid var(--g-border);
  font-variant-numeric: tabular-nums;
}
.g-gantt__tier--top .g-gantt__tcell2 { justify-content: flex-start; padding-inline: var(--g-space-2); font-weight: var(--g-fw-semibold); color: var(--g-text); font-size: var(--g-fs-sm); }
.g-gantt__tcell2.is-weekend { background: var(--g-surface-3); }

/* ------------------------------------------------------------------ chart: body */
.g-gantt__cbody { position: relative; }
.g-gantt__bands, .g-gantt__marks, .g-gantt__crows { position: absolute; inset: 0; }
.g-gantt__bands { pointer-events: none; }
.g-gantt__band { position: absolute; top: 0; bottom: 0; }
.g-gantt__band--weekend { background: var(--g-surface-2); }
.g-gantt__band--holiday { background: var(--g-warning-subtle); }
.g-gantt__bandlabel {
  position: sticky;
  top: calc(var(--g-gantt-head-h) + var(--g-space-2));
  display: block;
  margin-inline: auto;
  width: max-content;
  padding-block: var(--g-space-2);
  writing-mode: vertical-rl;
  color: var(--g-warning-text);
  font-size: var(--g-fs-xs);
  font-weight: var(--g-fw-medium);
}
.g-gantt__lines { position: absolute; top: 0; inset-inline-start: 0; z-index: 1; overflow: visible; pointer-events: none; }
[dir="rtl"] .g-gantt__lines { inset-inline-start: auto; left: 0; }
.g-gantt__linepath { fill: none; stroke: var(--g-text-3); stroke-width: 1.25; }
.g-gantt__arrow { fill: var(--g-text-3); stroke: none; }
.g-gantt__crow { position: absolute; inset-inline: 0; height: var(--g-gantt-row-h); border-bottom: var(--g-border-w) solid transparent; }
.g-gantt__marks { pointer-events: none; z-index: 1; }
.g-gantt__mark { position: absolute; top: 0; bottom: 0; width: 0; border-inline-start: 2px solid var(--g-danger); }
.g-gantt__mark--event { border-inline-start: 2px dashed var(--g-info); }
.g-gantt__marklabel {
  position: absolute;
  top: var(--g-space-1);
  inset-inline-start: 4px;
  padding: 1px var(--g-space-2);
  border-radius: var(--g-radius-sm);
  background: var(--g-info);
  color: var(--g-on-solid);
  font-size: var(--g-fs-xs);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ bars */
.g-gantt-bar {
  --_bar: var(--g-accent);
  --_prog: var(--_bar);
  --_bd: var(--_bar);
  position: absolute;
  top: 50%;
  z-index: 2;
  height: var(--g-gantt-bar-h);
  transform: translateY(-50%);
  border: var(--g-border-w) solid var(--_bd);
  border-radius: var(--g-radius-sm);
  background: color-mix(in srgb, var(--_bar) 28%, var(--g-surface));
  overflow: visible;
  cursor: pointer;
  outline: none;
  touch-action: none;
}
.g-gantt-bar__progress {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  border-start-start-radius: inherit;
  border-end-start-radius: inherit;
  background: var(--_prog);
  pointer-events: none;
}
.g-gantt-bar__label {
  position: relative;
  display: block;
  padding-inline: var(--g-space-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: calc(var(--g-gantt-bar-h) - 2px);
  font-size: var(--g-fs-xs);
  font-weight: var(--g-fw-medium);
  color: var(--g-text);
  pointer-events: none;
}
.g-gantt-bar--parent {
  --_bar: var(--g-text-2);
  height: calc(var(--g-gantt-bar-h) * 0.6);
  border-radius: var(--g-radius-2xs);
}
.g-gantt-bar--parent::before,
.g-gantt-bar--parent::after {
  content: '';
  position: absolute;
  top: 100%;
  width: 0;
  height: 0;
  border-block-start: 6px solid var(--_bd);
}
.g-gantt-bar--parent::before { inset-inline-start: -1px; border-inline-end: 6px solid transparent; }
.g-gantt-bar--parent::after { inset-inline-end: -1px; border-inline-start: 6px solid transparent; }
.g-gantt-bar--milestone {
  --_bar: var(--g-text-2);
  width: var(--g-gantt-ms);
  height: var(--g-gantt-ms);
  margin-inline-start: calc(var(--g-gantt-ms) / -2);
  transform: translateY(-50%) rotate(45deg);
  border-radius: var(--g-radius-2xs);
  background: var(--_bar);
}
.g-gantt-bar:hover { box-shadow: var(--g-shadow-1); }
.g-gantt-bar:focus-visible { box-shadow: var(--g-focus-ring); }
.g-gantt-bar__handle {
  position: absolute;
  inset-block: -2px;
  width: 8px;
  cursor: ew-resize;
  opacity: 0;
}
.g-gantt-bar__handle--start { inset-inline-start: -4px; }
.g-gantt-bar__handle--end { inset-inline-end: -4px; }
.g-gantt-bar__handle--progress {
  inset-block: auto -7px;
  width: 10px;
  height: 8px;
  margin-inline-start: -5px;
  cursor: col-resize;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: var(--g-text);
}
.g-gantt-bar__handle--start::after,
.g-gantt-bar__handle--end::after {
  content: '';
  position: absolute;
  inset-block: 25%;
  inset-inline-start: 3px;
  width: 2px;
  border-radius: var(--g-radius-pill);
  background: var(--g-text);
}
.g-gantt-bar:hover .g-gantt-bar__handle,
.g-gantt-bar:focus-visible .g-gantt-bar__handle,
.g-gantt.is-dragging .g-gantt-bar__handle { opacity: 1; }
.g-gantt__side {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  white-space: nowrap;
  font-size: var(--g-fs-xs);
  color: var(--g-text-2);
  pointer-events: none;
}

/* ------------------------------------------------------------------ tooltip */
.g-gantt-tip {
  position: fixed;
  z-index: var(--g-z-tooltip);
  max-width: min(22rem, calc(100vw - 16px));
  padding: var(--g-space-2) var(--g-space-3);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-popup-radius);
  background: var(--g-surface-raised);
  color: var(--g-text);
  box-shadow: var(--g-shadow-3);
  font-family: var(--g-font);
  font-size: var(--g-fs-sm);
  pointer-events: none;
}
.g-gantt-tip[hidden] { display: none; }
.g-gantt-tip__title { font-weight: var(--g-fw-semibold); margin-bottom: var(--g-space-1); }
.g-gantt-tip__list { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--g-space-3); margin: 0; }
.g-gantt-tip__list dt { color: var(--g-text-2); }
.g-gantt-tip__list dd { margin: 0; font-variant-numeric: tabular-nums; }

@media (forced-colors: active) {
  .g-gantt-bar { border-color: CanvasText; }
  .g-gantt-bar__progress { background: Highlight; }
  .g-gantt__linepath { stroke: CanvasText; }
  .g-gantt__arrow { fill: CanvasText; }
}


/* ---- css/components/gauge.css ---- */
/*
 * Gigant UI — CircularGauge + LinearGauge. Shared base: viz.css; palette and tooltip: chart.css.
 * Ranges take the caller's colours, else the categorical slots in order. The needle is ink (text
 * colour) rather than a series colour, so it reads on any range; the cap carries a surface ring.
 */
.g-viz--circulargauge,
.g-viz--lineargauge { min-height: 80px; }

.g-gauge__line { stroke-linecap: butt; }
.g-gauge__range { stroke: none; }
.g-gauge__needle-body,
.g-gauge__needle-tail { fill: var(--g-viz-ink); }
.g-gauge__cap { fill: var(--g-viz-ink); stroke: var(--g-chart-surface); stroke-width: 2; }
.g-gauge__bar,
.g-gauge__marker { stroke: var(--g-chart-surface); stroke-width: 1; }
.g-gauge__marker { stroke-width: 1.5; }
.g-gauge__container { fill: var(--g-viz-track); }
.g-gauge__label { font-size: var(--g-fs-xs); }
.g-gauge__pointer .g-viz__mark { cursor: default; }
.g-gauge__pointer .g-viz__mark:focus-visible { stroke: var(--g-focus); stroke-width: 3; }
.g-gauge__pointer g.g-viz__mark:focus-visible .g-gauge__cap,
.g-gauge__pointer g.g-viz__mark:focus-visible .g-gauge__needle-body { stroke: var(--g-focus); stroke-width: 2; }

/* annotations: author HTML placed at an angle / axis value, centred on the point */
.g-gauge__annotation {
  position: absolute;
  transform: translate(-50%, -50%);
  color: var(--g-text);
  font-size: var(--g-fs-lg);
  font-weight: var(--g-fw-semibold);
  font-variant-numeric: tabular-nums;
  line-height: var(--g-lh-tight);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

@media (forced-colors: active) {
  .g-gauge__needle-body, .g-gauge__cap { forced-color-adjust: none; fill: CanvasText; }
  .g-gauge__range, .g-gauge__bar, .g-gauge__marker { forced-color-adjust: none; stroke: CanvasText; stroke-width: 1; }
}

/* ---- css/components/grid.css ---- */
/*
 * Gigant UI — Grid.
 *
 * One scroll container; header, body and footer row groups share the column tracks through CSS subgrid,
 * so header and cells can never drift apart. The header and the aggregate footer are sticky, frozen
 * columns are sticky on the inline axis. Every colour is a token; logical properties throughout.
 *
 *   .g-grid                       root (toolbar, group bar, content, pager)
 *   .g-grid--compact              32px rows          .g-grid--fill  fills a flex parent (height:'100%')
 *   .g-grid--lines-both|none|vertical|horizontal       .g-grid--striped .g-grid--hover .g-grid--wrap
 *   .g-grid__row  .g-grid__hcell  .g-grid__cell  .g-grid__fcell  .is-selected .is-alt .is-frozen-start/end
 */
.g-grid {
  --g-grid-row-h: var(--g-row-h);
  --g-grid-cell-px: var(--g-space-3);
  --_row-bg: var(--g-surface);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  background: var(--g-surface);
  color: var(--g-text);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-radius-lg);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  line-height: var(--g-lh-tight);
  overflow: hidden;
}
.g-grid *, .g-grid *::before, .g-grid *::after { box-sizing: border-box; }
.g-grid--compact { --g-grid-row-h: var(--g-row-h-compact); --g-grid-cell-px: var(--g-space-2); }
.g-grid--fill { height: 100%; }
.g-grid--fill > .g-grid__content { flex: 1 1 auto; min-height: 0; }
.g-grid--fill .g-grid__scroller { height: 100%; }

/* ------------------------------------------------------------------ toolbar */
.g-grid__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--g-space-2);
  padding: var(--g-space-2) var(--g-space-3);
  border-bottom: var(--g-border-w) solid var(--g-border);
  background: var(--g-surface);
}
.g-grid__tb-start,
.g-grid__tb-end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--g-space-1); min-width: 0; }
.g-grid__tb-start { flex: 1 1 auto; }
.g-grid__tb-end { margin-inline-start: auto; flex-wrap: nowrap; }
.g-grid__tb-slot { display: contents; }
.g-grid__tb-sep { width: 1px; align-self: stretch; margin: var(--g-space-1) var(--g-space-1); background: var(--g-border); }
.g-grid__tb-btn .g-icon-font,
.g-grid__tb-btn .g-icon { color: var(--g-text-2); }
.g-grid__tb-btn:disabled .g-icon { color: inherit; }
.g-grid__search { width: min(260px, 100%); min-width: 160px; }
.g-grid__search .g-input__control::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

/* ------------------------------------------------------------------ group bar */
.g-grid__groupbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--g-space-2);
  padding: var(--g-space-2) var(--g-space-3);
  border-bottom: var(--g-border-w) solid var(--g-border);
  background: var(--g-surface);
  font-size: var(--g-fs-sm);
}
.g-grid__groupbar[hidden] { display: none; }
.g-grid__grouplabel { color: var(--g-text-3); }

/* ------------------------------------------------------------------ scroller + table */
.g-grid__content { position: relative; display: flex; flex-direction: column; min-height: 0; }
/* Scroll chaining (Imad, 2026-10-29): a wheel / touch scroll over the body scrolls the grid while the grid can scroll that
   way, and the PAGE once the grid is at its top/bottom or has nothing to scroll — `overscroll-behavior: contain` here
   trapped every wheel over a table. Horizontal overscroll stays contained: chaining it to the page would turn a
   trackpad swipe at the grid's side edge into the browser's Back gesture (and lose a half-typed document). */
.g-grid__scroller { position: relative; overflow: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior-y: auto; overscroll-behavior-x: contain; }
.g-grid__table {
  display: grid;
  grid-template-columns: var(--g-grid-cols, 1fr);
  width: 100%;
  outline: none;
}
.g-grid__head,
.g-grid__body,
.g-grid__foot,
.g-grid__row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
}
.g-grid__head { position: sticky; top: 0; z-index: 3; --_row-bg: var(--g-surface-2); background: var(--g-surface-2); }
.g-grid__foot { position: sticky; bottom: 0; z-index: 3; --_row-bg: var(--g-surface-2); background: var(--g-surface-2); }
.g-grid__foot:empty { display: none; }
.g-grid__row { min-height: var(--g-grid-row-h); background: var(--_row-bg); }

/* cells */
.g-grid__cell,
.g-grid__hcell,
.g-grid__fcell {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 var(--g-grid-cell-px);
  border-bottom: var(--g-border-w) solid var(--g-border);
  background: var(--_row-bg);
  outline: none;
}
.g-grid__cv { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Latin codes, dates and amounts keep their own order in an RTL page; alignment still follows the column */
.g-grid__cv,
.g-grid__agg,
.g-grid__htext { unicode-bidi: plaintext; text-align: match-parent; }
.g-grid__cell.is-clip .g-grid__cv { text-overflow: clip; }
.g-align-end { justify-content: flex-end; text-align: end; font-variant-numeric: tabular-nums; }
.g-align-center { justify-content: center; text-align: center; }
.g-align-start { justify-content: flex-start; text-align: start; }
.g-grid__cell.g-align-end .g-grid__cv { text-align: end; }
.g-grid__cell.g-align-center .g-grid__cv { text-align: center; }

/* focus: inset ring so the scroller never clips it */
.g-grid__cell:focus-visible,
.g-grid__hcell:focus-visible,
.g-grid__fcell:focus-visible,
.g-grid__gcell:focus-visible,
.g-grid__detailcell:focus-visible { box-shadow: var(--g-focus-ring-inset); z-index: 2; }

/* grid lines */
.g-grid--lines-both .g-grid__cell,
.g-grid--lines-both .g-grid__hcell,
.g-grid--lines-both .g-grid__fcell,
.g-grid--lines-vertical .g-grid__cell,
.g-grid--lines-vertical .g-grid__hcell { border-inline-end: var(--g-border-w) solid var(--g-border); }
.g-grid--lines-none .g-grid__body .g-grid__cell,
.g-grid--lines-vertical .g-grid__body .g-grid__cell { border-bottom-color: transparent; }

/* ------------------------------------------------------------------ header */
.g-grid__hcell {
  min-height: var(--g-grid-row-h);
  color: var(--g-text-2);
  font-size: var(--g-fs-sm);
  font-weight: var(--g-fw-semibold);
  user-select: none;
  padding-inline-end: var(--g-space-2);
}
.g-grid__hcell.is-sortable { cursor: pointer; }
.g-grid__hcell.is-sortable:hover { --_row-bg: var(--g-surface-3); }
.g-grid__hcell.is-draggable { cursor: grab; }
.g-grid__hinner { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1 1 auto; }
.g-grid__htext { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-align-end > .g-grid__hinner > .g-grid__htext { text-align: end; }
.g-align-center > .g-grid__hinner > .g-grid__htext { text-align: center; }
.g-grid__sort { display: inline-flex; align-items: center; gap: 1px; flex: none; color: var(--g-accent-text); }
.g-grid__sort .g-icon { width: 14px; height: 14px; stroke-width: 2.25; }
.g-grid__sortnum { font-size: var(--g-fs-2xs); font-weight: var(--g-fw-bold); line-height: 1; }
.g-grid__hbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--g-icon-btn);
  height: var(--g-icon-btn);
  padding: 0;
  border: 0;
  border-radius: var(--g-radius-sm);
  background: transparent;
  color: var(--g-text-3);
  cursor: pointer;
}
.g-grid__hbtn:hover { background: var(--g-surface-4); color: var(--g-text); }
.g-grid__hbtn:focus-visible { outline: none; box-shadow: var(--g-focus-ring-inset); }
.g-grid__hbtn .g-icon { width: 14px; height: 14px; }
.g-grid__filterbtn.is-active { color: var(--g-accent-text); background: var(--g-accent-subtle); }
.g-grid__filterbtn.is-active .g-icon { fill: currentColor; }
/* On pointer devices idle header buttons take no room (narrow headers keep their text); they slide in on
   hover/focus. An active filter always shows. Touch devices always show them. */
@media (hover: hover) {
  .g-grid__hbtn { width: 0; opacity: 0; overflow: hidden; transition: opacity var(--g-dur-fast) var(--g-ease), width var(--g-dur-fast) var(--g-ease); }
  .g-grid__hcell:hover .g-grid__hbtn,
  .g-grid__hcell:focus-visible .g-grid__hbtn,
  .g-grid__hcell:focus-within .g-grid__hbtn,
  .g-grid__hbtn.is-active { width: var(--g-icon-btn); opacity: 1; }
}
.g-grid__resizer {
  position: absolute;
  inset-block: 0;
  inset-inline-end: -4px;
  z-index: 2;
  width: 9px;
  cursor: col-resize;
  touch-action: none;
}
.g-grid__resizer::after {
  content: "";
  position: absolute;
  inset-block: 25%;
  inset-inline-start: 4px;
  width: 1px;
  background: var(--g-border);
}
.g-grid__hcell:hover .g-grid__resizer::after,
.g-grid__resizer:hover::after,
.g-grid.is-resizing .g-grid__resizer::after { inset-block: 0; width: 2px; background: var(--g-focus); }
.g-grid.is-resizing,
.g-grid.is-resizing * { cursor: col-resize; user-select: none; }
.g-grid.is-dragging .g-grid__hcell { cursor: grabbing; }

/* filter bar row */
.g-grid__fcell { padding: var(--g-space-1) var(--g-space-2); min-height: calc(var(--g-grid-row-h) + 4px); }
.g-grid__fcell .g-input { min-height: var(--g-control-h-sm); background: var(--g-surface); }
.g-grid__fcell .g-input__prefix .g-icon { width: 12px; height: 12px; }

/* ------------------------------------------------------------------ body rows */
.g-grid--striped .g-grid__drow.is-alt { --_row-bg: var(--g-row-stripe); }
.g-grid--hover .g-grid__drow:hover { --_row-bg: var(--g-row-hover); }
.g-grid__drow.is-selected,
.g-grid--hover .g-grid__drow.is-selected:hover { --_row-bg: var(--g-row-selected); }
/* selection is also marked by a bar at the start edge, so it never relies on the tint alone */
.g-grid__drow > .g-grid__c:first-child { border-inline-start: 3px solid transparent; padding-inline-start: calc(var(--g-grid-cell-px) - 3px); }
.g-grid__drow.is-selected > .g-grid__c:first-child { border-inline-start-color: var(--g-accent); }
.g-grid--wrap .g-grid__cv { white-space: normal; overflow-wrap: anywhere; padding-block: var(--g-space-2); }
.g-grid--wrap-header .g-grid__htext { white-space: normal; overflow-wrap: anywhere; padding-block: var(--g-space-2); }
.g-grid--virtual .g-grid__drow { height: var(--g-grid-row-h); }
.g-grid--virtual .g-grid__cv { white-space: nowrap; padding-block: 0; }
.g-grid__spacer { grid-column: 1 / -1; pointer-events: none; }

.g-grid__checkcell { padding-inline: 0; }
.g-grid__drow > .g-grid__checkcell:first-child { padding-inline-start: 0; }
.g-grid__hcell .g-grid__selectall { margin-inline: auto; }
.g-grid__bool { display: inline-flex; align-items: center; gap: 4px; color: var(--g-text-2); font-weight: var(--g-fw-medium); }
.g-grid__bool.is-on { color: var(--g-success-text); }
.g-grid__bool .g-icon { width: 14px; height: 14px; stroke-width: 2.5; flex: 0 0 auto; }

/* empty / error */
.g-grid__emptyrow { min-height: calc(var(--g-grid-row-h) * 3); }
.g-grid__empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--g-space-8) var(--g-space-4);
  color: var(--g-text-3);
  text-align: center;
  background: var(--g-surface);
  position: sticky;
  inset-inline-start: 0;
}
.g-grid__error { color: var(--g-danger-text); }

/* frozen columns */
.g-grid .is-frozen-start,
.g-grid .is-frozen-end { position: sticky; z-index: 1; }
.g-grid__head .is-frozen-start,
.g-grid__head .is-frozen-end { z-index: 2; }
.g-grid .is-frozen-start.is-frozen-edge { border-inline-end: var(--g-border-w) solid var(--g-border-strong); }
.g-grid .is-frozen-end.is-frozen-edge { border-inline-start: var(--g-border-w) solid var(--g-border-strong); }

/* ------------------------------------------------------------------ groups, details, footer */
.g-grid__grow { --_row-bg: var(--g-surface-2); cursor: pointer; }
.g-grid__grow:hover { --_row-bg: var(--g-surface-3); }
.g-grid__gcell {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--g-space-2);
  min-width: 0;
  padding-block: var(--g-space-1);
  padding-inline-end: var(--g-space-3);
  border-bottom: var(--g-border-w) solid var(--g-border);
  background: var(--_row-bg);
  outline: none;
  font-size: var(--g-fs-sm);
  position: sticky;
  inset-inline-start: 0;
}
.g-grid__gtoggle { display: inline-flex; color: var(--g-text-2); transition: transform var(--g-dur-fast) var(--g-ease); }
.g-grid__gtoggle.is-expanded { transform: rotate(90deg); }
.g-grid__gtext { display: inline-flex; align-items: center; gap: var(--g-space-2); min-width: 0; }
.g-grid__gfield { color: var(--g-text-2); }
.g-grid__gcap { display: inline-flex; align-items: center; gap: var(--g-space-1); flex-wrap: wrap; }
.g-grid__gcount { font-weight: var(--g-fw-medium); color: var(--g-text-2); }
.g-grid__gaggs { display: inline-flex; gap: var(--g-space-3); margin-inline-start: auto; color: var(--g-text-2); font-variant-numeric: tabular-nums; }
.g-grid__gfoot { --_row-bg: var(--g-surface-2); }
.g-grid__gfoot .g-grid__fcell,
.g-grid__frow-agg .g-grid__fcell { font-weight: var(--g-fw-semibold); font-variant-numeric: tabular-nums; min-height: var(--g-grid-row-h); }
.g-grid__frow-agg .g-grid__fcell { border-bottom: 0; border-top: var(--g-border-w) solid var(--g-border); }
.g-grid__agg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-grid__agglabel { color: var(--g-text-3); font-weight: var(--g-fw-regular); font-size: var(--g-fs-xs); }

.g-grid__expander {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--g-icon-btn);
  height: var(--g-icon-btn);
  padding: 0;
  border: 0;
  border-radius: var(--g-radius-sm);
  background: transparent;
  color: var(--g-text-2);
  cursor: pointer;
}
.g-grid__expander:hover { background: var(--g-surface-4); }
.g-grid__expander .g-icon { transition: transform var(--g-dur-fast) var(--g-ease); }
.g-grid__expander.is-expanded .g-icon { transform: rotate(90deg); }
[dir="rtl"] .g-grid__expander.is-expanded .g-icon { transform: scaleX(-1) rotate(90deg); }
.g-grid__detailrow { --_row-bg: var(--g-surface-2); }
.g-grid__detailcell {
  grid-column: 1 / -1;
  min-width: 0;
  padding: var(--g-space-3) var(--g-space-4) var(--g-space-4);
  padding-inline-start: calc(var(--g-space-4) + 32px);
  border-bottom: var(--g-border-w) solid var(--g-border);
  background: var(--_row-bg);
  outline: none;
}
.g-grid__child .g-grid { border-radius: var(--g-radius-md); }

/* ------------------------------------------------------------------ editing */
.g-grid__row.is-editing { --_row-bg: var(--g-accent-subtle); }
.g-grid__cell.is-editing { overflow: visible; padding: 3px var(--g-space-1); z-index: 3; }
.g-grid__editor { flex: 1 1 auto; min-width: 0; width: 100%; }
/* In-cell fields follow the row height (and so the density); dialog editors (outside .g-grid) keep the normal
   control height. Not only the grid's own editors: ANY field a page mounts in a cell template (a NumericTextBox,
   TextBox, DropDownList or picker — the visit screen's Quantity / Price boxes, line grids) is an in-cell field too.
   A multi-line box keeps its own height. Field buttons keep their size (a 24px target at least): with one, the field
   may be a few px taller than the bare box, still inside the row. */
.g-grid__cell .g-input:not(.g-input--multiline) { min-height: calc(var(--g-grid-row-h) - 8px); }
.g-grid__cell .g-input:not(.g-input--multiline) .g-input__control { min-height: calc(var(--g-grid-row-h) - 10px); }
.g-grid__editor--check { display: flex; justify-content: center; }
.g-align-end .g-grid__editor .g-input__control { text-align: end; font-variant-numeric: tabular-nums; }
.g-grid__cell.is-editing .g-grid__fielderr,
.g-grid__rowerr {
  position: absolute;
  inset-block-start: calc(100% - 2px);
  inset-inline-start: var(--g-space-1);
  z-index: 6;
  max-width: 280px;
  padding: 3px var(--g-space-2);
  border-radius: var(--g-radius-sm);
  background: var(--g-danger);
  color: var(--g-on-solid);
  font-size: var(--g-fs-xs);
  white-space: normal;
  box-shadow: var(--g-shadow-2);
}
.g-grid__cell.is-editing .g-grid__fielderr:empty { display: none; }
.g-grid__cell.is-dirty::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  border-style: solid;
  border-width: 0;
  border-block-start-width: 8px;
  border-inline-end-width: 8px;
  border-block-start-color: var(--g-warning);
  border-inline-end-color: transparent;
}
.g-grid__drow.is-added { --_row-bg: var(--g-success-subtle); }
/* always-editable lines (grid-live.js): every row is open; the focused one carries .is-editing. A cell's
   message shows while that cell has focus or the pointer (it would cover the next line otherwise); the
   red field box stays visible, and the message is the field's accessible description. */
.g-grid__row.is-live .g-grid__cell.is-editing { z-index: auto; }            /* rows scroll under the sticky header */
.g-grid__row.is-live .g-grid__cell.is-editing:focus-within { z-index: 2; }
.g-grid__row.is-live .g-grid__cell.is-editing .g-grid__fielderr { display: none; }
.g-grid__row.is-live .g-grid__cell.is-editing:focus-within .g-grid__fielderr:not(:empty),
.g-grid__row.is-live .g-grid__cell.is-editing:hover .g-grid__fielderr:not(:empty) { display: block; }
/* a line whose last save the page refused (it keeps what was typed): a warning bar at its start */
.g-grid__row.is-live.is-pending > .g-grid__c:first-child::after {
  content: "";
  position: absolute;
  inset-block: 2px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: var(--g-radius-pill);
  background: var(--g-warning);
}
.g-grid__row.is-busy { opacity: .6; pointer-events: none; }
.g-grid__cmds { display: flex; align-items: center; gap: var(--g-space-1); }
.g-grid__cmd { min-height: var(--g-input-btn); }
.g-grid__cmd.g-btn--icon { width: var(--g-input-btn); }
.g-grid__cmd--danger { --_fg: var(--g-danger-text); }
.g-grid__cmdcell { padding-inline: var(--g-space-2); }

/* ------------------------------------------------------------------ pager slot */
.g-grid__pager { padding: var(--g-space-2) var(--g-space-3); border-top: var(--g-border-w) solid var(--g-border); background: var(--g-surface); }

/* ------------------------------------------------------------------ drag + measuring helpers */
.g-grid__ghost {
  position: fixed;
  z-index: var(--g-z-tooltip);
  padding: var(--g-space-1) var(--g-space-3);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-radius-md);
  background: var(--g-surface-raised);
  color: var(--g-text);
  font-family: var(--g-font);
  font-size: var(--g-fs-sm);
  font-weight: var(--g-fw-semibold);
  box-shadow: var(--g-shadow-3);
  pointer-events: none;
}
.g-grid__dropmark { position: absolute; inset-block: 0; z-index: 6; width: 2px; margin-inline-start: -1px; background: var(--g-focus); pointer-events: none; }
.g-grid__probe {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  visibility: hidden;
  white-space: nowrap;
  pointer-events: none;
  font-size: var(--g-fs-md);
}
.g-grid__probe .g-grid__htext { overflow: visible; font-size: var(--g-fs-sm); font-weight: var(--g-fw-semibold); }
.g-grid__printframe { position: fixed; inset-inline-start: -10000px; inset-block-start: 0; width: 1px; height: 1px; border: 0; }

/* ------------------------------------------------------------------ popups: menu, chooser, filters */
.g-grid-pop { min-width: 220px; }
.g-grid-menu { min-width: 220px; }
.g-grid-menu .g-option .g-icon { color: var(--g-text-3); }
.g-grid-chooser,
.g-grid-filter { width: min(300px, calc(100vw - 16px)); }
.g-grid-chooser__list { max-height: 280px; padding: var(--g-space-1) 0; }
.g-grid-chooser__item,
.g-grid-filter__item { display: flex; width: 100%; padding: var(--g-space-1) var(--g-space-3); min-height: 32px; }
.g-grid-chooser__item:hover,
.g-grid-filter__item:hover { background: var(--g-surface-3); }
.g-grid-chooser__foot { justify-content: space-between; align-items: center; }
.g-grid-filter__title { padding: var(--g-space-3) var(--g-space-3) 0; font-size: var(--g-fs-sm); font-weight: var(--g-fw-semibold); color: var(--g-text); }
.g-grid-filter__body { display: flex; flex-direction: column; gap: var(--g-space-2); padding: var(--g-space-3); }
.g-grid-filter__cond { display: flex; flex-direction: column; gap: var(--g-space-2); }
.g-grid-filter__cond [hidden] { display: none; }
.g-grid-filter__join { display: flex; gap: var(--g-space-4); padding-block: var(--g-space-1); font-size: var(--g-fs-sm); }
.g-grid-filter__search { padding: var(--g-space-2) var(--g-space-3) 0; }
.g-grid-filter__checks { padding: var(--g-space-2) 0; gap: 0; }
.g-grid-filter__allrow { display: flex; padding: var(--g-space-1) var(--g-space-3); min-height: 32px; border-bottom: var(--g-border-w) solid var(--g-border); font-weight: var(--g-fw-medium); }
.g-grid-filter__list { max-height: 240px; overflow: auto; padding-block: var(--g-space-1); }
.g-grid-filter__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-grid-filter__count { flex: none; color: var(--g-text-3); font-size: var(--g-fs-xs); font-variant-numeric: tabular-nums; }
.g-grid-filter__note { padding: var(--g-space-1) var(--g-space-3); color: var(--g-text-3); font-size: var(--g-fs-xs); }
.g-grid-filter__spacer { flex: 1 1 auto; }
.g-grid-filter .g-popup__footer { align-items: center; }
.g-grid-select { position: relative; padding-inline-end: var(--g-space-1); }
.g-grid-select select { -webkit-appearance: none; appearance: none; padding-inline-end: 22px; cursor: pointer; }
.g-grid-select .g-input__suffix { position: absolute; inset-inline-end: var(--g-space-2); pointer-events: none; }

/* ------------------------------------------------------------------ modal (edit dialog, confirm) */
.g-grid-scrim { z-index: var(--g-z-dialog); }
.g-grid-modal {
  position: fixed;
  inset: 0;
  z-index: var(--g-z-dialog);
  display: flex;
  flex-direction: column;
  width: min(640px, calc(100vw - 32px));
  height: fit-content;
  max-height: calc(100vh - 32px);
  margin: auto;
  background: var(--g-surface-raised);
  color: var(--g-text);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-surface-radius);
  box-shadow: var(--g-shadow-4);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  line-height: var(--g-lh);
  animation: g-pop-in var(--g-dur) var(--g-ease);
}
.g-grid-modal__head { display: flex; align-items: center; gap: var(--g-space-2); padding: var(--g-space-4) var(--g-space-4) var(--g-space-2) var(--g-space-5); }
.g-grid-modal__title { flex: 1 1 auto; margin: 0; font-size: var(--g-fs-lg); font-weight: var(--g-fw-semibold); }
.g-grid-modal__body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: var(--g-space-2) var(--g-space-5) var(--g-space-4); }
/* Hosted in a GUI.Dialog the dialog body already pads and scrolls: one padding, one scroll. */
.g-dialog__content > .g-grid-modal__body { padding: 0; overflow: visible; }
.g-grid-modal__foot { display: flex; justify-content: flex-end; gap: var(--g-space-2); padding: var(--g-space-3) var(--g-space-5) var(--g-space-4); border-top: var(--g-border-w) solid var(--g-border); }
.g-grid-modal__error { margin: 0 var(--g-space-5); padding: var(--g-space-2) var(--g-space-3); border-radius: var(--g-radius-md); background: var(--g-danger-subtle); color: var(--g-danger-text); font-size: var(--g-fs-sm); }
.g-grid-modal__error[hidden] { display: none; }
.g-grid-modal__msg { margin: 0; color: var(--g-text-2); }
.g-grid-modal[aria-busy="true"] .g-grid-modal__body { opacity: .7; }
.g-grid-form .g-form-grid { align-items: start; }
.g-grid-form__check { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: var(--g-space-2); align-self: end; min-height: var(--g-control-h); }
.g-grid-form__check .g-grid__editor { flex: none; width: auto; }

/* ------------------------------------------------------------------ narrow screens */
@media (max-width: 640px) {
  .g-grid__toolbar { padding: var(--g-space-2); }
  .g-grid__tb-end { margin-inline-start: 0; width: 100%; }
  .g-grid__search { width: 100%; min-width: 0; flex: 1 1 auto; }
  .g-grid__tb-btn > .g-icon + .g-grid__tb-text,
  .g-grid__tb-btn > .g-icon-font + .g-grid__tb-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .g-grid__tb-btn { padding-inline: var(--g-space-2); }
}

@media (forced-colors: active) {
  .g-grid { border-color: CanvasText; }
  .g-grid__drow.is-selected > .g-grid__cell { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .g-grid__cell:focus-visible,
  .g-grid__hcell:focus-visible,
  .g-grid__gcell:focus-visible { outline: 2px solid Highlight; outline-offset: -2px; }
  .g-grid__resizer::after { background: CanvasText; }
}

/* ---- css/components/heatmap.css ---- */
/*
 * Gigant UI — HeatMap. Shared base: viz.css (sequential ramp --g-viz-seq-1..7); tooltip, legend
 * swatches and table from chart.css. Cells sit 2px apart on the surface; labels choose light or dark
 * ink by contrast against the cell, so the text stays in text tokens.
 */
.g-viz--heatmap { min-height: 160px; }
.g-viz--heatmap.g-viz--legend-right,
.g-viz--heatmap.g-viz--legend-left { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); }
.g-viz--heatmap.g-viz--legend-left { grid-template-columns: auto minmax(0, 1fr); }
.g-viz--heatmap.g-viz--legend-right > .g-viz__header,
.g-viz--heatmap.g-viz--legend-left > .g-viz__header { grid-column: 1 / -1; }
.g-viz--heatmap.g-viz--legend-right > .g-viz__legend,
.g-viz--heatmap.g-viz--legend-left > .g-viz__legend { padding: 0 var(--g-space-2); align-items: center; }
.g-viz--legend-right > .g-viz__legend[hidden],
.g-viz--legend-left > .g-viz__legend[hidden] { display: none; }
.g-viz--heatmap.g-viz--legend-top > .g-viz__legend { padding-block: 0 var(--g-space-2); }

.g-heatmap__cell { stroke-width: 0; cursor: default; transition: filter var(--g-dur-fast) var(--g-ease); }
.g-heatmap__cell.is-empty { stroke: var(--g-border); stroke-width: 1; stroke-dasharray: 3 2; }
.g-heatmap__cell.is-hover { filter: brightness(1.06) saturate(1.1); stroke: var(--g-text); stroke-width: 1.5; }
.g-heatmap__cell.g-viz__mark:focus-visible { stroke: var(--g-focus); stroke-width: 3; }
.g-heatmap__label { font-size: var(--g-fs-xs); font-variant-numeric: tabular-nums; pointer-events: none; }
.g-heatmap__label.is-dark { fill: var(--g-text-on-accent); }
.g-heatmap__label.is-light { fill: var(--g-on-solid); }

/* gradient legend; vertical when the legend sits beside the map */
.g-viz__gradient-bar { position: relative; }
.g-viz__gradient--vertical { flex-direction: column; height: 100%; max-height: 260px; min-height: 80px; }
.g-viz__gradient--vertical .g-viz__gradient-bar { width: 10px; min-width: 10px; height: auto; flex: 1 1 auto; max-width: none; }
.g-heatmap__legend-marker {
  position: absolute; inset-block-start: -3px; width: 2px; height: 16px; margin-inline-start: -1px;
  background: var(--g-text); border-radius: var(--g-radius-2xs); box-shadow: 0 0 0 1px var(--g-surface);
}
.g-viz__gradient--vertical .g-heatmap__legend-marker { inset-block-start: auto; inset-inline-start: -3px; width: 16px; height: 2px; margin: 0 0 -1px; }
.g-heatmap__legend-marker[hidden] { display: none; }
.g-heatmap__buckets { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--g-space-1) var(--g-space-2); }
.g-heatmap__buckets.is-vertical { flex-direction: column; align-items: flex-start; justify-content: center; height: 100%; }

@media (forced-colors: active) {
  .g-heatmap__cell { forced-color-adjust: none; }
  .g-heatmap__cell.g-viz__mark:focus-visible { stroke: Highlight; }
}

/* ---- css/components/kanban.css ---- */
/*
 * Gigant UI — Kanban.
 *
 *   .g-kanban              root; --auto when height is 'auto'
 *   .g-kanban__scroll      THE scroller (both axes); header cells stick to its top
 *   .g-kanban__board       one CSS grid, a track per column (--_cols): minmax(--g-kanban-col-min, 1fr) or a collapsed strip
 *   .g-kanban__hcell       column header: toggle, title, count (n / max), limit state (.is-over / .is-under)
 *   .g-kanban__lane        swimlane header row, spanning every column
 *   .g-kanban__cell        one column × lane; holds .g-kanban__cards (role=list) of .g-kanban__item > .g-kanban-card
 *   .g-kanban-card         a card (role=button, aria-pressed = selected); __header __content __tags; .has-grabber
 *   .g-kanban-card--ghost  the card following the pointer while dragging (in <body>)
 *   .g-kanban__placeholder where the card will land
 */
.g-kanban {
  --g-kanban-col-min: 15rem;
  --g-kanban-col-collapsed: 2.75rem;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 100%;
  background: var(--g-surface);
  color: var(--g-text);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-surface-radius);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  overflow: hidden;
}
.g-kanban.is-dragging,
.g-kanban.is-dragging * { cursor: grabbing; user-select: none; }
.g-kanban__scroll { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.g-kanban--auto .g-kanban__scroll { overflow-y: hidden; }
.g-kanban__board {
  display: grid;
  grid-template-columns: var(--_cols, 1fr);
  column-gap: var(--g-space-2);
  padding: 0 var(--g-space-2) var(--g-space-2);
  min-width: min-content;
  align-items: stretch;
}

/* ------------------------------------------------------------------ column headers */
.g-kanban__hcell {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: var(--g-space-2) var(--g-space-2);
  margin-bottom: var(--g-space-2);
  background: var(--g-surface);
  border-bottom: 2px solid var(--g-border);
}
.g-kanban__htitle { display: flex; align-items: center; gap: var(--g-space-1); min-width: 0; }
.g-kanban__htext { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--g-fw-semibold); }
.g-kanban__count {
  flex: none;
  padding: 0 var(--g-space-2);
  border-radius: var(--g-radius-pill);
  background: var(--g-surface-3);
  color: var(--g-text-2);
  font-size: var(--g-fs-xs);
  font-weight: var(--g-fw-medium);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
.g-kanban__limit { font-size: var(--g-fs-xs); font-weight: var(--g-fw-medium); }
.g-kanban__hcell.is-over { border-bottom-color: var(--g-danger); }
.g-kanban__hcell.is-over .g-kanban__count { background: var(--g-danger-subtle); color: var(--g-danger-text); }
.g-kanban__hcell.is-over .g-kanban__limit,
.g-kanban__cell.is-over > .g-kanban__limit { color: var(--g-danger-text); }
.g-kanban__hcell.is-under { border-bottom-color: var(--g-warning); }
.g-kanban__hcell.is-under .g-kanban__count { background: var(--g-warning-subtle); color: var(--g-warning-text); }
.g-kanban__hcell.is-under .g-kanban__limit,
.g-kanban__cell.is-under > .g-kanban__limit { color: var(--g-warning-text); }
.g-kanban__toggle .g-icon { width: 16px; height: 16px; }
.g-kanban__hcell.is-collapsed { padding-inline: 0; align-items: center; }
.g-kanban__hcell.is-collapsed .g-kanban__htext,
.g-kanban__hcell.is-collapsed .g-kanban__count,
.g-kanban__hcell.is-collapsed .g-kanban__limit { display: none; }

/* ------------------------------------------------------------------ swimlanes */
.g-kanban__lane {
  grid-column: 1 / -1;
  margin-top: var(--g-space-1);
  margin-bottom: var(--g-space-2);
  border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-kanban__laneinner {
  position: sticky;
  inset-inline-start: var(--g-space-2);
  display: inline-flex;
  align-items: center;
  gap: var(--g-space-2);
  padding-block: var(--g-space-1);
  max-width: 100%;
}
.g-kanban__lanetext { font-weight: var(--g-fw-semibold); font-size: var(--g-fs-sm); }

/* ------------------------------------------------------------------ cells and cards */
.g-kanban__cell {
  display: flex;
  flex-direction: column;
  gap: var(--g-space-1);
  min-width: 0;
  min-height: 4rem;
  padding: var(--g-space-2);
  border-radius: var(--g-radius-lg);
  background: var(--g-surface-2);
  transition: background var(--g-dur-fast) var(--g-ease), box-shadow var(--g-dur-fast) var(--g-ease);
}
.g-kanban__cell.is-over { box-shadow: inset 0 0 0 2px var(--g-danger); background: var(--g-danger-subtle); }
.g-kanban__cell.is-under { box-shadow: inset 0 0 0 2px var(--g-warning); }
.g-kanban__cell.is-drop-target { box-shadow: inset 0 0 0 2px var(--g-accent); background: var(--g-accent-subtle); }
.g-kanban__cell.is-collapsed { align-items: center; padding-inline: 0; }
.g-kanban__vtext { writing-mode: vertical-rl; color: var(--g-text-2); font-size: var(--g-fs-sm); font-weight: var(--g-fw-medium); white-space: nowrap; padding-block: var(--g-space-2); }
.g-kanban__cards { display: flex; flex-direction: column; gap: var(--g-space-2); flex: 1 1 auto; min-height: 2.5rem; margin: 0; padding: 0; }
.g-kanban__item { display: block; }
.g-kanban__empty { padding: var(--g-space-3) var(--g-space-2); color: var(--g-text-3); font-size: var(--g-fs-sm); text-align: center; border: var(--g-border-w) dashed var(--g-border-strong); border-radius: var(--g-radius-md); }
.g-kanban__empty[hidden] { display: none; }
.g-kanban-card {
  --_grab: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--g-space-1);
  padding: var(--g-space-2) var(--g-space-3);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-radius-md);
  background: var(--g-surface);
  color: var(--g-text);
  box-shadow: var(--g-shadow-1);
  cursor: grab;
  outline: none;
  touch-action: none;
  overflow-wrap: anywhere;
}
.g-kanban-card.has-grabber { border-inline-start: 4px solid var(--_grab); }
.g-kanban-card:hover { border-color: var(--g-border-strong); box-shadow: var(--g-shadow-2); }
.g-kanban-card:focus-visible { box-shadow: var(--g-focus-ring); }
.g-kanban-card.is-selected { border-color: var(--g-accent); background: var(--g-accent-subtle); }
.g-kanban-card.is-selected::after {
  content: '';
  position: absolute;
  inset-block-start: var(--g-space-2);
  inset-inline-end: var(--g-space-2);
  width: 8px;
  height: 8px;
  border-radius: var(--g-radius-pill);
  background: var(--g-accent);
}
.g-kanban-card.is-dragging { opacity: 0.4; }
.g-kanban-card__header { font-weight: var(--g-fw-semibold); font-size: var(--g-fs-sm); color: var(--g-accent-text); padding-inline-end: var(--g-space-3); }
.g-kanban-card__content { font-size: var(--g-fs-sm); color: var(--g-text); line-height: var(--g-lh); }
.g-kanban-card__tags { display: flex; flex-wrap: wrap; gap: var(--g-space-1); }
.g-kanban-card__tag { padding: 0 var(--g-space-2); border-radius: var(--g-radius-pill); background: var(--g-surface-3); color: var(--g-text-2); font-size: var(--g-fs-xs); line-height: 1.7; }
.g-kanban-card--ghost {
  position: fixed;
  z-index: var(--g-z-tooltip);
  pointer-events: none;
  box-shadow: var(--g-shadow-4);
  transform: rotate(2deg);
  opacity: 0.95;
  font-family: var(--g-font);
}
.g-kanban__placeholder { border: 2px dashed var(--g-accent); border-radius: var(--g-radius-md); background: var(--g-accent-subtle); }

@media (forced-colors: active) {
  .g-kanban-card.is-selected { outline: 2px solid Highlight; }
  .g-kanban__cell.is-over, .g-kanban__cell.is-drop-target { outline: 2px solid CanvasText; }
}


/* ---- css/components/listview.css ---- */
/* Gigant UI — ListView: a listbox of templated rows (.g-option) with optional group headers. */
.g-listview { display: block; min-width: 0; }
.g-listview__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--g-space-1);
  outline: none;
  border-radius: var(--g-radius-md);
}
.g-listview__list:focus-visible { box-shadow: var(--g-focus-ring); }
.g-listview__item.g-option {
  /* templated rows wrap and grow; the primitive is single-line by default */
  white-space: normal;
  overflow: visible;
  min-height: var(--g-control-h);
  padding: var(--g-space-2) var(--g-space-3);
  align-items: center;
}
.g-listview__content { flex: 1 1 auto; min-width: 0; }
.g-listview__group {
  position: sticky;
  top: calc(-1 * var(--g-space-1));
  z-index: 1;
  padding: var(--g-space-2) var(--g-space-3) var(--g-space-1);
  background: var(--g-surface);
  color: var(--g-text-3);
  font-size: var(--g-fs-xs);
  font-weight: var(--g-fw-semibold);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.g-listview .g-option.is-selected { box-shadow: inset 3px 0 0 var(--g-accent-text); }
[dir="rtl"] .g-listview .g-option.is-selected { box-shadow: inset -3px 0 0 var(--g-accent-text); }
.g-listview .g-option.is-selected.is-focused { box-shadow: var(--g-focus-ring-inset); }

/* checkbox mode: a drawn box, state comes from the option's aria-selected */
.g-listview__check {
  position: relative;
  flex: none;
  width: var(--g-check-size);
  height: var(--g-check-size);
  border: 1.5px solid var(--g-border-strong);
  border-radius: var(--g-check-radius);
  background: var(--g-surface);
}
.g-listview .g-option[aria-selected="true"] .g-listview__check { background: var(--g-check-bg); border-color: var(--g-check-bg); }
.g-listview .g-option[aria-selected="true"] .g-listview__check::after {
  content: "";
  position: absolute;
  inset-inline-start: 50%;
  top: 45%;
  width: 5px;
  height: 9px;
  border: solid var(--g-check-fg);
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}
[dir="rtl"] .g-listview .g-option[aria-selected="true"] .g-listview__check::after { transform: translate(50%, -50%) rotate(45deg); }

/* ---- css/components/map.css ---- */
/* Gigant UI — Maps. */
.g-maps { display: flex; flex-direction: column; min-width: 0; color: var(--g-text); font-family: var(--g-font); }
.g-maps__viewport {
  position: relative; overflow: hidden; height: var(--g-maps-height, 22rem); min-height: 12rem;
  border: var(--g-border-w) solid var(--g-border); border-radius: var(--g-radius-lg);
  /* the neutral grid shows wherever a tile is missing (offline, blocked tile host) */
  background-color: var(--g-surface-2);
  background-image: linear-gradient(var(--g-border) 1px, transparent 1px), linear-gradient(90deg, var(--g-border) 1px, transparent 1px);
  background-size: 64px 64px;
  cursor: grab; touch-action: none; user-select: none;
}
.g-maps__viewport:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-maps__viewport.is-panning { cursor: grabbing; }
.g-maps__tiles { position: absolute; inset: 0; }
.g-maps__tile { position: absolute; top: 0; left: 0; width: 256px; height: 256px; max-width: none; opacity: 0; transition: opacity var(--g-dur) var(--g-ease); }
.g-maps__tile.is-loaded { opacity: 1; }
.g-maps__tile.is-failed { display: none; }
/* dark mode: dim the (light) street tiles so the markers stay the loudest thing */
[data-gui-mode="dark"] .g-maps__tile { filter: brightness(.72) contrast(1.1) saturate(.8); }
.g-maps__markers { position: absolute; inset: 0; pointer-events: none; }
.g-maps__marker {
  --_mc: var(--g-chart-1, var(--g-accent-text));
  --_mb: var(--g-surface);
  position: absolute; top: 0; left: 0;
  width: 24px; height: 24px; margin: -12px 0 0 -12px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; cursor: pointer; pointer-events: auto;
}
.g-maps__pin {
  display: block; width: var(--_mw, 14px); height: var(--_mh, 14px);
  background: var(--_mc); border: 2px solid var(--_mb); border-radius: 50%;
  box-shadow: var(--g-shadow-2);
  transition: transform var(--g-dur-fast) var(--g-ease);
}
.g-maps__marker--diamond .g-maps__pin { border-radius: var(--g-radius-2xs); transform: rotate(45deg) scale(.85); }
.g-maps__marker--rectangle .g-maps__pin { border-radius: var(--g-radius-2xs); }
.g-maps__marker:hover .g-maps__pin { transform: scale(1.25); }
.g-maps__marker--diamond:hover .g-maps__pin { transform: rotate(45deg) scale(1.1); }
.g-maps__marker:focus-visible { outline: none; }
.g-maps__marker:focus-visible .g-maps__pin { box-shadow: var(--g-focus-ring); transform: scale(1.25); }
.g-maps__marker.is-offscreen { visibility: hidden; }
.g-maps__tooltip {
  position: absolute; z-index: 3; pointer-events: none; max-width: min(18rem, 80%);
  padding: 4px 8px; font-size: var(--g-fs-xs); line-height: var(--g-lh-tight);
  background: var(--g-surface-raised); color: var(--g-text);
  border: var(--g-border-w) solid var(--g-border); border-radius: var(--g-radius-sm); box-shadow: var(--g-shadow-3);
}
.g-maps__tooltip[hidden] { display: none; }
.g-maps__controls {
  position: absolute; z-index: 2; inset-block-start: var(--g-space-2); inset-inline-end: var(--g-space-2);
  display: flex; flex-direction: column; gap: 2px; padding: 2px;
  background: var(--g-surface-raised); border: var(--g-border-w) solid var(--g-border); border-radius: var(--g-radius-md); box-shadow: var(--g-shadow-2);
  cursor: default;
}
.g-maps__ctl { border-color: transparent; }
.g-maps__attribution {
  position: absolute; z-index: 2; inset-block-end: 0; inset-inline-end: 0;
  padding: 1px 6px; font-size: var(--g-fs-2xs); color: var(--g-text-2);
  background: color-mix(in srgb, var(--g-surface) 85%, transparent); border-start-start-radius: var(--g-radius-sm);
  cursor: default;
}
.g-maps__attribution a { color: var(--g-accent-text); }
.g-maps__footer { display: flex; justify-content: flex-end; padding-block-start: var(--g-space-2); }
.g-maps__list { margin: var(--g-space-2) 0 0; padding: var(--g-space-2) var(--g-space-3) var(--g-space-2) var(--g-space-8); background: var(--g-surface-2); border-radius: var(--g-radius-md); font-size: var(--g-fs-sm); }
.g-maps__list[hidden] { display: none; }
.g-maps__list-item { min-height: 24px; padding: 2px 4px; border: 0; background: none; color: var(--g-accent-text); font: inherit; text-align: start; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.g-maps__list-item:focus-visible { outline: none; box-shadow: var(--g-focus-ring); border-radius: var(--g-radius-xs); }
@media (forced-colors: active) {
  .g-maps__pin { forced-color-adjust: none; border-color: CanvasText; }
  .g-maps__marker:focus-visible .g-maps__pin { outline: 2px solid Highlight; }
}

/* ---- css/components/maskedtextbox.css ---- */
/* Gigant UI — MaskedTextBox. Box/control are the base .g-input; masks read best in tabular figures. */
.g-masked .g-input__control { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; padding-inline-end: var(--g-space-2); }

/* Floating label — same geometry as the TextBox one (kept local so either file stands alone). */
.g-masked__float[hidden] { display: none; }
.g-input--float .g-masked__float {
  position: absolute;
  inset-inline-start: calc(var(--g-space-3) - 4px);
  top: 50%;
  transform: translateY(-50%);
  max-width: calc(100% - var(--g-space-8));
  padding: 0 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.2;
  font-size: var(--g-fs-md);
  color: var(--g-text-3);
  border-radius: var(--g-radius-xs);
  pointer-events: none;
  transition: top var(--g-dur-fast) var(--g-ease), font-size var(--g-dur-fast) var(--g-ease), color var(--g-dur-fast) var(--g-ease);
}
.g-input--float.is-floated .g-masked__float { top: 0; font-size: var(--g-fs-xs); color: var(--g-text-2); background: var(--g-surface); }
.g-input--float.is-floated.is-focused .g-masked__float { color: var(--g-accent-text); }
.g-input--float.is-floated.is-invalid .g-masked__float { color: var(--g-danger-text); }
.g-input--float.is-floated.is-readonly .g-masked__float,
.g-input--float.is-floated.is-disabled .g-masked__float { background: var(--g-surface-2); }
/* Masks (phone, IBAN, plate, codes) are left-to-right sequences: in an RTL page the box mirrors, the
   masked text keeps its order (caret positions stay predictable) and sits at the inline end. */
[dir="rtl"] .g-masked .g-input__control { direction: ltr; text-align: right; }

/* ---- css/components/menu.css ---- */
/*
 * Gigant UI — menus (ContextMenu, DropDownButton, SplitButton, Menu bar).
 * The popup is a .g-popup; rows are .g-option, so menus look like every other list in the library.
 */
.g-menu {
  min-width: 200px;
  max-width: min(360px, calc(100vw - 16px));
  overflow: auto;
}
.g-menu__list { padding: var(--g-space-1); }
.g-menu__item {
  position: relative;
  min-height: var(--g-control-h-sm);
  padding-inline: var(--g-space-2) var(--g-space-2);
  gap: var(--g-space-2);
  outline: none;
}
/* the item under the pointer or the keyboard is one "current" item: hover moves focus */
.g-menu__item:focus,
.g-menu__item[aria-expanded="true"] { background: var(--g-surface-3); }
.g-menu__item.is-disabled:focus { background: var(--g-surface-2); }
.g-menu__item:focus-visible { box-shadow: var(--g-focus-ring-inset); }
.g-menu__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 18px;
  color: var(--g-text-2);
}
.g-menu__item.is-disabled .g-menu__icon { color: var(--g-text-disabled); }
.g-menu__text { padding-inline-end: var(--g-space-2); }
.g-menu__shortcut { margin-inline-start: auto; }
.g-menu__caret { display: inline-flex; flex: none; margin-inline-start: auto; color: var(--g-text-3); }
.g-menu__sep { margin-inline: calc(-1 * var(--g-space-1)); }

/* ------------------------------------------------------------------ menu buttons */
.g-ddb { gap: var(--g-space-2); }
.g-ddb__icon { display: inline-flex; align-items: center; }
.g-ddb__text { display: inline-flex; align-items: center; gap: var(--g-space-1); }
.g-ddb__caret { width: 14px; height: 14px; margin-inline-end: calc(-1 * var(--g-space-1)); transition: transform var(--g-dur-fast) var(--g-ease); }
.g-ddb.is-open .g-ddb__caret,
.g-split__arrow.is-open .g-ddb__caret { transform: rotate(180deg); }
.g-ddb.is-open { background: var(--_bg-hover); }
.g-ddb--icon-only { padding-inline: var(--g-space-2); }
.g-ddb-host { display: inline-flex; }

.g-split { display: inline-flex; vertical-align: middle; }
.g-split__arrow { width: auto; min-width: var(--g-control-h); padding-inline: var(--g-space-2); }
.g-split__arrow.g-btn--sm { min-width: var(--g-control-h-sm); }
.g-split__arrow .g-ddb__caret { margin: 0; }
.g-split__arrow.is-open { background: var(--_bg-hover); }
/* a hairline between the two halves of a filled split button */
.g-split > .g-split__arrow { border-inline-start-color: color-mix(in srgb, var(--_fg) 25%, var(--_bd)); }

/* ------------------------------------------------------------------ menubar */
.g-menubar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: var(--g-space-1);
  list-style: none;
  background: var(--g-surface);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-radius-lg);
}
.g-menubar__item {
  display: inline-flex;
  align-items: center;
  gap: var(--g-space-1);
  min-height: var(--g-control-h-sm);
  padding: 0 var(--g-space-3);
  border-radius: var(--g-radius-sm);
  color: var(--g-text);
  font-weight: var(--g-fw-medium);
  cursor: pointer;
  user-select: none;
  outline: none;
}
.g-menubar__item:hover,
.g-menubar__item.is-open { background: var(--g-surface-3); }
.g-menubar__item:focus-visible { box-shadow: var(--g-focus-ring-inset); }
.g-menubar__item.is-disabled { color: var(--g-text-disabled); cursor: not-allowed; }
.g-menubar__caret { display: inline-flex; color: var(--g-text-3); }
.g-menubar__caret .g-icon { width: 14px; height: 14px; }
.g-menubar__sep { width: 1px; align-self: stretch; margin: var(--g-space-1); background: var(--g-border); }

@media (forced-colors: active) {
  .g-menu__item:focus { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .g-menubar__item:focus-visible { outline: 2px solid Highlight; }
}

/* ---- css/components/message.css ---- */
/*
 * Gigant UI — Message (inline banner).
 *   .g-message--{normal|info|success|warning|error}  × --{text|outlined|filled}
 */
.g-message {
  --_tone: var(--g-text-2);
  --_tint: var(--g-surface-2);
  display: flex;
  align-items: flex-start;
  gap: var(--g-space-2);
  padding: var(--g-space-2) var(--g-space-3);
  border: var(--g-border-w) solid transparent;
  border-radius: var(--g-radius-md);
  background: var(--_tint);
  color: var(--g-text);
  font-size: var(--g-fs-md);
  line-height: var(--g-lh);
}
.g-message[hidden] { display: none; }
.g-message--info { --_tone: var(--g-info-text); --_tint: var(--g-info-subtle); --_solid: var(--g-info); }
.g-message--success { --_tone: var(--g-success-text); --_tint: var(--g-success-subtle); --_solid: var(--g-success); }
.g-message--warning { --_tone: var(--g-warning-text); --_tint: var(--g-warning-subtle); --_solid: var(--g-warning); }
.g-message--error { --_tone: var(--g-danger-text); --_tint: var(--g-danger-subtle); --_solid: var(--g-danger); }

.g-message__icon { flex: none; display: inline-flex; color: var(--_tone); padding-top: 2px; }
.g-message__content { flex: 1 1 auto; min-width: 0; padding-block: 1px; overflow-wrap: anywhere; }
.g-message__content a { color: inherit; font-weight: var(--g-fw-semibold); text-decoration: underline; text-underline-offset: 2px; }
.g-message__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--g-icon-btn);
  height: var(--g-icon-btn);
  margin-inline-end: -4px;
  padding: 0;
  border: 0;
  border-radius: var(--g-radius-sm);
  background: transparent;
  color: inherit;
  opacity: .8;
  cursor: pointer;
}
.g-message__close:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.g-message__close:focus-visible { outline: none; opacity: 1; box-shadow: var(--g-focus-ring); }

/* Text (default): tinted fill. Outlined: tone border on the surface. Filled: solid tone. */
.g-message--text { border-color: color-mix(in srgb, var(--_tone) 22%, transparent); }
.g-message--outlined { background: var(--g-surface); border-color: var(--_tone); }
.g-message--filled { background: var(--_solid, var(--g-surface-4)); border-color: var(--_solid, var(--g-surface-4)); color: var(--g-on-solid); }
.g-message--filled .g-message__icon { color: inherit; }
.g-message--normal.g-message--filled { color: var(--g-text); }
/* amber/orange cannot carry white text: a near-black shade of the tone instead (same color-mix as base.css hovers) */
.g-message--warning.g-message--filled { color: var(--g-on-warning); }

@media (forced-colors: active) { .g-message { border: 1px solid CanvasText; } }

/* ---- css/components/numeric.css ---- */
/* Gigant UI — NumericTextBox. Box/control are the base .g-input; numbers align to the end. */
.g-numeric .g-input__control { text-align: end; font-variant-numeric: tabular-nums; }
.g-numeric .g-input__prefix[hidden],
.g-numeric .g-input__suffix[hidden] { display: none; }
.g-numeric__symbol { color: var(--g-text-2); font-size: var(--g-fs-sm); white-space: nowrap; }
.g-numeric__suffix { color: var(--g-text-2); margin-inline: 2px var(--g-space-1); }
.g-numeric__spin { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.g-numeric__spin[hidden] { display: none; }
.g-numeric__spin .g-input__btn:disabled { color: var(--g-text-disabled); cursor: not-allowed; background: transparent; }

/* Floating label — same geometry as the TextBox one (kept local so either file stands alone). */
.g-numeric__float[hidden] { display: none; }
.g-input--float .g-numeric__float {
  position: absolute;
  inset-inline-start: calc(var(--g-space-3) - 4px);
  top: 50%;
  transform: translateY(-50%);
  max-width: calc(100% - var(--g-space-10));
  padding: 0 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.2;
  font-size: var(--g-fs-md);
  color: var(--g-text-3);
  border-radius: var(--g-radius-xs);
  pointer-events: none;
  transition: top var(--g-dur-fast) var(--g-ease), font-size var(--g-dur-fast) var(--g-ease), color var(--g-dur-fast) var(--g-ease);
}
.g-input--float.g-input--has-prefix:not(.is-floated) .g-numeric__float { inset-inline-start: calc(var(--g-space-3) + 3em); }
.g-input--float.is-floated .g-numeric__float { top: 0; font-size: var(--g-fs-xs); color: var(--g-text-2); background: var(--g-surface); }
.g-input--float.is-floated.is-focused .g-numeric__float { color: var(--g-accent-text); }
.g-input--float.is-floated.is-invalid .g-numeric__float { color: var(--g-danger-text); }
.g-input--float.is-floated.is-readonly .g-numeric__float,
.g-input--float.is-floated.is-disabled .g-numeric__float { background: var(--g-surface-2); }
/* keep the number off the border when no spin/clear button follows it */
.g-numeric .g-input__control { padding-inline-end: var(--g-space-2); }

/* ---- css/components/pager.css ---- */
/*
 * Gigant UI — Pager (standalone and inside the Grid).
 * Summary on the start side, page buttons, page size and "go to page" on the end side; wraps on narrow widths.
 */
.g-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--g-space-2) var(--g-space-4);
  min-width: 0;
  font-family: var(--g-font);
  font-size: var(--g-fs-sm);
  color: var(--g-text-2);
}
.g-pager__summary {
  margin-inline-end: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--g-text-2);
  unicode-bidi: plaintext;
}
.g-pager__nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.g-pager__pages { display: inline-flex; align-items: center; gap: 2px; }
.g-pager__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--g-control-h-sm);
  height: var(--g-control-h-sm);
  padding: 0 var(--g-space-2);
  border: var(--g-border-w) solid transparent;
  border-radius: var(--g-control-radius);
  background: transparent;
  color: var(--g-text-2);
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color var(--g-dur-fast) var(--g-ease);
}
.g-pager__btn:hover:not(:disabled) { background: var(--g-surface-3); color: var(--g-text); }
.g-pager__btn:active:not(:disabled) { background: var(--g-surface-4); }
.g-pager__btn:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-pager__btn:disabled { color: var(--g-text-disabled); cursor: default; }
.g-pager__num.is-active {
  background: var(--g-accent-subtle);
  border-color: var(--g-accent-text);
  color: var(--g-text);
  font-weight: var(--g-fw-semibold);
}
.g-pager__gap { min-width: 20px; text-align: center; color: var(--g-text-3); }
.g-pager__extras { display: flex; align-items: center; gap: var(--g-space-2); flex-wrap: wrap; }
.g-pager__label { color: var(--g-text-2); white-space: nowrap; }
.g-pager__select { position: relative; display: inline-flex; align-items: center; }
.g-pager__size,
.g-pager__goto {
  height: var(--g-control-h-sm);
  border: var(--g-border-w) solid var(--g-border-input);
  border-radius: var(--g-control-radius);
  background: var(--g-surface);
  color: var(--g-text);
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.g-pager__size {
  -webkit-appearance: none;
  appearance: none;
  padding-inline: var(--g-space-3) calc(var(--g-space-3) + 16px);
  cursor: pointer;
}
.g-pager__caret { position: absolute; inset-inline-end: var(--g-space-2); pointer-events: none; display: inline-flex; color: var(--g-text-3); }
.g-pager__goto { width: 4.5em; padding: 0 var(--g-space-2); text-align: center; }
.g-pager__goto::placeholder { color: var(--g-text-3); }
.g-pager__size:hover,
.g-pager__goto:hover { border-color: var(--g-border-strong); }
.g-pager__size:focus-visible,
.g-pager__goto:focus { outline: none; border-color: var(--g-focus); box-shadow: 0 0 0 1px var(--g-focus); }

@media (max-width: 600px) {
  .g-pager { justify-content: center; }
  .g-pager__summary { margin-inline-end: 0; width: 100%; text-align: center; }
  .g-pager__btn--first,
  .g-pager__btn--last { display: none; }
}
@media (forced-colors: active) {
  .g-pager__num.is-active { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .g-pager__btn:focus-visible { outline: 2px solid Highlight; }
}

/* ---- css/components/pdfviewer.css ---- */
/* Gigant UI — PdfViewer (pdf.js pages, toolbar, thumbnails/bookmarks, search, annotations, comments). */
.g-pdfviewer {
  position: relative;
  display: flex; flex-direction: column; min-width: 0; min-height: 18rem;
  background: var(--g-surface); color: var(--g-text);
  border: var(--g-border-w) solid var(--g-border); border-radius: var(--g-radius-lg);
  overflow: hidden;
}

/* ------------------------------------------------------------------ toolbars */
.g-pdfviewer__toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--g-space-1) var(--g-space-2);
  padding: var(--g-space-1) var(--g-space-2);
  background: var(--g-surface-2); border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-pdfviewer__annbar { background: var(--g-surface); }
.g-pdfviewer__annbar[hidden], .g-pdfviewer__search[hidden] { display: none; }
.g-pdfviewer__group { display: inline-flex; align-items: center; gap: 2px; }
.g-pdfviewer__group + .g-pdfviewer__group { padding-inline-start: var(--g-space-2); border-inline-start: var(--g-border-w) solid var(--g-border); }
.g-pdfviewer__spacer { flex: 1 1 0; min-width: 0; }
.g-pdfviewer__spacer + .g-pdfviewer__group { border-inline-start: 0; padding-inline-start: 0; }
.g-pdfviewer__title { flex: 1 1 10rem; min-width: 0; display: flex; align-items: center; gap: var(--g-space-2); }
.g-pdfviewer__title + .g-pdfviewer__group { border-inline-start: 0; }
.g-pdfviewer__title > .g-icon { flex: none; color: var(--g-danger-text); }
.g-pdfviewer__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--g-fw-semibold); }
.g-pdfviewer__meta { flex: none; color: var(--g-text-3); font-size: var(--g-fs-sm); }
.g-pdfviewer .g-btn[aria-pressed="true"],
.g-pdfviewer .g-btn.is-active { --_bg: var(--g-accent-subtle); --_fg: var(--g-accent-text); --_bg-hover: var(--g-accent-subtle-2); }
.g-pdfviewer__page-box { width: 3.25rem; padding-inline: var(--g-space-1); }
.g-pdfviewer__page-box .g-input__control { text-align: center; }
.g-pdfviewer__page-of { padding-inline: var(--g-space-1); color: var(--g-text-2); font-size: var(--g-fs-sm); white-space: nowrap; }
.g-pdfviewer__zoom-box { width: 6.75rem; padding-inline-end: var(--g-space-1); }
.g-pdfviewer__prop-select { width: 5.5rem; padding-inline-end: var(--g-space-1); }
.g-pdfviewer__prop-select:has(select:disabled), .g-pdfviewer__zoom-box:has(select:disabled) { background: var(--g-surface-2); border-color: var(--g-border); }
.g-pdfviewer__color-btn { position: relative; padding-inline: var(--g-space-2); }
.g-pdfviewer__swatch {
  position: absolute; inset-inline: 25%; inset-block-end: 3px; height: 4px; border-radius: var(--g-radius-2xs);
  background: var(--_swatch, transparent); box-shadow: inset 0 0 0 1px var(--g-border-strong);
}
.g-pdfviewer__swatch.is-none,
.g-pdfviewer__swatch-btn.is-none {
  background: linear-gradient(to top right, transparent 44%, var(--g-danger) 44%, var(--g-danger) 56%, transparent 56%), var(--g-surface);
}
.g-pdfviewer__color-btn:disabled .g-pdfviewer__swatch { opacity: 0.4; }

/* search */
.g-pdfviewer__search {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--g-space-1) var(--g-space-2);
  padding: var(--g-space-1) var(--g-space-2); background: var(--g-surface); border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-pdfviewer__find-box { flex: 0 1 18rem; }
.g-pdfviewer__find-box > .g-icon { flex: none; color: var(--g-text-3); }
.g-pdfviewer__find-case { font-size: var(--g-fs-sm); }
.g-pdfviewer__find-status { min-width: 5rem; color: var(--g-text-2); font-size: var(--g-fs-sm); }
.g-pdfviewer__search .g-btn--icon { flex: none; }

/* ------------------------------------------------------------------ body: sidebar | pages | comments */
.g-pdfviewer__body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.g-pdfviewer__view {
  position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto;
  background: var(--g-surface-3); outline: 0;
}
.g-pdfviewer__view:focus-visible { box-shadow: var(--g-focus-ring-inset); }
.g-pdfviewer.is-native .g-pdfviewer__view { display: flex; overflow: hidden; }
.g-pdfviewer__frame { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: var(--g-surface-3); }
.g-pdfviewer__pages {
  box-sizing: border-box; width: max-content; min-width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: var(--g-space-4);
  padding: var(--g-space-4);
}
.g-pdfviewer__page {
  position: relative; flex: none;
  background: var(--g-surface); box-shadow: var(--g-shadow-2);
}
.g-pdfviewer__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* text layer (pdf.js lays the spans out with --scale-factor; the text itself is transparent) */
.g-pdfviewer__text {
  position: absolute; inset: 0; z-index: 2; overflow: clip; line-height: 1;
  text-size-adjust: none; -webkit-text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0;
}
.g-pdfviewer__text span,
.g-pdfviewer__text br { position: absolute; color: transparent; white-space: pre; cursor: text; transform-origin: 0 0; }
.g-pdfviewer__text span.markedContent { inset-block-start: 0; height: 0; }
.g-pdfviewer__text ::selection { background: color-mix(in srgb, var(--g-accent) 32%, transparent); }
.g-pdfviewer__text br::selection { background: transparent; }
.g-pdfviewer__text-end { position: absolute; inset: 100% 0 0; }
.g-pdfviewer.is-pan .g-pdfviewer__text,
.g-pdfviewer.is-drawing .g-pdfviewer__text { pointer-events: none; }
.g-pdfviewer.is-pan .g-pdfviewer__view { cursor: grab; user-select: none; }
.g-pdfviewer.is-pan .g-pdfviewer__view.is-grabbing { cursor: grabbing; }

/* search hits */
.g-pdfviewer__find { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.g-pdfviewer__hit { position: absolute; border-radius: var(--g-radius-2xs); background: color-mix(in srgb, var(--g-warning) 42%, transparent); }
.g-pdfviewer__hit.is-current { background: color-mix(in srgb, var(--g-accent) 38%, transparent); box-shadow: 0 0 0 2px var(--g-accent); }

/* ------------------------------------------------------------------ annotation layer */
.g-pdfviewer__ann { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.g-pdfviewer__annot { outline: 0; cursor: pointer; }
.g-pdfviewer__annot > :not(.g-pdfviewer__hit-area) { pointer-events: none; }
.g-pdfviewer__hit-area { fill: none; stroke: transparent; pointer-events: stroke; }
.g-pdfviewer__hit-area--fill { fill: transparent; stroke: none; pointer-events: fill; }
.g-pdfviewer__annot.is-editing .g-pdfviewer__ftext { visibility: hidden; }
.g-pdfviewer__sel-box { fill: none; stroke: var(--g-focus); pointer-events: none; }
.g-pdfviewer__annot:focus-visible ~ .g-pdfviewer__sel .g-pdfviewer__sel-box { stroke-dasharray: none; }
/* the page is paper (white in every theme): solid accent handles read on it in light and dark */
.g-pdfviewer__handle { fill: var(--g-accent); stroke: var(--g-text-on-accent); pointer-events: all; cursor: move; }
.g-pdfviewer__handle--n, .g-pdfviewer__handle--s { cursor: ns-resize; }
.g-pdfviewer__handle--e, .g-pdfviewer__handle--w { cursor: ew-resize; }
.g-pdfviewer__handle--nw, .g-pdfviewer__handle--se { cursor: nwse-resize; }
.g-pdfviewer__handle--ne, .g-pdfviewer__handle--sw { cursor: nesw-resize; }
.g-pdfviewer__draft { opacity: 0.85; }
.g-pdfviewer.is-drawing .g-pdfviewer__ann { pointer-events: all; cursor: crosshair; }
.g-pdfviewer.is-drawing .g-pdfviewer__annot,
.g-pdfviewer.is-drawing .g-pdfviewer__hit-area,
.g-pdfviewer.is-drawing .g-pdfviewer__handle { pointer-events: none; }
.g-pdfviewer.is-marking .g-pdfviewer__text span { cursor: text; }
.g-pdfviewer__editor {
  position: absolute; z-index: 4; box-sizing: border-box; margin: 0; resize: none; overflow: hidden;
  font-family: Helvetica, Arial, sans-serif; line-height: 1.25;
  background: transparent; border: var(--g-border-w) dashed var(--g-focus); border-radius: 0; outline: 0;
}
.g-pdfviewer__editor:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--g-focus) 35%, transparent); }

/* colour palette + stamp menu */
.g-pdfviewer__palette { display: grid; grid-template-columns: repeat(6, 28px); gap: var(--g-space-1); padding: var(--g-space-2); min-width: 0; }
.g-pdfviewer__swatch-btn {
  width: 28px; height: 28px; padding: 0; border-radius: var(--g-radius-sm); cursor: pointer;
  background: var(--_swatch, var(--g-surface)); border: var(--g-border-w) solid var(--g-border-strong);
}
.g-pdfviewer__swatch-btn[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--g-surface-raised), 0 0 0 4px var(--g-accent); }
.g-pdfviewer__swatch-btn:focus-visible { outline: 0; box-shadow: var(--g-focus-ring); }
.g-pdfviewer__stamp-menu { padding-block: var(--g-space-1); }
.g-pdfviewer__stamp-item { width: 100%; border: 0; background: none; text-align: start; font: inherit; color: inherit; }
.g-pdfviewer__stamp-chip { flex: none; width: 14px; height: 14px; border-radius: var(--g-radius-2xs); background: var(--_stamp); }

/* ------------------------------------------------------------------ sidebar (thumbnails, bookmarks) */
.g-pdfviewer__sidebar {
  flex: none; width: min(13.5rem, 40%); display: flex; flex-direction: column; min-height: 0;
  background: var(--g-surface-2); border-inline-end: var(--g-border-w) solid var(--g-border);
}
.g-pdfviewer__sidebar[hidden], .g-pdfviewer__comments[hidden] { display: none; }
.g-pdfviewer__tabs { display: flex; border-bottom: var(--g-border-w) solid var(--g-border); }
.g-pdfviewer__tab {
  flex: 1 1 0; min-height: var(--g-control-h); padding: var(--g-space-1) var(--g-space-2);
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--g-text-2); font: inherit; font-size: var(--g-fs-sm); font-weight: var(--g-fw-semibold); cursor: pointer;
}
.g-pdfviewer__tab:hover { color: var(--g-text); }
.g-pdfviewer__tab.is-active { color: var(--g-accent-text); border-bottom-color: var(--g-accent); }
.g-pdfviewer__tab:focus-visible { outline: 0; box-shadow: var(--g-focus-ring-inset); }
.g-pdfviewer__panel { flex: 1 1 auto; min-height: 0; overflow: auto; }
.g-pdfviewer__thumbs { list-style: none; margin: 0; padding: var(--g-space-3); display: flex; flex-direction: column; align-items: center; gap: var(--g-space-3); }
.g-pdfviewer__thumb {
  display: flex; flex-direction: column; align-items: center; gap: var(--g-space-1);
  padding: var(--g-space-1); background: none; border: 0; border-radius: var(--g-radius-md); cursor: pointer; color: var(--g-text-2);
}
.g-pdfviewer__thumb:hover { background: var(--g-surface-3); }
.g-pdfviewer__thumb:focus-visible { outline: 0; box-shadow: var(--g-focus-ring); }
.g-pdfviewer__thumb-frame {
  display: block; width: 112px; background: var(--g-surface); box-shadow: var(--g-shadow-1);
  border: 2px solid transparent; border-radius: var(--g-radius-2xs); overflow: hidden;
}
.g-pdfviewer__thumb[aria-current="page"] .g-pdfviewer__thumb-frame { border-color: var(--g-accent); }
.g-pdfviewer__thumb[aria-current="page"] { color: var(--g-accent-text); font-weight: var(--g-fw-semibold); }
.g-pdfviewer__thumb-canvas { display: block; width: 100%; height: auto; }
.g-pdfviewer__thumb-num { font-size: var(--g-fs-xs); }
.g-pdfviewer__bookmarks { list-style: none; margin: 0; padding: var(--g-space-1); }
.g-pdfviewer__bookmarks .g-pdfviewer__bookmarks { padding: 0; }
.g-pdfviewer__bookmark {
  display: block; width: 100%; min-height: var(--g-control-h-sm); padding-block: var(--g-space-1); padding-inline-end: var(--g-space-2);
  background: none; border: 0; border-radius: var(--g-radius-sm); color: var(--g-text); font: inherit; font-size: var(--g-fs-sm); text-align: start; cursor: pointer;
}
.g-pdfviewer__bookmark:hover { background: var(--g-surface-3); }
.g-pdfviewer__bookmark:focus-visible { outline: 0; box-shadow: var(--g-focus-ring-inset); }
.g-pdfviewer__empty { margin: 0; padding: var(--g-space-4) var(--g-space-3); color: var(--g-text-2); font-size: var(--g-fs-sm); }

/* ------------------------------------------------------------------ comments panel */
.g-pdfviewer__comments {
  flex: none; width: min(20rem, 45%); display: flex; flex-direction: column; min-height: 0;
  background: var(--g-surface); border-inline-start: var(--g-border-w) solid var(--g-border);
}
.g-pdfviewer__comments-head {
  display: flex; align-items: center; gap: var(--g-space-2);
  padding: var(--g-space-1) var(--g-space-2) var(--g-space-1) var(--g-space-3); border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-pdfviewer__comments-title { flex: 1 1 auto; margin: 0; font-size: var(--g-fs-md); font-weight: var(--g-fw-semibold); }
.g-pdfviewer__comments-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: var(--g-space-3); display: flex; flex-direction: column; gap: var(--g-space-3); }
.g-pdfviewer__comments-page { display: flex; flex-direction: column; gap: var(--g-space-2); }
.g-pdfviewer__comments-pagehead { margin: 0; color: var(--g-text-2); font-size: var(--g-fs-xs); font-weight: var(--g-fw-semibold); text-transform: uppercase; letter-spacing: 0.04em; }
.g-pdfviewer__card {
  display: flex; flex-direction: column; gap: var(--g-space-2); padding: var(--g-space-2) var(--g-space-3);
  background: var(--g-surface); border: var(--g-border-w) solid var(--g-border); border-radius: var(--g-radius-md); outline: 0;
}
.g-pdfviewer__card.is-selected { border-color: var(--g-accent); box-shadow: 0 0 0 1px var(--g-accent); }
.g-pdfviewer__card:focus-visible { box-shadow: var(--g-focus-ring); }
.g-pdfviewer__card-head { display: flex; align-items: flex-start; gap: var(--g-space-2); }
.g-pdfviewer__card-icon { flex: none; display: inline-flex; padding-block-start: 2px; color: var(--_ann, var(--g-text-2)); }
.g-pdfviewer__card-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.g-pdfviewer__card-type { font-size: var(--g-fs-sm); font-weight: var(--g-fw-semibold); overflow-wrap: anywhere; }
.g-pdfviewer__card-meta { color: var(--g-text-3); font-size: var(--g-fs-xs); }
.g-pdfviewer__card-quote {
  margin: 0; padding-inline-start: var(--g-space-2); border-inline-start: 3px solid var(--g-border-strong);
  color: var(--g-text-2); font-size: var(--g-fs-sm); white-space: pre-wrap; overflow-wrap: anywhere;
}
.g-pdfviewer__thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.g-pdfviewer__comment { display: flex; flex-direction: column; gap: 2px; padding-block: var(--g-space-1); }
.g-pdfviewer__comment + .g-pdfviewer__comment { border-top: var(--g-border-w) solid var(--g-border); }
.g-pdfviewer__comment-meta { display: flex; flex-wrap: wrap; gap: 0 var(--g-space-2); color: var(--g-text-3); font-size: var(--g-fs-xs); }
.g-pdfviewer__comment-author { color: var(--g-text-2); font-weight: var(--g-fw-semibold); }
.g-pdfviewer__comment-text { margin: 0; font-size: var(--g-fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.g-pdfviewer__comment-actions { display: flex; gap: var(--g-space-3); }
.g-pdfviewer__compose { display: flex; flex-direction: column; gap: var(--g-space-1); }
.g-pdfviewer__compose textarea.g-input__control { min-height: 2.25em; resize: none; overflow: hidden; }
.g-pdfviewer__compose-actions { display: flex; justify-content: flex-end; gap: var(--g-space-2); }

/* signature dialog content */
.g-pdfviewer__sig { display: flex; flex-direction: column; gap: var(--g-space-2); }
.g-pdfviewer__sig .g-field__hint { margin: 0; }

/* ------------------------------------------------------------------ messages, password, print frame */
.g-pdfviewer__message {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--g-space-2);
  padding: var(--g-space-6) var(--g-space-4); text-align: center; color: var(--g-text-2);
}
.g-pdfviewer__message p { margin: 0; max-width: 32rem; }
.g-pdfviewer__message > .g-icon { width: 40px; height: 40px; color: var(--g-text-3); }
.g-pdfviewer__message.is-error { color: var(--g-danger-text); }
.g-pdfviewer__message.is-error > .g-icon { color: var(--g-danger-text); }
.g-pdfviewer__fallback-title { font-weight: var(--g-fw-semibold); color: var(--g-text); }
.g-pdfviewer__fallback-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--g-space-2); margin-block-start: var(--g-space-2); }
.g-pdfviewer__pw { width: min(18rem, 100%); text-align: start; }
.g-pdfviewer__print-frame { position: fixed; inset-inline-end: 0; inset-block-end: 0; width: 0; height: 0; border: 0; }

/* ------------------------------------------------------------------ narrow screens: panes float over the pages */
@media (max-width: 720px) {
  .g-pdfviewer__btn-text { display: none; }
  .g-pdfviewer__title { flex-basis: 100%; }
  .g-pdfviewer__sidebar, .g-pdfviewer__comments { position: absolute; inset-block: 0; z-index: 5; box-shadow: var(--g-shadow-3); }
  .g-pdfviewer__sidebar { inset-inline-start: 0; width: min(14rem, 80%); }
  .g-pdfviewer__comments { inset-inline-end: 0; width: min(22rem, 92%); }
}

@media (forced-colors: active) {
  .g-pdfviewer__hit { background: Mark; forced-color-adjust: none; }
  .g-pdfviewer__hit.is-current { outline: 2px solid Highlight; }
  .g-pdfviewer__sel-box, .g-pdfviewer__handle { stroke: Highlight; }
  .g-pdfviewer__card.is-selected, .g-pdfviewer__thumb[aria-current="page"] .g-pdfviewer__thumb-frame { border-color: Highlight; }
  .g-pdfviewer__text ::selection { background: Highlight; }
}

/* ---- css/components/richtexteditor.css ---- */
/* Gigant UI — RichTextEditor. */
.g-rte {
  display: flex; flex-direction: column; min-width: 0; min-height: 10rem;
  background: var(--g-surface); color: var(--g-text);
  border: var(--g-border-w) solid var(--g-border-input); border-radius: var(--g-control-radius);
  font-family: var(--g-font); font-size: var(--g-fs-md);
  overflow: hidden;
}
.g-rte.is-focused { border-color: var(--g-focus); box-shadow: 0 0 0 1px var(--g-focus); }
.g-rte.is-disabled { background: var(--g-surface-2); color: var(--g-text-disabled); }
.g-rte.is-readonly { background: var(--g-surface-2); }

/* toolbar (APG toolbar: one tab stop, arrows move) */
.g-rte__toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  padding: var(--g-space-1);
  background: var(--g-surface-2);
  border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-rte__toolbar[hidden] { display: none; }
.g-rte__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  min-width: 30px; height: 30px; padding: 0 6px;
  border: 0; border-radius: var(--g-radius-sm);
  background: transparent; color: var(--g-text-2);
  font: inherit; font-size: var(--g-fs-sm); cursor: pointer;
}
.g-rte__btn:hover { background: var(--g-surface-3); color: var(--g-text); }
.g-rte__btn:focus-visible { outline: none; box-shadow: var(--g-focus-ring-inset); }
.g-rte__btn[aria-pressed="true"] { background: var(--g-accent-subtle); color: var(--g-accent-text); }
.g-rte__btn[aria-expanded="true"] { background: var(--g-surface-4); color: var(--g-text); }
.g-rte__btn[aria-disabled="true"] { color: var(--g-text-disabled); background: transparent; cursor: not-allowed; }
.g-rte__btn--text { padding-inline: 8px 4px; }
.g-rte__btn-text { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-rte__btn--text > .g-icon:first-child { display: none; }
.g-rte__caret { width: 12px; height: 12px; }
.g-rte__sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--g-border); }

/* editing surface */
.g-rte__content { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.g-rte__editable {
  flex: 1 1 auto; min-height: 6rem;
  padding: var(--g-space-3) var(--g-space-4);
  outline: none; line-height: 1.55; overflow-wrap: anywhere;
}
.g-rte__editable.is-empty::before {
  content: attr(data-placeholder);
  position: absolute; pointer-events: none;
  color: var(--g-text-3);
}
.g-rte__editable[hidden], .g-rte__source[hidden] { display: none; }
.g-rte__editable > :first-child { margin-block-start: 0; }
.g-rte__editable p { margin: 0 0 .5em; }
.g-rte__editable h1 { font-size: 1.6em; margin: .6em 0 .3em; line-height: 1.2; }
.g-rte__editable h2 { font-size: 1.35em; margin: .6em 0 .3em; line-height: 1.25; }
.g-rte__editable h3 { font-size: 1.15em; margin: .5em 0 .3em; }
.g-rte__editable h4 { font-size: 1em; margin: .5em 0 .3em; }
.g-rte__editable blockquote { margin: .5em 0; padding-inline-start: var(--g-space-3); border-inline-start: 3px solid var(--g-border-input); color: var(--g-text-2); }
.g-rte__editable pre { margin: .5em 0; padding: var(--g-space-2) var(--g-space-3); background: var(--g-surface-2); border-radius: var(--g-radius-sm); font-family: var(--g-font-mono); font-size: var(--g-fs-sm); white-space: pre-wrap; }
.g-rte__editable ul, .g-rte__editable ol { margin: 0 0 .5em; padding-inline-start: 1.6em; }
.g-rte__editable a { color: var(--g-accent-text); }
.g-rte__editable table { border-collapse: collapse; margin: .5em 0; }
.g-rte__editable td, .g-rte__editable th { vertical-align: top; }
.g-rte__editable img { max-width: 100%; height: auto; }
.g-rte__editable hr { border: 0; border-top: 1px solid var(--g-border-input); margin: 1em 0; }
.g-rte__source {
  flex: 1 1 auto; min-height: 6rem; width: 100%; resize: none;
  padding: var(--g-space-3) var(--g-space-4);
  border: 0; outline: none; background: var(--g-surface); color: var(--g-text);
  font-family: var(--g-font-mono); font-size: var(--g-fs-sm); line-height: 1.5;
}
.g-rte__source:focus-visible { box-shadow: var(--g-focus-ring-inset); }
.g-rte.is-readonly .g-rte__editable,
.g-rte.is-disabled .g-rte__editable { cursor: default; }

.g-rte__footer { display: flex; justify-content: flex-end; padding: 2px var(--g-space-3); font-size: var(--g-fs-xs); color: var(--g-text-3); border-top: var(--g-border-w) solid var(--g-border); }
.g-rte__footer[hidden] { display: none; }
.g-rte__footer.is-over { color: var(--g-danger-text); }

/* full screen */
.g-rte--fullscreen { position: fixed; inset: 0; z-index: var(--g-z-dialog); height: auto; border-radius: 0; }
.g-rte-noscroll { overflow: hidden; }

/* popups */
.g-rte__popup { padding: var(--g-space-1); }
.g-rte__menu { min-width: 11rem; }
.g-rte__menu .g-option { gap: var(--g-space-2); }
.g-rte__fmt--h1 .g-option__text { font-size: 1.3em; font-weight: var(--g-fw-semibold); }
.g-rte__fmt--h2 .g-option__text { font-size: 1.15em; font-weight: var(--g-fw-semibold); }
.g-rte__fmt--h3 .g-option__text { font-size: 1.05em; font-weight: var(--g-fw-semibold); }
.g-rte__fmt--h4 .g-option__text { font-weight: var(--g-fw-semibold); }
.g-rte__fmt--pre .g-option__text { font-family: var(--g-font-mono); }
.g-rte__fmt--blockquote .g-option__text { font-style: italic; }
.g-rte__swatches { display: flex; flex-direction: column; gap: var(--g-space-2); padding: var(--g-space-2); }
.g-rte__swatch-grid { display: grid; grid-template-columns: repeat(6, 28px); gap: 4px; }
.g-rte__swatch {
  width: 28px; height: 28px; padding: 0; cursor: pointer;
  border: var(--g-border-w) solid var(--g-border-input); border-radius: var(--g-radius-sm);
  background: var(--_sw);
}
.g-rte__swatch:hover { box-shadow: 0 0 0 2px var(--g-surface), 0 0 0 3px var(--g-border-strong); }
.g-rte__swatch:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-rte__form { display: flex; flex-direction: column; gap: var(--g-space-2); padding: var(--g-space-3); width: min(20rem, 90vw); }
.g-rte__form-actions { display: flex; justify-content: flex-end; gap: var(--g-space-2); margin-block-start: var(--g-space-1); }

@media (forced-colors: active) {
  .g-rte { border-color: CanvasText; }
  .g-rte__btn[aria-pressed="true"] { outline: 2px solid Highlight; }
  .g-rte__swatch { forced-color-adjust: none; }
}

/* ---- css/components/schedule.css ---- */
/*
 * Gigant UI — Schedule.
 *
 *   .g-sch                 root (toolbar + viewport); --auto when height is 'auto'
 *   .g-sch__toolbar        Today / ‹ › / date-range title (jump) / view switcher
 *   .g-sch__scroll         the ONE scroller: sticky header rows, sticky time / resource column
 *   .g-sch__table          role=grid; --vertical (Day/Week), --timeline, --month
 *   .g-sch__row            role=row, a CSS grid with the table's column template
 *   .g-sch__cell           role=gridcell (work, all-day and month cells)
 *   .g-sch-ev              an event chip (role=button), positioned inside the cell it starts in
 *   .g-sch__agenda         Agenda view: a list per day
 *   .g-sch-quick           quick-info popover;  .g-sch-dialog  built-in modal (editor, delete alert)
 *
 * Event colour: the chip is a TINT of the event colour (16 % over the surface) with a solid accent
 * bar, and the text is always --g-text. Whatever colour a page or a resource supplies, the text
 * contrast stays above 4.5:1 in both modes because the tint never exceeds a quarter of the colour.
 */
.g-sch {
  --g-sch-gutter: 4.5rem;
  --g-sch-rh: 11rem;
  --g-sch-slot-h: calc(var(--g-row-h-compact) - 4px);
  --g-sch-chip-h: 24px;
  --g-sch-chip-step: 26px;
  --g-sch-lane-step: 28px;
  --g-sch-mhead: 30px;
  --g-sch-mrow-min: 6.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 100%;
  background: var(--g-surface);
  color: var(--g-text);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-surface-radius);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  overflow: hidden;
}
.g-sch.is-dragging,
.g-sch.is-dragging * { cursor: grabbing; user-select: none; }

/* ------------------------------------------------------------------ toolbar */
.g-sch__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--g-space-2);
  padding: var(--g-space-2) var(--g-space-3);
  border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-sch__nav { display: flex; align-items: center; gap: var(--g-space-1); flex-wrap: wrap; min-width: 0; }
.g-sch__title { font-weight: var(--g-fw-semibold); font-size: var(--g-fs-md); color: var(--g-text); gap: var(--g-space-2); }
.g-sch__title .g-icon--chevron-down { width: 14px; height: 14px; color: var(--g-text-3); }
.g-sch__spacer { flex: 1 1 auto; }
.g-sch__views .g-btn.is-active {
  --_bg: var(--g-accent-subtle); --_bg-hover: var(--g-accent-subtle-2); --_fg: var(--g-accent-text); --_bd: var(--g-accent-text);
  position: relative; z-index: 1;
}

/* ------------------------------------------------------------------ viewport / scroller */
.g-sch__viewport { position: relative; display: flex; flex: 1 1 auto; min-height: 0; }
.g-sch__scroll { position: relative; flex: 1 1 auto; min-width: 0; overflow: auto; }
.g-sch--auto .g-sch__scroll { overflow-y: hidden; }

.g-sch__table { position: relative; }
.g-sch__row { display: grid; }
.g-sch__table--vertical .g-sch__row { grid-template-columns: var(--g-sch-gutter) repeat(var(--_cols), minmax(var(--_colmin), 1fr)); }
.g-sch__table--timeline .g-sch__row { grid-template-columns: var(--g-sch-rh) repeat(var(--_cols), minmax(var(--_colmin), 1fr)); }
.g-sch__table--month .g-sch__row { grid-template-columns: repeat(var(--_cols), minmax(var(--_colmin), 1fr)); }

/* header */
.g-sch__head { position: sticky; top: 0; z-index: 4; background: var(--g-surface); }
.g-sch__hcell {
  min-width: 0;
  padding: var(--g-space-1) var(--g-space-1);
  border-bottom: var(--g-border-w) solid var(--g-border);
  border-inline-end: var(--g-border-w) solid var(--g-border);
  font-size: var(--g-fs-sm);
  color: var(--g-text-2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-sch__corner { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--g-surface); }
.g-sch__hcell--res { padding-block: var(--g-space-2); }
.g-sch__hcell--time { text-align: start; font-size: var(--g-fs-xs); color: var(--g-text-3); padding-inline: var(--g-space-2); }
.g-sch__hcell--date { text-align: start; padding-inline: var(--g-space-2); }
.g-sch__hcell--dow { font-size: var(--g-fs-xs); font-weight: var(--g-fw-semibold); color: var(--g-text-3); text-transform: uppercase; letter-spacing: .04em; padding-block: var(--g-space-2); }

.g-sch__date {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 2px var(--g-space-2);
  border: 0;
  border-radius: var(--g-radius-md);
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.15;
}
button.g-sch__date { cursor: pointer; }
button.g-sch__date:hover { background: var(--g-surface-3); }
button.g-sch__date:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-sch__dow { font-size: var(--g-fs-xs); color: var(--g-text-3); text-transform: uppercase; letter-spacing: .04em; }
.g-sch__dnum {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 2rem; padding: 0 4px;
  border-radius: var(--g-radius-pill);
  font-size: var(--g-fs-lg); font-weight: var(--g-fw-semibold); color: var(--g-text);
}
.g-sch__dnum.is-today { background: var(--g-accent); color: var(--g-text-on-accent); }
.g-sch__date--compact { flex-direction: row; gap: var(--g-space-1); }
.g-sch__date--compact .g-sch__dnum { min-width: 1.6rem; height: 1.6rem; font-size: var(--g-fs-sm); }

.g-sch__res { display: inline-flex; align-items: center; gap: var(--g-space-2); min-width: 0; max-width: 100%; font-weight: var(--g-fw-semibold); color: var(--g-text); }
.g-sch__res-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-sch__res-dot { --_ev: var(--g-accent); flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--_ev); }

/* time gutter / resource header column */
.g-sch__gutter,
.g-sch__rh {
  position: sticky;
  inset-inline-start: 0;
  z-index: 3;
  background: var(--g-surface);
  border-inline-end: var(--g-border-w) solid var(--g-border);
  min-width: 0;
}
.g-sch__gutter {
  padding-inline-end: var(--g-space-2);
  text-align: end;
  font-size: var(--g-fs-xs);
  color: var(--g-text-3);
}
.g-sch__row--slot.is-major-end .g-sch__gutter { border-bottom: var(--g-border-w) solid var(--g-border); }
.g-sch__time { display: block; padding-top: 2px; font-variant-numeric: tabular-nums; }
.g-sch__row--allday .g-sch__gutter { display: flex; align-items: center; justify-content: flex-end; border-bottom: 2px solid var(--g-border); font-size: var(--g-fs-xs); color: var(--g-text-3); padding-inline-start: var(--g-space-1); white-space: normal; text-align: end; }
.g-sch__rh { display: flex; align-items: center; padding: var(--g-space-1) var(--g-space-3); border-bottom: var(--g-border-w) solid var(--g-border); font-size: var(--g-fs-sm); overflow: hidden; }

/* ------------------------------------------------------------------ cells */
.g-sch__cell {
  position: relative;
  min-width: 0;
  background: var(--g-surface);
  border-inline-end: var(--g-border-w) solid var(--g-border);
  outline: none;
  transition: background-color var(--g-dur-fast) var(--g-ease);
}
.g-sch__cell.is-off { background: var(--g-surface-2); }
.g-sch__cell:hover { background: var(--g-row-hover); }
.g-sch__cell.is-selected { background: var(--g-accent-subtle); }
.g-sch__cell:focus-visible { box-shadow: var(--g-focus-ring-inset); }
.g-sch__row--slot { height: var(--g-sch-slot-h); }
.g-sch__row--slot .g-sch__cell { border-bottom: var(--g-border-w) dashed var(--g-border); }
.g-sch__row--slot.is-major-end .g-sch__cell { border-bottom-style: solid; }
.g-sch__row--allday { min-height: calc(var(--_allday-lanes, 1) * var(--g-sch-chip-step) + 6px); }
.g-sch__cell--allday { border-bottom: 2px solid var(--g-border); }

/* timeline */
.g-sch__row--lane { min-height: max(3rem, calc(var(--_lanes, 1) * var(--g-sch-lane-step) + 8px)); }
.g-sch__table--timeline .g-sch__cell { border-bottom: var(--g-border-w) solid var(--g-border); border-inline-end-style: dashed; }
.g-sch__table--timeline .g-sch__cell.is-major-end { border-inline-end-style: solid; }

/* month */
.g-sch__table--month { display: flex; flex-direction: column; min-height: 100%; }
.g-sch__body--month { display: flex; flex-direction: column; flex: 1 1 auto; }
.g-sch__row--week { flex: 1 1 0; min-height: var(--g-sch-mrow-min); }
.g-sch__cell--month { border-bottom: var(--g-border-w) solid var(--g-border); }
.g-sch__cell--month.is-other { background: var(--g-surface-2); }
.g-sch__mnum {
  position: absolute;
  top: 4px;
  inset-inline-start: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 6px;
  border: 0; border-radius: var(--g-radius-pill);
  background: transparent; color: var(--g-text-2);
  font: inherit; font-size: var(--g-fs-sm); font-weight: var(--g-fw-medium);
  font-variant-numeric: tabular-nums;
}
button.g-sch__mnum { cursor: pointer; }
button.g-sch__mnum:hover { background: var(--g-surface-3); }
.g-sch__cell--month.is-other .g-sch__mnum { color: var(--g-text-3); }
.g-sch__mnum.is-today,
.g-sch__cell--month.is-other .g-sch__mnum.is-today { background: var(--g-accent); color: var(--g-text-on-accent); }
.g-sch__more {
  position: absolute;
  inset-inline-start: 4px;
  z-index: 2;
  min-height: var(--g-sch-chip-h);
  padding: 0 var(--g-space-2);
  border: 0;
  border-radius: var(--g-radius-sm);
  background: transparent;
  color: var(--g-accent-text);
  font: inherit;
  font-size: var(--g-fs-xs);
  font-weight: var(--g-fw-semibold);
  cursor: pointer;
}
.g-sch__more:hover { background: var(--g-accent-subtle); }
.g-sch__more:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }

/* current time */
.g-sch__now { position: absolute; inset-inline: 0; z-index: 2; height: 2px; margin-top: -1px; background: var(--g-danger); pointer-events: none; }
.g-sch__now::before { content: ""; position: absolute; top: -4px; inset-inline-start: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--g-danger); }
.g-sch__now--v { inset-inline: auto; top: 0; bottom: 0; width: 2px; height: auto; margin: 0 0 0 -1px; }
.g-sch__now--v::before { top: -2px; inset-inline-start: -4px; }

/* ------------------------------------------------------------------ events */
.g-sch-ev {
  --_ev: var(--g-accent);
  position: absolute;
  z-index: 2;
  display: flex;
  min-width: 0;
  overflow: hidden;
  padding: 2px var(--g-space-2) 2px 7px;
  padding-inline: 7px var(--g-space-2);
  border-inline-start: 3px solid var(--_ev);
  border-radius: var(--g-radius-sm);
  background: color-mix(in srgb, var(--_ev) 16%, var(--g-surface));
  box-shadow: 0 0 0 1px var(--g-surface);
  color: var(--g-text);
  font-size: var(--g-fs-xs);
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  transition: background-color var(--g-dur-fast) var(--g-ease), box-shadow var(--g-dur-fast) var(--g-ease);
}
.g-sch-ev:hover { background: color-mix(in srgb, var(--_ev) 24%, var(--g-surface)); }
.g-sch-ev:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-sch-ev__inner { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; overflow: hidden; }
.g-sch-ev__subject { font-weight: var(--g-fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-sch-ev__time,
.g-sch-ev__loc { color: var(--g-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-sch-ev.is-short .g-sch-ev__inner { flex-direction: row; align-items: center; gap: var(--g-space-2); }
.g-sch-ev.is-short .g-sch-ev__loc { display: none; }

.g-sch-ev--bar { height: var(--g-sch-chip-h); align-items: center; inset-inline-start: 2px; }
.g-sch-ev--bar .g-sch-ev__inner { flex-direction: row; align-items: center; gap: var(--g-space-2); }
.g-sch-ev--month { inset-inline-start: 3px; }
.g-sch-ev--month:not(.g-sch-ev--bar) { height: var(--g-sch-chip-h); align-items: center; }
.g-sch-ev--month:not(.g-sch-ev--bar) .g-sch-ev__inner { flex-direction: row; gap: var(--g-space-1); }
.g-sch-ev.is-cont-prev { border-start-start-radius: 0; border-end-start-radius: 0; border-inline-start-style: dashed; }
.g-sch-ev.is-cont-next { border-start-end-radius: 0; border-end-end-radius: 0; }
.g-sch-ev.is-readonly { cursor: pointer; }
.g-sch-ev.is-block {
  background: repeating-linear-gradient(135deg, var(--g-surface-3) 0 6px, var(--g-surface-2) 6px 12px);
  border-inline-start-color: var(--g-text-3);
  color: var(--g-text-2);
  cursor: not-allowed;
}
.g-sch-ev.is-dragging { z-index: 2; pointer-events: none; box-shadow: var(--g-shadow-3); background: color-mix(in srgb, var(--_ev) 24%, var(--g-surface)); }
.g-sch-ev.is-drag-source { pointer-events: none; opacity: .4; }

.g-sch-ev__resize { position: absolute; z-index: 1; }
.g-sch-ev:not(.g-sch-ev--bar) .g-sch-ev__resize--start { top: 0; inset-inline: 0; height: 6px; cursor: ns-resize; }
.g-sch-ev:not(.g-sch-ev--bar) .g-sch-ev__resize--end { bottom: 0; inset-inline: 0; height: 6px; cursor: ns-resize; }
.g-sch-ev--bar .g-sch-ev__resize--start { inset-block: 0; inset-inline-start: 0; width: 6px; cursor: ew-resize; }
.g-sch-ev--bar .g-sch-ev__resize--end { inset-block: 0; inset-inline-end: 0; width: 6px; cursor: ew-resize; }
.g-sch-ev:hover .g-sch-ev__resize--end::after,
.g-sch-ev:focus-visible .g-sch-ev__resize--end::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 16px; height: 2px; border-radius: var(--g-radius-2xs); background: var(--_ev); opacity: .7;
}
.g-sch-ev--bar:hover .g-sch-ev__resize--end::after { width: 2px; height: 12px; }

/* ------------------------------------------------------------------ agenda */
.g-sch__agenda { display: flex; flex-direction: column; gap: var(--g-space-3); padding: var(--g-space-3) var(--g-space-4); }
.g-sch__agenda-day {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr);
  gap: var(--g-space-3);
  padding-bottom: var(--g-space-3);
  border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-sch__agenda-day:last-child { border-bottom: 0; }
.g-sch__agenda-date { margin: 0; display: flex; align-items: baseline; gap: var(--g-space-2); font-size: var(--g-fs-md); font-weight: var(--g-fw-semibold); }
.g-sch__agenda-num { font-size: var(--g-fs-2xl); font-variant-numeric: tabular-nums; line-height: 1; }
.g-sch__agenda-day.is-today .g-sch__agenda-num { color: var(--g-accent-text); }
.g-sch__agenda-dtext { font-size: var(--g-fs-xs); font-weight: var(--g-fw-regular); color: var(--g-text-3); }
.g-sch__agenda-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--g-space-2); }
.g-sch__agenda-empty,
.g-sch__agenda-none { color: var(--g-text-3); font-size: var(--g-fs-sm); margin: 0; }
.g-sch-ev--agenda { position: relative; z-index: auto; min-height: 36px; align-items: center; padding-block: var(--g-space-2); font-size: var(--g-fs-sm); }
.g-sch-ev--agenda .g-sch-ev__inner { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: var(--g-space-4); row-gap: 2px; }
.g-sch-ev--agenda .g-sch-ev__time { order: -1; min-width: 7.5rem; color: var(--g-text-2); }
@media (max-width: 600px) {
  .g-sch__agenda-day { grid-template-columns: minmax(0, 1fr); }
  .g-sch__toolbar { padding: var(--g-space-2); }
}

/* ------------------------------------------------------------------ popovers */
.g-sch-quick { width: min(22rem, calc(100vw - 16px)); border-top: 4px solid var(--_ev, var(--g-accent)); }
.g-sch-quick__head { display: flex; align-items: flex-start; gap: var(--g-space-2); padding: var(--g-space-3) var(--g-space-3) var(--g-space-1) var(--g-space-4); }
.g-sch-quick__title { flex: 1 1 auto; min-width: 0; margin: 0; padding-top: 4px; font-size: var(--g-fs-lg); font-weight: var(--g-fw-semibold); overflow-wrap: anywhere; }
.g-sch-quick__body { padding: var(--g-space-1) var(--g-space-4) var(--g-space-3); font-size: var(--g-fs-sm); overflow: auto; }
.g-sch-quick__list { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--g-space-2) var(--g-space-2); margin: 0; }
.g-sch-quick__list dt { color: var(--g-text-3); padding-top: 1px; }
.g-sch-quick__list dd { margin: 0; overflow-wrap: anywhere; }
.g-sch-quick__input { margin-top: var(--g-space-1); }
.g-sch-quick__when { margin: var(--g-space-2) 0 0; color: var(--g-text-2); }
.g-sch-quick__foot { display: flex; justify-content: flex-end; gap: var(--g-space-2); padding: var(--g-space-2) var(--g-space-4) var(--g-space-3); border-top: var(--g-border-w) solid var(--g-border); }
.g-sch-quick__delete { margin-inline-end: auto; color: var(--g-danger-text); }
.g-sch-more__list { list-style: none; margin: 0; padding: var(--g-space-1) var(--g-space-3) var(--g-space-3); display: flex; flex-direction: column; gap: var(--g-space-2); overflow: auto; }
.g-sch-tip { padding: var(--g-space-2) var(--g-space-3); font-size: var(--g-fs-sm); min-width: 0; max-width: 20rem; pointer-events: none; }
.g-sch-tip__title { font-weight: var(--g-fw-semibold); }
.g-sch-jump { padding: 0; }
.g-sch-jump .g-calendar { border: 0; box-shadow: none; }

/* ------------------------------------------------------------------ built-in modal (when GUI.Dialog is absent) */
.g-sch-modal { display: flex; align-items: center; justify-content: center; padding: var(--g-space-4); }
.g-sch-dialog {
  display: flex;
  flex-direction: column;
  width: min(38rem, 100%);
  max-height: calc(100vh - 2 * var(--g-space-4));
  background: var(--g-surface-raised);
  color: var(--g-text);
  border-radius: var(--g-surface-radius);
  box-shadow: var(--g-shadow-4);
  outline: none;
}
.g-sch-dialog--alert { width: min(28rem, 100%); }
.g-sch-dialog__head { display: flex; align-items: center; gap: var(--g-space-2); padding: var(--g-space-3) var(--g-space-3) var(--g-space-2) var(--g-space-5); border-bottom: var(--g-border-w) solid var(--g-border); }
.g-sch-dialog__title { flex: 1 1 auto; margin: 0; font-size: var(--g-fs-lg); font-weight: var(--g-fw-semibold); }
.g-sch-dialog .g-sch-dialog__body { padding: var(--g-space-4) var(--g-space-5); overflow: auto; }
.g-sch-dialog .g-sch-dialog__foot { padding: var(--g-space-3) var(--g-space-5); border-top: var(--g-border-w) solid var(--g-border); }
.g-sch-dialog__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--g-space-2); width: 100%; }
.g-sch-dialog__body p { margin: 0; }
.g-sch-editor .g-field__error:empty { display: none; }

/* ------------------------------------------------------------------ print */
.g-sch-print-root { display: block; padding: 0; background: var(--g-surface); }
.g-sch-print-root__title { margin: 0 0 var(--g-space-3); font-size: var(--g-fs-xl); font-weight: var(--g-fw-semibold); }
.g-sch--print { border: 0; border-radius: 0; }
.g-sch--print .g-sch__head,
.g-sch--print .g-sch__gutter,
.g-sch--print .g-sch__rh,
.g-sch--print .g-sch__corner { position: static; }
.g-sch--print .g-sch__scroll { overflow: visible; }
@media print {
  .g-sch-print-root { width: 100%; }
  .g-sch--print .g-sch__table { min-width: 0; }
}

@media (forced-colors: active) {
  .g-sch-ev { border: 1px solid CanvasText; border-inline-start-width: 4px; forced-color-adjust: none; background: Canvas; color: CanvasText; }
  .g-sch-ev:focus-visible { outline: 2px solid Highlight; }
  .g-sch__cell.is-selected { forced-color-adjust: none; background: Highlight; }
  .g-sch__cell:focus-visible { outline: 2px solid Highlight; outline-offset: -2px; }
  .g-sch__now, .g-sch__now::before { background: Highlight; }
}

/* timeline date headers span many slots: keep the label visible while scrolling sideways */
.g-sch__hcell--date { overflow: visible; }
.g-sch__hcell--date .g-sch__date { position: sticky; inset-inline-start: calc(var(--g-sch-rh) + var(--g-space-2)); }
/* one-line chips: the subject keeps its room, time and place give way first */
.g-sch-ev--bar .g-sch-ev__subject,
.g-sch-ev.is-short .g-sch-ev__subject { flex: 0 1 auto; min-width: 2.5em; }
.g-sch-ev--bar .g-sch-ev__time,
.g-sch-ev--bar .g-sch-ev__loc,
.g-sch-ev.is-short .g-sch-ev__time { flex: 0 1000 auto; min-width: 0; }
/* mixed-script data (Latin names on an RTL page and vice versa) keeps its own direction */
.g-sch-ev__subject, .g-sch-ev__time, .g-sch-ev__loc, .g-sch__title span, .g-sch__more, .g-sch__res-text { unicode-bidi: plaintext; }

/* ---- css/components/signature.css ---- */
/* Gigant UI — Signature. The pad keeps the author's paper colour (backgroundColor); chrome uses tokens. */
.g-signature { display: flex; flex-direction: column; gap: var(--g-space-2); min-width: 0; }
.g-signature__pad {
  position: relative;
  width: 100%;
  min-height: 120px;
  border: var(--g-border-w) solid var(--g-border-input);
  border-radius: var(--g-control-radius);
  background: var(--g-surface);
  overflow: hidden;
  touch-action: none;
}
.g-signature__canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.g-signature__pad.is-disabled .g-signature__canvas { cursor: not-allowed; }
.g-signature__line {
  position: absolute;
  inset-inline: 8%;
  bottom: 26%;
  border-bottom: 1px dashed var(--_sig-ink-faint, var(--g-border-input));
  pointer-events: none;
}
.g-signature__placeholder {
  position: absolute;
  inset-inline-start: 8%;
  bottom: calc(26% + 6px);
  font-size: var(--g-fs-sm);
  color: var(--_sig-ink-faint, var(--g-text-3));
  pointer-events: none;
}
.g-signature__placeholder[hidden] { display: none; }
.g-signature__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--g-space-1); }
.g-signature__spacer { flex: 1; }
.g-signature__typed[hidden] { display: none; }

/* ---- css/components/slider.css ---- */
/* Gigant UI — Slider. Horizontal positions use inset-inline-start, so RTL mirrors with no overrides. */
.g-slider {
  --_thumb: 18px;
  --_track: 4px;
  display: flex;
  align-items: center;
  gap: var(--g-space-2);
  width: 100%;
  min-width: 0;
  padding-block: var(--g-space-2);
  color: var(--g-text);
  touch-action: none;
  user-select: none;
}
.g-slider--tooltip { padding-block-start: calc(var(--g-space-8) + var(--g-space-1)); }
.g-slider--tooltip-after { padding-block: var(--g-space-2) calc(var(--g-space-8) + var(--g-space-1)); }
.g-slider--ticks-after,
.g-slider--ticks-both { padding-block-end: calc(var(--g-space-6) + var(--g-space-1)); }
.g-slider--ticks-before,
.g-slider--ticks-both { padding-block-start: calc(var(--g-space-6) + var(--g-space-1)); }
.g-slider--tooltip.g-slider--ticks-before,
.g-slider--tooltip.g-slider--ticks-both { padding-block-start: calc(var(--g-space-10) + var(--g-space-4)); }

.g-slider__body {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: var(--_thumb);
  margin-inline: calc(var(--_thumb) / 2);
  cursor: pointer;
}
.g-slider__track {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: var(--_track);
  margin-top: calc(var(--_track) / -2);
  border-radius: var(--g-radius-pill);
  background: var(--g-surface-4);
}
.g-slider__range,
.g-slider__limit {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: var(--g-radius-pill);
}
.g-slider__range { background: var(--g-accent); }
.g-slider__range[hidden] { display: none; }
.g-slider__limit { background: var(--g-accent-subtle-2); }

.g-slider__thumb {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: var(--_thumb);
  height: var(--_thumb);
  margin-top: calc(var(--_thumb) / -2);
  margin-inline-start: calc(var(--_thumb) / -2);
  border: 2px solid var(--g-accent);
  border-radius: 50%;
  background: var(--g-surface);
  box-shadow: var(--g-shadow-1);
  cursor: grab;
  transition: transform var(--g-dur-fast) var(--g-ease), box-shadow var(--g-dur-fast) var(--g-ease);
}
.g-slider__thumb:hover { transform: scale(1.12); }
.g-slider__thumb:focus { outline: none; }
.g-slider__thumb:focus-visible,
.g-slider__thumb.is-focused { box-shadow: var(--g-focus-ring); }
.g-slider__thumb.is-dragging { cursor: grabbing; transform: scale(1.15); }
/* a pointer target of at least 24×24 around an 18px thumb */
.g-slider__thumb::before { content: ''; position: absolute; inset: -5px; border-radius: 50%; }

.g-slider__tooltip {
  position: absolute;
  bottom: calc(100% + var(--g-space-2));
  inset-inline-start: 50%;
  translate: -50% 0;
  min-width: 2rem;
  padding: 2px var(--g-space-2);
  border-radius: var(--g-radius-sm);
  background: var(--g-text);
  color: var(--g-surface);
  font-size: var(--g-fs-xs);
  font-variant-numeric: tabular-nums;
  line-height: var(--g-lh-tight);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--g-dur-fast) var(--g-ease);
}
[dir="rtl"] .g-slider__tooltip { translate: 50% 0; }
.g-slider--tooltip-after .g-slider__tooltip { bottom: auto; top: calc(100% + var(--g-space-2)); }
.g-slider:not(.g-slider--tooltip) .g-slider__tooltip { display: none; }
/* showOn: auto = hover, focus or drag; always; focus; hover; click (= while pressed) */
.g-slider[data-tooltip-on="always"] .g-slider__tooltip,
.g-slider[data-tooltip-on="auto"] .g-slider__thumb:hover .g-slider__tooltip,
.g-slider[data-tooltip-on="auto"] .g-slider__thumb.is-focused .g-slider__tooltip,
.g-slider[data-tooltip-on="hover"] .g-slider__thumb:hover .g-slider__tooltip,
.g-slider[data-tooltip-on="focus"] .g-slider__thumb.is-focused .g-slider__tooltip,
.g-slider .g-slider__thumb.is-dragging .g-slider__tooltip { opacity: 1; visibility: visible; }

.g-slider__ticks { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.g-slider__tick {
  position: absolute;
  top: calc(50% + var(--_thumb) / 2 + 2px);
  width: 1px;
  height: 5px;
  background: var(--g-border-strong);
}
.g-slider__tick.is-large { height: 8px; }
.g-slider__tick-label {
  position: absolute;
  top: calc(100% + 2px);
  inset-inline-start: 50%;
  translate: -50% 0;
  color: var(--g-text-2);
  font-size: var(--g-fs-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
[dir="rtl"] .g-slider__tick-label { translate: 50% 0; }
.g-slider--ticks-before .g-slider__tick { top: auto; bottom: calc(50% + var(--_thumb) / 2 + 2px); }
.g-slider--ticks-before .g-slider__tick-label { top: auto; bottom: calc(100% + 2px); }
.g-slider--ticks-both .g-slider__tick::after {
  content: '';
  position: absolute;
  bottom: calc(100% + var(--_thumb) + 4px);
  inset-inline-start: 0;
  width: 1px;
  height: inherit;
  background: inherit;
}

.g-slider__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: var(--g-border-w) solid var(--g-border-input);
  border-radius: 50%;
  background: var(--g-surface);
  color: var(--g-text-2);
  cursor: pointer;
}
.g-slider__btn:hover:not(:disabled) { background: var(--g-surface-3); color: var(--g-text); }
.g-slider__btn:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-slider__btn:disabled { color: var(--g-text-disabled); border-color: var(--g-border); cursor: not-allowed; }

/* states */
.g-slider.is-disabled .g-slider__body { cursor: not-allowed; }
.g-slider.is-disabled .g-slider__range { background: var(--g-text-disabled); }
.g-slider.is-disabled .g-slider__thumb { border-color: var(--g-text-disabled); box-shadow: none; cursor: not-allowed; transform: none; }
.g-slider.is-readonly .g-slider__body,
.g-slider.is-readonly .g-slider__thumb { cursor: default; }
.g-slider.is-readonly .g-slider__thumb:hover { transform: none; }

/* vertical */
.g-slider--vertical {
  flex-direction: column-reverse;
  width: auto;
  height: 12rem;
  padding-block: 0;
  padding-inline: var(--g-space-2);
}
.g-slider--vertical .g-slider__body { width: var(--_thumb); height: auto; flex: 1 1 auto; margin: calc(var(--_thumb) / 2) 0; }
.g-slider--vertical .g-slider__track { inset-inline: auto; top: 0; bottom: 0; left: 50%; width: var(--_track); height: auto; margin: 0 0 0 calc(var(--_track) / -2); }
.g-slider--vertical .g-slider__range,
.g-slider--vertical .g-slider__limit { top: auto; left: 0; right: 0; width: auto; }
.g-slider--vertical .g-slider__thumb { top: auto; left: 50%; margin: 0 0 calc(var(--_thumb) / -2) calc(var(--_thumb) / -2); }
.g-slider--vertical .g-slider__tooltip { bottom: auto; top: 50%; inset-inline-start: calc(100% + var(--g-space-2)); translate: 0 -50%; }
.g-slider--vertical .g-slider__tick { top: auto; left: calc(50% + var(--_thumb) / 2 + 2px); width: 5px; height: 1px; }
.g-slider--vertical .g-slider__tick.is-large { width: 8px; height: 1px; }
.g-slider--vertical .g-slider__tick-label { top: 50%; inset-inline-start: auto; left: calc(100% + 4px); translate: 0 -50%; }
[dir="rtl"] .g-slider--vertical .g-slider__tick-label { translate: 0 -50%; }
.g-slider--vertical.g-slider--tooltip,
.g-slider--vertical.g-slider--ticks-after { padding-block: 0; padding-inline-end: var(--g-space-10); }

@media (forced-colors: active) {
  .g-slider__track { background: CanvasText; }
  .g-slider__range { background: Highlight; }
  .g-slider__thumb { background: ButtonFace; border-color: ButtonText; }
}

/* ---- css/components/sparkline.css ---- */
/*
 * Gigant UI — Sparkline. Shared base: viz.css; palette and tooltip: chart.css.
 * Word-sized: no minimum height (it fits a grid cell or a KPI tile), 2px line, 2px-radius columns.
 */
.g-viz--sparkline { min-height: 16px; }
.g-viz--sparkline .g-viz__plot { min-height: 16px; }
.g-viz--sparkline .g-chart__tooltip { min-width: 0; white-space: nowrap; padding: var(--g-space-1) var(--g-space-2); }

.g-sparkline__line { fill: none; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.g-sparkline__area { stroke: none; pointer-events: none; }
.g-sparkline__band { pointer-events: none; }
.g-sparkline__marker { stroke: var(--g-chart-surface); stroke-width: 1.5; }
.g-sparkline__marker.is-hidden { fill-opacity: 0; stroke-opacity: 0; }
.g-sparkline__marker.is-hover,
.g-sparkline__marker.g-viz__mark:focus-visible { fill-opacity: 1; stroke-opacity: 1; }
.g-sparkline__marker.g-viz__mark:focus-visible { stroke: var(--g-focus); stroke-width: 2.5; }
.g-sparkline__slice { stroke: var(--g-chart-surface); stroke-width: 1; }
.g-sparkline__track { stroke: var(--g-text-3); stroke-dasharray: 2 2; pointer-events: none; }
.g-sparkline__label { font-size: var(--g-fs-2xs); }

/* ---- css/components/stepper.css ---- */
/*
 * Gigant UI — Stepper. Status classes on each step: is-completed / is-active / is-pending / is-error.
 */
.g-stepper { --_dot: 32px; min-width: 0; color: var(--g-text); font-family: var(--g-font); font-size: var(--g-fs-md); }
.g-stepper__list { display: flex; align-items: flex-start; margin: 0; padding: 0; list-style: none; }
.g-stepper__step { position: relative; display: flex; flex: 1 1 0; min-width: 0; flex-direction: column; align-items: center; }
.g-stepper__trigger {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--g-space-1);
  max-width: 100%;
  padding: var(--g-space-1) var(--g-space-2);
  border: 0;
  border-radius: var(--g-radius-md);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
}
button.g-stepper__trigger { cursor: pointer; }
button.g-stepper__trigger:hover:not([aria-disabled="true"]) .g-stepper__indicator { box-shadow: 0 0 0 4px var(--g-surface-3); }
button.g-stepper__trigger[aria-disabled="true"] { cursor: not-allowed; }
.g-stepper__trigger:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-stepper__indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--_dot);
  height: var(--_dot);
  border: 2px solid var(--g-border-input);
  border-radius: 50%;
  background: var(--g-surface);
  color: var(--g-text-2);
  font-size: var(--g-fs-sm);
  font-weight: var(--g-fw-semibold);
  transition: background-color var(--g-dur) var(--g-ease), border-color var(--g-dur) var(--g-ease), box-shadow var(--g-dur-fast) var(--g-ease);
}
.g-stepper__labels { display: flex; flex-direction: column; min-width: 0; }
.g-stepper__label { font-weight: var(--g-fw-medium); color: var(--g-text-2); overflow-wrap: anywhere; }
.g-stepper__text { font-size: var(--g-fs-xs); color: var(--g-text-3); }
.g-stepper__connector {
  position: absolute;
  top: calc(var(--g-space-1) + var(--_dot) / 2 - 1px);
  inset-inline-start: calc(50% + var(--_dot) / 2 + 6px);
  inset-inline-end: calc(-50% + var(--_dot) / 2 + 6px);
  height: 2px;
  border-radius: var(--g-radius-2xs);
  background: var(--g-border);
}
/* states */
.g-stepper__step.is-completed .g-stepper__indicator { background: var(--g-accent-text); border-color: var(--g-accent-text); color: var(--g-surface); }
.g-stepper__step.is-completed .g-stepper__connector { background: var(--g-accent-text); }
.g-stepper__step.is-active .g-stepper__indicator { border-color: var(--g-accent-text); color: var(--g-accent-text); box-shadow: 0 0 0 4px var(--g-accent-subtle); }
.g-stepper__step.is-active .g-stepper__label { color: var(--g-text); font-weight: var(--g-fw-semibold); }
.g-stepper__step.is-error .g-stepper__indicator { border-color: var(--g-danger); background: var(--g-danger-subtle); color: var(--g-danger-text); }
.g-stepper__step.is-error .g-stepper__label { color: var(--g-danger-text); }
.g-stepper__step.is-pending .g-stepper__label { color: var(--g-text-3); }
.g-stepper__step.is-disabled .g-stepper__label { color: var(--g-text-disabled); }
.g-stepper__indicator .g-icon { width: 16px; height: 16px; stroke-width: 2.25; }
/* labels beside the indicator */
.g-stepper--label-end .g-stepper__trigger { flex-direction: row; text-align: start; gap: var(--g-space-2); }
.g-stepper--label-end .g-stepper__step { flex-direction: row; align-items: center; }
.g-stepper--label-end:not(.g-stepper--vertical) .g-stepper__connector { position: static; flex: 1 1 auto; min-width: 16px; margin-inline: var(--g-space-1); }
/* vertical */
.g-stepper--vertical .g-stepper__list { flex-direction: column; gap: 0; }
.g-stepper--vertical .g-stepper__step { flex: none; align-items: flex-start; flex-direction: column; padding-bottom: var(--g-space-5); }
.g-stepper--vertical .g-stepper__connector {
  position: absolute;
  top: calc(var(--g-space-1) + var(--_dot) + 4px);
  bottom: 4px;
  inset-inline-start: calc(var(--g-space-2) + var(--_dot) / 2 - 1px);
  inset-inline-end: auto;
  width: 2px;
  height: auto;
}
.g-stepper--indicator { --_dot: 14px; }
.g-stepper--indicator .g-stepper__indicator .g-icon,
.g-stepper--indicator .g-stepper__num { display: none; }
@media (max-width: 600px) {
  .g-stepper:not(.g-stepper--vertical) .g-stepper__text { display: none; }
  .g-stepper:not(.g-stepper--vertical) .g-stepper__label { font-size: var(--g-fs-xs); }
}
@media (forced-colors: active) {
  .g-stepper__step.is-completed .g-stepper__indicator, .g-stepper__step.is-active .g-stepper__indicator { border-color: Highlight; }
  .g-stepper__connector { background: CanvasText; }
}

/* ---- css/components/tabs.css ---- */
/*
 * Gigant UI — Tab.
 *   .g-tabs                      host; heightAdjustMode → --h-content | --h-none | --h-fill | --h-auto
 *   .g-tabs__header              scroll buttons + .g-tabs__strip (scroller) + role=tablist
 *   .g-tabs__tab                 role=tab (underline indicator in ::after)
 *   .g-tabs__panels/.g-tabs__panel
 *   .g-tabs--segmented           pill track, filled active option (list filters)
 *   .g-tabs--vertical            headerPlacement Left / Right
 */
.g-tabs {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--g-text);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
}
.g-tabs--end:not(.g-tabs--vertical) { flex-direction: column-reverse; }
.g-tabs__header {
  position: relative;
  display: flex;
  align-items: stretch;
  min-width: 0;
  border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-tabs--end:not(.g-tabs--vertical) > .g-tabs__header { border-bottom: 0; border-top: var(--g-border-w) solid var(--g-border); }
.g-tabs__strip {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.g-tabs__strip::-webkit-scrollbar { display: none; }
.g-tabs__list { display: flex; align-items: stretch; gap: var(--g-space-1); width: max-content; min-width: 100%; }
.g-tabs--multirow .g-tabs__strip { overflow: visible; }
.g-tabs--multirow .g-tabs__list { flex-wrap: wrap; width: auto; }

.g-tabs__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--g-space-2);
  flex: none;
  min-height: var(--g-control-h);
  padding: 0 var(--g-space-3);
  border: 0;
  border-radius: var(--g-radius-sm) var(--g-radius-sm) 0 0;
  background: transparent;
  color: var(--g-text-2);
  font: inherit;
  font-weight: var(--g-fw-medium);
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  transition: color var(--g-dur-fast) var(--g-ease), background-color var(--g-dur-fast) var(--g-ease);
}
.g-tabs__tab:hover { color: var(--g-text); background: var(--g-surface-3); }
.g-tabs__tab:focus-visible { box-shadow: var(--g-focus-ring-inset); }
.g-tabs__tab.is-active { color: var(--g-accent-text); font-weight: var(--g-fw-semibold); }
.g-tabs__tab.is-disabled { color: var(--g-text-disabled); cursor: not-allowed; background: none; }
.g-tabs__tab[hidden] { display: none; }
/* underline indicator: full width under the Gigant tab */
.g-tabs__tab::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
  transition: background-color var(--g-dur-fast) var(--g-ease);
}
.g-tabs__tab:not(.is-disabled):hover::after { background: var(--g-border-input); }
.g-tabs__tab.is-active::after { background: var(--g-accent-text); }
/* Microsoft Fluent 2's TabList: a 3px rounded indicator inset from the label edges (genuine design difference) */
[data-gui-theme="gigant-fluent"] .g-tabs__tab::after { inset-inline: var(--g-space-3); bottom: 0; height: 3px; border-radius: var(--g-radius-pill); }
[data-gui-theme="gigant-fluent"] .g-tabs__tab { border-radius: var(--g-radius-sm); }
[data-gui-theme="gigant-fluent"] .g-tabs__tab:hover { background: transparent; }
.g-tabs--end:not(.g-tabs--vertical) .g-tabs__tab::after { bottom: auto; top: -1px; }

.g-tabs__icon { display: inline-flex; align-items: center; }
.g-tabs__tab--icon-top { flex-direction: column; gap: 2px; padding-block: var(--g-space-1); }
.g-tabs__tab--icon-right,
.g-tabs__tab--icon-end { flex-direction: row-reverse; }
.g-tabs__text { display: inline-flex; align-items: center; gap: var(--g-space-1); }
.g-tabs__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--g-icon-btn);
  height: var(--g-icon-btn);
  margin-inline-end: calc(-1 * var(--g-space-2));
  border-radius: var(--g-radius-sm);
  color: var(--g-text-3);
}
.g-tabs__close .g-icon { width: 14px; height: 14px; }
.g-tabs__close:hover { background: var(--g-surface-4); color: var(--g-text); }

.g-tabs__scroll {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--g-input-btn);
  padding: 0;
  border: 0;
  background: var(--g-surface);
  color: var(--g-text-2);
  cursor: pointer;
}
.g-tabs__scroll:hover { background: var(--g-surface-3); color: var(--g-text); }
.g-tabs__scroll:disabled { color: var(--g-text-disabled); cursor: default; background: var(--g-surface); }
.g-tabs__scroll[hidden] { display: none; }

/* ------------------------------------------------------------------ panels */
.g-tabs__panels { position: relative; min-width: 0; min-height: 0; }
.g-tabs--headers-only > .g-tabs__panels { display: none; }
.g-tabs__panel { padding-block: var(--g-space-3); outline: none; min-width: 0; }
.g-tabs__panel:focus-visible { box-shadow: var(--g-focus-ring-inset); border-radius: var(--g-radius-sm); }
.g-tabs__panel[hidden] { display: none; }
.g-tabs__panel--from-end { animation: g-tabs-in-end var(--g-dur) var(--g-ease); }
.g-tabs__panel--from-start { animation: g-tabs-in-start var(--g-dur) var(--g-ease); }
@keyframes g-tabs-in-end { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes g-tabs-in-start { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
[dir="rtl"] .g-tabs__panel--from-end { animation-name: g-tabs-in-start; }
[dir="rtl"] .g-tabs__panel--from-start { animation-name: g-tabs-in-end; }

/* heightAdjustMode */
.g-tabs--h-fill { height: 100%; min-height: 0; }
.g-tabs--h-fill > .g-tabs__panels { flex: 1 1 auto; display: flex; flex-direction: column; }
/* the visible panel fills too, so a grid of height 100% inside it keeps its pager in view */
.g-tabs--h-fill > .g-tabs__panels > .g-tabs__panel:not([hidden]) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.g-tabs--h-fill > .g-tabs__panels > .g-tabs__panel > .g-grid { flex: 1 1 auto; min-height: 0; }
.g-tabs--h-fill > .g-tabs__panels > .g-tabs__panel { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.g-tabs--h-fill > .g-tabs__panels > .g-tabs__panel[hidden] { display: none; }
.g-tabs--h-none > .g-tabs__panels { flex: 1 1 auto; overflow: auto; }
.g-tabs--h-auto > .g-tabs__panels { display: grid; }
.g-tabs--h-auto > .g-tabs__panels > .g-tabs__panel { grid-area: 1 / 1; }
.g-tabs--h-auto > .g-tabs__panels > .g-tabs__panel[hidden] { display: block; visibility: hidden; }

/* ------------------------------------------------------------------ vertical */
.g-tabs--vertical { flex-direction: row; }
.g-tabs--vertical.g-tabs--end { flex-direction: row-reverse; }
.g-tabs--vertical > .g-tabs__header {
  flex-direction: column;
  flex: none;
  max-width: 40%;
  border-bottom: 0;
  border-inline-end: var(--g-border-w) solid var(--g-border);
}
.g-tabs--vertical.g-tabs--end > .g-tabs__header { border-inline-end: 0; border-inline-start: var(--g-border-w) solid var(--g-border); }
.g-tabs--vertical .g-tabs__strip { overflow-x: hidden; overflow-y: auto; }
.g-tabs--vertical .g-tabs__list { flex-direction: column; width: auto; gap: 2px; }
.g-tabs--vertical .g-tabs__scroll { width: auto; height: var(--g-icon-btn); }
/* logical radii: the rounded corners sit on the start side in LTR and in RTL (the indicator is on the end side) */
.g-tabs--vertical .g-tabs__tab {
  justify-content: flex-start;
  border-radius: 0;
  border-start-start-radius: var(--g-radius-sm);
  border-end-start-radius: var(--g-radius-sm);
  padding-inline: var(--g-space-3) var(--g-space-4);
  text-align: start;
}
.g-tabs--vertical.g-tabs--end .g-tabs__tab {
  border-radius: 0;
  border-start-end-radius: var(--g-radius-sm);
  border-end-end-radius: var(--g-radius-sm);
}
[data-gui-theme="gigant-fluent"] .g-tabs--vertical .g-tabs__tab { border-radius: var(--g-radius-sm); }
.g-tabs--vertical .g-tabs__text { white-space: normal; }
/* group headings of a rail ({ group: true }): not tabs, not focusable, told apart by colour and type only (no border):
   the accent text colour (AA on every theme surface; never the 2:1 accent fill), small semibold capitals with letter-spacing, space above every group but
   the first; the tabs under a heading are indented one step (logical, so it flips in RTL). */
.g-tabs__group {
  display: flex;
  align-items: flex-end;
  padding: var(--g-space-4) var(--g-space-3) var(--g-space-1);
  color: var(--g-accent-text);
  font-size: var(--g-fs-xs);
  font-weight: var(--g-fw-semibold);
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: default;
  pointer-events: none;
  user-select: none;
}
.g-tabs__group:first-child { padding-block-start: var(--g-space-1); }
.g-tabs__group[hidden] { display: none; }
/* Arabic / Kurdish script has no capitals: smaller weight change only, no letter-spacing (it breaks joined letters) */
:lang(ar) .g-tabs__group, :lang(ku) .g-tabs__group, [dir="rtl"] .g-tabs__group { letter-spacing: 0; text-transform: none; font-size: var(--g-fs-sm); }
.g-tabs--vertical:not(.g-tabs--collapsed) .g-tabs__group ~ .g-tabs__tab { padding-inline-start: calc(var(--g-space-3) + var(--g-space-3)); }
@media (forced-colors: active) { .g-tabs__group { color: GrayText; } }
.g-tabs--vertical .g-tabs__tab::after { inset-inline: auto -1px; inset-block: 0; width: 2px; height: auto; bottom: auto; }
.g-tabs--vertical.g-tabs--end .g-tabs__tab::after { inset-inline: -1px auto; }
[data-gui-theme="gigant-fluent"] .g-tabs--vertical .g-tabs__tab::after { inset-block: var(--g-space-2); inset-inline: 0 auto; width: 3px; height: auto; }
.g-tabs--vertical > .g-tabs__panels { flex: 1 1 auto; padding-inline: var(--g-space-4); min-width: 0; }

/* collapsed rail (collapseWidth): a narrow host shows the rail as a top scrollable strip */
.g-tabs--vertical.g-tabs--collapsed { flex-direction: column; }
.g-tabs--vertical.g-tabs--collapsed > .g-tabs__header {
  flex-direction: row;
  max-width: none;
  border-inline-end: 0;
  border-inline-start: 0;
  border-bottom: var(--g-border-w) solid var(--g-border);
}
.g-tabs--vertical.g-tabs--collapsed .g-tabs__strip { overflow-x: auto; overflow-y: hidden; }
.g-tabs--vertical.g-tabs--collapsed .g-tabs__list { flex-direction: row; width: max-content; min-width: 100%; gap: var(--g-space-1); }
.g-tabs--vertical.g-tabs--collapsed .g-tabs__scroll { width: var(--g-input-btn); height: auto; }
.g-tabs--vertical.g-tabs--collapsed .g-tabs__tab {
  border-radius: 0;
  border-start-start-radius: var(--g-radius-sm);
  border-start-end-radius: var(--g-radius-sm);
  padding-inline: var(--g-space-3);
}
.g-tabs--vertical.g-tabs--collapsed .g-tabs__text { white-space: nowrap; }
.g-tabs--vertical.g-tabs--collapsed .g-tabs__tab::after { inset-inline: 0; inset-block: auto -1px; width: auto; height: 2px; bottom: -1px; }
[data-gui-theme="gigant-fluent"] .g-tabs--vertical.g-tabs--collapsed .g-tabs__tab::after { inset-inline: var(--g-space-3); bottom: 0; height: 3px; width: auto; inset-block-start: auto; }
.g-tabs--vertical.g-tabs--collapsed .g-tabs__group {
  align-items: center;
  padding: 0 var(--g-space-1) 0 var(--g-space-4);
  min-height: 0;
}
.g-tabs--vertical.g-tabs--collapsed .g-tabs__group:first-child { padding-inline-start: var(--g-space-1); }
.g-tabs--vertical.g-tabs--collapsed > .g-tabs__panels { padding-inline: 0; }

/* ------------------------------------------------------------------ segmented (list filters) */
.g-tabs--segmented { display: inline-flex; max-width: 100%; }
.g-tabs--segmented > .g-tabs__header { border: 0; }
.g-tabs--segmented .g-tabs__list {
  gap: 2px;
  min-width: 0;
  padding: 3px;
  border-radius: var(--g-button-radius);
  background: var(--g-surface-3);
  box-shadow: inset 0 0 0 1px var(--g-border);
}
.g-tabs--segmented .g-tabs__tab {
  min-height: var(--g-input-btn);
  padding: 0 var(--g-space-3);
  border-radius: var(--g-button-radius);
  color: var(--g-text-2);
  font-size: var(--g-fs-sm);
  font-weight: var(--g-fw-medium);
}
.g-tabs--segmented .g-tabs__tab::after { display: none; }
.g-tabs--segmented .g-tabs__tab:not(.is-active):not(.is-disabled):hover { background: var(--g-surface-4); color: var(--g-text); }
.g-tabs--segmented .g-tabs__tab.is-active {
  background: var(--g-accent);
  color: var(--g-text-on-accent);
  font-weight: var(--g-fw-semibold);
  box-shadow: var(--g-shadow-1);
}
.g-tabs--segmented .g-tabs__tab:focus-visible { box-shadow: var(--g-focus-ring); }
.g-tabs--segmented .g-tabs__scroll { background: transparent; }
.g-tabs--segmented .g-badge { height: 18px; min-width: 18px; padding: 0 6px; background: var(--g-surface); color: var(--g-text); }

@media (forced-colors: active) {
  .g-tabs__tab.is-active::after { background: Highlight; }
  .g-tabs--segmented .g-tabs__tab.is-active { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .g-tabs__tab:focus-visible { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* A tabbed dialog scrolls INSIDE the active tab panel, so the tab headers stay in view (Imad, 2026-10-28).
   Tabs that are the dialog's content (or the only child of its form / wrapper) take the remaining height
   and their panels scroll; tabs nested deeper keep a sticky header instead. */
.g-dialog__content:has(> .g-tabs, > :only-child > .g-tabs) { display: flex; flex-direction: column; overflow: hidden; }
.g-dialog__content > :only-child:has(> .g-tabs) { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.g-dialog__content > .g-tabs,
.g-dialog__content > :only-child > .g-tabs { flex: 1 1 auto; min-height: 0; }
.g-dialog__content > .g-tabs > .g-tabs__panels,
.g-dialog__content > :only-child > .g-tabs > .g-tabs__panels { flex: 1 1 auto; min-height: 0; overflow: auto; }
.g-dialog__content .g-tabs__header { position: sticky; top: calc(-1 * var(--g-space-4)); z-index: 2; background: var(--g-surface); }

/* ---- css/components/textbox.css ---- */
/* Gigant UI — TextBox. The box and control are the base .g-input / .g-input__control. */
.g-input__prefix[hidden],
.g-input__suffix[hidden] { display: none; }
.g-input__suffix { margin-inline-end: var(--g-space-2); }
.g-textbox.g-input--multiline .g-input__btn { align-self: flex-start; }
textarea.g-textbox__autosize { resize: none; overflow-y: hidden; min-height: 0; }

.g-textbox__counter {
  align-self: flex-end;
  font-size: var(--g-fs-xs);
  color: var(--g-text-3);
  font-variant-numeric: tabular-nums;
}
.g-textbox__counter[hidden] { display: none; }
.g-textbox__counter.is-near { color: var(--g-warning-text); font-weight: var(--g-fw-medium); }

/* Floating label (floatLabelType Auto/Always): rests inside the box, floats onto the top border. */
.g-textbox__float[hidden] { display: none; }
.g-input--float .g-textbox__float {
  position: absolute;
  inset-inline-start: calc(var(--g-space-3) - 4px);
  top: 50%;
  transform: translateY(-50%);
  max-width: calc(100% - var(--g-space-8));
  padding: 0 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.2;
  font-size: var(--g-fs-md);
  color: var(--g-text-3);
  border-radius: var(--g-radius-xs);
  pointer-events: none;
  transition: top var(--g-dur-fast) var(--g-ease), font-size var(--g-dur-fast) var(--g-ease), color var(--g-dur-fast) var(--g-ease);
}
.g-input--float.g-input--has-prefix:not(.is-floated) .g-textbox__float { inset-inline-start: calc(var(--g-space-3) + var(--g-icon-size) + var(--g-space-1)); }
.g-input--float.g-input--multiline:not(.is-floated) .g-textbox__float { top: calc(var(--g-space-2) + 0.75em); }
.g-input--float.is-floated .g-textbox__float {
  top: 0;
  font-size: var(--g-fs-xs);
  color: var(--g-text-2);
  background: var(--g-surface);
}
.g-input--float.is-floated.is-focused .g-textbox__float { color: var(--g-accent-text); }
.g-input--float.is-floated.is-invalid .g-textbox__float { color: var(--g-danger-text); }
.g-input--float.is-floated.is-readonly .g-textbox__float,
.g-input--float.is-floated.is-disabled .g-textbox__float { background: var(--g-surface-2); }
.g-input--float.is-disabled .g-textbox__float { color: var(--g-text-disabled); }

/* ---- css/components/timeline.css ---- */
/*
 * Gigant UI — Timeline. Each item is a 3-column grid: opposite | dot | content; the line runs
 * through the dot column. Alternate layouts swap the sides on even items.
 */
.g-timeline {
  --_dot: 28px;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--g-text);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
}
.g-timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--_dot) minmax(0, 3fr);
  column-gap: var(--g-space-3);
  padding-bottom: var(--g-space-4);
}
.g-timeline__item:last-child { padding-bottom: 0; }
/* connector through the dot column */
.g-timeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: calc(var(--_dot) + 4px);
  bottom: 4px;
  inset-inline-start: calc(var(--_ls, 0px) + var(--_dot) / 2 - 1px);
  width: 2px;
  border-radius: var(--g-radius-2xs);
  background: var(--g-border);
}
.g-timeline__opposite { grid-column: 1; padding-top: 4px; color: var(--g-text-3); font-size: var(--g-fs-sm); text-align: end; overflow-wrap: anywhere; }
.g-timeline__dot {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--_dot);
  height: var(--_dot);
  border: 2px solid var(--g-border-input);
  border-radius: 50%;
  background: var(--g-surface);
  color: var(--g-text-2);
}
.g-timeline__dot .g-icon { width: 14px; height: 14px; stroke-width: 2.25; }
.g-timeline__content { grid-column: 3; min-width: 0; padding-top: 3px; overflow-wrap: anywhere; }
.g-timeline__item.is-disabled { opacity: .6; }
/* status colours (an icon carries the same meaning) */
.g-timeline__item--success .g-timeline__dot { border-color: var(--g-success); background: var(--g-success-subtle); color: var(--g-success-text); }
.g-timeline__item--danger .g-timeline__dot { border-color: var(--g-danger); background: var(--g-danger-subtle); color: var(--g-danger-text); }
.g-timeline__item--warning .g-timeline__dot { border-color: var(--g-warning); background: var(--g-warning-subtle); color: var(--g-warning-text); }
.g-timeline__item--info .g-timeline__dot { border-color: var(--g-info); background: var(--g-info-subtle); color: var(--g-info-text); }
.g-timeline__item--accent .g-timeline__dot { border-color: var(--g-accent-text); background: var(--g-accent-subtle); color: var(--g-accent-text); }

/* align After (default): no opposite column when it is empty everywhere → content gets the room */
.g-timeline--after .g-timeline__item { grid-template-columns: auto var(--_dot) minmax(0, 1fr); }
.g-timeline--after .g-timeline__opposite:empty { display: none; }
.g-timeline--after .g-timeline__item:has(.g-timeline__opposite:empty) { grid-template-columns: var(--_dot) minmax(0, 1fr); }
.g-timeline--after .g-timeline__item:has(.g-timeline__opposite:empty) .g-timeline__dot { grid-column: 1; }
.g-timeline--after .g-timeline__item:has(.g-timeline__opposite:empty) .g-timeline__content { grid-column: 2; }
.g-timeline--after .g-timeline__item:not(:has(.g-timeline__opposite:empty)) { --_ls: calc(var(--_opp, 9rem) + var(--g-space-3)); grid-template-columns: var(--_opp, 9rem) var(--_dot) minmax(0, 1fr); }
/* align Before: content on the start side */
.g-timeline--before .g-timeline__item { grid-template-columns: minmax(0, 1fr) var(--_dot) var(--_opp, 9rem); --_ls: calc(100% - var(--_opp, 9rem) - var(--_dot) - var(--g-space-3)); }
.g-timeline--before .g-timeline__content { grid-column: 1; grid-row: 1; text-align: end; }
.g-timeline--before .g-timeline__opposite { grid-column: 3; grid-row: 1; text-align: start; }
/* alternate: content swaps sides every other item */
.g-timeline--alternate .g-timeline__item,
.g-timeline--alternatereverse .g-timeline__item { grid-template-columns: minmax(0, 1fr) var(--_dot) minmax(0, 1fr); --_ls: calc(50% - var(--_dot) / 2); }
.g-timeline--alternate .g-timeline__item:nth-child(even) .g-timeline__content,
.g-timeline--alternatereverse .g-timeline__item:nth-child(odd) .g-timeline__content { grid-column: 1; grid-row: 1; text-align: end; }
.g-timeline--alternate .g-timeline__item:nth-child(even) .g-timeline__opposite,
.g-timeline--alternatereverse .g-timeline__item:nth-child(odd) .g-timeline__opposite { grid-column: 3; grid-row: 1; text-align: start; }
/* horizontal */
.g-timeline--horizontal { flex-direction: row; overflow-x: auto; padding-bottom: var(--g-space-2); }
.g-timeline--horizontal .g-timeline__item { display: flex; flex-direction: column; align-items: center; flex: 1 0 9rem; padding: 0 var(--g-space-2); text-align: center; }
.g-timeline--horizontal .g-timeline__opposite { order: 0; min-height: 1.4em; text-align: center; padding: 0 0 var(--g-space-1); }
.g-timeline--horizontal .g-timeline__dot { order: 1; }
.g-timeline--horizontal .g-timeline__content { order: 2; padding-top: var(--g-space-2); }
.g-timeline--horizontal .g-timeline__item:not(:last-child)::before {
  top: calc(1.4em + var(--g-space-1) + var(--_dot) / 2 - 1px); bottom: auto;
  inset-inline-start: calc(50% + var(--_dot) / 2 + 4px); inset-inline-end: calc(-50% + var(--_dot) / 2 + 4px);
  width: auto; height: 2px;
}
@media (max-width: 600px) {
  .g-timeline--alternate .g-timeline__item, .g-timeline--alternatereverse .g-timeline__item, .g-timeline--before .g-timeline__item {
    grid-template-columns: var(--_dot) minmax(0, 1fr); --_ls: 0px;
  }
  .g-timeline--alternate .g-timeline__item .g-timeline__dot, .g-timeline--alternatereverse .g-timeline__item .g-timeline__dot, .g-timeline--before .g-timeline__item .g-timeline__dot { grid-column: 1; grid-row: 1 / span 2; }
  .g-timeline--alternate .g-timeline__item .g-timeline__content, .g-timeline--alternatereverse .g-timeline__item .g-timeline__content, .g-timeline--before .g-timeline__item .g-timeline__content,
  .g-timeline--alternate .g-timeline__item .g-timeline__opposite, .g-timeline--alternatereverse .g-timeline__item .g-timeline__opposite, .g-timeline--before .g-timeline__item .g-timeline__opposite {
    grid-column: 2; text-align: start;
  }
  .g-timeline--alternate .g-timeline__item .g-timeline__content, .g-timeline--alternatereverse .g-timeline__item .g-timeline__content, .g-timeline--before .g-timeline__item .g-timeline__content { grid-row: 2; }
}
@media (forced-colors: active) { .g-timeline__dot { border-color: CanvasText; } .g-timeline__item::before { background: CanvasText; } }

/* ---- css/components/toast.css ---- */
/*
 * Gigant UI — Toast.
 *   .g-toast-region--{top|bottom} --{start|center|end}   one stack per position
 *   .g-toast(--success|--danger|--warning|--info)          icon + hidden severity text, never colour alone
 */
.g-toast-region {
  position: fixed;
  z-index: var(--g-z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--g-space-2);
  width: min(380px, calc(100vw - 2 * var(--g-space-4)));
  padding: 0;
  margin: 0;
  pointer-events: none;
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  line-height: var(--g-lh);
}
.g-toast-region:empty { display: none; }
.g-toast-region--contained { position: absolute; }
.g-toast-region--top { top: var(--g-space-4); }
.g-toast-region--bottom { bottom: var(--g-space-4); }
.g-toast-region--end { inset-inline-end: var(--g-space-4); }
.g-toast-region--start { inset-inline-start: var(--g-space-4); }
.g-toast-region--center { left: 50%; transform: translateX(-50%); }

.g-toast {
  --_tone: var(--g-text-3);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--g-space-3);
  padding: var(--g-space-3) var(--g-space-3) var(--g-space-3) var(--g-space-4);
  border: var(--g-border-w) solid var(--g-border);
  border-inline-start: 4px solid var(--_tone);
  border-radius: var(--g-popup-radius);
  background: var(--g-surface-raised);
  color: var(--g-text);
  box-shadow: var(--g-shadow-3);
  overflow: hidden;
  pointer-events: auto;
  word-break: break-word;
}
.g-toast--success { --_tone: var(--g-success-text); }
.g-toast--danger { --_tone: var(--g-danger-text); }
.g-toast--warning { --_tone: var(--g-warning-text); }
.g-toast--info { --_tone: var(--g-info-text); }
.g-toast__icon { flex: none; display: inline-flex; color: var(--_tone); padding-top: 2px; }
.g-toast__icon .g-icon { width: 20px; height: 20px; }
.g-toast__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 1px; }
.g-toast__title { font-weight: var(--g-fw-semibold); color: var(--g-text); }
.g-toast__content { color: var(--g-text-2); }
.g-toast__content a { color: var(--g-accent-text); }
.g-toast__actions { display: flex; flex-wrap: wrap; gap: var(--g-space-2); margin-top: var(--g-space-2); }
.g-toast__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--g-input-btn);
  height: var(--g-input-btn);
  margin: -4px -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: var(--g-radius-sm);
  background: transparent;
  color: var(--g-text-3);
  cursor: pointer;
}
[dir="rtl"] .g-toast__close { margin: -4px 0 0 -4px; }
.g-toast__close:hover { background: var(--g-surface-3); color: var(--g-text); }
.g-toast__close:focus-visible { outline: none; box-shadow: var(--g-focus-ring); }
.g-toast__progress { position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--_tone) 18%, transparent); }
.g-toast__progress > span { display: block; height: 100%; background: var(--_tone); transform-origin: left center; }
[dir="rtl"] .g-toast__progress > span { transform-origin: right center; }
.g-toast__progress--ltr > span { transform-origin: right center; }

.g-toast.is-entering { animation: g-toast-in var(--g-dur) var(--g-ease) both; }
.g-toast.is-leaving { animation: g-toast-out var(--g-dur-fast) var(--g-ease) both; pointer-events: none; }
@keyframes g-toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes g-toast-out { from { opacity: 1; } to { opacity: 0; transform: scale(.98); } }
.g-toast-region--bottom .g-toast.is-entering { animation-name: g-toast-in-up; }
@keyframes g-toast-in-up { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 600px) {
  .g-toast-region { width: calc(100vw - 2 * var(--g-space-2)); }
  .g-toast-region--top { top: var(--g-space-2); }
  .g-toast-region--bottom { bottom: var(--g-space-2); }
  .g-toast-region--end, .g-toast-region--start, .g-toast-region--center { inset-inline: var(--g-space-2); left: var(--g-space-2); transform: none; }
}
@media (forced-colors: active) { .g-toast { border: 1px solid CanvasText; } }

/* ---- css/components/toolbar.css ---- */
/*
 * Gigant UI — Toolbar. Left / centre / right groups; items that do not fit get .is-overflowed and
 * appear in the "More" menu.
 */
.g-toolbar {
  display: flex;
  align-items: center;
  gap: var(--g-space-1);
  min-width: 0;
  min-height: calc(var(--g-control-h-sm) + 2 * var(--g-space-1));
  padding: var(--g-space-1);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-radius-lg);
  background: var(--g-surface);
  color: var(--g-text);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
}
.g-toolbar__items { display: flex; align-items: center; gap: var(--g-space-1); flex: 1 1 auto; min-width: 0; overflow: hidden; }
.g-toolbar__group { display: flex; align-items: center; gap: var(--g-space-1); flex: none; }
.g-toolbar__group[hidden] { display: none; }
.g-toolbar__group--center { margin-inline: auto; }
.g-toolbar__group--right { margin-inline-start: auto; }
.g-toolbar__group--center + .g-toolbar__group--right { margin-inline-start: 0; }
.g-toolbar__item { display: inline-flex; align-items: center; flex: none; }
.g-toolbar__item.is-hidden,
.g-toolbar__item.is-overflowed,
.g-toolbar__sep.is-overflowed,
.g-toolbar__sep.is-hidden { display: none; }
.g-toolbar__btn { gap: var(--g-space-1); }
.g-toolbar__btn--icon { width: var(--g-control-h-sm); padding: 0; }
.g-toolbar__btn.is-disabled { color: var(--g-text-disabled); cursor: not-allowed; background: transparent; }
.g-toolbar__btn[aria-pressed="true"] { background: var(--g-accent-subtle); color: var(--g-accent-text); }
.g-toolbar__icon { display: inline-flex; align-items: center; }
.g-toolbar__sep { flex: none; width: 1px; height: 20px; margin-inline: var(--g-space-1); background: var(--g-border); }
.g-toolbar__more { flex: none; width: var(--g-control-h-sm); min-height: var(--g-control-h-sm); }
.g-toolbar__more[hidden] { display: none; }
.g-toolbar__more[aria-expanded="true"] { background: var(--g-surface-4); }
.g-toolbar__item--template .g-input { min-height: var(--g-control-h-sm); }

/* ---- css/components/tooltip.css ---- */
/* Gigant UI — Tooltip. Positioned by GUI.popup (fixed, flipped, clamped). */
.g-tooltip {
  position: fixed;
  z-index: var(--g-z-tooltip);
  max-width: min(320px, calc(100vw - 16px));
  padding: var(--g-space-1) var(--g-space-2);
  border-radius: var(--g-radius-sm);
  background: var(--g-text);
  color: var(--g-surface);
  box-shadow: var(--g-shadow-2);
  font-family: var(--g-font);
  font-size: var(--g-fs-xs);
  font-weight: var(--g-fw-medium);
  line-height: var(--g-lh);
  overflow-wrap: anywhere;
  pointer-events: auto;
  animation: g-tooltip-in var(--g-dur-fast) var(--g-ease);
}
/* Gigant Fluent tooltips are light surfaces with a hairline stroke, not inverted. */
[data-gui-theme="gigant-fluent"] .g-tooltip {
  background: var(--g-surface-raised);
  color: var(--g-text);
  border: var(--g-border-w) solid var(--g-border);
  padding: 5px var(--g-space-3) 7px;
  border-radius: var(--g-radius-md);
  font-weight: var(--g-fw-regular);
  box-shadow: var(--g-shadow-3);
}
.g-tooltip__content { display: block; }
@keyframes g-tooltip-in { from { opacity: 0; } to { opacity: 1; } }
@media (forced-colors: active) { .g-tooltip { border: 1px solid CanvasText; } }

/* ---- css/components/treegrid.css ---- */
/*
 * Gigant UI — TreeGrid. Builds on grid.css: only the tree column's indent, toggle and checkbox live here.
 */
.g-tree__cell { gap: 0; }
.g-tree__lead { display: inline-flex; align-items: center; flex: none; gap: 2px; margin-inline-end: var(--g-space-1); }
.g-tree__indent { display: inline-block; flex: none; height: 1px; }
.g-tree__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--g-icon-btn);
  height: var(--g-icon-btn);
  border-radius: var(--g-radius-sm);
  color: var(--g-text-2);
  cursor: pointer;
}
.g-tree__toggle:hover { background: var(--g-surface-4); color: var(--g-text); }
.g-tree__toggle .g-icon { transition: transform var(--g-dur-fast) var(--g-ease); }
.g-tree__toggle.is-expanded .g-icon { transform: rotate(90deg); }
[dir="rtl"] .g-tree__toggle.is-expanded .g-icon { transform: scaleX(-1) rotate(90deg); }
.g-tree__toggle--leaf { cursor: default; }
.g-tree__toggle--leaf:hover { background: transparent; }
.g-tree__toggle .g-spinner { --g-spinner-size: 14px; }
.g-tree__check { margin-inline: 2px var(--g-space-1); }
.g-grid__drow.g-tree__parent .g-tree__cell .g-grid__cv { font-weight: var(--g-fw-medium); }
.g-grid__drow.is-checked { --_row-bg: var(--g-row-selected); }

/* ---- css/components/treemap.css ---- */
/*
 * Gigant UI — TreeMap. Shared base: viz.css; palette, tooltip, legend swatches and table: chart.css.
 * Leaves sit 2px apart on the surface (the gap is the separator, not a stroke); group frames are a
 * subtle fill with a header row in text tokens and a swatch carrying the group colour.
 */
.g-viz--treemap { min-height: 160px; }
.g-treemap__group { fill: var(--g-surface-2); stroke: var(--g-border); stroke-width: 1; }
.g-treemap__header { cursor: default; }
.g-treemap__header[role="button"] { cursor: pointer; }
.g-treemap__header.is-hover { fill: var(--g-chart-hover); }
.g-treemap__header.g-viz__mark:focus-visible { stroke: var(--g-focus); stroke-width: 2; }
.g-treemap__header-text { fill: var(--g-text); font-size: var(--g-fs-xs); font-weight: var(--g-fw-semibold); pointer-events: none; }
.g-treemap__leaf { cursor: default; transition: filter var(--g-dur-fast) var(--g-ease); }
.g-treemap__leaf[role="button"] { cursor: pointer; }
.g-treemap__leaf.is-hover { filter: brightness(1.08) saturate(1.1); }
.g-treemap__leaf.is-selected { stroke: var(--g-text); stroke-width: 2; }
.g-treemap__leaf.g-viz__mark:focus-visible { stroke: var(--g-focus); stroke-width: 3; }
.g-treemap__label, .g-treemap__value { font-size: var(--g-fs-xs); pointer-events: none; }
.g-treemap__label { font-weight: var(--g-fw-medium); }
.g-treemap__value { font-variant-numeric: tabular-nums; }
.g-treemap__label.is-dark, .g-treemap__value.is-dark { fill: var(--g-text-on-accent); }
.g-treemap__label.is-light, .g-treemap__value.is-light { fill: var(--g-on-solid); }
.g-treemap__label-template { position: absolute; overflow: hidden; padding: var(--g-space-1) var(--g-space-2); pointer-events: none; font-size: var(--g-fs-xs); }
.g-treemap__tip-path { color: var(--g-text-3); font-size: var(--g-fs-xs); margin-block-end: 2px; }

.g-treemap__crumbs { padding-block-end: var(--g-space-1); }
.g-treemap__crumbs[hidden] { display: none; }
.g-treemap__crumb-list { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: var(--g-fs-sm); }
.g-treemap__crumb { display: inline-flex; align-items: center; gap: 2px; color: var(--g-text); }
.g-treemap__crumb + .g-treemap__crumb::before { content: "›"; color: var(--g-text-3); padding-inline: 2px; }
.g-treemap__crumb > span { padding-inline: var(--g-space-1); font-weight: var(--g-fw-semibold); }

@media (forced-colors: active) {
  .g-treemap__leaf { forced-color-adjust: none; stroke: Canvas; stroke-width: 1; }
  .g-treemap__leaf.g-viz__mark:focus-visible, .g-treemap__header.g-viz__mark:focus-visible { stroke: Highlight; }
}

/* ---- css/components/treeview.css ---- */
/*
 * Gigant UI — TreeView.
 *
 *   .g-tree                 host (block; scrolls when the `height` option is set)
 *   .g-tree__list / __group role=tree / role=group lists
 *   .g-tree__item           role=treeitem <li> (roving tabindex; focus ring drawn on its row)
 *   .g-tree__row            the visible line: toggle, checkbox, icon, text, badge
 *   .g-tree--nav            compact sidebar navigation variant (icons, active item, counts)
 */
.g-tree {
  --_indent: 18px;
  --_row-h: var(--g-row-h-compact);
  --_row-radius: var(--g-radius-sm);
  position: relative;
  display: block;
  min-width: 0;
  color: var(--g-text);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
  line-height: var(--g-lh-tight);
}
.g-tree--scroll { overflow: auto; }
.g-tree__list,
.g-tree__group {
  list-style: none;
  margin: 0;
  padding: 0;
}
.g-tree__list { padding-block: 2px; outline: none; }
.g-tree__group:not([hidden]) { animation: g-tree-open var(--g-dur-fast) var(--g-ease); }
@keyframes g-tree-open { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
.g-tree__item { outline: none; }
.g-tree__item[hidden] { display: none; }

.g-tree__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--g-space-1);
  min-height: var(--_row-h);
  margin: 1px var(--g-space-1);
  padding-block: 2px;
  padding-inline: calc(var(--_lvl, 0) * var(--_indent) + 2px) var(--g-space-2);
  border-radius: var(--_row-radius);
  color: var(--g-text);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color var(--g-dur-fast) var(--g-ease);
}
.g-tree__row:hover { background: var(--g-row-hover); }
.g-tree__item.is-selected > .g-tree__row {
  background: var(--g-row-selected);
  font-weight: var(--g-fw-medium);
}
/* selected is not colour-only: a bar on the start edge */
.g-tree__item.is-selected > .g-tree__row::before {
  content: "";
  position: absolute;
  inset-block: 5px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: var(--g-radius-pill);
  background: var(--g-accent-text);
}
.g-tree__item:focus-visible > .g-tree__row { box-shadow: var(--g-focus-ring-inset); }
.g-tree__item.is-disabled > .g-tree__row { color: var(--g-text-disabled); cursor: not-allowed; background: none; }
.is-disabled.g-tree { opacity: .7; pointer-events: none; }

.g-tree__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--g-icon-btn);
  height: var(--g-icon-btn);
  border-radius: var(--g-radius-sm);
  color: var(--g-text-3);
  transition: transform var(--g-dur-fast) var(--g-ease);
}
.g-tree__item--parent > .g-tree__row > .g-tree__toggle:hover { background: var(--g-surface-4); color: var(--g-text); }
.g-tree__item.is-expanded > .g-tree__row > .g-tree__toggle { transform: rotate(90deg); }
/* the chevron is mirrored in RTL (flip class), so "expanded" turns the other way */
[dir="rtl"] .g-tree__item.is-expanded > .g-tree__row > .g-tree__toggle { transform: rotate(-90deg); }
.g-tree__toggle .g-spinner { --g-spinner-size: 14px; }

.g-tree__checkwrap { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--g-icon-btn); height: var(--g-icon-btn); }
/* the TreeView's box is drawn inside its wrap, which takes the click; scoped so GUI.TreeGrid's row tick boxes (no wrap,
   the box itself is the click target) stay clickable — the unscoped rule made a real click on them do nothing */
.g-tree__checkwrap .g-tree__check { pointer-events: none; }
.g-tree__checkwrap:hover .g-tree__check:not(:disabled) { border-color: var(--g-text); }

.g-tree__icon,
.g-tree__image { flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--g-text-2); }
.g-tree__image { width: 18px; height: 18px; border-radius: var(--g-radius-xs); object-fit: cover; }
.g-tree__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-block: 2px;
}
.g-tree__link { color: inherit; text-decoration: none; }
.g-tree__link:hover { text-decoration: underline; }
.g-tree__badge { margin-inline-start: auto; }
.g-tree__empty { padding: var(--g-space-4) var(--g-space-3); color: var(--g-text-3); text-align: center; list-style: none; }

/* inline rename */
.g-tree__editor {
  width: 100%;
  min-width: 8em;
  height: calc(var(--_row-h) - 6px);
  padding: 0 var(--g-space-2);
  border: var(--g-border-w) solid var(--g-focus);
  border-radius: var(--g-radius-sm);
  background: var(--g-surface);
  color: var(--g-text);
  font: inherit;
  outline: none;
  box-shadow: 0 0 0 1px var(--g-focus);
  user-select: text;
}

/* drag and drop */
.g-tree.is-dragging, .g-tree.is-dragging .g-tree__row { cursor: grabbing; }
.g-tree__item.is-drag-source > .g-tree__row { opacity: .45; }
.g-tree__row.is-drop-inside { background: var(--g-accent-subtle); box-shadow: inset 0 0 0 2px var(--g-accent-text); }
.g-tree__row.is-drop-before::after,
.g-tree__row.is-drop-after::after {
  content: "";
  position: absolute;
  inset-inline: calc(var(--_lvl, 0) * var(--_indent) + 24px) 4px;
  height: 2px;
  border-radius: var(--g-radius-2xs);
  background: var(--g-accent-text);
  pointer-events: none;
}
.g-tree__row.is-drop-before::after { top: -2px; }
.g-tree__row.is-drop-after::after { bottom: -2px; }
.g-tree__ghost {
  position: fixed;
  z-index: var(--g-z-tooltip);
  max-width: 260px;
  padding: var(--g-space-1) var(--g-space-3);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-radius-md);
  background: var(--g-surface-raised);
  color: var(--g-text);
  box-shadow: var(--g-shadow-3);
  font-family: var(--g-font);
  font-size: var(--g-fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* ------------------------------------------------------------------ navigation variant (sidebar) */
.g-tree--nav {
  --_row-h: calc(36px * var(--g-space-scale));
  --_indent: 14px;
  --_row-radius: var(--g-radius-md);
  font-size: var(--g-fs-md);
}
.g-tree--nav .g-tree__row {
  gap: var(--g-space-2);
  margin: 2px var(--g-space-2);
  padding-inline: calc(var(--_lvl, 0) * var(--_indent) + var(--g-space-2)) var(--g-space-1);
  color: var(--g-text-2);
}
/* the expand arrow sits at the end of a navigation row, as in the app's sidebar */
.g-tree--nav .g-tree__toggle { order: 9; margin-inline-start: auto; width: var(--g-icon-btn); }
.g-tree--nav .g-tree__item:not(.g-tree__item--parent) > .g-tree__row > .g-tree__toggle { display: none; }
.g-tree--nav .g-tree__badge { order: 8; }
.g-tree--nav .g-tree__item--parent > .g-tree__row { font-weight: var(--g-fw-semibold); color: var(--g-text); }
.g-tree--nav .g-tree__icon { width: 20px; color: var(--g-text-3); }
.g-tree--nav .g-tree__row:hover { background: var(--g-shell-nav-hover); }
.g-tree--nav .g-tree__item.is-selected > .g-tree__row {
  background: var(--g-shell-nav-active-bg);
  color: var(--g-shell-nav-active-text);
  font-weight: var(--g-fw-semibold);
}
.g-tree--nav .g-tree__item.is-selected > .g-tree__row .g-tree__icon { color: inherit; }
.g-tree--nav .g-tree__item.is-selected > .g-tree__row .g-tree__badge { background: var(--g-surface); color: var(--g-text); }

@media (forced-colors: active) {
  .g-tree__item.is-selected > .g-tree__row { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .g-tree__item:focus-visible > .g-tree__row { outline: 2px solid Highlight; outline-offset: -2px; }
  .g-tree__row.is-drop-inside { outline: 2px dashed Highlight; }
}

/* ---- css/components/uploader.css ---- */
/* Gigant UI — Uploader. Buttons are .g-btn; the rest is layout and state colour from tokens. */
.g-uploader { display: flex; flex-direction: column; gap: var(--g-space-2); min-width: 0; }
.g-uploader__drop {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--g-space-3);
  padding: var(--g-space-4);
  border: 1.5px dashed var(--g-border-input);
  border-radius: var(--g-radius-lg);
  background: var(--g-surface-2);
  color: var(--g-text-2);
  transition: border-color var(--g-dur-fast) var(--g-ease), background-color var(--g-dur-fast) var(--g-ease);
}
.g-uploader__drop.is-dragover { border-style: solid; border-color: var(--g-accent-text); background: var(--g-accent-subtle); }
.g-uploader__drop-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--g-surface);
  color: var(--g-accent-text);
}
.g-uploader__drop-icon .g-icon { width: 20px; height: 20px; }
.g-uploader__drop-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 12em; min-width: 0; }
.g-uploader__title { font-weight: var(--g-fw-medium); color: var(--g-text); }
.g-uploader__hint { font-size: var(--g-fs-xs); color: var(--g-text-3); }
.g-uploader.is-disabled .g-uploader__drop { color: var(--g-text-disabled); }
.g-uploader.is-disabled .g-uploader__title { color: var(--g-text-disabled); }

.g-uploader__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--g-space-1); }
.g-uploader__list[hidden] { display: none; }
.g-uploader__file {
  display: flex; align-items: center; gap: var(--g-space-3);
  padding: var(--g-space-2) var(--g-space-2) var(--g-space-2) var(--g-space-3);
  border: var(--g-border-w) solid var(--g-border);
  border-radius: var(--g-radius-md);
  background: var(--g-surface);
}
.g-uploader__file.is-invalid,
.g-uploader__file.is-failed { border-color: var(--g-danger); background: var(--g-danger-subtle); }
.g-uploader__file-icon { display: inline-flex; color: var(--g-text-3); }
.g-uploader__file-icon .g-icon { width: 20px; height: 20px; }
.g-uploader__file-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.g-uploader__file-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: var(--g-fw-medium); }
.g-uploader__file-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: var(--g-fs-xs); color: var(--g-text-3); }
.g-uploader__file-status { display: inline-flex; align-items: center; gap: 4px; }
.is-invalid .g-uploader__file-status,
.is-failed .g-uploader__file-status { color: var(--g-danger-text); }
.is-done .g-uploader__file-status { color: var(--g-success-text); }
.is-cancelled .g-uploader__file-status { color: var(--g-warning-text); }
.g-uploader__progress { height: 4px; margin-top: 2px; border-radius: var(--g-radius-pill); background: var(--g-surface-4); overflow: hidden; }
.g-uploader__progress-bar { display: block; height: 100%; background: var(--g-accent-text); transition: width var(--g-dur-fast) linear; }
.is-done .g-uploader__progress-bar { background: var(--g-success); }
.g-uploader__file-actions { display: inline-flex; gap: 2px; flex: none; }
.g-uploader__actions { display: flex; justify-content: flex-end; gap: var(--g-space-2); }
.g-uploader__actions[hidden] { display: none; }
@media (forced-colors: active) { .g-uploader__progress-bar { background: Highlight; } }
/* muted text-3 is below 4.5:1 on the danger tint: use text-2 inside refused/failed rows */
.g-uploader__file.is-invalid .g-uploader__file-meta,
.g-uploader__file.is-failed .g-uploader__file-meta { color: var(--g-text-2); }

/* ---- css/components/viz.css ---- */
/*
 * Gigant UI — shared base for the visualization widgets (CircularGauge, LinearGauge, Sparkline,
 * HeatMap, TreeMap, BulletChart). They reuse the chart family's palette (--g-chart-1..8) and its
 * header / tooltip / legend / table classes from chart.css, so every visual reads as one system.
 *
 * Sequential ramp --g-viz-seq-1..7 (low → high, one hue: blue) for heat maps and colour-by-value.
 * Light: the dataviz reference blue ramp 100…700 (the low end recedes toward the white surface).
 * Dark: the same steps reversed, so "near zero" recedes toward the dark surface and high values are
 * the brightest — a selected dark ramp, not an automatic flip. Same values in Gigant and Gigant Fluent
 * (both chart surfaces are white / near-black), so no theme-specific rule.
 *
 * Neutral qualitative bands --g-viz-band-1..3 (bullet-chart ranges, gauge tracks) are mixes of the
 * text colour into the surface, so they stay recessive in all four theme/mode combinations.
 */
:root {
  --g-viz-seq-1: #cde2fb;
  --g-viz-seq-2: #9ec5f4;
  --g-viz-seq-3: #6da7ec;
  --g-viz-seq-4: #3987e5;
  --g-viz-seq-5: #256abf;
  --g-viz-seq-6: #184f95;
  --g-viz-seq-7: #0d366b;
  --g-viz-band-1: color-mix(in srgb, var(--g-text) 7%, var(--g-surface));
  --g-viz-band-2: color-mix(in srgb, var(--g-text) 14%, var(--g-surface));
  --g-viz-band-3: color-mix(in srgb, var(--g-text) 22%, var(--g-surface));
  --g-viz-track: var(--g-surface-3);
  --g-viz-ink: var(--g-text);
}
[data-gui-mode="dark"] {
  --g-viz-seq-1: #104281;
  --g-viz-seq-2: #1c5cab;
  --g-viz-seq-3: #2a78d6;
  --g-viz-seq-4: #3987e5;
  --g-viz-seq-5: #6da7ec;
  --g-viz-seq-6: #9ec5f4;
  --g-viz-seq-7: #cde2fb;
  --g-viz-band-1: color-mix(in srgb, var(--g-text) 9%, var(--g-surface));
  --g-viz-band-2: color-mix(in srgb, var(--g-text) 17%, var(--g-surface));
  --g-viz-band-3: color-mix(in srgb, var(--g-text) 26%, var(--g-surface));
}

.g-viz {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--g-text);
  font-family: var(--g-font);
  font-size: var(--g-fs-md);
}
.g-viz__body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.g-viz__plot { position: relative; flex: 1 1 auto; min-height: 0; }
.g-viz__plot[hidden], .g-viz__table[hidden] { display: none; }
.g-viz__svg { position: absolute; inset: 0; display: block; overflow: visible; }
.g-viz__overlay { position: absolute; inset: 0; pointer-events: none; }
.g-viz__overlay > * { pointer-events: auto; }
.g-viz__legend { padding-block: var(--g-space-2) 0; }

/* text inside SVG: always text tokens, never the series colour */
.g-viz__label { fill: var(--g-text-2); font-size: var(--g-fs-xs); font-variant-numeric: tabular-nums; }
.g-viz__label--muted { fill: var(--g-text-3); }
.g-viz__label--strong { fill: var(--g-text); font-weight: var(--g-fw-semibold); }
.g-viz__label--on-light { fill: var(--g-text-on-accent); }
.g-viz__label--on-dark { fill: var(--g-on-solid); }
.g-viz__axis-line { stroke: var(--g-chart-axis); fill: none; }
.g-viz__tick { stroke: var(--g-chart-axis); }
.g-viz__tick--minor { stroke: var(--g-chart-grid); }
.g-viz__axis-title { fill: var(--g-text-2); font-size: var(--g-fs-xs); font-weight: var(--g-fw-medium); }

/* focusable marks: one tab stop each widget, visible ring in the focus colour */
.g-viz__mark { outline: none; }
.g-viz__mark:focus-visible { stroke: var(--g-focus); stroke-width: 3; }
.g-viz__mark.is-hover { filter: brightness(1.08) saturate(1.1); }

/* legend swatch for a gradient palette */
.g-viz__gradient { display: flex; align-items: center; gap: var(--g-space-2); color: var(--g-text-2); font-size: var(--g-fs-xs); font-variant-numeric: tabular-nums; }
.g-viz__gradient-bar { flex: 1 1 auto; min-width: 80px; max-width: 240px; height: 10px; border-radius: var(--g-radius-2xs); }
.g-viz__legend-static { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 8px; color: var(--g-text-2); font-size: var(--g-fs-sm); }

/* entrance animation (first paint only; never under reduced motion — base.css also shortens it) */
.g-viz--animate .g-viz__grow { animation: g-viz-fade var(--g-dur-slow) var(--g-ease) both; }
@keyframes g-viz-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .g-viz--animate .g-viz__grow { animation: none; }
}
@media (forced-colors: active) {
  .g-viz__mark { forced-color-adjust: none; }
  .g-viz__mark:focus-visible { stroke: Highlight; }
  .g-viz__axis-line, .g-viz__tick { stroke: CanvasText; }
}
