/* TenderOS design system (India Catalyst Partners).

   Type: IBM Plex Sans for the interface (its figures are tabular by default, so numbers align
   everywhere), Source Serif 4 for page titles, IBM Plex Mono for codes and logs. Self-hosted
   from fonts/ (fontsource 5.3 builds of the Google Fonts files, SIL Open Font License 1.1; see
   fonts/OFL-*.txt). No runtime CDN.

   Colour: warm neutral paper and ink, one accent (ink navy), and muted semantic hues that carry
   meaning only: hot / awarded / cold / mid, solo / partner, good / warn / bad.

   Class names are a contract with every template (including feature pages built elsewhere):
   restyle freely, never rename. Every page is styled from this one file: the V1 and V2 feature
   stylesheets are folded in below as components. The old token names (--panel, --panel-2,
   --solo, --solo-soft) stay defined for feature work written against them. */

/* ------------------------------------------------------------------ fonts */

@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2-variations"),
       url("fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-ext-wght-normal.woff2") format("woff2-variations"),
       url("fonts/ibm-plex-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2-variations"),
       url("fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("fonts/source-serif-4-latin-ext-opsz-normal.woff2") format("woff2-variations"),
       url("fonts/source-serif-4-latin-ext-opsz-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: light;

  /* neutrals: one warm stone family */
  --bg: #f6f5f2;            /* page */
  --side-bg: #f0efea;       /* navigation */
  --surface: #ffffff;       /* panels, tables */
  --surface-2: #f3f2ee;     /* quiet fills: chips, code, board columns */
  --surface-3: #ebe9e4;     /* pressed, bar tracks */
  --line: #e6e3dc;          /* hairlines */
  --line-2: #d5d1c8;        /* stronger separators */
  --field-line: #bdb8ae;    /* form control borders */
  --text: #1c1b18;          /* ink */
  --text-2: #3b3934;        /* secondary ink */
  --muted: #615e56;         /* metadata (6:1 on paper) */
  --faint: #716d64;         /* tertiary text, still WCAG AA */
  --hover: rgba(28, 27, 24, .035);
  --hover-strong: rgba(28, 27, 24, .06);

  /* the one accent: ink navy */
  --accent: #26487c;
  --accent-fill: #26487c;
  --accent-fill-hover: #1c3a66;
  --accent-soft: #e8eef7;
  --accent-text: #26487c;
  --on-accent: #ffffff;
  --focus: rgba(38, 72, 124, .28);

  /* meaning */
  --good: #2b6846;    --good-soft: #e5f0e8;
  --partner: #6a4890; --partner-soft: #efe9f6;
  --hot: #a33e2a;     --hot-soft: #f8e7e2;
  --awarded: #1c6964; --awarded-soft: #e1efed;
  --cold: #2d5b85;    --cold-soft: #e4ecf5;
  --mid: #87590f;     --mid-soft: #f6ebd8;
  --warn: #8a560c;    --warn-soft: #f8ecd9;
  --bad: #a8302e;     --bad-soft: #f9e5e3;
  --unknown: #5c5951; --unknown-soft: #eeece7;

  /* network map */
  --viz-team: #26487c; --viz-contact: #a39e94; --viz-wealth: #7b58a3; --viz-company: #3a7654;
  --viz-edge: #d9d5cc; --viz-label: #3b3934;

  /* legacy names (feature stylesheets use these) */
  --panel: var(--surface);
  --panel-2: var(--surface-2);
  --solo: var(--good);
  --solo-soft: var(--good-soft);

  /* type */
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-serif: "Source Serif 4", "Iowan Old Style", Charter, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-2xs: 11px;
  --fs-xs: 11.5px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-base: 14px;
  --fs-lg: 15px;
  --fs-xl: 19px;
  --fs-2xl: 24px;
  --fs-3xl: 28px;

  /* space (4px grid) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* shape and depth */
  --radius-sm: 3px;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow: 0 1px 0 rgba(28, 27, 24, .03);
  --shadow-pop: 0 1px 2px rgba(28, 27, 24, .06), 0 12px 32px -8px rgba(28, 27, 24, .18);
  --z-sticky: 2; --z-nav: 30; --z-pop: 40; --z-toast: 50;
  --side-w: 236px;

  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23615e56' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Dark: the same tokens, twice (system preference unless the toggle says light; or forced dark). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131312; --side-bg: #0f0f0e; --surface: #1a1a18; --surface-2: #20201d; --surface-3: #2a2a26;
    --line: #2c2c28; --line-2: #3a3935; --field-line: #55534c;
    --text: #ecebe6; --text-2: #cfcdc6; --muted: #a5a297; --faint: #8f8c82;
    --hover: rgba(236, 235, 230, .04); --hover-strong: rgba(236, 235, 230, .07);
    --accent: #9bb8e6; --accent-fill: #3f669f; --accent-fill-hover: #4a73ad; --accent-soft: #1d2738;
    --accent-text: #a5c0ea; --on-accent: #ffffff; --focus: rgba(155, 184, 230, .32);
    --good: #86c59f; --good-soft: #18281e; --partner: #bda5df; --partner-soft: #241e30;
    --hot: #ec9a85; --hot-soft: #2e1c17; --awarded: #74c2b9; --awarded-soft: #142826;
    --cold: #94b6de; --cold-soft: #182432; --mid: #dcab5f; --mid-soft: #2b2415;
    --warn: #e0ad5c; --warn-soft: #2c2414; --bad: #f08c82; --bad-soft: #301b19;
    --unknown: #b4b0a6; --unknown-soft: #25241f;
    --viz-team: #8fb0e3; --viz-contact: #6f6c64; --viz-wealth: #b39bd8; --viz-company: #7dbb96;
    --viz-edge: #3a3935; --viz-label: #cfcdc6;
    --shadow: none;
    --shadow-pop: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -8px rgba(0, 0, 0, .6);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a5a297' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131312; --side-bg: #0f0f0e; --surface: #1a1a18; --surface-2: #20201d; --surface-3: #2a2a26;
  --line: #2c2c28; --line-2: #3a3935; --field-line: #55534c;
  --text: #ecebe6; --text-2: #cfcdc6; --muted: #a5a297; --faint: #8f8c82;
  --hover: rgba(236, 235, 230, .04); --hover-strong: rgba(236, 235, 230, .07);
  --accent: #9bb8e6; --accent-fill: #3f669f; --accent-fill-hover: #4a73ad; --accent-soft: #1d2738;
  --accent-text: #a5c0ea; --on-accent: #ffffff; --focus: rgba(155, 184, 230, .32);
  --good: #86c59f; --good-soft: #18281e; --partner: #bda5df; --partner-soft: #241e30;
  --hot: #ec9a85; --hot-soft: #2e1c17; --awarded: #74c2b9; --awarded-soft: #142826;
  --cold: #94b6de; --cold-soft: #182432; --mid: #dcab5f; --mid-soft: #2b2415;
  --warn: #e0ad5c; --warn-soft: #2c2414; --bad: #f08c82; --bad-soft: #301b19;
  --unknown: #b4b0a6; --unknown-soft: #25241f;
  --viz-team: #8fb0e3; --viz-contact: #6f6c64; --viz-wealth: #b39bd8; --viz-company: #7dbb96;
  --viz-edge: #3a3935; --viz-label: #cfcdc6;
  --shadow: none;
  --shadow-pop: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -8px rgba(0, 0, 0, .6);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a5a297' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:root[data-theme="light"] { color-scheme: light; }

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--line-2) transparent; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: var(--fs-base); line-height: 1.5; font-weight: 400; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
a { color: var(--accent-text); text-decoration: none; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 600; }
p { margin: 0 0 var(--s-3); }
img, svg { max-width: 100%; }

h1 {
  font-family: var(--font-serif); font-optical-sizing: auto; font-size: var(--fs-3xl); line-height: 1.12;
  font-weight: 500; letter-spacing: -.012em; margin: 0; color: var(--text); text-wrap: balance;
}
h2 { font-size: var(--fs-lg); line-height: 1.35; font-weight: 600; letter-spacing: -.004em; margin: 0 0 var(--s-3); color: var(--text); }
h3 { font-size: var(--fs-sm); line-height: 1.4; font-weight: 600; color: var(--muted); margin: 0 0 var(--s-2); letter-spacing: .01em; }

.num, td.num, th.num { font-variant-numeric: tabular-nums lining-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: var(--fs-sm); line-height: 1.45; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a:focus-visible { border-radius: 2px; }

.skip { position: absolute; left: var(--s-3); top: -60px; z-index: var(--z-toast); background: var(--surface); color: var(--text);
  padding: var(--s-2) var(--s-3); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.skip:focus { top: var(--s-3); }

/* ------------------------------------------------------------------ shell */

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; z-index: var(--z-nav);
  display: flex; flex-direction: column; background: var(--side-bg); border-right: 1px solid var(--line);
  padding: 16px 12px 12px; overflow: hidden;
}
.side-head { display: flex; align-items: center; gap: var(--s-3); flex: none; }
.side-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
/* the navigation scrolls on short screens; the status footer and theme switch stay in view */
.nav-scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -12px; padding: 0 12px 8px; scrollbar-width: thin; }

.brand { display: grid; gap: 3px; padding: 0 10px 6px; color: var(--text); font-weight: 600; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-name { font-family: var(--font-serif); font-optical-sizing: auto; font-size: 21px; line-height: 1; font-weight: 600; letter-spacing: -.02em; }
.brand-owner { font-size: var(--fs-2xs); font-weight: 500; line-height: 1.2; color: var(--muted); letter-spacing: .03em; }
.brand span:not([class]) { color: inherit; }

.nav-group { display: grid; gap: 1px; margin-top: 14px; }
.nav-label {
  padding: 0 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--faint);
}
/* the folded System group: its label is the toggle */
details.nav-more > summary.nav-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 4px 10px 6px;
  border-radius: 5px; font-size: 10.5px; color: var(--faint); cursor: pointer; list-style: none;
}
details.nav-more > summary.nav-label::-webkit-details-marker { display: none; }
details.nav-more > summary.nav-label::before { content: none; }
details.nav-more > summary.nav-label::after {
  content: ""; width: 5px; height: 5px; margin-right: 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s ease;
}
details.nav-more[open] > summary.nav-label::after { transform: rotate(45deg); }
details.nav-more > summary.nav-label:hover { color: var(--muted); }
details.nav-more:not([open]) > summary.nav-label { padding-bottom: 4px; }
.side a.nav {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 27px; padding: 3px 10px;
  border-radius: 5px; color: var(--text-2); font-size: 13.5px; line-height: 1.25; font-weight: 450;
  transition: background-color .12s ease, color .12s ease;
}
.side a.nav:hover { background: var(--hover-strong); color: var(--text); text-decoration: none; }
.side a.nav.on { background: var(--surface); color: var(--text); font-weight: 560; box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.side .nav svg { width: 16px; height: 16px; flex: none; color: var(--faint); stroke-width: 1.6; }
.side a.nav:hover svg { color: var(--muted); }
.side a.nav.on svg { color: var(--accent); }
.side .sep { height: 1px; background: var(--line); margin: var(--s-2) 10px; }

.side .foot {
  margin-top: auto; padding: var(--s-3) 10px 0; display: grid; gap: 6px; font-size: var(--fs-sm); color: var(--muted);
}
.side .foot > .status { display: flex; align-items: baseline; min-width: 0; line-height: 1.35; }
.side .foot a { color: var(--muted); }
.side .foot a:hover { color: var(--text); }
.side .foot .foot-rule { height: 1px; background: var(--line); margin: 2px -10px 6px; }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: 1px; flex: none; }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 18%, transparent); }
.dot.off { background: var(--faint); }
.dot.busy { background: var(--warn); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.theme {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-top: 2px; padding: 2px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
}
.theme button {
  font: inherit; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); background: transparent;
  border: 0; border-radius: 4px; padding: 4px 8px; cursor: pointer; transition: color .12s, background-color .12s;
}
.theme button:hover { color: var(--text); }
.theme button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line), var(--shadow); }

