/* Customer dashboard.
   Loaded only by base_dashboard.html and portfolio.html, so login/admin/runs pages
   don't pay for it — which is also why the palette below can sit on :root and
   override the app-wide tokens without leaking off the dashboard.

   Ported from the handover pack's prototype (260906-aeo-handover-v1210hrs/
   dashboard.html) essentially verbatim: same tokens, same class names, same DOM
   contract. Templates emit the prototype's markup, so a rule here should read the
   same as its counterpart there. See docs/ui-design.md.

   Two adaptations the port needs, both because the prototype is a standalone file
   and we render inside base.html:
     - the prototype's .shell is base.html's .layout, and its bare `main` selector
       has to be `main.content` to outrank app.css's `.content`
     - the prototype is a JS-tabbed SPA; we serve a page per panel, so .panel and
       its display toggling are dropped. Sub-nav items are in-page anchors. */

:root {
  --ink: #16241c; --ink2: #4d5f55; --ink3: #83928a;
  --line: #e2e7e3; --line2: #c9d3cc;
  --page: #f7f8f6; --card: #fff; --soft: #f0f3f0;
  --dgreen: #1c7a4e; --green: #1c7a4e; --pale: #eaf3ed; --pale2: #eaf3ed;
  --gold: #a8790c; --palegold: #f7edd6;
  --bad: #8c3a2b; --palebad: #f7e5e0;
  /* The MICHELIN Guide's red, for the key emblem on a portfolio card only. */
  --michelin: #c8102e;
  --bar-you: #1c7a4e; --bar-other: #a8b3ac; --bar-track: #ecefec;
  --r: 10px;
  /* Chart.js reads colour vars off document.documentElement (static/js/charts.js),
     so the series colour has to be global rather than scoped to a component. */
  --chart-you: #1c7a4e;
}

* { box-sizing: border-box; }
/* `hidden` is display:none in the UA sheet at the weakest possible specificity, so any
   class that sets display wins over it — .btn is inline-block, which is why the Clear
   button stayed on screen after the script had hidden it. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
a { cursor: pointer; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: var(--font, Inter), Inter, system-ui, sans-serif; font-size: 14px; line-height: 1.55;
  font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased;
}

/* Landing-look backdrop: the gausslabshq.com background grid and colour washes, drawn
   behind the content area only - the sidebar keeps its solid green. Same construction
   as the landing page's .bg-grid / .bg-washes: fixed full-viewport layers at z-index 0
   under .layout, so the page ground shows them and opaque cards cover them. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .7;
  background-image: linear-gradient(rgba(26,28,32,.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(26,28,32,.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,1), rgba(0,0,0,.55) 55%, rgba(0,0,0,.8));
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,1), rgba(0,0,0,.55) 55%, rgba(0,0,0,.8));
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 620px at 8% 4%, rgba(232,121,28,.12), transparent 60%),
    radial-gradient(900px 700px at 96% 10%, rgba(28,122,78,.10), transparent 62%),
    radial-gradient(1000px 700px at 50% 96%, rgba(232,121,28,.07), transparent 60%);
}
/* Keep the shell above the backdrop layers. */
.topbar, .layout { position: relative; z-index: 1; }

/* ---------- shell ----------
   base.html gives us <div class="layout"><nav …>…<main class="content">, which is
   the prototype's .shell / .nav / main. */
.layout { display: flex; align-items: flex-start; min-height: 100vh; }
main.content { flex: 1; min-width: 0; padding: 32px 38px 100px; }
main.content:has(> .dimensions-page) { max-width: none; }
/* The portfolio card grid uses the full desktop width like the dimensions page. */
main.content:has(> .pfpage) { max-width: none; }
/* The recommendation detail page (Content gen) uses the full desktop width. */
main.content:has(> #recommendation-ui[data-page="detail"]) { max-width: none; }
/* Anchored sub-sections land a little below the viewport edge rather than flush. */
[id] { scroll-margin-top: 18px; }

.nav {
  width: 256px; flex: 0 0 256px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--dgreen); padding: 24px 0 30px; display: flex; flex-direction: column;
}
/* The product mark, above the property it is showing. Doubles as the way back to the
   portfolio, which is where the old chrome-bar back link went.
   
   The lockup is the brand's: the mark, then "Gauss Labs" set in Archivo (--figs) at
   700, one colour, with the space. It was "GaussLabs" with a gold second word, which is
   neither the spelling nor the treatment. White here rather than the brand's near-black
   only because this sits on the dark sidebar; the login card uses ink. */
.navlogo {
  display: flex; align-items: center; gap: 10px; padding: 0 22px 18px;
  color: #fff; text-decoration: none;
}
.navlogo img { display: block; }
.navlogo span {
  font-family: var(--figs); font-weight: 700; font-size: 16px; letter-spacing: -.02em;
}
.navlogo:hover span { opacity: .85; }
.nav .id { padding: 0 14px 15px; margin-bottom: 8px; border-bottom: 1px solid var(--greennav); }
.nav .id label { display: block; color: rgba(255,255,255,.55); font-size: 10.5px; font-weight: 600; letter-spacing: 1.4px; margin: 0 6px 5px; }
.nav .id select {
  display: block; width: 100%; color: #fff; background: var(--dgreen);
  border: 1px solid var(--greennav); border-radius: var(--r-sm);
  padding: 9px; font: inherit; font-size: 12px; font-weight: 500;
}
/* Some browser profiles enhance selects with bb-customSelect. Use only the native
   control here: its onchange owns property navigation, and the injected opener otherwise
   creates a second visible property name above it. */
