/* AI Insights — one stylesheet, two themes. Colours are tokens on :root; the
   charts read the same tokens (app.js), so a theme switch repaints both.
   Values come from the Finout app: finout-application packages/ui/tailwind.css
   (brand #1570EF, neutrals, semantic colours; dark = its html.dark block). */

:root {
  --bg: #f3f5f8;
  --bg-glow: none;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --border: #eaecf0;
  --text: #101828;
  --text-2: #475467;
  --muted: #667085;
  --accent: #1570ef;
  --accent-2: #53b1fd;
  --good: #027a48; --good-bg: #ecfdf3;
  --bad: #d92d20; --bad-bg: #fef3f2;
  --warn: #dc6803; --warn-bg: #fffaeb;
  --info: #1570ef; --info-bg: #eff8ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --grid: #e6e6e6;
  --c1: #1570ef; --c2: #12b76a; --c3: #fdb022; --c4: #f04438; --c5: #53b1fd; --c6: #7f56d9; --c7: #6ce9a6; --c8: #f79009;
  --radius: 12px;
  --font: "Helvetica Neue", Inter, Arial, ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1b2e;
    --bg-glow: none;
    --surface: #0f1e33;
    --surface-2: #192b3e;
    --border: #1e2f41;
    --text: #f9fafb;
    --text-2: #8094ae;
    --muted: #6b8fae;
    --accent: #2e90fa;
    --accent-2: #53b1fd;
    --good: #6ce9a6; --good-bg: #062917;
    --bad: #f87979; --bad-bg: #2a0d0a;
    --warn: #fdb022; --warn-bg: #241507;
    --info: #53b1fd; --info-bg: #0c2441;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --grid: #2a3e55;
    --c1: #2e90fa; --c2: #12b76a; --c3: #fdb022; --c4: #f87979; --c5: #53b1fd; --c6: #a683ff; --c7: #6ce9a6; --c8: #f79009;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1b2e;
  --bg-glow: none;
  --surface: #0f1e33;
  --surface-2: #192b3e;
  --border: #1e2f41;
  --text: #f9fafb;
  --text-2: #8094ae;
  --muted: #6b8fae;
  --accent: #2e90fa;
  --accent-2: #53b1fd;
  --good: #6ce9a6; --good-bg: #062917;
  --bad: #f87979; --bad-bg: #2a0d0a;
  --warn: #fdb022; --warn-bg: #241507;
  --info: #53b1fd; --info-bg: #0c2441;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --grid: #2a3e55;
  --c1: #2e90fa; --c2: #12b76a; --c3: #fdb022; --c4: #f87979; --c5: #53b1fd; --c6: #a683ff; --c7: #6ce9a6; --c8: #f79009;
  color-scheme: dark;
}

* { box-sizing: border-box; }
button, select, input { font: inherit; }
html, body { margin: 0; }
html { scrollbar-gutter: stable; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg-glow), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum";
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); font-size: 12.5px; }

/* ── banner ─────────────────────────────────────────────────────────────── */
.banner {
  padding: 9px 24px;
  font-size: 13px;
  color: #3d2a00;
  background: repeating-linear-gradient(-45deg, #fde68a, #fde68a 14px, #fcd34d 14px, #fcd34d 28px);
  text-align: center;
}
.banner code { background: rgba(255, 255, 255, 0.5); padding: 1px 5px; border-radius: 5px; }

/* ── top bar ────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -1px; line-height: 32px; }
.brand .sub { margin: 1px 0 0; color: var(--muted); font-size: 12px; }
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.select select {
  appearance: none;
  font: inherit; color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' stroke='%237c859b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") right 10px center no-repeat;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 32px 8px 12px; min-width: 210px; max-width: 70vw;
  box-shadow: var(--shadow); cursor: pointer;
}
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.segmented button {
  font: inherit; font-size: 13px; color: var(--text-2); background: transparent; border: 0;
  padding: 5px 11px; border-radius: 7px; cursor: pointer;
}
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow);
  display: grid; place-items: center;
}
.icon-btn svg { width: 17px; height: 17px; }

/* ── layout ─────────────────────────────────────────────────────────────── */
main { max-width: 1440px; margin: 0 auto; padding: 22px 28px 40px; }
.scope-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 2px 0 16px; }
.scope-line h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.scope-line .chip { font-size: 12px; }
.tag-group-control { position: relative; }
.tag-group-control summary { display: flex; align-items: center; list-style: none; cursor: pointer; }
.tag-group-control summary::-webkit-details-marker { display: none; }
.tag-group-control summary .lbl { padding: 0 8px 0 10px; font-size: 12px; white-space: nowrap; }
.tag-group-selection {
  display: flex; align-items: center; gap: 8px; max-width: 16rem;
  padding: 5px 10px; border-radius: 7px; font-size: 13px; font-weight: 600; text-align: left;
}
.tag-group-selection::after {
  content: ""; flex: none; width: 6px; height: 6px; margin-bottom: 2px;
  border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.tag-group-options {
  position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 20;
  width: min(18rem, 85vw); max-height: min(20rem, 55vh); overflow: auto;
  padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow);
}
.tag-group-options button { display: block; width: 100%; padding: 7px 10px; text-align: left; }
.tag-group-options button:hover, .tag-group-options button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.tag-group-options button[aria-pressed="true"] { font-weight: 600; }
.tag-group-options a { display: block; padding: 7px 10px; white-space: nowrap; }
.tag-breakdown { margin-bottom: 16px; }
.tag-breakdown .table th[scope="row"] { font-size: 13px; color: var(--text); }
.tag-breakdown .chart { margin-top: 14px; }
.tag-breakdown .chart[hidden] { display: none; }
#app-insights[data-grouped="cost"] :is(#scope-show, [data-default-cost-breakdown]),
#app-insights[data-grouped="areas"] #areas-card { display: none; }
.scope-line .avatar-sm { align-self: center; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }

/* The scope trail. The tab set is the one strip under the masthead, in #app-nav. */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); min-width: 0; flex-wrap: wrap; }
.crumbs[hidden], body[data-me] #crumbs { display: none; }
.crumbs .crumb { font: inherit; padding: 2px 4px; border: 0; background: none; color: var(--text-2); border-radius: 5px; }
.crumbs button.crumb { cursor: pointer; }
.crumbs button.crumb:hover { color: var(--text); background: var(--surface-2); }
.crumbs .cur { color: var(--text); font-weight: 600; }
.crumbs .sep { color: var(--muted); }
.app-nav { background: var(--bg); }
.compass-tabs { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin: 0 0 18px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.compass-tabs-main { display: flex; align-items: flex-end; overflow-x: auto; scrollbar-width: none; }
.compass-tabs-main::-webkit-scrollbar { display: none; }
.compass-tabs-right { display: flex; align-items: flex-end; gap: 6px; }
.compass-tabs[hidden] { display: none; }
.compass-tabs .tab-group { display: inline-flex; flex-direction: column; align-items: flex-start; margin-top: 6px; }
.compass-tabs .tab-group-label { margin: 0 0 1px 10px; padding: 2px 6px; color: var(--group-color); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; line-height: 1.2; text-transform: uppercase; pointer-events: none; cursor: default; user-select: none; }
.compass-tabs .tab-group-tabs { display: inline-flex; align-items: flex-end; }
.compass-tabs a { padding: 8px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); font-weight: 500; white-space: nowrap; text-decoration: none; }
.compass-tabs a:hover { color: var(--text); text-decoration: none; }
.compass-tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.compass-tabs .tab-group a[aria-current="page"] { color: var(--text); border-bottom-color: var(--group-color); background: var(--surface); font-weight: 700; }
@media (max-width: 1300px) { .compass-tabs-main a { padding-inline: 9px; } }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 10px; box-shadow: var(--shadow);
}
.kpi .label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 32px; font-weight: 500; letter-spacing: -0.02em; margin-top: 4px; }
.kpi .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi svg.spark { width: 100%; height: 36px; display: block; margin-top: 6px; }
.delta { font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.delta.good { color: var(--good); background: var(--good-bg); }
.delta.bad { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--muted); background: var(--surface-2); }
.est { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--warn); background: var(--warn-bg); padding: 1px 6px; border-radius: 5px; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card {
  grid-column: span 2;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); min-width: 0;
}
.card.span-2 { grid-column: span 4; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.card h2 { margin: 0; font-size: 16px; font-weight: 500; letter-spacing: -0.005em; }
.tag { font-size: 11px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 2px 8px; border-radius: 999px; }
.chart { height: 260px; }
.chart.tall { height: 320px; }
.note { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; }
/* What the numbers say, against how they were worked out. */
.insight { margin: 0 0 10px; font-size: 14px; color: var(--text); }
.footnote { margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 11.5px; }

/* ── prompt analysis ────────────────────────────────────────────────────── */
.pair-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.prompts-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.mini-stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px; }
.mini-stats .k { color: var(--muted); font-size: 11.5px; }
.mini-stats .v { font-size: 18px; font-weight: 650; margin-top: 2px; }
.gaps { list-style: none; margin: 0; padding: 0; }
.gaps li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.gaps li:last-child { border-bottom: 0; }
.gaps .topic { font-family: var(--mono); font-size: 12.5px; }
.gaps .num { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.gaps .who { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }
.state { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.state.merged { color: var(--good); background: var(--good-bg); }
.state.open { color: var(--info); background: var(--info-bg); }
.state.closed { color: var(--muted); background: var(--surface-2); }
.kind { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.kind.question { color: var(--warn); background: var(--warn-bg); }
.kind.task { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.table td.worse { color: var(--bad); }
.table td.better { color: var(--good); }
.sev { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.sev.high { color: var(--bad); background: var(--bad-bg); }
.sev.medium { color: var(--warn); background: var(--warn-bg); }
.sev.low { color: var(--info); background: var(--info-bg); }
#prompt-people-wrap { margin-top: 12px; }
/* The intent legend can wrap to several rows; keep the donut itself large enough for its centre label. */

/* ── spend → shipped, skill reach ─────────────────────────────────────── */
.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); margin: 4px 0 8px; }
.stack span { display: block; height: 100%; }
.stack-legend { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-2); }
.stack-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.reach { display: inline-block; width: 90px; height: 6px; border-radius: 4px; background: var(--surface-2); vertical-align: middle; margin-right: 8px; overflow: hidden; }
.reach span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.table td.low { color: var(--muted); }
.trend { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; vertical-align: middle; }
.trend i { display: block; width: 7px; min-height: 1px; border-radius: 2px 2px 0 0; background: var(--accent); }
.trend i.gap { background: transparent; border-bottom: 1px dashed var(--border); }
.trend i.last { background: var(--accent-2); }
.hours { display: grid; grid-template-columns: 34px repeat(6, minmax(0, 1fr)); gap: 2px; font-size: 10.5px; color: var(--muted); }
.hours span { display: block; height: 18px; border-radius: 3px; }
.hours .lab { height: auto; line-height: 18px; text-align: right; padding-right: 4px; }
.hours .hr { height: auto; text-align: center; }
.hours .held { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 3px, transparent 3px, transparent 6px); }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; font-weight: 600; }

