/* Page chrome around the DevExpress components.
   Every colour is a token; html[data-gk-theme] / html[data-gk-mode] (set from the theme cookie, see
   Services/Appearance) pick the values, so the chrome follows whichever DevExpress theme is active.
   The "Grid" look (light edges, fine grid, corner brackets) is kept to hairlines and low opacity. */
:root {
    --g-bg: #f3f5f8;
    --g-surface: #ffffff;
    --g-surface-2: #f7f9fb;
    --g-border: #dde2e8;
    --g-border-strong: #c3ccd6;
    --g-border-control: #7a8592;
    --g-text: #141b23;
    --g-muted: #434d5a;
    --g-accent: #0b5394;
    --g-accent-strong: #083f71;
    --g-on-accent: #ffffff;
    --g-glow: rgba(11, 83, 148, .18);
    --g-grid-line: rgba(11, 83, 148, .045);
    --g-header-bg: #0b1118;
    --g-header-text: #e6edf5;
    --g-header-muted: #9fb3c8;
    --g-header-accent: #4fd1ff;
    --g-error-bg: #fdecee; --g-error-border: #f0b3bd; --g-error-text: #6e0a1a;
    --g-info-bg: #eaf2fb; --g-info-border: #b3cde9; --g-info-text: #08345e;
    --g-ok-bg: #ebf6ee; --g-ok-border: #b1dbbb; --g-ok-text: #0f4a24;
    --g-warn-text: #6b5200;
    --g-status-run: #0b5394; --g-status-ok: #0f4a24; --g-status-fail: #8f0b20;
    --g-radius: 4px;
    --g-gap: 16px;
    --g-header-h: 56px;

    /* Row tones (report rows coloured by kind, e.g. adverts / music). Light values match Export/RowTones, so the
       exported files look like the screen. */
    --g-tone-green: #135c32;  --g-tone-green-bg: #eaf6ee;
    --g-tone-blue: #0b5394;   --g-tone-blue-bg: #eaf1fb;
    --g-tone-amber: #7a4f00;  --g-tone-amber-bg: #fdf4e3;
    --g-tone-red: #9b221a;    --g-tone-red-bg: #fcecea;
    --g-tone-purple: #553a9e; --g-tone-purple-bg: #f1edfa;
    --g-tone-grey: #4a5563;   --g-tone-grey-bg: #f1f3f5;
    --g-on-tone: #ffffff;
}
html[data-gk-mode="dark"] {
    --g-tone-green: #7fe0a6;  --g-tone-green-bg: rgba(127, 224, 166, .09);
    --g-tone-blue: #7cc4ff;   --g-tone-blue-bg: rgba(95, 179, 255, .11);
    --g-tone-amber: #ffd866;  --g-tone-amber-bg: rgba(255, 216, 102, .09);
    --g-tone-red: #ff8a9b;    --g-tone-red-bg: rgba(255, 138, 155, .09);
    --g-tone-purple: #b9a6ff; --g-tone-purple-bg: rgba(185, 166, 255, .10);
    --g-tone-grey: #9fb3c8;   --g-tone-grey-bg: rgba(159, 179, 200, .08);
    --g-on-tone: #071017;
}

/* Gnosko Grid: Fluent dark with the neutral scale shifted to blue-black, so DevExpress grids, editors and popups
   share the page's palette. Only the dark half of the scale changes hue noticeably. */
html[data-gk-theme="grid"] {
    --DS-neutral-250: #0b1117; --DS-neutral-240: #0f161d; --DS-neutral-230: #151d26; --DS-neutral-220: #1a2430;
    --DS-neutral-210: #202d3b; --DS-neutral-200: #263546; --DS-neutral-190: #2f3e50; --DS-neutral-180: #384657;
    --DS-neutral-170: #3f4f62; --DS-neutral-160: #4a5d72; --DS-neutral-150: #556b84; --DS-neutral-140: #687584;
    --DS-neutral-130: #717f8f; --DS-neutral-120: #7b8998; --DS-neutral-110: #8793a0; --DS-neutral-100: #929daa;

    --g-bg: #0b1117;
    --g-surface: #111921;
    --g-surface-2: #151d26;
    --g-border: #213041;
    --g-border-strong: #2f4459;
    --g-border-control: #5f7891;
    --g-text: #e6edf5;
    --g-muted: #9fb3c8;
    --g-accent: #4fd1ff;
    --g-accent-strong: #8be3ff;
    --g-on-accent: #071017;
    --g-glow: rgba(79, 209, 255, .32);
    --g-grid-line: rgba(79, 209, 255, .055);
    --g-header-bg: #070c11;
    --g-error-bg: #2a1217; --g-error-border: #6b2531; --g-error-text: #ffc2cb;
    --g-info-bg: #0f2333; --g-info-border: #1f4d6e; --g-info-text: #bfe9ff;
    --g-ok-bg: #0f251a; --g-ok-border: #23573a; --g-ok-text: #bff0d0;
    --g-warn-text: #ffd866;
    --g-status-run: #4fd1ff; --g-status-ok: #7fe0a6; --g-status-fail: #ff8a9b;
}

