/*
 * Design tokens and components. Every color, radius and font in the app traces
 * back to a token here.
 *
 * The look is letlois.com: a near-black ground with a blue cast, flat surfaces
 * separated by hairlines rather than shadows, one saturated brand blue spent on
 * the primary action, a heavy condensed face for anything that behaves like
 * signage, and monospace uppercase for labels and controls.
 *
 * Ornament is not the tool's job. There are no drop shadows, no angled cuts and
 * no gradients behind live state: a panel is a surface with an edge, and the
 * only colour in a table is the colour that means something. Nothing below
 * hard-codes a state colour — distributions set --accent or use a b-* / rail
 * class, both derived from state in src/shared/domain.ts.
 */

:root {
  /* Tells the browser to draw its own furniture dark: the date picker, select
     dropdowns, scrollbars and checkboxes. Without it a native calendar popup
     opens as a white card in the middle of a dark app. */
  color-scheme: dark;

  /* Near-black with a blue cast, the way the site's ground reads. Surfaces step
     up rather than down: the page is darkest, panels sit above it. */
  --bg: #0A0D13;
  --nav: #05070B;
  --paper: #141922;
  --s1: rgba(255, 255, 255, .025);
  --s2: #1B212C;
  --s3: #232B38;

  /* Edges are hairlines. On a dark ground a 2px outline reads as a bar, not a
     border, and the surface step is already doing most of the separating. */
  --line: #29323F;
  --line-2: #3A4553;
  --hair: rgba(255, 255, 255, .07);

  --tx: #E7EDF6;
  /* Measured on the two grounds these actually sit on — the page and a panel.
     A dark ground is far more forgiving than the cream it replaced, but grey on
     grey still fails quietly, so both clear 4.5:1 rather than merely looking
     the part. */
  --tx-2: #A3B0C2;
  --tx-3: #8794A6;

  /* The brand blue, in the two jobs it actually has. One value cannot do both:
     bright enough to read as text on a dark ground puts white at 3.1:1 when a
     button is filled with it, and dark enough for white drops it to 4.2:1 as
     text. So the blue you *read* and the blue you *press* are separate.
       --brand      text, icons, focus, borders, "you are here"  (6.8:1 on page)
       --brand-fill filled surfaces carrying white               (4.8:1 white)
     Same hue and saturation, two values. */
  --brand: #4A9BF9;
  --brand-fill: #2E73C2;
  --brand-ink: #FFFFFF;
  --brand-dim: rgba(74, 155, 249, .15);
  /* Ink for text sitting on a saturated chip. The state colours are bright on
     a dark ground, so near-black clears contrast on them where white does not. */
  --on-accent: #080B10;
  /* Tinted grounds for a flash or a rejected upload: the state colour at low
     opacity, so the surface still reads as a surface and the text stays the
     bright hue rather than a muddy blend of the two. */
  --wash-ok: rgba(61, 214, 140, .13);
  --wash-bad: rgba(255, 111, 94, .13);

  /* State colours. The meanings are fixed by CLAUDE.md; the hues are retuned
     for a dark ground, where the old ink-on-cream values sit at roughly 2:1 and
     are unreadable. Turquoise stays distinct from the brand blue on purpose —
     processing and "the button you press" must never look like each other. */
  --green: #3DD68C;
  --cyan: #26CBD8;
  --blue: #3B93F7;
  --amber: #F5B23D;
  --red: #FF6F5E;
  --violet: #B98CF5;

  --r: 6px;
  --r-sm: 4px;
  /* Kept as tokens because the components reference them. Flat now: the site
     separates with surface and edge, and a hard offset shadow was the loudest
     thing in the old theme. */
  --pop: none;
  --pop-sm: none;
}

* { box-sizing: border-box; margin: 0; padding: 0 }
html { -webkit-text-size-adjust: 100% }
/* Component classes below set `display`, which outranks the browser's own
   [hidden] rule. Progressive enhancement relies on hidden staying hidden. */
[hidden] { display: none !important }

body {
  background: var(--bg);
  color: var(--tx);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono { font-family: 'Space Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums }

/* Display face, for anything that behaves like signage. Heavy and condensed,
   set uppercase and tight the way the site sets a headline. Deliberately not
   the numbers: Anton is proportional, so a metric ticking 9 to 10 would shift
   width on every poll. Figures stay mono and tabular. */
h1, h2, h3, .brand-tx b {
  font-family: 'Anton', 'Inter', sans-serif; font-weight: 400;
  letter-spacing: .01em; text-transform: uppercase;
}
h1 { font-size: 21px; line-height: 1.12 }
h2 { font-size: 14px; letter-spacing: .03em }
h3 { font-size: 12.5px; letter-spacing: .03em }

/* Controls and labels are monospace uppercase, which is how the site sets its
   nav, its buttons and its category tiles. It is the loudest thing here now,
   and it costs nothing to read. */
.btn, .badge, .cal-dow, .tbl th, .eyebrow {
  font-family: 'Space Mono', ui-monospace, monospace;
}
.metric .m-n, .job-pct b { font-family: 'Space Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-weight: 700 }
svg.i { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer }
a { color: inherit }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-sm) }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* ---------- top bar ---------- */
.top {
  height: 52px; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: var(--nav); color: var(--tx);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding-right: 16px; margin-right: 4px; border-right: 1px solid var(--line); height: 100%; text-decoration: none; flex: none }
.mark {
  width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--brand-fill); color: var(--brand-ink);
}
/* Height-constrained, width free: a logo is whatever shape it is, and a client's
   own may be nothing like ours. Bounded both ways so a very wide or very tall
   file cannot push the rest of the bar off screen. */
.brand-logo {
  height: 26px; width: auto; max-width: 190px; object-fit: contain; display: block;
  color: var(--tx-2); font-size: 12px;
}
/* Stroked like every other icon rather than filled, which is how the sprite
   draws it. */
.mark svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round }
.brand-tx b { display: block; font-size: 14px; letter-spacing: .01em; color: var(--tx) }
.brand-tx span { display: block; font-size: 9.5px; color: var(--tx-2); letter-spacing: .16em; text-transform: uppercase }
/* The whole app is dark now, so the bar needs no inversion of its own. The
   wordmark's second line takes the brand blue, the way the site sets it. */
.top .brand-tx span { color: var(--brand) }

/* Search hits. Not the browser's yellow, which is unreadable on this ground. */
mark { background: rgba(245, 178, 61, .26); color: var(--amber); border-radius: 2px; padding: 0 2px }

.search {
  display: flex; align-items: center; gap: 8px; position: relative;
  flex: 0 1 440px; min-width: 0; height: 32px; padding: 0 10px;
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .22); border-radius: 20px;
  color: rgba(255, 255, 255, .55);
}
/* The focus ring is the blue you read, not amber: amber means pending. */
.search:focus-within { border-color: var(--brand) }
.search input { flex: 1; background: none; border: none; outline: none; color: var(--tx); font: inherit; min-width: 0 }
.search input::placeholder { color: rgba(255, 255, 255, .45) }
.search kbd {
  font-family: 'Space Mono', monospace; font-size: 10px; color: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 3px; padding: 1px 4px;
}
.ico-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--tx-2); position: relative; flex: none;
}
.ico-btn { color: rgba(255, 255, 255, .72) }
.ico-btn:hover { background: rgba(255, 255, 255, .09); color: var(--tx) }
.dot-badge {
  position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 0 2px var(--nav);
}
/* The search box ends where it ends; the account chip always sits at the far
   right, so it never moves with the length of a page's title or the box. */
.search-link, .nav-toggle { display: none }
.me {
  margin-left: auto; flex: none;
  display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, .22); text-decoration: none; border-radius: 20px;
}
.me:hover { background: rgba(255, 255, 255, .10) }
.av {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em; flex: none;
}
.av-c { background: var(--cyan); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--line) }
.av-v { background: var(--violet); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--line) }
.av-g { background: var(--green); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--line) }
.av-a { background: var(--amber); color: var(--nav); box-shadow: inset 0 0 0 1px var(--line) }
.me-tx b { display: block; font-size: 12px; font-weight: 500; line-height: 1.25; color: var(--tx); white-space: nowrap }
/* Neutral, not amber: a role is not a state, and amber means pending. */
.me-tx span { display: block; font-size: 9.5px; color: var(--tx-3); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap }

/* ---------- shell ----------
 * Two zones: the rail and the workspace. The rail is the only global
 * navigation; there is no second row of tabs and no console down the right.
 * The rail is sticky and scrolls on its own, so every link stays in reach
 * however far down a long page you are — and a short page is never made to
 * scroll by a rail taller than it.
 * ---------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 52px) }
.shell.nav-collapsed { grid-template-columns: 60px minmax(0, 1fr) }
.shell { transition: grid-template-columns .2s cubic-bezier(.4, 0, .2, 1) }

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: 52px; align-self: start; height: calc(100vh - 52px);
  background: var(--s2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-width: 0;
}
.side-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 10px 8px 12px; display: flex; flex-direction: column; gap: 1px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
/* The column scrolls; its rows never shrink to fit it. Without this a
   one-link module (Overview, Companies) is squeezed to its text height
   whenever the open groups outgrow the rail. */
.side-scroll > * { flex-shrink: 0 }
/* A module heading (a group that opens) and a module that is one link share a
   row: icon, label, then a count or a chevron at the far end. */
.nav-top, .nav-grp-h {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: var(--r); color: var(--tx-2); text-decoration: none;
  font-size: 12.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background .13s, color .13s; user-select: none;
}
.nav-grp-h { list-style: none }
.nav-grp-h::-webkit-details-marker { display: none }
.nav-top:hover, .nav-grp-h:hover { background: var(--s3); color: var(--tx) }
.nav-tx { min-width: 0; overflow: hidden; text-overflow: ellipsis }
.nav-chev { margin-left: auto; width: 14px; height: 14px; color: var(--tx-3); transform: rotate(-90deg); transition: transform .15s }
.nav-grp[open] > .nav-grp-h .nav-chev { transform: none }
/* A group's own count only while it is closed: open, the count is on its row. */
.nav-grp[open] > .nav-grp-h .grp-ct { display: none }
.nav-grp-h .ct + .nav-chev { margin-left: 6px }
/* The module you are in keeps saying so when its group is closed. */
.nav-grp.has-current > .nav-grp-h { color: var(--tx) }
.nav-grp.has-current > .nav-grp-h svg.i:first-child { color: var(--brand) }

.nav-sub {
  display: flex; flex-direction: column; gap: 1px;
  margin: 1px 0 6px 18px; padding-left: 9px; border-left: 1px solid var(--line);
}
.nav-i {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px;
  border-radius: var(--r); color: var(--tx-2); text-decoration: none;
  font-size: 12.5px; white-space: nowrap; position: relative;
  transition: background .13s, color .13s;
}
.nav-i:hover { background: var(--s3); color: var(--tx) }
/* A label inside a group, for a run of links that belong together (Settings). */
.nav-sub-lbl {
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--tx-3); font-weight: 600;
  padding: 8px 10px 3px;
}
/* "You are here": a tint and a bar, not a filled blue. The one filled blue on
   a screen is its primary action, and a rail lit solid competed with it. The
   text stays --tx: --brand on the tint measures under 4.5:1. */
.nav-top[aria-current], .nav-i[aria-current] { background: var(--brand-dim); color: var(--tx); font-weight: 600 }
.nav-top[aria-current] svg.i { color: var(--brand) }
.nav-i[aria-current]::before {
  content: ''; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--brand);
}
.ct {
  margin-left: auto; font-family: 'Space Mono', monospace; font-size: 10px; line-height: 16px;
  padding: 0 6px; border-radius: 20px; background: var(--s3); color: var(--tx-2);
  border: 1px solid var(--line); flex: none; font-weight: 400;
}
.ct.warn { background: var(--amber); color: var(--on-accent); border-color: transparent }
.ct.bad { background: var(--red); color: var(--on-accent); border-color: transparent }

.side-foot {
  flex: none; display: flex; align-items: center; gap: 9px; padding: 8px 8px 8px 14px; min-height: 44px;
  border-top: 1px solid var(--line); color: var(--tx-2); font-size: 11px; white-space: nowrap;
}
.side-foot-tx { min-width: 0; overflow: hidden; text-overflow: ellipsis }
.rail-toggle { margin-left: auto; color: var(--tx-3) }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); border: 1px solid var(--line); flex: none; animation: bl 2.4s infinite }
/* Queue held: same dot, amber, and no blink — nothing is moving. */
.side-foot.held .pulse { background: var(--amber); animation: none }
.side-foot.held { color: var(--amber) }
@keyframes bl { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }

/* Collapsed to icons (desktop only, remembered). One glyph per module, so the
   column still says where each goes; a click on a module opens the rail. */
@media (min-width: 1024px) {
  .nav-collapsed .nav-tx,
  .nav-collapsed .ct,
  .nav-collapsed .nav-chev,
  .nav-collapsed .nav-sub,
  .nav-collapsed .side-foot-tx { display: none }
  .nav-collapsed .side-scroll { padding: 10px 8px }
  .nav-collapsed .nav-top, .nav-collapsed .nav-grp-h { justify-content: center; padding: 0 }
  .nav-collapsed .nav-grp.has-current > .nav-grp-h { background: var(--brand-dim) }
  .nav-collapsed .side-foot { flex-direction: column; padding: 8px 0; gap: 6px }
  .nav-collapsed .rail-toggle { margin-left: 0; transform: scaleX(-1) }
}