/* ── findings ───────────────────────────────────────────────────────────── */
.findings { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.finding {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start;
  padding: 11px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
}
.finding .icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; }
.finding.warn .icon { background: var(--warn-bg); color: var(--warn); }
.finding.good .icon { background: var(--good-bg); color: var(--good); }
.finding.info .icon { background: var(--info-bg); color: var(--info); }
.movers .finding .icon { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 700; }
.finding .title { font-weight: 600; font-size: 13.5px; }
.finding .detail { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.finding button.person { all: unset; color: var(--accent); cursor: pointer; font-weight: 600; }
.finding button.person:hover { text-decoration: underline; }

/* ── lists with inline bars ────────────────────────────────────────────── */
.bars { list-style: none; margin: 0 0 10px; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.bars li:last-child { border-bottom: 0; }
.bars .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; }
.bars .num { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.bars .bar { grid-column: 1 / -1; height: 5px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bars .bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bars .sub { color: var(--muted); font-size: 11.5px; }
.bars-title { margin: 6px 0 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── page links ─────────────────────────────────────────────────────────── */
.nav-link { color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 500; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
a.chip { text-decoration: none; color: inherit; }

/* ── recommendations ────────────────────────────────────────────────────── */
.recs { list-style: none; margin: 0; padding: 0; }
.recs li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); align-items: start; }
.recs li:last-child { border-bottom: 0; }
.recs li.empty { display: block; color: var(--muted); }
.recs .rec-body p { margin: 4px 0; color: var(--text-2); font-size: 13.5px; }
.recs .rec-body .sub { color: var(--muted); font-size: 12px; }
.job-status { list-style: none; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.job-status li + li { margin-top: 4px; }
.admin-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.admin-row input, .admin-row select { margin-left: 6px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; }
.admin-row input { width: 280px; max-width: 100%; }
.btn { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
a.btn { display: inline-block; text-decoration: none; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ── tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 8px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; position: sticky; top: 0; background: var(--surface); }
.table td.n, .table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: var(--surface-2); }
.table.sortable th { cursor: pointer; user-select: none; }
.table.sortable th[aria-sort="descending"]::after { content: " ↓"; }
.table.sortable th[aria-sort="ascending"]::after { content: " ↑"; }
.table tr.clickable { cursor: pointer; }

/* AG Grid over a table (grid.js, AIC-11): the table stays in the page, hidden, and the grid shows copies of its cells. */
table.table.cg-src { display: none; }
.cg-host { position: relative; width: 100%; font-size: 13px; }
.cg-host.cg-tall .cg-grid { height: 600px; }
.cg-bar { display: flex; justify-content: flex-end; gap: 6px; margin: 0 0 4px; }
.cg-bar .btn { padding: 2px 10px; font-size: 12px; }
/* The filter icon sits right after its own header text, never at the edge next to the neighbour's. */
.cg-host .ag-cell-label-container { flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.cg-host .ag-right-aligned-header .ag-cell-label-container { justify-content: flex-start; }
.cg-host .ag-header-cell-label { flex: 0 1 auto; }
.cg-host .ag-cell { display: flex; align-items: center; overflow: hidden; }
.cg-host .ag-cell-wrapper { flex: 1; min-width: 0; }
.cg-host .ag-right-aligned-cell, .cg-host .ag-right-aligned-cell .ag-cell-wrapper, .cg-host .ag-right-aligned-cell .ag-cell-value { display: flex; justify-content: flex-end; }
/* A short grid is as tall as its rows, not AG Grid's 150px minimum. */
.cg-host .ag-grid-scrolling-rows.ag-layout-auto-height { min-height: 0; }
.cg-cell { white-space: nowrap; line-height: 1.45; padding: 7px 0; font-variant-numeric: tabular-nums; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cg-cell.wrap, .cg-cell.sa-name { white-space: normal; }
.cg-cell.worse, .cg-cell.bad { color: var(--bad); }
.cg-cell.better, .cg-cell.good { color: var(--good); }
.cg-cell.low { color: var(--muted); }
.cg-host .ag-cell.held { color: var(--muted); background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 3px, transparent 3px, transparent 6px); }
.cg-host .ag-row.clickable { cursor: pointer; }
.cg-host .ag-row.off .ag-cell { opacity: .55; }
.cg-host .ag-row.selected { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.cg-host .ag-row.hot { box-shadow: inset 3px 0 0 var(--warn); }
.cg-host .ag-row.hot.good { box-shadow: inset 3px 0 0 var(--good); }
.cg-host .ag-row.hot.bad { box-shadow: inset 3px 0 0 var(--bad); }
.cg-host svg.wk { display: block; width: 112px; height: 26px; }
body[data-me] #app-insights .cg-host { display: none; }
.who { display: flex; align-items: center; gap: 9px; }
.chip { font: inherit; display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); margin-right: 4px; }
.chip.flag { background: var(--warn-bg); color: var(--warn); border-color: transparent; font-weight: 600; }
.pill-bar { display: inline-block; width: 70px; height: 6px; border-radius: 4px; background: var(--surface-2); vertical-align: middle; margin-left: 8px; overflow: hidden; }
.pill-bar span { display: block; height: 100%; background: var(--accent-2); }
.pager, .chart-more { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 4px 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pager[hidden], .chart-more[hidden] { display: none; }
.chart-more { justify-content: flex-end; }
.bars + .pager { padding: 0 0 6px; }
.pager-nav { display: inline-flex; gap: 6px; }
.pager .btn, .chart-more .btn { padding: 3px 10px; font-size: 12px; }
.tabs { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 9px; border: 1px solid var(--border); }
.tabs button { font: inherit; font-size: 12.5px; border: 0; background: transparent; color: var(--text-2); padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }

/* ── footer, loading ────────────────────────────────────────────────────── */
.footer { max-width: 1440px; margin: 0 auto; padding: 0 28px 28px; color: var(--muted); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.page-loading {
  position: sticky; top: var(--mast-h); align-self: start; height: 100cqh;
  display: grid; place-items: center; pointer-events: none; z-index: 1;
}
.page-loading-content {
  display: grid; place-items: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.page-loading-compass {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 2px solid var(--accent); border-radius: 50%;
}
.page-loading-needle {
  width: 12px; height: 26px;
  background: linear-gradient(var(--accent) 50%, var(--text-2) 50%);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  transform: rotate(35deg);
}
@media (prefers-reduced-motion: no-preference) {
  .page-loading-needle { animation: compass-turn 1.4s linear infinite; }
}
@keyframes compass-turn { to { transform: rotate(395deg); } }
main[aria-busy="true"] .kpi .value { opacity: 0.4; }
/* Keep the previous scope's numbers hidden until the new selection is ready. */
#app-insights[data-pending] > #tag-efficiency,
#app-insights[data-pending] > .grid,
#app-teams[aria-busy="true"] > .scope-line,
#app-teams[aria-busy="true"] > .kpis,
#app-teams[aria-busy="true"] > .note,
#app-teams[aria-busy="true"] > .grid,
#app-changes[aria-busy="true"] > .anoms,
#app-changes[aria-busy="true"] > .card,
#app-dash[aria-busy="true"] > #b-grid,
#app-dash[aria-busy="true"] #b-when { visibility: hidden; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; font-size: 13px; }
.error { color: var(--bad); background: var(--bad-bg); padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; }

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card, .card.span-2 { grid-column: span 2; }
}
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; position: static; }
  main { padding: 14px 16px 28px; }
  .footer { padding: 0 16px 22px; }
  .banner { padding: 8px 16px; text-align: left; }
  .controls { width: 100%; }
  .select, .select select { width: 100%; min-width: 0; max-width: none; }
  .segmented { flex: 1; }
  .segmented button { flex: 1; padding: 6px 4px; }
  .kpis { gap: 10px; }
  .kpi .value { font-size: 21px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .card, .card.span-2 { grid-column: span 1; padding: 14px; }
  .chart { height: 230px; }
  .chart.tall { height: 280px; }
  .findings { grid-template-columns: minmax(0, 1fr); }
  .prompts-grid, .pair-grid { grid-template-columns: minmax(0, 1fr); }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Where the work went: technical × product grid. */
.table.areas td.held { color: var(--muted); background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 3px, transparent 3px, transparent 6px); }
.table.areas td, .table.areas th { white-space: nowrap; }

/* Top bar: the Finout navy, with the primary navigation (My team, Me, Admin) in it. */
:root { --mast-h: 56px; }
body { padding-top: var(--mast-h); }
#compass-root {
  display: grid; grid-template-rows: auto auto minmax(0, 1fr);
  height: calc(100dvh - var(--mast-h));
}
#app-nav { grid-row: 2; min-width: 0; }
.page-content { grid-row: 3; min-width: 0; container-type: size; }
.page-content-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.page-content-grid > * { grid-area: 1 / 1; }
.view[hidden] { display: none; }
.view-error { margin: 24px 28px; }
.off-page { display: none !important; }

/* Where the work went: two breakdowns side by side. */
.areas-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 8px 0; }
@media (max-width: 760px) { .areas-split { grid-template-columns: 1fr; } }

/* (i) tooltips: the method note behind a card, out of its body (Idan's UX pass, item 15). */
.tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--border); color: var(--muted); font-size: 11px; font-style: italic; font-weight: 600; cursor: help; flex: none; }
.tip:hover, .tip:focus-visible { color: var(--text); border-color: var(--accent); outline: none; }
.tip[data-tip=""] { display: none; }
.tip::after { content: attr(data-tip); position: absolute; top: 22px; left: 50%; transform: translateX(-50%); z-index: 20; width: max-content; max-width: min(360px, 80vw); padding: 8px 10px; border-radius: 8px; background: var(--text); color: var(--surface-2); font: 400 12px/1.45 Inter, system-ui, sans-serif; font-style: normal; white-space: normal; text-align: left; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.tip:hover::after, .tip:focus-visible::after { opacity: 1; }
.card > header h2 { display: inline-flex; align-items: center; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.filters input, .filters select { font: inherit; font-size: 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.filters input { flex: 1 1 240px; min-width: 0; }
.bars li.clickable { cursor: pointer; }
.bars li.clickable:hover .name { color: var(--accent); }

/* ── recommendations ─────────────────────────────────────────────────── */
.sa-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.sa-pane { grid-column: auto; }
.sa-list { margin: 0; padding: 0; max-height: min(60vh, 450px); overflow: auto; }
.sa-list ul { list-style: none; margin: 0; padding: 0; }
.sa-group { margin: 8px 9px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); }
.sa-open { display: grid; gap: 2px; width: 100%; text-align: start; border: 0; border-bottom: 1px solid var(--border); background: none; padding: 7px 9px; cursor: pointer; font-weight: 600; color: var(--text); }
.sa-open[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 580px) { .sa-layout { grid-template-columns: minmax(0, 1fr); } .sa-list { max-height: 155px; } }
.sa-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag.sev-high { color: var(--bad); background: var(--bad-bg); }
.tag.sev-medium { color: var(--warn); background: var(--warn-bg); }
.tag.state-applied { color: var(--good); background: var(--good-bg); }
.tag.state-dismissed { color: var(--muted); background: var(--surface-2); }
.suggestion > header { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.suggestion > header h2 { margin: 0; }
.suggestion h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 14px 0 6px; }
.suggestion ul.facts { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
.suggestion .lever { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.suggestion .lever .where { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.suggestion .lever pre { margin: 0 0 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.suggestion .lever ul.facts { margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.suggestion dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 12px 0 0; font-size: 13px; }
.suggestion dt { color: var(--muted); }
.suggestion dd { margin: 0; }
.sa-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.suggestion .set-state { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.suggestion .set-state input { flex: 1 1 100%; min-width: 0; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.suggestion details { margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.suggestion details ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 720px) {
  .suggestion dl { grid-template-columns: 1fr; }
}

/* Filter-bar controls: outlined, 8px radius, like the app's Filters / Time Frame bar. */
.select select, .segmented, .icon-btn, .nav-link { border-color: var(--outline, #d0d5dd); border-radius: 8px; }
:root[data-theme="dark"] .select select, :root[data-theme="dark"] .segmented, :root[data-theme="dark"] .icon-btn, :root[data-theme="dark"] .nav-link { border-color: #3a5068; }
@media (max-width: 900px) {
  body { padding-top: 0; }
  #compass-root { height: 100dvh; }
  .page-loading { top: 0; }
  .masthead { position: static; flex-wrap: wrap; height: auto; padding: 8px 12px; }
}

/* ── masthead: the primary navigation and the period ─── */
.masthead {
  position: fixed; inset: 0 0 auto 0; height: var(--mast-h); z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px; background: #101828; border-bottom: 1px solid rgba(255, 255, 255, 0.2); color: #fff;
}
.mast-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.mast-brand:hover { text-decoration: none; }
.mast-brand img { display: block; height: 22px; width: 88px; }
.mast-brand span { font-size: 12px; font-weight: 500; color: #98a2b3; }
.mast-brand .mast-icon { vertical-align: -2px; margin-right: 4px; }
.mast-account { display: inline-flex; align-items: center; gap: 8px; }
.areas { display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); }
.areas a { padding: 6px 16px; border-radius: 6px; font-size: 14px; font-weight: 500; color: #d0d5dd; text-decoration: none; white-space: nowrap; }
.areas a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; text-decoration: none; }
.areas a[aria-current="page"] { background: var(--accent); color: #fff; }
.period { position: relative; }
.period-btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; padding: 7px 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.25); background: transparent; color: #fff; cursor: pointer; }
.period-btn svg { flex: none; }
.period-btn:hover, .period-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.1); }
.period-menu { position: absolute; right: 0; top: 44px; min-width: 250px; padding: 6px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(16, 24, 40, 0.25); }
.period-menu[hidden] { display: none; }
.period-menu > button[data-days]:not([hidden]) { display: flex; width: 100%; justify-content: space-between; font: inherit; font-size: 14px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.period-menu > button[data-days]:hover { background: var(--surface-2); }
.period-menu > button[aria-checked="true"] { font-weight: 600; color: var(--accent); }
.period-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; margin-top: 4px; border-top: 1px solid var(--border); }
.period-custom label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.period-custom input { font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.period-custom .btn { grid-column: span 2; }
.period-custom[hidden] { display: none; }
.mast-right { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }
.mast-dataset { color: #e2e8f0; border: 1px solid rgb(255 255 255 / .25); border-radius: .375rem; padding: .25rem .5rem; font-size: .75rem; max-width: 24vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mast-filters { display: flex; flex: none; margin-left: auto; min-width: 0; justify-content: flex-end; align-items: center; gap: 12px; }
.mast-filters .period { flex: none; }
#mast-tag-group:empty { display: none; }
#masthead .tag-group-control { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.25); }
#masthead .tag-group-control summary { color: #d0d5dd; }
#masthead .tag-group-selection { color: #fff; background: rgba(255, 255, 255, 0.12); }
#masthead .tag-group-selection::after { border-color: #d0d5dd; }
.mast-scope { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.mast-scope .picker { flex: 0 1 auto; min-width: 0; }
.mast-scope .picker-btn { min-width: min(220px, 100%); max-width: 100%; background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.25); }
.mast-scope .picker-btn span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mast-scope .picker-btn::after { border-color: #98a2b3; }
.mast-scope .crumbs { flex-wrap: nowrap; overflow: hidden; color: #98a2b3; white-space: nowrap; }
.mast-scope .crumbs .crumb { color: #98a2b3; }
.mast-scope .crumbs button.crumb:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.mast-scope .crumbs .cur { color: #fff; overflow: hidden; text-overflow: ellipsis; }
.mast-scope .crumbs .sep { color: #667085; }
.masthead [hidden] { display: none; }
#picker-panel { display: none !important; }
.avatar-wrap { position: relative; }
.avatar {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25); cursor: pointer; background: transparent; color: #fff;
}
.avatar:hover, .avatar[aria-expanded="true"] { background: rgba(255, 255, 255, 0.12); }
.avatar.viewing-as::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px;
  border-radius: 50%; border: 2px solid #101828; background: #fdb022;
}
.menu {
  position: absolute; right: 0; top: 44px; z-index: 50; width: min(310px, calc(100vw - 24px)); padding: 6px;
  max-height: calc(100dvh - 64px); overflow-y: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.25);
}
.menu[hidden] { display: none; }
.account-heading { display: grid; gap: 3px; padding: 9px 10px 11px; margin-bottom: 4px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
#account-context { font-size: 12px; color: var(--muted); }
.account-select { display: grid; gap: 4px; padding: 6px 10px; font-size: 12px; color: var(--text-2); }
.account-select select {
  width: 100%; min-width: 0; height: 34px; padding: 4px 8px; font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
}
.menu a, .menu-row { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 6px; font-size: 14px; color: var(--text); text-decoration: none; }
.menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu-row span { flex: 1; color: var(--text-2); }
.menu-row button { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; }
.menu-row button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* The scope bar under the masthead: one selector for every view. */
.topbar { top: var(--mast-h); }
.scope-wrap { display: flex; align-items: center; gap: 10px; }
.scope-wrap .select select { min-width: 280px; }
@media (max-width: 700px) {
  .scope-wrap { position: relative; flex-wrap: wrap; }
  .scope-wrap .tag-group-control { position: static; }
  .scope-wrap .select select { min-width: 0; max-width: 42vw; }
}
.areas a[hidden], #c-scope[hidden], label.select[hidden] { display: none; }
.mast-tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }

/* Codex vs Claude Code */
.vs { display: grid; gap: 2px; }
.vs-row { display: grid; grid-template-columns: 140px 110px 1fr 110px; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.vs-row:last-child { border-bottom: 0; }
.vs-head { color: var(--muted); font-size: 12px; padding-top: 0; }
.vs-v { font-variant-numeric: tabular-nums; font-weight: 500; }
.vs-v.claude { text-align: right; }
.vs-bar { height: 8px; border-radius: 4px; background: var(--c1); overflow: hidden; }
.vs-bar i { display: block; height: 100%; background: var(--c5); }
.vs-head .claude { color: var(--c1); } .vs-head .codex { color: var(--c5); }

/* Dashboards (builder.html) */
.b-actions { margin-left: auto; display: inline-flex; gap: 8px; }
.b-title { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.b-title h1 { font-size: 22px; font-weight: 600; margin: 0; }
.b-title input { font: inherit; font-size: 20px; font-weight: 600; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.b-edit-only { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }
.btn[aria-pressed="true"], .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.w-1 { grid-column: span 1; } .w-2 { grid-column: span 2; } .w-4 { grid-column: 1 / -1; }
.w { position: relative; }
.w .kpi { border: 0; padding: 0; box-shadow: none; background: none; }
.w-tools { display: none; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
body.editing .w-tools { display: flex; }
.w-tools select { font: inherit; font-size: 12px; max-width: 100%; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; }
.w-tools .col { font-size: 12px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.w-tools .w-move { margin-left: auto; display: inline-flex; gap: 2px; }
body.editing .w { outline: 1px dashed var(--border); }
.w-tools button { border: 0; background: var(--bg); color: var(--muted); border-radius: 6px; padding: 2px 7px; cursor: pointer; font: inherit; font-size: 12px; }
.w-tools button:hover { color: var(--text); }
.w table { width: 100%; border-collapse: collapse; font-size: 13px; }
.w td, .w th { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--border); font-weight: 400; }
.w th { color: var(--muted); font-size: 12px; }
.w td:first-child, .w th:first-child { text-align: left; }
.w svg.trend { width: 100%; height: 120px; display: block; }
.w .range { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 4px; }
@media print {
  #compass-root { display: block; height: auto; }
  .page-content { container-type: normal; }
  .page-content-grid { display: block; }
  .page-loading { display: none; }
  .masthead, .compass-tabs, .act-tabs, .admin-sidebar, .topbar, .w-tools, .b-edit-only, #b-copy { display: none !important; }
  #app-admin { display: block; }
  body { padding: 0 !important; background: #fff; }
}
@media (max-width: 900px) { .w-1, .w-2, .w-4 { grid-column: span 2; } }


/* Scope picker: People / Teams / Org */
.picker { position: relative; }
.picker-btn { min-width: 280px; text-align: left; padding: 8px 32px 8px 12px; border: 1px solid var(--outline, #d0d5dd); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; position: relative; }
.picker-btn::after { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); }
.picker-panel { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: min(620px, 92vw); max-height: min(560px, calc(100vh - 160px)); overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18); }
.picker-all { width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.picker-tabs { display: flex; gap: 4px; margin: 10px 0; border-bottom: 1px solid var(--border); }
.picker-tabs button { padding: 6px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.picker-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.picker-all:hover, .pick:hover, .org-node:hover { border-color: var(--accent); }
.picker-all[aria-current="true"], .pick[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.picker-body input { width: 100%; padding: 7px 10px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; }
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pick { width: 100%; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; text-align: left; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.pick .sub { color: var(--muted); font-size: 12px; }
button.org-node { font: inherit; cursor: pointer; }
.picker-body .org-tree { margin-top: 2px; }
.picker-body .empty { color: var(--muted); font-size: 13px; margin: 6px 0; }
@media (max-width: 700px) { .pick-list { grid-template-columns: 1fr; } .picker-btn { min-width: 0; width: 100%; } }

/* Narrow screens: the nav becomes a row on top, and nothing is fixed under it. */
@media (max-width: 900px) {
  .masthead { position: static; padding: 0 16px; }
  #masthead { position: relative; height: auto; flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
  #masthead .mast-filters { position: relative; order: 1; flex: 1 0 100%; flex-wrap: wrap; align-items: center; gap: 8px; }
  #masthead .tag-group-control { position: static; }
  #masthead .tag-group-selection { max-width: min(16rem, 36vw); }
  #masthead .mast-filters:not(:has(> :not([hidden]))) { display: none; }
  #masthead .mast-scope { flex-wrap: wrap; gap: 4px; }
  #masthead .mast-scope .picker, #masthead .mast-scope .picker-btn { width: 100%; min-width: 0; }
  #masthead .mast-scope .picker-btn span { white-space: normal; overflow-wrap: anywhere; }
  #masthead .mast-scope .crumbs { flex: 1 0 100%; flex-wrap: wrap; white-space: normal; }
  #masthead .picker-panel { width: min(620px, calc(100vw - 24px)); }
  #masthead .period { max-width: 48%; }
  #masthead .period-btn { max-width: 100%; text-align: left; }
  .topbar { top: 0; position: static; }
}
@media (max-width: 480px) {
  #masthead { column-gap: 8px; }
  #masthead .mast-brand img { width: 74px; height: auto; }
  #masthead .mast-brand span { display: none; }
  #masthead .areas a { padding-inline: 8px; font-size: 13px; }
}

/* What changed */
.nav-badge { float: right; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.nav-badge[hidden] { display: none; }
.scope-wrap .check { display: inline-flex; align-items: center; gap: 6px; margin-left: 16px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.changes th.n, .changes td.n { text-align: right; }
.changes tr.group th { position: static; padding-top: 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border-bottom: 0; background: none; }
.changes td.good { color: var(--good); }
.changes td.bad { color: var(--bad); }
.changes td[title] { cursor: help; }
.changes tr.hot td:first-child { box-shadow: inset 3px 0 0 var(--warn); font-weight: 600; }
.changes tr.hot.good td:first-child { box-shadow: inset 3px 0 0 var(--good); }
.changes tr.hot.bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.changes svg.wk { display: block; width: 112px; height: 26px; }
.flag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; color: var(--warn); background: var(--warn-bg); }
.flag.bad { color: var(--bad); background: var(--bad-bg); }
.flag.good { color: var(--good); background: var(--good-bg); }
.anoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); gap: 12px; margin-bottom: 12px; }
.anom { display: grid; grid-template-columns: 1fr 340px; gap: 4px 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: inset 3px 0 0 var(--warn); }
.anom.good { box-shadow: inset 3px 0 0 var(--good); }
.anom.bad { box-shadow: inset 3px 0 0 var(--bad); }
.anom h3 { margin: 2px 0 8px; font-size: 16px; font-weight: 600; }
.anom p { margin: 4px 0; font-size: 13px; color: var(--text-2); }
.anom-date { font-size: 12px; color: var(--muted); }
.anom-delta .lbl { color: var(--muted); }
.anom-delta b { font-size: 18px; }
.anom-delta b.good, .pill.good { color: var(--good); }
.anom-delta b.bad, .pill.bad { color: var(--bad); }
.anom-delta b.flat, .pill.flat { color: var(--warn); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-2); }
.anom-vs { display: flex; gap: 16px; }
.anom-vs b { color: var(--text); }
.chip { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-weight: 500; }
.anom svg.area { grid-column: 2; grid-row: 1 / 3; width: 100%; height: auto; font-size: 10px; fill: var(--muted); }
.anom svg.area .grid { stroke: var(--border); }
.anom svg.area .mark { stroke-dasharray: 3 3; stroke-width: 1.5; }
.anom-actions { grid-column: 1 / -1; display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); margin-top: 6px; }
.anom-actions .btn:last-child { margin-left: auto; }
@media (max-width: 700px) { .anoms { grid-template-columns: 1fr; } .anom { grid-template-columns: 1fr; } .anom svg.area { grid-column: 1; grid-row: auto; } }
.changes .bell { opacity: 0.45; }
.changes tr:hover .bell, .changes .bell:focus-visible { opacity: 1; }
.alert-list { list-style: none; margin: 0 0 12px; padding: 0; }
.alert-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.alert-list li > span:first-child { flex: 1; }
.alert-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.alert-form select, .alert-form input { font: inherit; font-size: 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.alert-form input { width: 96px; }

/* Investigations */
.inv-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inv-form input, .inv-form select { font: inherit; font-size: 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.inv-form input[type=date] { width: 140px; }
a.inv { margin-left: 8px; font-size: 12px; font-weight: 500; }
.nowrap { white-space: nowrap; }
.prompt-text { margin: 12px 0 0; padding: 12px; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }

/* AI Compass: tiles and a grid on top of a tab, the cards the wireframe has not got at the bottom. */
.grid > .extra { order: 50; }
.kpis.compass-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: stretch; }
.compass-tiles .kpi { display: flex; flex-direction: column; min-width: 0; }
.compass-tiles .kpi .label { min-height: 2.6em; align-items: flex-start; line-height: 1.3; }
.compass-tiles .kpi .row { align-items: flex-start; }
.compass-tiles .kpi .value { font-size: 26px; overflow-wrap: anywhere; }
.compass-tiles .kpi-lines { width: 100%; list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.compass-tiles .kpi-lines li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.compass-tiles .kpi-lines .n { font-variant-numeric: tabular-nums; font-weight: 600; }
.compass-grid { margin-bottom: 16px; }
.compass-grid .segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.act-tabs { display: flex; gap: 2px; margin: 0 0 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.act-tabs[hidden] { display: none; }
.act-tabs a { padding: 9px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); font-weight: 500; white-space: nowrap; text-decoration: none; }
.act-tabs a:hover { color: var(--text); text-decoration: none; }
.act-tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.act-tabs a[hidden] { display: none; }
.compass-more { margin: 10px 0 0; }

/* ── AI Compass: the wireframe's card types, in the app's own tokens ─── */
#compass-top { display: contents; }
#compass-top > .compass-tiles { grid-column: 1 / -1; order: -8; margin: 0; }
#tag-breakdown { grid-column: 1 / -1; order: -9; margin: 0; }
#app-insights[data-grouped="areas"] #tag-breakdown { order: -6; }
.compass-mid { display: contents; }
.compass-mid > * { grid-column: 1 / -1; margin: 0; }
.compass-lead { order: -3; }
.compass-grid { order: -2; }
.compass-after { order: -1; }
.compass-scorecard { order: -7; }
#shipped-card { order: -6; }
#overview-delivery { order: -6; }
#overview-delivery-stats { grid-template-columns: repeat(2, minmax(0, 260px)); }
#areas-card { order: -5; }
#attribution-units { order: -4; }
.units-scope { display: flex; gap: .55rem; align-items: center; margin-inline-start: auto; color: var(--muted); font-size: .85rem; }
.units-scope select {
  max-width: min(22rem, 55vw); padding: .3rem .5rem; color: var(--text); font: inherit;
  border: 1px solid var(--border); border-radius: .4rem; background: var(--surface-2);
}
.units-summary {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 1rem;
  border: 1px solid var(--border); border-radius: .6rem; background: var(--surface-2);
}
.units-summary > div { min-width: 0; padding: .65rem .8rem; }
.units-summary > div + div { border-inline-start: 1px solid var(--border); }
.units-summary dt, .units-summary span, .units-delta { color: var(--muted); font-size: .78rem; }
.units-summary dd { margin: .15rem 0 0; font-size: clamp(1.15rem, 2.1vw, 1.65rem); line-height: 1.2; font-weight: 650; overflow-wrap: anywhere; }
.units-summary dd, .units-table td { font-variant-numeric: tabular-nums; }
.units-delta { margin-inline-start: .25rem; white-space: nowrap; }
.units-summary .units-delta { margin-inline-start: 0; }
.units-group-picker { width: fit-content; margin-bottom: .45rem; }
.units-group-picker button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.units-table { min-width: 45rem; }
.units-table .n { white-space: nowrap; }
.units-table th:first-child { width: 37%; }
.units-table tbody th { color: var(--text); font-weight: 550; }
.units-total { font-weight: 650; }
.units-table tr[data-unit-group-open] { background: var(--surface-2); }
.units-expand { border: 0; background: none; color: inherit; font: inherit; text-align: start; padding: .15rem 0; cursor: pointer; }
.units-expand:hover { text-decoration: underline; }
.units-expand span {
  display: inline-block; width: .4rem; height: .4rem; margin: 0 .55rem .12rem .12rem; transform: rotate(-45deg);
  border: solid var(--muted); border-width: 0 1.5px 1.5px 0;
}
.units-expand[aria-expanded="true"] span { transform: rotate(45deg); }
.units-detail { padding: .4rem .65rem .65rem; background: var(--surface-2); border-radius: .4rem; }
.units-detail table { margin-bottom: .5rem; }
.units-detail th:first-child { width: 60%; }
@media (max-width: 820px) {
  .units-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .units-summary > div { grid-column: span 2; }
  .units-summary > div:nth-child(-n+2) { grid-column: span 3; }
  .units-summary > div:nth-child(3) { border-inline-start: 0; }
  .units-summary > div:nth-child(n+3) { border-top: 1px solid var(--border); }
}
#prs-card, #attributed-work { order: -2; scroll-margin-top: 7rem; }
body[data-page="areas"] .compass-after { order: 51; }
.attribution-share { order: 52; }
body[data-page="efficiency"] .grid [data-section="savings"] { order: 60; }
body[data-page="efficiency"] .grid > .savings-heading { grid-column: 1 / -1; order: 59; }
body[data-page="efficiency"] #efficiency-fixes { order: 61; }
#quality-widgets, #quality-card, #correction-loops, #efficiency-practice { order: -2; }
body[data-page="insights"] #hygiene-card { order: 1; }
body[data-page="knowledge"] :is(#topics-card, #langs-card, #repeated-card) { order: -6; }
body[data-page="insights"] :is(#idle-card, #compactidle-card, #regrowth-card) { order: 2; }
.fix-card { scroll-margin-top: 7rem; }
.top-fixes { display: grid; gap: 8px; padding: 0; list-style: none; }
.top-fixes a { display: block; padding-inline-start: 8px; border-inline-start: 3px solid var(--group-color, var(--accent)); }
.findings-card { grid-column: 1 / -1; }
.change-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); gap: 10px; list-style: none; padding: 0; margin: 0; }
.change-card { padding: 10px; display: grid; gap: 4px; border: 1px solid var(--border); border-inline-start: 3px solid var(--accent); border-radius: 6px; }
[data-group="proficiency"] { --group-color: #6945a3; --group-tint: #f2eafc; --group-dark: #b799f0; --group-tint-dark: #21274b; }
[data-group="value"] { --group-color: #176957; --group-tint: #dff4ec; --group-dark: #65c5ad; --group-tint-dark: #012f40; }
[data-group="agents"] { --group-color: #345eaa; --group-tint: #e4efff; --group-dark: #8cb1f5; --group-tint-dark: #102a4e; }
[data-group="efficiency"] { --group-color: #865615; --group-tint: #f9ecdc; --group-dark: #e1b46d; --group-tint-dark: #262b34; }
[data-theme="dark"] [data-group] { --group-color: var(--group-dark); --group-tint: var(--group-tint-dark); --text-2: #a6b4c7; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) [data-group] { --group-color: var(--group-dark); --group-tint: var(--group-tint-dark); --text-2: #a6b4c7; }
}
:is(.tab-group, .score > .dim, .change-card)[data-group] {
  background-color: var(--group-tint, var(--surface-2));
}
.change-card { border-inline-start: 3px solid var(--group-color, var(--accent)); }
.change-card .muted { color: var(--text-2); }
.change-card a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
#me-tab { display: flex; align-items: center; gap: 8px; padding: 4px 9px; margin: 0 0 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 600; }
#me-tab[aria-current="page"] { border-color: var(--accent); }
.me-tab-initials { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); font-size: 11px; }
.me-tab-levels { display: grid; line-height: 1.15; }
.me-tab-levels { font-size: 11px; font-weight: 500; }
.me-tab-levels[hidden] { display: none; }
.me-level-stars { margin-inline-start: 4px; font-size: 8px; letter-spacing: 1px; }
.change-card strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.change-more { margin-top: 10px; }
.change-more summary { cursor: pointer; width: fit-content; }
.change-more[open] summary { margin-bottom: 10px; }
.change-more:not([open]) .when-open, .change-more[open] .when-closed { display: none; }
body:is([data-page="overview"], [data-page="quality"], [data-page="insights"], [data-page="knowledge"], [data-page="efficiency"]) #scope-show { display: none; }
.grid > #kpis { grid-column: 1 / -1; order: 40; margin-bottom: 0; }
.kpi .spark { display: block; width: 100%; height: 26px; margin-top: 8px; color: var(--accent); opacity: 0.85; }
.habit-meter { accent-color: var(--accent); width: 100%; height: 12px; margin-top: 8px; }
.habit-meter::-webkit-meter-optimum-value { background: var(--accent); }
.qcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.qcard { display: grid; align-content: start; gap: 4px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.qn { display: inline-block; margin-right: 8px; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent); }
.qcard .qn { margin: 0; }
.qt { font-weight: 600; }
.qcard > h3 { margin: 0; font-size: inherit; }
.qv { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.qv .per { margin-left: 8px; font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.qs { color: var(--text-2); font-size: 13px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.btns .btn, .action .btn { text-decoration: none; font-size: 13px; padding: 5px 12px; }
.score { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.evidence-line { margin: 0 0 12px; }
.dim { display: grid; gap: 4px; align-content: start; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.dim:hover { border-color: var(--accent); text-decoration: none; }
.dim .l { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.dim .v { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dim .why { font-size: 12.5px; color: var(--text-2); }
.score > .dim[data-group] :is(.l, .v) { color: var(--text); }
.score > .dim[data-group] .status { color: var(--text-2); }
.dim.st-ok { border-left: 3px solid var(--good); }
.dim.st-watch { border-left: 3px solid var(--warn); }
.dim.st-act { border-left: 3px solid var(--bad); }
.dim .l { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.status { font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; display: inline-flex; align-items: center; gap: 5px; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--status-color, currentColor); }
.status.ok { --status-color: var(--good); } .status.watch { --status-color: var(--warn); } .status.act { --status-color: var(--bad); }
.status:is(.ok, .watch, .act) { color: var(--status-color); }
.dot-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.sdot.ok { background: var(--good); } .sdot.watch { background: var(--warn); } .sdot.act { background: var(--bad); }
.focus { font-size: 12px; font-weight: 600; }
.focus.act { color: var(--bad); } .focus.watch { color: var(--warn); } .focus.ok { color: var(--muted); font-weight: 500; }
.action { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.action:first-of-type { border-top: 0; }
.action .t { font-weight: 600; }
.action .d { margin-top: 2px; font-size: 13px; color: var(--text-2); }
.action .amt { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.action .btns { margin: 0; }
@media (max-width: 900px) { .qcards { grid-template-columns: 1fr; } .score { grid-template-columns: repeat(2, minmax(0, 1fr)); } .action { grid-template-columns: 1fr; } .action .amt { text-align: left; } }

/* AI Compass: the session setup card (Waste tab). */
.setup-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.setup-stat .l { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.setup-stat .v { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.setup-stat .s { font-size: 12px; color: var(--muted); }
.setup-trend { margin: 16px 0 8px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.setup-trend figcaption { font-size: 13px; color: var(--text-2); }
.setup-trend .spark { display: block; width: 100%; height: 56px; margin: 8px 0 2px; color: var(--accent); }
.setup-dates { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) { .setup-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.model-effort-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.model-effort-panels > section { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.model-effort-panels header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.model-effort-panels h3 { margin: 0; font-size: 15px; }
#effort-people-wrap { margin-top: 12px; }
#cache-card .prompts-grid { grid-template-columns: minmax(0, 1fr); }

/* ── AI Compass v2: gaps kept in place, the cost tab, the Show selector ─── */
.compass-gaps { order: -4; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cols2 > .card { grid-column: auto; margin: 0; }
.cost-breakdown { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
#plan-stats { grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), max-content)); }
#plan-detail-card { margin-top: 14px; }
#plan-detail-card h3 { margin: 0 0 8px; font-size: 15px; }
@media (max-width: 900px) { .cols2 { grid-template-columns: 1fr; } }
.kpi.gap, .gap-card { border-style: dashed; background: transparent; box-shadow: none; }
.kpi.gap .value { color: var(--muted); }
.kpi.gap .muted { font-style: italic; }
.gap-card .note { margin: 0; color: var(--muted); }
/* Both figures are gaps (not collected yet): dashed, like the other gap cards. */
.scope-line .scope-show { margin-left: auto; align-self: center; }
.scope-show .segmented { align-items: center; }
.scope-show .lbl { padding: 0 8px 0 10px; font-size: 12px; color: var(--muted); }
.scope-show .segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }

/* Fix this (CTX-584): a row per red or amber finding, and the side panel it opens. */
.fix-group + .fix-group { margin-top: 14px; }
.fix-group h3 { margin: 0 0 4px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.fix-group ul { list-style: none; padding: 0; margin: 0; }
.fix-row + .fix-row { margin-top: 4px; }
.fix-item { display: grid; grid-template-columns: minmax(70px, auto) minmax(0, 1fr) auto auto; width: 100%; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; text-align: left; }
.fix-item:hover { background: var(--surface-2); }
.fix-item-title { overflow-wrap: anywhere; }
.fix-amount { grid-column: 3; color: var(--text-2); font-variant-numeric: tabular-nums; }
.fix-arrow { grid-column: 4; color: var(--muted); font-size: 16px; line-height: 1; }
.status.opportunity { --status-color: var(--accent); color: var(--text-2); }
.fix-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / 0.25); z-index: 90; }
.fix-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); overflow-y: auto; z-index: 91; padding: 20px 24px; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow); }
.fix-panel h2 { margin: 10px 0 14px; font-size: 18px; }
.fix-panel h3 { margin: 14px 0 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.fix-panel p, .fix-panel ol { margin: 0; font-size: 14px; color: var(--text); }
.fix-panel ol { padding-left: 20px; display: grid; gap: 4px; }
.fix-panel .btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.fix-panel .btn { text-decoration: none; }
.fix-head { display: flex; justify-content: space-between; align-items: center; }
.fix-close { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.fix-copy { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fix-panel .muted { margin-top: 12px; font-size: 13px; color: var(--muted); }
.fix-panel .note { margin-top: 10px; }
.suggestions-panel { margin: 0 0 0 auto; width: min(800px, 100%); height: 100dvh; max-width: none; max-height: none; border: 0; border-left: 1px solid var(--border); color: var(--text); }
.suggestions-panel::backdrop { background: rgb(0 0 0 / 0.25); }
.suggestions-panel .sa-open .muted { margin: 0; font-size: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .suggestions-panel[open] { animation: suggestions-slide-in 150ms ease-out; }
  @keyframes suggestions-slide-in { from { transform: translateX(100%); } }
}

/* Admin (CTX-584 round 3): the wireframe's panel. */
.admin-layout { display: grid; grid-template-columns: 188px minmax(0, 1fr); align-items: start; gap: 24px; }
.admin-sidebar { position: sticky; top: calc(var(--mast-h) + 22px); padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-sidebar h1 { margin: 0 0 8px; padding: 3px 10px 10px; border-bottom: 1px solid var(--border); font-size: 20px; }
#admin-nav:not([hidden]) { display: grid; gap: 4px; }
#admin-nav a { display: flex; align-items: center; min-height: 38px; padding: 7px 10px; border-radius: 7px; color: var(--text-2); font-weight: 500; text-decoration: none; }
#admin-nav a:hover { color: var(--text); background: var(--surface-2); }
#admin-nav a[aria-current="page"] { color: var(--accent); background: var(--info-bg); font-weight: 600; }
#admin-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.admin-content { min-width: 0; }
.linear-bug-labels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 6px 14px; max-height: 156px; overflow: auto; margin: 10px 0; }
.linear-bug-labels label { overflow-wrap: anywhere; }
.admin-mode { display: flex; justify-content: flex-end; }
#admin-mode:not([hidden]) { margin: 0 0 10px; }
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .admin-sidebar { position: static; }
  #admin-nav:not([hidden]) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); }
  #admin-nav a { min-height: 44px; }
}
#app-admin .card { margin-bottom: 16px; grid-column: auto; }
#app-admin .compass-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
#app-admin .kpi .value .of { font-size: 15px; color: var(--muted); }
#app-admin .kpi .muted { font-size: 12px; margin-top: 2px; }
.integration-categories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin: 4px 0 20px; }
.integration-category { grid-column: 1 / -1; min-width: 0; }
.integration-category > h2 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.integration-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.integration-grid--collector { grid-template-columns: repeat(2, minmax(0, 390px)); }
#app-admin .integration-provider { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 12px; }
.integration-provider-name { display: grid; justify-items: start; gap: 8px; }
.integration-grid--collector .integration-provider-name { display: flex; flex-wrap: wrap; align-items: center; }
.integration-provider-name h3 { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.integration-logo { display: grid; place-items: center; flex: none; width: 48px; height: 42px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.integration-logo img { display: block; width: 32px; height: 30px; object-fit: contain; }
.integration-logo--chatgpt img { color-scheme: light; }
.integration-logo--bamboohr, .integration-logo--workday, .integration-logo--okta { width: 76px; }
.integration-logo--bamboohr img, .integration-logo--workday img, .integration-logo--okta img { width: 62px; }
.integration-logo--okta { background: #191919; }
.integration-provider-status { display: flex; flex: 1; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 6px; }
.integration-provider-status .status { min-height: 24px; }
.slack-integration > header h2 { gap: 8px; }
.slack-integration > header h2::before { content: ''; width: 18px; height: 18px; background: url('/integration-logos/slack.svg') center / contain no-repeat; }
.integration-options { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0 0; }
.integration-options.kv { display: grid; }
.taxonomy-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.taxonomy-options .table :is(th, td) { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.taxonomy-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.taxonomy-keywords .table :is(th, td) { white-space: normal; overflow-wrap: anywhere; }
.taxonomy-services > summary { cursor: pointer; font-weight: 600; }
.taxonomy-services[open] > summary { margin-bottom: 12px; }
.taxonomy-area { padding: 12px 0; border-top: 1px solid var(--border); }
.taxonomy-area header, .taxonomy-area li, .taxonomy-area-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.taxonomy-area header { justify-content: space-between; }
.taxonomy-area h3, .taxonomy-area h4 { margin: 0 0 6px; overflow-wrap: anywhere; }
.taxonomy-area h3 { font-size: 15px; }
.taxonomy-area h4 { font-size: 13px; }
.taxonomy-area ul { list-style: none; padding: 0; margin: 0 0 8px; }
.taxonomy-area li { padding: 2px 0; overflow-wrap: anywhere; }
.taxonomy-editor { width: min(440px, calc(100% - 32px)); padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); }
.taxonomy-editor::backdrop { background: rgb(0 0 0 / 45%); }
.taxonomy-editor h2 { margin: 0 0 12px; font-size: 17px; }
.taxonomy-editor label { display: grid; gap: 4px; margin: 12px 0; }
.taxonomy-editor label :is(input, select, textarea) { width: 100%; padding: 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text); font: inherit; }
.taxonomy-editor textarea { resize: vertical; max-height: 220px; }
.taxonomy-editor .muted { overflow-wrap: anywhere; }
.taxonomy-editor-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (min-width: 850px) { .integration-category--source-control, .integration-category--issue-tracker { grid-column: auto; } }
@media (max-width: 510px) {
  .integration-grid--collector { grid-template-columns: minmax(0, 390px); }
  .integration-grid:not(.integration-grid--collector) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 146px), 1fr)); }
  .taxonomy-options { grid-template-columns: 1fr; gap: 0; }
}
.setup-guide { max-width: 48rem; margin: 0 auto; padding: 24px; }
.setup-guide nav ul { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-left: 0; list-style: none; }
.setup-guide section { margin-top: 24px; }
.setup-guide .table th, .setup-guide .table td { position: static; vertical-align: top; white-space: normal; }
.setup-guide pre { overflow-x: auto; padding: 12px; background: var(--surface-2); }
.admin-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.admin-cols > .card { margin-bottom: 0 !important; }
.admin-side { display: grid; gap: 16px; }
.admin-side .card { margin-bottom: 0 !important; }
.admin-cols + .card { margin-top: 16px; }
.sw { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 2px 10px 2px 3px; font: inherit; font-size: 12px; cursor: pointer; }
.sw::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .12s; }
.sw.on { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); background: var(--good-bg); }
.sw.on::before { background: var(--good); }
.sw:disabled { cursor: default; opacity: .7; }
.sw-row { display: inline-flex; align-items: center; gap: 8px; }
.cover { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.cover i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.cover.on i { background: var(--good); } .cover.part i { background: var(--warn); } .cover.off { color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.slack-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: center; }
.slack-form label { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.slack-form input { font: inherit; font-size: 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; min-width: 0; }
.ua-map { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.ua-link { flex-wrap: wrap; gap: 8px; margin-block-end: 8px; }
.ua-map input { font: inherit; font-size: 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; width: 220px; }
.slack-btns { display: flex; gap: 8px; margin: 12px 0 0; }
.table.compact td, .table.compact th { padding: 7px 8px; }
.table.rules td { white-space: normal; vertical-align: top; }
.table.rules td .muted { font-size: 12px; }
.table tr.off td { opacity: .55; }
.thr { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.thr input { width: 64px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; }
.thr .pill { font-weight: 500; font-size: 11px; color: var(--warn); }
/* AI Virtual Tags (AIC-7): the tag editor on Admin. */
#app-admin .vt-panel { padding: clamp(14px, 2vw, 24px); }
.vt-panel > header { margin-bottom: 16px; }
.vt-list { list-style: none; padding: 0; margin: 0 0 12px; }
.vt-list-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 18px; padding: 14px 0; border-top: 1px solid var(--border); }
.vt-list-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.vt-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vt-editor-actions { margin: 16px 0; }
.vt-message { margin-bottom: 0; }
.vt-message:empty { display: none; }
.vt-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.vt-fields h3 { margin: 20px 0 4px; font-size: 15px; }
.vt-fields h3 + p { margin: 0 0 8px; }
.vt-fields label { display: grid; gap: 4px; min-width: 0; }
.vt-name { max-width: 24rem; margin-bottom: 16px; }
.vt-values, .vt-rule { min-width: 0; margin: 0 0 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.vt-values { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vt-value { display: inline-flex; gap: 4px; min-width: 0; max-width: 100%; }
.vt-fields input, .vt-fields select { min-width: 0; max-width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.vt-rule-head, .vt-cond { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 16px; margin-bottom: 12px; }
.vt-cond label:last-of-type { flex: 1 1 13rem; }
.chips button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.level { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: grid; gap: 4px; }
.level .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.level .nm { font-size: 15px; font-weight: 600; }
.level .g { font-size: 12.5px; color: var(--muted); min-height: 2.6em; }
.level .b { font-size: 20px; font-weight: 500; } .level .b span { font-size: 12px; color: var(--muted); }
.level .c { font-size: 12.5px; }
.levels > .level { border-top: 3px solid var(--lc); }
/* Proficiency levels (levels.js). Each colour has at least 3:1 contrast against its surface. */
:root { --lvl-starter: oklch(0.62 0.12 200); --lvl-proficient: oklch(0.49 0.17 260); --lvl-expert: oklch(0.32 0.16 305); --lvl-specialist: oklch(0.62 0.14 74); --lvl-advanced-specialist: oklch(0.31 0.09 225); --lvl-principal-specialist: oklch(0.58 0.21 345); --lvl-on-expert: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --lvl-starter: oklch(0.58 0.10 210); --lvl-proficient: oklch(0.75 0.14 255); --lvl-expert: oklch(0.93 0.09 335); --lvl-specialist: oklch(0.79 0.14 75); --lvl-advanced-specialist: oklch(0.83 0.10 195); --lvl-principal-specialist: oklch(0.67 0.20 355); --lvl-on-expert: #0d1b2e; } }
:root[data-theme="dark"] { --lvl-starter: oklch(0.58 0.10 210); --lvl-proficient: oklch(0.75 0.14 255); --lvl-expert: oklch(0.93 0.09 335); --lvl-specialist: oklch(0.79 0.14 75); --lvl-advanced-specialist: oklch(0.83 0.10 195); --lvl-principal-specialist: oklch(0.67 0.20 355); --lvl-on-expert: #0d1b2e; }
.lvl-starter { --lc: var(--lvl-starter); } .lvl-proficient { --lc: var(--lvl-proficient); } .lvl-expert { --lc: var(--lvl-expert); }
.lvl-specialist { --lc: var(--lvl-specialist); }
.lvl-advanced-specialist { --lc: var(--lvl-advanced-specialist); }
.lvl-principal-specialist { --lc: var(--lvl-principal-specialist); }
.lvl { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: color-mix(in oklab, var(--lc) 18%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--lc) 55%, transparent); }
.lvl::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--lc); }
.lvl-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.scope-line .lvl { align-self: center; }
.lvl-dist { display: inline-flex; width: 84px; height: 8px; border-radius: 999px; overflow: hidden; gap: 1px; vertical-align: middle; background: var(--surface-2); }
.lvl-dist i { background: var(--lc); min-width: 3px; }
.level-card header { align-items: center; }
.level-tracks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.level-tracks h3 { margin: 0 0 4px; }
.level-gaps { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 8px 0 0; }
.level-gaps dd { margin: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .level-tracks { grid-template-columns: 1fr; } }
.note.error { color: var(--bad); }
@media (max-width: 1100px) { #app-admin .compass-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .admin-cols { grid-template-columns: 1fr; } }
@media (max-width: 640px) { #app-admin .compass-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .levels { grid-template-columns: 1fr; } }

/* Tool colours are shared by the comparison table and distribution chart. */
.tool-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.tool-usage-chart { width: 100%; height: auto; color: var(--muted); font: 11px var(--font); }
.tool-usage-chart text { fill: currentColor; }
.tool-usage-chart rect:focus { outline: 2px solid var(--text); outline-offset: 2px; }

/* Me Compass (AIC-14): the Compass pages for one person. Tabs stay in the frame. The header with their level and XP, then their cards, is the page. */
#app-me { display: grid; gap: 14px; }
#app-me .card { grid-column: auto; }
.me-strip { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; gap: 24px; align-items: center; padding: 16px 18px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
#app-me .me-strip { margin-bottom: 0; }
.me-strip[hidden] { display: none; }
.me-who { display: flex; align-items: center; gap: 12px; }
.me-who h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.me-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: var(--lvl-on-expert); background: var(--lvl-expert); flex: none; }
.me-xp { display: grid; gap: 6px; max-width: 520px; }
.me-xp p { margin: 0; }
.me-xp-num { font-size: 13px; color: var(--text-2); } .me-xp-num b { font-size: 24px; font-weight: 600; color: var(--text); margin-right: 2px; }
.me-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.me-bar i { display: block; height: 100%; border-radius: 999px; background: var(--lc); }
.me-end { display: flex; align-items: center; gap: 10px; }
.me-demo { background: var(--warn-bg); color: var(--warn); border-color: transparent; font-weight: 600; }
.me-demo[hidden] { display: none; }
#app-me .me-tabs { margin: 0; }
.me-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.me-tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.me-tasks li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.me-task { display: grid; gap: 2px; font-weight: 500; }
.me-pts { font-weight: 600; font-size: 12.5px; white-space: nowrap; padding: 3px 9px; border-radius: 999px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.me-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.me-stat { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.me-stat .l { font-size: 12px; color: var(--muted); }
.me-stat .v { font-size: 22px; font-weight: 500; }
.me-stat .s { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.me-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.me-chip { font-size: 12.5px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; }
.me-chip.agent { border-style: dashed; }
.me-chip.off { color: var(--muted); }
.me-look { display: grid; gap: 8px; }
.me-look-item { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; border-left: 3px solid var(--muted); background: var(--surface-2); }
.me-look-item.good { border-left-color: var(--good); } .me-look-item.bad { border-left-color: var(--bad); } .me-look-item.flat { border-left-color: var(--accent); }
#me-gates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
#me-gates > :first-child { grid-area: 1 / 1; }
#me-gates:not(:has(.me-proficiency + .me-proficiency, .me-next-step + .me-proficiency)) { grid-template-columns: 1fr; }
.me-gate-list { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.me-gate-label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.me-gate-list progress { appearance: none; display: block; width: 100%; height: 6px; margin-top: 5px; border: 0; border-radius: 999px; background: var(--surface-2); }
.me-gate-list progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.me-gate-list progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.me-gate-list progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.me-next-step { grid-area: 2 / 1; justify-self: start; font-size: 13px; font-weight: 600; }
.me-tasks li:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.me-achievements { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 10px; }
.me-achievements li { display: grid; grid-template-rows: 62px auto 1fr; justify-items: center; gap: 5px; min-width: 0;
  padding: 12px 6px; border-radius: 10px; background: var(--surface-2); text-align: center; font-size: 12px; }
.me-medal { --medal-light: #c0c6d2; --medal-dark: #727e96; position: relative; width: 52px; height: 59px; display: grid; place-items: center;
  clip-path: polygon(50% 0, 95% 17%, 95% 68%, 82% 85%, 50% 100%, 18% 85%, 5% 68%, 5% 17%);
  background: linear-gradient(145deg, #fff 0%, var(--medal-light) 32%, var(--medal-dark) 72%, var(--medal-light) 100%);
  color: #192238; font-size: 28px; font-weight: 700; }
.me-medal::before { content: ''; position: absolute; inset: 4px; clip-path: inherit;
  background: linear-gradient(160deg, var(--medal-light), color-mix(in srgb, var(--medal-light) 60%, white), var(--medal-dark)); }
.me-medal span { position: relative; line-height: 1; }
.me-achievements .locked .me-medal { filter: grayscale(1); opacity: .58; }
.me-achievements .earned { background: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface-2)); }
.me-achievements .violet .me-medal { --medal-light: #c9b5ff; --medal-dark: #7754c7; }
.me-achievements .gold .me-medal { --medal-light: #ffdb7c; --medal-dark: #c18625; }
.me-achievements .rose .me-medal { --medal-light: #ffb0bc; --medal-dark: #c4526a; }
.me-achievements .green .me-medal { --medal-light: #a9efc2; --medal-dark: #3b9e71; }
.me-achievements .blue .me-medal { --medal-light: #a7dcff; --medal-dark: #478fc6; }
#app-me .me-work-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) {
  #me-gates { display: flex; flex-direction: column; align-items: stretch; }
  .me-next-step { align-self: flex-start; }
}

.me-proficiency h3 { font-size: 13px; margin: 0 0 8px; }
/* On a Me page the in-page scope line is redundant; the top-bar picker stays so you can change person. */
body[data-me] #scope-line { display: none !important; }
body[data-me] :is(#tag-breakdown, .tag-metrics) th[scope="row"] { display: block; }
body[data-me] #app-insights .table-wrap { overflow: visible; }
body[data-me] #app-insights table.table, body[data-me] #app-insights table.table tbody, body[data-me] #app-insights table.table tr, body[data-me] #app-insights table.table td { display: block; }
body[data-me] #app-insights table.table thead { display: none; }
body[data-me] #app-insights table.table tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
body[data-me] #app-insights table.table tr { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
body[data-me] #app-insights table.table td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
body[data-me] #app-insights table.table td::before { content: attr(data-label); color: var(--muted); text-align: left; }
body[data-me] #app-insights table.table td:first-child { font-weight: 600; text-align: left; justify-content: flex-start; align-items: center; gap: 8px; padding-bottom: 6px; }
body[data-me] #app-insights table.table td:first-child::before, body[data-me] #app-insights table.table td[colspan]::before { content: none; }
body[data-me] #app-insights table.table td:empty, body[data-me] #app-insights table.table td.me-who-col { display: none; }
body[data-me] #app-insights table.table tfoot { display: none; }
@media (max-width: 1100px) { .me-strip { grid-template-columns: 1fr; } .me-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .me-grid { grid-template-columns: 1fr; } }
/* Repository cycle time uses the same cards, grids and theme as Compass. */
.cycle-toolbar { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; margin: 16px 0; }
.cycle-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.cycle-controls label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.cycle-controls label[hidden] { display: none; }
.cycle-controls select, .cycle-select select { padding: 7px 9px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.cycle-select { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.cycle-card { margin: 14px 0; }
.cycle-section-title { margin: 20px 0 12px; font-size: 18px; }
.cycle-process-grid + .cycle-process-grid { margin-top: 14px; }
.cycle-process-grid:has(> [hidden]) { grid-template-columns: minmax(0, 1fr); }
.cycle-process-grid :is(h3, h4) { margin: 0; font-size: 15px; }
#cycle-review-card:not(:first-child) { margin-top: 16px; }
#cycle-stages tr.cycle-group th { padding-top: 16px; color: var(--text); font-weight: 600; background: transparent; }
#cycle-app [role="tabpanel"][hidden], #cycle-results[hidden] { display: none; }
#cycle-status:empty { display: none; }
#cycle-app .card { min-width: 0; }
.cycle-unit, .cycle-summary { font-size: 12px; color: var(--muted); }
.cycle-info { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; padding: 0; margin-left: 5px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--muted); font: 11px var(--font); cursor: help; vertical-align: middle; }
.cycle-info [role="tooltip"] { display: none; position: absolute; top: 22px; left: -8px; z-index: 20; width: min(360px, 70vw); padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); color: var(--text-2); text-align: left; font: 12px/1.5 var(--font); }
.cycle-info:hover [role="tooltip"], .cycle-info:focus [role="tooltip"] { display: block; }
.cycle-split > .card:last-child .cycle-info [role="tooltip"] { left: auto; right: -8px; }
.cycle-timeline { padding: 8px 8px 0 0; }
.cycle-flow-row, .cycle-flow-axis { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; align-items: center; }
.cycle-flow-row { height: 31px; font-size: 13px; }
.cycle-track { position: relative; height: 100%; background: repeating-linear-gradient(to right, var(--grid) 0 1px, transparent 1px 25%); border-right: 1px solid var(--grid); display: flex; align-items: center; }
.cycle-pending { display: block; height: 22px; line-height: 22px; width: 100%; padding-left: 12px; border-radius: 4px; background: color-mix(in srgb, var(--surface-2) 75%, transparent); color: var(--muted); font-size: 11px; }
.cycle-span { position: absolute; display: block; height: 22px; min-width: 2px; border-radius: 4px; background: repeating-linear-gradient(135deg, transparent 0 5px, #ffffff26 5px 7px), var(--flow-color); }
.cycle-span.building { --flow-color: #279e96; }
.cycle-span.merging { --flow-color: #657de8; }
.cycle-span.review { --flow-color: #d6a23c; }
.cycle-span.rework { --flow-color: #ad76ce; }
.cycle-span.ci { --flow-color: #dc8d40; }
.cycle-flow-axis { padding-top: 10px; color: var(--muted); font-size: 11px; }
.cycle-flow-axis > div { display: flex; justify-content: space-between; }
.cycle-split { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(270px, 1fr); gap: 14px; align-items: start; }
.cycle-split > .card { grid-column: auto; }
#cycle-chart { height: 288px; }
#cycle-trends .cg-host { max-height: 280px; overflow: auto; }
.cycle-open-total { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 22px; color: var(--muted); }
.cycle-open-total strong { color: var(--text); font-size: 32px; font-weight: 500; }
.cycle-age-buckets { display: grid; gap: 25px; padding: 0 0 20px; }
.cycle-bucket { display: grid; grid-template-columns: 68px minmax(0, 1fr) 25px; gap: 14px; align-items: center; font-size: 12px; }
.cycle-bucket > span { color: var(--muted); }
.cycle-bucket strong { text-align: right; font-weight: 500; }
.cycle-bucket-track { height: 18px; border-radius: 3px; background: var(--surface-2); }
.cycle-bucket-track i { display: block; height: 100%; border-radius: 3px; background: #279e96; }
.quality-widgets:not([hidden]) { display: grid; grid-column: 1 / -1; gap: 14px; min-width: 0; }
.quality-widgets > .card { grid-column: auto; }
.quality-widgets [hidden] { display: none; }
.cycle-intake { display: grid; gap: 15px; margin: 20px 0 8px; }
.cycle-intake dt { font-size: 12px; color: var(--muted); }
.cycle-intake dd { font-size: 22px; margin: 4px 0 0; color: var(--muted); }
#cycle-unreviewed-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#cycle-unreviewed-stats dd { color: var(--text); }
.cycle-strong td { font-weight: 600; }
@media (max-width: 850px) { .cycle-split { grid-template-columns: 1fr; } .cycle-flow-row, .cycle-flow-axis { grid-template-columns: 115px minmax(0, 1fr); gap: 8px; } .cycle-controls select { max-width: 210px; } }

/* PR activity (AIC-19) */
.cycle-controls input[type="date"] { padding: 6px 9px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font: inherit; }
#pra-results[hidden], #pra-status:empty { display: none; }
.pra-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.pra-dot.ai { background: var(--c1); }
.pra-dot.bot { background: var(--muted); }
.pra-dot.unaccounted { background: var(--warn); }
.pra-counts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 5px 0 0; }
.pra-counts dt { color: var(--muted); font-size: 11px; }
.pra-counts dd { margin: 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pra-counts small { font-weight: 400; color: var(--muted); font-size: 12px; }
.kpi .value small { font-size: 14px; }
.pra-bucket { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.pra-bucket.ai { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pra-bucket.bot { color: var(--muted); background: var(--surface-2); }
.pra-bucket.unaccounted { color: var(--warn); background: var(--warn-bg); }
#work-links-report { grid-column: 1 / -1; order: 50; min-width: 0; }
#work-links-title { margin: 0 0 12px; font-size: 16px; }
.work-links-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.work-links-grid .card { grid-column: auto; min-width: 0; }
.work-links-grid h3 { margin: 0; font-size: 15px; font-weight: 500; }
.work-links-grid .work-links-wide { grid-column: 1 / -1; }
@media (max-width: 1100px) { .work-links-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { #pra-app .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