/* Gnosko Light: AAA placeholder text and 3:1 editor borders on the Fluent defaults. */
html[data-gk-theme="light"] {
    --DS-color-content-neutral-deep-rest: #4a5563;
    --DS-color-border-neutral-default-rest: #7a8592;
}
html[data-gk-theme="grid"] { --DS-color-content-neutral-deep-rest: #a9b6c4; }

/* Fluent puts white text on the accent. On Grid's cyan that is 1.8:1, so text on the accent is near-black, and the
   selected navigation item is a tint with a light edge rather than a solid cyan slab. */
html[data-gk-theme="grid"] .dxbl-btn { --dxbl-btn-primary-color: #071017; }
html[data-gk-theme="grid"] .dxbl-treeview {
    --dxbl-treeview-item-active-bg: rgba(79, 209, 255, .14);
    --dxbl-treeview-item-active-focused-bg: rgba(79, 209, 255, .20);
    --dxbl-treeview-item-active-color: #e6edf5;
    --dxbl-treeview-badge-active-bg: #4fd1ff;
    --dxbl-treeview-badge-active-color: #071017;
}
html[data-gk-theme="grid"] .nav-tree .dxbl-treeview-item-container.dxbl-active { box-shadow: inset 2px 0 0 var(--g-accent); }
/* Classic themes paint the selected item with a hard-coded pale ::before at 80% under white text (2.3-5.2:1); use the
   AAA accent instead. The chain mirrors DevExpress's own selector so this one is more specific. */
html[data-gk-theme="blazing-berry"] .nav-tree .dxbl-treeview-item > .dxbl-treeview-item-content > .dxbl-treeview-item-container:not(.dxbl-disabled):not(:disabled).dxbl-active::before,
html[data-gk-theme="purple"] .nav-tree .dxbl-treeview-item > .dxbl-treeview-item-content > .dxbl-treeview-item-container:not(.dxbl-disabled):not(:disabled).dxbl-active::before,
html[data-gk-theme="office-white"] .nav-tree .dxbl-treeview-item > .dxbl-treeview-item-content > .dxbl-treeview-item-container:not(.dxbl-disabled):not(:disabled).dxbl-active::before { background-color: var(--g-accent); opacity: 1; }
html[data-gk-theme] .dxbl-treeview { --dxbl-treeview-item-focus-outline-color: var(--g-accent); }
/* DevExpress's focused-and-selected rule (:focus-visible ... .dxbl-active::before) also hard-codes its pastel, and its
   selector cannot be out-ranked without !important; scoped to the selected nav item only. */
html[data-gk-theme="blazing-berry"] .nav-tree .dxbl-treeview-item-container.dxbl-active::before,
html[data-gk-theme="purple"] .nav-tree .dxbl-treeview-item-container.dxbl-active::before,
html[data-gk-theme="office-white"] .nav-tree .dxbl-treeview-item-container.dxbl-active::before { background-color: var(--g-accent) !important; opacity: 1 !important; }
html[data-gk-theme="blazing-berry"] .nav-tree .dxbl-treeview-item-container.dxbl-active,
html[data-gk-theme="purple"] .nav-tree .dxbl-treeview-item-container.dxbl-active,
html[data-gk-theme="office-white"] .nav-tree .dxbl-treeview-item-container.dxbl-active,
html[data-gk-theme="blazing-dark"] .nav-tree .dxbl-treeview-item-container.dxbl-active { color: #fff !important; }
html[data-gk-theme] .nav-tree .dxbl-treeview-item-container:focus-visible { outline: 2px solid var(--g-accent) !important; outline-offset: 2px; }

/* Link-style DxButtons use the page accent, like anchors. */
html[data-gk-theme="light"] .dxbl-btn, html[data-gk-theme="grid"] .dxbl-btn { --dxbl-btn-link-color: var(--g-accent); }
.target-44 { min-height: 44px; min-width: 44px; }

/* DevExpress classic themes: the chrome takes each theme's accent; Blazing Dark also gets dark surfaces. */
html[data-gk-theme="blazing-berry"] { --g-accent: #5c2d91; --g-accent-strong: #44206c; --g-glow: rgba(92, 45, 145, .18); --g-grid-line: rgba(92, 45, 145, .04); --g-header-accent: #c9a7ff; }
html[data-gk-theme="purple"] { --g-accent: #3d47b0; --g-accent-strong: #2e3689; --g-glow: rgba(75, 86, 200, .18); --g-grid-line: rgba(75, 86, 200, .04); --g-header-accent: #a9b2ff; }
html[data-gk-theme="office-white"] { --g-accent: #943900; --g-accent-strong: #722c00; --g-glow: rgba(179, 71, 0, .16); --g-grid-line: rgba(179, 71, 0, .035); --g-header-accent: #ffa463; }
html[data-gk-theme="blazing-dark"] {
    --g-bg: #1f1e22; --g-surface: #2a292e; --g-surface-2: #323136; --g-border: #44424a; --g-border-strong: #5a5761;
    --g-text: #f1eff4; --g-muted: #bdb8c6; --g-accent: #d9b3ff; --g-accent-strong: #ead6ff; --g-on-accent: #1a1620;
    --g-glow: rgba(195, 166, 245, .28); --g-grid-line: rgba(195, 166, 245, .045); --g-header-bg: #17161a; --g-header-accent: #c3a6f5;
    --g-error-bg: #2c1619; --g-error-border: #6b2a33; --g-error-text: #ffc6ce;
    --g-info-bg: #1d1c2e; --g-info-border: #45407a; --g-info-text: #d9d3ff;
    --g-ok-bg: #16261d; --g-ok-border: #2d5a40; --g-ok-text: #c4efd3;
    --g-warn-text: #ffd866;
    --g-status-run: #c3a6f5; --g-status-ok: #8fe3b0; --g-status-fail: #ff99a6;
}

html, body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    background: var(--g-bg);
    color: var(--g-text);
}

a { color: var(--g-accent); text-underline-offset: 2px; }
a:hover { color: var(--g-accent-strong); }
:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; }
::selection { background: var(--g-glow); }

h1 { font-size: 1.6rem; margin: 0 0 12px; font-weight: 600; letter-spacing: -.005em; }
h1:focus, h1:focus-visible { outline: none; }
h2 { font-size: 1.05rem; margin: 0 0 10px; font-weight: 600; }

/* A short accent rule under page titles: the one recurring "light edge" outside the header. */
.app-content h1::after {
    content: ""; display: block; width: 36px; height: 2px; margin-top: 8px; background: var(--g-accent);
}
html[data-gk-mode="dark"] .app-content h1::after { box-shadow: 0 0 8px var(--g-glow); }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 300; padding: 10px 14px;
    background: var(--g-surface); color: var(--g-text); border: 2px solid var(--g-accent); border-radius: var(--g-radius);
}
.skip-link:focus { top: 8px; }
.app-content:focus { outline: none; }

/* Header: always dark, edged with a single line of light. */
.app-header {
    display: flex; align-items: center; gap: 12px;
    background: var(--g-header-bg); color: var(--g-header-text); padding: 0 16px; height: var(--g-header-h);
    position: sticky; top: 0; z-index: 100;
}
.app-header::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
    background: linear-gradient(90deg, transparent 0, var(--g-header-accent) 18%, var(--g-header-accent) 82%, transparent 100%);
    opacity: .55; box-shadow: 0 0 10px var(--g-header-accent);
}
.app-header .logo { display: inline-flex; align-items: center; color: #eaf6ff; text-decoration: none; padding: 4px 2px; }
.gnosko-logo { display: block; height: 20px; width: auto; }
.app-header :focus-visible { outline-color: var(--g-header-accent); }
.app-header-spacer { flex: 1; }
.nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -10px;
    background: none; border: 1px solid transparent; border-radius: var(--g-radius); color: var(--g-header-muted); cursor: pointer;
    transition: color .15s, border-color .15s, box-shadow .15s;
}
.nav-toggle:hover { color: var(--g-header-text); border-color: rgba(79, 209, 255, .45); box-shadow: 0 0 10px rgba(79, 209, 255, .18); }
.btn-signin {
    color: var(--g-header-text); border: 1px solid rgba(230, 237, 245, .35); border-radius: var(--g-radius);
    padding: 6px 14px; text-decoration: none; font-size: .92rem;
}
.btn-signin:hover { color: #fff; border-color: var(--g-header-accent); box-shadow: 0 0 10px rgba(79, 209, 255, .25); }

.header-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    background: transparent; color: var(--g-header-muted); border: 1px solid transparent; border-radius: var(--g-radius); cursor: pointer;
    transition: color .15s, border-color .15s, box-shadow .15s;
}
.header-icon-btn:hover, .header-icon-btn[aria-expanded="true"] {
    color: var(--g-header-text); border-color: rgba(79, 209, 255, .45); box-shadow: 0 0 10px rgba(79, 209, 255, .18);
}

/* Body: a fine grid behind the content, fading out down the page. */
.app-body { flex: 1; display: flex; min-height: 0; }
.app-content {
    flex: 1; padding: 22px 26px; min-width: 0; position: relative; overflow-x: clip;
    background-image:
        linear-gradient(var(--g-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--g-grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: -1px -1px;
}
.app-nav { min-height: 100%; }

/* The menu is a DxDrawer filling the body. Desktop (shrink): the panel stays under the header with its own scroll while
   the page scrolls; hidden, it folds away completely. Narrow (overlap): pinned to the viewport over the content, above the DevExpress shading (z-index 100). */
.app-body > .app-drawer { flex: 1 1 auto; min-width: 0; height: auto; align-self: stretch; }
.app-drawer > .dxbl-drawer-panel { background: var(--g-surface); border-right: 1px solid var(--g-border); }
.app-drawer.dxbl-drawer-shrink > .dxbl-drawer-panel {
    position: sticky; top: var(--g-header-h); align-self: flex-start; height: calc(100vh - var(--g-header-h));
}
.app-drawer.dxbl-drawer-overlap > .dxbl-drawer-panel {
    position: fixed; top: var(--g-header-h); bottom: 0; height: auto; z-index: 110; box-shadow: 2px 0 16px rgba(0, 0, 0, .28);
}
.app-drawer > .dxbl-drawer-content { min-width: 0; overflow: visible; display: flex; }
.app-drawer > .dxbl-drawer-content > .app-content { flex: 1; }
.app-footer {
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 12px 26px; color: var(--g-muted); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
    border-top: 1px solid var(--g-border); background: var(--g-surface);
}

.nav-tree { padding: 8px 4px; }
.nav-disabled { opacity: .55; }
.card.nav-disabled { opacity: 1; }
.card.nav-disabled strong { color: var(--g-muted); }

@media (max-width: 900px) {
    .app-content { padding: 16px; }
    .app-footer { padding: 12px 16px; }
}

/* Popovers in the header (user menu, appearance). */
.popover-backdrop { position: fixed; inset: 0; z-index: 150; }
.user-menu, .theme-switcher { position: relative; }
.user-chip { display: flex; align-items: center; gap: 8px; min-height: 44px; background: none; border: 0; color: var(--g-header-text); cursor: pointer; padding: 4px 6px; border-radius: var(--g-radius); }
@media (max-width: 600px) { .user-name { display: none; } }
.avatar {
    width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 600; color: var(--g-header-text);
    background: #13202c; border: 1px solid var(--g-header-accent);
}
.user-dropdown, .theme-panel {
    position: absolute; right: 0; top: calc(100% + 10px); background: var(--g-surface); color: var(--g-text);
    border: 1px solid var(--g-border-strong); border-radius: var(--g-radius); box-shadow: 0 10px 28px rgba(0,0,0,.28); z-index: 200;
}
.user-dropdown { min-width: 240px; padding: 12px 14px; }
.user-dropdown-name { font-weight: 600; }
.user-dropdown-email, .user-dropdown-company { color: var(--g-muted); font-size: .9rem; margin: 2px 0 8px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--g-accent); cursor: pointer; font: inherit; }

.theme-panel { width: 300px; padding: 14px; }
.theme-panel-title { font-weight: 600; margin-bottom: 10px; }
.theme-group-label { color: var(--g-muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; margin: 12px 0 6px; }
.theme-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.theme-option {
    display: flex; flex-direction: column; gap: 6px; align-items: stretch; padding: 6px; margin: 0;
    background: none; border: 1px solid transparent; border-radius: var(--g-radius); color: var(--g-text); cursor: pointer; font: inherit; text-align: left;
}
.theme-option:hover { border-color: var(--g-border-strong); }
.theme-option.active { border-color: var(--g-accent); box-shadow: 0 0 0 1px var(--g-accent), 0 0 10px var(--g-glow); }
.theme-preview {
    display: block; position: relative; height: 34px; border-radius: 3px; overflow: hidden;
    background: var(--sw-bg); border: 1px solid rgba(127, 127, 127, .35);
}
.featured .theme-preview { height: 54px; }
.theme-preview > span {
    position: absolute; left: 18%; right: 10%; top: 26%; bottom: 0; background: var(--sw-surface);
    border-top: 2px solid var(--sw-accent); border-radius: 2px 2px 0 0;
}
.theme-name { font-size: .82rem; line-height: 1.2; white-space: nowrap; }
.featured .theme-name { font-size: .86rem; }

/* Generic blocks */
.page-header { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.as-at, .muted { color: var(--g-muted); font-size: .9rem; }
.page-message { padding: 32px 0; color: var(--g-muted); }
.prose { max-width: 760px; line-height: 1.6; }
.alert { padding: 12px 16px; border-radius: var(--g-radius); margin: 12px 0; }
.alert-error { background: var(--g-error-bg); border: 1px solid var(--g-error-border); color: var(--g-error-text); }
.alert-info { background: var(--g-info-bg); border: 1px solid var(--g-info-border); color: var(--g-info-text); }
.alert-ok { background: var(--g-ok-bg); border: 1px solid var(--g-ok-border); color: var(--g-ok-text); }

/* Panels: flat surfaces with a light corner bracket, top-left, in the accent colour. */
.card, .kpi-tile, .feature, .contact-card, .param-panel {
    position: relative; background: var(--g-surface); border: 1px solid var(--g-border); border-radius: var(--g-radius);
}
.card::before, .kpi-tile::before, .feature::before, .contact-card::before, .param-panel::before {
    content: ""; position: absolute; top: -1px; left: -1px; width: 14px; height: 14px; pointer-events: none;
    border-top: 2px solid var(--g-accent); border-left: 2px solid var(--g-accent); border-top-left-radius: var(--g-radius);
}

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--g-gap); margin-bottom: var(--g-gap); }
.card { padding: 16px; min-width: 0; }
.card.wide { grid-column: span 2; }
@media (max-width: 900px) { .card.wide { grid-column: span 1; } }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--g-gap); margin-bottom: var(--g-gap); }
.kpi-tile { padding: 14px 16px 16px; overflow: hidden; }
.kpi-tile::after {
    content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 2px; pointer-events: none;
    background: linear-gradient(90deg, var(--g-accent), transparent); opacity: .7;
}
.kpi-value { font-size: 1.8rem; line-height: 1.15; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
@media (max-width: 600px) { .kpi-row { gap: 10px; } .kpi-value { font-size: 1.35rem; white-space: nowrap; } }
.kpi-caption { color: var(--g-muted); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }

.highlight-title { font-size: 1.2rem; font-weight: 600; }
.highlight-detail { color: var(--g-muted); }
.highlight-stats { margin-top: 6px; }

.simple-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.simple-table th, .simple-table td { padding: 6px 8px; border-bottom: 1px solid var(--g-border); text-align: left; }
.simple-table th { color: var(--g-muted); font-weight: 600; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.simple-table .num { text-align: right; }

.chart-tooltip { padding: 4px 8px; }
.card > a { text-decoration: none; }
.card > a:hover, .card > a:focus-visible { text-decoration: underline; }
.dxbl-chart-root .dxc-val-grid path, .dxbl-chart-root .dxc-arg-grid path { stroke: var(--g-border-strong); }

/* Landing: the only place with a horizon grid, kept faint and static. */
.landing-hero { position: relative; isolation: isolate; padding: 56px 0 40px; max-width: 820px; }
.landing-hero::before {
    content: ""; position: absolute; z-index: -1; left: -26px; right: 0; bottom: -10px; height: 220px; pointer-events: none;
    background-image:
        linear-gradient(var(--g-horizon-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--g-horizon-line) 1px, transparent 1px);
    background-size: 48px 48px;
    transform: perspective(420px) rotateX(58deg); transform-origin: bottom;
    -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%);
    mask-image: linear-gradient(to top, #000 10%, transparent 90%);
}
.landing-hero { --g-horizon-line: rgba(11, 83, 148, .16); }
html[data-gk-mode="dark"] .landing-hero { --g-horizon-line: rgba(79, 209, 255, .2); }
.landing-hero h1 { font-size: 2.4rem; line-height: 1.15; }
.landing-hero h1::after { width: 56px; margin-top: 14px; }
.lead { font-size: 1.15rem; color: var(--g-muted); line-height: 1.55; max-width: 62ch; }
.landing-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.btn-primary, .btn-secondary {
    padding: 10px 20px; border-radius: var(--g-radius); text-decoration: none; font-weight: 600;
    transition: box-shadow .15s, background-color .15s, border-color .15s;
}
.btn-primary { background: var(--g-accent); color: var(--g-on-accent); border: 1px solid var(--g-accent); }
.btn-primary:hover { background: var(--g-accent-strong); color: var(--g-on-accent); box-shadow: 0 0 14px var(--g-glow); }
.btn-secondary { border: 1px solid var(--g-border-control); color: var(--g-text); background: var(--g-surface); }
.btn-secondary:hover { color: var(--g-text); border-color: var(--g-accent); }
.landing-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--g-gap); }
.feature, .contact-card { padding: 18px; }
.feature p { color: var(--g-muted); margin-bottom: 0; line-height: 1.5; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--g-gap); }