/* ---------- workspace ---------- */
.work { padding: 18px 20px 40px; min-width: 0 }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap }
.head p { font-size: 12px; color: var(--tx-2); margin-top: 3px }
/* Wraps rather than pushing past the edge: a record page can carry five actions. */
.head-act { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 100% }

.btn {
  height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px;
  border-radius: var(--r); font-size: 10.5px; font-weight: 700; white-space: nowrap;
  letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--line-2); background: transparent; color: var(--tx);
  text-decoration: none;
  transition: background .13s, border-color .13s, color .13s;
}
.btn:hover { background: var(--s2); border-color: var(--tx-3) }
.btn:disabled { opacity: .4; cursor: not-allowed }
.btn svg { width: 14px; height: 14px }
/* One primary per screen, and it is the only filled blue on it. */
.btn-p { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--brand-ink) }
.btn-p:hover { background: #3781D6; border-color: #3781D6 }
.btn-xs { height: 25px; padding: 0 10px; font-size: 9.5px }
.btn-ok { background: var(--green); border-color: var(--green); color: var(--on-accent) }
.btn-ok:hover { background: #34C57E; border-color: #34C57E }
.btn-bad { background: var(--red); border-color: var(--red); color: var(--on-accent) }
.btn-bad:hover { background: #F0604F; border-color: #F0604F }
/* An action, so it takes the brand blue rather than the turquoise its variant
   name suggests. Turquoise means "processing" here, and this button sits
   directly above a column of processing badges — a control that wears a state
   colour reads as a state. The variant name is the component's API and is left
   alone; only what it paints has changed. */
/* Outlined, not filled: it sits once per row (Push on every pending company),
   and a column of solid blue buttons broke "one filled blue per screen" —
   none of them read as the thing to press. The blue you read, on an edge. */
.btn-cy { background: transparent; border-color: var(--brand); color: var(--brand) }
.btn-cy:hover { background: var(--brand-dim); border-color: var(--brand) }
.inline-form { display: inline-flex }

/* metric strip */
.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px }
.metric {
  background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px 13px;
  position: relative; overflow: hidden;
  transition: border-color .15s;
}
.metric:hover { border-color: var(--line-2) }
.metric .m-top { display: flex; align-items: center; gap: 7px; color: var(--accent, var(--cyan)) }
.metric .m-top svg { width: 14px; height: 14px }
.metric .m-lbl { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--tx-3); font-weight: 600 }
.metric .m-n { font-size: 25px; letter-spacing: .01em; margin: 8px 0 3px; line-height: 1 }
.metric .m-d { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--tx-3) }
.metric .m-d b { font-weight: 500; font-family: 'Space Mono', monospace }
.up b { color: var(--green) }
.dn b { color: var(--red) }

/* panels */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 12px }
.panel:last-child { margin-bottom: 0 }
.p-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px;
  border-bottom: 1px solid var(--line); background: var(--s2);
  position: relative;
}
.p-head h2 { font-size: 13px; letter-spacing: .02em }
.p-head .sub { font-size: 10.5px; color: var(--tx-3) }
.p-head .r { margin-left: auto; display: flex; align-items: center; gap: 7px; position: relative; z-index: 1; margin-right: 34px }
.live {
  display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--on-accent);
  background: var(--green); border: 1px solid var(--line);
  border-radius: 20px; padding: 2px 9px 2px 7px;
}
.live.paused { color: var(--on-accent); background: var(--amber) }
.live.paused .pulse { background: var(--nav); animation: none }
.p-body { padding: 12px 13px }

/* publishing queue job */
.job { border: 1px solid var(--line); border-radius: var(--r); background: var(--s1); padding: 12px; margin-bottom: 10px }
.job:last-child { margin-bottom: 0 }
.job-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 11px }
.job-top h3 { font-size: 13.5px; font-weight: 500; letter-spacing: -.01em; line-height: 1.35 }
.job-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 10.5px; color: var(--tx-3); flex-wrap: wrap }
.job-meta i { width: 1px; height: 9px; background: var(--hair) }
.job-pct { text-align: right; flex: none; margin-left: auto }
.job-pct b { font-size: 19px; letter-spacing: .01em }
.job-pct span { display: block; font-size: 10px; color: var(--tx-3) }
.job-act { display: flex; gap: 6px; margin-top: 10px }

/* signature: segmented rail, one cell per company */
.rail { display: flex; gap: 3px; margin-bottom: 11px }
.rail i { height: 7px; flex: 1; border: 1px solid var(--line); background: var(--s3) }
.rail i.ok { background: var(--green) }
.rail i.run { background: var(--cyan); animation: bl 1.5s infinite }
.rail i.wait { background: var(--amber) }
.rail i.bad { background: var(--red) }

.dist { width: 100%; border-collapse: collapse }
.dist th {
  text-align: left; font-size: 9.5px; letter-spacing: .10em; text-transform: uppercase;
  color: var(--tx-3); font-weight: 600; padding: 0 8px 7px; border-bottom: 1px solid var(--line);
}
.dist th:last-child, .dist td:last-child { text-align: right }
.dist td { padding: 7px 8px; border-bottom: 1px solid var(--hair); font-size: 12px }
.dist tr:last-child td { border-bottom: none }
.dist tbody tr:hover { background: var(--s2) }
.co { display: flex; align-items: center; gap: 9px }
.co-l {
  width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none;
  font-size: 9.5px; font-weight: 600; background: var(--s3); color: var(--tx);
  border: 1px solid var(--line);
}
.co b { font-weight: 400 }
.co span { display: block; font-size: 10px; color: var(--tx-3) }
.co-err { color: var(--red); font-size: 10px }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none }
.b-ok { background: var(--green); color: var(--on-accent); border: 1px solid var(--line) }
.b-run { background: var(--cyan); color: var(--on-accent); border: 1px solid var(--line) }
.b-wait { background: var(--amber); color: var(--nav); border: 1px solid var(--line) }
.b-bad { background: var(--red); color: var(--on-accent); border: 1px solid var(--line) }
.b-draft { background: var(--s3); color: var(--tx-2); border: 1px solid var(--line) }
.b-run::before { animation: bl 1.4s infinite }

/* company cards */
.co-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
.co-grid.wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) }
.co-card {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); padding: 11px;
  transition: border-color .13s, background .13s;
}
.co-card:hover { border-color: var(--line-2); background: var(--s2) }
/* Cards sit on a grid row, so a name that wraps would stagger its neighbours. */
.co-card { display: flex; flex-direction: column }
.co-card .ch { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; min-width: 0 }
.co-card .ch > span:last-child { min-width: 0 }
.co-card .ch b,
.co-card .ch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block }
.co-card .ch b { font-size: 12.5px; font-weight: 500; color: var(--tx) }
.co-card .ch > span:last-child > span { font-size: 10px; color: var(--tx-3) }
.co-card .ch .co-l { color: var(--tx) }
.co-card .co-stats { margin-top: auto }
.co-stats { display: flex; gap: 14px; padding-top: 9px; border-top: 1px solid var(--hair) }
.co-stats div { font-size: 10px; color: var(--tx-3); letter-spacing: .05em; text-transform: uppercase }
.co-stats b { display: block; font-family: 'Space Mono', monospace; font-size: 15px; font-weight: 700; color: var(--tx); margin-bottom: 1px }
.co-stats b.g { color: var(--green) }
.co-stats b.a { color: var(--amber) }

/* tables */
.tbl { width: 100%; border-collapse: collapse }
.tbl th {
  text-align: left; font-size: 9.5px; letter-spacing: .10em; text-transform: uppercase; color: var(--tx-3);
  font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--s2);
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--hair); font-size: 12px; vertical-align: middle }
.tbl tbody tr:last-child td { border-bottom: none }
.tbl tbody tr:hover { background: var(--s2) }
.tbl .t-title { font-weight: 500; letter-spacing: -.005em }
.tbl .t-sub { font-size: 10.5px; color: var(--tx-3); margin-top: 2px }
.stack { display: flex }
.stack .av { width: 20px; height: 20px; font-size: 8.5px; margin-left: -5px; box-shadow: 0 0 0 2px var(--paper) }
.stack .av:first-child { margin-left: 0 }
.stack .more {
  width: 20px; height: 20px; border-radius: 50%; background: var(--s3); color: var(--tx-2);
  display: grid; place-items: center; font-size: 8.5px; font-weight: 500; margin-left: -5px;
  box-shadow: 0 0 0 2px var(--paper);
}
.row-act { display: flex; gap: 5px; justify-content: flex-end }

/* empty state */
.empty { padding: 28px 12px; text-align: center; color: var(--tx-3) }
.empty svg { width: 22px; height: 22px; margin-bottom: 8px; color: var(--tx-3) }
.empty p { font-size: 12px }
.empty p + p { margin-top: 4px; font-size: 11px }

/* flash */
.flash {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; margin-bottom: 12px;
  border-radius: var(--r); font-size: 12px; border: 1px solid var(--line); background: var(--paper);
}
.flash svg { width: 14px; height: 14px; flex: none }
.flash-ok { background: var(--wash-ok); border-color: var(--green); color: var(--green) }
.flash-bad { background: var(--wash-bad); border-color: var(--red); color: var(--red) }

/* forms */
.form { display: flex; flex-direction: column; gap: 13px }
.field { display: flex; flex-direction: column; gap: 6px }
.field > label {
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--tx-2); font-weight: 600;
}
.hint { font-size: 10.5px; color: var(--tx-3) }
/* Fields take the small radius (CLAUDE.md: 6px panels and controls, 4px fields)
   and the button's height, so a field and the button beside it line up. */
.input, .textarea, .select {
  width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--tx); font: inherit; padding: 6px 10px; min-height: 32px; outline: none;
  transition: border-color .13s;
}
.textarea { min-height: 220px; resize: vertical; line-height: 1.6 }
.input:focus, .textarea:focus, .select:focus { border-color: var(--brand) }
.input::placeholder, .textarea::placeholder { color: var(--tx-3) }
.form-act { display: flex; align-items: center; gap: 8px; padding-top: 2px }
.form-act .spacer { margin-left: auto }

.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto }
.pick {
  display: flex; align-items: center; gap: 9px; padding: 9px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--paper); cursor: pointer;
  transition: background .13s, box-shadow .13s;
}
.pick:hover { background: var(--s2) }
.pick input { accent-color: var(--brand); width: 14px; height: 14px; flex: none; cursor: pointer }
.pick b { display: block; font-size: 12px; font-weight: 500 }
.pick span { display: block; font-size: 10px; color: var(--tx-3) }
.pick:has(input:checked) { background: var(--brand-dim); border-color: var(--brand) }

/* The account profile, beside the company it belongs to in the studio picker. */
.pick-wrap { display: flex; flex-direction: column; gap: 4px }
.profile { font-size: 10px; color: var(--tx-3); padding: 0 9px }
.profile summary {
  cursor: pointer; color: var(--tx-2); letter-spacing: .06em; text-transform: uppercase;
  font-size: 9px; padding: 2px 0;
}
.profile summary:hover { color: var(--brand) }
.profile { border-left: 2px solid var(--hair); margin-left: 9px }
.profile p { margin: 5px 0 0; line-height: 1.55; color: var(--tx-2) }
.profile p b { color: var(--tx-3); font-weight: 500 }

/* image uploads */
.drop {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 14px; border-radius: var(--r); background: var(--s1);
  border: 2px dashed var(--line); color: var(--tx-2);
  transition: background .13s;
}
/* The input covers the zone, so the whole zone is the click target and the
   control still works with the client script blocked. */
.drop-in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer }
.drop svg { width: 18px; height: 18px; color: var(--tx-3); flex: none }
.drop-tx b { display: block; font-size: 12px; font-weight: 500; color: var(--tx) }
.drop-tx span { display: block; font-size: 10.5px; color: var(--tx-3) }
.drop:hover, .drop.over { background: var(--brand-dim); border-color: var(--brand) }
.drop:focus-within { border-color: var(--brand) }
.drop.over svg, .drop:hover svg { color: var(--brand) }

/* The chosen-file list the client script fills in before submit. */
.up-list { list-style: none; display: flex; flex-direction: column; gap: 4px }
.up-list li {
  display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--tx-2);
  padding: 5px 8px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line);
}
.up-list li span:last-child { margin-left: auto; color: var(--tx-3) }
.up-list li.bad { background: var(--wash-bad); border-color: var(--red); color: var(--red) }
.up-list li.bad span:last-child { color: var(--red) }

.img-list { list-style: none; display: flex; flex-direction: column; gap: 10px }
.img-item {
  display: flex; align-items: flex-start; gap: 11px; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--paper);
}
.img-thumb {
  width: 78px; height: 60px; border-radius: var(--r); overflow: hidden; flex: none;
  background: var(--s3); border: 1px solid var(--line); display: block;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block }