.menu-btn {
  display: none; margin-left: auto; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  font: inherit; font-size: var(--fs-md); font-weight: 500; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer;
}
.menu-btn svg { width: 16px; height: 16px; }

.main { min-width: 0; width: 100%; max-width: 1600px; padding: 28px 36px 72px; }

/* page header */
.top { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: var(--s-4) var(--s-6); margin: 0 0 var(--s-6); }
.top > :first-child { min-width: 0; flex: 1 1 440px; }
.top > :first-child > .muted.small:last-child,
.top .lede { margin-top: 8px; font-size: var(--fs-md); line-height: 1.5; color: var(--muted); max-width: 88ch; }
.top form { display: flex; gap: var(--s-2); }
.top form input[type=search] { width: 280px; }
.top .row { flex-wrap: wrap; justify-content: flex-end; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .slash { color: var(--line-2); margin: 0 8px; }
.top-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; }

/* ------------------------------------------------------------------ blocks */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px 20px 20px; box-shadow: var(--shadow); min-width: 0;
}
.card + .card { margin-top: var(--s-4); }
.grid > .card + .card { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; overflow: clip; }
.card.flush > h2 { padding: 16px 20px 0; margin-bottom: var(--s-3); }
.card > h2:first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card.empty { text-align: center; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-3); }
.card-head h2 { margin: 0; }
.card-head.align-top { align-items: flex-start; }
.card.flush > .card-head { padding: 16px 20px 0; }
.card.flush > .tabbar { margin: 0; padding: 0 20px; }
.card-note { color: var(--muted); font-size: var(--fs-sm); margin: -4px 0 var(--s-3); max-width: 90ch; }
.card.flush > .card-note { padding: 0 20px; }
.card-foot { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin: var(--s-8) 0 var(--s-3); }
.section-title h2 { margin: 0; }

.main > * + * { margin-top: var(--s-4); }
.grid { display: grid; gap: var(--s-4); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 352px; align-items: start; }

/* KPI strip: one panel, hairline dividers, label above the figure */
.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: var(--s-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
}
.kpi {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 18px 16px;
  box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line);
}
.kpi > a { flex: 1; display: flex; flex-direction: column; gap: 6px; color: inherit; margin: -14px -18px -16px; padding: 14px 18px 16px; transition: background-color .12s; }
.kpi > a:hover { background: var(--hover); text-decoration: none; }
.kpi .l { order: -1; font-size: var(--fs-sm); line-height: 1.35; color: var(--muted); }
.kpi .v {
  font-size: 26px; line-height: 1.1; font-weight: 450; letter-spacing: -.02em; color: var(--text);
  font-variant-numeric: tabular-nums lining-nums; overflow-wrap: anywhere;
}
.kpi .v .dot { width: 8px; height: 8px; vertical-align: 4px; }
.kpi .mark { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.mark-solo { background: var(--good); } .mark-partner { background: var(--partner); }

/* dashboard side column: two labelled panels of joined sections (what waits on a person, then the overview)
   instead of a stack of separate cards; feature cards drop in as sections */
.rail { display: grid; gap: var(--s-2); align-content: start; min-width: 0; }
.rail-label { margin: var(--s-3) 2px -2px; font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.rail-label:first-child { margin-top: 0; }
.rail-group { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; overflow: clip; }
.rail-group > .card { margin: 0; padding: 14px 18px 16px; border: 0; border-radius: 0; box-shadow: none; }
.rail-group > .card + .card { margin-top: 0; border-top: 1px solid var(--line); }
.rail-group .card-head { margin-bottom: 8px; }
.rail-group .card-head h2 { font-size: var(--fs-base); }
.rail-group .card-note { margin: -2px 0 8px; }
.rail-group .portal-health .figure { font-size: 22px; }
.rail-empty { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.rail-more { margin-top: 2px; }
.rail-more > summary { padding: 4px 0 2px; font-size: var(--fs-sm); }
.rail-more[open] > summary { margin-bottom: 2px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: var(--s-3); }
.stack > h3 { margin-bottom: 0; }

dl.kv { display: grid; grid-template-columns: minmax(104px, 36%) minmax(0, 1fr); margin: 0; font-size: var(--fs-md); }
dl.kv dt { color: var(--muted); padding: 7px 14px 7px 0; border-top: 1px solid var(--line); }
dl.kv dd { margin: 0; padding: 7px 0; border-top: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
dl.kv dt:first-of-type, dl.kv dt:first-of-type + dd { border-top: 0; padding-top: 0; }
dl.kv.small { font-size: var(--fs-sm); }

/* ------------------------------------------------------------------ tables */

.scroll { overflow-x: auto; scrollbar-width: thin; }
.scroll.tall { max-height: min(74vh, 860px); overflow: auto; overscroll-behavior: contain; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-md); line-height: 1.45; }
table.data th {
  position: sticky; top: 0; z-index: var(--z-sticky); background: var(--surface);
  text-align: left; font-weight: 500; font-size: var(--fs-xs); letter-spacing: .02em; color: var(--muted);
  padding: 10px 12px 9px; border-bottom: 1px solid var(--line-2); white-space: nowrap; vertical-align: bottom;
}
table.data th.num { text-align: right; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th:first-child, table.data td:first-child { padding-left: 20px; }
table.data th:last-child, table.data td:last-child { padding-right: 20px; }
table.data tr:last-child td { border-bottom: 0; }
table.data tfoot td { border-top: 1px solid var(--line-2); }
table.data tr:hover td { background: var(--hover); }
table.data td.title { min-width: 280px; }
table.data td a { color: var(--text); }
table.data td a:hover { color: var(--accent-text); }
table.data td.title a { font-weight: 500; }
table.data td .small, table.data td .muted.small { margin-top: 2px; }
table.data td.empty { text-align: center; }
table.data tr:hover td.empty { background: none; }
.card:not(.flush) table.data th:first-child, .card:not(.flush) table.data td:first-child { padding-left: 0; }
.card:not(.flush) table.data th:last-child, .card:not(.flush) table.data td:last-child { padding-right: 0; }

/* ------------------------------------------------------------------ badges, chips, bars */

.badge {
  --b-fg: var(--muted); --b-bg: var(--surface-2);
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; vertical-align: 1px;
  border-radius: var(--radius-sm); background: var(--b-bg); color: var(--b-fg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--b-fg) 18%, transparent);
  font-size: var(--fs-xs); font-weight: 500; line-height: 1; letter-spacing: .005em; white-space: nowrap;
}
.b-solo, .b-good, .b-team, .b-admin { --b-fg: var(--good); --b-bg: var(--good-soft); }
.b-partner, .b-lead { --b-fg: var(--partner); --b-bg: var(--partner-soft); }
.b-hot { --b-fg: var(--hot); --b-bg: var(--hot-soft); }
.b-awarded { --b-fg: var(--awarded); --b-bg: var(--awarded-soft); }
.b-cold { --b-fg: var(--cold); --b-bg: var(--cold-soft); }
.b-mid { --b-fg: var(--mid); --b-bg: var(--mid-soft); }
.b-warn { --b-fg: var(--warn); --b-bg: var(--warn-soft); }
.b-bad, .b-blocked { --b-fg: var(--bad); --b-bg: var(--bad-soft); }
.b-unknown { --b-fg: var(--unknown); --b-bg: var(--unknown-soft); }
.b-no_fit { --b-fg: var(--faint); --b-bg: transparent; }
.b-plain { --b-fg: var(--muted); --b-bg: var(--surface-2); }
.b-accent { --b-fg: var(--accent-text); --b-bg: var(--accent-soft); }
/* heat and track carry a signal dot */
.b-hot::before, .b-awarded::before, .b-cold::before, .b-mid::before, .b-solo::before, .b-partner::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none;
}

.chip {
  display: inline-block; max-width: 100%; padding: 2px 6px; margin: 0 4px 4px 0; vertical-align: top;
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-xs); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.due-0 { color: var(--bad); font-weight: 600; }
.due-1 { color: var(--warn); font-weight: 600; }
.due-2 { color: var(--text); }

.score { display: inline-flex; align-items: center; gap: 8px; }
.score b { min-width: 2ch; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { display: inline-block; width: 56px; height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; vertical-align: middle; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.comp { display: grid; grid-template-columns: 64px minmax(0, 1fr) 24px; gap: 8px; align-items: center; margin: 3px 0; font-size: var(--fs-2xs); color: var(--muted); }
.comp .bar { width: 100%; height: 3px; }
.comp > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.hbar { display: grid; grid-template-columns: minmax(0, 1fr) 28% 38px; gap: 10px; align-items: center; padding: 5px 0; font-size: var(--fs-md); }
.hbar > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar a { color: var(--text); }
.hbar a:hover { color: var(--accent-text); }
.hbar .bar { width: 100%; height: 6px; border-radius: 1px; }
.hbar .num { color: var(--muted); }

/* ------------------------------------------------------------------ forms */

input[type=text], input[type=number], input[type=search], input[type=date], input[type=datetime-local], input[type=time],
input[type=password], input[type=email], input[type=url], input[type=tel], select, textarea {
  font: inherit; font-size: var(--fs-md); color: var(--text); background-color: var(--surface);
  border: 1px solid var(--field-line); border-radius: var(--radius); height: 32px; padding: 0 10px;
  min-width: 0; max-width: 100%; transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 84px; width: 100%; padding: 8px 10px; line-height: 1.5; resize: vertical; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 28px; text-overflow: ellipsis;
  background-image: var(--chevron); background-repeat: no-repeat; background-position: right 10px center; background-size: 10px 6px;
}
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--field-line) 55%, var(--text)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent-fill); width: 15px; height: 15px; margin: 0; flex: none; }
input[type=file] { font: inherit; font-size: var(--fs-md); color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button {
  font: inherit; font-size: var(--fs-md); font-weight: 500; color: var(--text); background: var(--surface);
  border: 1px solid var(--field-line); border-radius: var(--radius); height: 32px; padding: 0 12px; margin-right: 10px; cursor: pointer;
}
label.f { display: grid; gap: 6px; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
label.f input, label.f select, label.f textarea { font-weight: 400; }
label.row { font-size: var(--fs-md); color: var(--text-2); }
label.row.small { font-size: var(--fs-sm); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px;
  font: inherit; font-size: var(--fs-md); font-weight: 500; line-height: 1; letter-spacing: .005em;
  color: var(--on-accent); background: var(--accent-fill); border: 1px solid var(--accent-fill); border-radius: var(--radius);
  cursor: pointer; white-space: nowrap; text-decoration: none; user-select: none;
  transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s, opacity .12s;
}
.btn:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { color: var(--text); background: var(--surface); border-color: var(--field-line); }
.btn.ghost:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--field-line) 55%, var(--text)); }
.btn.small { height: 26px; padding: 0 10px; font-size: var(--fs-sm); }
.btn.good { color: var(--good); background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 22%, transparent); }
.btn.good:hover { border-color: var(--good); }
.btn.bad { color: var(--bad); background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.btn.bad:hover { border-color: var(--bad); }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { opacity: 1; cursor: progress; color: var(--text); background: var(--surface-2); border-color: var(--line-2); }
.btn[aria-busy="true"]::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); animation: pulse 1.2s ease-in-out infinite;
}
.btn-text { padding: 0; border: 0; background: none; font: inherit; color: var(--accent-text); cursor: pointer; }