.nav .id .bb-custom-select-container:has(#nav-property) > .bb-custom-select-opener,
.nav .id .bb-custom-select-container:has(#nav-property) > .bb-custom-select-panel {
  display: none !important;
}
.nav .id .bb-custom-select-container:has(#nav-property) #nav-property {
  display: block !important; position: static !important; visibility: visible !important;
  opacity: 1 !important; pointer-events: auto !important; width: 100% !important;
}
.nav .id select option { background: var(--dgreen); }
/* Themed property picker (26 Oct): a details/summary listbox - the native select's
   macOS popup stayed grey whatever the CSS. The summary borrows the select's shell. */
.nav .id .nav-prop { position: relative; }
.nav .id .nav-prop summary {
  display: block; box-sizing: border-box; width: 100%; color: #fff; background: var(--dgreen);
  border: 1px solid var(--greennav); border-radius: var(--r-sm);
  padding: 9px 26px 9px 9px; font: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; list-style: none; position: relative;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav .id .nav-prop summary::-webkit-details-marker { display: none; }
.nav .id .nav-prop summary::after {
  content: ""; position: absolute; right: 11px; top: 50%; margin-top: -2px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid rgba(255,255,255,.75);
}
.nav .id .nav-prop[open] summary { border-radius: var(--r-sm) var(--r-sm) 0 0; }
.nav .id .nav-prop-list {
  position: absolute; left: 0; right: 0; z-index: 40; margin-top: -1px;
  background: var(--dgreen); border: 1px solid var(--greennav);
  border-radius: 0 0 var(--r-sm) var(--r-sm); max-height: 264px; overflow-y: auto;
}
.nav .id .nav-prop-list a {
  display: block; padding: 8px 10px; color: #fff; font-size: 12px; font-weight: 500;
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav .id .nav-prop-list a:hover { background: rgba(255,255,255,.12); }
.nav .id .nav-prop-list a.current { font-weight: 650; }
/* Untracked explicit-current row: named so the page is identifiable, greyed and
unselectable because it is not a tracked choice (29 Oct, Hitanshu's report). */
.nav .id .nav-prop-list span.untracked {
  display: block; padding: 8px 10px; color: rgba(255,255,255,.45); font-size: 12px;
  font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: default;
}
.nav .id .nav-run { margin-top: 12px; }
/* The spacer pins Settings and the utility links to the bottom on desktop. */
.nav .navsp { margin-top: auto; padding-top: 10px; }
.navgrp { margin-bottom: 2px; }
.nav-divider { border-top: 1px solid var(--greennav); margin: 10px 0; }
.nav-divider-soft { border-top-color: rgba(255,255,255,.25); }
.navtop {
  display: block; width: 100%; text-align: left; appearance: none; background: none; border: 0;
  font: inherit; font-size: 13px; color: #fff; padding: 9px 22px; cursor: pointer;
  line-height: 1.35; text-decoration: none;
}
.navtop:hover { color: #fff; }
/* Baseline owns these two panels; their pages sit one further level in. */
.navgrp.nav-child > .navtop { padding-left: 34px; font-weight: 400; }
.navgrp.nav-child > a.sub { padding-left: 46px; }
.nav-placeholder { cursor: default; }
.nav-placeholder:hover { color: #fff; }
/* One light-green active treatment, including nested destinations. */
.navgrp.on > .navtop, .navgrp a.sub.on {
  color: var(--greendk); font-weight: 500; background: var(--greennav);
}
.navgrp a.sub { display: none; margin: 0; }
@media (min-width: 861px) {
  .navgrp a.sub { display: block; }
}
.navgrp a.sub {
  font-size: 12.5px; color: var(--pale); text-decoration: none;
  padding: 6px 22px 6px 34px; line-height: 1.35;
}
.navgrp a.sub:hover { color: #fff; }
.navgrp a.sub.on:hover { color: var(--greendk); }
.navgrp.expanded { padding-bottom: 4px; }
.navout { padding: 7px 22px 0; margin-top: 3px; }
.navout button {
  appearance: none; background: none; border: 0; padding: 0; font: inherit;
  font-size: 12.5px; color: var(--pale); cursor: pointer;
}
.navout button:hover { color: #fff; }
/* At the drawer breakpoint, retain its original selected-group disclosure behavior. */
@media (max-width: 860px) {
  .navgrp.expanded a.sub { display: block; }
}
.navtag {
  display: inline; font-size: 10px; font-weight: 400; color: var(--pale);
  margin-left: 6px; vertical-align: baseline;
}

/* ---------- type ---------- */
h1 { font-size: 25px; font-weight: 500; margin: 0 0 3px; letter-spacing: normal; }
h2 { font-size: 20px; font-weight: 500; margin: 0 0 5px; letter-spacing: normal; }
h3 { font-size: 16px; font-weight: 500; margin: 0 0 5px; }
h1 .chev { font-size: 14px; color: var(--ink3); font-weight: 400; vertical-align: middle; }
.sub { color: var(--ink2); font-size: 13px; margin: 0 0 26px; }
.sub2 { color: var(--ink2); font-size: 12.5px; margin: 0 0 18px; }
.sec { padding-top: 36px; margin-top: 36px; border-top: 1px solid var(--line2); }
.sec:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.blk { margin-top: 30px; }
.ovw { padding-bottom: 6px; }
.lab { font-size: 11px; color: var(--ink3); margin: 0 0 7px; display: flex; justify-content: space-between; gap: 14px; }
.ttl { font-size: 13px; font-weight: 500; margin: 0 0 11px; }
.ttl.s { font-size: 12px; margin-bottom: 7px; }
.bhead { font-size: 12.5px; font-weight: 500; color: var(--ink2); margin: 0 0 11px; }
/* A second heading inside one block starts a new subject, so it needs air above
   it — otherwise it reads as a caption on the thing before it. */
.bhead.next { margin-top: 22px }
.shead { display: block; font-size: 13px; font-weight: 500; margin: 0 0 11px; }
.shead em { font-style: normal; font-weight: 400; font-size: 11px; color: var(--ink3); }
.meta {
  margin: 11px 0 0; font-size: 11.5px; color: var(--ink3); line-height: 1.6;
  display: block; overflow: visible;
}
.def { margin: 6px 0 0; font-size: 12px; color: var(--ink2); }
.mut { color: var(--ink3); }
.split-rule { border-top: 1px solid var(--line2); margin: 26px 0 22px; }
.subrule { border-top: 1px solid var(--line); margin: 32px 0 0; }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 18px; }
.soft { background: var(--soft); border-radius: var(--r); padding: 13px 15px; }
.grid { display: grid; gap: 11px; align-items: stretch; }
.grid > .card, .grid > .soft { display: flex; flex-direction: column; height: 100%; }
.grid > .card > .def, .grid > .soft > .def { margin-bottom: 0; min-height: 3.1em; }
.grid > .card > .meta, .grid > .soft > .meta { margin-top: 0; padding-top: 12px; min-height: 3.4em; }
/* The prototype's summary cards are divs; ours are real links, so they need
   blockifying — an inline <a> collapses the card and its text spills out. */
a.card, a.soft { display: block; }
a.card, a.soft, .go { color: inherit; text-decoration: none; transition: border-color .12s, background .12s; }
/* headline figure beside its delta */
.numrow { display: flex; align-items: baseline; gap: 10px; }
.go { cursor: pointer; }
.card.go:hover { border-color: var(--green); }
.soft.go:hover { background: var(--pale2); }
.go:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.num { font-size: 30px; font-weight: 500; line-height: 1.04; font-family: inherit; color: var(--ink); }
.num.sm { font-size: 22px; }
.dlt { font-size: 12px; color: var(--ink3); }
.dlt.up { color: var(--green); }
.dlt.dn { color: var(--bad); }
.dlt.ph { color: var(--ink3); }

/* ---------- hero stat ---------- */
.hero { display: flex; align-items: center; gap: 28px; padding: 4px 0 18px; flex-wrap: wrap; }
.hero .fig { font-size: 62px; font-weight: 500; line-height: .92; letter-spacing: -.02em; }
.hero .side { flex: 1; min-width: 260px; }
.hero .side p { margin: 0 0 9px; font-size: 13.5px; color: var(--ink2); }
.split { display: flex; gap: 30px; flex-wrap: wrap; font-size: 12px; color: var(--ink3); }
.split b { display: block; font-size: 17px; font-weight: 500; color: var(--ink); line-height: 1.2; }

/* ---------- bars ---------- */
/* The columns live on `.bars`, and each row borrows them with `subgrid`. That is the
   whole trick: every `.row` is its own grid, so sizing the label column per row — which
   is what `auto` did — measured each label separately and the bars started at a
   different x on every line. Declared once on the parent, `max-content` is the widest
   label across the whole chart, so the bars align and no more space is held back than
   the longest label needs.

   Behind @supports because a dropped `grid-template-columns` would not degrade — it
   would stack every label, bar and value vertically. Without subgrid the rows fall back
   to the proportional split they had before. */
.bars { display: grid; gap: 9px; }
.card > .bars { padding: 2px 0; }
/* The proportional fallback, for anything without subgrid. */
.row {
  display: grid; grid-template-columns: minmax(90px, 1fr) minmax(0, 3fr) 78px;
  align-items: center; gap: 12px;
}
@supports (grid-template-columns: subgrid) {
  .bars {
    gap: 9px 12px;
    grid-template-columns: minmax(90px, max-content) minmax(0, 1fr) 78px;
  }
  /* No `gap` here: a subgrid inherits the parent's, and setting it to zero is what
     ran the longest label straight into its bar. `.bars` owns both gaps — 12px
     between the columns, 9px between the rows. */
  .row { grid-template-columns: subgrid; grid-column: 1 / -1; }
  .bars.mini { grid-template-columns: 112px minmax(46px, 1fr) 56px; gap: 9px 11px; }
}
/* Capped so one long label cannot squeeze the bar it labels: past this it wraps
   rather than pushing the chart over. The cap also bounds the max-content track. */
.row .k { font-size: 13px; color: var(--ink); max-width: 280px; overflow-wrap: anywhere; }
.row .t { height: 22px; background: var(--bar-track); border-radius: 5px; overflow: hidden; }
.row .t i { display: block; height: 100%; background: var(--bar-you); }
.row .t i.other { background: var(--bar-other); }
.row .v { text-align: right; font-size: 13px; font-weight: 500; color: var(--ink); }
.row .v small { display: block; font-weight: 400; font-size: 11px; color: var(--ink3); margin-top: 0; }
.mini .row { grid-template-columns: 112px minmax(46px, 1fr) 56px; gap: 11px; }
.mini .row .k { white-space: nowrap; font-size: 12.5px; color: var(--ink); }
.mini .row .v small { white-space: nowrap; }
.mini .row .t { height: 15px; }
.mini .row .v { font-size: 12.5px; color: var(--ink); }
.tt { display: block; height: 13px; background: var(--bar-track); border-radius: 4px; overflow: hidden; }
.tt i { display: block; height: 100%; background: var(--bar-other); }

/* ---------- share-of-voice tables ---------- */
.sov td { padding: 7px 8px 7px 0; }
.sub-cell { font-size: 12px; color: var(--ink2); }
.bad-cell { font-size: 12px; color: var(--bad); }
.good-cell { font-size: 12px; color: var(--green); }
.sov { table-layout: auto; }
/* The name is as wide as it needs to be; the bar takes the rest. `width: 100%` on a
   table cell is a instruction to grow, not a literal width — the other two columns
   size to their content and this one absorbs the remainder. */
.sov th.sov-bar, .sov td:nth-child(2) { width: 100%; }
.sov td:nth-child(1) { white-space: nowrap; padding-right: 18px; }
.sov td:nth-child(2) { padding-right: 18px; }
.sov td:nth-child(n+3) { width: 84px; padding-right: 0; }
.sov tr.me td { font-weight: 500; }
.sov tr.me .tt i { background: var(--bar-you); }
.sov tr.bench td { border-top: 1px solid var(--line2); color: var(--ink2); font-style: italic; }
.sov tr.bench .tt i { background: var(--bar-other); }

/* The outcome competitor chart uses the same name / bar / value columns on
   phones, but all three fit inside the card. Names wrap instead of taking the bar's
   width; the measured value remains on-screen without a sideways scroll. */
@media (max-width: 760px) {
  .metric-page .sov { table-layout: fixed; width: 100%; }
  .metric-page .sov col.sov-name-col { width: 48%; }
  .metric-page .sov col.sov-value-col { width: 64px; }
  .metric-page .sov td:nth-child(1), .metric-page .sov th:nth-child(1) {
    white-space: normal; overflow-wrap: anywhere; padding-right: 10px;
  }
  .metric-page .sov td:nth-child(2) { padding-right: 8px; }
  .metric-page .sov th.sov-bar, .metric-page .sov td:nth-child(2) { width: auto; }
  .metric-page .sov td:nth-child(3), .metric-page .sov th:nth-child(3) {
    width: 64px; overflow-wrap: anywhere;
  }
}

/* stacked categorical bar: colour encodes the category across every row, and the
   property's own row is marked by label weight instead. Negative always --bad:
   it is a flag, not a step in the ramp. */
.stack { display: flex; height: 15px; background: var(--bar-track); border-radius: 3px; overflow: hidden; }
.stack i { display: block; height: 100%; }
.stack i + i { box-shadow: inset 1px 0 0 #fff; }
.stack i.a { background: #6f7f76; }
.stack i.b { background: #aab5ae; }
.stack i.c { background: #dfe4e0; }
.stack i.d { background: var(--bad); }
.key { display: flex; gap: 16px; margin: 10px 0 0; font-size: 11px; color: var(--ink3); }
.key span { display: flex; align-items: center; gap: 5px; }
/* The swatch classes mirror .stack i — the prototype set these inline; keeping them
   here is what lets the templates hold no inline colour at all. */
.key b { display: block; width: 9px; height: 9px; border-radius: 2px; }
.key b.a { background: #6f7f76; }
.key b.b { background: #aab5ae; }
.key b.c { background: #dfe4e0; }
.key b.d { background: var(--bad); }

/* ---------- buttons ----------
   app.css builds .btn from --ink, a near-black that belongs to the app shell. On the
   dashboard the palette is green, and a control that is nearly black reads as a
   different product. Secondary is the same green, outlined: "Cancel" beside "Add
   prompt" was falling through to the browser's own grey button chrome, which is what
   made the dialog look unfinished. */
.btn { background: var(--dgreen); border-color: var(--dgreen); color: #fff; }
.btn:hover { background: var(--greendk); border-color: var(--greendk); opacity: 1; }
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.btn.secondary { background: var(--card); color: var(--dgreen); border-color: var(--line2); }
.btn.secondary:hover {
  background: var(--pale2); border-color: var(--green); box-shadow: none; opacity: 1;
}
.btn.sm { font-size: 12.5px; padding: 7px 14px; }

/* The shared form focus ring is --vis, the app's blue. Nothing else on the dashboard is
   blue, so a focused field was the one thing on screen from another palette. */
form.styled input:focus, form.styled select:focus, form.styled textarea:focus {
  outline-color: var(--green); border-color: var(--green);
}

/* ---------- sign in ----------
   Its own centred card on the page ground, with no sidebar and no chrome bar. */
/* base.html wraps every page in main.content, which is capped at 900px and sits at the
   left of the layout — right for a dashboard beside a sidebar, wrong for a sign-in page
   that has no sidebar and should sit in the middle of the window. */
main.content:has(> .signin) { max-width: none; padding: 0; }
.signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.signin-card {
  width: min(420px, 100%); background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 34px 34px 30px; box-shadow: var(--menu);
}
/* The same lockup on the brand's own ground, so here the wordmark is ink. */
.signin-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.signin-brand img { display: block; }
.signin-brand span {
  font-family: var(--figs); font-weight: 700; font-size: 20px; letter-spacing: -.02em;
  color: var(--ink);
}
.signin-card h1 { font-size: 23px; margin: 0 0 4px; }
.signin-card .sub { margin-bottom: 22px; }
.signin-card form.styled label { margin-top: 16px; }
.signin-card form.styled input { max-width: none; }
.signin-card .btn { width: 100%; margin-top: 24px; text-align: center; }
.signin.addprop .signin-card .btn { border-radius: 8px; }
.signin .pw-field { position: relative; }
.signin .pw-field input { padding-right: 46px; }
.signin .pw-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0; background: transparent; border: 0; border-radius: 8px; color: var(--ink2); cursor: pointer; }
.signin .pw-toggle:hover { color: var(--ink); background: var(--soft); }
.signin .pw-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.signin .pw-toggle .pw-eye-off { display: none; }
.signin .pw-toggle.on .pw-eye { display: none; }
.signin .pw-toggle.on .pw-eye-off { display: inline; }
.signin-reset { display: block; margin-top: 16px; font-size: 12.5px; color: var(--ink2); text-decoration: none; }
.signin-reset:hover { color: var(--ink); }
.signin .errorlist { margin: 0 0 4px; padding: 0; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; font-size: 11px; color: var(--ink3); padding: 0 8px 7px 0; border-bottom: 1px solid var(--line); }
td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; padding-right: 0; }

/* A link in a table cell. There was no rule for one, so it fell through to the
   browser's default blue underline — the only place on the dashboard that happened.
   Same treatment as a link in a takeaway: the text keeps its colour and a hairline
   carries the affordance. */
td a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line2); }
td a:hover { border-bottom-color: var(--ink3); }

.chip { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 20px; background: var(--pale); color: var(--dgreen); border: 0; }
.chip.g { background: var(--palegold); color: var(--gold); }
.chip.b { background: var(--palebad); color: var(--bad); }
.chip.n { background: var(--soft); color: var(--ink2); }

/* ── Prompts ──────────────────────────────────────────────────────────────
   Search bar, the add-prompt dialog, and an answer's own prose. The dialog is a
   native <dialog>, so the backdrop, focus trap and Escape key are the browser's
   job rather than ours. */
.promptbar { display: flex; gap: 8px; align-items: center; margin: 0 0 14px; }
.promptbar input[type=search] {
  flex: 1; min-width: 0; font: inherit; font-size: 13px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 7px 11px;
}
.promptbar input[type=search]:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--pale2);
}
/* The pager's controls are buttons now that paging happens in the browser, so they
   have to be un-buttoned back to the link they look like everywhere else. */
.pager .linkbtn {
  font: inherit; font-size: 12px; color: var(--ink2); background: none; border: 0;
  padding: 0; cursor: pointer; border-bottom: 1px solid var(--line2);
}
.pager .linkbtn:hover:not(:disabled) { color: var(--ink); border-bottom-color: var(--ink3); }
.pager .linkbtn:disabled { color: var(--ink3); border-bottom-color: transparent; cursor: default; }

.modal {
  /* `margin: auto` is what centres a modal <dialog>, and app.css's `* { margin: 0 }`
     had already taken it away — which is why this opened hard against the top left. */
  margin: auto;
  width: min(520px, calc(100vw - 32px)); border: 1px solid var(--line);
  border-radius: var(--r); background: var(--card); color: var(--ink); padding: 22px 24px;
  box-shadow: 0 12px 40px rgba(22, 36, 28, .18);
}
.modal::backdrop { background: rgba(22, 36, 28, .35); }
.modal h3 { margin: 0 0 4px; }
.modal .sub2 { margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* An assistant's answer is prose it wrote, not a figure we computed. Left as written,
   with its own line breaks kept. */
.answer { margin: 0; white-space: pre-wrap; font-size: 13px; line-height: 1.7; }

/* One panel per assistant, paging through that assistant's answers. The rule under
   .shead carries the boundary; the extra space above a following group is what stops
   two assistants reading as one list. */
.answer-group + .answer-group { margin-top: 34px; }
.answer-group .pager { padding-top: 12px; }
/* A panel holds one answer at a time, and answers differ wildly in length. Without a
   floor the panel collapses to two lines and the pager jumps up the page between
   clicks; with a ceiling a very long answer scrolls inside its own panel rather than
   pushing the assistant below it off the screen. */
.answer-card { min-height: 150px; max-height: 60vh; overflow-y: auto; }

/* ---------- stated empty states (design-spec.md §8) ---------- */
.empty, .emptybox, .empty-state {
  background: var(--soft); border: 1px dashed var(--line2); border-radius: var(--r);
  padding: 20px 18px; color: var(--ink2); font-size: 13px;
}
.empty b, .emptybox b { display: block; font-weight: 500; color: var(--ink); margin-bottom: 3px; }
.note { background: var(--palegold); border: 1px solid #e8d5a8; border-radius: var(--r); padding: 13px 16px; font-size: 12.5px; color: #6b4c05; }
.note b { font-weight: 500; }
.quote { border-left: 2px solid var(--line2); padding-left: 12px; margin: 9px 0 0; color: var(--ink); font-size: 12.5px; line-height: 1.6; }
.grid > .card > .quote { margin-bottom: 0; }
code { background: var(--soft); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; font-family: ui-monospace, monospace; }
ul.t { margin: 6px 0 0; padding-left: 17px; font-size: 12.5px; color: var(--ink2); }
ul.t li { margin-bottom: 4px; }
dl.m { margin: 0; display: grid; grid-template-columns: 150px 1fr; gap: 6px 16px; font-size: 12.5px; }
dl.m dt { color: var(--ink3); }
dl.m dd { margin: 0; color: var(--ink2); }

.tobuild {
  display: inline-block; vertical-align: middle; font-size: 11px; font-weight: 400;
  background: var(--palegold); color: var(--gold); border-radius: 20px; padding: 3px 10px; margin-left: 8px;
}
.plist { margin-top: 4px; }
.pname { font-size: 13px; padding: 7px 0; border-top: 1px solid var(--line); }
.pname:first-child { border-top: 0; }
.todo { display: grid; grid-template-columns: 170px 1fr; gap: 22px; align-items: start; }
.todo-l { border-right: 1px solid var(--line); padding-right: 20px; }

/* The small numeral before a block heading — i, ii, iii within a view. The page-level
   numbers this also carried are gone: the sidebar is the order, and a "3" beside a
   title read as a rank rather than a position. */
.lvl { color: var(--gold); font-weight: 500; margin-right: 7px; font-variant-numeric: normal; }

/* ---------- chrome bar (the prototype's .chrome; carries our working menus) ---------- */
.chrome { display: flex; align-items: center; gap: 9px; margin-bottom: 20px; flex-wrap: wrap; }
.chrome .back {
  font-size: 12.5px; color: var(--ink2); text-decoration: none;
  background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer;
}
.chrome .back:hover { color: var(--ink); }
/* The trail that replaced the property switcher. Sized like the .back link it also
   replaced, so the chrome bar keeps its weight — the current page is the only part that
   takes full ink, because everything before it is somewhere to go rather than where you
   are. */
.chrome .spacer { flex: 1; }
.chrome .ctl, .chrome select.ctl {
  font-size: 12px; color: var(--ink2); border: 1px solid var(--line); border-radius: 7px;
  padding: 4px 10px; background: var(--card); font-family: inherit;
}
/* The period a customer sees is a label, not a control. It used to carry .ctl, which is
   the admin's run picker, so it sat in the chrome bar boxed and bordered beside the
   property switcher and invited a click that does nothing. Same size and colour, no
   affordance. */
.chrome .period { font-size: 12px; color: var(--ink3); padding: 4px 2px; font-family: inherit; }
.chrome .badge { font-size: 11px; color: var(--ink3); background: var(--soft); border-radius: 7px; padding: 4px 9px; }
.chrome .badge-link { text-decoration: none; display: inline-block; }
.chrome .badge-link:hover { background: var(--pale2); color: var(--ink2); }
.chrome .cog {
  font-size: 14px; color: var(--ink3); background: none; border: 0; cursor: pointer;
  padding: 4px 6px; line-height: 1;
}
.chrome .cog svg { display: block; width: 14px; height: 14px; }
.chrome .cog svg path { fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.chrome .cog:hover { color: var(--ink); }
.menuwrap { position: relative; }
.menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 270px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--menu, 0 8px 24px rgba(22, 36, 28, .12)); padding: 6px;
}
.menu.right { left: auto; right: 0; width: 220px; }
.menu.open { display: block; }
.menu .mi {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px;
  text-decoration: none; color: var(--ink); font-size: 13px;
}
.menu .mi:hover, .menu .mi.cur { background: var(--soft); }
.menu .mi img { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; flex: none; }
.menu .mi .nm { display: block; font-size: 13px; font-weight: 500; }
.menu .mi .lc { display: block; font-size: 11.5px; color: var(--ink3); }
.menu .mi .tick { margin-left: auto; color: var(--green); }
.menu .div { height: 1px; background: var(--line); margin: 7px 4px; }
.menu .all { display: block; padding: 8px 10px; border-radius: 7px; text-decoration: none; color: var(--ink2); font-size: 12.5px; }
.menu .all:hover { background: var(--soft); color: var(--ink); }
.menu .logout { width: 100%; text-align: left; border: 0; background: none; font: inherit; cursor: pointer; color: var(--ink); }

/* ---------- portfolio ---------- */
.wrap { max-width: var(--content-max, 1080px); margin: 0 auto; }
.grouphd { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 26px 0 22px; }
.grouphd h1 { font-size: 28px; }
.grouphd p { margin: 8px 0 0; color: var(--ink2); font-size: 14px; }
.props { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.padd {
  display: inline-block; margin-top: 10px; padding: 8px 14px; border-radius: 8px;
  background: var(--dgreen); border: 1px solid var(--dgreen); color: #fff;
  font-size: 13px; font-weight: 500; text-decoration: none;
}
.padd:hover { background: var(--green); border-color: var(--green); }
.prop {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; text-decoration: none; color: inherit; display: block;
  transition: border-color .14s ease;
}
.prop:hover { border-color: var(--green); }
.prop-empty { background: var(--soft); color: var(--ink2); }
/* An unmeasured property keeps its photo in colour: a portfolio is mostly unmeasured
   hotels at first, and a page of grey photos reads as broken rather than as "not yet". */
.prop-empty .pempty { margin-top: 12px; font-size: 12px; color: var(--ink3); }
.prop-empty:hover, .prop-empty:focus-visible { border-color: var(--green); }
.prop .ph { position: relative; aspect-ratio: 16 / 10; background: var(--line); }
.prop .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* MICHELIN Keys: red stroked emblems drawn straight onto the photo's top-left, as the Guide
   and the hotels' own sites show them; a soft shadow keeps the line legible over a bright
   sky. The photo file itself is untouched. */
.prop .mkeys {
  position: absolute; top: 12px; left: 12px; display: inline-flex; gap: 2px;
  color: var(--michelin); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
}
.prop .mkey { display: block; width: 38px; height: 38px; }
.prop .mkey path { stroke-width: 2.2; }
.propfilter { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.propfilter[hidden] { display: none; }
.propfilter input[type=search] {
  flex: 0 1 320px; min-width: 0; font: inherit; font-size: 13px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 11px;
}
.propfilter input[type=search]:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--pale2);
}
.propfilter-n { font-size: 12px; color: var(--ink3); }
.prop .body { padding: 16px 18px 18px; }
.prop h3 { font-size: 15px; font-weight: 500; margin: 0; color: var(--ink); }
.prop .loc { color: var(--ink3); font-size: 12.5px; margin-top: 3px; }
.pchips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 15px; }
.pchip { border-radius: 7px; padding: 8px 6px; text-align: center; background: var(--soft); }
.pchip .cv { font-size: 14px; font-weight: 500; color: var(--ink); }
.pchip .cv.none { font-size: 12.5px; color: var(--ink3); }
.pchip .cl { font-size: 10px; letter-spacing: 0.03em; margin-top: 2px; color: var(--ink3); }

/* ---------- page head (settings/reports keep a plain heading) ---------- */
.phead { margin-bottom: 18px; }
.phead p { margin: 7px 0 0; color: var(--ink2); font-size: 13px; }
.crumb { font-size: 12.5px; color: var(--ink3); margin-bottom: 7px; }
.crumb a { color: var(--ink3); text-decoration: none; }
.crumb a:hover { color: var(--ink); }

/* ---------- settings fields ---------- */
.field { padding: 13px 0; border-top: 1px solid var(--line); display: flex; gap: 18px; align-items: flex-start; }
.field:first-of-type { border-top: 0; }
.field .lb { width: 180px; flex: none; color: var(--ink3); font-size: 13px; padding-top: 2px; }
.field .vl { flex: 1; font-size: 13.5px; }
.field .vl small { display: block; color: var(--ink3); font-size: 12px; margin-top: 3px; }

@media (max-width: 900px) { .props { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) {
  .todo { grid-template-columns: 1fr; }
  .todo-l { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; }
}
@media (max-width: 860px) {
  /* stretch: the desktop row's flex-start, in a column, sized the content to its widest
     child, so a table with a minimum width pushed the page past the screen. */
  .layout { flex-direction: column; align-items: stretch; }
  .navgrp.expanded a.sub { padding-left: 34px; }
  .navgrp.nav-child.expanded a.sub { padding-left: 46px; }
  main.content { padding: 20px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .hero .fig { font-size: 46px; }
  .row { grid-template-columns: minmax(90px, 1fr) minmax(0, 2fr) 66px; gap: 10px; }
  .props { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── TYPE RULE ───────────────────────────────────────────────────
   A label naming a thing            13px, --ink        (bar labels, table cells)
   A value                           13px, 500, --ink
   Its sample size or sub-figure     11px, --ink3
   Column headers                    11px, 500, --ink3
   Commentary under a visual         11.5px, --ink3
   Nothing that names a thing is ever set in a lighter colour than
   anything else that names a thing.
   ────────────────────────────────────────────────────────────────
   BAR COLOUR RULE
   Colour says WHOSE number it is, never whether it is good or bad.
     default  green  var(--bar-you)    a value belonging to this property
     .other   grey   var(--bar-other)  a rival, a benchmark, or a non-you category
     track           var(--bar-track)  the empty remainder
   Length carries good and bad. Never add a third bar colour.
   ──────────────────────────────────────────────────────────────── */

/* ── Detail pages ─────────────────────────────────────────────────────────
   A recommendation brief and a check detail are reached from a table row, so
   they need a way back that is not the browser button. */
.steps { margin: 0; padding-left: 20px }
.steps li { padding: 5px 0; line-height: 1.5 }
.steps li + li { border-top: 1px solid var(--rule) }

.scope { margin: 0; padding-left: 18px; list-style: none }
.scope li { padding: 3px 0; word-break: break-all; font-size: 12px }

/* ── Filters and pagination ───────────────────────────────────────────────
   The recommendations page groups by kind of work, each group carrying its own
   rail (see .audit-workgroup). A kind with nothing in it keeps its filter chip
   and shows a zero: an empty Publications group is a finding about thin
   evidence, not a gap to fill with invented actions. */
.pager {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 2px 0; font-size: 12px;
}
.pager a { color: var(--ink2); text-decoration: none; border-bottom: 1px solid var(--rule) }
.pager a:hover { color: var(--ink) }
.chrome .back.on { color: var(--ink); border-bottom: 1px solid var(--ink3) }

/* A card whose analysis is not written yet. Muted and stated, not hidden: an empty space
   reads as a view that has nothing to say, where this one has not been written. */
.structure-takeaways.pending, .structure-related.pending { border-style: dashed }
.structure-takeaways.pending p, .structure-related.pending p {
  margin: 10px 0 0; font-size: 12.5px; color: var(--ink3);
}

/* One check, as v3 draws it: a card carrying where the rule lives, what it asks, and
   how it came out. Tables put the verdict in a column where it reads as data; the badge
   makes it the thing you scan for. */
.audit-list-row {
  display: flex; gap: 15px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 15px 16px; margin: 8px 0;
}
.audit-list-row > div:first-child { flex: 1; min-width: 0 }
.audit-list-row h4 { font-size: 13px; font-weight: 500; margin: 4px 0 }
.audit-list-row p { font-size: 12px; line-height: 1.6; color: var(--ink2); margin: 6px 0 0 }
.audit-list-row .audit-label {
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3);
}
.audit-list-row .checklink {
  font-size: 12px; color: var(--ink2); text-decoration: none; white-space: nowrap;
  border-bottom: 1px solid var(--rule);
}
.audit-list-row .checklink:hover { color: var(--ink) }
.audit-pill.pass { background: var(--greenbg); color: var(--greendk) }
.audit-pill.work { background: #fbebe1; color: #96502b }
.audit-pill.confirm { background: #f6efdb; color: #7a5c1e }
.audit-pill.optional { background: var(--soft); color: var(--ink3) }

/* The filter row above a rule list: area on the left, result on the right, the current
   choice marked. Server-side links rather than selects, so a filtered view can be shared
   and the back button does what a reader expects. */
.audit-toolbar {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px;
}
.audit-toolbar label { font-size: 11px; color: var(--ink3); display: inline-flex;
  align-items: center; gap: 6px }
.audit-toolbar .audit-filter {
  font: inherit; font-size: 12px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 5px 8px;
}
.audit-toolbar .audit-label { font-size: 10px; color: var(--ink3) }
.audit-toolbar .audit-spacer { flex: 1 }
.audit-toolbar .audit-btn {
  font-size: 12px; color: var(--ink2); text-decoration: none; padding: 4px 9px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
}
.audit-toolbar .audit-btn:hover { border-color: var(--green); color: var(--ink) }
.audit-toolbar .audit-btn.on {
  background: var(--wash); border-color: var(--dgreen); color: var(--dgreen); font-weight: 500;
}
.structure-access-group.on { border-color: var(--dgreen); background: var(--wash) }

/* Key takeaways and What we recommend: two cards, as v3 draws them. A numbered list,
   the number in a soft disc so the eye can count findings without reading them. */
.structure-takeaways, .structure-related { padding: 16px 18px; margin: 18px 0 }
.structure-takeaways h3, .structure-related h3 { font-size: 13px; margin: 0 }
.structure-takeaways ol, .structure-related ol {
  list-style: none; padding: 0; margin: 12px 0 0; counter-reset: insight;
}
.structure-takeaways li, .structure-related li {
  counter-increment: insight; position: relative; padding: 11px 0 11px 30px;
  border-top: 1px solid var(--line); font-size: 13px; line-height: 1.65;
}
.structure-takeaways li:first-child, .structure-related li:first-child { border-top: 0 }
.structure-takeaways li::before, .structure-related li::before {
  content: counter(insight); position: absolute; left: 0; top: 13px; width: 20px;
  height: 20px; border-radius: 50%; background: var(--soft); text-align: center;
  font-size: 11px; line-height: 20px; color: var(--dgreen);
}
.structure-related .structure-section-head { margin: 0; display: flex;
  justify-content: space-between; align-items: baseline; gap: 12px }
.structure-related li a { color: inherit; text-decoration: none;
  border-bottom: 1px solid var(--rule) }
.structure-related li a:hover { border-bottom-color: var(--ink) }
.structure-related .audit-btn {
  border: 0; background: none; padding: 0; font-size: 12px; color: var(--ink2);
  text-decoration: none; cursor: pointer;
}
/* The base a takeaway's own figures rest on, set apart from the sentence. */

/* ── Takeaways ────────────────────────────────────────────────────────────
   An issue and the actions answering it, above the charts that evidence them.
   Only pairs render: an issue with no action is context, and context belongs
   in a chart rather than at the top of a page. */
.takeaways { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 18px }
.takeaway {
  border-left: 2px solid var(--ink3); padding: 2px 0 2px 14px;
}
.takeaway p { margin: 0 0 6px; line-height: 1.5 }
.takeaway ul { margin: 0; padding-left: 16px }
.takeaway li { font-size: 12px; color: var(--ink2); padding: 2px 0 }
.takeaway a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule) }
.takeaway a:hover { color: var(--ink) }

/* ═══ v3 layout ═══════════════════════════════════════════════════════════
   Ported from the prototype's structure.css and customer-report.css. Our
   tokens are the same names and the same values, so this is the prototype's
   geometry on our palette rather than a reinterpretation of it. */

.structure-heading { margin-bottom: 18px }
.structure-heading h2 { font-size: 20px; margin: 0 0 5px }
.structure-heading .sub { font-size: 13px; margin-bottom: 18px }
.structure-explainer { font-size: 12.5px; color: var(--ink2); line-height: 1.65 }

/* An interpretation of the page, not a number from it. Gold rule, cream ground. */
.structure-takeaway {
  font-size: 13px; line-height: 1.65; border-left: 3px solid var(--gold);
  background: var(--palegold); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 18px 0;
}

.structure-section-head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin: 26px 0 12px;
}
.structure-section-head h2, .structure-section-head h3 { margin: 0 }
.structure-section-head h3 { font-size: 14px }

/* The four views of a panel, as tabs. One line, name over figure — the summary page
   carries the definitions and the evidence, so a tab needs only enough to be recognised
   and to show which way its number went. */
.viewtabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  margin: 0 0 22px;
}
.viewtab {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  background: var(--card); color: var(--ink); text-decoration: none;
  border-bottom: 2px solid var(--line);
}
.viewtab:hover { border-color: var(--green); background: #fcfefb }
.viewtab.on { border-color: var(--line); border-bottom-color: var(--dgreen); background: var(--wash) }
.viewtab-label { font-size: 12px; color: var(--ink2); line-height: 1.3 }
.viewtab.on .viewtab-label { color: var(--dgreen); font-weight: 500 }
.viewtab > strong {
  font-size: 17px; font-weight: 500; letter-spacing: -.2px; line-height: 1.3;
  overflow-wrap: anywhere;
}
/* The words qualifying the figure, set like a summary tile's caption: smaller and grey,
   so the number reads first and the unit explains it rather than competing. */
.viewtab-unit { font-size: 11.5px; font-weight: 400; color: var(--ink3); letter-spacing: 0 }
/* An unmeasured view still gets a tab: it is reachable, and it says why it is empty
   when you open it. Sizing it like a figure would make "not measured" look like one. */
.viewtab > strong.none { font-size: 12px; font-weight: 400; color: var(--ink3) }

@media (max-width: 860px) {
  .viewtabs { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
/* Three driver tabs are an odd number: the two-column tablet layout leaves one
   stranded. Stack them through the tablet breakpoint; the driver table below
   is the only element that scrolls sideways. */
@media (max-width: 860px) {
  .viewtabs:has(> .viewtab:nth-child(3):last-child) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.structure-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
/* Drivers wrap after two, matching the outcome cards. */
.structure-cards.three { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.structure-card {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 8px;
  border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px 15px;
  background: var(--card); color: var(--ink); text-decoration: none; min-width: 0;
}
.structure-card:hover { border-color: var(--green); background: #fcfefb }
/* Repair 10: the title link covers the card; the info marker sits above that layer. */
.structure-card { position: relative }
.structure-card-link { color: inherit; text-decoration: none }
.structure-card-link::after { content: ""; position: absolute; inset: 0; border-radius: 10px }
.structure-card .info { position: relative; z-index: 1 }
.structure-card:has(.structure-card-link:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px }
.structure-card-link:focus-visible { outline: none }
.structure-card-title {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; font-size: 13px; font-weight: 500;
}
.structure-card-title > span { color: var(--ink3) }
.structure-card-title .structure-card-tools {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px;
  flex: 0 0 auto;
}
/* Comparison is a label, not a control: keep its color without pill chrome. */
.metric-status {
  font-size: 10px; font-weight: 700; line-height: 1.35;
  letter-spacing: .04em; white-space: nowrap;
}
.metric-status-ahead { color: var(--dgreen) }
.metric-status-inline { color: var(--ink2) }
.metric-status-behind { color: var(--bad) }
.structure-card > strong {
  font-size: 26px; font-weight: 500; letter-spacing: -.5px; line-height: 1.35; color: var(--ink);
}
.structure-card > strong.none { font-size: 13px; letter-spacing: 0; color: var(--ink3) }
/* Keep the score prominent; the chosen unit reads inline, like sibling metrics. */
.metric-unit { font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--ink3); }

/* What a metric means lives in a tooltip, not in the card. The definition was a
   paragraph on every card, so eight cards carried eight paragraphs and the figures they
   were meant to frame had to compete with them for the reader's eye. A reader who wants
   the definition asks for it; one who wants the number should meet the number. */
.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; margin-left: 6px; border: 1px solid var(--line2);
  border-radius: 50%; font-size: 9.5px; font-style: italic; color: var(--ink3);
  cursor: help; position: relative; vertical-align: middle; flex: 0 0 auto;
}
.info .tip {
  display: none; position: absolute; left: 50%; top: 20px; transform: translateX(-50%);
  width: 230px; background: var(--ink); color: #fff; font-size: 11.5px; font-style: normal;
  font-weight: 400; line-height: 1.45; padding: 9px 11px; border-radius: 7px;
  z-index: 20; text-align: left; letter-spacing: 0; text-transform: none;
}
/* Focus as well as hover: the icon is tabbable, so the definition has to be reachable
   without a pointer. */
.info:hover .tip, .info:focus .tip, .info:focus-within .tip { display: block }

/* Put the rubric above the table scroll and fixed navigation, and constrain it to
   the viewport. JS positions it at the icon, so overflow-x:auto cannot clip it. */
.info .tip { position: fixed; z-index: 150; top: 0; left: 0; transform: none;
  max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; }
.info:hover .tip, .info:focus .tip, .info:focus-within .tip { display: none }
.info.is-open .tip, body > .tip.is-open { display: block }
body > .tip { display: none; position: fixed; z-index: 150; transform: none;
  background: var(--ink); color: #fff; font-size: 11.5px; font-style: normal;
  font-weight: 400; line-height: 1.45; padding: 9px 11px; border-radius: 7px;
  text-align: left; letter-spacing: 0; text-transform: none;
  max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; }

/* The comparison line sits at the foot of the card so the eight of them line up, and
   it is absent rather than blank where no rival number exists to compare against. */
/* The evidence the figure rests on, at the foot of the card so the eight of them line
   up. min-height reserves the second line: without it a one-line caption shortens its
   card and the grid goes ragged. */
.structure-card-caption {
  font-size: 11.5px; line-height: 1.6; padding-top: 8px; margin: auto 0 0;
  min-height: 2.6em; color: var(--ink2); width: 100%;
}

/* The recommendation preview: one count, then the work to start with. */
/* Built from .structure-card so it matches the eight above it — same title row, same
   figure size and ink, same hover. It differs only in spanning the grid. */
.structure-summary-actions { gap: 14px; padding-bottom: 18px }
.structure-summary-actions > strong {
  font-size: 26px; font-weight: 500; letter-spacing: -.5px; line-height: 1.35; color: var(--ink);
}

/* The shape of the work, along the bottom. A row scales to however many kinds there
   are, where the stacked list did not; each cell is its own block so the count reads
   first and the label under it. A kind with nothing in it is dimmed, not dropped. */
.sa-breakdown {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px;
  margin: 4px 0 0; width: 100%;
}
.sa-breakdown > div { background: var(--soft); border-radius: 8px; padding: 10px 12px }
.sa-breakdown > div.none { background: transparent; box-shadow: inset 0 0 0 1px var(--line) }
.sa-breakdown dd {
  margin: 0; font-size: 17px; font-weight: 500; color: var(--ink); line-height: 1.2;
}
.sa-breakdown > div.none dd { color: var(--ink3) }
.sa-breakdown dt {
  font-size: 11px; color: var(--ink2); margin-top: 3px; text-transform: capitalize;
}
@media (max-width: 700px) {
  .sa-breakdown { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr) }
}

/* The "n more in your full plan" line under a What-we-recommend list. Ruled off and
   indented clear of the numbers so it cannot be read as an unnumbered list item. */
.related-more {
  margin: 0; padding: 12px 0 0 30px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink3);
}

.report-summary-link { text-align: right; margin: 10px 0 }
.report-summary-link .audit-btn {
  border: 0; background: none; padding: 0; font-size: 13px; color: var(--ink2);
  text-decoration: none; cursor: pointer;
}
.report-summary-link .audit-btn:hover { color: var(--ink) }

#summary h1 { font-size: 25px; margin-bottom: 22px }
.shead {
  font-size: 18px; font-weight: 600; letter-spacing: normal; text-transform: none; color: var(--ink);
  padding-bottom: 9px; border-bottom: 1px solid var(--line2); margin: 28px 0 12px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.shead .src { text-transform: none; letter-spacing: 0; color: var(--ink3); font-size: 11.5px }

/* Three headline figures above a diagnostic view. */
.structure-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0 }
/* The existing metric cards, paired for the same two readouts on each view. */
.comparison-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 18px 0 26px; }
.metric-page .structure-heading h1 { margin: 0 0 3px; }
.metric-page .structure-heading .sub2 { margin: 0 0 16px; }
/* Align the bar starts and ends across numbered outcome charts. */
@media (min-width: 861px) {
  .metric-page .bars:not(.mini) {
    grid-template-columns: 250px minmax(0, 1fr) 78px;
  }
  .metric-page .sov { table-layout: fixed; width: 100%; }
  /* The table is slightly narrower inside its card than the grid. Reserve the same
     track by measuring the bar cell from its left edge, not from label text width. */
  .metric-page .sov col.sov-name-col { width: 262px; }
  .metric-page .sov col.sov-value-col { width: 78px; }
  .metric-page .sov td:nth-child(1), .metric-page .sov th:nth-child(1) {
    white-space: normal; overflow-wrap: anywhere;
  }
  .metric-page .sov td:nth-child(2) { padding-right: 12px; }
  .metric-page .sov th.sov-bar, .metric-page .sov td:nth-child(2) { width: auto; }
  .metric-page .sov td:nth-child(1), .metric-page .sov th:nth-child(1) { width: 262px; }
  .metric-page .sov td:nth-child(3), .metric-page .sov th:nth-child(3) { width: 78px; }
}
@supports (grid-template-columns: subgrid) {
  .metric-page .bars:not(.mini) .row { grid-template-columns: subgrid; grid-column: 1 / -1; }
}
.audit-metric { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; background: var(--card) }
.audit-metric .audit-label {
  font-size: 12px; letter-spacing: normal; text-transform: none; color: var(--ink3);
  display: block; margin-bottom: 6px;
}
.audit-metric .audit-figure { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap }
.audit-metric strong { font-size: 26px; font-weight: 500; line-height: 1.2 }
.audit-metric small { font-size: 13px; color: var(--ink2) }

/* Pass / needs work / everything else, as one bar. */
.structure-status { margin: 16px 0 }
.structure-status-track { display: flex; height: 10px; border-radius: 8px; overflow: hidden; background: var(--soft) }
.structure-status-track i.pass { background: var(--green) }
.structure-status-track i.work { background: #c18b49 }
.structure-status-track i.other { background: #c9d3cc }
.structure-status-key { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 9px; color: var(--ink2); font-size: 12px }

.structure-access-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0 }
.structure-access-group {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start; text-align: left;
  border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: var(--card);
  color: var(--ink); text-decoration: none; font-size: 13px;
}
.structure-access-group:hover { border-color: var(--green) }
.structure-access-group strong { font-size: 18px; font-weight: 500; color: var(--dgreen) }
.structure-access-group small { color: var(--ink2); font-size: 11px }

@media (max-width: 760px) {
  .structure-cards, .structure-cards.three, .structure-access-groups, .structure-metrics { grid-template-columns: 1fr }
  .structure-section-head { align-items: flex-start; flex-direction: column; gap: 8px }
}

/* Shared tracks across outcome sections below desktop width. The table
   reserves a value column; the other cards use the same label / bar / value grid.
   Widths are scoped to outcome drill-downs so driver tables keep their swipe. */
@media (min-width: 761px) and (max-width: 860px) {
  .metric-page .sov { table-layout: fixed; width: 100%; }
  .metric-page .sov col.sov-name-col { width: 233px; }
  .metric-page .sov col.sov-value-col { width: 78px; }
  .metric-page .sov td:nth-child(1), .metric-page .sov th:nth-child(1) {
    white-space: normal; overflow-wrap: anywhere;
  }
  .metric-page .sov td:nth-child(2) { padding-right: 11px; }
  .metric-page .sov th.sov-bar, .metric-page .sov td:nth-child(2) { width: auto; }
  .metric-page .bars:not(.mini) { grid-template-columns: 222px minmax(0, 1fr) 78px; }
  .metric-page .bars:not(.mini) .row {
    grid-template-columns: 222px minmax(0, 1fr) 78px;
  }
}
@media (max-width: 760px) {
  .metric-page .bars:not(.mini) {
    grid-template-columns: calc(48% - 8px) minmax(0, 1fr) 64px;
    gap: 9px 8px;
  }
  .metric-page .bars:not(.mini) .row {
    grid-template-columns: calc(48% - 8px) minmax(0, 1fr) 64px;
    gap: 8px;
  }
}
@supports (grid-template-columns: subgrid) {
  .metric-page .bars:not(.mini) .row { grid-template-columns: subgrid; grid-column: 1 / -1; }
}

/* The base a takeaway is quoting, beside the claim. Without it a share of one
   population reads as a contradiction of the headline's different population. */

/* ── Recommendations, v3 geometry ─────────────────────────────────────────
   Grouped sections, each with a sticky rail naming the kind of work, and one
   card per action. Not a table: an action carries a title, a reason, where its
   evidence lives and how big it is, and a table row flattens those into
   columns that fight for width. */
.audit-workgroup {
  display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 20px;
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line);
}
.audit-workgroup:first-of-type { border-top: 0; margin-top: 4px; padding-top: 0 }
.audit-workrail { align-self: start; position: sticky; top: 24px; padding-top: 18px }
.audit-workrail h3 { font-size: 14px; margin: 0 0 8px }
.audit-count { display: block; line-height: 1.6; font-size: 12px; color: var(--ink3) }

.structure-action {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px;
  padding: 16px 18px; margin: 0 0 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card);
}
.structure-action > div:first-child { grid-column: 1 / -1 }
.structure-action h4 { font-size: 13px; line-height: 1.5; margin: 0 0 6px; font-weight: 500 }
.structure-action p { font-size: 12px; margin: 0; line-height: 1.6; color: var(--ink2) }
.structure-action-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap }
.structure-action-sources {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 12px; color: var(--ink2); margin-top: 10px;
}
.structure-action-sources a {
  color: var(--ink2); text-decoration: none; border-bottom: 1px solid var(--line2); padding: 2px 0;
}
.structure-action-sources a:hover { color: var(--ink) }
.structure-action .brief {
  justify-self: end; align-self: center; font-size: 12px; color: var(--dgreen);
  text-decoration: none; white-space: nowrap;
}
.structure-action .brief:hover { border-bottom: 1px solid var(--dgreen) }

#actions:has(details.structure-action) .audit-workrail h3 {
  font-size: 18px; line-height: 1.3; font-weight: 500;
}

/* Compact recommendation cards. The native disclosure keeps keyboard access and
   needs no script; the existing workgroup grid and dashboard tokens remain in use. */
details.structure-action {
  display: block; padding: 0; margin-bottom: 12px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--card);
}
details.structure-action > summary {
  cursor: pointer; list-style: none; padding: 16px 18px; font-size: 13px;
  line-height: 1.5; font-weight: 500; color: var(--ink);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
details.structure-action > summary::-webkit-details-marker { display: none }
details.structure-action > summary::after {
  content: "+"; flex: none; font-size: 16px; color: var(--dgreen);
}
details.structure-action[open] > summary::after { content: "−" }
details.structure-action > summary:focus-visible { outline: 2px solid var(--green); outline-offset: 2px }
.structure-action-body { padding: 0 18px 16px; font-size: 12px; line-height: 1.6; color: var(--ink2) }
.structure-action-body p { margin: 0 0 10px }
.structure-action-body .action-citation { color: var(--dgreen); white-space: nowrap }
/* Evidence: "Where" (E2E.50) and the answers behind a card (E2E.69), folded under one
   label so the card reads as its advice first. Set in the paragraph's own size and colour:
   at 11px grey, links and all, it was the hardest text on the page to read. */
.action-evidence { margin-top: 2px }
.action-evidence > summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-weight: 600; color: var(--dgreen);
}
.action-evidence > summary::-webkit-details-marker { display: none }
.action-evidence > summary::before {
  content: ""; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg); transition: transform .12s;
}
.action-evidence[open] > summary::before { transform: rotate(45deg) translate(-1px, -1px) }
.action-evidence > summary:focus-visible { outline: 2px solid var(--green); outline-offset: 2px }
.action-where { margin-top: 8px; color: var(--ink2) }
.action-where-label { display: block; font-weight: 600; color: var(--ink) }
.action-where ul { margin: 2px 0 0; padding-left: 16px }
.action-where li { margin: 0 0 4px; overflow-wrap: anywhere }
.action-where a, .evidence-page a {
  color: inherit; text-decoration: underline; text-decoration-color: var(--line2);
  text-underline-offset: 2px;
}
.action-where a:hover, .evidence-page a:hover { color: var(--dgreen); text-decoration-color: var(--dgreen) }
.action-where-value { display: block; color: var(--ink3) }
.action-where-open { margin-left: 4px; text-decoration: none !important }
/* One answer a card cites (E2E.69). */
.answer-label { display: block; font-size: 11px; font-weight: 600; color: var(--ink3); margin-bottom: 4px }
.answer-question p { margin: 0; font-weight: 600 }
.answer-text { font-size: 12px; line-height: 1.6; color: var(--ink2) }
.answer-text p { margin: 0 0 10px }
.answer-text ul { margin: 0 0 10px; padding-left: 18px }
.answer-text a, .answer-sources a { overflow-wrap: anywhere }
.answer-sources { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.7; color: var(--ink2) }
.structure-action-body .structure-priority {
  display: flex; align-items: center; gap: 7px; width: max-content; margin-top: 10px;
  font-weight: 600; color: var(--dgreen);
}
.audit-references { margin-bottom: 0 }
.reco-note { margin: 14px 0 80px; font-size: 11px; line-height: 1.5; color: var(--ink3) }
.reference-list { display: grid; gap: 5px; padding-top: 2px }
.reference-entry {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px;
  font-size: 11px; line-height: 1.35; color: var(--ink3); scroll-margin-top: 24px;
}
.reference-entry a { color: var(--ink3); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 2px }
.reference-entry a:hover { color: var(--dgreen) }
.reference-entry:target { background: var(--soft) }
@media (max-width: 700px) { details.structure-action > summary { padding: 14px } .structure-action-body { padding: 0 14px 14px } }

/* Work size as three rising bars: a word buried in a row is skipped, a shape is not. */
.structure-effort { display: inline-flex; gap: 7px; align-items: center; font-size: 12px; color: var(--ink2) }
.structure-effort > span { display: flex; gap: 3px; height: 16px; align-items: flex-end }
.structure-effort i { width: 4px; background: var(--line2); height: 6px; display: block }
.structure-effort i:nth-child(2) { height: 11px }
.structure-effort i:nth-child(3) { height: 16px }
.structure-effort i.filled { background: var(--green) }

.audit-pill {
  font-size: 10px; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px;
  border-radius: 999px; background: var(--soft); color: var(--ink2); white-space: nowrap;
}
.audit-pill.first { background: var(--pale); color: var(--dgreen) }

@media (max-width: 1050px) {
  .audit-workgroup { grid-template-columns: 1fr; gap: 4px }
  .audit-workrail { position: static; display: flex; gap: 12px; align-items: baseline; padding: 0 }
}
@media (max-width: 700px) {
  .structure-action { grid-template-columns: 1fr }
  .structure-action > div:first-child { grid-column: auto }
  .structure-action .brief { justify-self: start }
}

/* A section a reader opens rather than scrolls past: secondary evidence that belongs on
   the page but should not compete with the measurement above it. */
.report-details { margin: 18px 0 }
.report-details > summary {
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink2);
  padding: 10px 0; border-top: 1px solid var(--line);
}
.report-details > summary:hover { color: var(--ink) }
.report-details[open] > summary { color: var(--ink) }

/* Timeline key: the tier a marker's colour stands for. Sits under the chart rather than
   inside the SVG, so it wraps on a narrow screen and the text is selectable. */
.timeline-key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; }
.timeline-key span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink3); }
.timeline-key i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* An imported figure and our own computation disagreeing. Admin-only, and deliberately
   plain: it is a note to whoever owns both pipelines, not a customer-facing warning. */
.disagreement { color: var(--ink3); border-left: 2px solid var(--line); padding-left: 10px; }

/* Coverage dimensions: equal option widths communicate the set; numbers communicate weight. */
.dimension-help { margin: 16px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); font-size: 12px; }
.dimension-help b { margin-right: 10px; }
.dimension-model { padding: 0; overflow: hidden; }
.dimension-model-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dimension-model-head h3, .dimension-model-head p { margin: 0; }
.dimension-row { display: grid; grid-template-columns: 205px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.dimension-row:last-child { border-bottom: 0; }
.dimension-label { appearance: none; border: 0; background: transparent; padding: 13px 14px; color: var(--ink); text-align: left; display: flex; justify-content: space-between; gap: 8px; cursor: pointer; }
.dimension-label small { display: block; margin-top: 4px; color: var(--ink3); font-weight: 400; }
.dimension-chevron { width: 12px; height: 8px; margin: 4px 3px 0 8px; flex: 0 0 auto; }
.dimension-chevron path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dimension-options { display: grid; grid-template-columns: repeat(var(--option-count), minmax(72px, 1fr)); gap: 5px; padding: 8px; overflow-x: auto; }
.dimension-option { min-width: 72px; background: var(--pale); border: 1px solid var(--line); border-radius: 7px; padding: 10px 6px; text-align: center; }
.dimension-option span { display: block; font-size: 10px; }
.dimension-option b { display: block; margin: 4px 0 0; color: var(--dgreen); font-size: 18px; }
.dimension-drawer:not(:empty) { grid-column: 1 / -1; position: relative; padding: 14px; border-top: 2px solid var(--green); background: var(--soft); }
.dimension-samples { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--card); }
.dimension-sample-row { padding: 10px 12px; border-bottom: 1px solid var(--line); line-height: 1.45; }
.dimension-sample-row:last-child { border-bottom: 0; }
.dimension-sample-row b { margin-right: 3px; font-weight: 600; }
@media (max-width: 760px) { .dimension-row { grid-template-columns: 1fr; } .dimension-options { grid-column: 1; } .dimension-model-head { align-items: flex-start; gap: 8px; flex-direction: column; } }
.dimension-actions { display:flex; align-items:center; gap:10px; }
.dimension-export { position:relative; }
.dimension-export summary { list-style:none; cursor:pointer; border:1px solid var(--line); border-radius:var(--r-sm); padding:7px 10px; color:var(--ink); background:#fff; font-weight:600; white-space:nowrap; }
.dimension-export summary::-webkit-details-marker { display:none; }
.dimension-export summary svg { width:10px; height:7px; margin-left:5px; }
.dimension-export summary path { fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.dimension-export-menu { position:absolute; right:0; top:calc(100% + 5px); min-width:130px; padding:5px; border:1px solid var(--line); border-radius:8px; background:#fff; box-shadow:0 8px 22px rgba(14,45,36,.13); z-index:5; }
.dimension-export-menu a { display:block; padding:7px 9px; border-radius:5px; color:var(--ink); text-decoration:none; }
.dimension-export-menu a:hover, .dimension-export-menu a:focus { background:var(--soft); }

/* ── Driver tables (reads) ───────────────────────────────────────────────────────
   Fixed column widths so the three tables on a view line up (QA brief v2, 6b), and a
   horizontal scroll with a minimum width on a phone, where the description column was
   squeezed to one word a line (6d). */
.table-scroll { overflow-x: auto; }
.table-scroll > table.driver-table { table-layout: fixed; min-width: 640px; }
.driver-table th.r, .driver-table td.r { padding-left: 16px; }
.driver-table td.comparison { color: var(--ink); }

/* ── Ask Gauss vs the page (QA brief v2, 6a) ─────────────────────────────────────
   The launcher is fixed bottom-right. Below 1500px the content column reaches under it
   and it covered the right-most table column, so it shrinks to its mark; below 1160px
   the content runs to the window's edge, so the page keeps a gutter for it. */
@media (max-width: 1499px) {
  body #gauss-launcher { padding: 10px; }
  body #gauss-launcher > span:not(.g-mark) { display: none; }
}
@media (min-width: 861px) and (max-width: 1159px) {
  main.content { padding-right: 96px; }
}

/* ── The sidebar on a phone: a drawer behind a top bar ──────────────────────────
   It was a full-width block above the content, so every page opened on the menu and
   the reader scrolled past all of it to reach the page. Now a slim bar carries the
   menu button and the page's name, and the sidebar — unchanged — slides in over the
   content. Closed, it is `visibility: hidden`, so its links are out of the tab order
   and the accessibility tree rather than merely off-screen. */
.mbar, .nav-scrim, .nav-close { display: none; }
@media (max-width: 860px) {
  .mbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 80;
    background: var(--dgreen); color: #fff; padding: 8px 14px 8px 8px;
  }
  .mbar-menu {
    appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
    width: 44px; height: 44px; display: grid; place-items: center; color: #fff;
    border-radius: 8px;
  }
  .mbar-menu svg { width: 22px; height: 22px; fill: none; stroke: currentColor;
                   stroke-width: 1.8; stroke-linecap: round; }
  .mbar-menu:focus-visible, .nav-close:focus-visible { outline: 2px solid var(--gold); }
  .mbar-logo { display: flex; }
  .mbar-title { font-size: 14px; font-weight: 500; min-width: 0; overflow: hidden;
                text-overflow: ellipsis; white-space: nowrap; }

  .nav {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 120;
    width: min(300px, 86vw); height: 100dvh; flex: none;
    transform: translateX(-100%); visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
    box-shadow: 0 0 40px rgba(0, 0, 0, .25);
  }
  body.nav-open .nav {
    transform: none; visibility: visible; transition: transform .22s ease;
  }
  .nav-close {
    display: grid; place-items: center; position: absolute; top: 10px; right: 10px;
    width: 40px; height: 40px; appearance: none; background: none; border: 0;
    color: #fff; font-size: 26px; line-height: 1; cursor: pointer; border-radius: 8px;
  }
  .nav-scrim {
    position: fixed; inset: 0; z-index: 110; background: rgba(12, 26, 18, .45);
  }
  body.nav-open .nav-scrim { display: block; }
  body.nav-open { overflow: hidden; }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  .nav, body.nav-open .nav { transition: none; }
}

/* ── The pages behind a driver row ────────────────────────────────────────────────
   Opened in place under the row's description: the failing pages with their reason,
   or every page's score, weakest first. Links go to the page's own report. */
/* The feature summary is the row's disclosure control, with no extra teaser line. */
.row-pages .feature-name { font-weight: 500; }
.row-pages > summary { cursor: pointer; list-style: none; color: var(--ink); }
.row-pages > summary > .sub-cell { display: block; }
.row-pages > summary::-webkit-details-marker { display: none; }
.row-pages > summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.row-pages > summary:hover .feature-name { text-decoration: underline; }
.row-pages .info { pointer-events: auto; }
/* Excluded coverage pieces use the same quiet link treatment as counted articles.
   Keep the reason on its own line so long titles do not run into it on phones. */
#coverage-found > details.row-pages ul { list-style: none; margin: 10px 0 0; padding: 0; }
#coverage-found > details.row-pages li {
  border-top: 1px solid var(--line); padding: 10px 0; font-size: 13px;
  overflow-wrap: anywhere;
}
#coverage-found > details.row-pages li > a { color: var(--ink); font-size: 13px; }
#coverage-found > details.row-pages li > .sub-cell { display: block; margin-top: 4px; }

/* A sibling row spans all four columns and mirrors the table's numeric widths. */
/* Keep links visible if CSS is unavailable or :has() is unsupported. Native
   details state hides only the closed feature's full-width sibling row. */
.driver-table tr:has(details.row-pages:not([open])) + tr.row-pages-detail { display: none; }
.driver-table tr.row-pages-detail > td { background: #fff; }
/* Full-width detail retains the table's numeric column. No grey panel or second
   heading row: one Our pages label, page links, colored scores, hairline dividers. */
.row-pages-detail ul { list-style: none; margin: 0; padding: 0; }
.row-pages-detail li { border-top: 1px solid var(--line); font-size: 12.5px; }
.row-pages-score-heading, .row-pages-scores li {
  display: grid; grid-template-columns: minmax(0, 1fr) 104px 112px 104px;
  column-gap: 0;
}
.row-pages-score-heading { margin: 8px 0 4px; color: var(--ink2); font-size: 12px; }
.row-pages-score-heading span, .row-pages-scores li > span {
  grid-column: 3; text-align: right; padding-right: 12px;
}
.row-pages-scores li { padding: 7px 0; }
.row-pages-scores li > a { min-width: 0; overflow-wrap: anywhere; text-align: left; }
.row-pages-scores li > span { font-weight: 600; }
.row-pages-more > summary {
  display: block; padding: 10px 0; border-top: 1px solid var(--line);
  color: var(--dgreen); font-size: 12px; font-weight: 600;
  text-align: center; cursor: pointer; list-style: none;
}
.row-pages-more > summary::-webkit-details-marker { display: none; }
.row-pages-more > summary:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.row-pages-more .show-less, .row-pages-more[open] .show-more { display: none; }
.row-pages-more[open] .show-less { display: inline; }
/* The driver table scrolls sideways on phones. Keep the expanded preview's page,
   score and Show all control within the initially visible left side of that table. */
@media (max-width: 760px) {
  .row-pages-score-heading, .row-pages-scores li {
    width: 304px; grid-template-columns: minmax(0, 210px) 94px;
  }
  .row-pages-score-heading span, .row-pages-scores li > span { grid-column: 2; }
  .row-pages-more > summary { width: 304px; }
}
.row-pages-detail li > div { grid-column: 1 / -1; }
.row-pages-detail li.row-pages-rest { grid-template-columns: 1fr; }
.fix-table .fix-problem + .fix-problem { margin-top: 6px; }
.fix-table b { font-weight: 500; }
.driver-table tr.grp td { font-size: 12px; font-weight: 500; color: var(--ink2); background: var(--soft); }
/* What the structured data says: one table per entry, the values allowed to wrap. */
.sd-next { margin-top: 14px; }
.driver-table td.sd-value { overflow-wrap: anywhere; font-size: 12.5px; }
#structured-data .driver-table th.sd-entry-heading { vertical-align: top; white-space: normal; overflow-wrap: break-word; }
#structured-data .sd-entry-heading .sub-cell { display: block; margin-top: 3px; font-weight: 400; overflow-wrap: break-word; }
#structured-data .driver-table th:nth-child(2) { vertical-align: top; }



/* RD3 drill-down consistency. Keep the existing palette and type. */
.metric-page .lvl { color: var(--green); font-variant-numeric: tabular-nums; }
.metric-page .bhead { font-size: 13px; font-weight: 600; color: var(--ink); }
.metric-page .bhead .lvl { display: inline-block; min-width: 22px; }
.metric-page .section-question { margin: -7px 0 11px; font-size: 11.5px; color: var(--ink3); line-height: 1.6; }
.metric-page .meta { display: block; overflow: visible; -webkit-line-clamp: unset; }
.metric-page .row-pages > summary, .metric-page .blk a:not(.btn) { text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 2px; }
.metric-page .row-pages > summary:hover, .metric-page .blk a:hover { text-decoration-color: var(--green); }
.metric-page .driver-table th { white-space: nowrap; }
.metric-page .audit-metric small { white-space: nowrap; }
/* A long hotel name must wrap inside the value track: the nowrap let it run past the
   card's right edge. Phones already wrap (below); this brings desktop in line. */
.reason-bars .reason-owner { color: var(--ink3); font-size: 11px; font-weight: 400; }
.reason-bars .row .v { min-width: 0; }
.reason-bars .row .v .reason-caption { overflow-wrap: break-word; }
@media (min-width: 761px) {
  .metric-page .reason-bars.bars:not(.mini) {
    grid-template-columns: minmax(90px, max-content) minmax(0, 1fr) 220px;
  }
  .metric-page .reason-bars.bars:not(.mini) .row {
    grid-template-columns: minmax(90px, 1fr) minmax(0, 1fr) 220px;
  }
}
@media (max-width: 760px) {
  main.content:has(.metric-page) { padding-bottom: 132px; }
  .metric-page .audit-metric small { white-space: normal; }
  .metric-page .table-scroll { overflow: visible; }
  .metric-page .driver-table { min-width: 0 !important; width: 100%; table-layout: auto; display: block; }
  .metric-page .driver-table colgroup, .metric-page .driver-table thead { display: none; }
  .metric-page .driver-table tbody { display: grid; gap: 10px; }
  .metric-page .driver-table tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 8px; padding: 10px; gap: 8px 12px; }
  .metric-page .driver-table tr > td { display: block; border: 0; min-width: 0; width: auto; padding: 0; overflow-wrap: break-word; text-align: left; }
  .metric-page .driver-table tr > td:first-child { grid-column: 1 / -1; }
  .metric-page .driver-table:not(.fix-table) tr > td:nth-child(2):before { content: 'Priority'; }
  .metric-page .driver-table:not(.fix-table) tr > td:nth-child(3):before { content: 'Result'; }
  .metric-page .driver-table:not(.fix-table) tr > td:nth-child(4):before { content: 'Competitor average'; }
  .metric-page .driver-table tr > td:nth-child(n+2):before { display: block; color: var(--ink3); font-size: 11px; font-weight: 400; margin-bottom: 2px; }
  .metric-page .driver-table:not(.fix-table) tr > td:nth-child(4) { grid-column: 1 / -1; }
  .metric-page .fix-table tr > td:nth-child(2) { grid-column: 1 / -1; }
  .metric-page .fix-table tr > td:nth-child(2):before { content: "What's wrong"; }
  .metric-page .driver-table tr.row-pages-detail { display: block; }
  .metric-page .driver-table tr.row-pages-detail > td { width: 100%; }
  .metric-page .row-pages-score-heading, .metric-page .row-pages-scores li, .metric-page .row-pages-more > summary { max-width: 100%; width: 100%; }
  .metric-page .pager { flex-wrap: wrap; justify-content: space-between; padding-right: 0; }
  .metric-page .pager > span:nth-child(2) { order: 3; flex-basis: 100%; text-align: center; }
  .reason-bars .row .v .reason-caption { white-space: normal; overflow-wrap: normal; }
  .reason-bars .reason-owner { display: inline-block; max-width: 100%; white-space: normal; overflow-wrap: normal; word-break: normal; hyphens: none; }
}

@media (max-width: 760px) {
  .metric-page #coverage-found .driver-table tr > td:nth-child(2):before { content: 'Type'; }
  .metric-page #coverage-found .driver-table tr > td:nth-child(3):before { content: 'Published'; }
  .metric-page #coverage-found .driver-table tr > td:nth-child(4):before { content: 'Cited by AI'; }
  .metric-page #structured-data .driver-table tr > td:nth-child(2):before { content: 'Says'; }
  .metric-page #structured-data .driver-table tr > td:nth-child(3):before { content: 'Shown on the page'; }
  .metric-page #structured-data .driver-table tr > td:nth-child(3) { grid-column: 1 / -1; }
  .metric-page .driver-table tr > td[colspan] { grid-column: 1 / -1; }
  .metric-page .driver-table tr > td[colspan]:before { content: none !important; }
  .metric-page .pager > * { max-width: 100%; }
}

/* The sentiment owner stays intact, even when the regular 64px value track shrinks. */
@media (max-width: 760px) {
  .metric-page .reason-bars.bars:not(.mini),
  .metric-page .reason-bars.bars:not(.mini) .row {
    grid-template-columns: minmax(0, 1fr) minmax(16px, .25fr) minmax(145px, 44%);
  }
}

/* ---------- drill-down (sentiment view, FEATURE_DRILLDOWN) ---------- */
.bars .k a.drill-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.bars .k a.drill-link:hover, .bars .k a.drill-link:focus-visible { text-decoration-color: currentColor; }
.drill-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; }
.drill-crumbs .sep { color: var(--ink3); }
.drill-crumbs .crumb { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 20px; background: var(--soft); }
.drill-crumbs .drill-x { padding: 0 6px; color: var(--ink2); text-decoration: none; }
.drill-by { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; }
.drill-by select { max-width: 100%; }
.drill-evidence .drill-clause { padding: 10px 0; border-top: 1px solid var(--line); }
.drill-evidence .drill-clause:first-child { border-top: 0; }
.drill-evidence q { display: block; color: var(--ink); }
.drill-evidence p { margin: 4px 0 0; font-size: 12.5px; overflow-wrap: anywhere; }

