/* ============================================================
   Samarth eGov · Guest/Public theme
   Tokens + light/dark + a few primitives only.
   Everything else: Bootstrap 5 utilities + grid.

   Colour system:
     Accent  = modern blue ramp (indigo #4f46e5 → sky #0ea5e9)
     Primary = slate greys + dark navy
   ============================================================ */

:root {
    /* Accent ramp — a bright, modern blue (indigo → sky). The gradient spans
       both ends clearly. Shifted from the old violet/purple ramp for a cooler,
       cleaner tone across the whole shell (buttons, links, accents, hero). */
    --g-accent: #2563eb;
    --g-accent-2: #3b82f6;
    --g-accent-strong: #1d4ed8;
    --g-accent-soft: #eff4ff;
    /* Unread notice date tile (white on #2563eb is 5.2:1). */
    --g-notice-new-bg: var(--g-accent);
    --g-notice-new-bg-hover: var(--g-accent-strong);
    --g-notice-new-ink: #fff;
    /* Base ink for neutral drop shadows (slate-900), mixed to the needed
       strength with color-mix() at each use. */
    --g-shadow-color: #0f172a;
    /* Footer (always dark): link arrow on hover. */
    --g-footer-link-hover: #bfdbfe;
    /* Light-blue ink for text, icons and focus rings on the always-dark navy
       bands (Knowledge Center support band, hero eyebrows). */
    --g-ink-on-navy: #bfdbfe;
    --g-gradient: linear-gradient(120deg, #4f46e5 0%, #2563eb 55%, #0ea5e9 100%);
    --g-gradient-soft: linear-gradient(120deg, #3b82f6, #38bdf8);

    /* Neutral / primary (slate + navy) */
    --g-bg: #f7f9fc;
    --g-surface: #ffffff;
    /* Softened a step (was #f1f5f9 / #e2e8f0 / #cbd5e1). Separation between
       surfaces and the hairlines that divide them are everywhere in this
       interface — a page is dozens of card edges, table rules and tile fills —
       so a little less contrast on each one takes the glare off the whole
       screen. Text tokens are deliberately NOT softened: see the AA notes on
       --g-text-faint below. */
    --g-surface-2: #f4f7fb;
    --g-border: #e7ecf3;
    --g-border-strong: #d3dce8;
    --g-text: #0f172a;
    --g-text-muted: #475569;
    /* Darkened from #94a3b8, which only reached 2.56:1 on white and so failed
       WCAG AA (4.5:1) wherever it carried small text — timestamps, summaries,
       helper copy. This value clears AA on all three light backgrounds:
       5.43:1 on --g-surface, 5.19:1 on --g-bg, 4.95:1 on --g-surface-2. */
    --g-text-faint: #5b6b82;

    --g-navy: #0b1220;
    --g-navy-2: #111a2e;

    --g-success: #16a34a;
    --g-danger: #dc2626;
    --g-danger-border: #fca5a5;
    --g-danger-bg: #fef2f2;
    --g-warning: #c2410c;
    --g-info: #1d4ed8;

    /* Semantic INK — for text sitting on a tint of its own colour, which is
       how every status surface in this theme is built (soft fill, coloured
       text, matching hairline).
       The base colours above are tuned for a fill or an icon, not for text on
       a pale version of themselves: #16a34a on a 12% green tint measures
       2.89:1, well under WCAG AA. These darker shades clear 4.5:1 against
       every tint strength the theme uses, from 8% to 20% — verified, worst
       case 4.73:1 (danger at 20%).
       Use --g-*-ink for text, --g-* for borders and icons, where the 3:1
       non-text threshold applies. */
    --g-success-ink: #116a33;
    --g-danger-ink: #b91c1c;
    --g-warning-ink: #9a3412;
    --g-info-ink: #1e40af;
    --g-accent-ink: var(--g-accent-strong);

    /* Form field validation colours */
    --g-field-valid: #14b8a6;
    --g-field-danger: #ff5a4f;

    /* Radii + shadows.
       Radii up a step, shadows spread wider at lower opacity and in two
       layers — a tight contact shadow plus a broad ambient one. A single
       hard-edged drop shadow is what makes a card look stuck onto the page
       rather than resting on it. */
    --g-r-sm: 9px;
    --g-r-md: 14px;
    --g-r-lg: 18px;
    --g-r-xl: 26px;
    --g-shadow-sm: 0 1px 2px rgba(15,23,42,.035), 0 2px 6px -2px rgba(15,23,42,.035);
    --g-shadow: 0 2px 6px -2px rgba(15,23,42,.05), 0 14px 40px -16px rgba(15,23,42,.12);
    --g-shadow-lg: 0 4px 12px -4px rgba(59,130,246,.08), 0 34px 72px -28px rgba(59,130,246,.24);
    --g-ease: cubic-bezier(.22,.61,.36,1);

    /* Scrollbar thumb. Deliberately translucent so the thumb tints whatever is
       behind it rather than sitting on the page as a solid bar. Derived from
       --g-text-faint, which is already theme-aware, so the dark theme needs no
       override of its own. */
    --g-sb-thumb: color-mix(in srgb, var(--g-text-faint) 30%, transparent);
    --g-sb-thumb-hover: color-mix(in srgb, var(--g-text-faint) 60%, transparent);
    --g-sb-thumb-active: var(--g-text-faint);
}

/* Dark theme — toggled on the <html data-guest-theme="dark"> root */
[data-guest-theme="dark"] {
    --g-bg: #0b1220;
    --g-surface: #121a2b;
    --g-surface-2: #18223a;
    --g-border: #253149;
    --g-border-strong: #334155;
    --g-text: #e8edf6;
    --g-text-muted: #a3b0c7;
    /* Lightened from #6b7a95 (4.01:1 on --g-surface, 3.64:1 on --g-surface-2,
       both under AA). Now 6.11:1 / 6.58:1 / 5.55:1 across surface, bg and
       surface-2. */
    --g-text-faint: #8b9ab4;

    --g-navy: #070b14;
    --g-navy-2: #0c1322;

    --g-accent: #60a5fa;
    --g-accent-2: #3b82f6;
    --g-accent-strong: #93c5fd;
    --g-accent-soft: #172554;
    /* Unread notice date tile: dark ink on the light dark-mode accent
       (navy-2 on #60a5fa is 7.6:1). */
    --g-notice-new-bg: var(--g-accent);
    --g-notice-new-bg-hover: var(--g-accent-strong);
    --g-notice-new-ink: var(--g-navy-2);
    --g-chip-ink: #c7d2fe;

    --g-danger: #f87171;
    --g-danger-border: #7f1d1d;
    --g-danger-bg: #2a1416;
    --g-success: #34d399;
    --g-warning: #fbbf24;
    --g-info: #60a5fa;

    /* On a dark canvas the tint is darker than the colour, so the base shades
       are already the readable ones — 4.68:1 at worst across the same tint
       range. No separate ink is needed; the names stay so components can
       reference --g-*-ink in one theme-agnostic rule. */
    --g-success-ink: var(--g-success);
    --g-danger-ink: var(--g-danger);
    --g-warning-ink: var(--g-warning);
    --g-info-ink: var(--g-info);
    --g-accent-ink: var(--g-accent-strong);

    --g-field-valid: #2dd4bf;
    --g-field-danger: #ff6b61;

    /* Same two-layer treatment, and pulled back from .5/.55/.6 — on a dark
       canvas a heavy shadow reads as a black halo rather than depth. */
    --g-shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 2px 6px -2px rgba(0,0,0,.25);
    --g-shadow: 0 2px 6px -2px rgba(0,0,0,.3), 0 14px 40px -16px rgba(0,0,0,.45);
    --g-shadow-lg: 0 4px 12px -4px rgba(0,0,0,.3), 0 34px 72px -28px rgba(0,0,0,.5);
    color-scheme: dark;
}

/* ── Scroll chaining ──
   Stops the macOS/overscroll "rubber-band" bounce past the top and bottom of
   the document — the empty strip that flashes above the header or below the
   footer when the page is flung. `none` also prevents scroll from chaining to
   any parent scroller. Set on both html and body because browsers disagree on
   which one is the viewport's scroll container (WebKit honours it on body,
   others on the root); covering both makes the fix reliable across them.
   Supported in every current engine (Safari 16+, Chrome/Edge 63+, FF 59+). */
html,
.g-body {
    overscroll-behavior: none;
}

/* ── Base canvas ── */
.g-body {
    background: var(--g-bg);
    color: var(--g-text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s var(--g-ease), color .25s var(--g-ease);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.g-main { flex: 1 0 auto; }
/* When the skip link (or any in-page jump) sends focus to <main id="g-main">
   it carries tabindex="-1"; suppress the default focus ring on the wrapper
   itself — the link has done its job and focus continues into the content. */
.g-main:focus { outline: none; }

/* ── Skip to main content (WCAG 2.4.1 Bypass Blocks) ──
   The first focusable element in both shells. Visually hidden until it takes
   keyboard focus, then it slides into view at the top-left above the header
   and all overlays. Tokens only; mirrors the design system's focus ring. */
.g-skip-link {
    position: fixed;
    top: .75rem;
    left: .75rem;
    z-index: 2000;
    padding: .6rem 1rem;
    border-radius: var(--g-r-sm);
    background: var(--g-surface);
    color: var(--g-text);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--g-shadow-color) 35%, transparent);
    border: 1px solid var(--g-border);
    /* Hidden off-screen until focused — clipped rather than display:none so it
       stays in the focus order as the first tab stop. */
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none;
    transition: transform .16s var(--g-ease), opacity .16s var(--g-ease);
}
.g-skip-link:focus,
.g-skip-link:focus-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    outline: 2px solid var(--g-accent);
    outline-offset: 2px;
    color: var(--g-text);
}

/* ── Mobile gutter guard ──
   Bootstrap sizes a `.row` with a negative horizontal margin of
   calc(-.5 * var(--bs-gutter-x)), but a `.container` keeps a fixed .75rem
   padding regardless of the gutter. So a wide-gutter row (g-4 => 1.5rem,
   g-5 => 3rem) pokes past the container edge — on the homepage hero the g-5
   row overflowed the 390px viewport by ~12px each side and caused x-scroll.
   Capping the horizontal gutter at the mobile breakpoint keeps every guest
   row inside its container without touching the vertical gutter (row-gap)
   that spaces stacked columns. Columns regain their own x-gutter at >=576px. */
@media (max-width: 575.98px) {
    .g-body .row { --bs-gutter-x: 1.5rem; }
}

/* Decorative corner glows live on a fixed, viewport-anchored backdrop rather
   than inside the hero. Anchoring them to the hero made them shift (and get
   cut at the hero's top edge) whenever a flash alert pushed the hero down.
   Fixed to the viewport, the glow stays put regardless of alerts or scroll. */
.g-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(34rem 34rem at 100% 0%, color-mix(in srgb, var(--g-accent-2) 12%, transparent), transparent 60%),
        radial-gradient(26rem 26rem at 0% 42%, color-mix(in srgb, var(--g-accent) 7%, transparent), transparent 60%);
}
/* Keep real content above the backdrop. */
.g-trust, .g-header, .g-main, .g-footer, .g-toast-stack { position: relative; z-index: 1; }