.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.filters input[type=search] { width: 260px; }
.filters label.row { height: 32px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: var(--s-2); align-items: center; }
.filter-grid > * { width: 100%; min-width: 0; }
.filter-grid > .span-2 { grid-column: span 2; }
.filter-grid input[type=search] { width: 100%; }
.filter-grid .range { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.filter-grid .range input { width: 100%; }
.filter-grid .filter-actions { display: flex; gap: var(--s-2); justify-content: flex-end; grid-column-end: -1; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 7px 16px; }
.checks label { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-md); line-height: 1.35; color: var(--text-2); }
.checks input { margin-top: 1px; }
.pager { display: flex; gap: var(--s-3); justify-content: space-between; align-items: center; padding: 10px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.pager .row { gap: 6px; }

/* ------------------------------------------------------------------ misc */

ul.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: var(--fs-md); line-height: 1.45; }
ul.reasons li { color: var(--text); overflow-wrap: anywhere; }
ul.reasons.small { font-size: var(--fs-sm); }
ul.reasons.dotted li { position: relative; padding-left: 14px; }
ul.reasons.dotted li::before { content: ""; position: absolute; left: 1px; top: .6em; width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--fs-md); min-width: 0; }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li:last-child { padding-bottom: 0; }
.list > li > :first-child { min-width: 0; overflow-wrap: anywhere; }
.list a { color: var(--text); }
.list a:hover { color: var(--accent-text); }
.list .meta { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.row.tight { gap: 6px; }
.figure { font-size: 26px; line-height: 1.1; font-weight: 450; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.portal-health { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: var(--s-3); }
.portal-health:last-child { margin-bottom: 0; }
.star { color: var(--warn); margin-right: 6px; font-size: .92em; }
.cell-chips { width: 196px; }
.cell-chips .chip { max-width: 184px; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 7px; }
.tags .chip { margin: 0; max-width: 260px; }
.tag-note { font-size: var(--fs-xs); color: var(--muted); }
.th-note { font-weight: 400; color: var(--faint); margin-left: 6px; letter-spacing: 0; }
table.tenders td.title { min-width: 340px; }
table.tenders td:nth-child(2) { min-width: 84px; }

/* detail pages */
.top-detail { align-items: flex-start; }
.h1-long { font-size: var(--fs-2xl); line-height: 1.22; max-width: 62ch; }
.h1-long .star { font-size: .7em; vertical-align: .2em; }
h1 .badge { vertical-align: .35em; margin-left: 4px; font-family: var(--font-sans); letter-spacing: .005em; }
.h2-inline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.prose { font-size: var(--fs-base); line-height: 1.6; color: var(--text); max-width: 78ch; margin: 0 0 var(--s-4); }
.split { gap: var(--s-4) var(--s-6); }
.split + .split { margin-top: var(--s-5); }
.tight-grid { gap: var(--s-3); }
.grow { flex: 1 1 160px; }
.comps { margin-top: 8px; }
.cell-partner { min-width: 190px; }
.cell-score { min-width: 140px; }
.cell-validate { min-width: 176px; width: 200px; }
.verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 8px; }
.verdict-form { display: grid; gap: 6px; margin-bottom: 6px; }
.verdict-form input { width: 100%; }
.timeline { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; font-size: var(--fs-sm); }
.timeline li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; }
.timeline .when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.docs .doc-desc { display: block; }
.raw-fields { margin-top: var(--s-3); }

.notice {
  padding: 11px 16px; margin-bottom: var(--s-5); font-size: var(--fs-md); line-height: 1.5; color: var(--text);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); border-radius: var(--radius);
}
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 26%, transparent); }
.notice a { font-weight: 500; }

.path { font-size: var(--fs-md); line-height: 1.5; }
.path .arrow { color: var(--faint); margin: 0 5px; }
.path a { color: var(--text); }
.path a:hover { color: var(--accent-text); }

/* bid pipeline board */
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: var(--s-3); overflow-x: auto; padding-bottom: var(--s-2); scrollbar-width: thin; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 10px 10px; min-height: 132px; min-width: 0; }
.col h3 {
  display: flex; justify-content: space-between; align-items: baseline; margin: 0 4px 10px;
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.col h3 > span:last-child { font-variant-numeric: tabular-nums; letter-spacing: 0; color: var(--faint); }
.tcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 11px;
  margin-top: var(--s-2); font-size: var(--fs-md); line-height: 1.4; box-shadow: var(--shadow);
}
.col h3 + .tcard { margin-top: 0; }
.tcard a { color: var(--text); font-weight: 500; }
.tcard a:hover { color: var(--accent-text); }
.tcard-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 8px; font-size: var(--fs-sm); }
.owner { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); }
.avatar {
  display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent-text); font-size: 10px; font-weight: 600; line-height: 1;
}
.col-empty { padding: 18px 6px; text-align: center; font-size: var(--fs-sm); color: var(--faint); border: 1px dashed var(--line-2); border-radius: var(--radius); }

#graph { width: 100%; height: 640px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-sm); color: var(--muted); }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 7px; vertical-align: 0; }
.legend .lg-team { background: var(--viz-team); }
.legend .lg-contact { background: var(--viz-contact); }
.legend .lg-wealth { background: var(--viz-wealth); }
.legend .lg-company { background: var(--viz-company); border-radius: 2px; }
.finder { position: relative; }
.finder input[type=search] { width: 300px; }
.connect-form { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.connect-form input[type=text] { flex: 1 1 170px; }

/* forms in panels */
fieldset.fs { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.fs > legend { padding: 0; margin-bottom: 10px; font-size: var(--fs-sm); font-weight: 600; color: var(--text); letter-spacing: .01em; }
.fs-note { margin: 8px 0 0; }
.fy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
.fy-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fy-grid input { width: 100%; }
.check-list { display: grid; gap: 8px; }
.check-list label.row { gap: 8px; flex-wrap: wrap; }
.form-actions {
  position: sticky; bottom: 0; z-index: var(--z-sticky); display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--s-3);
  padding: 12px 0 14px; background: var(--bg); border-top: 1px solid var(--line);
}
.flow > * + * { margin-top: var(--s-4); }
.stack > fieldset { margin-top: var(--s-5); }
.add-row { border-top: 1px solid var(--line); border-bottom: 0; background: var(--surface-2); }
.add-row .grow-2 { flex: 2 1 240px; }
.add-row input[type=text]:not(.grow-2) { flex: 1 1 140px; }
.w-num { width: 92px; }
label.f > span:first-child { font-weight: 500; }

/* health, jobs */
.heal { padding: 14px 0; border-top: 1px solid var(--line); }
.heal:last-child { padding-bottom: 0; }
.heal-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px 16px; }
.heal-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.heal-body { margin: 6px 0 2px; font-size: var(--fs-md); max-width: 90ch; }
.heal-more { margin-top: 8px; align-items: flex-start; gap: 6px 20px; }
.heal-more details[open] { flex-basis: 100%; }
.heal-more .pre { margin-top: 8px; }
.jobs { display: grid; gap: var(--s-4); }
.job-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.link-muted { color: var(--muted); }
table.data td a.link-muted { color: var(--muted); }
table.data td a.link-muted:hover { color: var(--accent-text); }
.cell-notes { max-width: 340px; }
.count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 2px;
  border-radius: 4px; background: var(--surface-3); color: var(--text); font-size: var(--fs-2xs); font-weight: 600;
}
.card.flush > .list { padding: 4px 20px 16px; }
.report-list .meta { font-size: var(--fs-xs); }
li.empty { display: block; padding: 28px 0; }

/* WhatsApp */
.v-status { display: flex; align-items: center; font-size: 20px; letter-spacing: -.01em; }
.v-status .dot { margin-right: 10px; }
.v-date { font-size: 18px; letter-spacing: -.01em; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: var(--fs-md); line-height: 1.6; max-width: 100ch; }
.steps li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.thread { max-height: 720px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.thread .msg:first-child { margin-top: 0; }
.contacts { display: grid; gap: 0; }
.contact { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.contact:first-child { border-top: 0; padding-top: 0; }
.contact-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.contact-row > input[type=text] { flex: 1 1 110px; }
.contact-row .btn { margin-left: auto; }
.add-contact { display: grid; gap: 8px; }
.w-full { width: 100%; }

/* documents */
.upload-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); align-items: end; }
.upload-form .span-2 { grid-column: span 2; }
.upload-form input[type=text], .upload-form select { width: 100%; }
.upload-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-2) var(--s-3); min-height: 32px; }
.doc-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.doc-edit .doc-title { flex: 2 1 220px; font-weight: 500; }
.doc-edit .doc-desc-input { flex: 3 1 240px; }
.doc-file { margin-top: 6px; }

/* audit */
.cell-check { width: 300px; }
.audit-form { display: grid; gap: 6px; }
.w-by { width: 84px; }
.finding { margin-top: 4px; }

/* weekly report, in the app (report.html carries its own copy of these styles for the standalone file) */
.report-bar { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); max-width: 1000px; margin: 0 auto; font-size: var(--fs-md); }
.card.report { max-width: 1000px; margin-left: auto; margin-right: auto; padding: 40px 48px 52px; }
.report .r-head { padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line-2); }
.report .r-eyebrow { font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.report h1 { font-size: 34px; }
.report .r-meta { margin-top: 8px; color: var(--muted); font-size: var(--fs-md); }
.report h2 { margin: 36px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); font-size: var(--fs-lg); }
.report .h-note { font-weight: 400; color: var(--muted); font-size: var(--fs-sm); margin-left: 6px; }
.report .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); box-shadow: none; margin-bottom: 8px; }
.report .v-sep { color: var(--faint); font-weight: 300; }
.report table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-md); line-height: 1.45; }
.report table th { text-align: left; font-weight: 500; font-size: var(--fs-xs); letter-spacing: .02em; color: var(--muted); padding: 8px 10px 7px; border-bottom: 1px solid var(--line-2); white-space: nowrap; position: static; background: none; }
.report table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.report table th:first-child, .report table td:first-child { padding-left: 0; }
.report table th:last-child, .report table td:last-child { padding-right: 0; }
.report table th.num { text-align: right; }
.report table tr:last-child td { border-bottom: 0; }
.report table + table, .report table + p { margin-top: 18px; }
.report table tr:hover td { background: none; }
.report td a { color: var(--text); }
.report td a:hover { color: var(--accent-text); }
.report .stats { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.report .bad { color: var(--bad); font-weight: 500; }
.report .news { list-style: none; margin: 0; padding: 0; }
.report .news li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.report .news li:first-child { padding-top: 0; }
.report .news li:last-child { border-bottom: 0; }
.report .news-head { font-weight: 600; margin-bottom: 2px; }
.report .news-head a { color: var(--text); }
.report .news-item { font-size: var(--fs-md); margin-top: 3px; }

.log, .pre {
  font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.6; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; overflow: auto;
}
.log { max-height: 240px; }
.pre { max-height: 320px; }

details > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; list-style: none; display: inline-flex; align-items: center; gap: 7px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: ""; width: 0; height: 0; border-left: 4px solid currentColor; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent;
  transition: transform .15s ease;
}
details[open] > summary::before { transform: rotate(90deg); }
details > summary:hover { color: var(--text); }