/* ---------- AI accessibility page (23 Oct 2026 redesign) ----------
   Scores first, page-level evidence underneath, competitor detail on expand.
   Colours are the dashboard's own tokens; #c9a24a (fail-one amber) is the one
   derivation, from the approved mock. */

.aia-der {
  --aia-one: #c9a24a;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 18px; margin: 0 0 4px;
}
.aia-der .aia-eq { margin: 0; font-size: 15px; }
.aia-der .aia-eq b { font-weight: 600; }
.aia-stack { display: grid; grid-template-columns: var(--aia-tracks); height: 10px; gap: 2px; margin-top: 10px; }
.aia-stack i { display: block; height: 10px; }
.aia-legend { display: grid; grid-template-columns: var(--aia-tracks); gap: 2px; font-size: 12px; color: var(--ink2); margin-top: 6px; }
.aia-legend span { min-width: 0; }
.aia-legend > span:nth-child(1) { --aia-column: 1; }
.aia-legend > span:nth-child(2) { --aia-column: 2; }
.aia-legend > span:nth-child(3) { --aia-column: 3; }
.aia-distribution-narrow .aia-legend { row-gap: 0; }
.aia-distribution-narrow .aia-legend > span {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: subgrid;
  grid-column: var(--aia-column) / -1; grid-row: 1 / span var(--aia-column);
}
.aia-distribution-narrow .aia-legend > span::before {
  content: ""; position: absolute; grid-row: 1 / var(--aia-column); left: 0; top: -6px; bottom: 0;
  border-left: 1px solid currentColor;
}
.aia-distribution-narrow .aia-legend > span:first-child::before {
  grid-row: 1; bottom: auto; height: 6px;
}
.aia-distribution-narrow .aia-legend > span::after {
  content: ""; position: absolute; grid-row: var(--aia-column); top: 0; left: min(0px, calc(100% - 150px));
  width: max(0px, calc(150px - 100%)); border-top: 1px solid currentColor;
}
.aia-distribution-narrow .aia-caption {
  position: relative; z-index: 1; grid-row: var(--aia-column); align-self: start; margin-top: 6px;
  left: min(0px, calc(100% - 150px)); width: 142px; background: var(--card);
}
@supports not (grid-template-rows: subgrid) {
  .aia-distribution-narrow .aia-legend { --aia-caption-row: 44px; grid-auto-rows: var(--aia-caption-row); }
  .aia-distribution-narrow .aia-legend > span { display: block; grid-row: var(--aia-column); }
  .aia-distribution-narrow .aia-legend > span::before {
    grid-row: auto; top: calc(-6px - (var(--aia-column) - 1) * var(--aia-caption-row)); bottom: auto;
    height: calc(6px + (var(--aia-column) - 1) * var(--aia-caption-row));
  }
  .aia-distribution-narrow .aia-legend > span::after { grid-row: auto; }
  .aia-distribution-narrow .aia-caption { position: absolute; grid-row: auto; top: 6px; margin-top: 0; }
}
.aia-legend .ok { color: var(--dgreen); }
.aia-legend .bad { color: var(--bad); }
.aia-legend .aia-one { color: var(--aia-one); }