.img-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px }
.img-name { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.img-sub { font-size: 10.5px; color: var(--tx-3) }
.img-url { display: flex; align-items: center; gap: 7px; min-width: 0 }
.img-url code {
  font-size: 10.5px; color: var(--tx-2); background: var(--s2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 2px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Insert-into-body: one press per image on the post, unhidden by the bundle.
   A thumbnail with its filename under it — the same shape as the library
   picker, but a button rather than a checkbox, because it acts once instead of
   selecting. No colour: it is structure, and the primary action on the screen
   is Save. */
.ins-row {
  display: grid; gap: 9px;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}
.ins-b {
  display: grid; gap: 4px; padding: 6px; text-align: left; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--tx-2); font: inherit; transition: border-color 140ms, background 140ms;
}
.ins-b:hover { border-color: var(--brand); background: var(--s2) }
.ins-b > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sm) }
.ins-n {
  font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* A link target has no thumbnail, so it is a wider card carrying the title and
   the path it will write. Same button, different cargo. */
.ins-row:has(.ins-l) { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) }
.ins-l { gap: 2px }
.ins-l .ins-n { font-size: 12px; color: var(--tx) }
.ins-p {
  font-size: 10.5px; color: var(--tx-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.alt-form { display: flex; align-items: center; gap: 7px }
.alt-form .input { height: 27px; padding: 0 8px; font-size: 11.5px }

/* sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px }
.auth-card { width: 100%; max-width: 360px }
.auth-card .brand { border-right: none; padding: 0 0 18px; height: auto; gap: 14px }
.auth-card .mark { width: 38px; height: 38px }
.auth-card .panel { padding: 18px }
.auth-note { margin-top: 12px; font-size: 10.5px; color: var(--tx-3); line-height: 1.6 }
.auth-note b { color: var(--tx-2); font-weight: 500 }

/* ---------- Administration → Activity logs ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 12px;
  padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
}
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 120px; flex: 1 1 140px }
.fld-grow { flex: 2 1 220px }
/* A native date field is taller than a text field in WebKit; held to the row. */
.fld .input, .fld .select { height: 32px }
.fld > span { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--tx-2); font-weight: 600 }
.fld-act { display: flex; gap: 8px; align-items: center }
/* Main column and a narrow side column, for a screen that has one thing to
   read and one thing to glance at. */
.split-r { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; align-items: start }
.split-r > .panel { margin-bottom: 0 }
.log-tbl td { vertical-align: top }
.log-tbl .t-sub { display: block }
.log-time { white-space: nowrap; width: 1% }
.log-time .mono { font-size: 11px; color: var(--tx-2) }
.log-ev { display: flex; gap: 9px; align-items: flex-start; min-width: 280px }
.log-ev b { font-weight: 500 }
.log-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--tx-3) }
.log-dot.ev-ok { background: var(--green) }
.log-dot.ev-bad { background: var(--red) }
.log-dot.ev-cy { background: var(--cyan) }
.log-dot.ev-vi { background: var(--violet) }
.log-dot.ev-am { background: var(--amber) }
.who-list { padding: 6px }
/* .who span below sets block on every span, the avatar included. */
.who .av { display: grid; font-size: 10.5px; color: var(--on-accent) }
@media (max-width: 1100px) { .split-r { grid-template-columns: minmax(0, 1fr) } }
@media (max-width: 700px) {
  .fld, .fld-grow { flex: 1 1 100% }
  .log-ev { min-width: 220px }
}
/* ---------- activity feed (dashboard, company timelines) ---------- */
.feed { display: flex; flex-direction: column; gap: 1px }
.ev { display: flex; gap: 10px; padding: 8px; border-radius: var(--r-sm); position: relative }
.ev:hover { background: var(--paper) }
.ev-i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--paper); border: 1px solid var(--line) }
.ev-i svg { width: 13px; height: 13px }
.ev-ok .ev-i { background: var(--green); color: var(--on-accent) }
.ev-bad .ev-i { background: var(--red); color: var(--on-accent) }
.ev-cy .ev-i { background: var(--cyan); color: var(--on-accent) }
.ev-vi .ev-i { background: var(--violet); color: var(--on-accent) }
.ev-am .ev-i { background: var(--amber); color: var(--nav) }
.ev-tx { min-width: 0; flex: 1 }
.ev-tx p { font-size: 12px; line-height: 1.4 }
.ev-tx p b { font-weight: 500 }
.ev-mt { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 10px; color: var(--tx-3) }
.ev-mt i { width: 1px; height: 8px; background: var(--hair) }
/* The detail truncates; the timestamp never does. */
.ev-mt span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0 }
.ev-mt span + i + span { flex: none }
.ev-mt i { flex: none }

.who { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: var(--r-sm) }
.who:hover { background: var(--paper) }
.who-av { position: relative; flex: none }
.who-av .st {
  position: absolute; bottom: -1px; right: -1px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 2px var(--s2);
}
.who-av .st.idle { background: var(--amber); box-shadow: 0 0 0 2px var(--s2) }
.who-av .st.off { background: var(--tx-3); box-shadow: 0 0 0 2px var(--s2) }
.who b { display: block; font-size: 12px; font-weight: 500 }
.who span { display: block; font-size: 10px; color: var(--tx-3) }
.who .tag {
  margin-left: auto; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tx-2); border: 1px solid var(--line); border-radius: 20px; padding: 1px 7px;
}

@media (max-width: 1240px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .grid-2 { grid-template-columns: minmax(0, 1fr) }
}

/* ------------------------------------------------------------------ *
 * Tablets and phones (narrower than 1024px)
 *
 * The rail becomes a drawer behind the menu button, with every label: an icon
 * column cannot show a module's links, and a tablet is where people most need
 * them. The drawer needs the bundle (`.js` on <html>); without it the rail is
 * an ordinary list above the page — longer, but every link still works.
 * ------------------------------------------------------------------ */
@media (max-width: 1023px) {
  .nav-toggle { display: grid }
  .rail-toggle { display: none }
  .shell, .shell.nav-collapsed { grid-template-columns: minmax(0, 1fr); transition: none }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line) }
  .side-scroll { overflow: visible }
  .nav-top, .nav-grp-h { height: 40px }
  .nav-i { height: 38px }

  /* align-self back to stretch: on a fixed box, "start" sizes it to its
     content, and WebKit (every iPhone) then drew the drawer one row tall. */
  .js .side {
    position: fixed; top: 52px; left: 0; bottom: 0; z-index: 35; height: auto; align-self: stretch;
    width: min(300px, 86vw); border-right: 1px solid var(--line); border-bottom: 0;
    transform: translateX(-100%); visibility: hidden;
    transition: transform .2s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .2s;
  }
  .js .side-scroll { overflow-y: auto }
  .js .shell.nav-open .side { transform: none; visibility: visible; transition: transform .2s cubic-bezier(.4, 0, .2, 1) }
  /* The backdrop is the shell's own pseudo-element, so a tap on it lands on
     the shell, which is how the script tells it from a tap in the drawer. */
  .js .shell.nav-open::after { content: ''; position: fixed; inset: 52px 0 0 0; z-index: 34; background: rgba(5, 7, 11, .62) }
  html.js:has(.shell.nav-open) { overflow: hidden }
  /* With the root locked, the body's own overflow-x makes it the top bar's
     scroll container, and the sticky bar (with the button that closes the
     drawer) is left wherever the page had scrolled to. Visible while locked;
     the root still clips. */
  html.js:has(.shell.nav-open) body { overflow: visible }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important } }

/* Version history. A body read in place, so comparing two short posts does not
   cost a second screen. */
.rev-body { margin-top: 6px }
.rev-body > summary {
  cursor: pointer; font-size: 12px; color: var(--brand); font-weight: 600;
  list-style: none;
}
.rev-body > summary::-webkit-details-marker { display: none }
.rev-body > summary::before { content: '▸ '; }
.rev-body[open] > summary::before { content: '▾ '; }
.rev-text {
  margin-top: 8px; padding: 10px 12px; max-width: 62ch;
  background: var(--s2); border: 1px solid var(--hair); border-radius: var(--r-sm);
  color: var(--tx-2); font-size: 13px; line-height: 1.65;
}
.rev-text p + p { margin-top: 9px }

/* Connection readiness. A list, not a table: each row is a sentence and a fix,
   and the fix is the part worth reading. */
.checks { display: grid; gap: 9px }
.checks li { display: flex; gap: 9px; align-items: flex-start; font-size: 13px }
.checks li > svg { width: 15px; height: 15px; flex: none; margin-top: 1px }
.checks li > span { display: grid; gap: 2px }
.check-ok > svg { color: var(--green) }
.check-bad > svg { color: var(--red) }
.check-bad > span > b { color: var(--tx) }
.check-fix { color: var(--tx-2); font-size: 12px; line-height: 1.5 }
/* A finding, not a fault. The writing checks are advisory — nothing there
   refuses a save — so they must not wear the coral that means a connection is
   broken. Amber is already "waiting on somebody", which is what an unmet
   suggestion is. */
.check-note > svg { color: var(--amber) }
.check-note > span > b { color: var(--tx) }

/* The reading band. No state colour on it deliberately: green here would be the
   green that means published, and a badge saying a draft is published would be
   telling a reader something untrue. The word is the information. */
.band {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--tx-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 2px 7px; background: var(--s2); flex: none;
}
.band-row { display: flex; align-items: baseline; gap: 9px; margin: 0 0 10px }
.band-row .hint { margin: 0 }

/* Library picker. Cards rather than a list: an image is chosen by looking at
   it, and the company it belongs to has to be read at the same time. */
.lib-pick { margin-top: 13px; border-top: 1px solid var(--hair); padding-top: 11px }
.lib-pick > summary { cursor: pointer; font-size: 12px; color: var(--brand); font-weight: 600 }
.lib-grid {
  display: grid; gap: 9px; margin: 11px 0 0;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}
.lib-card {
  display: grid; gap: 3px; cursor: pointer; position: relative;
  border: 1px solid var(--line); border-radius: var(--r); padding: 6px;
  background: var(--paper);
}
.lib-card:has(input:checked) { background: var(--s2) }
.lib-card > input { position: absolute; top: 8px; left: 8px; margin: 0 }
.lib-card > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sm) }
.lib-co { font-size: 10px; font-weight: 700; color: var(--brand) }
.lib-name {
  font-size: 11px; color: var(--tx-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ------------------------------------------------------------------ *
 * Calendar
 *
 * Structure only, like the tables: this holds live publish state. Hairlines,
 * real contrast, and colour only where it carries the distribution's state.
 * ------------------------------------------------------------------ */
.cal-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px }
.cal-bar .spacer { margin-left: auto }
.cal-month {
  font-family: 'Anton', 'Inter', sans-serif; font-weight: 400; font-size: 15px; text-transform: uppercase;
  letter-spacing: -.01em; min-width: 168px;
}

.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden;
  background: var(--paper);
}
.cal-dow {
  padding: 7px 8px; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--tx-3); background: var(--s2);
  border-bottom: 1px solid var(--line); border-right: 1px solid var(--hair);
}
.cal-dow:nth-child(7n) { border-right: none }

.cal-day {
  min-height: 96px; padding: 6px; background: var(--paper);
  border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
.cal-day:nth-child(7n) { border-right: none }
/* The last row carries no rule: the grid's own border closes it. */
.cal-day:nth-last-child(-n+7) { border-bottom: none }
.cal-day.out { background: var(--bg) }
.cal-day.out .cal-num { color: var(--tx-3) }
.cal-day.today { background: var(--s1) }
.cal-day.today .cal-num {
  background: var(--brand-fill); color: var(--brand-ink); border-radius: 20px;
  width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
}

.cal-num { font-family: 'Space Mono', ui-monospace, monospace; font-size: 11px; color: var(--tx-2); font-variant-numeric: tabular-nums }

.cal-ev {
  display: flex; align-items: center; gap: 5px; padding: 3px 5px; border-radius: 3px;
  font-size: 10.5px; line-height: 1.25; text-decoration: none; color: var(--tx);
  border: 1px solid var(--line); background: var(--paper); min-width: 0;
}
.cal-ev:hover { background: var(--s2) }
.cal-ev .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--accent, var(--tx-3)) }
.cal-ev .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0 }
/* Which client, in two letters. The title truncates before this does, because
   on a day holding two companies the company is the part that disambiguates. */
.cal-ev .who {
  font-family: 'Space Mono', ui-monospace, monospace; font-size: 9px; letter-spacing: .04em;
  color: var(--tx-3); flex: none;
}
.cal-prev .i { transform: rotate(90deg) }
.cal-next .i { transform: rotate(-90deg) }
/* A plan reads lighter than a fact: dashed until it has actually happened. */
.cal-ev.plan { border-style: dashed }
.cal-more { font-size: 10px; color: var(--tx-3); padding-left: 5px }

@media (max-width: 900px) {
  .cal-day { min-height: 72px }
  .cal-ev .tx { display: none }
}

/* Password reveal. The button ships hidden and the bundle unhides it, so with
   JavaScript blocked the field is an ordinary password box and not a dead
   control. */