.empty { padding: 36px 20px; text-align: center; color: var(--muted); font-size: var(--fs-md); }
.empty a { font-weight: 500; }

/* filter tabs: an underlined row of views with counts (scheme categories, SPOC, outreach and agreement statuses) */
.tabbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 22px; margin: 0 0 var(--s-5);
  border-bottom: 1px solid var(--line);
}
.tabbar a {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 0 9px; margin-bottom: -1px; white-space: nowrap;
  border-bottom: 2px solid transparent; color: var(--muted); font-size: var(--fs-md); font-weight: 500;
  font-variant-numeric: tabular-nums; transition: color .12s, border-color .12s;
}
.tabbar a:hover { color: var(--text); text-decoration: none; }
.tabbar a.on { color: var(--text); border-bottom-color: var(--accent); }
.tabbar .count { display: inline; min-width: 0; height: auto; padding: 0; margin: 0; background: none; border-radius: 0; color: var(--faint); font-size: inherit; font-weight: 400; }
.tabbar a.on .count { color: var(--muted); }
.cat-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; vertical-align: 1px; background: var(--faint); }
.c-hot { --c: var(--hot); } .c-awarded { --c: var(--awarded); } .c-cold { --c: var(--cold); }
.c-mid { --c: var(--mid); } .c-unknown { --c: var(--faint); }
.cat-dot[class*="c-"] { background: var(--c); }

/* secondary filters beside or under a tabbar (owner, kind) */
.subfilters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: calc(-1 * var(--s-3)) 0 var(--s-5); font-size: var(--fs-sm); color: var(--muted); }
.subfilters .lab { margin-right: 2px; }
.subfilters .lab + a, .subfilters a + .lab { margin-left: 0; }
.subfilters .lab:not(:first-child) { margin-left: 10px; }
.subfilters a { padding: 3px 9px; border-radius: 5px; color: var(--text-2); border: 1px solid var(--line); background: var(--surface); }
.subfilters a:hover { border-color: var(--field-line); text-decoration: none; color: var(--text); }
.subfilters a.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent-text); font-weight: 500; }

/* segmented control (people tabs, segment views) */
.tabs { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: var(--s-4); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.tabs a { padding: 5px 12px; border-radius: 5px; font-size: var(--fs-md); font-weight: 500; color: var(--muted); }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.tabs .count { display: inline; min-width: 0; height: auto; padding: 0; margin: 0 0 0 4px; background: none; border-radius: 0; color: var(--faint); font-size: inherit; font-weight: 400; }
.tabs a.on .count { color: var(--muted); }
/* the small one inside a card head (escalation status, movers period) */
.tabs.compact { margin: 0; padding: 2px; border-radius: var(--radius); }
.tabs.compact a { padding: 3px 10px; border-radius: 4px; font-size: var(--fs-sm); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: var(--s-5); }
.toolbar .tabs { margin: 0; }
.toolbar .lab { font-size: var(--fs-sm); color: var(--muted); }

/* ------------------------------------------------------------------ feature components
   Schemes and awards, segments and company profiles, outreach (V1). Of the old feature class names only the
   ones a template still uses remain (ow-card, ow-ell, ow-hint on the outreach cards). */

/* explanation of the scheme categories, one column each, ruled in the category colour */
.cat-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4) var(--s-6); margin: 0 0 var(--s-5); }
.cat-legend > div { padding-top: 10px; border-top: 2px solid var(--c, var(--line-2)); font-size: var(--fs-sm); line-height: 1.55; color: var(--muted); }
.cat-legend b { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; color: var(--text); font-size: var(--fs-md); font-weight: 600; }
.section-note { color: var(--muted); font-size: var(--fs-md); line-height: 1.55; max-width: 92ch; margin: calc(-1 * var(--s-2)) 0 var(--s-5); }
.cell-note { color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; margin-top: 6px; max-width: 36ch; }

/* stacked groups inside a side card (scheme board, award benchmarks, outreach rows) */
.group + .group { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.group-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.group-head .num { font-weight: 600; }
.group p { margin: 4px 0 0; }
.list.compact > li { padding: 4px 0; border-top: 0; font-size: 12.5px; }
.list.compact > li:first-child { padding-top: 0; }
.list .muted.nowrap { white-space: nowrap; }
.spread { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-width: 0; }
.spread > .grow { flex: 1; min-width: 0; }
.ellipsis, .ow-ell { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ow-card form { margin: 0; }
.ow-card p { margin: 8px 0 0; }

/* compact figures inside a card */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); margin: 0 0 var(--s-4); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat-row > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; padding: 9px 12px 10px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); background: none; border-radius: 0; }
.stat-row b { display: block; font-size: 16px; font-weight: 500; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-row span { font-size: var(--fs-xs); color: var(--muted); }

/* card internals */
.card-body { padding: 0 20px 16px; }
.card-body > :last-child { margin-bottom: 0; }
.card.flush > .card-body + .scroll { border-top: 1px solid var(--line); }
.card.flush > .foot-note { padding: 10px 20px 14px; margin: 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--faint); }
.card.flush > details.card-body { padding-top: 12px; border-top: 1px solid var(--line); }
.prose p, p.prose-sm { font-size: var(--fs-md); line-height: 1.6; max-width: 80ch; }
.prose-sm { margin: 0 0 var(--s-3); }

/* forms in side cards */
.form-grid { display: grid; gap: 12px; }
.form-grid .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid input[type=text], .form-grid input[type=number], .form-grid input[type=date], .form-grid select, .form-grid textarea { width: 100%; }
.form-grid textarea.short { min-height: 56px; }
.form-grid .submit-row { display: flex; gap: 8px; align-items: center; }
.form-grid .submit-row input { flex: 1; }
.add-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.add-form.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.add-form .wide { grid-column: span 2; }
.add-form input, .add-form select { width: 100%; }
.add-form .btn { justify-self: start; }

/* small helpers used by the feature pages */
.strong { font-weight: 600; }
.cell-winner { min-width: 120px; }
.cell-contract { min-width: 200px; }
.selected-scheme { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
ul.reasons.tech-list { display: block; columns: 2 260px; column-gap: 32px; }
ul.reasons.tech-list li { break-inside: avoid; margin-bottom: 5px; }
.fund-facts { margin-top: var(--s-4); }
.facts-note { margin: 8px 0 0; }
.filter-grid .check-row { grid-column: 1 / -2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; min-height: 30px; }
h3.gap { margin-top: var(--s-3); }
.row-gap { margin-top: 6px; }
.draft-form { margin: 10px 0 8px; }
.add-scheme { margin-top: 6px; flex-wrap: nowrap; }
.add-scheme select { flex: 1 1 auto; min-width: 0; max-width: 260px; height: 26px; font-size: var(--fs-sm); }
.work-forms details.activity { margin-top: 2px; }
.work-forms .timeline { margin-top: 8px; }
p.ow-hint { margin: 8px 0 0; }
.ow-card .group .badge { margin-top: 6px; }
.list.news-list > li { display: block; }
h3 + .list { margin-top: 2px; }

/* KPI extras: a secondary figure and a meter */
.v-sub { margin-left: 4px; font-size: var(--fs-md); font-weight: 500; color: var(--muted); letter-spacing: 0; }
.meter { display: block; height: 3px; margin-top: 6px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); }

/* state x turnover matrix: a plain table whose known cells get a faint accent tint by count */
table.matrix th.num, table.matrix td.num { min-width: 78px; }
table.matrix td { padding: 8px 12px; }
table.matrix .m-state { white-space: nowrap; }
table.matrix td a { color: var(--text); }
table.matrix td.m-cell[style] { background: color-mix(in srgb, var(--accent) calc(var(--i, 0) * 16% + 3%), transparent); }
table.matrix tr:hover td.m-cell[style] { background: color-mix(in srgb, var(--accent) calc(var(--i, 0) * 16% + 6%), transparent); }
table.matrix .m-unknown, table.matrix .m-total { box-shadow: inset 1px 0 0 var(--line); }
table.matrix td.m-unknown a { color: var(--muted); }
table.matrix .m-total { font-weight: 600; }
table.matrix tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line-2); border-bottom: 0; }

/* profile completeness: a bar and the actions that fill the gaps */
.pct { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.pct .bar { width: 44px; }
.completeness > .bar { width: 100%; height: 5px; margin: 0 0 12px; }
.action-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.known { color: var(--muted); font-size: var(--fs-sm); margin: 10px 0 0; }

/* company facts under the title (segment, slab, states, profile) */
.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0 0; padding: 0; }
.facts > div { display: grid; gap: 1px; min-width: 0; }
.facts dt { font-size: var(--fs-xs); color: var(--muted); }
.facts dd { margin: 0; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts dd a { color: var(--text); }

/* a person or official in a side card */
.person-row { padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); line-height: 1.45; }
.person-row:first-child { border-top: 0; padding-top: 0; }
.person-row .name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.person-row .contact { margin-top: 4px; font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-2); overflow-wrap: anywhere; }
.person-row .next { margin-top: 4px; color: var(--muted); }