/* Text selection — the OS default is a hard blue that clashes with the accent
   ramp. On ordinary light content the selected text takes the accent colour on
   a soft accent wash. Dark surfaces (navy header/footer/trust bar + dark cards)
   override this below so white text stays readable when selected. */
.g-body ::selection {
    background: color-mix(in srgb, var(--g-accent) 22%, transparent);
    color: var(--g-accent-strong);
}

.g-body ::-moz-selection {
    background: color-mix(in srgb, var(--g-accent) 22%, transparent);
    color: var(--g-accent-strong);
}

/* Dark surfaces keep a white selected glyph on a stronger accent fill — the
   accent-coloured text above would vanish against navy. Covers the shell
   bands, the dark hero/landing panels (CTA band, Samarth aside, navy service
   tile) and everything in dark mode. */
.g-trust ::selection,
.g-header ::selection,
.g-footer ::selection,
.gh-access ::selection,
.gh-cta ::selection,
.gh-story__samarth ::selection,
.gh-service--navy ::selection,
[data-guest-theme="dark"] ::selection {
    background: color-mix(in srgb, var(--g-accent) 60%, transparent);
    color: #fff;
}

.g-trust ::-moz-selection,
.g-header ::-moz-selection,
.g-footer ::-moz-selection,
.gh-access ::-moz-selection,
.gh-cta ::-moz-selection,
.gh-story__samarth ::-moz-selection,
.gh-service--navy ::-moz-selection,
[data-guest-theme="dark"] ::-moz-selection {
    background: color-mix(in srgb, var(--g-accent) 60%, transparent);
    color: #fff;
}

/* Buttons/pills carry their own text colour on a coloured fill, so a selection
   tint of either flavour can wash the label out. Give them an opaque, high-
   contrast highlight (solid accent + white) regardless of the surface they
   sit on. */
.g-btn-accent ::selection, .g-btn-accent::selection,
.g-btn-soft ::selection, .g-btn-soft::selection,
.g-hbtn ::selection, .g-hbtn::selection,
.gh-hero__button ::selection, .gh-hero__button::selection,
.gh-access__primary ::selection, .gh-access__primary::selection,
.gh-access__secondary ::selection, .gh-access__secondary::selection,
.gh-cta__btn ::selection, .gh-cta__btn::selection {
    background: var(--g-accent-strong);
    color: #fff;
}

.g-btn-accent ::-moz-selection, .g-btn-accent::-moz-selection,
.g-btn-soft ::-moz-selection, .g-btn-soft::-moz-selection,
.g-hbtn ::-moz-selection, .g-hbtn::-moz-selection,
.gh-hero__button ::-moz-selection, .gh-hero__button::-moz-selection,
.gh-access__primary ::-moz-selection, .gh-access__primary::-moz-selection,
.gh-access__secondary ::-moz-selection, .gh-access__secondary::-moz-selection,
.gh-cta__btn ::-moz-selection, .gh-cta__btn::-moz-selection {
    background: var(--g-accent-strong);
    color: #fff;
}

/* ── Primitives Bootstrap can't express ── */

/* Gradient text — follows the live accent ramp (var(--g-gradient)). */
.g-gradient-text {
    background: var(--g-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Shared button shape — self-sufficient, but also composes with BS5 .btn.
   Design radius/weight/min-height so look is consistent with or without .btn. */
.g-btn-accent,
.g-btn-soft {
    --bs-btn-border-radius: var(--g-r-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: .6rem 1.2rem;
    border-radius: var(--g-r-md);
    font-size: .9rem;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
}

/* Accent gradient button */
.g-btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-color: #fff;
    border: 0;
    background: var(--g-gradient) !important;
    color: #fff !important;
    box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--g-accent-2) 70%, transparent);
    transition: transform .16s var(--g-ease), box-shadow .18s var(--g-ease), filter .18s var(--g-ease);
}
.g-btn-accent:hover { color: #fff !important; transform: translateY(-1px); box-shadow: 0 12px 26px -14px color-mix(in srgb, var(--g-accent-2) 65%, transparent); filter: saturate(1.04); }
.g-btn-accent:focus,
.g-btn-accent:focus-visible,
.g-btn-accent:active,
.g-btn-accent.active {
    border-color: transparent !important;
    background: var(--g-gradient) !important;
    color: #fff !important;
}
.g-btn-accent:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; box-shadow: none !important; }
.g-btn-accent:active { transform: translateY(0); }

/* Soft/outline button that respects theme */
.g-btn-soft {
    background: var(--g-surface);
    color: var(--g-text);
    border: 1px solid var(--g-border);
    box-shadow: var(--g-shadow-sm);
    transition: transform .16s var(--g-ease), border-color .18s var(--g-ease), background .18s var(--g-ease);
}
.g-btn-soft:hover { color: var(--g-text); transform: translateY(-1px); border-color: var(--g-border-strong); background: var(--g-surface-2); }
.g-btn-soft:focus,
.g-btn-soft:focus-visible,
.g-btn-soft:active {
    border-color: var(--g-border-strong) !important;
    background: var(--g-surface-2) !important;
    color: var(--g-text) !important;
}
.g-btn-soft:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; box-shadow: none !important; }

/* Pill chip */
.g-chip {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .4rem .85rem; border-radius: 999px;
    background: var(--g-accent-soft); color: var(--g-accent-strong);
    font-size: .74rem; font-weight: 700; letter-spacing: .02em;
    border: 1px solid color-mix(in srgb, var(--g-accent) 18%, transparent);
}
[data-guest-theme="dark"] .g-chip { color: var(--g-chip-ink); }

/* Surface card primitive (theme-aware) — pair with BS utilities */
.g-card {
    background: var(--g-surface);
    border: 1px solid var(--g-border);
    border-radius: var(--g-r-lg);
    box-shadow: var(--g-shadow-sm);
    transition: transform .18s var(--g-ease), box-shadow .18s var(--g-ease), border-color .18s var(--g-ease);
}
.g-card--hover:hover { transform: translateY(-2px); box-shadow: var(--g-shadow); border-color: var(--g-border-strong); }