.pw { position: relative; display: flex; align-items: center }
.pw .input { padding-right: 38px }
.pw-eye {
  position: absolute; right: 5px; width: 28px; height: 28px;
  display: grid; place-items: center; border-radius: var(--r-sm);
  /* --tx-2, not --tx-3: this is a control, and the most muted token in the
     palette is for text you are not meant to act on. */
  color: var(--tx-2); background: none; border: none;
  transition: color .13s, background .13s;
}
.pw-eye:hover { color: var(--tx); background: var(--s3) }
.pw-eye.on { color: var(--brand) }
/* A shade heavier than the 1.5 the icon set uses: at 16px inside a field, the
   hairline stroke reads as smudge rather than as a shape. */
.pw-eye svg { width: 16px; height: 16px; stroke-width: 1.75 }

/* ------------------------------------------------------------------ *
 * SEO preview
 *
 * A quiet zone: it is showing someone else's chrome, so it should read as a
 * sample rather than as part of this app. Hairlines and surface, no accent.
 * ------------------------------------------------------------------ */
.seo-prev { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; padding: 13px }
.seo-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); padding: 12px }
.seo-lbl {
  font-family: 'Space Mono', ui-monospace, monospace; font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--tx-3); margin-bottom: 9px;
}
.seo-url {
  font-size: 11px; color: var(--tx-3); margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Deliberately not Anton and not uppercase: this is a sample of a search
   result, not a heading in this app, and it should read as the former. */
.seo-title {
  font-family: 'Inter', system-ui, sans-serif; font-size: 15px; line-height: 1.3;
  color: var(--brand); margin-bottom: 4px;
}
.seo-desc { font-size: 12px; line-height: 1.5; color: var(--tx-2) }
.seo-missing { color: var(--tx-3); font-style: italic }

.seo-og { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden }
.seo-og-img { display: block; width: 100%; height: 132px; object-fit: cover; background: var(--s2) }
.seo-og-none {
  display: grid; place-items: center; gap: 5px; align-content: center;
  color: var(--tx-3); font-size: 10.5px;
}
.seo-og-none svg { width: 20px; height: 20px }
.seo-og-tx { padding: 10px 11px }
.seo-og-tx .seo-title { font-size: 13.5px; color: var(--tx) }
.seo-og-tx .seo-desc { font-size: 11.5px }

/* ------------------------------------------------------------------ *
 * Charts
 *
 * The data is the only thing allowed to be loud. Grid and axis are one step
 * off the surface and solid — never dashed, which reads as a threshold when it
 * is only a grid. Bars carry the published green because that is what they
 * count; nothing else here has colour.
 * ------------------------------------------------------------------ */
.chart { padding: 14px 13px 10px }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible }
.chart-grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges }
.chart-bar { fill: var(--green) }
/* The hit area is the whole slot, so an empty week is still hoverable. */
.chart-hit { fill: transparent }
.chart-col:hover .chart-bar { fill: #5FE3A5 }
.chart-col:hover .chart-hit { fill: rgba(255, 255, 255, .04) }
.chart-tick {
  font-family: 'Space Mono', ui-monospace, monospace; font-size: 9px;
  fill: var(--tx-3); text-anchor: middle; font-variant-numeric: tabular-nums;
}
.chart-note { font-size: 11px; color: var(--tx-3); margin-top: 9px }
.chart-note b { color: var(--tx-2); font-weight: 500 }

/* Ranked horizontal bars. A row is name, track, value — the name reads first
   because that is what someone is looking for. */
.chart-rows { display: flex; flex-direction: column; gap: 7px }
.chart-row { display: flex; align-items: center; gap: 10px }
.chart-row-name {
  flex: none; width: 150px; font-size: 11.5px; color: var(--tx-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chart-row-track { flex: 1; height: 14px; background: var(--s2); border-radius: 4px; overflow: hidden }
.chart-row-bar { display: block; height: 100%; background: var(--green); border-radius: 4px }
.chart-row-n {
  flex: none; width: 34px; text-align: right;
  font-family: 'Space Mono', ui-monospace, monospace; font-size: 11.5px;
  font-variant-numeric: tabular-nums; color: var(--tx-2); font-weight: 400;
}

.chart-table { border-top: 1px solid var(--hair) }
.chart-table > summary {
  cursor: pointer; padding: 9px 13px; font-size: 10.5px; color: var(--tx-3);
  font-family: 'Space Mono', ui-monospace, monospace; letter-spacing: .06em;
  text-transform: uppercase;
}
.chart-table > summary:hover { color: var(--brand) }
.chart-table .tbl { border-top: 1px solid var(--hair) }

.m-ok .m-top { color: var(--green) }
.m-bad .m-top { color: var(--red) }

/* ---------- GHL menu link ---------- *
 * The URL is meant to be selected and pasted into GHL, so it wraps rather than
 * ellipsing: a truncated URL is worse than a tall one when copying is the whole
 * point of showing it. */
.ghl-link { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line) }

/* Installing the GitHub App, on the add-company form. A surface step and a
   hairline, like every other grouping here — the button inside it is an
   outline, because the one filled blue on this screen is Add company. */
.gh-connect { background: var(--s2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px }

/* A client on the git transport whose repository has never been read. Amber,
   because it is waiting on somebody rather than broken, and on the card itself
   because the numbers above it will all be zero and none of them say why. */
.co-warn {
  display: flex; gap: 6px; align-items: center; margin-top: 9px;
  padding-top: 9px; border-top: 1px solid var(--hair);
  font-size: 11px; color: var(--amber);
}
.co-warn > svg { width: 13px; height: 13px; flex: none }

/* The connect wizard. A rail of steps down the left, each one done, current or
   still ahead — carried by the number's own surface and one hairline, because
   structure carries no colour here. The only accent is the green tick on a step
   that is finished, which is a state and has earned it. */
.wiz { display: grid; gap: 2px }
.wiz-step { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--hair) }
.wiz-step:first-child { border-top: 0; padding-top: 2px }
.wiz-n {
  width: 24px; height: 24px; flex: none; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Space Mono', ui-monospace, monospace; font-size: 12px; font-variant-numeric: tabular-nums;
  background: var(--s2); border: 1px solid var(--line); color: var(--tx-3);
}
.wiz-n > svg { width: 13px; height: 13px }
.wiz-done { background: var(--s3); border-color: var(--line); color: var(--green) }
/* The step to do now. An outline in the brand blue you read, never a fill —
   the filled blue on this screen belongs to the button inside the step. */
.wiz-now { border-color: var(--brand); color: var(--brand) }
.wiz-body { flex: 1; min-width: 0 }
.wiz-title { font-size: 13px; font-weight: 600; color: var(--tx); display: flex; gap: 8px; align-items: baseline }
.wiz-tag {
  font-family: 'Space Mono', ui-monospace, monospace; font-size: 10px;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--tx-3);
}
.wiz-step-now .wiz-tag { color: var(--brand) }
.wiz-sub { color: var(--tx-2); font-size: 12px; line-height: 1.55; margin-top: 3px }
.wiz-step-later .wiz-title, .wiz-step-later .wiz-sub { color: var(--tx-3) }
.wiz-body .form, .wiz-body .checks, .wiz-body > .hint { margin-top: 10px }
.wiz-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px }
.ghl-url {
  font-size: 11.5px; color: var(--tx); background: var(--s2);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 8px 10px; margin: 8px 0; word-break: break-all; user-select: all;
}

/* An archived company. Recessive rather than marked: it is a record, not a
 * warning, and a state colour here would say something is wrong. */
.co-archived { opacity: 0.62 }
.co-archived:hover { opacity: 1 }

/* ---------- rich editor ---------- *
 * Wraps the body textarea rather than replacing it: the textarea is still the
 * control that submits, and is simply hidden while the editor holds the value.
 * With JS blocked, none of this exists and the field is a plain textarea. */
.ed { border: 1px solid var(--line); border-radius: var(--r); background: var(--s2); overflow: hidden }
.ed-bar {
  display: flex; gap: 2px; padding: 5px 6px;
  border-bottom: 1px solid var(--line); background: var(--s3);
}
.ed-b {
  min-width: 28px; height: 26px; padding: 0 7px;
  font: 600 11.5px/1 'Space Mono', ui-monospace, monospace; color: var(--tx-2);
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  cursor: pointer; transition: background 120ms, color 120ms, border-color 120ms;
}
.ed-b:hover { color: var(--tx); background: var(--s2); border-color: var(--line) }
/* The pressed state is the brand read-blue, not a fill: a filled control here
   would compete with Save, which is the one thing to press on this screen. */
.ed-b.on { color: var(--brand); border-color: var(--line); background: var(--bg) }
.ed-surface { padding: 10px 12px; min-height: 260px; font-size: 13px; line-height: 1.65 }
.ed-surface .ProseMirror { outline: none; min-height: 240px }

/* A post being read rather than written. Same prose, no chrome: it is content
   inside a panel, not a control, so it gets no border, no fill and no minimum
   height. `.rd-raw` is how the server sends it — pre-wrapped source, which the
   bundle replaces with the rendered document and then unsets. */
.rd { font-size: 12.5px; line-height: 1.7; color: var(--tx-2) }
.rd-raw { white-space: pre-wrap }
.rd .ProseMirror { outline: none }
.rd img { max-width: 100%; height: auto; border-radius: var(--r-sm); margin: 4px 0 }
.rd a { color: var(--brand) }
:is(.ed-surface, .rd) h2 { font-size: 17px; margin: 16px 0 6px }
:is(.ed-surface, .rd) h3 { font-size: 14px; margin: 14px 0 5px }
:is(.ed-surface, .rd) p { margin: 0 0 10px }
:is(.ed-surface, .rd) ul, :is(.ed-surface, .rd) ol { margin: 0 0 10px; padding-left: 20px }
:is(.ed-surface, .rd) li { margin-bottom: 3px }
.ed-surface blockquote,
.rd blockquote {
  margin: 0 0 10px; padding-left: 11px; border-left: 2px solid var(--line); color: var(--tx-2);
}
:is(.ed-surface, .rd) :is(h2, h3, p, li):first-child { margin-top: 0 }
.ed-note { margin-top: 7px }

/* Dragging a scheduled post. The cursor and the lift are the only affordance —
 * a calendar covered in handles would be a worse calendar for the people who
 * never drag anything. */
.cal-ev[data-move] { cursor: grab }
.cal-ev.dragging { opacity: 0.45; cursor: grabbing }
.cal-day.over { background: var(--s3); box-shadow: inset 0 0 0 1px var(--brand) }

/* An image nobody described. Amber rather than coral: an empty alt is correct
   for a decorative image, so this is an unanswered question, not a failure. */
/* Two uses, one look: an image with no alt text, and a trashed post whose
   address something else has taken. Both are a warning attached to a name. */
.alt-missing, .flag-chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--amber) 34%, transparent);
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 8px;
  white-space: nowrap;
}
.alt-hint { flex-basis: 100%; margin: 4px 0 0; max-width: 46ch }

/* ------------------------------------------------------------------ *
 * Onboarding · client files
 *
 * A file browser over the onboarding worker's bucket. Structure only: names
 * in the reading colour, folders a link like any other, nothing tinted —
 * none of these rows is a state.
 * ------------------------------------------------------------------ */
.ob-bar { border-bottom: 1px solid var(--hair) }
.ob-trail { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11.5px; color: var(--tx-3); word-break: break-all }
.ob-trail a { color: var(--tx-2); text-decoration: none }
.ob-trail a[aria-current] { color: var(--tx) }
.ob-name { display: inline-flex; align-items: flex-start; gap: 8px; color: var(--tx); text-decoration: none; word-break: break-word }
.ob-name svg.i { color: var(--tx-3); margin-top: 1px }
.ob-name:hover span, .ob-trail a:hover { color: var(--brand); text-decoration: underline }
.ob-tbl .ob-num { text-align: right; white-space: nowrap; color: var(--tx-2) }
.ob-tbl .ob-when { white-space: nowrap; color: var(--tx-2) }
.ob-tbl .ob-act { text-align: right; width: 1% }
.ob-more { border-top: 1px solid var(--hair) }

@media (max-width: 700px) {
  .ob-tbl .ob-when { display: none }
  .ob-tbl td, .ob-tbl th { padding-left: 9px; padding-right: 9px }
}

/* ------------------------------------------------------------------ *
 * Onboarding · pipeline
 *
 * Stages are not distribution states, so none of the state colours appear
 * here: columns are surfaces, progress is filled in the reading colour, and
 * the only blue is the one action each screen exists for.
 * ------------------------------------------------------------------ */
.pl-views { display: flex; gap: 6px }
.pl-views a[aria-current] { border-color: var(--brand); color: var(--tx) }
.pl-start { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.pl-start .select { flex: 1 1 240px; max-width: 420px }

.pl-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: start }
.pl-col { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0 }
.pl-col-h { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 2px 4px; border-bottom: 1px solid var(--hair) }
.pl-col-h h2 { font-size: 13px }
.pl-col-h .mono { font-size: 12px; color: var(--tx-3) }
.pl-none { font-size: 11px; color: var(--tx-3); padding: 2px }
.pl-card { background: var(--s2); border: 1px solid var(--hair); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0 }
.pl-card-h { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--tx); min-width: 0 }
.pl-card-h > span:last-child { min-width: 0 }
.pl-card-h b, .pl-card-h span span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.pl-card-h b { font-size: 12.5px; font-weight: 500 }
.pl-card-h span span { font-size: 10.5px; color: var(--tx-3) }
.pl-card-h:hover b { color: var(--brand) }
.pl-card-m { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--tx-2) }
.pl-card .inline-form .btn { width: 100%; justify-content: center }