/* SPOC and prospect work cards */
.work-card .work-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px 20px; }
.work-card .work-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; }
.work-card .work-head h2 .id { color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.work-card .work-meta { margin-top: 4px; font-size: var(--fs-sm); color: var(--muted); }
.work-card .work-when { font-size: var(--fs-sm); color: var(--muted); text-align: right; }
.work-card .work-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); gap: var(--s-4) var(--s-8); }
.work-card dl.kv { font-size: var(--fs-sm); }
.work-card .work-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.work-forms { display: grid; gap: 10px; align-content: start; }
.work-forms form { display: flex; flex-wrap: wrap; gap: 8px; }
.work-forms form > input[type=text]:not(.w-by):not(.w-owner) { flex: 1 1 160px; }
.w-owner { width: 104px; }
.ow-spoc { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.ow-prospect { gap: 8px; }
.ow-match { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* eligibility marks on a scheme match (pass / fail / unknown per criterion) */
.elig { font-size: var(--fs-sm); }
.elig > summary { list-style: none; display: inline-flex; gap: 3px; align-items: center; cursor: pointer; }
.elig > summary::before { content: none; }
.elig > summary::-webkit-details-marker { display: none; }
.elig .m { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 4px; font-size: 10.5px; font-weight: 700; line-height: 1; }
.elig .m.pass { background: var(--good-soft); color: var(--good); }
.elig .m.fail { background: var(--bad-soft); color: var(--bad); }
.elig .m.unknown { background: var(--surface-2); color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
.elig summary .n { margin-left: 5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.elig ul { list-style: none; margin: 8px 0 2px; padding: 8px 10px; display: grid; gap: 4px; min-width: 240px; max-width: 360px; white-space: normal;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.elig li b { font-weight: 600; }
.elig li.fail b { color: var(--bad); }
.elig li.pass b { color: var(--good); }
.elig li.unknown b { color: var(--muted); }

/* outreach workspace: the queue on the left, the message on a sheet on the right */
.ow-status { gap: 14px; color: var(--muted); font-size: var(--fs-sm); }
.ow-layout { display: grid; grid-template-columns: 316px minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.ow-main { min-width: 0; }
.ow-main > .card + .card { margin-top: var(--s-4); }
.ow-pending { display: grid; gap: 4px; margin-bottom: var(--s-4); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ow-pending b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--warn); vertical-align: 1px; animation: pulse 1.4s ease-in-out infinite; }
.ow-list { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; }
.ow-item { position: relative; display: grid; gap: 3px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text); transition: background-color .12s; }
.ow-item:last-child { border-bottom: 0; }
.ow-item:hover { background: var(--hover); text-decoration: none; }
.ow-item.on { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.ow-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ow-snip { color: var(--text-2); }
.ow-chans { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ow-chans .chip { margin: 0; }
.ow-sheet { padding: 26px 30px 22px; }
.ow-head { display: grid; gap: 4px; }
.ow-to-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.ow-name { font-family: var(--font-serif); font-optical-sizing: auto; font-size: 24px; line-height: 1.15; font-weight: 500; letter-spacing: -.01em; }
.ow-about { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin-top: 2px; }
.ow-channels { margin: 18px 0 0; }
.ow-tab-st { color: var(--faint); font-size: var(--fs-xs); font-weight: 400; }
.ow-hint { margin-top: 14px; padding: 9px 14px; font-size: var(--fs-sm); color: var(--text); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); border-radius: var(--radius); }
.ow-sheet > .notice { margin: 14px 0 0; }
.ow-compose { margin-top: 8px; }
.ow-field { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 12px; border-bottom: 1px solid var(--line); transition: border-color .12s; }
.ow-field:focus-within { border-bottom-color: var(--accent); }
.ow-field label { font-size: var(--fs-sm); color: var(--muted); }
.ow-compose .ow-field input { height: auto; width: 100%; padding: 12px 0; font-size: var(--fs-base); border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.ow-compose .ow-field input:focus { outline: none; box-shadow: none; }
.ow-compose .ow-subject input { font-size: 15.5px; font-weight: 600; letter-spacing: -.005em; }
.ow-compose .ow-body {
  display: block; width: 100%; max-width: 72ch; min-height: 240px; margin: 0; padding: 20px 0 14px; overflow: hidden; resize: vertical;
  font-size: 15px; line-height: 1.7; color: var(--text); border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.ow-compose .ow-body:focus { outline: none; box-shadow: none; }
.ow-compose .ow-body[readonly], .ow-compose .ow-field input[readonly] { color: var(--text); cursor: default; }
.ow-meta { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; padding: 9px 0 2px; border-top: 1px solid var(--line); }
.ow-count { font-size: var(--fs-sm); color: var(--faint); font-variant-numeric: tabular-nums; }
.ow-count.over { color: var(--warn); font-weight: 600; }
.ow-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: var(--s-4); }
.ow-approve, .ow-me { display: inline-flex; align-items: center; gap: 6px; }
.ow-approve input, .ow-me input { width: 132px; }
.ow-spacer { flex: 1; }
.ow-send { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.ow-send h3 { margin-bottom: 0; color: var(--text); font-size: var(--fs-md); }
.ow-send p { margin: 10px 0 0; }
.ow-mark { margin-top: var(--s-4); gap: 8px; }
.ow-by { width: 120px; }
.ow-notes h3 { margin-top: 2px; }
.ow-angle { margin: 0 0 var(--s-4); max-width: 75ch; font-size: var(--fs-md); line-height: 1.6; }
.ow-checks { margin: 0 0 var(--s-4); padding: 12px 16px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); }
.ow-checks h3 { color: var(--warn); }
.ow-checks ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: var(--fs-md); }
.ow-facts ol { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.ow-facts li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; font-size: var(--fs-md); line-height: 1.5; }
.ow-facts li.unused { color: var(--muted); }
.ow-n { color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }
.ow-grp { display: inline-block; margin-right: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.ow-src { font-size: var(--fs-xs); color: var(--faint); overflow-wrap: anywhere; }

/* WhatsApp conversation */
.msg { padding: 8px 12px 9px; border-radius: var(--radius-lg); margin: 8px 0; max-width: 680px; font-size: var(--fs-md); line-height: 1.5; background: var(--surface-2); border: 1px solid var(--line); }
.msg > div { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.in { margin-right: 48px; }
.msg.out { margin-left: 48px; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 16%, transparent); }
.msg-meta { display: block; margin-bottom: 3px; font-size: var(--fs-2xs); color: var(--muted); }

/* toast for background-job errors (postJSON / queueTask) */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast); max-width: min(440px, calc(100vw - 40px));
  padding: 12px 40px 12px 14px; font-size: var(--fs-md); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
  color: var(--text); background: var(--surface); border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line)); border-left: 3px solid var(--bad);
  border-radius: var(--radius); box-shadow: var(--shadow-pop);
}
.toast[hidden] { display: none; }
.toast button { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border: 0; border-radius: 4px; background: none; color: var(--muted); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.toast button:hover { background: var(--hover-strong); color: var(--text); }

/* popover (network search) */
.pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: var(--z-pop); width: min(380px, 92vw); max-height: 360px; overflow: auto;
  padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
.pop a { display: block; padding: 7px 10px; border-radius: 5px; color: var(--text); }
.pop a:hover { background: var(--hover-strong); text-decoration: none; }
.pop a .muted { margin-left: 6px; }

/* ------------------------------------------------------------------ contracts: obligations, bid checklists, agreements and proposals (V2 step 1) */

/* helpers */
.ct-tight { margin: 0; }
.ct-gap { margin-top: 10px; }
.ct-sub { display: block; margin-top: 2px; }
.ct-titles { min-width: 0; flex: 1 1 320px; }
.ct-lede { margin: 0 0 12px; max-width: 80ch; line-height: 1.55; }
.ct-flash { margin: 0 0 12px; }
ul.reasons.ct-bullets { list-style: disc; padding-left: 18px; gap: 6px; }
ul.ct-bullets li::marker { color: var(--faint); }
.ct-state { flex: none; flex-wrap: nowrap; }

/* a risk mark is a dot and a word, never colour alone */
.ct-risk { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; color: var(--muted); }
.ct-risk::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.ct-risk-high { color: var(--bad); }
.ct-risk-high::before { background: var(--bad); }
.ct-risk-medium::before { background: var(--warn); }
.ct-risk-low::before { background: transparent; box-shadow: inset 0 0 0 1px var(--faint); }

/* tender page: what was read, the obligations by category */
.ct-basis { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 6px; line-height: 1.5; }
.ct-sources { margin: 0 0 12px; }
.ct-doclist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.ct-doclist .faint { margin-left: 6px; }
.ct-attach-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 6px; }
.ct-attach-form input[type=text] { flex: 1 1 200px; }
.ct-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.ct-total { margin-right: 8px; font-size: var(--fs-md); }
.chip.ct-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 3px 8px; color: var(--text-2); }
.chip.ct-chip:hover { text-decoration: none; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.ct-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bad); display: inline-block; flex: none; }
.ct-highs {
  margin: 2px 0 14px; padding: 12px 16px 6px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--bad) 24%, var(--line)); background: color-mix(in srgb, var(--bad-soft) 50%, transparent);
}
.ct-highs h3 { color: var(--bad); margin: 0 0 4px; }
table.ct-high-table td { padding-top: 8px; padding-bottom: 8px; }
table.data.ct-high-table tr:hover td { background: none; }
.ct-group { border-top: 1px solid var(--line); }
.ct-group > summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; font-size: var(--fs-md); color: var(--text); }
.ct-group > summary:hover { color: var(--text); background: var(--hover); }
.ct-group > summary .ct-g-name { font-weight: 600; }
.ct-group[open] > summary { padding-bottom: 6px; }
.ct-group .scroll { margin-bottom: 12px; }
table.ct-table td { padding-top: 9px; padding-bottom: 9px; }
.ct-c-risk { width: 84px; }
.ct-c-who { width: 116px; }
.ct-c-when { width: 150px; }
.ct-c-ref { width: 130px; }
.ct-c-status { width: 146px; }
.ct-c-due { width: 76px; }
.ct-c-owner { width: 110px; }
.ct-high-table .ct-c-who { width: 150px; }
.ct-ob { min-width: 300px; line-height: 1.45; }
.ct-ob > div + div { margin-top: 3px; }
.ct-why { color: var(--bad); }
.ct-ref { overflow-wrap: anywhere; }
.ct-auto-form select { height: 28px; max-width: 116px; padding-left: 8px; font-size: var(--fs-sm); }
.ct-check .ct-auto-form select { max-width: 136px; }
.ct-tools { display: flex; flex-wrap: wrap; gap: 0 14px; margin-top: 4px; }
.ct-tools > details[open] { flex-basis: 100%; }
.ct-quote > summary, .ct-row-edit > summary { font-size: var(--fs-xs); }
.ct-quote blockquote {
  margin: 6px 0 2px; padding: 8px 12px; color: var(--text); background: var(--surface-2);
  border-left: 2px solid var(--line-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif); font-optical-sizing: auto; font-size: 14px; line-height: 1.55;
}
.ct-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; margin: 10px 0 6px; align-items: end; }
.ct-form-grid .ct-span { grid-column: 1 / -1; }
.ct-form-grid input[type=text], .ct-form-grid input[type=date], .ct-form-grid select, .ct-form-grid textarea { width: 100%; }
.ct-foot-note { margin: 10px 0 0; }
.ct-missing { margin-top: 14px; padding: 12px 16px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); }
.ct-missing h3 { color: var(--warn); margin-bottom: 6px; }
.ct-missing h3 .faint { margin-left: 4px; font-weight: 500; }
.ct-missing .ct-more { margin-top: 6px; }
.ct-missing .ct-more ul { margin-top: 6px; }
.ct-add { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* tender page: the bid checklist (rows carry ct-st-<status>; the script swaps it) */
.ct-progress { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
.ct-progress .bar { width: 120px; height: 5px; }
td > .ct-progress { margin-top: 0; flex-wrap: nowrap; }
td > .ct-progress .bar { width: 48px; }
.ct-phase { margin: 18px 0 6px; }
.ct-item { min-width: 280px; line-height: 1.45; }
.ct-item .chip, .ct-ob .chip { margin: 0 0 0 2px; vertical-align: middle; }
.ct-next { margin-top: 4px; }
.ct-notes { margin-top: 3px; white-space: pre-line; color: var(--text-2); }
.ct-st-done .ct-item-text, .ct-st-not_applicable .ct-item-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.ct-st-in_progress .ct-item-text { font-weight: 500; }

/* tender and company pages: drafts, and the forms that start them */
.ct-draft-forms { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.card-head + .ct-draft-forms { margin-top: 0; padding-top: 0; border-top: 0; }
.ct-draft { display: grid; gap: 8px; align-content: start; }
.ct-draft h3 { margin: 0; }
.ct-draft select, .ct-draft input[type=text], .ct-terms textarea { width: 100%; }
.ct-terms textarea { margin-top: 6px; }
.ct-company-draft { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.ct-company-draft form { margin-top: 10px; }
.ct-company-draft select { width: 100%; }

/* /contracts */
.ct-pending { display: grid; gap: 4px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ct-pending b::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%;
  background: var(--warn); vertical-align: 1px; animation: pulse 1.4s ease-in-out infinite;
}
.kpi .v.ct-v-bad { color: var(--bad); }
tr.ct-closed td, table.data tr.ct-closed td.title a { color: var(--muted); }
.cell-next { min-width: 140px; }
table.ct-bids td.title { min-width: 220px; }
.list.ct-tpl > li { display: block; }
.list.ct-tpl > li > a { font-weight: 500; }
.list.ct-dash > li > :first-child { min-width: 0; }
.list.ct-dash > li.ct-dash-t { display: block; padding-bottom: 1px; font-size: var(--fs-sm); }
.list.ct-dash > li.ct-dash-t a { color: var(--muted); }
.list.ct-dash > li.ct-dash-t a:hover { color: var(--accent-text); }
.list.ct-dash > li + li.ct-dash-t { margin-top: 6px; }
h3.ct-dash-h { margin: 14px 0 4px; }

/* agreement and proposal pages: a typeset document beside its status */
.ct-title { max-width: 60ch; }
.ct-doc-layout { grid-template-columns: minmax(0, 1fr) 320px; }
.ct-doc-col { min-width: 0; }
.ct-paper {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 56px 64px 72px; box-shadow: var(--shadow);
}
.ct-aside > .card + .card { margin-top: var(--s-3); }
.ct-steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; counter-reset: ct-step; }
.ct-steps li { counter-increment: ct-step; position: relative; padding: 5px 0 5px 28px; font-size: var(--fs-md); color: var(--muted); }
.ct-steps li::before {
  content: counter(ct-step); position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-2); font-size: 10.5px; line-height: 18px; text-align: center; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.ct-steps li + li::after { content: ""; position: absolute; left: 8.5px; top: -5px; height: 9px; width: 1px; background: var(--line-2); }
.ct-steps li.done { color: var(--text); }
.ct-steps li.done::before { color: var(--good); background: var(--good-soft); box-shadow: inset 0 0 0 1px var(--good); }
.ct-steps li.on { color: var(--text); font-weight: 600; }
.ct-steps li.on::before { background: var(--accent-fill); color: var(--on-accent); box-shadow: none; }
.ct-status-form input[type=text] { width: 100%; }
.ct-review { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); box-shadow: inset 3px 0 0 var(--warn); }
ul.ct-blanks { gap: 6px; }
.ct-blanks mark.ph { font-size: var(--fs-sm); line-height: 1.6; }
table.ct-mini { font-size: var(--fs-sm); }
table.ct-mini td, table.ct-mini th { padding: 6px 8px; }
.ct-facts ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.ct-facts li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; font-size: var(--fs-sm); line-height: 1.45; }
.ct-facts li.unused { color: var(--muted); }
.ct-facts .faint { font-size: var(--fs-xs); overflow-wrap: anywhere; }
.ct-n { color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.ct-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.ct-history li { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 8px; }

/* the editors */
.ct-editor { display: grid; gap: 14px; }
.ct-editor input[type=text] { width: 100%; }
.ct-editor-body textarea { font-family: var(--mono); font-size: var(--fs-md); line-height: 1.65; min-height: 480px; width: 100%; resize: vertical; }
.ct-editor textarea.ct-grow { min-height: 120px; width: 100%; font-family: var(--font-serif); font-optical-sizing: auto; font-size: 15px; line-height: 1.6; }
.ct-editor-actions { gap: 8px; padding-top: 4px; }
.ct-editor-actions input[type=text] { width: 160px; }
.ct-section-edit { border: 0; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; min-width: 0; }
label.f input.ct-section-head { font-weight: 600; }

/* the document itself: an agreement or proposal set like a printed page.
   Serif text at a readable measure, numbered clauses with hanging numbers, blanks marked in the warn tint. */
.ct-doc {
  max-width: 68ch; margin: 0 auto; color: var(--text);
  font-family: var(--font-serif); font-optical-sizing: auto; font-size: 16.5px; line-height: 1.65;
  hyphens: manual; overflow-wrap: break-word; text-wrap: pretty;
}
.ct-doc h1 { font-family: inherit; font-size: 26px; line-height: 1.25; font-weight: 600; text-align: center; letter-spacing: -.01em; margin: 30px 0 28px; }
.ct-doc h2 { font-family: inherit; font-size: 17px; line-height: 1.35; font-weight: 650; color: var(--text); margin: 32px 0 10px; letter-spacing: 0; }
.ct-doc h3 { font-family: inherit; font-size: 15.5px; font-weight: 600; color: var(--text); margin: 20px 0 6px; letter-spacing: 0; }
.ct-doc > h1:first-child { margin-top: 4px; }
.ct-doc p { margin: 0 0 12px; }
.ct-doc p.cl { padding-left: 2.8em; text-indent: -2.8em; }
.ct-doc .cl-n { display: inline-block; width: 2.8em; text-indent: 0; color: var(--muted); font-variant-numeric: tabular-nums lining-nums; }
.ct-doc ol, .ct-doc ul { margin: 0 0 12px; padding-left: 1.6em; }
.ct-doc li { margin: 4px 0; }
.ct-doc li::marker { color: var(--muted); }
.ct-doc strong { font-weight: 650; }
.ct-doc blockquote {
  margin: 0 0 24px; padding: 10px 14px; border-left: 2px solid var(--warn); background: var(--warn-soft);
  font-family: var(--font-sans); font-size: var(--fs-md); line-height: 1.5; color: var(--text); text-wrap: wrap;
}
.ct-doc blockquote p { margin: 0; }
mark.ph {
  background: var(--warn-soft); color: var(--text); border-radius: 2px; padding: 0 3px;
  box-shadow: inset 0 -1.5px 0 color-mix(in srgb, var(--warn) 55%, transparent);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.ct-doc .doc-table { overflow-x: auto; margin: 8px 0 18px; }
.ct-doc table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: var(--fs-md); line-height: 1.45; }
.ct-doc th, .ct-doc td { border: 1px solid var(--line-2); padding: 7px 10px; text-align: left; vertical-align: top; }
.ct-doc th { background: var(--surface-2); font-weight: 600; }
.ct-doc hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.ct-proposal h2 { font-size: 18px; margin-top: 36px; }

/* ------------------------------------------------------------------ comms hub: inbox, timeline, meetings (V2 step 2) */

/* helpers */
.cm-links { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.cm-tight { margin: 4px 0 0; }
.cm-empty { margin: 0; max-width: 72ch; }
.cm-warn { color: var(--warn); }
.cm-grow { flex: 1 1 160px; min-width: 0; }
h3.cm-sub { margin: 18px 0 6px; }
.cm-code {
  margin: 6px 0 10px; padding: 9px 12px; font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius);
}
code.cm-cmd {
  font-family: var(--mono); font-size: .92em; padding: 1px 5px; border-radius: 4px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap;
}
.cm-dirw { display: inline-block; min-width: 30px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.cm-snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 80ch; }
.cm-quiet .cm-title, .cm-quiet .cm-sum, tr.cm-quiet td { color: var(--faint); }

/* the timeline: channel filters, then one row per email, chat day, meeting or activity (a row opens its text) */
.cm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.cm-chip {
  font: inherit; font-size: var(--fs-sm); line-height: 1.2; color: var(--text-2); background: var(--surface);
  border: 1px solid var(--line); border-radius: 5px; padding: 4px 9px; cursor: pointer;
  transition: color .12s, border-color .12s, background-color .12s;
}
.cm-chip:hover { color: var(--text); border-color: var(--field-line); }
.cm-chip[aria-pressed="true"] { color: var(--accent-text); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); font-weight: 500; }
.cm-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cm-n { margin-left: 3px; color: var(--faint); font-weight: 400; font-variant-numeric: tabular-nums; }
.cm-chip[aria-pressed="true"] .cm-n { color: inherit; opacity: .75; }
.cm-list { list-style: none; margin: 0; padding: 0; }
.cm-item { border-top: 1px solid var(--line); }
.cm-item:first-child { border-top: 0; }
.cm-item[hidden] { display: none; }
.cm-item > details > summary {
  display: grid; grid-template-columns: 52px 76px minmax(0, 1fr) auto; gap: 12px; align-items: baseline;
  padding: 9px 8px; margin: 0 -8px; color: var(--text); font-size: var(--fs-md); line-height: 1.45;
  border-radius: var(--radius-sm); cursor: pointer;
}
.cm-item > details > summary::before { content: none; display: none; }
.cm-item > details > summary:hover { background: var(--hover); color: var(--text); }
.cm-item > details.cm-flat > summary { cursor: default; }
.cm-item > details.cm-flat > summary:hover { background: transparent; }
.cm-date { display: grid; color: var(--muted); font-size: var(--fs-sm); line-height: 1.35; font-variant-numeric: tabular-nums; }
.cm-date .cm-y, .cm-date .cm-t { color: var(--faint); }
.cm-date .cm-t { font-size: var(--fs-xs); }
.cm-same .cm-d, .cm-same .cm-y { display: none; }
.cm-ch { display: grid; font-size: var(--fs-sm); font-weight: 500; line-height: 1.35; color: var(--text-2); }
.cm-dir { font-size: var(--fs-xs); font-weight: 400; color: var(--faint); }
.cm-line { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details[open] > summary .cm-line { white-space: normal; }
.cm-title { font-weight: 500; }
.cm-sum { margin-left: 8px; color: var(--muted); }
details[open] > summary .cm-sum { display: block; margin: 2px 0 0; }
.cm-detail { display: grid; gap: 8px; justify-items: start; padding: 0 0 14px calc(52px + 76px + 24px); }
.cm-text {
  width: 100%; max-height: 360px; overflow: auto; padding: 10px 12px; font-size: var(--fs-md); line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); background: var(--surface-2); border-radius: var(--radius);
}

/* inbox: email with companies, unmatched email and chats (a row of text, then the forms that link it) */
.cm-mail td.cm-co { min-width: 150px; }
.cm-mail td.title { min-width: 260px; }
.cm-um { list-style: none; margin: 0; padding: 0; }
.cm-um > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.cm-um-main { display: grid; gap: 2px; min-width: 0; }
.cm-um-subj { font-size: var(--fs-md); font-weight: 500; }
.cm-um-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.cm-um-act form { margin: 0; }
.cm-co-in { width: 180px; }
.cm-person-in { width: 140px; }
.card.flush > .foot-note.cm-applied { color: var(--muted); }
.cm-form input[type=text], .cm-form input[type=date], .cm-form input[type=datetime-local], .cm-form select, .cm-form textarea { width: 100%; }
.cm-form textarea { min-height: 96px; }
/* two fields side by side where the card is wide enough (the new-meeting form sits in a side card: one per row there) */
.cm-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 12px; }
.cm-2 > * { min-width: 0; }