/* Icon tile */
.g-icon {
    display: inline-grid; place-items: center;
    width: 46px; height: 46px; border-radius: 13px;
    font-size: 21px; flex: none;
}
.g-icon--accent { background: var(--g-gradient); color: #fff; }
.g-icon--soft { background: var(--g-accent-soft); color: var(--g-accent-ink); }

/* Theme-aware helpers mapped to tokens */
.g-surface { background: var(--g-surface) !important; }
.g-surface-2 { background: var(--g-surface-2) !important; }
.g-text { color: var(--g-text) !important; }
.g-text-muted { color: var(--g-text-muted) !important; }
.g-text-faint { color: var(--g-text-faint) !important; }
.g-border { border-color: var(--g-border) !important; }
.g-accent { color: var(--g-accent-ink) !important; }

/* ── Official-website trust bar (above header, not sticky) ──
   Matches the Samarth info-bar reference exactly, in our Inter font.
   bg linear-gradient(#0b132b,#101c3a); 30px bordered icon circles. */
.g-trust {
    /* The info bar is dark in both themes; its palette is scoped here. */
    --g-trust-bg-from: #0b132b;
    --g-trust-bg-to: #101c3a;
    --g-trust-ink: #e5e7eb;
    --g-trust-muted: #9ca3af;
    --g-trust-ring: #374151;
    --g-trust-accent: #3b82f6;
    background: linear-gradient(90deg, var(--g-trust-bg-from), var(--g-trust-bg-to));
    color: var(--g-trust-ink);
    font-size: 12px;
}
.g-trust__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 34px; padding: .3rem 0; }
.g-trust__left { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.g-trust__flag { display: inline-flex; flex-direction: column; width: 20px; height: 14px; border-radius: 3px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.g-trust__flag span { flex: 1; position: relative; }
.g-trust__flag span:nth-child(1) { background: #ff9933; } /* national flag, fixed colours: lint-allow-raw-colour */
.g-trust__flag span:nth-child(2) { background: #fff; }
.g-trust__flag span:nth-child(3) { background: #128807; } /* lint-allow-raw-colour */
.g-trust__flag span:nth-child(2)::after { content: ""; position: absolute; inset: 0; margin: auto; width: 4px; height: 4px; border-radius: 50%; border: 1px solid #000080; } /* lint-allow-raw-colour */
.g-trust__line { margin: 0; font-size: 10px; color: var(--g-trust-muted); }
.g-trust__line strong { color: #fff; font-weight: 600; }
.g-trust__toggle { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .6rem; border: 0; border-radius: 6px; background: rgba(255,255,255,.1); color: #fff; font-size: 10px; font-weight: 500; letter-spacing: .3px; white-space: nowrap; cursor: pointer; transition: background .18s var(--g-ease); }
.g-trust__toggle:hover { background: rgba(255,255,255,.16); }
.g-trust__toggle i { font-size: .6rem; transition: transform .3s ease; }
.g-trust__toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.g-trust__panel { padding: 1.25rem 0; }
.g-trust__panel[hidden] { display: none; }
.g-trust__item { display: flex; align-items: flex-start; gap: 1rem; }
.g-trust__icon { display: grid; width: 30px; height: 30px; flex: none; place-items: center; border-radius: 50%; border: 1px solid var(--g-trust-ring); background: transparent; color: var(--g-trust-ink); font-size: 12px; }
.g-trust__icon--s { border: 1.5px solid var(--g-trust-accent); background: color-mix(in srgb, var(--g-trust-accent) 10%, transparent); color: #fff; font-weight: 700; }
.g-trust__item h4 { margin: 0; font-size: 11px; font-weight: 600; color: #fff; line-height: 1.4; }
.g-trust__item p { margin: 8px 0 0; font-size: 10px; line-height: 1.9; color: var(--g-trust-muted); }
.g-trust__item p strong { color: #fff; font-weight: 400; }
.g-trust__sub { color: var(--g-trust-muted); font-weight: 400; }
@media (max-width: 767.98px) {
    .g-trust__toggle span { display: none; }
}

/* ── Header ── */
.g-header {
    position: sticky; top: 0; z-index: 1030;
    /* The header is a frosted bar, but at the top of the page there is nothing
       behind it, so a high-opacity tint reads as clean rather than see-through.
       (At 82% a dark card scrolling under the blur bled through and looked like
       the content was floating above the bar.) */
    background: color-mix(in srgb, var(--g-bg) 92%, transparent);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid var(--g-border);
    transition: background-color .2s var(--g-ease), box-shadow .25s var(--g-ease);
}
/* Once content is scrolling beneath it, go effectively opaque so nothing shows
   through the glass — this is what stops cards from appearing to sit on top of
   the bar. The blur stays for the thin sliver at the very edges. */
.g-header.is-scrolled {
    background: color-mix(in srgb, var(--g-bg) 98%, transparent);
    box-shadow: 0 6px 24px -16px color-mix(in srgb, var(--g-shadow-color) 35%, transparent);
}
.g-header__inner { height: 68px; }

/* Product tour (TourGuide) layering.
   The tour dims the page with .tg-backdrop — a huge box-shadow spread that
   darkens everything around a clear rect over the highlighted target. Its
   default z-index (99) sits below the sticky header (1030), so the header
   stayed fully lit on every step, most obviously on the welcome step that has
   no target. Lift the backdrop just under the tour dialog (z-index 9999) so it
   dims the header too. tour.js appends .tg-backdrop to <body> while the tour
   is open and removes it after, so :has() scopes these rules to the active
   tour and both revert automatically when it ends. */
.tg-backdrop { z-index: 9998 !important; }
body:has(> .tg-backdrop) .g-header { z-index: 999; }
/* Tour dialog in the theme. tour.min.css hard-codes a white card with grey
   text and buttons, so in dark mode it was a white box with unreadable,
   legacy-styled buttons. Same structure, theme tokens, both modes. */
.g-body .tg-dialog {
    border: 1px solid var(--g-border);
    border-radius: var(--g-r-lg);
    background: var(--g-surface);
    color: var(--g-text);
    box-shadow: var(--g-shadow-lg);
    font-family: inherit;
}
.g-body .tg-dialog .tg-arrow { background: var(--g-surface); }
.g-body .tg-dialog .tg-dialog-header .tg-dialog-title { color: var(--g-text); font-weight: 650; }
.g-body .tg-dialog .tg-dialog-header .tg-dialog-close-btn { opacity: .55; filter: var(--g-tour-close-filter, none); }
.g-body .tg-dialog .tg-dialog-header .tg-dialog-close-btn:hover,
.g-body .tg-dialog .tg-dialog-header .tg-dialog-close-btn:focus-visible { opacity: 1; }
.g-body .tg-dialog .tg-dialog-body { color: var(--g-text-muted); line-height: 1.55; }
.g-body .tg-dialog .tg-dialog-progress-bar { background: var(--g-surface-2); }
.g-body .tg-dialog .tg-dialog-progress-bar > .tg-bar { background: var(--g-accent); }
.g-body .tg-dialog .tg-dialog-dots { border-color: var(--g-border); }
.g-body .tg-dialog .tg-dialog-dots > span.tg-dot { background: var(--g-border-strong); }
.g-body .tg-dialog .tg-dialog-dots > span.tg-dot.tg-dot-active { background: var(--g-accent); }
.g-body .tg-dialog .tg-step-progress { color: var(--g-text-muted); opacity: 1; }
.g-body .tg-dialog .tg-dialog-footer button.tg-dialog-btn {
    min-height: 2.1rem;
    padding: .35rem .9rem;
    border: 1px solid var(--g-border-strong);
    border-radius: var(--g-r-md);
    background: transparent;
    color: var(--g-text);
    font-weight: 600;
    box-shadow: none;
}
.g-body .tg-dialog .tg-dialog-footer button.tg-dialog-btn:hover { background: var(--g-surface-2); border-color: var(--g-border-strong); color: var(--g-text); }
.g-body .tg-dialog .tg-dialog-footer button.tg-dialog-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--g-accent) 45%, transparent); outline-offset: 2px; }
.g-body .tg-dialog .tg-dialog-footer button.tg-dialog-btn:active { background: var(--g-accent-soft); border-color: var(--g-accent); color: var(--g-accent-ink); }
/* Next / Finish (the last footer button) is the primary action. */
.g-body .tg-dialog .tg-dialog-footer button.tg-dialog-btn:last-child:not(.disabled) {
    border-color: var(--g-accent);
    background: var(--g-accent);
    color: #fff; /* text on accent, as primary buttons: lint-allow-raw-colour */
}
.g-body .tg-dialog .tg-dialog-footer button.tg-dialog-btn:last-child:not(.disabled):hover { background: var(--g-accent-strong); border-color: var(--g-accent-strong); }
.g-body .tg-dialog .tg-dialog-footer button.tg-dialog-btn.disabled { opacity: .45; }
[data-guest-theme="dark"] { --g-tour-close-filter: invert(1); }
/* Nothing else floats over the tour. */
body:has(> .tg-backdrop) .g-pwa { display: none; }
/* TourGuide does not raise the targeted element itself; it relies on the
   target showing through the backdrop's clear rect at its natural z-index.
   With the header now dimmed, a step whose target lives IN the header (the
   mega-menu trigger) would be dimmed too. dashboard.js adds .gi-tour-target to
   the CURRENT step's target on each step change (and clears it from the
   previous one), so only the element actually being pointed at is lifted above
   the backdrop — never a header control on a step that is not about it. */
.gi-tour-target {
    position: relative;
    z-index: 9999;
}
.g-header__brand-logo { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex: none; }
.g-header__brand-logo img { width: 100%; height: 100%; object-fit: contain; }
/* Institution logo that failed to load (it is served by the institution's
   own Samarth host, so a slow or unreachable host broke it): guest.js adds
   .is-logo-broken and the circle shows the institution's initials instead of
   the browser's broken-image box and squeezed alt text. */
[data-logo-fallback].is-logo-broken > img { display: none; }
[data-logo-fallback].is-logo-broken {
    background: color-mix(in srgb, var(--g-accent) 14%, var(--g-surface));
    color: var(--g-accent-ink);
}
[data-logo-fallback].is-logo-broken::after {
    content: attr(data-logo-fallback);
    font-size: .62rem;
    font-weight: 750;
    letter-spacing: .02em;
    line-height: 1;
}
.g-header__name { color: var(--g-text); line-height: 1.2; max-width: 22rem; }
.g-header__name-main { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .9rem; font-weight: 700; letter-spacing: -.01em; }
.g-header__name small { display: block; font-size: .67rem; font-weight: 500; color: var(--g-text-muted); letter-spacing: .02em; }

/* Theme toggle */
.g-themebar { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--g-border); border-radius: 999px; background: var(--g-surface); box-shadow: var(--g-shadow-sm); }
.g-themebar__opt { display: inline-flex; align-items: center; gap: .3rem; padding: .4rem .65rem; border: 0; border-radius: 999px; font-size: .72rem; font-weight: 600; color: var(--g-text-muted); background: transparent; cursor: pointer; transition: all .2s var(--g-ease); }
.g-themebar__opt:hover { color: var(--g-text); }
/* Generic selected state for ANY segmented themebar option (theme, navigation
   colour, and any future one). A neutral grey pill — raised surface + hairline
   ring — so the chosen option reads as clearly selected without pulling in the
   accent colour. Covers both the theme and navigation-colour controls. */
.g-themebar__opt.active {
    /* Match the canonical soft hover wash (the search button / .g-btn-soft:hover
       use --g-surface-2); the selected chip now reads the same neutral as every
       other soft hover across the shell instead of a one-off text-tinted grey. */
    background: var(--g-surface-2);
    color: var(--g-text);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g-text) 8%, transparent);
}
/* The Dark-theme option keeps its signature full-accent-gradient pill. */
.g-themebar__opt[data-theme="dark"].active { background: var(--g-gradient); color: #fff; box-shadow: 0 3px 10px -4px color-mix(in srgb, var(--g-accent-2) 60%, transparent); }

/* Accent colour picker (System Preferences).
   Round preset swatches + a native colour input + a reset button. Each swatch
   carries its own colour on the --g-swatch custom property (set inline from
   the preset hex); guest.js toggles .active + aria-pressed to mark the stored
   base. The active ring uses the LIVE --g-accent so it tracks whatever accent
   is currently applied, matching the rest of the shell. */
.g-accentbar { display: flex; flex-wrap: wrap; gap: .5rem; }
.g-accentbar__swatch {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--g-swatch, var(--g-accent)) 55%, var(--g-border));
    border-radius: 999px;
    background: var(--g-swatch, var(--g-accent));
    cursor: pointer;
    transition: transform .12s var(--g-ease), box-shadow .12s var(--g-ease);
}
.g-accentbar__swatch:hover { transform: translateY(-1px); }
.g-accentbar__swatch:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; }
/* Active = a ring in the surface colour plus an accent halo, so the chosen
   swatch reads as selected regardless of its own hue. */
.g-accentbar__swatch.active {
    box-shadow: 0 0 0 2px var(--g-surface), 0 0 0 4px var(--g-accent);
}

.g-accentbar__extra { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: .65rem; }
/* Custom-colour chip: a round control that shows a PICKER ICON (eyedropper) at
   rest — no colour chosen yet — and fills with the chosen colour once applied
   (guest.js adds .has-value and sets --g-custom-swatch). The native colour
   input sits on top, fully transparent, so clicking anywhere opens the OS
   picker while our styled chip shows underneath. */
.g-accentbar__custom {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    font-size: .78rem;
    font-weight: 600;
    color: var(--g-text-muted);
    cursor: pointer;
}
.g-accentbar__custom-chip {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    flex: none;
    border-radius: 999px;
    border: 1px dashed var(--g-border-strong);
    background: var(--g-surface-2);
    color: var(--g-text-muted);
    font-size: .85rem;
    transition: border-color .12s var(--g-ease), background-color .12s var(--g-ease);
}
.g-accentbar__custom:hover .g-accentbar__custom-chip { border-color: var(--g-accent); color: var(--g-accent-ink); }
/* Once a custom colour is applied: solid chip in that colour, icon hidden. */
.g-accentbar__custom.has-value .g-accentbar__custom-chip {
    border-style: solid;
    border-color: color-mix(in srgb, var(--g-custom-swatch, var(--g-accent)) 55%, var(--g-border));
    background: var(--g-custom-swatch, var(--g-accent));
}
.g-accentbar__custom.has-value .g-accentbar__custom-ico { display: none; }
/* The real input overlays the chip, invisible, and captures the click. */
.g-accentbar__custom input[type="color"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}
.g-accentbar__custom input[type="color"]:focus-visible + .g-accentbar__custom-chip,
.g-accentbar__custom:focus-within .g-accentbar__custom-chip { outline: 2px solid var(--g-accent); outline-offset: 2px; }

/* Header-level "Reset to default" for the whole Appearance card. A plain white
   button with a hairline grey border, kept on one line and pushed to the right
   edge of the header — the standard secondary-button look used across the app. */
.gi-prefs__head--appearance { display: flex; align-items: center; gap: .75rem; }
.gi-prefs__reset-all {
    margin-left: auto;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .8rem;
    border: 1px solid var(--g-border);
    border-radius: var(--g-r-sm);
    background: var(--g-surface);
    color: var(--g-text-muted);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .12s var(--g-ease), background-color .12s var(--g-ease), color .12s var(--g-ease);
}
.gi-prefs__reset-all:hover { border-color: var(--g-border-strong); background: var(--g-surface-2); color: var(--g-text); }
.gi-prefs__reset-all:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; }
/* Icon pinned left and non-shrinking; the label never wraps, so the whole
   button stays on one line. */
.gi-prefs__reset-all > .bi { flex: none; font-size: .9em; }
.gi-prefs__reset-all { text-wrap: nowrap; }

.g-hbtn { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1.1rem; border-radius: var(--g-r-md); font-size: .82rem; font-weight: 600; text-decoration: none; transition: all .18s var(--g-ease); }
.g-hbtn__ico { width: 1.05em; height: 1.05em; flex: none; }
/* The login button carries a full label and a short "Login" variant; the short
   one only appears on mobile (toggled in mega-menu.css). Hide it by default. */
.g-hbtn__label--short { display: none; }
/* Trailing arrow on a call-to-action header button. Nudges forward on hover;
   held still for anyone who has asked for reduced motion. */
.g-hbtn__arrow { margin-left: -.1rem; transition: transform .18s var(--g-ease); }
.g-hbtn:hover .g-hbtn__arrow { transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) {
    .g-hbtn:hover .g-hbtn__arrow { transform: none; }
}
.g-hbtn--ghost { color: var(--g-text); border: 1px solid var(--g-border); background: var(--g-surface); box-shadow: var(--g-shadow-sm); }
.g-hbtn--ghost:hover { border-color: var(--g-border-strong); color: var(--g-text); background: var(--g-surface-2); transform: translateY(-1px); }
.g-hbtn--ghost:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; }

/* Search affordance: the command-palette trigger in the header. The label
   muted and the shortcut badge trailing, so it reads as a search box rather
   than a loud button. The badge text ("⌘K" / "Ctrl K") is set per platform by
   command-palette.js on [data-gcp-kbd]. */
.g-hbtn--search { color: var(--g-text-muted); cursor: pointer; }
.g-hbtn--search:hover { color: var(--g-text); }
.g-hbtn__kbd {
    display: inline-flex;
    align-items: center;
    margin-left: .15rem;
    padding: .08rem .35rem;
    border: 1px solid var(--g-border);
    border-radius: 5px;
    background: var(--g-surface-2);
    color: var(--g-text-faint);
    font-family: inherit;
    font-size: .68rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.g-hbtn--search:hover .g-hbtn__kbd { border-color: var(--g-border-strong); color: var(--g-text-muted); }

/* ── Footer ── */
.g-footer { position: relative; background: var(--g-navy); color: #fff; }
.g-footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--g-accent-2) 60%, transparent), transparent); }
.g-footer a { color: rgba(255,255,255,.68); text-decoration: none; transition: color .18s var(--g-ease); }
.g-footer a:hover { color: #fff; }

/* Brand block — institution identity, echoing the header */
.g-footer__brand { display: flex; align-items: center; gap: .75rem; }
.g-footer__seal { display: grid; width: 2.6rem; height: 2.6rem; flex: none; place-items: center; overflow: hidden; border-radius: 11px; background: rgba(255,255,255,.06); }
.g-footer__seal img { max-width: 72%; max-height: 72%; object-fit: contain; }
.g-footer__seal.is-logo-broken { background: color-mix(in srgb, var(--g-accent) 30%, transparent); color: inherit; }
.g-footer__inst { margin: 0; max-width: 20rem; font-size: .9rem; font-weight: 700; letter-spacing: -.01em; color: #fff; line-height: 1.35; }
.g-footer__tagline { max-width: 20rem; font-size: .86rem; font-weight: 400; color: rgba(255,255,255,.55); line-height: 1.6; }

.g-footer__visit { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.05rem; border: 1px solid rgba(255,255,255,.18); border-radius: var(--g-r-md); color: #fff; font-size: .8rem; font-weight: 600; transition: background .18s var(--g-ease), border-color .18s var(--g-ease); }
.g-footer__visit:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.3); color: #fff; }

.g-footer__col h4 { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 1.1rem; color: rgba(255,255,255,.55); }
.g-footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.g-footer__col li a { display: inline-flex; align-items: center; font-size: .84rem; }
.g-footer__col li a .arr { margin-right: .55rem; font-size: .8rem; color: rgba(255,255,255,.35); transition: transform .18s var(--g-ease), color .18s var(--g-ease); }
.g-footer__col li a:hover .arr { color: var(--g-footer-link-hover); transform: translateX(2px); }
.g-footer__col ul.g-scroll { max-height: 180px; }

.g-footer__divider { border: 0; border-top: 1px solid rgba(255,255,255,.1); }
.g-footer__sep { opacity: .4; padding: 0 .5rem; }
.g-footer__bottom { font-size: .8rem; color: rgba(255,255,255,.7); }
.g-footer__bottom a { color: #fff; }
.g-footer__bottom .dim { color: rgba(255,255,255,.5); }

/* ── Flash messages ──
   Built on top of Bootstrap's `.alert` (so data-bs-dismiss still works) but
   repainted from guest tokens: a softly tinted panel with a matching hairline
   border, a solid tone dot beside the title, and the message hung beneath it.
   One accent variable (--g-al) drives every variant. */
.g-alerts {
    /* Sits between the header and the page body. The page section below
       drops its own top padding (.g-main--alerted) so the two don't stack. */
    padding-top: clamp(1.25rem, 3vw, 1.75rem);
}

/* When Bootstrap dismisses the last alert it removes the .g-alert node but
   leaves this wrapper (and its padding) in the DOM, which held a strip of
   empty space. Collapse the wrapper once no alert remains. The JS fallback in
   guest.js also hides it for browsers without :has(). */
.g-alerts:not(:has(.g-alert)),
.g-alerts.is-empty {
    padding-top: 0;
}

.g-alert + .g-alert { margin-top: .75rem; }

.g-alert {
    --g-al: var(--g-accent);
    --g-al-ink: color-mix(in srgb, var(--g-al) 74%, var(--g-text));
    --g-al-icon: 1.25rem;
    --g-al-gap: .6rem;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    width: 100%;
    margin: 0;
    padding: 1rem;
    border: 1px solid color-mix(in srgb, var(--g-al) 32%, var(--g-border));
    border-radius: var(--g-r-lg);
    /* Base tint plus a soft glow rising from behind the icon. Bumped from a
       washed-out 4.5%/9% to a more vivid 10%/16% so the alert reads clearly;
       --g-al-ink still carries the text so AA holds. */
    background:
        radial-gradient(70% 170% at 0% 0%, color-mix(in srgb, var(--g-al) 16%, transparent), transparent 70%),
        color-mix(in srgb, var(--g-al) 10%, var(--g-surface));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .7),
        0 1px 2px rgba(15, 23, 42, .04),
        0 14px 30px -24px color-mix(in srgb, var(--g-al) 55%, transparent);
    color: var(--g-text);
    line-height: 1.45;
}

.g-alert__body {
    flex: 1;
    min-width: 0;
}

.g-alert__heading {
    display: flex;
    align-items: center;
    gap: var(--g-al-gap);
    min-height: var(--g-al-icon);
}

/* Solid tone dot with a white mark and a soft halo ring. */
.g-alert__icon {
    position: relative;
    display: grid;
    width: var(--g-al-icon);
    height: var(--g-al-icon);
    flex: none;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--g-al), color-mix(in srgb, var(--g-al) 84%, #000));
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--g-al) 14%, transparent),
        0 3px 8px -3px color-mix(in srgb, var(--g-al) 70%, transparent);
    color: #fff;
}