.pl-prog { display: inline-flex; gap: 3px }
.pl-prog i { width: 14px; height: 4px; border-radius: 2px; background: var(--s3) }
.pl-prog i.on { background: var(--tx-2) }
.pl-stage {
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--tx-2);
  border: 1px solid var(--line); border-radius: 20px; padding: 2px 8px; white-space: nowrap;
}
.pl-tw { overflow-x: auto }
.pl-link { text-decoration: none; color: var(--tx) }
.pl-link:hover .t-title { color: var(--brand) }
.tbl .pl-when { white-space: nowrap; color: var(--tx-2) }
.tbl .pl-act { text-align: right; width: 1% }

.pl-steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 6px; flex-wrap: wrap }
.pl-step { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--tx-3); padding: 6px 10px; border: 1px solid var(--hair); border-radius: 20px }
.pl-step.done { color: var(--tx-2) }
.pl-step.now { color: var(--tx); border-color: var(--brand) }
.pl-dot { width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center }
.pl-step.done .pl-dot { background: var(--s3) }
.pl-step.now .pl-dot { border-color: var(--brand) }
.pl-note { min-height: 84px }
.pl-move-act { flex-wrap: wrap }

.pl-hist { list-style: none; margin: 0; padding: 0 }
.pl-hist li { padding: 11px 13px; border-bottom: 1px solid var(--hair) }
.pl-hist li:last-child { border-bottom: none }
.pl-hist-h { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 12px }
.pl-hist-h b { font-weight: 500 }
.pl-hist-h span { font-size: 10.5px; color: var(--tx-3) }
.pl-hist-n { margin-top: 5px; font-size: 12px; color: var(--tx-2); white-space: pre-wrap; word-break: break-word; max-width: 72ch }

@media (max-width: 1100px) { .pl-board { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 700px) {
  .pl-board { grid-template-columns: minmax(0, 1fr) }
  .tbl .pl-when { display: none }
}

/* ------------------------------------------------------------------ *
 * Onboarding · submissions
 *
 * Answers read like a form someone filled in: the question muted on the
 * left, what they wrote on the right, line breaks kept. Nothing tinted.
 * ------------------------------------------------------------------ */
.sb-tw { overflow-x: auto }
.sb-link { text-decoration: none; color: var(--tx) }
.sb-link:hover .t-title { color: var(--brand); text-decoration: underline }
.sb-tbl .sb-part { white-space: nowrap; color: var(--tx-2) }
.sb-tbl .sb-when { white-space: nowrap; color: var(--tx-2) }
.sb-times { color: var(--tx-3) }
.sb-none { color: var(--tx-3) }
.sb-dl { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 12.5px }
.sb-dl dt { color: var(--tx-3); font-size: 11.5px; padding-top: 1px }
.sb-dl dd { margin: 0; color: var(--tx); white-space: pre-wrap; word-break: break-word; max-width: 72ch }
.sb-dl dd a { color: var(--brand) }
.sb-hint { margin-top: 10px }
.sb-earlier { margin-top: 12px; border-top: 1px solid var(--hair); padding-top: 10px }
.sb-earlier summary { cursor: pointer; font-size: 11.5px; color: var(--tx-2) }
.sb-earlier .sb-dl { margin-top: 10px }

@media (max-width: 700px) {
  .sb-tbl .sb-when { display: none }
  .sb-dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0 }
  .sb-dl dd { margin-bottom: 8px }
}

/* ------------------------------------------------------------------ *
 * Client files · browser tools, grid, selection, viewer
 *
 * Same rules as the list: surfaces and hairlines, the one blue on the action a
 * screen exists for (Download, in the viewer). Thumbnails sit on --s2 so a
 * transparent PNG still reads as a tile.
 * ------------------------------------------------------------------ */
.ob-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-bottom: 1px solid var(--hair) }
.ob-tools .ob-q { flex: 1 1 200px; max-width: 280px }
.ob-tools .select { width: auto; min-width: 0 }
.ob-tools .spacer { margin-left: auto }
.ob-views { display: flex; gap: 6px }
.ob-views a[aria-current] { border-color: var(--brand); color: var(--tx) }
.ob-select { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-bottom: 1px solid var(--hair) }
.ob-check { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tx-2); min-width: 0 }
.ob-check input { width: 15px; height: 15px; accent-color: var(--brand); flex: none }
.ob-progress { padding: 10px 13px; border-bottom: 1px solid var(--hair); font-size: 12px; color: var(--tx-2); word-break: break-word }
.ob-progress.ok { color: var(--green) }
.ob-progress.bad { color: var(--amber) }
.ob-tw { overflow-x: auto }
.ob-tbl .ob-pick { width: 1%; padding-right: 0 }
.ob-tbl .ob-type { color: var(--tx-3); font-size: 10.5px; letter-spacing: .06em; white-space: nowrap }
.ob-count { margin-left: 24px }

.ob-grid { list-style: none; margin: 0; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px }
.ob-card { background: var(--s2); border: 1px solid var(--hair); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; min-width: 0 }
.ob-thumb {
  display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--bg); color: var(--tx-3);
  border-bottom: 1px solid var(--hair); overflow: hidden;
}
.ob-thumb img { width: 100%; height: 100%; object-fit: cover; display: block }
.ob-thumb:hover { color: var(--brand) }
.ob-card-tx { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 5px; min-width: 0 }
.ob-card-tx .t-sub { font-size: 10.5px; color: var(--tx-3) }
.ob-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tx); font-size: 12px }
.ob-card-tx .btn { align-self: flex-start }
.ob-card-dir .ob-thumb { aspect-ratio: 4 / 2 }

.ob-v-title { min-width: 0 }
.ob-v-name { word-break: break-word }
.ob-v-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px }
.ob-v-bar .spacer { margin-left: auto }
.ob-v-bar a[aria-disabled] { opacity: .45; pointer-events: none }
.ob-v-stage { padding: 0 }
.ob-v-tools { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--hair) }
.ob-v-zoom { min-width: 44px; text-align: center; font-size: 11px; color: var(--tx-2) }
.ob-v-frame { display: grid; place-items: center; background: var(--bg); min-height: 240px; max-height: 76vh; overflow: auto }
.ob-v-img { display: block; max-width: 100%; max-height: 76vh; height: auto }
.ob-v-frame.zoomed { place-items: start }
.ob-v-frame.zoomed .ob-v-img { max-width: none; max-height: none }
.ob-v-video { display: block; width: 100%; max-height: 76vh; background: var(--bg) }
.ob-v-fallback { padding: 24px; color: var(--tx-2); font-size: 13px; text-align: center }
.ob-v-pdf { display: block; width: 100%; height: 78vh; border: 0; background: var(--bg) }
.ob-v-text { margin: 0; padding: 14px; font: 12px/1.6 'Space Mono', ui-monospace, monospace; color: var(--tx); white-space: pre-wrap; word-break: break-word }
.ob-v-keys { margin-top: 8px }

@media (max-width: 700px) {
  .ob-tbl .ob-type { display: none }
  .ob-tools .ob-q { max-width: none; flex-basis: 100% }
  .ob-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 9px; gap: 8px }
  .ob-v-pdf { height: 64vh }
}

/* Pipeline · last change, confirmations */
.pl-last { display: flex; flex-direction: column; gap: 8px; align-items: flex-start }
.pl-dupes, .pl-what { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 6px; font-size: 12.5px; color: var(--tx) }
.pl-dupes a { color: var(--brand) }
.pl-what b { font-weight: 600 }
.pl-hist-cancel .pl-hist-h b { color: var(--amber) }
.pl-card .inline-form + .inline-form { margin-top: -2px }

/* client timeline: a day heading, then that day's rows */
.tl-day + .tl-day { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair) }
.tl-date { margin: 0 0 6px; font-family: 'Space Mono', ui-monospace, monospace; font-size: 10.5px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; color: var(--tx-3) }
.tl-time { font-family: 'Space Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums }
.tl-note { margin: 0 0 12px }
.tl-day .ev-tx a { color: var(--brand) }
.tl-day .ev-mt span:first-child { white-space: normal }

/* client suggestions under the top-bar search box */
.search { position: relative }
.search-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: min(380px, calc(100vw - 32px));
  background: var(--s2); border: 1px solid var(--hair); border-radius: var(--r); padding: 4px; color: var(--tx);
}
.search-pop[hidden] { display: none }
.sug-state, .sug-empty { margin: 0; padding: 10px; font-size: 12px; color: var(--tx-3) }
.sug-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px }
.sug-item { display: grid; gap: 2px; padding: 6px 8px; border-radius: var(--r-sm) }
.sug-item:hover, .sug-item:focus-within { background: var(--s3) }
.sug-main { display: grid; gap: 1px; color: var(--tx); min-width: 0 }
.sug-main b { font-weight: 600; font-size: 13px }
.sug-main span { font-size: 11.5px; color: var(--tx-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.sug-links { display: flex; flex-wrap: wrap; gap: 10px; font-family: 'Space Mono', ui-monospace, monospace; font-size: 10px; letter-spacing: .06em; text-transform: uppercase }
.sug-links a, .sug-all { color: var(--brand) }
.sug-all { display: block; margin-top: 2px; padding: 8px; border-top: 1px solid var(--hair); font-size: 12px }
.search-pop a:focus-visible { outline: 1px solid var(--brand); outline-offset: 1px; border-radius: 2px }

/* a company's Business Intelligence section */
.bi-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 14px; font-size: 13px }
.bi-facts dt { color: var(--tx-3) }
.bi-facts dd { margin: 0; color: var(--tx); min-width: 0; overflow-wrap: anywhere }
.bi-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px }
.bi-row .hint { margin: 0 }
.bi-sync { display: flex; align-items: center; gap: 8px }
.bi-sync .input { width: auto }
.bi-note { margin: 10px 0 0 }
.bi-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)) }
.tbl-wrap { overflow-x: auto }
.bi-tbl th.num, .bi-tbl td.num { text-align: right; white-space: nowrap }
.bi-total td { border-top: 1px solid var(--line-2); font-weight: 600; color: var(--tx) }
.bi-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13px }
.bi-list b { font-weight: 600 }
.bi-defs { font-size: 12.5px; color: var(--tx-2) }
.bi-defs summary { cursor: pointer; color: var(--brand) }
.bi-defs dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 10px 0 0 }
.bi-defs dt { color: var(--tx); font-weight: 600 }
.bi-defs dd { margin: 0 }
@media (max-width: 900px) {
  .bi-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .bi-defs dl { grid-template-columns: minmax(0, 1fr) }
}
.bi-tabs { margin: 0 0 12px; flex-wrap: wrap }
.bi-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; color: var(--tx-2) }
.bi-range .input { width: auto }
.bi-tbl td.day { white-space: nowrap }
.bi-pick { margin: 0 0 12px }
.bi-funnel { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 13px; color: var(--tx) }
.bi-funnel .t-sub { margin-left: 6px }
.bi-status { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--tx-2) }
.bi-quality { margin: -4px 0 12px }
.bi-secret { margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--s3); font-size: 16px; letter-spacing: .04em; color: var(--tx); user-select: all; overflow-wrap: anywhere }
.bi-user { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap }
.bi-invite { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair) }

/* Ads reporting (/bi/ads). Colour only where it says something: each series
   keeps one hue (spend the brand blue, Google-reported conversions plum, an
   accent no state uses), a won lead is green and a lost one coral as
   everywhere else, and anything without a meaning stays grey. Bars are drawn
   a step back from full strength so the one filled blue, Apply, stays the
   loudest thing on the page. */
.ads-filters .select { width: auto; max-width: 100% }
.ads-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px }
.ads-charts .panel { margin-bottom: 0 }
.ads-chart-spend .chart-bar { fill: var(--brand); fill-opacity: .78 }
.ads-chart-conv .chart-bar { fill: var(--violet); fill-opacity: .78 }
.ads-charts .chart-col:hover .chart-bar { fill-opacity: 1 }
.ads-bar { background: var(--tx-3) }
.ads-bar.t-brand { background: var(--brand) }
.ads-bar.t-ok { background: var(--green) }
.ads-bar.t-bad { background: var(--red) }
.ads-status { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3) }
.ads-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tx-3); flex: none }
.ads-status.on { color: var(--tx-2) }
.ads-status.on::before { background: var(--green) }
.ads-tbl td.ads-best { color: var(--green); font-weight: 700 }
.ads-coverage { margin: -4px 0 12px }
.ads-uploads { margin-top: 12px }
.ads-uploads .bi-list { margin-top: 8px; font-size: 12px }
.ads-admin { margin-top: 12px }
.ads-upload { display: grid; gap: 8px; justify-items: start }
.ads-upload .input { width: 100%; max-width: 420px }
.ads-clients { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; font-size: 13px }
.ads-clients label { display: flex; align-items: center; gap: 8px; cursor: pointer }
.ads-clients input { accent-color: var(--brand) }
.ads-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px }
.ads-filters .ads-report-link { margin-left: auto }
/* The platform switch: outlined like every secondary control; the current one
   marked in the brand blue you read, never filled (Apply is this screen's one fill). */