/* meeting page: Claude's read, the transcript, apply to the CRM */
.cm-busy { display: flex; align-items: center; gap: 2px; }
.cm-read .cm-summary { margin: 0 0 8px; max-width: 72ch; font-size: 14.5px; line-height: 1.65; }
.cm-check { margin: 14px 0 4px; padding: 11px 16px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); }
.cm-check h3.cm-sub { margin-top: 0; color: var(--warn); }
.cm-check ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: var(--fs-md); }
.cm-ul { max-width: 72ch; }
table.cm-actions td { font-size: var(--fs-md); }
.cm-fold > summary { display: flex; align-items: baseline; gap: 10px; width: 100%; color: var(--muted); }
.cm-fold > summary::before { align-self: center; }
.cm-fold > summary h2 { display: inline; margin: 0; color: var(--text); }
.cm-transcript {
  max-height: 520px; overflow: auto; margin-top: 12px; padding: 12px 14px; font-size: var(--fs-md); line-height: 1.65;
  white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: var(--radius);
}
.cm-edit { margin-top: 12px; }
.cm-edit textarea { min-height: 240px; font-size: var(--fs-md); line-height: 1.55; }
.cm-stage { display: grid; gap: 6px; }
.cm-applied-note { margin: 0 0 10px; padding: 10px 12px; font-size: var(--fs-md); line-height: 1.55; white-space: pre-wrap; background: var(--surface-2); border-radius: var(--radius); }
.cm-del { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* dashboard card and the prospect card's line */
.cm-dl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-dsub { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
h3.cm-dhead { margin: 14px 0 4px; }
.cm-pline { margin-top: 6px; }
.cm-pline a { font-weight: 500; }

/* ------------------------------------------------------------------ lifecycle and market: escalations, nurture, trends, benchmarks (V2 step 3) */

/* helpers and card internals */
.lc-tight { margin: 0 0 8px; }
.lc-gap { margin-top: 10px; }
.lc-foot { margin: 12px 0 0; }
.lc-notes { white-space: pre-wrap; color: var(--muted); margin-top: 4px; max-width: 46ch; }
.lc-select { max-width: 200px; }
.lc-name-input { width: 128px; }
.lc-inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.lc-more > summary { font-size: var(--fs-sm); }
.lc-more[open] { flex-basis: 100%; }
.lc-line { padding: 6px 0; border-top: 1px solid var(--line); gap: 8px; }
h3 + .lc-line, .lc-line:first-child { border-top: 0; }
.lc-line a { color: var(--text); }
.lc-line a:hover { color: var(--accent-text); }
.lc-h3 { margin: 0; padding: 14px 20px 6px; border-top: 1px solid var(--line); }
.card-head + .lc-h3 { border-top: 0; padding-top: 2px; }
.card:not(.flush) .lc-h3 { padding: 12px 0 4px; }
.card:not(.flush) .lc-h3-tight { border-top: 0; padding: 12px 0 2px; }
.card:not(.flush) .card-head + .lc-h3-tight { padding-top: 0; }
.lc-sub { padding: 14px 20px 16px; border-top: 1px solid var(--line); }
.lc-sub h3 { margin-bottom: 4px; }
.cell-draft { min-width: 224px; }
.cell-draft .lc-inline { flex-wrap: nowrap; }
.lc-note { margin: 12px 0 14px; }

/* escalations: who, why, what to try, and the actions */
.lc-esc { padding: 16px 20px 18px; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.card-head + .lc-esc { border-top-color: var(--line); }
.lc-esc:target { box-shadow: inset 3px 0 0 var(--accent); background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.lc-esc-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.lc-esc-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
a.lc-name { font-size: var(--fs-lg); font-weight: 600; color: var(--text); }
a.lc-name:hover { color: var(--accent-text); }
.lc-reason { margin: 8px 0; font-size: var(--fs-md); max-width: 90ch; }
.lc-resolution { margin: 0; }
.lc-actions { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 4px; max-width: 92ch; color: var(--text-2); }
.lc-actions li::marker { color: var(--faint); font-variant-numeric: tabular-nums; }
.lc-forms { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lc-forms > form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.lc-resolve { display: grid; gap: 6px; margin-top: 8px; min-width: min(420px, 80vw); }

/* the prospect card's strip: follow-up count, escalation, nurture, and small forms in popovers */
.lc-strip { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: -2px 0 14px; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.lc-strip-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.lc-strip-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.lc-strip-acts form { margin: 0; }
.lc-pop { position: relative; }
.lc-pop > summary { font-size: var(--fs-sm); }
.lc-pop[open] > form {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: var(--z-pop); min-width: 320px; padding: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
}

/* stage funnel, days in stage, sequences */
.lc-funnel { display: grid; grid-template-columns: minmax(0, 1fr) 34% 30px 26px; gap: 8px; align-items: center; padding: 5px 0; font-size: var(--fs-md); }
.lc-funnel .bar, .lc-statebar .bar, .lc-medbar .bar { width: 100%; height: 6px; border-radius: 1px; }
.lc-age + .lc-age { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.lc-age > .row:first-child { margin-bottom: 2px; }
.lc-seq + .lc-seq { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.lc-steps { margin: 8px 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.lc-steps li { position: relative; padding-left: 60px; line-height: 1.45; }
.lc-day { position: absolute; left: 0; top: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.lc-edit textarea { font-family: var(--mono); font-size: var(--fs-sm); }

/* market: sparklines (inline SVG in currentColor), trends, deltas, benchmarks */
.lc-spark { display: inline-block; vertical-align: middle; color: var(--accent); overflow: visible; }
.lc-trend { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.lc-trend b { font-weight: 600; min-width: 2.5ch; text-align: right; }
.lc-delta { font-size: var(--fs-xs); color: var(--faint); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.lc-up { color: var(--good); }
.lc-down { color: var(--bad); }
table.lc-trends td { padding-top: 9px; padding-bottom: 9px; vertical-align: middle; }
.lc-medbar { display: grid; grid-template-columns: 72px auto; gap: 8px; align-items: center; }
.lc-minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.lc-mini { display: grid; gap: 4px; padding: 12px 20px 14px; min-width: 0; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.lc-mini-l { font-size: var(--fs-sm); color: var(--muted); }
.lc-mini-v { display: flex; align-items: baseline; gap: 8px; font-size: 20px; line-height: 1.15; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.lc-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.lc-split > div { padding: 0 20px 16px; min-width: 0; }
.lc-split > div + div { border-left: 1px solid var(--line); }
.lc-split .lc-h3 { border-top: 0; padding: 14px 0 6px; }
.lc-statebar { display: grid; grid-template-columns: minmax(0, 1fr) 30% 28px 72px; gap: 8px; align-items: center; padding: 4px 0; }
.lc-statebar > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-award { padding: 8px 0; border-top: 1px solid var(--line); }
.lc-award:first-of-type { border-top: 0; padding-top: 0; }
.lc-peer-table td:first-child { color: var(--text-2); }

/* dashboard card: three counts, then the escalations and follow-ups behind them */
.lc-dash-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 10px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lc-dash-stats a { display: grid; gap: 1px; padding: 8px 10px 9px; color: var(--text); transition: background-color .12s; }
.lc-dash-stats a + a { box-shadow: inset 1px 0 0 var(--line); }
.lc-dash-stats a:hover { background: var(--hover); text-decoration: none; }
.lc-dash-stats b { font-size: 17px; font-weight: 500; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.lc-dash-stats span { font-size: var(--fs-xs); color: var(--muted); }
.lc-dash-market { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); }
.lc-dash-stats + .lc-line { border-top: 0; }

/* ------------------------------------------------------------------ setup: the go-live checklist (readiness) */

/* summary: "n of m" with a quiet meter, then what still blocks */
.su-ready .v { display: flex; align-items: baseline; gap: 6px; }
.su-of { font-size: var(--fs-lg); font-weight: 400; letter-spacing: 0; color: var(--muted); }
.su-meter { height: 4px; margin-top: 2px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.su-meter > i { display: block; height: 100%; background: var(--good); border-radius: inherit; }
.su-todo { margin: -6px 0 var(--s-5); font-size: var(--fs-md); line-height: 1.6; max-width: 110ch; }
.su-todo a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); }
.su-todo a:hover { color: var(--accent-text); text-decoration-color: currentColor; }

/* one item: status mark, what was found, the next step, an optional button */
.su-list { list-style: none; margin: 0; padding: 0; }
.su-item {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 4px 14px; align-items: start;
  padding: 14px 20px 16px; border-top: 1px solid var(--line); scroll-margin-top: 16px;
}
.su-item:target { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.su-mark { display: block; width: 18px; height: 18px; margin-top: 1px; }
.su-mark svg { display: block; width: 18px; height: 18px; }
.su-ok { color: var(--good); }
.su-warn { color: var(--warn); }
.su-missing { color: var(--faint); }
.su-error { color: var(--bad); }
.su-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-height: 20px; }
.su-title { margin: 0; font-size: var(--fs-base); font-weight: 600; letter-spacing: 0; color: var(--text); }
.su-state { font-size: var(--fs-sm); color: var(--muted); }
.su-detail { margin: 3px 0 0; font-size: var(--fs-md); line-height: 1.5; color: var(--text-2); max-width: 96ch; overflow-wrap: anywhere; }
.su-is-ok .su-detail { color: var(--muted); }
.su-next {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 12px; max-width: 96ch; margin-top: 10px;
  padding: 10px 12px; font-size: var(--fs-md); line-height: 1.5;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.su-next-l { padding-top: 2px; font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.su-next-b { display: grid; gap: 6px; min-width: 0; }
.su-cmd { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.su-cmd code {
  min-width: 0; padding: 3px 8px; font-family: var(--mono); font-size: var(--fs-sm); color: var(--text); overflow-wrap: anywhere;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.su-go a { font-weight: 500; }
.su-act { padding-top: 1px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.su-act form { margin: 0; display: contents; }
.su-more { margin-top: 8px; }
.su-more > ul { margin-top: 6px; }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1400px) and (min-width: 1181px) {
  .g-side { grid-template-columns: minmax(0, 1fr) 312px; }
  table.data td.title { min-width: 220px; }
  table.data th, table.data td { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 1180px) {
  .g-side, .g3 { grid-template-columns: minmax(0, 1fr); }
  .main { padding: 24px 28px 64px; }
  .cat-legend { grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
  .ow-layout { grid-template-columns: minmax(0, 1fr); }
  .ow-list { position: static; max-height: 320px; }
  .add-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* contracts */
  .ct-doc-layout { grid-template-columns: minmax(0, 1fr); }
  .ct-paper { padding: 44px 44px 56px; }
  /* comms */
  .cm-um > li { grid-template-columns: minmax(0, 1fr); }
  .cm-um-act { justify-content: flex-start; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; height: auto; max-height: 100dvh; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .side-head { min-height: 36px; }
  .brand { padding: 0; }
  .brand-name { font-size: 19px; }
  .menu-btn { display: inline-flex; }
  .side-panel { display: none; }
  .side.open .side-panel { display: flex; max-height: calc(100dvh - 58px); overflow: hidden; padding: 4px 0 14px; }
  .side .foot { margin-top: var(--s-2); }
  .main { padding: 20px 16px 56px; }
  .top { flex-direction: column; align-items: stretch; gap: var(--s-3); margin-bottom: var(--s-5); }
  .top > :first-child { flex-basis: auto; }
  .top .row { justify-content: flex-start; }
  .top form { width: 100%; }
  .top form input[type=search] { flex: 1; width: auto; }
  h1 { font-size: var(--fs-2xl); }
  .h1-long { font-size: 20px; line-height: 1.25; }
  .g2, .g3, .g-side { grid-template-columns: minmax(0, 1fr); }
  .filters { padding: 12px 16px; }
  .filters > input, .filters > select { flex: 1 1 150px; }
  .filters input[type=search] { flex-basis: 100%; width: 100%; }
  .pager { padding: 10px 16px; }
  table.data th:first-child, table.data td:first-child { padding-left: 16px; }
  table.data th:last-child, table.data td:last-child { padding-right: 16px; }
  table.data td.title { min-width: 240px; }
  .card { padding: 16px; }
  .card.flush > h2, .card.flush > .card-head { padding: 14px 16px 0; }
  .card.flush > .card-note { padding: 0 16px; }
  .card.flush > .tabbar { padding: 0 16px; }
  .kpi { padding: 12px 14px 14px; }
  .kpi > a { margin: -12px -14px -14px; padding: 12px 14px 14px; }
  .kpi .v { font-size: 22px; }
  dl.kv { grid-template-columns: minmax(0, 1fr); }
  dl.kv dt { padding: 8px 0 0; }
  dl.kv dd { border-top: 0; padding: 2px 0 8px; }
  dl.kv dt:first-of-type + dd { padding-top: 2px; }
  .scroll.tall { max-height: none; }
  #graph { height: 480px; }
  .msg.in { margin-right: 16px; }
  .msg.out { margin-left: 16px; }
  .add-form { grid-template-columns: minmax(0, 1fr); }
  .add-form .wide { grid-column: auto; }
  .ow-sheet { padding: 18px 16px; }
  .ow-field { grid-template-columns: 58px minmax(0, 1fr); }
  .ow-name { font-size: 20px; }
  .work-card .work-when { text-align: left; }
  .card-body { padding: 0 16px 14px; }
  .card.flush > .foot-note { padding: 10px 16px 12px; }
  .facts { gap: 8px 20px; }
  .tabbar { gap: 0 18px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar a { margin-bottom: 0; }
  .hbar { grid-template-columns: minmax(0, 1fr) 72px 40px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid .filter-actions { grid-column: 1 / -1; }
  .upload-form { grid-template-columns: minmax(0, 1fr); }
  .upload-form .span-2 { grid-column: auto; }
  .network-tools, .finder { width: 100%; }
  .finder { flex: 1 1 100%; }
  .finder input[type=search] { width: 100%; }
  .card.report { padding: 24px 18px 32px; }
  .report h1 { font-size: 28px; }
  .report .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report table { display: block; overflow-x: auto; }
  .report table td:first-child { min-width: 210px; }
  .cell-check { width: auto; min-width: 240px; }
  .cols { grid-auto-columns: minmax(78vw, 1fr); }
  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1 1 auto; }
  .top .row > form, .top .row > .btn { flex: 0 0 auto; }
  /* lifecycle */
  .lc-split { grid-template-columns: minmax(0, 1fr); }
  .lc-split > div { padding: 0 16px 14px; }
  .lc-split > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .lc-mini { padding: 10px 16px 12px; }
  .lc-pop[open] > form { position: static; box-shadow: none; min-width: 0; margin-top: 6px; }
  .lc-esc, .lc-sub { padding-left: 16px; padding-right: 16px; }
  .lc-h3 { padding-left: 16px; padding-right: 16px; }
  .cell-draft { min-width: 0; }
  .cell-draft .lc-inline { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  /* contracts */
  .ct-paper { padding: 26px 18px 34px; }
  .ct-doc { font-size: 15.5px; line-height: 1.62; }
  .ct-doc h1 { font-size: 22px; margin: 18px 0 20px; }
  .ct-doc p.cl { padding-left: 2.3em; text-indent: -2.3em; }
  .ct-doc .cl-n { width: 2.3em; }
  .ct-c-ref, .ct-c-when { width: auto; }
  /* the high-risk box reads as a list on a phone: the obligation, then category, party and clause on one line */
  table.ct-high-table, table.ct-high-table tbody, table.ct-high-table tr, table.ct-high-table td.ct-ob { display: block; width: auto; }
  table.ct-high-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.ct-high-table tr:last-child { border-bottom: 0; }
  table.ct-high-table td { padding: 0; border: 0; }
  table.ct-high-table td.ct-ob { min-width: 0; margin-bottom: 4px; }
  table.ct-high-table td.ct-c-who, table.ct-high-table td.ct-ref { display: inline; width: auto; }
  table.ct-high-table td.ct-c-who .muted { display: inline; }
  table.ct-high-table td.ct-c-who .muted::before, table.ct-high-table td.ct-ref::before { content: " · "; color: var(--faint); }
  /* comms */
  .cm-um > li { padding: 12px 16px; }
  .cm-item > details > summary { grid-template-columns: 46px minmax(0, 1fr); gap: 2px 10px; }
  .cm-item > details > summary > .cm-ch { grid-column: 2; grid-row: 1; display: flex; gap: 6px; }
  .cm-item > details > summary > .cm-line { grid-column: 2; }
  .cm-item > details > summary > .badge { grid-column: 2; justify-self: start; margin-top: 2px; }
  .cm-detail { padding-left: 0; }
  .cm-2 { grid-template-columns: minmax(0, 1fr); }
  /* setup */
  .su-item { grid-template-columns: 18px minmax(0, 1fr); padding: 12px 16px 14px; }
  .su-act { grid-column: 2; padding-top: 4px; }
  .su-next { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .ct-aside, .ct-top .row, .notice { display: none !important; }
  .ct-doc-layout { display: block; }
  .ct-paper { border: 0; padding: 0; box-shadow: none; }
  .side, .menu-btn, .toast, .btn { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ------------------------------------------------------------------ people and access: sign-in, /me, /admin/users, /admin/audit */
.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--s-8) var(--s-4); }
.auth-wrap { width: 100%; max-width: 400px; }
.auth-brand { display: grid; gap: 4px; justify-items: center; margin-bottom: var(--s-6); text-align: center; }
.auth-brand .brand-name { font-size: 26px; }
.auth-card { padding: 26px 28px 22px; }
.auth-card h1 { font-size: var(--fs-xl); margin: 0 0 var(--s-4); }
.auth-card .notice { margin-bottom: var(--s-4); }
.auth-form { display: grid; gap: var(--s-4); }
.auth-form input { width: 100%; height: 36px; }
.auth-form .btn { width: 100%; height: 36px; }
.auth-foot { margin: var(--s-4) 0 0; padding-top: var(--s-3); border-top: 1px solid var(--line); }
.auth-cmd { margin: var(--s-3) 0 var(--s-4); }
/* Sign in with Google (/login and /oauth/login) */
.google-btn { display: flex; width: 100%; height: 38px; justify-content: center; align-items: center; gap: 10px; }
.google-btn svg { flex: 0 0 auto; }
.auth-or { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-4) 0; color: var(--faint); font-size: var(--fs-sm); }
.auth-or::before, .auth-or::after { content: ""; flex: 1 1 0; border-top: 1px solid var(--line); }

.side .foot .foot-user { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; align-items: center;
  padding-bottom: 8px; margin-bottom: 2px; border-bottom: 1px solid var(--line); }
.side .foot .foot-name { color: var(--text); font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-user .foot-role { grid-column: 1; font-size: var(--fs-xs); color: var(--muted); }
.foot-user .foot-out { grid-column: 2; grid-row: 1 / span 2; }
.foot-user .btn-text { font-size: var(--fs-sm); }
button.denied { cursor: not-allowed; }
.access-refused p { max-width: 72ch; }

.copybox { position: relative; }
.copybox .pre { margin: 0; padding-right: 76px; max-height: none; }
.copybox .copy-btn { position: absolute; top: 7px; right: 7px; }
.token-once { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.token-once h3 { margin: var(--s-5) 0 var(--s-2); }
.snippets { display: grid; gap: var(--s-3); margin-top: var(--s-3); }
.snip-label { margin-bottom: 4px; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.snip-label.snip-then { margin-top: var(--s-2); }
.perm-list { margin: 0; display: grid; gap: 3px; }
.perm-list dt { margin-top: var(--s-3); font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.perm-list dt:first-child { margin-top: 0; }
.perm-list dd { position: relative; margin: 0; padding-left: 14px; font-size: var(--fs-md); line-height: 1.45; color: var(--text-2); }
.perm-list dd::before { content: ""; position: absolute; left: 2px; top: .62em; width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); }
.perm-missing { margin-top: var(--s-4); }
.perm-missing > .perm-list { margin-top: var(--s-3); }
.me-pw { max-width: 380px; }
.me-pw input { width: 100%; }
.token-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s-3); align-items: end;
  padding: 16px 20px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.token-form input, .token-form select { width: 100%; }
.token-form > details, .token-form > div { grid-column: 1 / -1; }
.token-scopes .checks { margin-top: var(--s-2); }

.ua-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--s-3); align-items: center; padding: 10px 20px; }
.ua-head { padding-top: 0; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); }
.ua-item { border-bottom: 1px solid var(--line); }
.ua-item:last-child { border-bottom: 0; }
.ua-item > summary.ua-row { display: grid; font-size: var(--fs-md); color: var(--text); }
.ua-item > summary.ua-row::before { display: none; }
.ua-item > summary:hover { background: var(--hover); }
.ua-item[open] > summary { background: var(--surface-2); }
.ua-who { display: grid; gap: 1px; min-width: 0; }
.ua-who .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ua-off .ua-who b { color: var(--muted); }
.ua-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s-4) var(--s-8);
  padding: 14px 20px 18px; background: var(--surface-2); border-top: 1px solid var(--line); }
.ua-edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); align-content: start; }
.ua-edit input, .ua-edit select { width: 100%; }
.ua-edit .span-all { grid-column: 1 / -1; }
.ua-extra .checks { margin-top: var(--s-2); }
.ua-side { display: grid; gap: var(--s-3); align-content: start; }
.ua-side input[type=password] { flex: 1 1 170px; }
.ua-tokens { grid-column: 1 / -1; }
/* access requests from Sign in with Google (/admin/users) */
.ar-list { display: grid; margin-top: var(--s-3); }
.ar-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.6fr) auto; gap: var(--s-3); align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line); }
.ar-rejected { margin-top: var(--s-4); }
@media (max-width: 720px) { .ar-row { grid-template-columns: minmax(0, 1fr); } }
.ua-tokens .scroll { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px; }
.ua-add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); align-items: end; }
.ua-add input, .ua-add select { width: 100%; }
.ua-add-go { display: flex; justify-content: flex-end; }
.role-list { margin: 0; display: grid; gap: 2px; }
.role-list dt { margin-top: var(--s-3); font-weight: 600; font-size: var(--fs-md); }
.role-list dt:first-child { margin-top: 0; }
.role-list dd { margin: 0; font-size: var(--fs-md); line-height: 1.45; color: var(--text-2); }

.audit-filters { align-items: end; }
.audit-table td { vertical-align: top; }
.audit-failed td { background: color-mix(in srgb, var(--bad-soft) 60%, transparent); }
.audit-detail { display: block; margin-top: 3px; }
.audit-detail .pre { margin-top: 6px; max-width: 70ch; }

@media (max-width: 900px) {
  .ua-head { display: none; }
  .ua-row { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 16px; }
  .ua-row > span:nth-child(n+3) { grid-column: 1 / -1; }
  .ua-body, .ua-edit, .ua-add, .token-form { grid-template-columns: minmax(0, 1fr); }
  .ua-body { padding: 12px 16px 16px; }
}