.g-alert__glyph {
    width: .8rem;
    height: .8rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Ring for the one-time pulse on errors and warnings (see motion below). */
.g-alert__icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--g-al);
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
}

.g-alert__title {
    margin: 0;
    color: var(--g-al-ink);
    font-size: .86rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.35;
}

/* The message hangs under the title rather than under the icon. */
.g-alert__text {
    margin-top: .3rem;
    padding-left: calc(var(--g-al-icon) + var(--g-al-gap));
    color: color-mix(in srgb, var(--g-al) 24%, var(--g-text-muted));
    font-size: .82rem;
    line-height: 1.55;
}

/* Title-only alert: no body, so drop the spacing it would otherwise add. */
.g-alert__text:empty { display: none; }

.g-alert__text p { margin: 0; }
.g-alert__text > * + * { margin-top: .35rem; }
.g-alert__text :last-child { margin-bottom: 0; }

.g-alert__text strong,
.g-alert__text b {
    color: var(--g-al-ink);
    font-weight: 650;
}

.g-alert__text ul,
.g-alert__text ol {
    margin: .35rem 0 0;
    padding-left: 1.1rem;
}

.g-alert__text li + li { margin-top: .15rem; }
.g-alert__text li::marker { color: color-mix(in srgb, var(--g-al) 70%, transparent); }