.ads-platforms { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px }
.ads-platforms a[aria-current] { border-color: var(--brand); color: var(--brand) }
.ads-meta-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end }
.ads-meta-actions form { display: inline }
.ads-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair) }
.ads-breakdown .bi-status { margin: 0 0 8px }
.ads-breakdown .chart-row-name { width: 120px }
.ads-sync { margin-bottom: 4px }

/* ---------- the Meta Ads dashboard (/bi/ads?platform=meta) ----------
   One page, sections in order. Built from the existing panels, metric cards
   and bar charts; the only additions are a three-column card grid, equal
   halves for paired panels, and the creative list. Colour stays scarce: the
   brand blue and the muted violet the other ads charts already use. */
.meta-sec { margin-bottom: 14px }
.meta-sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0 8px }
.meta-sec-head h2 { font-size: 13px; letter-spacing: .08em }
.meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 6px }
.meta-note { margin: 4px 0 0; font-size: 11.5px }
.meta-pad { padding: 8px 13px 12px }
.meta-dash .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.meta-charts .panel { margin-bottom: 0 }
.meta-charts { margin-bottom: 12px }
.ads-bar.t-muted { background: var(--violet); opacity: .78 }
.meta-audience { display: grid; gap: 14px }
.meta-audience .chart-row-name { width: 110px }
.meta-dash .chart-row-n { width: 46px }
.meta-ads { list-style: none; margin: 0; padding: 0 }
.meta-ads li { display: flex; align-items: center; gap: 12px; padding: 10px 13px; border-bottom: 1px solid var(--hair) }
.meta-thumb {
  flex: none; width: 44px; height: 44px; border-radius: 6px; background: var(--s2); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--tx-3); object-fit: cover;
}
.meta-ad-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px }
.meta-ad-name b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.meta-ad-figs { display: grid; grid-template-columns: repeat(4, minmax(64px, auto)); gap: 0 18px; margin: 0; text-align: right }
.meta-ad-figs dt { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--tx-3) }
.meta-ad-figs dd { margin: 2px 0 0; font-size: 12.5px }
.meta-sales { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin: 0 }
.meta-sales dt { font-size: 11.5px; color: var(--tx-2) }
.meta-sales dd { margin: 3px 0 0 }
.meta-sales dd.mono { font-size: 17px; color: var(--tx) }
.meta-sales dd.meta-na { font-size: 13px; color: var(--tx-3) }
.meta-sales dd.t-sub { font-size: 11px; color: var(--tx-3) }
.meta-funnel .chart-row-name { width: 190px; white-space: normal; line-height: 1.3 }
.meta-why { display: block; font-size: 10.5px }
.meta-video-rates { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--hair) }
.meta-rate { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--hair) }
.meta-rate b { font-size: 17px }
.meta-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 12.5px; line-height: 1.5; color: var(--tx-2) }
.meta-more { border-top: 1px solid var(--hair) }
.meta-more summary { cursor: pointer; padding: 10px 13px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand) }
@media (max-width: 900px) {
  .meta-dash .grid-2 { grid-template-columns: minmax(0, 1fr) }
  .meta-ad-figs { grid-template-columns: repeat(2, minmax(56px, auto)); gap: 4px 14px }
}
@media (max-width: 700px) {
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important }
  .meta-ads li { flex-wrap: wrap }
  .meta-ad-figs { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: left }
  .meta-sales { grid-template-columns: minmax(0, 1fr) }
}

/*
 * Meta Ads dashboard: tabs, a compact demo notice, and quieter type inside the
 * dashboard (sentence-case labels in Inter; section headings keep the house
 * signage). Existing tokens only: surfaces, hairlines, one brand blue.
 */
.md-head { align-items: center }
.md-head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px }
.md-demo { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 11px; color: var(--tx-2) }
.md-demo::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--amber) }
.md-head-actions .btn[aria-current] { border-color: var(--brand); color: var(--brand) }
.md-notice { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); font-size: 12px; color: var(--tx-2) }
.md-notice svg { color: var(--tx-3); flex: none }
.md-tabs { display: flex; gap: 2px; margin: 0 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none }
.md-tabs a { padding: 9px 12px; font-size: 12.5px; color: var(--tx-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap }
.md-tabs a:hover { color: var(--tx) }
.md-tabs a[aria-current] { color: var(--tx); border-bottom-color: var(--brand) }
.md-tabs a:focus-visible, .md-sort:focus-visible, .md-seg a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px }

.md-dash .metric .m-lbl { font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--tx-2) }
.md-dash .metric .m-d { font-size: 11px }
.md-dash .tbl th { font-size: 11px; letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--tx-2) }
.md-dash .ads-status { font-size: 11px; letter-spacing: 0; text-transform: none }
.md-dash .meta-sec { margin-bottom: 6px }
.md-cell-sub { display: block; margin-top: 2px; font-size: 11px; color: var(--tx-3) }
.md-muted { color: var(--tx-3) }
.md-sub { margin: 0 0 8px; font-family: Inter, system-ui, sans-serif; font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--tx-2) }

.md-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; margin: 0 }
.md-kpis dt { font-size: 12px; color: var(--tx-2) }
.md-kpis dd { margin: 4px 0 0 }
.md-kpis-primary .md-kpi-n { font-size: 24px; color: var(--tx); line-height: 1.1 }
.md-kpis-secondary { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair) }
.md-kpis-secondary .md-kpi-n { font-size: 16px; color: var(--tx) }
.md-kpi-d { font-size: 11px; color: var(--tx-3) }
.md-more { margin-top: 12px }
.md-more summary { cursor: pointer; font-size: 12px; color: var(--brand); width: max-content }
.md-more .md-kpis-secondary { margin-top: 10px }

.md-switch { position: relative; display: flex; flex-direction: column; min-width: 0 }
.md-switch-in { position: absolute; opacity: 0; pointer-events: none }
.md-switch-bar { display: inline-flex; align-self: flex-start; gap: 2px; padding: 2px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper) }
.md-switch-bar label { padding: 4px 10px; font-size: 12px; color: var(--tx-2); border-radius: 4px; cursor: pointer }
.md-switch-in:nth-of-type(1):checked ~ .md-switch-bar label:nth-child(1),
.md-switch-in:nth-of-type(2):checked ~ .md-switch-bar label:nth-child(2) { background: var(--s3); color: var(--tx) }
.md-switch-in:nth-of-type(1):focus-visible ~ .md-switch-bar label:nth-child(1),
.md-switch-in:nth-of-type(2):focus-visible ~ .md-switch-bar label:nth-child(2) { outline: 2px solid var(--brand); outline-offset: 1px }
.md-switch-in:nth-of-type(1):checked ~ .md-pane-b,
.md-switch-in:nth-of-type(2):checked ~ .md-pane-a { display: none }
.md-pane .panel { margin-bottom: 0 }
.md-charts { margin-bottom: 12px }

.md-pair { align-items: start }
.md-advice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px }
.md-advice ol.meta-list li::marker { color: var(--brand) }

.md-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 0 0 12px }
.md-filters label { display: grid; gap: 4px; font-size: 11px; color: var(--tx-2) }
.md-filters .select { width: auto }
.md-sort { color: inherit; text-decoration: none }
.md-sort:hover { color: var(--tx) }
.md-cols-in { position: absolute; opacity: 0; pointer-events: none }
.md-cols-toggle { display: inline-block; margin: 10px 13px; font-size: 12px; color: var(--brand); cursor: pointer }
.md-cols-toggle::before { content: "+ " }
.md-cols-in:checked + .md-cols-toggle::before { content: "− " }
.md-cols-in:focus-visible + .md-cols-toggle { outline: 2px solid var(--brand); outline-offset: 2px }
.md-campaigns .md-col-extra { display: none }
.md-cols-in:checked ~ .tbl-wrap .md-col-extra { display: table-cell }

.md-cuts td { padding-top: 7px; padding-bottom: 7px }
.md-bar-col { width: 34%; min-width: 120px }
.md-bar { display: inline-block; vertical-align: middle; width: calc(100% - 52px); height: 8px; border-radius: 4px; background: var(--s2); overflow: hidden }
.md-bar span { display: block; height: 100%; border-radius: 4px; background: var(--brand) }
.md-bar-n { display: inline-block; width: 46px; text-align: right; font-size: 11px; color: var(--tx-2) }

.md-seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r) }
.md-seg a { padding: 3px 9px; font-size: 11.5px; color: var(--tx-2); text-decoration: none; border-radius: 4px }
.md-seg a[aria-current] { background: var(--s3); color: var(--tx) }
.md-ads .meta-ad-figs dt { text-transform: none; letter-spacing: 0 }
.md-integrations .ads-admin { margin-top: 12px }
@media (max-width: 900px) {
  .md-advice { grid-template-columns: minmax(0, 1fr) }
}
@media (max-width: 700px) {
  .md-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .md-dash .meta-sales { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .md-head-actions { margin-left: 0 }
  .md-bar-col { min-width: 90px }
}

/* Google Ads: the same dashboard pieces, plus a three-way chart switch, a one-line status and the client list. */
.md-switch-in:nth-of-type(3):checked ~ .md-switch-bar label:nth-child(3) { background: var(--s3); color: var(--tx) }
.md-switch-in:nth-of-type(3):focus-visible ~ .md-switch-bar label:nth-child(3) { outline: 2px solid var(--brand); outline-offset: 1px }
.md-switch .md-pane-1, .md-switch .md-pane-2 { display: none }
.md-switch-in:nth-of-type(2):checked ~ .md-pane-0, .md-switch-in:nth-of-type(3):checked ~ .md-pane-0 { display: none }
.md-switch-in:nth-of-type(2):checked ~ .md-pane-1, .md-switch-in:nth-of-type(3):checked ~ .md-pane-2 { display: block }
.md-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 12px; padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); font-size: 12px; color: var(--tx-2) }
.md-status b { color: var(--tx); font-weight: 600 }
.md-status a, .md-notice a { color: var(--brand) }
.md-notice b { color: var(--tx); font-weight: 600 }
.md-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.gd-clients { max-height: 260px; overflow-y: auto; margin: 4px 0 8px; padding: 6px 8px; border: 1px solid var(--hair); border-radius: 4px }
.gd-client-search { margin-bottom: 8px }
.md-integrations .form > .btn { align-self: flex-start }
.md-integrations .ads-status { white-space: nowrap }
@media (max-width: 900px) {
  .md-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important }
}