.aia-bar { height: 6px; background: var(--bar-track); width: 110px; margin-top: 6px; }

/* The scorecard is table-layout: fixed (every .driver-table in a .table-scroll is);
   the two figure columns get explicit room so a score and its bar never lean on the
   competitor figure beside them. */
.aia-score th:nth-child(4), .aia-score th:nth-child(5) { width: 180px; }
.aia-score th:nth-child(4), .aia-score td:nth-child(4),
.aia-score th:nth-child(5), .aia-score td:nth-child(5) { text-align: left; padding-left: 16px; padding-right: 16px; }
.aia-score-value { white-space: nowrap; }
.aia-score-count { display: inline; margin-left: 6px; white-space: nowrap; }
.aia-bar i { display: block; height: 6px; background: var(--bar-you); }
.aia-bar i.b { background: var(--bad); }

.aia-grp td { background: var(--soft); font-weight: 600; font-size: 13px; }
.aia-grp .sub-cell { font-weight: 400; }

.aia-cards { display: none; }
.aia-cards-g { margin: 14px 0 6px; font-weight: 600; }
.aia-card { padding: 12px 14px; margin-bottom: 8px; }
.aia-card .h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.aia-card .sc { font-weight: 600; font-size: 15px; white-space: nowrap; }
.aia-card .mut { color: var(--ink3); font-size: 12px; font-weight: 400; }
.aia-card .aia-bar { width: 100%; }