.g-alert__text a {
    color: var(--g-al-ink);
    font-weight: 650;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--g-al) 35%, transparent);
    text-underline-offset: 2px;
    transition: text-decoration-color .16s var(--g-ease);
}

.g-alert__text a:hover { text-decoration-color: currentColor; }

.g-alert__close {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    flex: none;
    place-items: center;
    /* Centred on the heading row and mirrored against the icon's inset. */
    margin: -.25rem -.25rem 0 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: color-mix(in srgb, var(--g-al) 62%, var(--g-text-faint));
    font-size: .72rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .16s var(--g-ease), color .16s var(--g-ease);
}

.g-alert__close:hover {
    background: color-mix(in srgb, var(--g-al) 10%, transparent);
    color: var(--g-al-ink);
}

.g-alert__close:focus-visible {
    outline: 2px solid var(--g-al);
    outline-offset: 2px;
    color: var(--g-al-ink);
}

.g-alert--info { --g-al: var(--g-info); }
.g-alert--success { --g-al: var(--g-success); }
.g-alert--warning { --g-al: var(--g-warning); }
.g-alert--danger { --g-al: var(--g-danger); }

[data-guest-theme="dark"] .g-alert {
    --g-al-ink: color-mix(in srgb, var(--g-al) 78%, var(--g-text));
    border-color: color-mix(in srgb, var(--g-al) 32%, var(--g-border));
    background:
        radial-gradient(70% 170% at 0% 0%, color-mix(in srgb, var(--g-al) 20%, transparent), transparent 70%),
        color-mix(in srgb, var(--g-al) 14%, var(--g-surface));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .04),
        0 14px 30px -24px rgba(0, 0, 0, .8);
}

/* Dark-theme tones are light, so the mark flips to dark ink for contrast. */
[data-guest-theme="dark"] .g-alert__icon {
    background: var(--g-al);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-al) 20%, transparent);
    color: var(--g-bg);
}

[data-guest-theme="dark"] .g-alert__text {
    color: color-mix(in srgb, var(--g-al) 16%, var(--g-text-muted));
}

@media (max-width: 575.98px) {
    .g-alert {
        gap: .7rem;
        padding: .85rem;
        border-radius: var(--g-r-md);
    }
}

/* Motion: a short entrance for every alert, the icon popping in, and a single
   pulse on errors and warnings. Nothing animates under reduced motion. */
@keyframes g-alert-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

@keyframes g-alert-icon-in {
    from { opacity: 0; transform: scale(.4); }
    to   { opacity: 1; transform: none; }
}

@keyframes g-alert-ping {
    from { opacity: .45; transform: scale(1); }
    to   { opacity: 0; transform: scale(2.4); }
}

@media (prefers-reduced-motion: no-preference) {
    /* No fill-mode on the alert: Bootstrap's `.fade` keeps control of
       opacity when the alert is dismissed. */
    .g-alert { animation: g-alert-in .32s var(--g-ease); }

    .g-alert__icon { animation: g-alert-icon-in .45s cubic-bezier(.34, 1.56, .64, 1) .08s backwards; }

    .g-alert--danger .g-alert__icon::after,
    .g-alert--warning .g-alert__icon::after {
        animation: g-alert-ping 1.1s cubic-bezier(0, 0, .2, 1) .5s;
    }
}

/* A flash already adds top rhythm; trim the following section's top padding so
   the two don't stack. The hero is deliberately exempt: its full top padding is
   what reveals the clipped corner gradient, and reducing it (which also lingers
   after the alert is dismissed, since .g-main--alerted stays on <main>).
   Safe to include the hero now that the decorative glow lives on a fixed
   viewport backdrop (.g-body::before) rather than inside the hero — so
   trimming the hero's top padding no longer cuts any gradient. This nests the
   alert snugly between the header and the hero content. */
/* Keyed on an alert actually being present (:has) rather than the server-set
   .g-main--alerted class. That class stays on <main> after Bootstrap removes
   the alert node, which left the hero stuck on the reduced padding — so the
   dismissed state sat higher than a clean page load. With :has() the rule
   stops matching the moment the alert is gone, restoring the hero's own
   padding and making "after dismiss" identical to a normal load.
   .g-main--alerted is kept as the no-:has() fallback, paired with the JS in
   guest.js that strips it once the last alert closes. */
.g-main:has(> .g-alerts .g-alert) > .g-alerts + section,
.g-main--alerted.g-main--has-alert > .g-alerts + section {
    padding-top: clamp(1.25rem, 3vw, 1.75rem);
}

/* ── Toasts ──
   The same tone system as `.g-alert`, re-homed in a fixed stack in the
   bottom-right corner. Toasts reuse the alert inner parts (icon/body/title/
   text/close) and layer on a frosted elevated surface plus a timer bar. */
.g-toast-stack {
    position: fixed;
    z-index: 1080;
    right: clamp(1rem, 3vw, 2rem);
    bottom: clamp(1rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: .7rem;
    width: min(22rem, calc(100vw - 2rem));
    pointer-events: none;
}

.g-toast {
    --g-al: var(--g-accent);
    --g-al-ink: color-mix(in srgb, var(--g-al) 74%, var(--g-text));
    --g-al-icon: 1.25rem;
    --g-al-gap: .6rem;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    overflow: hidden;
    padding: .9rem 1rem;
    border: 1px solid color-mix(in srgb, var(--g-al) 26%, var(--g-border));
    border-radius: var(--g-r-lg);
    background:
        radial-gradient(70% 170% at 0% 0%, color-mix(in srgb, var(--g-al) 10%, transparent), transparent 70%),
        color-mix(in srgb, var(--g-al) 5%, var(--g-surface));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .7),
        var(--g-shadow);
    color: var(--g-text);
    line-height: 1.45;
    pointer-events: auto;
}

/* Toasts share the alert dot, glyph, body and close styles. */
.g-toast .g-alert__icon,
.g-toast .g-alert__glyph,
.g-toast .g-alert__body,
.g-toast .g-alert__heading,
.g-toast .g-alert__title,
.g-toast .g-alert__text,
.g-toast .g-alert__close { all: unset; }

.g-toast .g-alert__body { flex: 1; min-width: 0; display: block; }
.g-toast .g-alert__heading { display: flex; align-items: center; gap: var(--g-al-gap); min-height: var(--g-al-icon); }
.g-toast .g-alert__icon {
    position: relative;
    display: grid;
    width: var(--g-al-icon);
    height: var(--g-al-icon);
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--g-al), color-mix(in srgb, var(--g-al) 84%, #000));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-al) 14%, transparent);
    color: #fff;
}
.g-toast .g-alert__glyph { display: block; width: .8rem; height: .8rem; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.g-toast .g-alert__title { margin: 0; color: var(--g-al-ink); font-size: .86rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.35; }
.g-toast .g-alert__text {
    display: block;
    margin-top: .3rem;
    padding-left: calc(var(--g-al-icon) + var(--g-al-gap));
    color: color-mix(in srgb, var(--g-al) 24%, var(--g-text-muted));
    font-size: .82rem;
    line-height: 1.55;
}

.g-toast .g-alert__close {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    flex: none;
    place-items: center;
    margin: -.2rem -.25rem 0 0;
    border-radius: 8px;
    color: color-mix(in srgb, var(--g-al) 62%, var(--g-text-faint));
    font-size: .72rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .16s var(--g-ease), color .16s var(--g-ease);
}
.g-toast .g-alert__close:hover { background: color-mix(in srgb, var(--g-al) 10%, transparent); color: var(--g-al-ink); }
.g-toast .g-alert__close:focus-visible { outline: 2px solid var(--g-al); outline-offset: 2px; }

/* Auto-dismiss timer bar along the bottom edge. */
.g-toast__timer {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    transform-origin: left;
    background: var(--g-al);
    opacity: .55;
}

.g-toast--info { --g-al: var(--g-info); }
.g-toast--success { --g-al: var(--g-success); }
.g-toast--warning { --g-al: var(--g-warning); }
.g-toast--danger { --g-al: var(--g-danger); }

[data-guest-theme="dark"] .g-toast {
    --g-al-ink: color-mix(in srgb, var(--g-al) 78%, var(--g-text));
    border-color: color-mix(in srgb, var(--g-al) 34%, var(--g-border));
    background:
        radial-gradient(70% 170% at 0% 0%, color-mix(in srgb, var(--g-al) 15%, transparent), transparent 70%),
        color-mix(in srgb, var(--g-al) 12%, var(--g-surface));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), var(--g-shadow);
}