/* OpenAI Ads: the quieter secondary row, attribution and events. */
.oa-secondary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 18px; margin: 4px 0 6px; padding: 10px 13px; border: 1px solid var(--hair); border-radius: var(--r) }
.oa-secondary dt { font-size: 11px; color: var(--tx-2) }
.oa-secondary dd { margin: 3px 0 0; font-size: 14px; color: var(--tx) }
.oa-secondary .oa-goal dd { font-size: 12.5px }
.oa-crm-note a { color: var(--brand) }
.oa-total { margin: 0 0 10px; display: flex; align-items: baseline; gap: 8px }
.oa-total b { font-size: 22px }
.oa-attr { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--hair) }
.oa-attr label { display: grid; gap: 4px; font-size: 11px; color: var(--tx-2) }
.oa-attr .select { width: auto }
.oa-events td { vertical-align: top }
.oa-event-name { display: block; margin-top: 2px; font-size: 10.5px; color: var(--tx-3) }
.oa-pad { padding: 0 13px 12px }
.oa-funnel-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--hair) }
.oa-cuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px }
@media (max-width: 1100px) {
  .oa-cuts { grid-template-columns: minmax(0, 1fr) }
}
@media (max-width: 700px) {
      .oa-funnel-figs { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
/* TikTok Ads redesign: a five-way chart switch, the video snapshot, engagement grid and creatives. */
.md-switch-in:nth-of-type(5):checked ~ .md-switch-bar label:nth-child(5) { background: var(--s3); color: var(--tx) }
.md-switch-in:nth-of-type(5):focus-visible ~ .md-switch-bar label:nth-child(5) { outline: 2px solid var(--brand); outline-offset: 1px }
.md-switch .md-pane-4 { display: none }
.md-switch-in:nth-of-type(5):checked ~ .md-pane-0 { display: none }
.md-switch-in:nth-of-type(5):checked ~ .md-pane-4 { display: block }
.tt-dash .tt-snapshot { margin-top: 0; padding-top: 0; border-top: 0 }
.tt-dash .tt-engage { margin-top: 0; padding-top: 0; border-top: 0; grid-template-columns: repeat(3, minmax(0, 1fr)) }
.tt-video-pair { align-items: start }
.tt-dash .md-cuts td:first-child, .tt-dash .md-cuts th { white-space: nowrap }
.tt-dash .tt-engage .md-kpi-d:empty { display: none }
.tt-sub { display: block; margin-top: 2px; font-size: 11px; color: var(--tx-3) }
.tt-creative { display: flex; align-items: center; gap: 10px }
.tt-creative .meta-thumb { flex: none; width: 32px; height: 32px }
.tt-observe { grid-template-columns: repeat(3, minmax(0, 1fr)) }
.tt-observe dd { font-size: 12.5px; line-height: 1.45; color: var(--tx-2) }
.tt-video-trend { display: block }
@media (max-width: 1100px) {
  .tt-observe { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 700px) {
  .tt-dash .tt-engage { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .tt-observe { grid-template-columns: minmax(0, 1fr) }
}

/* OpenAI Ads redesign: a four-way chart switch, grouped events, the campaign filters. */
.md-switch-in:nth-of-type(4):checked ~ .md-switch-bar label:nth-child(4) { background: var(--s3); color: var(--tx) }
.md-switch-in:nth-of-type(4):focus-visible ~ .md-switch-bar label:nth-child(4) { outline: 2px solid var(--brand); outline-offset: 1px }
.md-switch .md-pane-3 { display: none }
.md-switch-in:nth-of-type(4):checked ~ .md-pane-0 { display: none }
.md-switch-in:nth-of-type(4):checked ~ .md-pane-3 { display: block }
.md-switch-bar { flex-wrap: wrap }
.md-filters .md-inline { margin: 0 }
.md-drill { color: var(--brand); text-decoration: none }
.md-drill:hover { text-decoration: underline }
.oa-group th { padding-top: 12px; font-size: 11.5px; font-weight: 600; color: var(--tx); text-align: left; background: var(--s2) }
.oa-dash .oa-funnel-figs { margin-top: 10px }
@media (max-width: 1100px) {
  .ads-charts { grid-template-columns: minmax(0, 1fr) }
}
@media (max-width: 700px) {
  .ads-split { grid-template-columns: minmax(0, 1fr) }
}

/* ------------------------------------------------------------------ *
 * Support
 *
 * Ticket statuses borrow the state colours for the meanings they already
 * carry — gold waiting on us, turquoise in motion, grey not ours, green done —
 * and coral only for overdue. Priority is text: urgent and high are the two
 * worth a glance, so only they carry a colour. Structure stays surface and
 * hairline; the one filled blue on a ticket is the next step.
 * ------------------------------------------------------------------ */
.sp-metric { display: block; text-decoration: none; color: inherit; min-width: 0 }
.sp-tw { overflow-x: auto }
.sp-link { text-decoration: none; color: var(--tx) }
.sp-link:hover .t-title { color: var(--brand); text-decoration: underline }
.sp-tbl .t-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center }
.sp-has { display: inline-flex; align-items: center; gap: 3px; color: var(--tx-3) }
.sp-badges { display: inline-flex; flex-wrap: wrap; gap: 4px }
.sp-tbl .sp-c-when, .sp-tbl .sp-c-pri { white-space: nowrap; color: var(--tx-2) }
.sp-none { color: var(--tx-3) }
.sp-pri { color: var(--tx-2) }
.sp-pri-high { color: var(--amber) }
.sp-pri-urgent { color: var(--red); font-weight: 600 }

.sp-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 12px 13px; border-bottom: 1px solid var(--hair); align-items: end }
.sp-filters .sp-f-q { grid-column: span 2 }
.sp-f-act { display: flex; gap: 8px; align-items: center }
.sp-pages { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 13px; border-top: 1px solid var(--hair); font-size: 11.5px; color: var(--tx-2) }

.sp-head { min-width: 0 }
.sp-head h1 { word-break: break-word }
.sp-head p { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center }
.sp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start }
.sp-main, .sp-side { display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.sp-desc { white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.6; max-width: 72ch; color: var(--tx) }
.sp-pad { padding: 12px 13px }

.sp-files { list-style: none; margin: 0; padding: 0 }
.sp-file { border-bottom: 1px solid var(--hair) }
.sp-file:last-child { border-bottom: none }
.sp-video { display: block; width: 100%; max-height: 70vh; background: var(--bg) }
.sp-img { display: block; max-width: 100%; max-height: 60vh; margin: 0 auto; background: var(--bg) }
.sp-file-bar { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 9px 13px; font-size: 12px }
.sp-file-bar svg.i { color: var(--tx-3); flex: none }
.sp-file-name { flex: 1 1 160px; min-width: 0; word-break: break-word }
.sp-file-name b { font-weight: 500; color: var(--tx-2) }

.sp-moves { display: flex; flex-wrap: wrap; gap: 6px }
.sp-inline { display: flex; gap: 8px; align-items: end; flex-wrap: wrap }
.sp-inline .field { flex: 1 1 150px; min-width: 0 }
.sp-inline .select { width: 100%; min-width: 0 }
.sp-dl { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 7px 12px; margin: 0; font-size: 12px }
.sp-dl dt { color: var(--tx-3); font-size: 11px; padding-top: 1px }
.sp-dl dd { margin: 0; word-break: break-word }
.sp-dl dd a { color: var(--brand) }
.sp-ua { font-size: 10.5px; color: var(--tx-3) }

.sp-note-form { padding: 12px 13px; border-bottom: 1px solid var(--hair) }
.sp-note { min-height: 84px }
.sp-hist { list-style: none; margin: 0; padding: 0 }
.sp-hist li { padding: 10px 13px; border-bottom: 1px solid var(--hair) }
.sp-hist li:last-child { border-bottom: none }
.sp-hist-h { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 12px }
.sp-hist-h b { font-weight: 500 }
.sp-hist-h span { font-size: 10.5px; color: var(--tx-3) }
.sp-hist-h .sp-hist-d { font-size: 12px; color: var(--tx-2) }
.sp-hist-n { margin-top: 5px; font-size: 12px; color: var(--tx-2); white-space: pre-wrap; word-break: break-word; max-width: 72ch }
.sp-hist-bad .sp-hist-h b { color: var(--red) }
.sp-targets { max-width: 360px }

@media (max-width: 1100px) {
  .sp-grid { grid-template-columns: minmax(0, 1fr) }
  /* On one column the actions come first, not after the whole history. */
  .sp-side { order: -1 }
}
@media (max-width: 700px) {
  .sp-tbl .sp-c-who, .sp-tbl .sp-c-pri { display: none }
  .sp-tbl td, .sp-tbl th { padding-left: 9px; padding-right: 9px }
  .sp-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) }
  .sp-filters .sp-f-q, .sp-f-act { grid-column: 1 / -1 }
}

/* ------------------------------------------------------------------ *
 * Referrals
 *
 * Built from the pipeline and support pieces (pl-stage, pl-prog, pl-steps,
 * sp-filters). What is new: the link field, the board's "you are here" row,
 * and the public landing card. The row uses --brand because that is what the
 * brand blue is for when it is read rather than pressed.
 * ------------------------------------------------------------------ */
.rf-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.rf-link { display: flex; gap: 8px; align-items: center; margin-bottom: 10px }
.rf-link .input { flex: 1 1 auto; min-width: 0; font-size: 12.5px }
.rf-share { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px }
.rf-steps { margin: 0; padding: 12px 0 0 18px; border-top: 1px solid var(--hair); display: grid; gap: 7px; font-size: 12px; color: var(--tx-2); line-height: 1.55 }
.rf-steps b { color: var(--tx); font-weight: 500 }
.rf-pos { margin-bottom: 10px; font-size: 12px; color: var(--tx-2) }
.rf-gap { text-align: center; color: var(--tx-3); padding: 2px 0; border-top: 1px solid var(--hair) }
.rf-board .rf-rank { width: 64px }
.rf-board td.rf-rank { font-size: 14px; color: var(--tx-2) }
:where(.rf-board, .rf-co) th.num, :where(.rf-board, .rf-co) td.num { text-align: right }
.rf-board tr.rf-mine td { background: var(--brand-dim) }
.rf-board tr.rf-mine td.rf-rank { color: var(--brand) }
.rf-you, .rf-top {
  margin-left: 8px; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 20px; padding: 1px 7px; color: var(--tx-2); white-space: nowrap;
}
.rf-you { border-color: var(--brand); color: var(--brand) }
.rf-defs { grid-template-columns: 170px minmax(0, 1fr) }
.rf-code { font-size: 11px; word-break: break-all }
.rf-who { white-space: nowrap }
.rf-copy { margin-left: 8px }
.rf-co td { vertical-align: top }
.rf-lb { display: flex; gap: 6px; align-items: center; flex-wrap: wrap }
.rf-lb .input { width: 180px; flex: 0 1 180px; padding: 5px 8px }
.rf-check { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--tx-2); white-space: nowrap }
.rf-check input { accent-color: var(--brand) }
.rf-checks { list-style: none; margin: 0 0 14px; padding: 0 }
.rf-checks .mono { font-size: 11px; word-break: break-all; color: var(--tx-2) }
.rf-hook .input { font-size: 11.5px }
.rf-note { margin-top: 10px }

.rf-land { max-width: 440px }
.rf-land .panel { padding: 22px }
.rf-land h1 { font-size: 26px; margin: 4px 0 10px }
.rf-eyebrow { font-family: 'Space Mono', ui-monospace, monospace; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand) }
.rf-lede { font-size: 13.5px; line-height: 1.6; color: var(--tx-2); margin-bottom: 18px }
.rf-cta { width: 100%; justify-content: center; height: 40px; font-size: 11.5px }

@media (max-width: 900px) {
  .rf-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 700px) {
  .rf-c-prog, .rf-c-upd, .rf-top { display: none }
  .rf-link { flex-wrap: wrap }
  .rf-link .btn { width: 100%; justify-content: center }
  .rf-defs { grid-template-columns: minmax(0, 1fr) }
  .rf-lb .input { flex: 1 1 100% ; width: auto }
}

/* ------------------------------------------------------------------ */
/* accounts receivable                                                 */
/* Everything here is layout on the existing tokens. The only colour on */
/* data is meaning: past due coral, a credit balance green.             */
/* ------------------------------------------------------------------ */
.ar-tabs { flex-wrap: wrap; margin-bottom: 12px }
.ar-subtabs { flex-wrap: wrap; margin: 4px 0 12px }
.ar-buckets { flex-wrap: wrap; padding: 10px 13px; border-bottom: 1px solid var(--hair) }
.ar-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.ar-metrics .m-d { flex-wrap: wrap }
.ar-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px }
.ar-charts .panel { margin-bottom: 0 }
.ar-bar-muted { fill: var(--tx-3) }
.ar-range { border-bottom: none }
.ar-range-note { grid-column: 1 / -1 }
.ar-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px }
.ar-form-grid .ar-wide { grid-column: 1 / -1 }
.ar-form-grid .form-act { grid-column: 1 / -1 }
.ar-textarea { min-height: 72px }
.ar-check { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; cursor: pointer }
.ar-check input { accent-color: var(--brand); width: 14px; height: 14px; margin-top: 2px; flex: none }
.ar-check b { display: block; font-weight: 500 }
.ar-check span span { display: block; font-size: 10.5px; color: var(--tx-3) }
.ar-bal { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px }
.ar-credit { color: var(--green) }
.ar-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: -6px 0 12px }
.ar-meta .ar-bal { flex-direction: row; align-items: center }
.ar-tbl td.num, .ar-tbl th.num, .tbl td.num, .tbl th.num { text-align: right; white-space: nowrap }
.ar-clients td:first-child { min-width: 180px }
.ar-import-go { padding: 12px 16px; border-top: 1px solid var(--line) }
.ar-tbl .t-sub { overflow-wrap: anywhere }
.ar-struck td { color: var(--tx-3) }
.ar-struck td.num { text-decoration: line-through }
.ar-older td { color: var(--tx-3) }
.ar-subrow td { padding-top: 0; border-bottom: 1px solid var(--hair) }
.ar-empty { color: var(--tx-3); text-align: center; padding: 20px 12px !important }
.ar-dl { grid-template-columns: 130px minmax(0, 1fr) }
.ar-defs { grid-template-columns: 170px minmax(0, 1fr); font-size: 12px; line-height: 1.55 }
.ar-how > summary { cursor: pointer; list-style: none }
.ar-how > summary::-webkit-details-marker { display: none }
.ar-details > summary { cursor: pointer; font-size: 11.5px; color: var(--brand); padding: 4px 0 }
.ar-details[open] > summary { margin-bottom: 8px }
.ar-inline-form { padding: 4px 0 12px; border-bottom: 1px solid var(--hair); margin-bottom: 8px }
.ar-reverse form { min-width: 220px; padding: 8px 0 }
.ar-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0 }
.ar-list { margin: 0; padding-left: 18px; font-size: 12.5px; display: grid; gap: 4px }
.ar-list a, .ar-dl a { color: var(--brand) }
.ar-notes { list-style: none; margin: 0; padding: 0 }
.ar-notes > li { padding: 12px 13px; border-bottom: 1px solid var(--hair) }
.ar-notes > li:last-child { border-bottom: none }
.ar-note-h { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 6px }
.ar-owner-filter { display: flex; gap: 6px; align-items: center }
.ar-owner-filter .select { height: 25px; font-size: 11px; padding: 0 8px }
.ar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: end }
.ar-callout { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; margin-bottom: 12px; background: var(--s2) }
.ar-num { width: 72px }
.ar-pad { padding: 10px 13px }
@media (max-width: 1100px) {
  .ar-charts { grid-template-columns: minmax(0, 1fr) }
}
@media (max-width: 700px) {
  .ar-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .ar-dl, .ar-defs { grid-template-columns: minmax(0, 1fr) }
  .ar-dl dt, .ar-defs dt { padding-top: 6px }
  .ar-form-grid { grid-template-columns: minmax(0, 1fr) }
}
.ar-axis { text-anchor: end }
.ar-bar-neg { fill: var(--red) }
@media (max-width: 560px) {
  .ar-metrics { grid-template-columns: minmax(0, 1fr) }
  .ar-metrics .m-n { white-space: nowrap }
}