.aia-ctl { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.aia-seg { display: flex; border: 1px solid var(--line2); border-radius: var(--r-sm); overflow: hidden; background: var(--card); }
.aia-seg a { padding: 6px 12px; font-size: 13px; color: var(--ink); text-decoration: none; border-right: 1px solid var(--line2); }
.aia-seg a:last-child { border-right: 0; }
.aia-seg a.on { background: var(--ink); color: #fff; }
.aia-srch { display: flex; gap: 6px; }
.aia-srch input { border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 6px 12px; font: inherit; font-size: 13px; min-width: 200px; background: var(--card); color: var(--ink); }
.aia-srch button { border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 6px 12px; background: var(--card); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.aia-srch button:hover { border-color: var(--ink3); }

.aia-grid { border-collapse: collapse; width: 100%; min-width: 760px; }
/* The page column stays put while the nine checks scroll past it. */
.aia-grid th:first-child, .aia-grid td:first-child {
  position: sticky; left: 0; background: var(--card); z-index: 1;
  box-shadow: 1px 0 0 var(--line);
}
.aia-grid thead th:first-child { background: var(--soft); z-index: 2; }
.aia-grid tr.aia-grp td > .aia-grp-label {
  position: sticky; left: 10px; z-index: 1; background: var(--soft); padding-right: 8px;
}
.aia-grid th, .aia-grid td { padding: 7px 6px; text-align: center; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.aia-grid th { font-weight: 500; color: var(--ink2); background: var(--soft); }
.aia-grid th:first-child, .aia-grid td:first-child { text-align: left; padding-left: 14px; }
.aia-grid tr:last-child td { border-bottom: 0; }
.aia-grid td a { text-decoration: none; }
.aia-grid td.p a { color: var(--dgreen); }
.aia-grid td.f a { color: var(--bad); font-weight: 600; }
.aia-grid td.nv a { color: var(--ink2); }
.aia-grid td.na a, .aia-grid td.miss a { color: var(--ink3); }
.aia-grid th:nth-child(5), .aia-grid td:nth-child(5),
.aia-grid th:nth-child(8), .aia-grid td:nth-child(8) { border-left: 2px solid #ccd5cc; }
.aia-grid th:nth-child(11), .aia-grid td:nth-child(11) { border-left: 1px solid #e3e8e3; }
.aia-grid .aia-res { font-weight: 600; }
.aia-grid .aia-res.pass { color: var(--dgreen); }
.aia-grid .aia-res.fail { color: var(--bad); }
.aia-grid .aia-res.unknown { color: var(--ink2); font-weight: 400; }

.aia-comp { border-collapse: collapse; width: 100%; min-width: 680px; }
.aia-comp th:first-child, .aia-comp td:first-child {
  position: sticky; left: 0; background: var(--card); z-index: 1;
  box-shadow: 1px 0 0 var(--line); max-width: 132px;
}
.aia-comp thead th:first-child { background: var(--soft); z-index: 2; }
.aia-comp tr.aia-grp td > .aia-grp-label {
  position: sticky; left: 10px; z-index: 1; background: var(--soft); padding-right: 8px;
}
/* A verdict cell that opens its reason on tap/focus is text, not the icon: the same
   .info tap/focus pattern the scorecard uses, wearing the cell's own styling. */
.aia-comp td .info {
  display: inline; width: auto; height: auto; margin-left: 0; border: 0; border-radius: 0;
  font-size: inherit; font-style: normal; color: inherit; cursor: pointer;
}
.aia-comp th, .aia-comp td { padding: 9px 8px; text-align: center; border-bottom: 1px solid var(--line); font-size: 13px; }
.aia-comp th { font-weight: 500; color: var(--ink2); background: var(--soft); }
.aia-comp th:first-child, .aia-comp td:first-child { text-align: left; padding-left: 14px; }
.aia-comp th a { color: var(--ink); text-decoration: none; }
.aia-comp th a:hover { text-decoration: underline; }
.aia-comp .sep { border-left: 1px solid var(--line); }
.aia-comp td.sc { font-weight: 600; }
.aia-comp td .sub-cell { font-weight: 400; }
.aia-comp td.p { color: var(--dgreen); }
.aia-comp td.f { color: var(--bad); font-weight: 600; }
.aia-comp td.nv { color: var(--ink2); }
.aia-comp td.na, .aia-comp td.miss { color: var(--ink3); }
.aia-comp .aia-x { margin-left: 4px; }

/* The scorecard table becomes one card per check on a phone; the grid and the
   competitor table stay tables, tightened. */
/* Metric pages set .table-scroll to overflow:visible so scorecard tooltips are
   never clipped; that also disables scrolling, which the grid and competitor tables
   need on a phone. They opt back in here — neither contains a tooltip to clip. */
.metric-page .table-scroll.aia-scroll { overflow-x: auto; padding-left: 0; padding-right: 0; }

.aia-scroll-hint { display: none; }

@media (max-width: 760px) {
  .aia-score-wrap { display: none; }
  .aia-scroll-hint { display: block; }
  .aia-cards { display: block; }
  .aia-grid th, .aia-grid td { padding: 6px 8px; font-size: 12px; }
  .aia-grid th:first-child, .aia-grid td:first-child { padding-left: 10px; max-width: 132px; }
  .aia-comp th, .aia-comp td { padding: 8px 4px; font-size: 12px; }
  .aia-srch input { min-width: 0; flex: 1; }
}
/* ---------- 23 Oct portfolio/nav redesign ----------
   The sidebar gains a PORTFOLIO section above the property picker; the Performance
   outcomes / Performance drivers group headings are gone, their seven views link
   directly after Baseline. The portfolio page's cards are photo, name, city and
   status - the metric chips moved out (the property's own pages carry the figures). */

/* Section labels in the sidebar (PORTFOLIO over the cross-property pages; the
   existing .id label covers PROPERTY above the picker). */
.navsec {
  padding: 0 22px 7px; color: rgba(255,255,255,.55);
  font-size: 10.5px; font-weight: 600; letter-spacing: 1.4px;
}
/* A rule separates the portfolio pages from the property they sit above. */
.nav .id { border-bottom: 0; border-top: 1px solid var(--greennav); padding-top: 15px; }
/* Headless groups (outcomes, drivers): their seven views render as one evenly spaced
   run of direct links, so the group wrapper adds no extra gap of its own. */
.navgrp.nav-headless { padding-bottom: 0; }

/* Portfolio page. */
.pfpage .pfdesc { margin: 5px 0 0; color: var(--ink2); font-size: 14.5px; }
.pfbar { display: flex; align-items: center; gap: 10px; margin: 24px 0 22px; flex-wrap: wrap; }
.pfbar[hidden] { display: none; }
.pfchip {
  display: flex; align-items: center; gap: 7px; background: var(--card);
  border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 8px 13px;
  font-size: 13.5px; color: var(--green); font-weight: 600;
}
.pfchip select {
  border: 0; outline: 0; font: inherit; font-weight: 600; color: var(--green);
  background: transparent; cursor: pointer;
}
.pfchip.grow input {
  border: 0; outline: 0; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--ink); width: 170px; background: transparent;
}
.pfchip.grow input::placeholder { color: var(--ink3); font-weight: 400; }
.pfchip input[type=checkbox], .exec-pick input[type=checkbox] { accent-color: var(--green); }
.pfchip label { color: var(--ink); font-weight: 500; cursor: pointer; }
.pfgrid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px; }
/* Card anatomy: photo above, then a row with name/city (and portfolio for staff)
   on the left and the status on the right. */
.prop .pfmeta { padding: 12px 15px 13px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.prop .pfmeta .pfl { min-width: 0; }
.prop .pfmeta h3 { font-weight: 600; }
.prop .pfname { font-size: 12.5px; color: var(--ink3); margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
.prop .pfst { font-size: 13px; color: var(--green); font-weight: 600; white-space: nowrap; padding-top: 2px; }
.prop-empty .pfst { color: var(--ink3); }
@media (max-width: 860px) {
  .pfchip.grow { flex: 1 1 100%; }
  .pfchip.grow input { flex: 1; width: auto; }
}
/* Disabled property sections on the portfolio page: visible but inert until the
   picker chooses a property - the section is never hidden, never invented. */
.navgrp.nav-disabled .navtop, .navgrp.nav-disabled .sub {
  display: block; color: rgba(255,255,255,.45); cursor: default;
}
.navgrp.nav-disabled .sub { margin: 0; padding: 6px 22px 6px 34px; font-size: 12.5px; }
/* The bar's Add a property sits at the right end, outlined (final 23 Oct mock). */
.pfspacer { flex: 1; }
.pfbar .padd {
  display: inline-flex; align-items: center; background: var(--card);
  border: 1px solid var(--green); border-radius: var(--r-sm); color: var(--green);
  font-size: 13.5px; font-weight: 600; padding: 8px 14px; text-decoration: none;
  white-space: nowrap; margin-top: 0;
}
.pfbar .padd:hover { background: var(--pale); }

/* Visibility page (GEN21). Shared row grid per the 24 Oct layout steer: one grid
   for every row on the page, labels left-aligned, bars starting and ending on the
   same columns, the track taking the width the old right-aligned labels spent. */
#sov-card .controls, #rep-card .controls, #rg-board .controls, #rg-h2h .controls, #sn-cohort-card .controls, #sn-tone-card .controls, #sn-evidence-card .controls, #sn-reasons-card .controls, #dl-cohort-card .controls, #dl-split-card .controls, #dl-agencies-card .controls, #dl-themes-card .controls, #direct .dl-basis, .mini .controls{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-bottom:16px;width:100%}
.ctl{display:flex;flex-direction:column;gap:4px;flex:1 1 130px;min-width:0}
.ctl label{font-size:10.5px;letter-spacing:.07em;color:var(--ink3);font-weight:650}
.ctl select{appearance:none;-webkit-appearance:none;border:1px solid var(--line2);border-radius:var(--r-sm);background:var(--card);padding:7px 24px 7px 10px;font:500 13px var(--font);color:var(--ink);width:100%}
.ctl select:focus-visible{outline:2px solid var(--green);outline-offset:1px}
.ctl select:disabled{opacity:.45;cursor:default}
.seg{display:flex;border:1px solid var(--line2);border-radius:var(--r-sm);overflow:hidden;width:100%}
.seg button{border:none;background:var(--card);padding:7px 13px;font-family:var(--font);font-size:13px;color:var(--ink2);cursor:pointer;border-right:1px solid var(--line);flex:1 1 0;text-align:center}
.seg button:last-child{border-right:none}
.seg button.on{background:var(--greennav);color:var(--greendk);font-weight:650}
.resetbtn{flex:0 0 auto;border:1px solid var(--line2);border-radius:var(--r-sm);background:var(--card);color:var(--ink);font:500 12.5px var(--font);padding:7px 14px;cursor:pointer}
.resetbtn:hover{background:var(--greenbg)}
/* Repair 8 (UI repair plan v3): one focus ring, the evidence button's 2px green outline
   on :focus-visible, for every filter control and Reset. */
.resetbtn:focus-visible,.seg button:focus-visible,.aia-seg button:focus-visible,.aia-srch :is(input,button):focus-visible{outline:2px solid var(--green);outline-offset:1px}
/* The row grid: label column, one shared track, value column. Labels left-aligned
   so every bar starts at the same x and the eye compares lengths, not offsets. */
.vrow{display:grid;grid-template-columns:150px 1fr 120px;gap:14px;align-items:center;padding:7.5px 0;position:relative}
.vrow .k{font-size:13.5px;font-weight:550;text-align:left;line-height:1.25}
.vtrack{height:18px;background:var(--greenbg);border-radius:5px;position:relative}
.vbar{position:absolute;top:0;bottom:0;left:0;background:var(--green);border-radius:5px;min-width:3px}
.vrow.faint .vbar{opacity:.42}
.vrow .v{font-family:var(--figs);letter-spacing:-0.03em;font-weight:650;font-size:14px;white-space:nowrap}
.vrow .v small{display:block;font-family:var(--font);font-weight:400;color:var(--ink3);font-size:11px;letter-spacing:0}
.vrow .v.na{color:var(--ink3);font-weight:500}
.cmp{position:absolute;top:-5px;bottom:-5px;border-left:2px dashed var(--gold);z-index:2}
/* Repair 20 (UI repair plan v3): the comparison tick shows its label in the white
   evidence-popup style on hover, keyboard focus or tap, instead of a native title
   tooltip (never shown on touch). The hit area widens without moving the line. */
.cmp[data-tip]{cursor:default;outline:none}
.cmp[data-tip]::before{content:"";position:absolute;top:0;bottom:0;left:-7px;width:12px}
.cmp[data-tip]:hover::after,.cmp[data-tip]:focus::after{content:attr(data-tip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);white-space:nowrap;background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:var(--r-sm);box-shadow:0 4px 14px rgba(0,0,0,.08);padding:6px 9px;font:500 12px var(--font);z-index:30;pointer-events:none}
.cmp[data-tip]:focus-visible{box-shadow:0 0 0 2px var(--green)}
.vrow.ghost .vtrack{background:transparent;border:1.5px dashed var(--line2)}
.vrow.ghost .k{color:var(--ink3)}
.vrow.ghost .v{font-family:var(--font);font-weight:400;font-size:11.5px;color:var(--ink3);white-space:normal}
.k .tagline{display:block;font-size:10.5px;font-weight:500;color:var(--ink3);margin-top:1px}
.qtip{display:none;position:absolute;left:110px;top:-8px;z-index:6;background:var(--card);border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 28px rgba(20,30,25,.14);padding:10px 12px;min-width:240px;max-width:420px}
.vrow.hasq:hover .qtip,.vrow.hasq.tapopen .qtip{display:block}
.qtip .qq{color:var(--ink2);padding:3px 0;border-bottom:1px solid var(--line)}
.qtip .qq:last-child{border-bottom:none}
.qtip .qn{font-weight:600;color:var(--greendk);margin-bottom:5px}
table.sov{width:100%;border-collapse:collapse;font-size:13.5px}
table.sov th{text-align:left;font-size:11px;letter-spacing:.06em;color:var(--ink3);font-weight:650;padding:6px 8px;border-bottom:1px solid var(--line)}
table.sov td{padding:6.5px 8px;border-bottom:1px solid var(--greenbg)}
table.sov .tt{display:block;height:14px;background:var(--greenbg);border-radius:4px;position:relative;min-width:60px}
table.sov .tt i{position:absolute;top:0;bottom:0;left:0;background:var(--green);border-radius:4px}
table.sov .tt i.other{background:var(--ink3)}
table.sov tr.me td{font-weight:650}
table.sov td.r,table.sov th.r{text-align:right;font-family:var(--figs);letter-spacing:-0.03em;white-space:nowrap}
.bars .row{display:grid;grid-template-columns:190px 1fr 46px;gap:14px;align-items:center;padding:6.5px 0;font-size:13.5px}
.bars .row .k{text-align:left}
.bars .row .t{display:block;height:16px;background:var(--greenbg);border-radius:5px;position:relative}
.bars .row .t i{position:absolute;top:0;bottom:0;left:0;background:var(--green);border-radius:5px}
.bars .row .v{font-family:var(--figs);font-weight:650;text-align:right}
.grid2{display:grid;grid-template-columns:1fr;gap:16px;margin-top:14px}
.card.mini{padding:16px 18px;margin-bottom:0}
.mini .vrow{grid-template-columns:120px 1fr 108px;gap:10px;padding:6.5px 0}
.mini .vrow .k{font-size:12.5px}
.mini .ctl select{min-width:112px;font-size:12.5px;padding:6px 24px 6px 9px}
.statebox{border:1.5px dashed var(--line2);border-radius:var(--r);padding:30px 26px;text-align:center;background:var(--greenbg)}
.statebox h3{font-size:15.5px;font-weight:650;margin-bottom:8px}
.statebox p{color:var(--ink2);font-size:13.5px;max-width:62ch;margin:0 auto 8px}
@media(max-width:940px){
  .vrow{grid-template-columns:104px 1fr 106px;gap:9px}
  .vrow .k{font-size:12.5px}
  .bars .row{grid-template-columns:150px 1fr 40px}
  .mini .vrow{grid-template-columns:92px 1fr 96px}
  .qtip{left:0;width:88vw}
}
/* Untracked inventory on the portfolio grid (25 Oct review, Hitanshu): a translucent
   grey film over the photo and a grey status word, so tracked properties read first.
   The card stays fully clickable - this mutes, it does not disable. */
.prop-untracked .ph::after {
  content: ""; position: absolute; inset: 0; background: rgba(88, 94, 90, .38);
}
.prop-untracked .pfst { color: var(--ink3); }

/* Portfolio groups reuse the shared grey collapsible section (.vis-sec, css/visibility.css,
   wired by js/vis-components.js); only the count beside the heading is page-specific. */
#portfolio .vis-sec .bhead { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
#portfolio .vis-sec .pfgn { margin-left: 8px; font-size: 12.5px; font-weight: 500; color: var(--ink3); }
#portfolio .vis-sec .props { margin: 0; }
#portfolio .pfgempty { color: var(--ink3); font-size: 13px; padding: 2px 4px 4px; }

/* Baseline groups (Hitanshu, 10 Nov 2026): the shared grey collapsible section
   (.vis-sec, css/visibility.css) with the group heading styled as on the portfolio.
   Each group's lead card spans both columns. */
#summary .vis-sec .bhead { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
#summary .vis-sec-body.structure-cards { margin: 0; }
.structure-card.wide { grid-column: 1 / -1; }