[data-guest-theme="dark"] .g-toast .g-alert__icon {
    background: var(--g-al);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-al) 20%, transparent);
}
[data-guest-theme="dark"] .g-toast .g-alert__glyph { stroke: var(--g-bg); }
[data-guest-theme="dark"] .g-toast .g-alert__text { color: color-mix(in srgb, var(--g-al) 16%, var(--g-text-muted)); }

/* Enter/leave + timer motion. `.is-leaving` is toggled by the gallery script. */
@keyframes g-toast-in {
    from { opacity: 0; transform: translateX(16px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

@keyframes g-toast-out {
    from { opacity: 1; transform: none; }
    to   { opacity: 0; transform: translateX(16px) scale(.98); }
}

@keyframes g-toast-count {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

.g-toast.is-leaving { animation: g-toast-out .28s var(--g-ease) forwards; }
.g-toast.is-paused .g-toast__timer { animation-play-state: paused; }

@media (prefers-reduced-motion: no-preference) {
    .g-toast { animation: g-toast-in .3s var(--g-ease); }
    .g-toast__timer { animation: g-toast-count var(--g-toast-life, 5s) linear forwards; }
}

/* Reduced motion: no slide, and the timer bar just drains width instead. */
@media (prefers-reduced-motion: reduce) {
    .g-toast__timer { animation: g-toast-count var(--g-toast-life, 5s) linear forwards; }
}

/* ── Component gallery (site/alerts) ──
   A light scaffold around the live components: a hero with a tone legend,
   numbered section cards, trigger chips and a copyable code block. */
.ga-hero { padding: clamp(2.25rem, 5vw, 3.5rem) 0 0; }

.ga-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--g-text-faint);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.ga-hero__eyebrow i { color: var(--g-accent-ink); }
.ga-hero__title { margin: .6rem 0 .4rem; font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -.025em; color: var(--g-text); }
.ga-hero__lead { max-width: 44rem; margin: 0; color: var(--g-text-muted); font-size: .95rem; line-height: 1.65; }
.ga-hero__lead code,
.ga-hero__title code {
    padding: .08em .4em;
    border-radius: 6px;
    background: color-mix(in srgb, var(--g-accent) 10%, var(--g-surface-2));
    color: color-mix(in srgb, var(--g-accent) 72%, var(--g-text));
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .85em;
}

/* Tone legend */
.ga-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .9rem;
    margin: 1.1rem 0 0;
    padding: 0;
    list-style: none;
}
.ga-legend__item {
    --g-al: var(--g-accent);
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--g-text-muted);
    font-size: .78rem;
    font-weight: 600;
}
.ga-legend__dot {
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    background: var(--g-al);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-al) 16%, transparent);
}
.ga-legend__item--info { --g-al: var(--g-info); }
.ga-legend__item--success { --g-al: var(--g-success); }
.ga-legend__item--warning { --g-al: var(--g-warning); }
.ga-legend__item--danger { --g-al: var(--g-danger); }

/* Sections */
.ga-sections { padding-top: clamp(1.5rem, 4vw, 2.5rem); }
.ga-section + .ga-section { margin-top: clamp(1.75rem, 4vw, 2.75rem); }
.ga-section__head {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 1rem;
}
.ga-section__num {
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    flex: none;
    border-radius: 10px;
    border: 1px solid var(--g-border);
    background: var(--g-surface);
    box-shadow: var(--g-shadow-sm);
    color: var(--g-accent-ink);
    font-size: .8rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}
.ga-section__title { margin: 0; font-size: 1.1rem; font-weight: 750; letter-spacing: -.015em; color: var(--g-text); }
.ga-section__note { margin: .1rem 0 0; color: var(--g-text-faint); font-size: .8rem; }

.ga-card {
    border: 1px solid var(--g-border);
    border-radius: var(--g-r-xl);
    background: var(--g-surface);
    box-shadow: var(--g-shadow-sm);
    padding: clamp(1.25rem, 3vw, 1.9rem);
}
.ga-card__lead { margin: 0 0 1.1rem; color: var(--g-text-muted); font-size: .86rem; line-height: 1.6; }

/* Alerts stack full-width and size to their content, so each one breathes and
   reads top-to-bottom like a proper component gallery. */
.ga-grid { display: grid; gap: .9rem; }

.ga-triggers { display: flex; flex-wrap: wrap; gap: .6rem; }

/* Tone-coloured trigger chips reuse the accent variable per tone. */
.ga-trigger {
    --g-al: var(--g-accent);
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1rem;
    border: 1px solid color-mix(in srgb, var(--g-al) 32%, var(--g-border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--g-al) 8%, var(--g-surface));
    color: color-mix(in srgb, var(--g-al) 72%, var(--g-text));
    font-size: .82rem;
    font-weight: 650;
    cursor: pointer;
    transition: background-color .16s var(--g-ease), border-color .16s var(--g-ease), transform .16s var(--g-ease), box-shadow .16s var(--g-ease);
}
.ga-trigger::before {
    content: "";
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: var(--g-al);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-al) 18%, transparent);
}
.ga-trigger:hover {
    background: color-mix(in srgb, var(--g-al) 14%, var(--g-surface));
    border-color: color-mix(in srgb, var(--g-al) 46%, var(--g-border));
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -14px color-mix(in srgb, var(--g-al) 80%, transparent);
}
.ga-trigger:active { transform: translateY(0); }
.ga-trigger:focus-visible { outline: 2px solid var(--g-al); outline-offset: 2px; }
.ga-trigger--info { --g-al: var(--g-info); }
.ga-trigger--success { --g-al: var(--g-success); }
.ga-trigger--warning { --g-al: var(--g-warning); }
.ga-trigger--danger { --g-al: var(--g-danger); }

/* Markup snippet with a title bar + copy button. */
.ga-code {
    margin: 1.25rem 0 0;
    border: 1px solid var(--g-border);
    border-radius: var(--g-r-md);
    background: var(--g-surface-2);
    overflow: hidden;
}
.ga-code__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem .5rem .5rem .85rem;
    border-bottom: 1px solid var(--g-border);
    background: color-mix(in srgb, var(--g-surface) 60%, var(--g-surface-2));
}
.ga-code__label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--g-text-faint);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.ga-code__copy {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .6rem;
    border: 1px solid var(--g-border);
    border-radius: 7px;
    background: var(--g-surface);
    color: var(--g-text-muted);
    font-size: .74rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .16s var(--g-ease), color .16s var(--g-ease), background-color .16s var(--g-ease);
}
.ga-code__copy:hover { border-color: var(--g-border-strong); color: var(--g-text); background: var(--g-surface-2); }
.ga-code__copy:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; }
.ga-code__copy.is-copied { border-color: color-mix(in srgb, var(--g-success) 45%, var(--g-border)); color: var(--g-success); }
.ga-code__pre {
    margin: 0;
    padding: .9rem 1rem;
    overflow-x: auto;
    color: var(--g-text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .78rem;
    line-height: 1.6;
}
.ga-code__pre code { font: inherit; color: inherit; }
.ga-code .tok-tag { color: color-mix(in srgb, var(--g-accent) 72%, var(--g-text)); font-weight: 600; }
.ga-code .tok-attr { color: color-mix(in srgb, var(--g-info) 70%, var(--g-text)); }
.ga-code .tok-str { color: color-mix(in srgb, var(--g-success) 55%, var(--g-text)); }
.ga-code .tok-punct { color: var(--g-text-faint); }

/* ── End-state pages (site/error, site/flush) ──
   Body-only views inside the guest shell. A tone-washed hero carries the
   status and onward actions; the error page adds a notices panel below.
   Shared rather than duplicated, because both pages are the same shape: badge,
   eyebrow, title, lead, actions. Tone is the only real difference, so
   .ge-hero--ok re-tints it for a confirmation instead of a fault. */
/* Transparent, like .gh-hero on the landing page and for the same reason: it
   used to paint its own `var(--g-bg)` plus an element-anchored radial tint.
   That fill sat on top of the page-level fixed glow (.g-body::before), so a
   flash alert above the hero pushed it down and left a hard horizontal seam
   where the page's gradient stopped and the hero's flat fill began. With no
   background of its own the glow runs behind the whole page, alert or not. */
.ge-hero {
    position: relative;
    padding: clamp(2.5rem, 6vw, 4.5rem) 0;
    background: transparent;
}
.ge-hero__inner {
    max-width: 40rem;
    margin: 0 auto;
    text-align: center;
}
.ge-hero__badge {
    display: inline-grid;
    place-items: center;
    width: 3.75rem;
    height: 3.75rem;
    margin-bottom: 1.1rem;
    border-radius: 50%;
    background: var(--g-gradient);
    box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--g-accent) 70%, transparent);
    color: #fff;
    font-size: 1.6rem;
}
.ge-hero__code {
    display: inline-block;
    margin-bottom: .6rem;
    color: var(--g-accent-ink);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.ge-hero__title {
    margin: 0 0 .6rem;
    font-size: clamp(1.6rem, 3.2vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--g-text);
}
.ge-hero__lead {
    margin: 0 auto;
    max-width: 34rem;
    color: var(--g-text-muted);
    font-size: .95rem;
    line-height: 1.65;
}
.ge-hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .7rem;
    margin-top: 1.6rem;
}
.ge-hero__actions .g-btn-accent,
.ge-hero__actions .g-btn-soft {
    gap: .5rem;
    padding-inline: 1.3rem;
}