/* Report page */
.report-layout { display: grid; grid-template-columns: 340px 1fr; gap: var(--g-gap); align-items: start; }
@media (max-width: 1100px) { .report-layout { grid-template-columns: 1fr; } }
.param-panel { padding: 14px; }
.param-row { margin-bottom: 12px; }
.param-row label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.param-help { color: var(--g-muted); font-size: .8rem; margin-top: 2px; }
.param-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.report-output { min-width: 0; }
.view-block { margin-bottom: var(--g-gap); }
.drill-link { cursor: pointer; color: var(--g-accent); text-decoration: underline; }

/* After a run the parameters fold into a summary bar (sticky under the header) and the report takes the full width;
   Edit slides the same panel in from the left over the report, so nothing is reloaded and the results stay. */
.report-layout.is-collapsed { grid-template-columns: minmax(0, 1fr); }
.param-sheet {
    position: fixed; top: var(--g-header-h); left: 0; bottom: 0; width: min(400px, 92vw); z-index: 95;
    overflow-y: auto; overscroll-behavior: contain; padding: 14px; background: var(--g-bg);
    border-right: 1px solid var(--g-border-strong); box-shadow: 8px 0 28px rgba(0, 0, 0, .28);
    transform: translateX(-104%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s;
}
.param-sheet.is-open { transform: none; visibility: visible; transition: transform .2s ease; }
.param-sheet-backdrop { position: fixed; inset: var(--g-header-h) 0 0 0; z-index: 94; background: rgba(4, 10, 18, .4); }
.param-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.param-sheet-head h2 { margin: 0; }
.param-summary {
    position: sticky; top: var(--g-header-h); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    padding: 8px 10px 8px 12px; margin-bottom: 12px; background: var(--g-surface);
    border: 1px solid var(--g-border); border-left: 3px solid var(--g-accent); border-radius: var(--g-radius);
}
.param-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; flex: 1 1 320px; min-width: 0; }
.param-chips li {
    display: inline-flex; align-items: baseline; gap: 6px; max-width: 40ch; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    padding: 3px 10px; border-radius: 999px; background: var(--g-surface-2); border: 1px solid var(--g-border); font-size: .85rem;
}
.param-chip-label { color: var(--g-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.param-dirty { color: var(--g-warn-text); font-size: .82rem; font-weight: 600; }
.param-summary-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.preset-list { list-style: none; margin: 0; padding: 0; }
.preset-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--g-border); }