/* ------------------------------------------------------------------ *
 * Phones (700px and narrower)
 *
 * The rail is already a drawer below 1024px. Here the top bar keeps the menu,
 * the logo, a search button, the avatar and sign-out. Wide tables scroll
 * sideways inside their own panel, so the page itself never does.
 * ------------------------------------------------------------------ */
@media (max-width: 700px) {
  .top { gap: 6px; padding: 0 8px }
  .brand { padding-right: 8px; border-right: 0 }
  .brand-logo { height: 22px; max-width: 120px }
  .me-tx, .search { display: none }
  .search-link { display: grid; margin-left: auto }
  .me { padding: 3px; margin-left: 0 }

  /* 16px in every field: iOS Safari zooms the page into any field set smaller
     than that the moment it gets focus, and leaves it zoomed. */
  .input, .textarea, .select { font-size: 16px }

  /* Sign-in, forgot and reset. The card sits in the upper third, where the
     keyboard does not cover it, and everything you tap is at least 44px. */
  .auth { align-items: start; padding: 14vh 16px 24px }
  .auth-card { max-width: 420px }
  .auth .input { min-height: 44px }
  .auth .btn { min-height: 44px; font-size: 12px }
  .auth .pw .input { padding-right: 48px }
  .auth .pw-eye { width: 40px; height: 40px; right: 2px }
  .auth-note { font-size: 12px }
  .auth-note a { display: inline-block; padding: 12px 0 }

  /* A calendar day is about 46px wide here: dot, initials and their gaps
     only fit once the padding gives way. */
  .cal-day { padding: 4px 3px }
  .cal-ev { gap: 3px; padding: 3px; justify-content: center }
  .cal-ev .who { letter-spacing: 0 }
  .cal-more { padding-left: 2px; font-size: 9.5px }

  .work { padding: 14px 12px 32px }
  .head { gap: 10px; margin-bottom: 12px }
  /* !important because some screens set their column count inline (Reporting
     asks for four); on a phone two is the most that leaves a label readable. */
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important }
  .p-head { flex-wrap: wrap; gap: 8px }
  .head-act { max-width: 100%; flex-wrap: wrap }
  .pl-views, .form-act { flex-wrap: wrap }

  /* Whatever holds a table scrolls it — a panel, its body, or one of the
     modules' own wrappers — and the table takes the width its content wants
     (up to a limit, past which long text wraps) instead of being squeezed to
     a word per line. */
  :has(> .tbl) { overflow-x: auto; -webkit-overflow-scrolling: touch }
  .tbl { width: max-content; min-width: 100%; max-width: 860px }

  /* A run's companies are three short cells with a button at the end, the
     button being the point. Stacked — company on one line, state and action
     under it — every action is in reach without scrolling sideways. */
  .dist thead { display: none }
  .dist, .dist tbody { display: block; width: 100% }
  .dist tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 9px 2px; border-bottom: 1px solid var(--hair) }
  .dist tr:last-child { border-bottom: none }
  .dist td, .dist tr:last-child td { display: block; padding: 0; border: 0 }
  .dist td:first-child { flex: 1 0 100% }
  .dist td:last-child { margin-left: auto }
}

/* BI: what to check before reading the figures, and linking from the overview */
.bi-checks li { line-height: 1.6 }
.bi-checks .badge { margin-right: 6px }
.bi-link-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px }
.bi-link-row .select { min-width: 220px }
@media (max-width: 700px) {
  .bi-link-row form { width: 100% }
  .bi-link-row .select { flex: 1; min-width: 0 }
}

/* ------------------------------------------------------------------ */
/* Account management (/accounts, /onboarding/oem)                     */
/* Structure is surface and hairline; a chip is a label, not a state, */
/* so it wears none of the accent colours. Only done-ness is green.    */
/* ------------------------------------------------------------------ */
.am-chip {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--s2); color: var(--tx-2); font-size: 10.5px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.am-dim { color: var(--tx-3) }
.am-empty { color: var(--tx-3); padding: 16px 13px; font-size: 12.5px; margin: 0 }
.am-note { color: var(--tx-3); font-size: 11.5px; line-height: 1.55; margin: -4px 0 14px }
.p-body.am-note { margin: 0 }
.am-src { display: block; color: var(--tx-3); font-size: 10px; letter-spacing: .02em; margin-top: 2px; font-weight: 400; text-transform: none }
.am-req { color: var(--tx-3); font-weight: 400; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; margin-left: 4px }
.am-callout { margin-bottom: 14px; font-size: 12.5px; line-height: 1.55 }
.am-callout a, .am-note a, .am-empty a, .am-links a, .am-crumb a { color: var(--brand) }
.am-warn { border: 1px solid var(--amber); border-radius: var(--r-sm); padding: 8px 10px; margin: 10px 0 0; font-size: 12px; background: var(--s2) }
.am-warn-tx { color: var(--amber) }
.am-ml { margin-left: 6px }
.am-pad { padding: 10px 13px }
.am-line { display: block }
.am-break { word-break: break-all }
.am-right { margin-left: auto }
.am-grow { flex: 1; min-width: 0 }
.am-long { min-width: 220px; max-width: 420px; white-space: pre-wrap; word-break: break-word; font-size: 11.5px; line-height: 1.5 }
.am-services { max-width: 220px; font-size: 11.5px; color: var(--tx-2) }
.am-crumb { font-size: 11px; color: var(--tx-3); margin: 0 0 8px }
.am-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: 12px }
.am-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)) }
.am-metrics-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.am-metrics .m-d { flex-wrap: wrap }
.am-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px }
.am-grid .panel { margin-bottom: 0 }
.am-bars .chart-row-name { width: 170px; flex: 0 1 170px; min-width: 88px }
.am-bars .chart-row-track { min-width: 40px }
.am-bars .chart-row-name a { color: var(--tx) }
/* Sized to what it holds: "1 · $11,640 ACV" was clipped at the base 34px. */
.am-bars .chart-row-n { width: auto; min-width: 34px; text-align: right; white-space: nowrap }
.am-bar { background: var(--line-2) }
.am-sublabel { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--tx-3); margin: 14px 0 8px; font-weight: 600 }
.am-pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 10px 13px; border-top: 1px solid var(--hair); font-size: 11.5px }
.am-tbl td { vertical-align: top }
.am-tbl-s td { font-size: 11.5px }

.am-search { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; max-width: 560px }
.am-search .input { flex: 1; min-width: 0 }
.am-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-bottom: 12px }
.am-card {
  display: flex; flex-direction: column; gap: 10px; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--paper); color: inherit; text-decoration: none; min-width: 0; transition: border-color .15s ease;
}
.am-card:hover, .am-card:focus-visible { border-color: var(--brand) }
.am-card-h { display: flex; gap: 10px; align-items: center; min-width: 0 }
.am-card-n { min-width: 0; display: flex; flex-direction: column }
.am-card-n b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.am-card-n span { font-size: 10.5px; color: var(--tx-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.am-card-tags { display: flex; flex-wrap: wrap; gap: 5px }
.am-card-m { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--tx-2); border-top: 1px solid var(--hair); padding-top: 8px }
.am-logo {
  flex: none; width: 34px; height: 34px; border-radius: var(--r); border: 1px solid var(--line); background: var(--s2);
  display: grid; place-items: center; overflow: hidden; font-family: 'Space Mono', monospace; font-size: 11px; color: var(--tx-2)
}
.am-logo img { width: 100%; height: 100%; object-fit: contain; background: var(--s3) }
.am-logo-lg { width: 56px; height: 56px; font-size: 16px }

.am-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); margin-bottom: 12px }
.am-hero-id { display: flex; gap: 14px; align-items: center; min-width: 0 }
.am-hero-id h1 { margin: 2px 0 6px }
.am-hero-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 0 }
.am-hero-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; justify-content: flex-end }
.am-hero-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; margin: 0; padding-top: 12px; border-top: 1px solid var(--hair) }
.am-hero-facts dt { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--tx-3); font-weight: 600; margin-bottom: 3px }
.am-hero-facts dd { margin: 0; font-size: 12.5px; min-width: 0; word-break: break-word }
.am-hero-facts dd a { color: var(--brand) }
.am-ids { display: flex; flex-direction: column; gap: 1px; font-size: 10.5px; color: var(--tx-2) }
.am-more { position: relative }
.am-more > summary { list-style: none; cursor: pointer }
.am-more > summary::-webkit-details-marker { display: none }
.am-more-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 220px; display: flex; flex-direction: column;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--s3); padding: 4px
}
.am-more-menu a { padding: 7px 10px; border-radius: var(--r-sm); color: var(--tx); font-size: 12px; text-decoration: none }
.am-more-menu a:hover, .am-more-menu a:focus-visible { background: var(--s2) }

.am-fin { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--hair); border: 1px solid var(--hair); border-radius: var(--r-sm); overflow: hidden }
.am-fig { background: var(--paper); padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0 }
.am-fig-wide { grid-column: span 3 }
.am-fig-l { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--tx-3); font-weight: 600 }
.am-fig b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums }
.am-dl { grid-template-columns: 140px minmax(0, 1fr) }
.am-dl dt .am-src { display: inline; margin: 0 0 0 4px; text-transform: uppercase; letter-spacing: .08em; font-size: 9px }
.am-tags { display: flex; flex-wrap: wrap; gap: 6px }
.am-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 13px; border-top: 1px solid var(--hair); font-size: 11.5px }
.am-inline .input { width: auto; flex: 1; min-width: 140px; height: 28px }
.am-check-inline { margin: 0; padding: 0; border: 0; background: none }
.am-link-form { display: flex; gap: 6px; align-items: center; min-width: 220px }
.am-link-form .select { flex: 1; min-width: 0; height: 28px; font-size: 11.5px }

.am-progress { height: 6px; border-radius: 3px; background: var(--s3); overflow: hidden; margin: 2px 0 8px }
.am-progress span { display: block; height: 100%; background: var(--green) }
.am-progress-s { width: 70px; margin: 0 }
.am-prog { display: inline-flex; gap: 8px; align-items: center; font-size: 11px }
.am-checklist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px }
.am-group { border: 1px solid var(--hair); border-radius: var(--r-sm) }
.am-group > summary { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; cursor: pointer; font-size: 12px }
.am-group > summary b { font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-size: 11px }
.am-group ul { list-style: none; margin: 0; padding: 0 10px 8px }
.am-group li { display: grid; grid-template-columns: 16px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 5px 0; border-top: 1px solid var(--hair); font-size: 11.5px }
.am-ci { color: var(--tx-3); text-align: center }
.am-done .am-ci { color: var(--green) }
.am-cv { color: var(--tx-2); word-break: break-word }
.am-cv a { color: var(--brand) }
.am-who { font-size: 10px; color: var(--tx-3); white-space: nowrap }

.am-note-row { display: flex; gap: 10px; align-items: flex-start }
.am-note-row .field:first-child { width: 140px; flex: none }
.am-versions > li { padding: 8px 0 }
.am-feed .feed { padding: 6px }

.am-bigform .panel { margin-bottom: 12px }
.am-fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0 }
.am-fieldset legend { font-family: 'Anton', Impact, sans-serif; text-transform: uppercase; letter-spacing: .04em; font-size: 15px; margin-bottom: 8px; padding: 0 }
.am-legend-sub { margin: -4px 0 10px }
.am-bigform .input[readonly] { color: var(--tx-3) }

@media (max-width: 1240px) {
  .am-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .am-hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 900px) {
  .am-grid { grid-template-columns: minmax(0, 1fr) }
}
@media (max-width: 700px) {
  .am-metrics, .am-metrics-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .am-hero { grid-template-columns: minmax(0, 1fr); padding: 12px }
  .am-hero-act { justify-content: flex-start }
  .am-hero-facts { grid-template-columns: minmax(0, 1fr) }
  .am-dl { grid-template-columns: 110px minmax(0, 1fr) }
  .am-fig-wide { grid-column: span 2 }
  .am-bars .chart-row-name { width: 110px }
  .am-group li { grid-template-columns: 16px minmax(0, 1fr); }
  .am-group li .am-cv, .am-group li .am-who { grid-column: 2 }
  .am-note-row { flex-direction: column; align-items: stretch }
  .am-note-row .field:first-child { width: auto }
  .am-more-menu { right: auto; left: 0 }
}
/* A profile leads with its figures on a narrow screen; support's tickets lead with their facts instead. */
@media (max-width: 1100px) { .am-pgrid .sp-side { order: 0 } }