.ge-hero__foot {
    margin: 1.4rem 0 0;
    color: var(--g-text-faint);
    font-size: .8rem;
}
.ge-hero__foot a { color: var(--g-accent-ink); font-weight: 650; text-decoration: none; }
.ge-hero__foot a:hover { text-decoration: underline; }

/* Confirmation tone: success badge and eyebrow. Everything else is inherited
   from .ge-hero above — including no background, so the flush page's hero does
   not develop the same seam under an alert. The green wash it used to carry
   went with the fill; the badge and eyebrow already carry the tone. */
.ge-hero--ok { background: transparent; }
.ge-hero--ok .ge-hero__badge {
    background: linear-gradient(135deg,
        var(--g-success),
        color-mix(in srgb, var(--g-success) 55%, var(--g-accent)));
    box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--g-success) 60%, transparent);
}
.ge-hero--ok .ge-hero__code { color: var(--g-success); }

/* Key/value facts under the lead — a centred row of pills, wrapping on narrow
   screens rather than forcing a table. */
.ge-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .45rem;
    margin: 1.5rem 0 0;
}
.ge-meta__row {
    display: inline-flex;
    align-items: baseline;
    gap: .4rem;
    padding: .38rem .8rem;
    border: 1px solid var(--g-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--g-surface) 80%, transparent);
    font-size: .74rem;
    line-height: 1.3;
}
.ge-meta dt {
    color: var(--g-text-faint);
    font-weight: 600;
}
.ge-meta dd {
    margin: 0;
    color: var(--g-text);
    font-weight: 650;
}

.ge-notices {
    max-width: 54rem;
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    border: 1px solid var(--g-border);
    border-radius: var(--g-r-xl);
    background: var(--g-surface);
    box-shadow: var(--g-shadow-sm);
}
.ge-notices__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.ge-notices__head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -.01em;
    color: var(--g-text);
}
.ge-notices__head a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--g-accent-ink);
    font-size: .82rem;
    font-weight: 650;
    text-decoration: none;
}
.ge-notices__head a:hover { text-decoration: underline; }
.ge-notices__grid { display: grid; gap: .6rem; }

.ge-notice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .9rem;
    padding: .8rem 1rem;
    /* 2px at rest reserves the width so the hover only swaps the colour — no
       layout jerk, only border-color transitions (never border-width). */
    border: 2px solid var(--g-border);
    border-radius: var(--g-r-md);
    background: var(--g-surface);
    text-decoration: none;
    transition: border-color .16s var(--g-ease), background-color .16s var(--g-ease), transform .16s var(--g-ease);
}
.ge-notice:hover {
    border-color: var(--g-accent-strong);
    background: color-mix(in srgb, var(--g-accent) 4%, var(--g-surface));
    transform: translateY(-1px);
}
.ge-notice__date {
    display: block;
    min-width: 2.75rem;
    text-align: center;
    color: var(--g-text-faint);
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.1;
}
.ge-notice__date b {
    display: block;
    color: var(--g-accent-ink);
    font-size: 1.15rem;
    font-weight: 800;
}
.ge-notice__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--g-text);
    font-size: .88rem;
    font-weight: 600;
}
.ge-notice__arrow { color: var(--g-text-faint); flex: none; }
.ge-notice:hover .ge-notice__arrow { color: var(--g-accent-ink); }

@media (max-width: 767.98px) {
    .ge-notice__title { white-space: normal; }
}

/* ── Shared section rhythm ── */
.g-section { padding: 4rem 0; }
.g-section--tint { background: var(--g-surface-2); }

/* ── Dark mode: one continuous page background ──
   Shell bands (trust bar, footer) and tinted sections all sit on --g-bg;
   only cards keep their own surface. Hairline borders still separate bands. */
[data-guest-theme="dark"] .g-trust { background: var(--g-bg); border-bottom: 1px solid var(--g-border); }
[data-guest-theme="dark"] .g-footer { background: var(--g-bg); }
[data-guest-theme="dark"] .g-section--tint { background: var(--g-bg); }
.g-head__eyebrow { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g-accent-ink); margin-bottom: .6rem; }
.g-head h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 .6rem; color: var(--g-text); }
.g-head p { font-size: .95rem; color: var(--g-text-muted); margin: 0; }

/* ── Form controls (theme-aware, built on BS .form-control) ──
   The shared foundation asset intentionally excludes the old global
   custom.css. These selectors are therefore component styling, not cascade
   repair. */
.g-field { margin-bottom: 1.1rem; }
.g-field__row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .45rem; }
label.g-label { display: block !important; }
.g-label { margin-bottom: .4rem; font-size: .8125rem; font-weight: 600; color: var(--g-text); }
.g-field__row .g-label { margin-bottom: 0; }

/* Required marker. The inputs already carry aria-required, this is the
   matching visual cue (WCAG 3.3.2). Decorative, so it is hidden from AT. */
.g-label--req::after {
    content: "*";
    margin-left: .2rem;
    color: var(--g-field-danger);
    font-weight: 700;
    speak: never;
}

/* Input shell.
   The border is ALWAYS 1px. Active states draw the second pixel with an
   inset shadow and the glow with an outer shadow, so the box never resizes
   (no layout jerk). Each state only swaps these variables. */
.g-control {
    --g-ctl-border: var(--g-border);
    --g-ctl-inner: transparent;
    --g-ctl-ring: transparent;
    --g-ctl-bg: var(--g-surface);
    --g-ctl-icon: var(--g-text-faint);

    display: flex;
    min-height: 42px;
    align-items: center;
    box-sizing: border-box;
    border: 1px solid var(--g-ctl-border);
    border-radius: 9px;
    background-color: var(--g-ctl-bg);
    box-shadow: inset 0 0 0 1px var(--g-ctl-inner), 0 0 0 3px var(--g-ctl-ring);
    transition: border-color .18s var(--g-ease), box-shadow .18s var(--g-ease), background-color .18s var(--g-ease);
}

.g-control__icon { display: flex; align-items: center; justify-content: center; width: 17px; flex: none; margin-left: .75rem; color: var(--g-ctl-icon); font-size: 15px; user-select: none; -webkit-user-select: none; pointer-events: none; transition: color .18s var(--g-ease); }
svg.g-control__icon { height: 17px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.g-control .form-control {
    flex: 1; min-width: 0;
    min-height: 40px;
    padding: 0 .75rem;
    border: 0 !important;
    border-radius: inherit !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: .85rem;
    color: var(--g-text) !important;
}
.g-control .form-control:focus { outline: none; box-shadow: none !important; }
.g-control .form-control::placeholder { color: var(--g-text-faint); opacity: 1; }

/* The shell owns the border, background and focus ring. Keep the underlying
   Bootstrap control transparent so only one box is painted. */
.g-control .form-control:focus,
.g-control .form-control.is-valid,
.g-control .form-control.is-invalid,
.g-control .form-control.is-valid:focus,
.g-control .form-control.is-invalid:focus {
    border: 0 !important;
    box-shadow: none !important;
    background-image: none !important;
}

/* Keep browser autofill from painting its own yellow/blue box. */
.g-control .form-control:-webkit-autofill,
.g-control .form-control:-webkit-autofill:hover,
.g-control .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--g-text);
    caret-color: var(--g-text);
    transition: background-color 600000s 0s, color 600000s 0s;
}

/* Native select inside a control: custom chevron, no OS arrow. */
.g-control--select .form-control { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: .5rem; }
.g-control__chevron { display: flex; align-items: center; flex: none; margin-right: .85rem; color: var(--g-text-faint); font-size: .75rem; pointer-events: none; }

/* Password reveal toggle */
.g-control__toggle { display: grid; place-items: center; width: 32px; height: 32px; flex: none; margin-right: .25rem; border: 0; border-radius: 7px; background: none; color: var(--g-text-faint); cursor: pointer; font-size: 14px; transition: color .16s var(--g-ease), background-color .16s var(--g-ease); }
.g-control__toggle:hover { background: var(--g-surface-2); color: var(--g-text-muted); }
.g-control__toggle:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 1px; color: var(--g-accent-ink); }

/* ── States ──
   Qualifiers sit inside :where() so every state has the same specificity
   as `.g-control`; precedence is simply the order below:
   hover < focus < filled/valid < focused-filled < danger < focused-danger < disabled.
   Danger works for both ActiveForm styles: `.has-error` on the field
   container (yii\widgets) and `.is-invalid` on the input (bootstrap5). */

/* Hover (empty) */
.g-control:where(:hover) {
    --g-ctl-border: var(--g-border-strong);
}

/* Focus (empty): accent */
.g-control:where(:focus-within) {
    --g-ctl-border: var(--g-accent);
    --g-ctl-inner: var(--g-accent);
    --g-ctl-ring: color-mix(in srgb, var(--g-accent) 14%, transparent);
    --g-ctl-icon: var(--g-accent);
}

/* Filled or validated: teal, 6% tint, soft glow */
.g-control:where(:has(input.form-control[placeholder]:not(:placeholder-shown)), :has(.form-control:-webkit-autofill), :has(.is-valid)),
:where(.has-success) .g-control {
    --g-ctl-border: var(--g-field-valid);
    --g-ctl-inner: var(--g-field-valid);
    --g-ctl-ring: color-mix(in srgb, var(--g-field-valid) 10%, transparent);
    --g-ctl-bg: color-mix(in srgb, var(--g-field-valid) 6%, var(--g-surface));
    --g-ctl-icon: var(--g-field-valid);
}

/* Focused filled: white surface, keeps teal border + glow */
.g-control:where(:has(input.form-control[placeholder]:not(:placeholder-shown)), :has(.form-control:-webkit-autofill), :has(.is-valid)):where(:focus-within),
:where(.has-success) .g-control:where(:focus-within) {
    --g-ctl-ring: color-mix(in srgb, var(--g-field-valid) 16%, transparent);
    --g-ctl-bg: var(--g-surface);
}