/* Large grids fill the window below the toolbar and scroll inside; small ones size to their rows. */
.grid-fill { height: max(420px, calc(100vh - var(--g-header-h) - 200px)); height: max(420px, calc(100dvh - var(--g-header-h) - 200px)); }
.pivot-scroll { overflow: auto; max-height: max(420px, calc(100dvh - var(--g-header-h) - 200px)); }
.density-switch { white-space: nowrap; }
/* Compact rows: DevExpress small size plus tighter cells and pills (about 37% shorter rows than the default). */
.dxbl-grid.grid-compact { --dxbl-grid-text-cell-padding-y: 2px; }
.grid-compact .tone-badge { line-height: 1.25; padding: 0 8px; font-size: .72rem; }

/* One table or chart over the whole window (Esc or the button returns). */
.view-block:focus { outline: none; }
.view-block.view-max {
    position: fixed; inset: 0; z-index: 120; margin: 0; border-radius: 0; border: 0; padding: 12px 16px;
    overflow: auto; background: var(--g-surface);
}
.view-block.view-max::before { display: none; }
.view-max .grid-fill { height: calc(100dvh - 76px); }
.view-max .pivot-scroll { max-height: calc(100dvh - 76px); }
html.gk-view-max { overflow: hidden; }

/* Row tones: a tinted row with an accent edge, the "kind" column as a pill, and a legend with counts above the grid. */
.row-tone-green { --g-tone: var(--g-tone-green); --g-tone-bg: var(--g-tone-green-bg); }
.row-tone-blue { --g-tone: var(--g-tone-blue); --g-tone-bg: var(--g-tone-blue-bg); }
.row-tone-amber { --g-tone: var(--g-tone-amber); --g-tone-bg: var(--g-tone-amber-bg); }
.row-tone-red { --g-tone: var(--g-tone-red); --g-tone-bg: var(--g-tone-red-bg); }
.row-tone-purple { --g-tone: var(--g-tone-purple); --g-tone-bg: var(--g-tone-purple-bg); }
.row-tone-grey { --g-tone: var(--g-tone-grey); --g-tone-bg: var(--g-tone-grey-bg); }
/* Group indent cells stay untinted so the hierarchy reads; the edge sits on the row's first real cell. */
.dxbl-grid tr[class*="row-tone-"] > td:not(.dxbl-grid-indent-cell) { background-color: var(--g-tone-bg); }
.dxbl-grid tr[class*="row-tone-"] > td:first-child:not(.dxbl-grid-indent-cell),
.dxbl-grid tr[class*="row-tone-"] > td.dxbl-grid-indent-cell + td:not(.dxbl-grid-indent-cell) { box-shadow: inset 3px 0 0 var(--g-tone); }
.dxbl-grid tr[class*="row-tone-"]:hover > td { background-image: linear-gradient(var(--g-tone-bg), var(--g-tone-bg)); }
.tone-badge {
    display: inline-block; min-width: 4.5em; padding: 1px 10px; border-radius: 999px; text-align: center;
    font-size: .78rem; font-weight: 600; letter-spacing: .02em; line-height: 1.5;
    background: var(--g-surface-2); color: var(--g-text); border: 1px solid var(--g-border);
}
tr[class*="row-tone-"] .tone-badge { background: var(--g-tone); color: var(--g-on-tone); border-color: var(--g-tone); }
.tone-legend { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: -2px 0 12px; padding: 0; }
.tone-legend li {
    display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 10px; border-radius: 999px;
    background: var(--g-tone-bg); color: var(--g-tone); font-weight: 600; font-size: .85rem; border: 1px solid transparent;
}
html[data-gk-mode="dark"] .tone-legend li { border-color: var(--g-tone-bg); }
.tone-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--g-tone); }
html[data-gk-mode="dark"] .tone-swatch { box-shadow: 0 0 6px var(--g-tone); }
.tone-count { color: var(--g-muted); font-weight: 400; font-variant-numeric: tabular-nums; }

/* Station picker */
.station-picker .filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.station-picker .summary { color: var(--g-muted); font-size: .85rem; margin: 6px 0; }
.station-picker .tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }

.toolbar-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.status-Queued { color: var(--g-warn-text); }
.status-Running { color: var(--g-status-run); }
.status-Succeeded { color: var(--g-status-ok); }
.status-Failed { color: var(--g-status-fail); }

#blazor-error-ui {
    background: #fff4ce; color: #3d2f00; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none;
    left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
