/* The shared tool components (/ici-components.css, a pinned copy of the hub's) draw the shell and controls, and
   ici-look.css (a byte-for-byte copy of the project's unified look, loaded last) sets the type and the eyebrow;
   this sheet only lays out what is specific to ICI Analytics. */

/* Self-hosted (the CSP admits fonts from this origin only); SIL Open Font License, see fonts/OFL-*.txt. */
@font-face { font-family: Jost; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jost-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: Jost; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jost-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: Jost; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/jost-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
:root {
  /* ICI tool tokens (hub /ici-tokens.css, docs/sso/tool-style-guide.md in the hub); the fallbacks keep the page styled without it. */
  --bg: var(--ici-bg, #faf8f3); --panel: var(--ici-surface, #ffffff); --panel-muted: var(--ici-surface-muted, #f1ede3);
  --text: var(--ici-text, #1b2230); --muted: var(--ici-text-muted, #64625d);
  --border: var(--ici-border, #e8e2d4); --border-strong: var(--ici-border-strong, #cbc7bf);
  --accent: var(--ici-primary, #1c3a63); --accent-hover: var(--ici-primary-hover, #12274a); --on-accent: var(--ici-on-primary, #ffffff);
  --accent-soft: var(--ici-primary-soft, rgba(28, 58, 99, .12)); --link: var(--ici-link, #1c3a63);
  --gold: var(--ici-gold, #c3a265); --gold-text: var(--ici-gold-text, #7a5f2a); --focus: var(--ici-focus, #9a7b3f);
  --good: var(--ici-success, #116329); --bad: var(--ici-danger, #b42323); --warn: var(--ici-warning, #7d5400);
  --mono: var(--ici-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  color-scheme: light;
}
/* Without the hub's ici-tokens.css (linked after this sheet when the hub is configured, so its values win),
   the shared components would keep their light fallbacks on a dark page. These are the hub's dark tokens, as fallbacks. */
@media (prefers-color-scheme: dark) {
  :root:not(.light):not([data-theme="light"]) {
    --ici-bg: #10141a; --ici-surface: #171c23; --ici-surface-muted: #1b2129; --ici-text: #e6e9ee; --ici-text-muted: #a9b0ba;
    --ici-border: #2a3039; --ici-border-strong: #343b46; --ici-primary: #dbc392; --ici-primary-hover: #c3a265; --ici-on-primary: #0b1b33;
    --ici-primary-soft: rgba(219, 195, 146, .16); --ici-link: #a9c2e6; --ici-focus: #dbc392; --ici-gold: #c3a265; --ici-gold-text: #dbc392;
    --ici-success: #4ac26b; --ici-success-soft: rgba(74, 194, 107, .16); --ici-danger: #e5747b; --ici-danger-soft: rgba(229, 116, 123, .16);
    --ici-warning: #d29922; --ici-warning-soft: rgba(210, 153, 34, .16); --ici-info: #8fb4f0; --ici-info-soft: rgba(143, 180, 240, .16);
    --ici-shadow-popover: 0 8px 24px rgb(0 0 0 / .4);
  }
}
:root.dark, :root[data-theme="dark"] {
  --ici-bg: #10141a; --ici-surface: #171c23; --ici-surface-muted: #1b2129; --ici-text: #e6e9ee; --ici-text-muted: #a9b0ba;
  --ici-border: #2a3039; --ici-border-strong: #343b46; --ici-primary: #dbc392; --ici-primary-hover: #c3a265; --ici-on-primary: #0b1b33;
  --ici-primary-soft: rgba(219, 195, 146, .16); --ici-link: #a9c2e6; --ici-focus: #dbc392; --ici-gold: #c3a265; --ici-gold-text: #dbc392;
  --ici-success: #4ac26b; --ici-success-soft: rgba(74, 194, 107, .16); --ici-danger: #e5747b; --ici-danger-soft: rgba(229, 116, 123, .16);
  --ici-warning: #d29922; --ici-warning-soft: rgba(210, 153, 34, .16); --ici-info: #8fb4f0; --ici-info-soft: rgba(143, 180, 240, .16);
  --ici-shadow-popover: 0 8px 24px rgb(0 0 0 / .4);
}
@media (prefers-color-scheme: dark) {
  :root:not(.light):not([data-theme="light"]) {
    --bg: var(--ici-bg, #10141a); --panel: var(--ici-surface, #171c23); --panel-muted: var(--ici-surface-muted, #1b2129);
    --text: var(--ici-text, #e6e9ee); --muted: var(--ici-text-muted, #a9b0ba);
    --border: var(--ici-border, #2a3039); --border-strong: var(--ici-border-strong, #343b46);
    --accent: var(--ici-primary, #dbc392); --accent-hover: var(--ici-primary-hover, #c3a265); --on-accent: var(--ici-on-primary, #0b1b33);
    --accent-soft: var(--ici-primary-soft, rgba(219, 195, 146, .16)); --link: var(--ici-link, #a9c2e6);
    --focus: var(--ici-focus, #dbc392); --gold-text: var(--ici-gold-text, #dbc392);
    --good: var(--ici-success, #4ac26b); --bad: var(--ici-danger, #e5747b); --warn: var(--ici-warning, #d29922);
    color-scheme: dark;
  }
}
/* Categorical series colours: the hub's --ici-chart-* tokens in fixed order; text never wears them. */
:root { --s1: var(--ici-chart-1, #1c3a63); --s2: var(--ici-chart-2, oklch(0.65 0.17 55)); --s3: var(--ici-chart-3, oklch(0.58 0.15 150));
  --s4: var(--ici-chart-4, oklch(0.58 0.19 25)); --s5: var(--ici-chart-5, oklch(0.55 0.16 300)); --s6: var(--ici-chart-6, oklch(0.52 0.09 65)); --s-other: var(--border-strong); }
@media (prefers-color-scheme: dark) { :root:not(.light):not([data-theme="light"]) { --s1: var(--ici-chart-1, oklch(0.75 0.12 255)); --s2: var(--ici-chart-2, oklch(0.78 0.14 60));
  --s3: var(--ici-chart-3, oklch(0.76 0.14 150)); --s4: var(--ici-chart-4, oklch(0.74 0.15 25)); --s5: var(--ici-chart-5, oklch(0.75 0.13 300)); --s6: var(--ici-chart-6, oklch(0.72 0.08 65)); } }

a:not(.aic *) { color: var(--link); }
a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hidden:not(.aic *) { display: none !important; }
.note { color: var(--muted); font-size: 12px; }
.error { color: var(--bad); }
.error:empty { display: none; }
.empty { color: var(--muted); padding: 20px 12px; text-align: center; }
li.empty { text-align: left; padding: 10px 12px; }
.ici-card.empty { padding: 16px; }
/* A refetch dims what is there instead of blanking it, so the page never jumps; the first load shows a skeleton. */
[aria-busy="true"] { opacity: .55; transition: opacity 160ms ease 120ms; pointer-events: none; }
.skeleton { display: grid; gap: 10px; padding: 8px 0 4px; }
.skeleton .ici-skeleton--text { height: 14px; margin: 0; }
.kpis .skeleton { padding: 0; }
.ici-error-banner { margin: 4px 0; }
.ici-error-banner .ico { color: var(--bad); margin-top: 2px; }
.ici-toast--danger { border-left-color: var(--bad); }
.ici-toast--danger > .toast-ico { color: var(--bad); }
.ici-toast > .toast-ico { color: var(--good); flex: none; margin-top: 2px; }
.ici-toast .ici-toast-close .ico { color: inherit; width: 14px; height: 14px; }
.ici-toast .ici-toast-description { color: var(--text); font-size: 13px; flex: 1; }
.key, code:not(.aic *) { font-family: var(--mono); font-size: 12px; word-break: break-all; }
html[data-ici-hub-account] .ici-own-account { display: none; }
#whoami { color: var(--muted); font-size: 12px; }
/* Text-like buttons the shared classes don't cover: inline links and sortable table headers. */
button.link, th button.sort { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
button.link { color: var(--link); text-decoration: underline; }
th button.sort { color: inherit; font-weight: 600; font-size: 12px; }
th button.sort[aria-sort]::after { content: " ↓"; } th button.sort[aria-sort="ascending"]::after { content: " ↑"; }

/* Shell: the hub header, then the tool sidebar beside the toolbar (title and report tabs), filters and segment, which stick on top. */
#nav { position: sticky; top: 0; height: 100vh; }
.ico { width: 16px; height: 16px; flex: none; color: var(--muted); }
.ici-sidebar-item[aria-current="page"] .ico { color: var(--accent); }
/* More actions menu (the toolbar's overflow): a flat popover of 32px items. */
.more-wrap { position: relative; display: inline-flex; }
.more-menu { display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 5; flex-direction: column; min-width: 160px; padding: 4px;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--ici-shadow-popover, 0 8px 24px rgb(11 27 51 / .16)); }
.more-menu.open { display: flex; }
.more-menu button { display: flex; align-items: center; justify-content: flex-start; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.more-menu button:hover, .more-menu button:focus-visible { background: var(--accent-soft); }
.filters .dates { display: inline-flex; align-items: center; gap: 6px; }
/* Filters menu: the bots and staff switches, with a count of the ones that differ from the default. */
.pop-wrap { position: relative; display: inline-flex; }
#filters-open .ici-badge, .filters-bar .ici-badge { margin-left: 4px; }
#filters-pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 5; flex-direction: column; gap: 8px; min-width: 190px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--ici-shadow-popover, 0 8px 24px rgb(11 27 51 / .16)); }
#filters-pop.open { display: flex; }
#filters-pop label { color: var(--text); font-size: 13px; white-space: nowrap; }
.filters .dates .ici-input { width: auto; }
.range-note { white-space: nowrap; }
.top { position: sticky; top: 0; z-index: 3; }
.ici-toolbar { flex-wrap: wrap; }
.ici-toolbar-actions { flex-wrap: wrap; }
.ici-toolbar-actions .ici-select { max-width: 220px; }
#crumb:has(li:empty), .ici-toolbar-tabs:empty { display: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 24px; background: var(--panel); border-bottom: 1px solid var(--border); }
.filters.locked > :not(#site):not(#live-note) { opacity: .45; pointer-events: none; }
.filters.locked #range-note { display: none; }
.seg-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 24px; background: var(--panel-muted); border-bottom: 1px solid var(--border); }
#segment { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 24px; border-bottom: 1px solid var(--border); background: var(--panel); }
#segment .chip { color: var(--accent); font-size: 12px; max-width: 100%; }
#segment .chip b { font-weight: 600; } #segment .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
#tool { display: grid; gap: 16px; align-content: start; }
#tool:focus { outline: none; }
.panel-form { margin: 16px 24px 0; }


/* Sign-in: the shared loading screen (ici-splash.css, a byte-for-byte copy from ici-kit) with the sign-in in place of
   its status line. With hub sign-in on, the token is the fallback, so its button drops to the quiet one. */
.ici-splash .ici-splash-form #token-intro { margin: 0; text-align: center; }
#sso:not(.hidden) + .ici-splash-form #save-token { background: transparent; color: var(--ici-splash-gold); }

/* Controls sit in rows here (filters, card titles, forms), so the shared fields size to their content. */
.ici-input, .ici-select { display: inline-block; width: auto; }
.ici-segmented { max-width: 100%; overflow-x: auto; }
.ici-card { min-width: 0; }
h2.ici-card-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.ici-card-title .note, .ici-card-title .tools { text-transform: none; letter-spacing: 0; font-weight: 400; }
.ici-card-title .ici-select, .ici-card-title .ici-input { height: 28px; font-size: 12px; }
h2 .tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
h3:not(.aic *) { font-size: 13px; margin: 0 0 6px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.lede { color: var(--muted); margin: 0 0 4px; max-width: 80ch; }
.toolbar-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.toolbar-row .grow { flex: 1; }
.toolbar-row label { display: inline-flex; gap: 6px; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 8px; margin-top: 10px; align-items: center; }
.form-grid .ici-input, .form-grid .ici-select { width: 100%; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-grid .field { display: flex; flex-direction: column; gap: 4px; align-self: start; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding: 12px; background: var(--panel-muted); border-radius: 8px; }
.inline-form input[type=text], .inline-form input:not([type]) { flex: 1 1 200px; }
.inline-form p { flex-basis: 100%; margin: 0; }
details:not(.aic *) summary { cursor: pointer; margin-top: 12px; color: var(--muted); }
pre.snippet { background: var(--panel-muted); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; word-break: break-all; font-size: 12px; margin: 6px 0 0; }
.chips { display: contents; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 2px 2px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--text); font-size: 13px; }
.chip .ici-btn { width: 20px; height: 20px; color: inherit; font-size: 15px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
/* Home: a row of what moved (with trends) over a row of how good it was, instead of eight tiles wrapping at random. */
@media (min-width: 768px) { .tool-home .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi .ici-stat { margin-top: 2px; font-variant-numeric: normal; }
.kpi .ici-stat small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.kpi .spark { display: block; width: 100%; height: 28px; margin-top: 6px; }
.kpi .spark polyline { fill: none; stroke: var(--s1); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.kpi .spark path { fill: var(--s1); opacity: .1; }
.kpi .delta { font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; min-height: 1.45em; }
.kpi .delta.better { color: var(--good); } .kpi .delta.worse { color: var(--bad); }
button.kpi.pick { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.kpi.pick:hover { border-color: var(--border-strong); }
.kpi.pick[aria-pressed="true"] { box-shadow: inset 0 3px 0 var(--gold); border-color: var(--border-strong); }
.kpi.pick:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.kpi.live .ici-stat::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 8px; vertical-align: middle; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .kpi.live .ici-stat::before { animation: none; } }

/* Tables: wide ones scroll inside their card on phones instead of widening the page. */
.table-wrap { overflow-x: auto; }
.ici-table { font-variant-numeric: tabular-nums; }
.ici-table td { vertical-align: top; }
td.label { overflow-wrap: anywhere; position: relative; }
td.label .bar { position: absolute; inset: 3px auto 3px 0; background: color-mix(in srgb, var(--s1) 14%, transparent); border-radius: 4px; z-index: 0; }
td.label span { position: relative; z-index: 1; padding-left: 4px; }
td.label[data-seg] { cursor: pointer; } td.label[data-seg]:hover > .cell > span:first-child { text-decoration: underline; }
/* Row actions: two small buttons at the right end of a table's first cell, after the label (which truncates with an ellipsis), shown while the row is hovered or holds focus (always on touch screens). */
td.label .cell { display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
td.label .cell > span:first-child { flex: 0 1 auto; min-width: 0; max-width: min(44ch, 62vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.label .row-actions { flex: none; margin-left: auto; padding: 0; display: inline-flex; gap: 4px; opacity: 0; transition: opacity 120ms; }
tr:hover > td.label .row-actions, tr:focus-within > td.label .row-actions, td.label:focus-within .row-actions { opacity: 1; }
td.label .row-actions .ici-btn { height: 22px; min-height: 0; padding: 0 8px; font-size: 11px; font-weight: 500; white-space: nowrap; background: var(--panel); border: 1px solid var(--border-strong); }
td.label .row-actions .ici-btn:hover { background: var(--panel-muted); }
@media (hover: none) { td.label .row-actions { opacity: 1; } }
tr.clickable { cursor: pointer; }
tr.current td { font-weight: 600; }
tr.totals td { font-weight: 600; border-bottom: 2px solid var(--border-strong); }
td i.sw { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; position: relative; z-index: 1; }
.delta-t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta-t.better { color: var(--good); } .delta-t.worse { color: var(--bad); }
td .delta-t { display: block; }
td.cell { text-align: center; font-variant-numeric: tabular-nums; }

/* Charts */
svg:not(.aic *) text { fill: var(--muted); font-size: 12px; }
.chart { width: 100%; height: 260px; display: block; }
.chart.short { height: 180px; }
.chart .grid line { stroke: var(--border); }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; }
.chart .series.prior { stroke-dasharray: 4 3; stroke-width: 1.5; }
.chart .area { opacity: .12; }
.chart circle { stroke: var(--panel); stroke-width: 1.5; }
.chart .note-line { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .note-dot { fill: var(--gold); }
.chart .note-deploy .note-line, .chart .note-deploy .note-dot { stroke: var(--s3); fill: var(--s3); }
.chart .note-deploy .note-line { fill: none; } .chart .note-deploy .note-dot { stroke: none; }
.chart .note-env .note-line, .chart .note-env .note-dot { stroke: var(--s5); fill: var(--s5); } .chart .note-env .note-line { fill: none; } .chart .note-env .note-dot { stroke: none; }
.chart .note-alert .note-line { stroke: var(--warn); } .chart .note-alert .note-dot { fill: var(--warn); }
.chart .note-error .note-line { stroke: var(--bad); } .chart .note-error .note-dot { fill: var(--bad); }
.chart .hover-dot { stroke: var(--panel); stroke-width: 2; }
.chart .anomaly { fill: none; stroke: var(--bad); stroke-width: 2; }
.chart .hover-line { stroke: var(--border-strong); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 2px; width: 14px; border-radius: 0; vertical-align: middle; }
.legend i.dash { height: 0; width: 14px; border-top: 2px dashed var(--muted); background: none !important; vertical-align: middle; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: 13px; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .val { font-variant-numeric: tabular-nums; text-align: right; }
.bar-row .track { grid-column: 1 / -1; height: 8px; background: var(--panel-muted); border-radius: 4px; overflow: hidden; }
.bar-row .track div { height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.pie { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.pie svg { width: 160px; height: 160px; flex: none; }
.pie .legend { flex-direction: column; flex: 1 1 160px; font-size: 13px; color: var(--text); }
.pie .legend span { display: flex; justify-content: space-between; gap: 12px; }
.pie .legend .pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.viz-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.viz-kpis .label { color: var(--muted); font-size: 12px; }
.stack { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--panel-muted); margin-top: 6px; }
.stack div { height: 100%; }
.stack .good { background: var(--good); } .stack .warn { background: var(--warn); } .stack .bad { background: var(--bad); }
.heat td.cell { font-size: 11px; padding: 6px 4px; min-width: 30px; }
.heat th { text-align: center; padding: 6px 4px; }
/* Map tool and Realtime's live map: shaded places, city dots and a sequential legend. */
.map, .map-legend { --map-land: color-mix(in srgb, var(--text) 9%, var(--panel)); }
.map { width: 100%; display: block; }
.map .places path { stroke: var(--panel); stroke-width: .6; stroke-linejoin: round; }
.map .places path.pick { cursor: pointer; }
.map .places path.pick:hover, .map .places path.pick:focus-visible { stroke: var(--text); stroke-width: 1.2; outline: none; }
.map .dots circle { fill: var(--s2); fill-opacity: .7; stroke: var(--panel); stroke-width: 1; }
.map .dots circle.pick { cursor: pointer; }
.map .dots circle.pick:hover, .map .dots circle.pick:focus-visible { fill-opacity: 1; stroke: var(--text); outline: none; }
.map-legend { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.map-legend i { width: 140px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--s1) 12%, var(--map-land)), var(--s1)); }
/* Office TV: the wall, which fills the screen (and grows its numbers) in full-screen mode. */
.tv-wall { display: grid; gap: 16px; }
.tv-head { display: flex; align-items: baseline; gap: 12px; }
.tv-head h2 { margin: 0; }
.tv-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tv-main { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.tv-wall:fullscreen { background: var(--bg); padding: 32px; overflow: auto; align-content: start; }
.tv-wall:fullscreen .tv-head h2 { font-size: 32px; }
.tv-wall:fullscreen .kpi .value { font-size: 56px; }
.tv-wall:fullscreen .kpi .label { font-size: 16px; }
/* Behavior > Heatmaps: the framed page under the click canvas, with scroll depth beside it. */
.heat-wrap { display: flex; gap: 12px; align-items: flex-start; overflow: hidden; }
.heat-stage { position: relative; flex: none; overflow: hidden; border: 1px solid var(--border); background: var(--panel-muted); }
.heat-stage iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.heat-stage canvas { position: absolute; left: 0; top: 0; }
.heat-scroll { width: 56px; flex: none; display: flex; flex-direction: column; border: 1px solid var(--border); }
.heat-scroll div { display: flex; align-items: flex-start; justify-content: center; font-size: 11px; color: var(--text); border-bottom: 1px solid var(--panel); }
.heat-scroll span { background: var(--panel); border-radius: 4px; padding: 0 3px; margin-top: 2px; }
select.heat-page { max-width: 360px; }
.chart-tip { position: fixed; pointer-events: none; z-index: 10; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 9px; font-size: 12px; box-shadow: var(--ici-shadow-popover, 0 8px 24px rgb(11 27 51 / .16)); max-width: 320px; }
.chart-tip b { display: block; margin-bottom: 2px; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 4px; margin-right: 6px; }
.chart-tip i.line { width: 12px; height: 2px; border-radius: 0; vertical-align: middle; }
.chart-tip i.dash { width: 12px; height: 0; border-top: 2px dashed var(--muted); background: none !important; vertical-align: middle; }
.chart-tip strong { font-variant-numeric: tabular-nums; }

/* Funnel */
.funnel-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(110px, 1fr); gap: 8px; align-items: end; overflow-x: auto; padding-bottom: 4px; }
.funnel-step { display: grid; gap: 6px; }
.funnel-step .col { height: 200px; display: flex; flex-direction: column; justify-content: flex-end; background: var(--panel-muted); border-radius: 6px; overflow: hidden; }
.funnel-step .col .fill { background: var(--s1); }
.funnel-step .col .drop { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bad) 22%, transparent) 0 6px, transparent 6px 12px); }
.funnel-step .name { font-size: 12px; font-weight: 600; word-break: break-all; }
.funnel-step .num { font-variant-numeric: tabular-nums; font-size: 13px; }
.step-builder { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.step-builder .step { display: flex; gap: 4px; align-items: center; }
.step-builder .step b { color: var(--muted); font-size: 12px; }
.step-builder .step input { width: 190px; }

/* Paths (sankey) */
.sankey { width: 100%; display: block; }
.sankey .node rect { fill: var(--s1); }
.sankey .node.exit rect { fill: var(--s-other); }
.sankey .node.clickable { cursor: pointer; }
.sankey .node text { fill: var(--text); font-size: 12px; }
.sankey .node text.n { fill: var(--muted); font-size: 11px; }
.sankey .link { fill: none; stroke: var(--s1); stroke-opacity: .18; }
.sankey .link:hover { stroke-opacity: .4; }

/* Explore builder */
.ex-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ex-row > b { width: 104px; font-size: 11px; line-height: 16px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .22em; }
.chips { display: contents; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--text); font-size: 13px; }
.chip button { border: 0; background: none; color: var(--muted); padding: 0 6px; min-height: 0; font-size: 15px; line-height: 1; }
.ex-filters { display: contents; }
.ex-filter { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; padding: 3px; border: 1px dashed var(--border-strong); border-radius: 8px; }
.ex-filter input { width: 170px; }
.ex-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 12px; }
.ex-viz:not(:empty) { margin-bottom: 16px; }

/* Dashboards */
.dash-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dash-bar .inline-form { flex-basis: 100%; }
.dash-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.dash-grid .widget { grid-column: span 3; }
.dash-grid .widget.small { grid-column: span 2; } .dash-grid .widget.full { grid-column: span 6; }
.widget .body { max-height: 420px; overflow: auto; }

/* Insights */
.insights { display: grid; gap: 10px; }
.insight { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.insight .mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.insight .mark.up { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.insight .mark.down { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.insight .mark.info { background: var(--accent-soft); color: var(--accent); }
.insight p { margin: 0; }
.insight .why { color: var(--muted); font-size: 12px; grid-column: 2; }

/* Live */
.live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.live-bars rect { fill: var(--s1); }

/* Goals, sites, notes admin */
.row-list > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.notes { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 8px; font-size: 13px; }
.notes .n b { color: var(--text); font-weight: 600; margin-right: 4px; }
.notes .n::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-right: 6px; vertical-align: 0; }
.notes .n.deploy::before { background: var(--s3); } .notes .n.error::before { background: var(--bad); }
.notes .n.env::before { background: var(--s5); } .notes .n.alert::before { background: var(--warn); }

/* Jump to (Ctrl/Cmd+K): a search over tools, reports, dashboards and sites. */
#jump { position: fixed; inset: 0; background: rgb(11 27 51 / .5); z-index: 7; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.jump-panel { width: min(560px, 100%); background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--ici-shadow-popover, 0 8px 24px rgb(11 27 51 / .16)); overflow: hidden; }
.jump-search { padding: 8px; border-bottom: 1px solid var(--border); }
.jump-search .ici-input { width: 100%; height: 40px; font-size: 15px; border: 0; box-shadow: none; }
.jump-search .ici-input:focus-visible { outline: none; }
#jump-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
#jump-list li[role="option"] { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
#jump-list li[aria-selected="true"] { background: var(--accent-soft); }
#jump-list li[aria-selected="true"] .ico { color: var(--accent); }
#jump-list .jump-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#jump-list .jump-kind { color: var(--muted); font-size: 12px; white-space: nowrap; }
.jump-help { margin: 0; padding: 6px 12px 10px; border-top: 1px solid var(--border); }
.jump-help kbd { font: 600 11px/1 var(--mono); border: 1px solid var(--border); border-radius: 4px; padding: 2px 4px; margin-right: 2px; }

/* Drawer (person / visitor journey) */
#drawer { position: fixed; inset: 0; background: rgb(11 27 51 / .5); display: flex; justify-content: flex-end; z-index: 6; }
#drawer .panel { background: var(--panel); width: min(720px, 100%); height: 100%; overflow-y: auto; padding: 16px 24px; border-left: 1px solid var(--border); box-shadow: var(--ici-shadow-popover, 0 8px 24px rgb(11 27 51 / .16)); }
#drawer .panel > h2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.timeline { display: grid; gap: 0; }
.timeline .sess { border-left: 2px solid var(--border-strong); padding: 4px 0 12px 14px; position: relative; }
.timeline .sess::before { content: ""; position: absolute; left: -6px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.timeline .sess h3 { margin: 0 0 4px; }

/* Archie: the hub's dock draws itself (inside .aic), and this page's element rules above keep out of it.
   The dock's stylesheet has no reset, because every other ICI tool has Tailwind's. This is that reset for the dock
   only, in the base layer, so the dock's own utilities still win, as they do on the hub and in Punchlist. */
@layer base {
  .aic, .aic *, .aic ::before, .aic ::after, .aic ::backdrop, .aic ::file-selector-button { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
  .aic { line-height: 1.5; tab-size: 4; -webkit-tap-highlight-color: transparent; }
  .aic hr { height: 0; color: inherit; border-top-width: 1px; }
  .aic h1, .aic h2, .aic h3, .aic h4, .aic h5, .aic h6 { font-size: inherit; font-weight: inherit; }
  .aic a { color: inherit; text-decoration: inherit; }
  .aic b, .aic strong { font-weight: bolder; }
  .aic code, .aic kbd, .aic samp, .aic pre { font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); font-size: 1em; }
  .aic small { font-size: 80%; }
  .aic table { text-indent: 0; border-color: inherit; border-collapse: collapse; }
  .aic summary { display: list-item; }
  .aic ol, .aic ul, .aic menu { list-style: none; }
  .aic img, .aic svg, .aic video, .aic canvas, .aic audio, .aic iframe, .aic embed, .aic object { display: block; vertical-align: middle; }
  .aic img, .aic video { max-width: 100%; height: auto; }
  .aic button, .aic input, .aic select, .aic optgroup, .aic textarea, .aic ::file-selector-button {
    font: inherit; font-feature-settings: inherit; font-variation-settings: inherit; letter-spacing: inherit; color: inherit;
    border-radius: 0; background-color: transparent; opacity: 1; }
  .aic ::placeholder { opacity: 1; color: color-mix(in oklab, currentcolor 50%, transparent); }
  .aic textarea { resize: vertical; }
  .aic button, .aic input:where([type='button'], [type='reset'], [type='submit']) { appearance: button; }
  .aic [hidden]:where(:not([hidden='until-found'])) { display: none !important; }
}
/* The stand-in launcher (sign in again, or open him on the hub). */
.archie-launcher { position: fixed; right: 16px; bottom: 8px; z-index: 50; width: 56px; height: 56px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; background: var(--accent); color: var(--on-accent); font-size: 24px; text-decoration: none;
  box-shadow: var(--ici-shadow-popover, 0 8px 24px rgb(11 27 51 / .16)); }
.archie-launcher:hover { background: var(--accent-hover); }
.summary-text { line-height: 1.6; max-width: 80ch; margin: 0 0 8px; }
.guide { max-width: 80ch; line-height: 1.6; }
.guide h2 { margin: 28px 0 6px; font-size: 16px; font-weight: 600; } .guide h1 { font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.guide code { background: var(--panel-muted); padding: 0 4px; border-radius: 4px; font-size: .9em; }

@media (max-width: 900px) {
  .dash-grid .widget.small { grid-column: span 3; } .dash-grid .widget, .dash-grid .widget.full { grid-column: span 6; }
}
.menu-btn, .filters-bar { display: none; }
.menu-btn .ico, .filters-bar .ico { color: inherit; }
/* Phones: the sidebar is an overlay drawer behind the toolbar's Menu button (it closes on navigation, Esc and a tap
   outside), and the filter row folds behind a single Filters button. */
@media (max-width: 767px) {
  #nav { position: fixed; z-index: 20; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); height: 100%; display: block; padding: 12px 0; overflow-x: hidden; overflow-y: auto;
    border-right: 1px solid var(--border); border-bottom: 0; transform: translateX(-102%); visibility: hidden; transition: transform 180ms ease, visibility 0s linear 180ms; }
  #app.nav-open #nav { transform: none; visibility: visible; box-shadow: var(--ici-shadow-popover, 0 8px 24px rgb(11 27 51 / .16)); transition: transform 180ms ease; }
  #nav .ici-sidebar-section { display: block; }
  #nav .ici-sidebar-label { display: flex; }
  #nav .ici-sidebar-item { width: 100%; min-height: 40px; padding: 0 40px 0 13px; border-left: 3px solid transparent; border-bottom: 0; white-space: normal; }
  #nav-backdrop { display: none; position: fixed; inset: 0; z-index: 19; background: rgba(0, 0, 0, .35); }
  #app.nav-open #nav-backdrop { display: block; }
  .menu-btn { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0; }
  .ici-toolbar-actions { flex: 1 1 100%; min-width: 0; max-width: 100%; }
  .range-note { white-space: normal; }
  .ici-toolbar-actions .ici-select { max-width: 100%; }
  .filters-bar { display: flex; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--border); }
  .filters-bar .ici-badge, #filters-open .ici-badge { margin-left: 2px; }
  .filters { display: none; }
  .top.filters-expanded .filters { display: flex; }
  .pop-wrap { display: contents; }
  #filters-open { display: none; }
  #filters-pop { display: flex; position: static; flex-direction: row; flex-wrap: wrap; gap: 8px 16px; min-width: 0; padding: 0; border: 0; box-shadow: none; background: none; }
  #nav .ici-brand { display: none; }
  .filters, #segment, .seg-form { padding: 8px 16px; } .panel-form { margin: 16px 16px 0; }
  .nav-pin { opacity: .7; }
}
@media (max-width: 520px) {
  .top { position: static; }
  .grid2, .grid3, .tv-main { grid-template-columns: 1fr; }
  .dash-grid .widget, .dash-grid .widget.small { grid-column: span 6; } .ex-row > b { width: 100%; }
}
.w-num { width: 7em; text-align: right; }
.pace { height: 6px; border-radius: 999px; background: var(--panel-muted); min-width: 80px; overflow: hidden; }
.pace > span { display: block; height: 100%; background: var(--s1); }
.pace.ahead > span { background: var(--good); }
.pace.behind > span { background: var(--bad); }
.notes .n.auto { opacity: .85; font-style: italic; }

/* Sidebar: collapsible groups and a pin on every tool. */
#nav .ici-sidebar-section + .ici-sidebar-section { margin-top: 4px; }
button.nav-group { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 0; border-radius: 0; background: none; cursor: pointer; font-family: inherit; text-align: left; color: var(--muted); }
button.nav-group:hover:not([aria-disabled="true"]) { color: var(--text); }
button.nav-group[aria-disabled="true"] { cursor: default; }
.nav-group .ico { width: 14px; height: 14px; transition: transform 120ms; }
.nav-group[aria-expanded="false"] .ico { transform: rotate(-90deg); }
.nav-row { position: relative; }
.nav-row .ici-sidebar-item { padding-right: 40px; }
.nav-pin { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--muted); cursor: pointer; opacity: 0; }
.nav-row:hover .nav-pin, .nav-pin:focus-visible, .nav-pin[aria-pressed="true"] { opacity: 1; }
.nav-pin:hover { background: var(--ici-c-hover, rgb(0 0 0 / .06)); color: var(--text); }
.nav-pin[aria-pressed="true"] { color: var(--gold-text); }
.nav-pin[aria-pressed="true"] .ico { fill: currentColor; }
.nav-pin .ico { width: 14px; height: 14px; color: inherit; }
.nav-pin:focus-visible, button.nav-group:focus-visible, .menu-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (hover: none) { .nav-pin { opacity: .7; } }

/* Confirm dialog (ICI.confirm): the same scrim as Jump to and the drawer, a flat panel, the verb on the button. */
#confirm { position: fixed; inset: 0; z-index: 30; display: flex; justify-content: center; align-items: center; padding: 16px; background: rgba(0, 0, 0, .35); }
.confirm-panel { width: min(440px, 100%); padding: 20px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--ici-shadow-popover, 0 8px 24px rgb(11 27 51 / .16)); }
.confirm-panel:focus { outline: none; }
.confirm-title { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.confirm-desc { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* Print: the report alone, every card whole. */
@media print {
  #nav, #nav-backdrop, #confirm, .top, .ici-toolbar-actions, .ici-toolbar-utilities, #toasts, #jump, #drawer, .archie-launcher, ici-ai-chat, .csv, button:not(.kpi), summary, .lede { display: none !important; }
  .ici-content { max-width: none; padding: 0; }
  .ici-card { break-inside: avoid; border-color: #ccc; }
  body { background: #fff; color: #000; }
}

/* community */
.ici-card-title .community-name { font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: 0; text-transform: none; }
.tool-community .card > .tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* home + compare */
.compare-pick { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.compare-pick .ici-select { width: auto; }
.sect-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: -6px; }
.tool-home .kpis.leads { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
button.kpi.lead, a.kpi.lead { display: flex; flex-direction: column; justify-content: flex-start; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.kpi.pick { display: flex; flex-direction: column; justify-content: flex-start; }
.kpi.lead:hover { border-color: var(--gold); }
.kpi.lead:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.warn-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 14px; font-size: 13px; color: var(--text);
  background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--warn) 55%, var(--border)); border-radius: 8px; }
.warn-banner .ico { color: var(--warn); flex: none; }
.warn-banner a { margin-left: auto; font-weight: 500; }
.coverage { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.coverage .pill { text-decoration: none; }
@media (max-width: 767px) { .compare-pick { white-space: normal; flex-wrap: wrap; } }
/* builders */
.sg-list { position: fixed; z-index: 60; max-height: 260px; overflow-y: auto; padding: 4px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--ici-shadow-popover, 0 8px 24px rgb(0 0 0 / .16)); }
.sg-list[hidden] { display: none; }
.sg-opt { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 6px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.sg-opt.sg-active { background: var(--accent-soft); }
.sg-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-n { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tpl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.tpl-row button { padding: 3px 10px; font-size: 13px; }
.step-builder .step .link { font-size: 12px; white-space: nowrap; }
.insight .insight-notes, .insight .insight-why { grid-column: 2; margin: 0; }
.insight-why { display: grid; gap: 10px; padding-top: 6px; }
.insight-why h3 { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none; }
.insight-why.hidden { display: none; }