/* Native <select>: there is no placeholder to go un-shown, so the input
   rules above never fire. A select always carries a value, so a control
   holding one reads as filled — matching the Select2 field beside it. */
.g-control--select:where(:has(select.form-control)) {
    --g-ctl-border: var(--g-field-valid);
    --g-ctl-inner: var(--g-field-valid);
    --g-ctl-ring: color-mix(in srgb, var(--g-field-valid) 10%, transparent);
    --g-ctl-bg: color-mix(in srgb, var(--g-field-valid) 6%, var(--g-surface));
    --g-ctl-icon: var(--g-field-valid);
}

.g-control--select:where(:has(select.form-control)):where(:focus-within) {
    --g-ctl-ring: color-mix(in srgb, var(--g-field-valid) 16%, transparent);
    --g-ctl-bg: var(--g-surface);
}

/* ...unless an empty placeholder option is the current selection, in which
   case the field is genuinely empty and replays the empty states. */
.g-control--select:where(:has(option[value=""]:checked)) {
    --g-ctl-border: var(--g-border);
    --g-ctl-inner: transparent;
    --g-ctl-ring: transparent;
    --g-ctl-bg: var(--g-surface);
    --g-ctl-icon: var(--g-text-faint);
}

.g-control--select:where(:has(option[value=""]:checked)):where(:hover) {
    --g-ctl-border: var(--g-border-strong);
}

.g-control--select:where(:has(option[value=""]:checked)):where(:focus-within) {
    --g-ctl-border: var(--g-accent);
    --g-ctl-inner: var(--g-accent);
    --g-ctl-ring: color-mix(in srgb, var(--g-accent) 14%, transparent);
    --g-ctl-icon: var(--g-accent);
}

/* Danger: orange-red, 6% tint, soft glow */
.g-control:where(:has(.is-invalid), .is-invalid),
:where(.has-error) .g-control {
    --g-ctl-border: var(--g-field-danger);
    --g-ctl-inner: var(--g-field-danger);
    --g-ctl-ring: color-mix(in srgb, var(--g-field-danger) 10%, transparent);
    --g-ctl-bg: color-mix(in srgb, var(--g-field-danger) 6%, var(--g-surface));
    --g-ctl-icon: var(--g-field-danger);
}

/* Focused danger: white surface, keeps red border + glow */
.g-control:where(:has(.is-invalid), .is-invalid):where(:focus-within),
:where(.has-error) .g-control:where(:focus-within) {
    --g-ctl-ring: color-mix(in srgb, var(--g-field-danger) 16%, transparent);
    --g-ctl-bg: var(--g-surface);
}

/* Disabled / read-only override every content-derived state */
.g-control:where(:has(.form-control:disabled), :has(.form-control[readonly])) {
    --g-ctl-border: var(--g-border);
    --g-ctl-inner: transparent;
    --g-ctl-ring: transparent;
    --g-ctl-bg: var(--g-surface-2);
    --g-ctl-icon: var(--g-text-faint);
    opacity: .7;
    cursor: not-allowed;
}

/* ── Mobile: prevent iOS Safari focus-zoom ──
   iOS Safari auto-zooms the viewport whenever a focused form control has a
   computed font-size below 16px. The guest controls sit at .85rem (13.6px),
   which tripped the zoom on the login fields and the register-page selects.
   Bumping every focusable guest control to 16px at the mobile breakpoint stops
   the zoom without disabling pinch-zoom in the viewport meta. The smaller
   visual size is kept at >=768px, so desktop is untouched. */
@media (max-width: 767.98px) {
    .g-control .form-control,
    .g-control select.form-control,
    .g-control input.form-control,
    .g-control textarea.form-control {
        font-size: 16px;
    }
}

/* Error text (yii\widgets uses .help-block, bootstrap5 our .g-error) */
.g-error,
.help-block {
    margin-top: .4rem;
    font-size: .72rem;
    font-weight: 500;
    color: var(--g-field-danger);
}
.g-error:empty { display: none; }

/* ---------- Scrollbars ----------
   The platform default draws an opaque grey gutter down the right edge of the
   page: it ignores the dark theme, and because it is a filled band it reads as
   a hard border beside the content. These rules keep the gutter but make it
   disappear when idle — the track is fully transparent, so the page background
   shows through, and the thumb is a translucent pill.

   The pill shape comes from `background-clip: padding-box` plus a transparent
   border: the border area stays see-through, which insets the visible thumb
   from the viewport edge instead of letting it touch. That inset is why the
   gutter is wider than the thumb looks.

   Both modern syntaxes are set. scrollbar-width/-color cover Firefox; the
   ::-webkit-* pseudo-elements cover Chrome, Edge and Safari, where they take
   precedence and give the finer control. */
/* The surface list is wrapped in :where() so it stays written once and adds no
   specificity — a component can still retune its own thumb by redefining
   --g-sb-thumb on itself, which .gl-panel__body does because that panel is
   dark in both themes. Chrome resolves the viewport scrollbar from the root
   element and falls back to <body>, so both are included. */
:where([data-guest-theme], .g-body, .g-scroll, .gmm__body, .gcp__results, .gl-panel__body) {
    scrollbar-width: thin;
    scrollbar-color: var(--g-sb-thumb) transparent;
}

:where([data-guest-theme], .g-body, .g-scroll, .gmm__body, .gcp__results, .gl-panel__body)::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

:where([data-guest-theme], .g-body, .g-scroll, .gmm__body, .gcp__results, .gl-panel__body)::-webkit-scrollbar-track {
    background: transparent;
}

:where([data-guest-theme], .g-body, .g-scroll, .gmm__body, .gcp__results, .gl-panel__body)::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: var(--g-sb-thumb);
    background-clip: padding-box;
}

:where([data-guest-theme], .g-body, .g-scroll, .gmm__body, .gcp__results, .gl-panel__body)::-webkit-scrollbar-thumb:hover {
    background: var(--g-sb-thumb-hover);
    background-clip: padding-box;
}

/* Dragging reads as a deliberate action, so the thumb drops its transparency. */
:where([data-guest-theme], .g-body, .g-scroll, .gmm__body, .gcp__results, .gl-panel__body)::-webkit-scrollbar-thumb:active {
    background: var(--g-sb-thumb-active);
    background-clip: padding-box;
}

/* The stepper buttons and the corner block between two scrollbars are both
   legacy chrome that would break the floating-pill look. */
:where([data-guest-theme], .g-body, .g-scroll, .gmm__body, .gcp__results, .gl-panel__body)::-webkit-scrollbar-button { display: none; }
:where([data-guest-theme], .g-body, .g-scroll, .gmm__body, .gcp__results, .gl-panel__body)::-webkit-scrollbar-corner { background: transparent; }

.g-scroll { overflow-y: auto; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* ============================================================
   Complete institution links directory
   ------------------------------------------------------------
   Shared by the public and authenticated layouts. The footer deliberately
   caps each link column; this is the complete, deterministic destination.
   ============================================================ */
.glinks { padding-block: 0; }
.glinks--guest { padding-block: clamp(2rem, 4vw, 3.5rem) clamp(3rem, 6vw, 5rem); }
.glinks__inner { width: 100%; }

.glinks__head {
    display: grid;
    max-width: 46rem;
    gap: .55rem;
    margin-bottom: clamp(1.4rem, 3vw, 2rem);
}
.glinks__eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: .4rem;
    color: var(--g-accent-ink);
    font-size: .66rem;
    font-weight: 720;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.glinks__head h1 {
    margin: 0;
    color: var(--g-text);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 760;
    letter-spacing: -.035em;
}
.glinks__head p { margin: 0; color: var(--g-text-muted); line-height: 1.6; }

.glinks__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.glinks__card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--g-border);
    border-radius: var(--g-r-lg);
    background: var(--g-surface);
    box-shadow: var(--g-shadow-sm);
}
.glinks__card-head {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--g-border);
    background: color-mix(in srgb, var(--g-surface-2) 55%, var(--g-surface));
}
.glinks__icon {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: none;
    place-items: center;
    border-radius: var(--g-r-sm);
    background: color-mix(in srgb, var(--g-accent) 9%, var(--g-surface));
    color: var(--g-accent-ink);
    font-size: .8rem;
}
.glinks__card-head h2 { margin: 0; color: var(--g-text); font-size: .92rem; font-weight: 700; }
.glinks__card-head p { margin: .12rem 0 0; color: var(--g-text-muted); font-size: .76rem; }

.glinks__list { display: grid; gap: 1px; margin: 0; padding: .45rem; list-style: none; }
.glinks__list a {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    padding: .58rem .65rem;
    border-radius: var(--g-r-sm);
    color: var(--g-text-muted);
    font-size: .82rem;
    font-weight: 580;
    text-decoration: none;
    transition: background-color .16s var(--g-ease), color .16s var(--g-ease);
}
.glinks__list a > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glinks__list a > i { flex: none; color: var(--g-text-faint); font-size: .68rem; }
.glinks__list a:hover { background: var(--g-surface-2); color: var(--g-text); }
.glinks__list a:hover > i { color: var(--g-accent-ink); }
.glinks__list a:focus-visible { outline: 2px solid var(--g-accent); outline-offset: -2px; }

.glinks__empty {
    display: grid;
    min-height: 8rem;
    place-items: center;
    align-content: center;
    gap: .35rem;
    padding: 1rem;
    color: var(--g-text-faint);
    text-align: center;
}
.glinks__empty p { margin: 0; color: var(--g-text-muted); font-size: .8rem; }

@media (max-width: 767.98px) {
    .glinks__grid { grid-template-columns: 1fr; }
}

/* Directory link after a capped footer list. A rule separates it from the
   institution-managed rows so it reads as navigation rather than another
   external resource. */
.g-footer__more {
    margin-top: .35rem;
    padding-top: .35rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
}
.g-footer__more a { color: rgba(255, 255, 255, .82); font-weight: 650; }


