/* Marketing Engine web app (iJen layout, 28-09-2026; iJen theme 06-10-2026).
   Structure follows the IJEN workspace: a narrow icon rail (an icon above a
   small label for every section, Inbox first), a context column whose lists
   belong to the section you are in (chats in Jen, agent groups in Team,
   sections in Brain, file types in Files, the settings menu in Settings) with
   status lines at its foot, and a calm content column. Chat is IJEN's three
   panes: history in the context column, the conversation, and a Files panel.
   02-11-2026 (owner decision): the app wears the iJen AI Audit skin (ijen.ai,
   public/site.css in the ijen-audit repo) so every iJen surface reads as one
   product. Dark (the default): warm charcoal #171615 page, cards in a 4%
   cream wash with hairline borders, 20px radius and a deep soft shadow, cream
   #F4F4ED headings, #D8D7CF body text, one lime accent #CCF70A, and a faint
   lime ambient light behind the page. Light follows the audit's .theme-light
   (cream page, white cards, deep olive #5A7300 accent). Type: the system SF
   Pro first then Inter Tight for text and headings, Geist Mono for eyebrows,
   labels and badges, Doto for display numbers. Pill buttons: cream primary,
   lime for the one main action (.btn.accent), a hairline ghost for the rest.
   The frame (rail, phone header and tab bar) sits on the page colour with a
   hairline edge, like the audit's top bar. One brand accent (--accent) drives
   the primary action; EngineTheme.setAccent in icons.js derives its text
   shade, soft tint and hover from one hex.
   Below 768px the rail becomes a bottom tab bar and tables fold into rows. */

/* ------------------------------------------------------------ tokens */
/* Contrast (WCAG 2.1, checked 02-11-2026): dark text #D8D7CF on the page
   #171615 12.5:1 and on the hover fill #2A2826 10.2:1, muted #9B9990 5.1:1 or
   better, faint #95928A 4.6:1 or better, cream buttons carry #171615 at
   16.4:1, lime #CCF70A carries #2A2725 at 12.6:1. Light: text #3A3633 on
   #F4F4ED 10.8:1, muted #6E6A63 4.6:1 or better, olive #5A7300 4.6:1. */
:root {
  /* the frame: rail, phone header and tab bar. Light: white with a hairline, as the audit's light top bar. */
  --frame-bg: #FFFFFF;
  --frame-ink: #2A2725;
  --frame-muted: #6E6A63;
  --frame-hover: #F1F0E9;
  --frame-active: #E8E7DF;
  --frame-line: #E2E1D8;
  --frame-mark: #5A7300;
  --on-frame-mark: #FFFFFF;

  /* brand accent: the one value a brand overrides (the audit's primary button: charcoal in light, cream in dark) */
  --accent: #2A2725;
  --accent-hover: #000000;
  --on-accent: #FFFFFF;
  --accent-ink-light: #5A7300;
  --accent-soft-light: #EEF5D2;
  --accent-ink-dark: #CCF70A;
  --accent-soft-dark: #33361C;
  --accent-ink: var(--accent-ink-light);
  --accent-soft: var(--accent-soft-light);
  --mark-a: #2A2725;
  --mark-b: #8D8A83;
  /* the audit's lime: the one main action, markers, progress */
  --lime: #5A7300;
  --lime-hover: #4A5F00;
  --on-lime: #FFFFFF;

  /* warm greys */
  --g025: #FAFAF5; --g050: #F1F0E9; --g075: #ECEBE3; --g100: #E7E5DF; --g150: #DDDBD4;
  --g200: #CBC9BE; --g500: #8D8A83; --g700: #5C5954; --g1100: #1F1D1B;

  /* surfaces */
  --page: #F4F4ED;
  --surface: #FFFFFF;
  --card: #FFFFFF;
  --rail-bg: var(--frame-bg);
  --rail-hover: var(--frame-hover);
  --rail-active: var(--frame-active);
  --panel-bg: #FAFAF5;
  --well: #FAFAF5;
  --btn-2: #FFFFFF;
  --btn-2-hover: #F1F0E9;
  --hover: #EFEEE7;
  --active: #E8E7DF;
  --field: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.85);
  --blur: saturate(1.6) blur(20px);

  /* ink: --ink is the audit's --fg (headings), --text its --ink (body) */
  --ink: #2A2725;
  --text: #3A3633;
  --muted: #6E6A63;
  --faint: #6E6A63;

  /* lines */
  --line: #E2E1D8;
  --line-soft: #EBEAE2;
  --line-strong: #CBC9BE;
  --focus: #5A7300;

  /* shadows: --shadow-card is the audit's card shadow */
  --shadow-1: 0 1px 2px rgba(11, 13, 21, 0.05);
  --shadow-2: 0 1px 2px rgba(11, 13, 21, 0.05), 0 10px 30px rgba(11, 13, 21, 0.07);
  --shadow-3: 0 2px 6px rgba(11, 13, 21, 0.08), 0 18px 44px rgba(11, 13, 21, 0.12);
  --shadow-card: var(--shadow-2);

  /* semantic */
  --ok: #0B7A50; --ok-bg: #E3F3EA;
  --bad: #B91C1C; --bad-bg: #FCE8E6;
  --warn: #9A4A06; --warn-bg: #FDF0DC;
  --info: var(--accent-ink); --info-bg: var(--accent-soft);
  --idle: #5C5954; --idle-bg: #ECEBE3;
  --live: #0F8A5F;

  /* shape: cards 20px as the audit, fields 14px, pills 999px */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 16px;
  --r-xl: 24px;
  --radius: 20px;
  --rail: 60px;
  --panel-w: 240px;
  --files-w: 300px;
  --tabbar: 62px;
  --gutter: 16px;

  /* type (the audit's stacks): system SF Pro first, then Inter Tight */
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter Tight", "Segoe UI", sans-serif;
  --head: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter Tight", "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --dot: "Doto", "Geist Mono", ui-monospace, monospace;
  --fs-xs: 12.5px;
  --fs-sm: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 22px;
  --fs-2xl: 30px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  /* the frame sits on the page colour with a hairline edge (the audit's top bar) */
  --frame-bg: #171615;
  --frame-ink: #F4F4ED;
  --frame-muted: #9B9990;
  --frame-hover: #2A2826;
  --frame-active: #312F2C;
  --frame-line: rgba(244, 244, 237, 0.09);
  --frame-mark: #CCF70A;
  --on-frame-mark: #2A2725;
  /* primary actions: cream with charcoal text (the audit's .btn-primary) */
  --accent: #F4F4ED;
  --accent-hover: #FFFFFF;
  --on-accent: #171615;
  --accent-ink: var(--accent-ink-dark);
  --accent-soft: var(--accent-soft-dark);
  --mark-a: #F4F4ED;
  --mark-b: #8D8A83;
  --lime: #CCF70A;
  --lime-hover: #D9FF3D;
  --on-lime: #2A2725;
  --page: #171615;
  --surface: #22201E;
  --card: rgba(244, 244, 237, 0.04);
  --panel-bg: #1B1A18;
  --well: #1C1B19;
  --btn-2: rgba(255, 255, 255, 0.06);
  --btn-2-hover: rgba(255, 255, 255, 0.11);
  --hover: #2A2826;
  --active: #312F2C;
  --field: rgba(255, 255, 255, 0.04);
  --glass: rgba(34, 32, 30, 0.94);
  --ink: #F4F4ED;
  --text: #D8D7CF;
  --muted: #9B9990;
  --faint: #95928A;
  --line: rgba(244, 244, 237, 0.09);
  --line-soft: rgba(244, 244, 237, 0.06);
  --line-strong: rgba(244, 244, 237, 0.16);
  --focus: #CCF70A;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 20px 50px rgba(0, 0, 0, 0.35);
  --shadow-3: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-card: var(--shadow-2);
  --ok: #7EE0A1; --ok-bg: #2B332B;
  --bad: #FF8A7A; --bad-bg: #382B27;
  --warn: #F2C063; --warn-bg: #373025;
  --idle: #B5B2AA; --idle-bg: #312F2C;
  --live: #7EE0A1;
}

/* ------------------------------------------------------------ base */
* { box-sizing: border-box; }
/* 07-10-2026: overflow-x clip, not hidden: hidden on html and body makes body
   a scroll container, so the sticky rail and panel scrolled away and left a
   light gap. clip cuts sideways overflow without creating one. hidden stays
   only for browsers without clip. */
html { -webkit-text-size-adjust: 100%; }
@supports not (overflow-x: clip) { html, body { overflow-x: hidden; } }
html, body { overflow-x: clip; }
body {
  margin: 0; background: var(--page); color: var(--text); font-family: var(--body); font-size: var(--fs-md); line-height: 1.55;
  min-height: 100vh; min-height: 100dvh; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* 02-11-2026: the audit's heading style (display face, tight tracking, balanced lines), sized for an app. */
h1, h2, h3, h4 { font-family: var(--head); color: var(--ink); margin: 0 0 8px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.035em; line-height: 1.06; }
h2 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.03em; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
/* Text links carry an underline; the link colour is the audit's lime (deep olive in light). */
a:not([class]), a.small, a.card-link, .login-alt a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.muted { color: var(--muted); }
/* 02-11-2026: the audit's eyebrow, Geist Mono in capitals with wide tracking. */
.eyebrow { font: 500 12px/1.3 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
@media (max-width: 480px) { .eyebrow { letter-spacing: 0.1em; font-size: 11px; } }
.error { color: var(--bad); font-size: var(--fs-sm); }
.ok-text { color: var(--ok); font-size: var(--fs-sm); }
.key-row { padding: 12px 0; border-top: 1px solid var(--line); }
.key-row .row > input { flex: 1 1 220px; min-width: 0; width: auto; }
.small { font-size: var(--fs-sm); }
.mono { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ line icons and tiles (public/icons.js, IJEN style) */
/* 20x20 outline glyphs, stroke 1.6, round caps; they take the text colour. */
.ic { display: inline-flex; width: var(--icon, var(--icon-default, 20px)); height: var(--icon, var(--icon-default, 20px)); flex: none; }
.ic svg { width: 100%; height: 100%; display: block; overflow: visible; }
/* IJEN department tile: a small rounded square in one tone (--tile-color, set
   per tile by app.js) with a white glyph. Colour lives only in the tile. */
.tile {
  --tile: 34px; display: inline-grid; place-items: center; width: var(--tile); height: var(--tile); flex: none;
  border-radius: var(--tile-r, 9px); background: var(--tile-color, var(--g500)); color: #fff;
}
/* 02-11-2026: on the audit skin the tiles drop their department colours for
   the audit's one palette: a cream wash with a hairline and a cream glyph, so
   lime stays the only colour on the page. --tile-color is still set per tile
   by app.js and is simply not used here. */
.tile { background: color-mix(in srgb, var(--ink) 7%, transparent); border: 1px solid var(--line-strong); color: var(--ink); }
.tile > .ic { --icon: calc(var(--tile) * 0.54); }
.tile.xs { --tile: 22px; --tile-r: 6px; }
.tile.xs > .ic { --icon: 13px; }
.tile.sm { --tile: 28px; --tile-r: 8px; }
.tile.sm > .ic { --icon: 15px; }
.tile.lg { --tile: 40px; --tile-r: 10px; }
.tile.xl { --tile: 56px; --tile-r: 14px; }

/* ------------------------------------------------------------ shell */
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* iJen logo (06-10-2026, v2 lime #CCF70A). The frame (rail, phone header) is
   charcoal in both themes, so it always shows the dark lockup (off-white with
   the lime dots) as a single file. The sign-in page sits on the content ground,
   so it carries a light and a dark file and the one for the active theme shows
   (data-theme, set by icons.js before first paint). Clear space is one dot
   width; the lockup is never under 96px wide (36px tall). */
.logo { display: inline-flex; align-items: center; flex: none; line-height: 0; }
.logo img { display: block; height: 100%; width: auto; }
.logo .logo-dark { display: none; }
:root[data-theme="dark"] .logo .logo-light { display: none; }
:root[data-theme="dark"] .logo .logo-dark { display: block; }
.logo.lockup { height: 36px; min-width: 96px; }
.logo.symbol { width: 30px; height: 30px; }
.brand .logo { overflow: visible; }
.brand .brand-sep { color: var(--faint); font-weight: 500; }
.brand .ws-inline { font-weight: 500; color: var(--muted); }
.top { display: none; }
/* The frame (06-10-2026): charcoal in both themes, off-white text, lime only as a marker. */
.top, .rail .rail-foot, .tab-primary { color: var(--frame-ink); }
.top .brand { color: var(--frame-ink); }
.top .brand .brand-sep, .top .brand .ws-inline { color: var(--frame-muted); }
.top .avatar-btn, .rail-foot .avatar-btn { background: var(--frame-ink); color: var(--frame-bg); }
.top .avatar-btn:focus-visible, .rail :focus-visible, .tab-primary :focus-visible, .panel-head :focus-visible { outline-color: var(--frame-ink); }
.tab-primary .count, .rail .count { background: var(--frame-mark); color: var(--on-frame-mark); }
.count {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-size: 10.5px; font-weight: 700; text-align: center; line-height: 18px; font-variant-numeric: tabular-nums;
}
.tabs a, .tab-more {
  display: flex; align-items: center; text-decoration: none; color: var(--muted); font-weight: 600;
  border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.tabs a:hover { text-decoration: none; }
.tabs a.active, .tab-more.active { color: var(--ink); }
.tab-label { white-space: nowrap; }
.scrim { position: fixed; inset: 0; z-index: 29; background: rgba(17, 17, 18, 0.18); }

.avatar-btn {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font: 600 13px/1 var(--body); transition: filter 120ms ease;
}
.avatar-btn:hover { filter: brightness(0.94); }

/* Account menu: a floating popover (glass is allowed here, it floats). */
.account-menu {
  position: fixed; z-index: 60; width: 240px; display: flex; flex-direction: column; gap: 2px; padding: 8px;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); animation: rise 140ms var(--ease);
}
.account-menu .who { display: block; font-size: var(--fs-xs); color: var(--muted); padding: 4px 8px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; background: none; border: 0;
  border-radius: var(--r-sm); padding: 9px 8px; font: 500 13.5px/1.3 var(--body); color: var(--ink); cursor: pointer;
}
.menu-item:hover { background: var(--hover); }
.menu-item svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.menu-item.is-signout { color: var(--bad); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

/* 02-11-2026: the audit's ambient light (ijen.ai .ambient): a faint lime and
   cream glow drifting behind the page, never behind long text (cards are
   solid enough to read on). Dark theme only, as on the audit. */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; display: none; }
:root[data-theme="dark"] .ambient { display: block; }
.ambient::before, .ambient::after { content: ""; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(90px); opacity: 0.06; }
.ambient::before { left: -25vmax; top: -35vmax; background: #CCF70A; animation: drift 26s ease-in-out infinite alternate; }
.ambient::after { right: -30vmax; top: 10vh; background: #F4F4ED; opacity: 0.04; animation: drift 32s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.1); } }

/* ------------------------------------------------------------ layout */
.view { padding: 12px var(--gutter) 40px; width: 100%; min-width: 0; }
#content { max-width: 1060px; margin: 0 auto; min-width: 0; }
/* 02-11-2026: the audit's card: a 4% cream wash, hairline border, 20px radius, deep soft shadow, blurred backdrop. */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-card); margin-bottom: 14px; min-width: 0;
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.card.clickable { cursor: pointer; transition: box-shadow 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease); }
.card.clickable:hover { box-shadow: var(--shadow-3); border-color: var(--line-strong); transform: translateY(-1px); }
.card.clickable:active { transform: translateY(0); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 12px; }
.stack > * { margin-bottom: 0; }
.head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-head > div { min-width: 0; }
.page-head h1 { margin: 0; overflow-wrap: anywhere; }
.page-lead { max-width: 62ch; color: var(--muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select { flex: 1 1 160px; width: auto; }
.empty { color: var(--muted); padding: 40px 16px; text-align: center; }
.empty .tile { margin: 0 auto 14px; }
.empty p { max-width: 44ch; margin: 0 auto; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); text-decoration: none; margin-bottom: 14px; }
.back::before { content: ''; width: 7px; height: 7px; border-left: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); margin-right: 2px; }
.back:hover { color: var(--ink); text-decoration: none; }
.section-title { margin-top: 28px; }
.card-link { font: 600 13.5px/1 var(--body); color: var(--accent-ink); }
.card-link::after { content: ' \2192'; opacity: 0.7; }

/* ------------------------------------------------------------ controls */
/* 02-11-2026: the audit's buttons. Every button is a pill. The default is the
   audit's ghost (a light wash with a hairline), .primary its cream button
   (charcoal in light), .accent its lime "one main action", .danger a soft red. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  border: 1px solid var(--line-strong); background: var(--btn-2); color: var(--ink);
  padding: 9px 18px; border-radius: 999px; font: 600 14px/1.2 var(--body); letter-spacing: -0.01em;
  cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s, box-shadow 0.3s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--btn-2-hover); text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(0.96); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.accent { background: var(--lime); color: var(--on-lime); border-color: transparent; }
.btn.accent:hover { background: var(--lime-hover); }
.btn.danger { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.btn.danger:hover { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.small { min-height: 34px; padding: 7px 14px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn.round { width: 40px; height: 40px; min-height: 40px; padding: 0; flex: none; }
.btn.round svg { width: 18px; height: 18px; }

label { display: block; font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 14px; }
label > input, label > select, label > textarea { margin-top: 7px; font-weight: 400; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 11px 15px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--field); color: var(--ink); font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
/* 02-11-2026: the audit's focus: the border turns to the heading colour with a soft 4px ring. */
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 9%, transparent); }
select option { background: var(--surface); color: var(--ink); }
input:disabled, select:disabled { opacity: 0.6; cursor: not-allowed; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238F9296' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 11px 7px;
}
input[type="file"] { padding: 7px 8px; font-size: var(--fs-sm); }
input[type="file"]::file-selector-button { border: 0; border-radius: 999px; padding: 6px 12px; margin-right: 10px; background: var(--btn-2); color: var(--ink); font-weight: 600; cursor: pointer; }
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-sm); font-weight: 500; margin: 0; cursor: pointer; }
.switch input {
  -webkit-appearance: none; appearance: none; width: 40px; min-height: 24px; height: 24px; padding: 0; margin: 0; border-radius: 999px; flex: none;
  background: var(--g150); border: 0; position: relative; cursor: pointer; transition: background-color 160ms var(--ease);
}
:root[data-theme="dark"] .switch input { background: var(--active); }
:root[data-theme="dark"] .switch input:checked::after { background: var(--on-lime); }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(17, 17, 18, 0.25); transition: transform 160ms var(--ease); }
.switch input:checked, :root[data-theme="dark"] .switch input:checked { background: var(--lime); }
.switch input:checked::after { transform: translateX(16px); }

/* ------------------------------------------------------------ status pills */
/* 02-11-2026: the audit's pill: Geist Mono, a tinted fill and a hairline in the same tone. */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font: 500 11.5px/1.5 var(--mono); letter-spacing: 0.04em; background: var(--idle-bg); color: var(--idle); white-space: nowrap;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill:empty { display: none; }
.pill.pending, .pill.running, .pill.question, .pill.other, .pill.awaiting_approval, .pill.retry, .pill.draft, .pill.auto, .pill.enriched, .pill.scored { background: var(--info-bg); color: var(--info); }
.pill.approved, .pill.ok, .pill.executed, .pill.valid, .pill.interested, .pill.answered, .pill.confirmed, .pill.recorded, .pill.sent, .pill.replied { background: var(--ok-bg); color: var(--ok); }
.pill.rejected, .pill.failed, .pill.invalid, .pill.blocked, .pill.unsubscribe, .pill.unsubscribed, .pill.negative, .pill.error { background: var(--bad-bg); color: var(--bad); }
.pill.expired, .pill.missing, .pill.skipped, .pill.partial, .pill.unknown, .pill.held { background: var(--warn-bg); color: var(--warn); }
.pill.superseded, .pill.retired, .pill.cancelled, .pill.off, .pill.not.connected { background: var(--idle-bg); color: var(--idle); }
.pill.queued, .pill.publishing { background: var(--info-bg); color: var(--info); }
.pill.published, .pill.connected, .pill.active { background: var(--ok-bg); color: var(--ok); }
.pill.refused { background: var(--bad-bg); color: var(--bad); }
.pill.publishing::before { animation: pulse 1.6s var(--ease) infinite; }
.pill.running::before, .pill.pending::before { animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ------------------------------------------------------------ tables */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow-card); margin-bottom: 14px;
}
table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; overflow-wrap: anywhere; }
th { font: 500 11.5px/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; background: transparent; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--hover); }
th.num { text-align: right; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td select { min-height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: var(--fs-sm); min-width: 140px; }
td .tile { vertical-align: middle; }

/* ------------------------------------------------------------ publisher */
.pub-accounts { list-style: none; padding: 4px 0; margin: 0 0 8px; }
.pub-account { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px; }
.pub-account + .pub-account { border-top: 1px solid var(--line-soft); }
.pub-account-main { display: flex; align-items: flex-start; gap: 12px; flex: 1 1 280px; min-width: 0; }
.pub-account-text { min-width: 0; }
.pub-account-text p { margin: 3px 0 0; }
.pub-caution { color: var(--warn); max-width: 60ch; }
.pub-actions { flex: none; }
.pub-picker { flex: 1 1 100%; align-items: flex-end; }
.pub-picker:empty { display: none; }
.pub-picker .grow, .row .grow { flex: 1 1 220px; min-width: 0; }
.pub-detail { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.pub-unknown { color: var(--warn); font-weight: 600; font-size: var(--fs-sm); }
.pub-row-actions { gap: 6px; }
.nowrap { white-space: nowrap; }
.pub-row-actions input { min-height: 34px; padding: 5px 8px; font-size: var(--fs-sm); width: auto; }

/* ------------------------------------------------------------ approvals */
.approval-list { display: flex; flex-direction: column; gap: 10px; }
.approval-list > .card { margin-bottom: 0; }
.approval-card { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; }
.approval-title { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; font-size: 15px; color: var(--ink); line-height: 1.35; min-width: 0; overflow-wrap: anywhere; }
.approval-title > .tile { margin-top: -1px; }
.approval-card .meta, .approval-card .excerpt { padding-left: 32px; }
.approval-card .card-link { margin-left: 32px; align-self: flex-start; }
.approval-card .meta { margin: 0; font-size: var(--fs-xs); }
.approval-card .excerpt { margin: 6px 0 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.approval-card .row.between { flex-wrap: nowrap; align-items: flex-start; }
.approval-card .card-link { margin-top: 10px; }
.meta { color: var(--muted); font-size: var(--fs-sm); }
.preview {
  white-space: pre-wrap; overflow-wrap: anywhere; background: var(--well); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  padding: 14px 16px; font-size: 14px; line-height: 1.6; max-height: 60vh; overflow: auto; color: var(--text);
}
.args pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--well); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 14px; margin: 0; max-height: 50vh; overflow: auto; }
.decide { display: grid; grid-template-columns: 1fr; gap: 8px; }
/* Approval card in plain words (01-11-2026): what it is, the thing itself,
   what approving does; internal detail behind a closed Details. */
.approval-lead { margin-bottom: 14px; }
.approval-what { margin: 0; font-size: var(--fs-lg); font-weight: 600; color: var(--ink); }
.approval-next { margin: 10px 0 0; }
.approval-lead .hint { margin: 10px 0 0; }
.approval-field { margin: 0 0 14px; }
.approval-field:last-child { margin-bottom: 0; }
.approval-field-label { margin: 0 0 6px; font: 500 11.5px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.approval-value { overflow-wrap: anywhere; }
.decision-help { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.approval-details > summary { cursor: pointer; font-weight: 600; }
.approval-details[open] > summary { margin-bottom: 10px; }
.approval-details h4 { margin: 16px 0 6px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 20px; align-items: start; }
@media (min-width: 1180px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .detail-grid > .detail-main { grid-column: 1; grid-row: 1; }
  .detail-grid > .detail-side { position: sticky; top: 24px; grid-column: 2; grid-row: 1; }
  .detail-side .decide { grid-template-columns: 1fr; }
}
.decision-card { border-color: var(--line-strong); box-shadow: var(--shadow-3); }
.hint { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); color: var(--ink); padding: 12px 15px; border-radius: var(--r-md); font-size: var(--fs-sm); }
.hint::before { content: ''; width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: var(--lime); flex: none; }

/* media (29-09-2026): a rail of thumbnail tiles beside the preview, grouped
   by piece ("Carousel: 9 slides"). Wide screens: a vertical, scrollable strip
   on the left of the preview. Phones: a horizontal strip above it. */
.preview-with-media { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 14px; align-items: start; }
.preview-with-media > .preview-card { margin-bottom: 0; }
.media-rail { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); min-width: 0; }
.media-rail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 8px; font: 500 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.media-rail-body { padding: 0 12px 12px; }
.media-group + .media-group { margin-top: 12px; }
.media-group-label { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.media-group-tiles { display: grid; gap: 8px; }
.media-tile {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 5; padding: 0; overflow: hidden; cursor: zoom-in;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--well); color: var(--muted);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), border-color 160ms var(--ease);
}
.media-tile:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); border-color: var(--line); }
.media-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-tile.is-file { cursor: pointer; align-content: center; gap: 4px; }
.media-num { position: absolute; left: 5px; bottom: 5px; min-width: 18px; padding: 2px 5px; border-radius: 999px; background: rgba(17, 17, 18, 0.66); color: #FFFFFF; font: 600 10.5px/1.2 var(--body); text-align: center; font-variant-numeric: tabular-nums; }
.media-doc { display: grid; place-items: center; color: var(--muted); }
.media-doc.big { width: 64px; height: 64px; border-radius: 16px; background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }
.media-doc-label { font: 600 11px/1 var(--body); letter-spacing: 0.04em; color: var(--muted); }
/* Phones: one horizontal strip; each group's tiles run in a row. */
.media-rail-body { display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 12px; -webkit-overflow-scrolling: touch; }
.media-rail .media-group { flex: none; margin-top: 0; }
.media-rail .media-group-tiles { grid-auto-flow: column; grid-auto-columns: 76px; }
.media-rail .media-tile { scroll-snap-align: start; }
@media (min-width: 900px) {
  .preview-with-media { grid-template-columns: 148px minmax(0, 1fr); }
  .media-rail { position: sticky; top: 24px; display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
  .media-rail-body { display: block; overflow-x: hidden; overflow-y: auto; scroll-snap-type: none; }
  .media-rail .media-group + .media-group { margin-top: 14px; }
  .media-rail .media-group-tiles { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-columns: auto; gap: 6px; }
}
/* Files preview: the same tiles in a wrapping row per group. */
.file-media:not(:empty) { margin-bottom: 12px; }
.media-strip .media-group-tiles { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }

/* The viewer: full screen, dark in both themes so images read true. */
body.layer-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 80; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  background: #0C0C0D; color: #F3F4F5; animation: fade-in 140ms var(--ease);
}
@keyframes fade-in { from { opacity: 0; } }
.lb-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.lb-heading { min-width: 0; }
.lb-title { margin: 2px 0 2px; font-size: 15px; font-weight: 600; color: #FFFFFF; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-counter { margin: 0; font-size: 12.5px; color: rgba(255, 255, 255, 0.7); font-variant-numeric: tabular-nums; }
.lb-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.lightbox .btn.ghost { color: rgba(255, 255, 255, 0.82); }
.lightbox .btn.ghost:hover { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }
.lb-close, .lb-nav {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, 0.12); color: #FFFFFF; transition: background-color 120ms ease;
}
.lb-close:hover, .lb-nav:hover:not(:disabled) { background: rgba(255, 255, 255, 0.22); }
.lb-close .ic, .lb-nav .ic { --icon: 20px; }
.lb-nav:disabled { opacity: 0.3; cursor: default; }
.lightbox :focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
.lb-stage { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 0; touch-action: pan-y pinch-zoom; }
.lb-figure { position: relative; margin: 0; align-self: stretch; min-height: 0; min-width: 0; display: grid; place-items: center; }
.lb-img { position: absolute; inset: 0; margin: auto; display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45); background: #1F1D1B; user-select: none; -webkit-user-drag: none; }
.lb-file { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 24px; }
.lb-file p { margin: 0; color: rgba(255, 255, 255, 0.8); }
.lb-strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 2px; justify-content: safe center; scrollbar-width: thin; }
.lb-thumb {
  position: relative; flex: none; width: 48px; aspect-ratio: 4 / 5; padding: 0; overflow: hidden; cursor: pointer; display: grid; place-items: center;
  border: 2px solid transparent; border-radius: 6px; background: #36322F; opacity: 0.6; transition: opacity 120ms ease, border-color 120ms ease;
}
.lb-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lb-thumb:hover { opacity: 0.9; }
.lb-thumb.is-active { opacity: 1; border-color: #FFFFFF; }
.lb-thumb .media-doc-label { color: rgba(255, 255, 255, 0.8); }
@media (max-width: 767.98px) {
  .lightbox { padding-left: 8px; padding-right: 8px; }
  .lb-stage { grid-template-columns: minmax(0, 1fr); }
  .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 40px; height: 40px; background: rgba(17, 17, 18, 0.55); }
  .lb-nav.prev { left: 4px; }
  .lb-nav.next { right: 4px; }
  .lb-open { display: none; }
}
@media (min-width: 768px) { .lb-stage { padding: 0 8px; } .lb-thumb { width: 56px; } }

/* ------------------------------------------------------------ agents: roster and drawer (29-09-2026) */
/* A compact grid of agent cards (about four a row on desktop); phones get one
   row per agent with the avatar on the left. */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.agent-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; min-width: 0; padding: 14px; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); color: var(--ink); font: inherit;
  transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.agent-tile:hover { box-shadow: var(--shadow-3); border-color: var(--line-strong); transform: translateY(-1px); }
.agent-tile:active { transform: translateY(0); }
.agent-tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; width: 100%; margin-bottom: 4px; }
.agent-tile-name { font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.agent-tile-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text); margin: 0; }
.agent-tile-lines { display: grid; gap: 2px; font-size: 12.5px; color: var(--muted); min-width: 0; width: 100%; }
.agent-tile-lines .line { overflow-wrap: anywhere; }
.roster-group + .roster-group { margin-top: 30px; }
.roster-group .group-head { margin-top: 0; }
.agent-tile-lines .k { color: var(--faint); }
.agent-tile.is-setup { background: var(--well); box-shadow: none; }
.agent-tile.is-setup .avatar-slot { filter: grayscale(1); opacity: 0.55; }
.agent-tile.is-setup .agent-tile-name, .agent-tile.is-setup .agent-tile-status { color: var(--muted); }
.waiting-pill { flex: none; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font: 500 11px/1.3 var(--mono); letter-spacing: 0.04em; white-space: nowrap; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.state-dot.idle { background: var(--g500); }
/* The avatar slot: public/avatars/<agent>.svg brings its own light grey
   rounded-square background, so it shows square with rounded corners only.
   Until that file exists: the line icon on a circle tinted in the agent's tone. */
.avatar-slot {
  --avatar: 56px; position: relative; display: grid; place-items: center; flex: none; width: var(--avatar); height: var(--avatar); overflow: hidden;
  border-radius: 50%; background: color-mix(in srgb, var(--avatar-tone, var(--g500)) 15%, var(--surface)); color: var(--avatar-tone, var(--g500));
}
.avatar-slot.lg { --avatar: 96px; }
.avatar-slot .ic { --icon: calc(var(--avatar) * 0.44); }
.avatar-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 160ms ease; }
.avatar-slot.has-img { border-radius: 14px; background: transparent; }
.avatar-slot.has-img.lg { border-radius: 22px; }
.avatar-slot.has-img img { opacity: 1; }
.avatar-slot.has-img .ic { visibility: hidden; }

/* The drawer: a full-height panel on the right; phones: a full-screen sheet. */
.drawer { position: fixed; inset: 0; z-index: 70; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(17, 17, 18, 0.28); animation: fade-in 140ms var(--ease); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%); display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-3); animation: drawer-in 220ms var(--ease);
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; align-items: flex-start; gap: 16px; padding: calc(20px + env(safe-area-inset-top)) 20px 16px; border-bottom: 1px solid var(--line-soft); }
.drawer-title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.drawer-title .slug { display: inline-block; max-width: 100%; overflow-wrap: anywhere; line-height: 1.3; }
.drawer-title h2 { margin: 2px 0 0; font-size: 20px; }
.drawer-close { width: 40px; min-height: 40px; padding: 0; flex: none; }
.drawer-close .ic { --icon: 18px; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.drawer-body > * { margin: 0; }
.drawer-body .desc { color: var(--muted); font-size: var(--fs-sm); line-height: 1.55; }
.drawer-body a.hint { text-decoration: none; }
.drawer-body h3 { margin: 8px 0 0; font-size: 15px; }
.drawer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.drawer-row .label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.drawer-body .facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: var(--fs-sm); }
.drawer-body .facts dt { color: var(--muted); font-weight: 500; }
.drawer-body .facts dd { margin: 0; overflow-wrap: anywhere; }
.drawer-body label { margin: 0; }
.drawer-body .actions { padding-top: 4px; }
.run-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 0; }
.run-list li { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.run-list li:first-child { padding-top: 2px; }
.run-list .run-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.run-list .num { margin-left: auto; font-variant-numeric: tabular-nums; }
.run-list .small { overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
  .roster { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .agent-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'av name' 'av status' 'av lines'; column-gap: 12px; row-gap: 3px; align-items: start; padding: 12px; }
  .agent-tile-top { grid-area: av; display: grid; justify-items: center; gap: 6px; width: auto; margin: 0; }
  .agent-tile-name { grid-area: name; }
  .agent-tile-status { grid-area: status; }
  .agent-tile-lines { grid-area: lines; }
  .agent-tile .avatar-slot { --avatar: 48px; }
  .waiting-pill { font-size: 10.5px; padding: 2px 6px; }
  .drawer-panel { width: 100%; border-left: 0; animation: sheet-up 220ms var(--ease); }
  @keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
  .drawer-head { padding: calc(14px + env(safe-area-inset-top)) 16px 14px; gap: 14px; }
  .drawer-head .avatar-slot.lg { --avatar: 72px; }
  .drawer-body { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
}

/* ------------------------------------------------------------ stats */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
/* 02-11-2026: display numbers in Doto, the audit's dot-matrix score face; labels in Geist Mono. */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-card); min-width: 0; }
.stat .label { font: 500 11px/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.stat .value { font: 900 34px/1 var(--dot); letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; margin: 10px 0 4px; }
.stat .sub { font-size: var(--fs-xs); color: var(--muted); }
.numbers-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .numbers-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.numbers-page .card { margin-bottom: 16px; }
.numbers-page h3.section-title { font-size: var(--fs-md, 15px); margin: 18px 0 8px; }
.bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 10px; }
:root[data-theme="dark"] .bar { background: rgba(255, 255, 255, 0.08); }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--lime); transition: width 0.8s var(--ease); }
.bar > i.warn { background: #D97706; }

/* ------------------------------------------------------------ chat */
.chat { display: flex; flex-direction: column; min-height: calc(100dvh - 200px); max-width: 760px; }
.messages { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 4px 0 16px; }
.msg { max-width: min(86%, 62ch); padding: 10px 15px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.msg.agent { align-self: flex-start; background: var(--card); color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow-1); }
.msg.thinking { color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.msg.thinking::after { content: ''; width: 22px; height: 6px; background: radial-gradient(circle 3px at 3px 3px, currentColor 98%, transparent) 0 0 / 8px 6px repeat-x; animation: dots 1.2s steps(4) infinite; clip-path: inset(0 100% 0 0); }
@keyframes dots { to { clip-path: inset(0 -2px 0 0); } }
.msg.error { color: var(--bad); }
.composer {
  display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 16px; padding: 5px 5px 5px 8px; border-radius: 26px;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line); box-shadow: var(--shadow-2);
}
.composer textarea { min-height: 40px; max-height: 160px; background: transparent; border: 0; box-shadow: none; resize: none; padding: 9px 8px; }
.composer textarea:focus { box-shadow: none; border: 0; }
.composer:focus-within { box-shadow: var(--shadow-2), 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.composer button { flex: none; }

/* ------------------------------------------------------------ sign in */
/* 02-11-2026: the audit's sign-in card (ijen.ai/login): one 20px card, a 26px padding, a full-width cream button. */
.login { max-width: 440px; margin: 12vh auto 32px; padding: 30px 28px; border-radius: var(--radius); box-shadow: var(--shadow-card); border-color: var(--line); }
.login-mark.logo { height: 40px; display: flex; margin-bottom: 26px; }
.login h1 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 44px); }
.login form { margin-top: 20px; }
.login .btn { margin-top: 6px; min-height: 48px; font-size: 15.5px; }

/* ------------------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; max-width: min(560px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  color: var(--ink); font-size: 14.5px; font-weight: 500; border: 1px solid var(--line-strong); box-shadow: var(--shadow-3);
  animation: toast-in 220ms var(--ease);
}
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; }
.toast.bad { color: var(--bad); }
.toast.bad::before { background: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ------------------------------------------------------------ brain tab */
.diff { font-family: var(--mono); font-size: 12.5px; background: var(--well); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 8px; max-height: 60vh; overflow: auto; }
.diff-line { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1px 6px; border-radius: 6px; }
.diff-line.add { background: var(--ok-bg); color: var(--ok); }
.diff-line.del { background: var(--bad-bg); color: var(--bad); }
.rules { margin: 0 0 12px; padding-left: 18px; }
.rules li + li { margin-top: 4px; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--g075); border: 1px solid var(--line); margin-bottom: 18px; max-width: 100%; overflow-x: auto; }
:root[data-theme="dark"] .segmented { background: rgba(255, 255, 255, 0.04); }
.segmented .btn { background: transparent; color: var(--muted); min-height: 32px; border-color: transparent; }
.segmented .btn:hover { color: var(--ink); background: transparent; }
.segmented .btn.primary { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
:root[data-theme="dark"] .segmented .btn.primary { background: var(--accent); color: var(--on-accent); }

/* ------------------------------------------------------------ section panel (desktop) */
.panel { background: var(--panel-bg); border-right: 1px solid var(--line); flex-direction: column; min-width: 0; }
/* The switcher band: the top of the context column joins the charcoal frame. */
.panel-head { padding: 12px 12px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.panel-head .ws-switcher { background: var(--card); border-color: var(--line); color: var(--ink); }
.panel-head .ws-switcher:hover, .panel-head .ws-switcher[aria-expanded="true"] { border-color: var(--line-strong); }
.panel-head .ws-avatar { background: var(--lime); color: var(--on-lime); }
.panel-head .ws-chevron { color: var(--muted); }
.ws-switcher {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color 120ms ease; min-width: 0;
}
.ws-switcher:hover { border-color: var(--line-strong); text-decoration: none; }
.ws-avatar { flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--accent); color: var(--on-accent); font: 700 11.5px/22px var(--body); text-align: center; }
.ws-name { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-chevron { width: 11px; height: 11px; flex: none; color: var(--faint); }
/* Brand switcher (04-10-2026): a button; the menu drops under it. */
.ws-wrap { position: relative; }
button.ws-switcher { width: 100%; font: inherit; text-align: left; cursor: pointer; }
.ws-switcher:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ws-switcher.is-inert .ws-chevron { display: none; }
.ws-switcher[aria-expanded="true"] { border-color: var(--line-strong); }
.ws-menu {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0; max-height: min(60vh, 420px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); animation: rise 140ms var(--ease);
}
.ws-menu .menu-item { padding: 8px; }
.ws-menu .menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ws-menu .menu-item.is-current { background: var(--hover); font-weight: 600; }
.ws-menu .menu-item.is-current .ws-item-name::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); margin-right: 7px; vertical-align: middle; }
.ws-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-menu .pill { flex: none; }
.ws-menu-sep { border-top: 1px solid var(--line); margin: 4px 2px; }
/* Clients page (Asmal team). */
.clients-table .client-actions { flex-wrap: nowrap; }
.client-agent { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.client-manage { margin-top: 22px; scroll-margin-top: 16px; }
.client-manage h4 { margin: 8px 0 0; font-size: var(--fs-sm); }
.client-add-person { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.panel-search { position: relative; display: flex; align-items: center; padding: 0 12px 10px; margin: 0; }
.panel-search svg { position: absolute; left: 23px; width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.panel-search input { min-height: 38px; padding: 8px 14px 8px 34px; border-radius: 999px; background: var(--field); border-color: var(--line); font-size: 13.5px; font-weight: 500; }
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.nav-group-label { font: 500 10.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); padding: 18px 10px 8px; }
.panel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.panel-link {
  display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: var(--r-sm); color: var(--muted);
  font: 500 13.5px/1.2 var(--body); text-decoration: none; min-width: 0; transition: background-color 100ms ease, color 100ms ease;
}
.panel-link:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.panel-link.is-active { background: var(--active); color: var(--ink); font-weight: 600; }
.panel-link .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count-pill { flex: none; min-width: 20px; padding: 3px 7px; border-radius: 999px; background: var(--g075); color: var(--muted); font: 500 11px/1 var(--mono); text-align: center; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .count-pill { background: rgba(255, 255, 255, 0.06); }
.count-pill.hot { background: var(--lime); color: var(--on-lime); }
.panel-foot { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }
.panel-foot a { color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.panel-foot a:hover { color: var(--ink); text-decoration: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); flex: none; }
.dot.off { background: var(--g500); }

/* ------------------------------------------------------------ context column: section lists (IJEN) */
.panel-action { padding: 0 12px 4px; }
.panel-action:empty { display: none; }
.panel-action .btn { width: 100%; }
.panel-link .meta-line { display: block; font: 400 11.5px/1.3 var(--body); color: var(--faint); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 02-11-2026: a name with a line under it, anywhere (tables included), never run together. */
.two-line > .name, .two-line > .meta-line { display: block; }
.two-line > .meta-line { font-size: var(--fs-xs); color: var(--faint); margin-top: 2px; }
.panel-link .two-line { flex: 1; min-width: 0; }
.panel-link .two-line .name { display: block; }
.panel-link.thread { align-items: flex-start; padding: 8px 9px; border: 1px solid transparent; }
.panel-link.thread.is-active { background: var(--card); border-color: var(--line); box-shadow: var(--shadow-1); }
.panel-link.thread .state-dot { margin-top: 5px; }
.state-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--g200); }
.state-dot.ok { background: var(--live); }
.state-dot.wait { background: var(--lime); box-shadow: 0 0 0 3px var(--accent-soft); }
.state-dot.warn { background: #D97706; }
.state-dot.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--g200); }
.panel-empty { font-size: 12.5px; color: var(--faint); padding: 6px 10px; margin: 0; }
.panel-tag { flex: none; font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.panel-foot .line { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font: 500 12px/1.3 var(--body); }
.panel-foot .line .soft { color: var(--faint); }

/* Below 1100px the context column's list shows as pills at the top of the page. */
.subnav-inline { display: flex; gap: 6px; overflow-x: auto; margin: -4px 0 18px; padding: 2px 0 4px; scrollbar-width: none; }
.subnav-inline::-webkit-scrollbar { display: none; }
.subnav-inline a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font: 600 13px/1 var(--body); color: var(--muted); background: var(--btn-2); text-decoration: none; }
.subnav-inline a.is-active { background: var(--ink); border-color: var(--ink); color: var(--page); }
.subnav-inline .count-pill { padding: 2px 6px; font-size: 10.5px; }
.subnav-inline a.is-active .count-pill { background: color-mix(in srgb, var(--page) 22%, transparent); color: var(--page); }

/* ------------------------------------------------------------ chat: conversation and Files panel */
body.full-bleed #content { max-width: none; }
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100dvh - 120px); }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.chat-header h1 { font-size: 19px; margin: 0; }
.chat-header p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.chat-header .who-jen { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; font: 500 11.5px/1 var(--mono); letter-spacing: 0.06em; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 13px; background: var(--btn-2); text-decoration: none; cursor: pointer; }
.chip:hover { color: var(--ink); text-decoration: none; border-color: var(--line-strong); }
.chip .dot { width: 7px; height: 7px; }
.chat-picker { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.chat-picker select { flex: 1 1 auto; min-width: 0; }
.chat-main .messages { padding: 20px 0 12px; }
.chat-welcome { text-align: center; max-width: 46ch; margin: 8vh auto 0; color: var(--muted); }
.chat-welcome .tile { margin: 0 auto 14px; }
.chat-welcome h2 { font-size: 21px; margin-bottom: 6px; }
.chat-welcome p { font-size: 13.5px; }
.chat-main .composer { margin-top: auto; }
.files-pane { display: none; }
.files-pane h2 { font: 500 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.files-pane .close-files { display: none; }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: flex-start; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 11px; color: var(--ink); text-decoration: none; min-width: 0; }
.file-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); text-decoration: none; }
.file-item .body { flex: 1; min-width: 0; }
.file-item strong { display: block; font: 600 12.5px/1.35 var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .small { display: block; font-size: 11px; color: var(--faint); margin-top: 3px; }
.files-empty { color: var(--muted); font-size: 12.5px; padding: 8px 2px; }
.files-empty strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
/* Narrower than 1280px: the Files panel is a drawer from the right. */
.files-pane.open {
  display: block; position: fixed; z-index: 45; top: 0; right: 0; bottom: 0; width: min(var(--files-w), 92vw); overflow-y: auto; padding: 22px 16px;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-3); animation: rise 160ms var(--ease);
}
.files-pane.open .close-files { display: inline-flex; float: right; margin-top: -8px; }
@media (min-width: 1280px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr) var(--files-w); gap: 0 26px; }
  .files-pane, .files-pane.open { display: block; position: sticky; top: 34px; align-self: start; max-height: calc(100dvh - 68px); overflow-y: auto; width: auto; padding: 0 0 0 22px; border-left: 1px solid var(--line); box-shadow: none; background: none; animation: none; z-index: auto; }
  .files-pane .close-files, .files-toggle { display: none !important; }
}

/* ------------------------------------------------------------ team */
.jen-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 22px; color: var(--ink); text-decoration: none; transition: border-color 160ms var(--ease), background-color 160ms var(--ease); }
.jen-hero:hover { border-color: color-mix(in srgb, var(--lime) 45%, transparent); text-decoration: none; }
.jen-avatar { position: relative; flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: var(--page); display: grid; place-items: center; }
.jen-avatar .ic { --icon: 20px; }
.jen-avatar::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--live); border: 2px solid var(--surface); }
.jen-hero .body { flex: 1 1 220px; min-width: 0; }
.jen-hero .name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jen-hero .name-row strong { font-size: 17px; font-weight: 600; }
.tag { display: inline-flex; align-items: center; font: 500 11px/1 var(--mono); letter-spacing: 0.04em; padding: 4px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.tag.grey { background: var(--g075); color: var(--muted); }
:root[data-theme="dark"] .tag.grey { background: rgba(255, 255, 255, 0.06); }
.jen-hero p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.jen-hero .cta { flex: none; font: 600 12.5px/1 var(--body); color: var(--accent-ink); }
.jen-hero .cta::after { content: ' \2192'; }
.group-head { display: flex; align-items: center; gap: 10px; margin: 26px 0 4px; }
.group-head:first-of-type { margin-top: 0; }
.group-head h2 { margin: 0; font-size: 17px; }
.group-purpose { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.slug { font: 500 11.5px/1 var(--mono); padding: 3px 6px; border-radius: 4px; background: var(--well); color: var(--muted); border: 1px solid var(--line-soft); }

/* ------------------------------------------------------------ brain */
.interview-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.interview-card .body { flex: 1 1 320px; min-width: 0; }
.interview-card h2 { font-size: 17px; margin-bottom: 4px; }
.interview-card p { color: var(--muted); font-size: 13.5px; margin: 0 0 10px; max-width: 60ch; }
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; max-width: 320px; }
:root[data-theme="dark"] .progress { background: rgba(255, 255, 255, 0.08); }
.progress > i { display: block; height: 100%; background: var(--lime); border-radius: inherit; transition: width 0.8s var(--ease); }
.progress-label { font-size: 11.5px; color: var(--faint); margin-top: 6px; }
.interview-link { margin-top: 12px; }
.interview-link p { margin-bottom: 6px; }
.interview-link-form { gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.interview-link-form input { flex: 1 1 240px; min-width: 0; }
.import-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.import-list li { border-top: 1px solid var(--line); padding-top: 10px; }
.import-list li:first-child { border-top: 0; padding-top: 0; }
.tile-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (min-width: 900px) { .tile-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.count-tile { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow-card); transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease); min-width: 0; }
.count-tile:hover { box-shadow: var(--shadow-3); text-decoration: none; border-color: var(--line-strong); transform: translateY(-1px); }
.count-tile .n { font: 900 34px/1 var(--dot); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin-bottom: 6px; }
.count-tile .n.accent { color: var(--accent-ink); }
.count-tile .n.warn { color: var(--warn); }
.count-tile .label { font: 600 12.5px/1.3 var(--body); }
.count-tile .blurb { font-size: 11.5px; color: var(--faint); }
.search-box { position: relative; margin-bottom: 12px; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.search-box input { padding-left: 36px; }

/* ------------------------------------------------------------ files */
.files-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1280px) { .files-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); } .files-layout .file-preview { position: sticky; top: 34px; } }
.file-rows { list-style: none; margin: 0; padding: 4px; }
.file-row { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 11px 12px; border: 0; border-radius: var(--r-sm); background: none; cursor: pointer; color: var(--ink); font: inherit; min-width: 0; }
.file-row:hover { background: var(--hover); }
.file-row.is-active { background: var(--hover); box-shadow: inset 2px 0 0 var(--lime); }
.file-row .body { flex: 1; min-width: 0; }
.file-row strong { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.file-row .excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.file-rows li + li { border-top: 1px solid var(--line-soft); }
.file-preview .preview { max-height: 70vh; }
.file-preview-empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.file-preview-empty .tile { margin: 0 auto 12px; }

/* ------------------------------------------------------------ settings */
.settings-panel { max-width: 780px; }
.section-intro { font-size: 13.5px; color: var(--muted); margin: -10px 0 18px; max-width: 64ch; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; padding: 13px 0; border-top: 1px solid var(--line); }
.setting-row:first-of-type { border-top: 0; padding-top: 4px; }
.setting-row .label { font: 600 14px/1.3 var(--body); color: var(--ink); }
.setting-row .setting-hint { font-size: 12.5px; color: var(--muted); max-width: 46ch; margin: 2px 0 0; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; font: 600 13px/1 var(--body); padding: 8px 14px; border-radius: 999px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 6px; background: var(--accent); vertical-align: middle; margin-right: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
/* ------------------------------------------------------------ Dashboard (04-10-2026) */
.dash-agents, .dash-tools { margin-bottom: 8px; }
@media (min-width: 900px) { .dash-agents, .dash-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.agent-card { display: flex; flex-direction: column; gap: 8px; }
.agent-card p { margin: 0; overflow-wrap: anywhere; }
.agent-card .approval-title { gap: 10px; min-width: 0; }
.agent-now { font-size: var(--fs-sm); }
.dash-split { display: grid; grid-template-columns: 1fr; gap: 0 18px; }
@media (min-width: 1000px) { .dash-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.activity-list { list-style: none; margin: 0; padding: 4px 14px; }
.activity-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; font-size: var(--fs-sm); min-width: 0; }
.activity-list li + li { border-top: 1px solid var(--line-soft); }
.activity-list .state-dot { margin-top: 6px; }
.activity-list .two-line { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* Getting started (06-10-2026): the setup checklist on the Dashboard. */
.setup-card { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.setup-card p { margin: 0; }
.setup-list { list-style: none; margin: 0; padding: 0; }
.setup-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; font-size: var(--fs-sm); min-width: 0; }
.setup-list li + li { border-top: 1px solid var(--line-soft); }
.setup-list .state-dot { margin-top: 6px; }
.setup-list .two-line { flex: 1; min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 2px; }
.setup-list .name { font-weight: 600; }
.setup-list li.done .name { color: var(--muted); }
.setup-list .meta-line { font-size: var(--fs-xs); color: var(--faint); }
.setup-list .card-link { margin-top: 4px; align-self: flex-start; }
/* Quality gate badge on outside drafts (06-10-2026). */
.pill.gate-pass { background: var(--ok-bg); color: var(--ok); }
.pill.gate-fail { background: var(--bad-bg); color: var(--bad); }
.pill.gate-none { background: var(--idle-bg); color: var(--idle); }
.activity-list .meta-line, .file-row .meta-line { display: block; font-size: var(--fs-xs); color: var(--faint); margin-top: 2px; }
.file-row .two-line { flex: 1; min-width: 0; }
a.file-row, a.file-row:hover { text-decoration: none; }
.file-row .two-line .name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-list { list-style: none; margin: 0; padding: 0; }
.service-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: var(--fs-sm); }
.service-list li:first-child { border-top: 0; }
.service-list .name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }

/* ------------------------------------------------------------ phones (< 768px): header on top, tab bar at the bottom */
@media (max-width: 767.98px) {
  body.signed-in .top {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 20; padding: 8px var(--gutter); padding-top: calc(8px + env(safe-area-inset-top));
    min-height: calc(54px + env(safe-area-inset-top));
    background: color-mix(in srgb, var(--frame-bg) 78%, transparent); border-bottom: 1px solid var(--frame-line);
    -webkit-backdrop-filter: saturate(1.6) blur(20px); backdrop-filter: saturate(1.6) blur(20px);
  }
  .panel, .rail-logo, .rail-foot { display: none !important; }
  .account-menu { top: calc(58px + env(safe-area-inset-top)); right: 12px; }
  /* The bar and the sheet each carry their own blur: a backdrop-filter on an
     ancestor would become the containing block of the fixed sheet. */
  .tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; }
  .tab-primary {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding: 0 4px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--frame-bg) 86%, transparent); border-top: 1px solid var(--frame-line);
    -webkit-backdrop-filter: saturate(1.6) blur(20px); backdrop-filter: saturate(1.6) blur(20px);
  }
  .tab-primary a, .tab-more { flex-direction: column; justify-content: center; gap: 3px; font-size: 10.5px; position: relative; padding: 6px 0 4px; min-width: 0; color: var(--frame-muted); }
  .tab-primary a.active, .tab-more.active, .tab-more[aria-expanded="true"] { color: var(--frame-ink); }
  .tab-primary .ic { --icon: 22px; }
  .tab-primary a:not(.active) .ic, .tab-more:not(.active):not([aria-expanded="true"]) .ic { opacity: 0.82; }
  .tab-primary a.active::before, .tab-more.active::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 2px 2px; background: var(--frame-mark); }
  .tab-primary .count { position: absolute; top: 5px; left: calc(50% + 6px); }
  .tab-sheet {
    display: none; position: fixed; left: 10px; right: 10px; bottom: calc(var(--tabbar) + 10px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 12px; border-radius: var(--r-xl);
    background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    border: 1px solid var(--line); box-shadow: var(--shadow-3); animation: sheet-in 220ms var(--ease);
    background-color: color-mix(in srgb, var(--surface) 92%, transparent);
  }
  .tabs.sheet-open .tab-sheet { display: grid; }
  .tab-sheet a { flex-direction: column; gap: 8px; padding: 12px 4px 10px; border-radius: var(--r-md); font-size: 12.5px; color: var(--text); }
  .tab-sheet a.active { background: var(--active); color: var(--ink); }
  .tab-sheet .ic { --icon: 22px; }
  .view { padding-bottom: calc(var(--tabbar) + 32px + env(safe-area-inset-bottom)); padding-top: 18px; }
  .composer { bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); }
  .chat-layout { min-height: calc(100dvh - var(--tabbar) - 120px); }
  .files-pane.open { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .jen-hero { flex-wrap: wrap; }
  .setting-row > * { max-width: 100%; }
  .toast { bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); }
  body:not(.signed-in) .toast { bottom: 24px; }
  h1 { font-size: 26px; }
  .page-head .tile.lg { --tile: 36px; --tile-r: 9px; }
  .card { padding: 18px; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 36px; }
  input, select, textarea { font-size: 16px; min-height: 44px; }
  .panel-search input { font-size: 16px; }

  /* Tables fold into labelled rows: each row reads as a small card. */
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap tr { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { display: grid; grid-template-columns: minmax(84px, 34%) minmax(0, 1fr); gap: 12px; padding: 4px 0; border: 0; text-align: left; }
  .table-wrap td::before { content: attr(data-label); font-size: var(--fs-xs); font-weight: 600; color: var(--muted); padding-top: 2px; }
  .table-wrap td > * { justify-self: start; max-width: 100%; }
  .table-wrap td[data-label=""] { display: block; }
  .table-wrap td[data-label=""]::before { content: none; }
  .table-wrap td:empty { display: none; }
  .table-wrap td.num { text-align: left; white-space: normal; }
  .table-wrap tr.clickable:hover td { background: transparent; }
  .table-wrap tr.clickable:active { background: var(--hover); }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* ------------------------------------------------------------ desktop (>= 768px): icon rail + content */
@media (min-width: 768px) {
  :root { --gutter: 24px; }
  .tab-more, .scrim { display: none !important; }
  body.signed-in .app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
  body.signed-in .rail {
    position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 12px 6px 12px; background: var(--frame-bg); border-right: 1px solid var(--frame-line); overflow-y: auto; scrollbar-width: none;
  }
  .rail-logo { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 48px; padding: 6px 0 5px; border-radius: var(--r-sm); margin-bottom: 6px; flex: none; text-decoration: none; }
  .rail-logo:hover { text-decoration: none; }
  .rail-logo .logo.symbol { width: 30px; height: 30px; }
  .rail-logo:hover { background: var(--frame-hover); }
  .rail .tab-group { display: flex; flex-direction: column; gap: 2px; width: 100%; }
  .rail a { flex-direction: column; justify-content: center; gap: 3px; padding: 7px 2px 6px; border-radius: 10px; position: relative; font: 600 9.5px/1.1 var(--body); letter-spacing: 0.01em; color: var(--frame-muted); transition: background-color 100ms ease, color 100ms ease; }
  .rail a .ic { --icon: 18px; opacity: 0.82; }
  .rail a.active .ic, .rail a:hover .ic { opacity: 1; }
  .rail a:hover { background: var(--frame-hover); color: var(--frame-ink); }
  /* Active item: off-white icon and label on a slightly lighter charcoal, with a thin lime marker at the rail's edge. */
  .rail a.active { background: var(--frame-hover); color: var(--frame-ink); }
  .rail a.active::before { content: ''; position: absolute; left: -6px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--frame-mark); }
  .rail .count { position: absolute; top: 2px; right: 3px; min-width: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
  .rail .sheet-only { display: none; }
  .rail-foot { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; align-items: center; flex: none; }
  .account-menu { left: calc(var(--rail) + 8px); bottom: 12px; }
  body.signed-in .view { padding: 34px 40px 64px; }
  body.signed-in.full-bleed .view { padding: 26px 30px 24px; }
  .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .decide { grid-template-columns: 1.4fr 1fr 1fr; }
  .card { padding: 24px 26px; }
  .approval-card { padding: 18px 20px; }
  table { min-width: 560px; }
}
/* Wide screens: the context column sits between rail and content. Below
   1100px it is hidden and each page shows the same list as pills at its top
   (.subnav-inline), so nothing in the column is out of reach. */
@media (min-width: 1100px) {
  body.signed-in .app { grid-template-columns: var(--rail) var(--panel-w) minmax(0, 1fr); }
  body.signed-in .panel { display: flex; position: sticky; top: 0; height: 100vh; height: 100dvh; }
  .subnav-inline, .chat-picker { display: none !important; }
}
@media (max-width: 1099.98px) { .panel { display: none !important; } }

/* ------------------------------------------------------------ preferences */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255, 255, 255, 0.97); }
  :root[data-theme="dark"] { --glass: rgba(34, 32, 30, 0.98); }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: #FFFFFF; }
  :root[data-theme="dark"] { --glass: #22201E; }
  *, *::before, *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
@media (prefers-contrast: more) {
  :root { --line: #B9BCBF; --line-soft: #C9CCCF; --line-strong: #8D8A83; --muted: #45413B; }
  :root[data-theme="dark"] { --line: rgba(255, 255, 255, 0.28); --line-soft: rgba(255, 255, 255, 0.22); --line-strong: rgba(255, 255, 255, 0.45); --muted: #D1D3D5; --card: #22201E; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .msg.thinking::after { clip-path: none; }
}
@media (forced-colors: active) {
  .card, .table-wrap, .stat, .btn, .rail, .panel, .toast, .account-menu, .tile { border: 1px solid CanvasText; }
  .pill::before, .dot { background: CanvasText; }
}

/* Brain section: an approved Brand DNA or Epistemology with no working summary (29-09-2026). */
.card.attention { border-color: var(--warn); border-left-width: 4px; }

/* 29-09-2026: Connected tools (Settings > Integrations) and Connect your AI. */
.tool-row .pub-account-text p.small { max-width: 70ch; }
.tool-kind { display: inline-block; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); background: var(--well); border-radius: 6px; padding: 1px 7px; margin-right: 8px; }
.tool-kind.write { color: var(--warn); background: var(--warn-bg); }
.pill.revoked { background: var(--idle-bg); color: var(--idle); }
.pill.proposed { background: var(--info-bg); color: var(--info); }
.copy-block { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0 2px; min-width: 0; }
.copy-block .btn { flex: none; }
.copy-text { flex: 1 1 auto; min-width: 0; margin: 0; padding: 9px 11px; background: var(--well); border: 1px solid var(--line-soft); border-radius: 8px; white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere; }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.setup-card h3 { font-size: var(--fs-sm, 14px); }
.setup-steps { margin: 0; padding-left: 20px; }
.setup-steps li { margin: 0 0 10px; }
.setup-steps li > span { display: block; }
.ai-make { gap: 10px; align-items: center; flex-wrap: wrap; }
.ai-make > input { flex: 1 1 220px; min-width: 0; width: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm, 14px); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--lime); }
.new-key { border-color: var(--lime); background: var(--accent-soft); }
@media (max-width: 560px) {
  .setup-grid { grid-template-columns: 1fr; }
  .copy-block { flex-direction: column; }
  .copy-block .btn { align-self: flex-end; }
}

/* Passwords (04-10-2026): forgot link, live checklist, invite link box. */
.login-alt { margin: 14px 0 0; text-align: center; }
.pw-show { display: flex; align-items: center; gap: 8px; color: var(--muted); }
/* Owner feedback 04-10-2026: the checklist must be readable at a glance.
   Unmet rules turn red with a bold cross once typing starts; met rules are
   green on a soft green band; the "checked when you save" rule stays neutral
   until the server answers. --ok and --bad pass AA contrast in both themes. */
.pw-checks { list-style: none; margin: 4px 0 2px; padding: 0; display: grid; gap: 4px; font-size: var(--fs-sm); }
.pw-row { display: flex; gap: 8px; align-items: baseline; color: var(--muted); padding: 3px 8px; border-radius: 8px; }
.pw-row.ok { color: var(--ok); background: var(--ok-bg); font-weight: 600; }
.pw-row.no { color: var(--bad); font-weight: 600; }
.pw-row.todo, .pw-row.later { color: var(--muted); }
.pw-mark { flex: none; width: 16px; text-align: center; font-weight: 800; font-size: 15px; line-height: 1; }
.pw-row.no .pw-mark { font-size: 16px; }
.pw-row.nudge { background: var(--bad-bg); box-shadow: inset 0 0 0 1.5px var(--bad); animation: pw-shake 0.4s ease; }
@keyframes pw-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .pw-row.nudge { animation: none; } }
.pw-status { margin: 6px 0 0; padding: 8px 12px; border-radius: 10px; font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); background: var(--idle-bg); }
.pw-status.todo { color: var(--bad); background: transparent; box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; }
.pw-status.bad { color: var(--bad); background: var(--bad-bg); font-weight: 600; }
.pw-status.good { color: var(--ok); background: var(--ok-bg); font-weight: 600; }
.pw-meter { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: var(--fs-sm); color: var(--muted); }
.pw-meter[hidden] { display: none; }
.pw-meter-track { flex: 1; height: 6px; border-radius: 999px; background: var(--idle-bg); overflow: hidden; }
.pw-meter-bar { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 0.2s ease, background-color 0.2s ease; }
.pw-meter[data-level="1"] .pw-meter-bar { width: 33%; background: var(--bad); }
.pw-meter[data-level="2"] .pw-meter-bar { width: 66%; background: var(--warn); }
.pw-meter[data-level="3"] .pw-meter-bar { width: 100%; background: var(--ok); }
.pw-meter[data-level="1"] .pw-meter-text { color: var(--bad); }
.pw-meter[data-level="2"] .pw-meter-text { color: var(--warn); }
.pw-meter[data-level="3"] .pw-meter-text { color: var(--ok); }
.pw-meter-text { flex: none; min-width: 9.5em; text-align: right; font-weight: 600; }
.invite-link { margin: 8px 0 14px; border-color: var(--lime); }
.pw-show input[type=checkbox] { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; flex: none; }
.pw-show { font-weight: 500; }

/* Inline field errors (04-10-2026, owner feedback): fieldError() in app.js
   puts this line under a field whose check failed and outlines the field.
   Same red as the password screens (.pw-status.bad); --bad passes AA in both themes. */
input.field-invalid, select.field-invalid, textarea.field-invalid,
input.field-invalid:focus, select.field-invalid:focus, textarea.field-invalid:focus { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.field-error { margin: 6px 0 0; padding: 8px 12px; border-radius: 10px; font-size: var(--fs-sm); line-height: 1.45; color: var(--bad); background: var(--bad-bg); font-weight: 600; flex-basis: 100%; }

/* Guided setup (01-11-2026): the client's four steps (interview, reference
   links, connect socials, summary and approve). Large, plain actions; the
   stepper wraps to two rows on a phone. */
.stepper { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stepper a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--text); text-decoration: none; background: var(--card); min-height: 56px; }
.stepper a:hover { border-color: var(--line-strong); text-decoration: none; }
.stepper .step-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 500 13px/1 var(--mono); background: var(--btn-2); border: 1px solid var(--line-strong); color: var(--muted); }
.stepper .step-name { font-weight: 600; font-size: var(--fs-sm); line-height: 1.3; }
.stepper .step-optional { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); }
.stepper li.current a { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }
.stepper li.current .step-num { background: var(--lime); color: var(--on-lime); border-color: transparent; }
.stepper li.done .step-num { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.setup-step h2 { margin: 0 0 8px; }
.setup-step p { margin: 0 0 10px; }
.setup-done { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.btn.big { min-height: 50px; padding: 13px 26px; font-size: 15.5px; }
.setup-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 22px 0 8px; flex-wrap: wrap; }
.setup-links { list-style: none; padding: 0; }
.setup-links li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; overflow-wrap: anywhere; }
.setup-links li + li { border-top: 1px solid var(--line-soft); }
.setup-links .grow { flex: 1; min-width: 0; }
.setup-links .link-read { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.setup-links li .btn + .btn { margin-left: 0; }
@media (max-width: 520px) { .setup-links li { flex-wrap: wrap; } .setup-links li .grow { flex-basis: 100%; } }
.summary-card .summary-text { white-space: pre-line; margin: 8px 0 0; overflow-wrap: anywhere; }
.setup-approve { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.setup-approve p { margin: 0; }
.plain-list { margin: 0; padding-left: 18px; overflow-wrap: anywhere; }
@media (max-width: 768px) {
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-nav .btn { flex: 1 1 auto; text-align: center; }
}

/* 02-11-2026: the simple client view. The hot count stays lime in dark mode
   (the dark .count-pill rule outranked .count-pill.hot and left an empty grey
   pill); a client's pills wrap on a phone; card excerpts keep their line
   breaks; the client's replies table never breaks a word in the middle. */
:root[data-theme="dark"] .count-pill.hot { background: var(--lime); color: var(--on-lime); }
.subnav-inline.wrap { flex-wrap: wrap; overflow-x: visible; }
.approval-card .excerpt.keep-lines { white-space: pre-line; -webkit-line-clamp: 3; }
.client-replies td { overflow-wrap: break-word; }
.client-replies tr.clickable { cursor: pointer; }
/* 02-11-2026: the Clients table has one more number column; the name keeps its words whole. */
.clients-table td:first-child { min-width: 10em; overflow-wrap: normal; }
.clients-table .client-actions { flex-wrap: wrap; }

/* ------------------------------------------------------------ the client app (02-11-2026)
   The approved client mock: four screens and Ask Jen. Wide screens: a left
   column (the business, Today, Content, Replies, Settings, Ask Jen, who is
   signed in). Phones: a slim header with the business and Ask Jen, and a
   bottom bar with the same four screens. The team's rail, context column and
   phone header are never shown in this mode. Same audit tokens as the rest. */
body.client-mode #tabs, body.client-mode #panel, body.client-mode .top { display: none !important; }
.client-nav, .client-top { display: none; }
body.client-mode .client-nav { display: flex; }
body.client-mode .client-nav[hidden], body.client-mode .client-top[hidden] { display: none; }
.c-ic { display: inline-flex; flex: none; }
.jen-mark { display: inline-flex; color: var(--ink); flex: none; }
.jen-mark .jen-dot { fill: var(--lime); }
.client-nav .cn-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; }
.cn-brand-text { display: flex; flex-direction: column; min-width: 0; }
.cn-name { font-weight: 700; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.cn-sub { font-size: 12px; color: var(--muted); }
.cn-preview { margin: 0 6px 14px; padding: 10px 12px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--ink); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.cn-preview a { color: var(--accent-ink); font-weight: 600; }
.cn-items { display: flex; flex-direction: column; gap: 4px; }
.cn-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 14px; border-radius: 14px; color: var(--text); font-size: 15px; font-weight: 500; text-decoration: none; }
.cn-item:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.cn-item.is-active { background: var(--accent-soft); color: var(--ink); }
.cn-label { flex: 1; }
.cn-count { min-width: 22px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--accent-ink); color: var(--accent-ink); font: 500 12px/1.5 var(--mono); text-align: center; }
.cn-count[hidden] { display: none; }
.cn-grow { flex: 1 1 auto; min-height: 24px; }
.cn-jen { width: 100%; justify-content: center; gap: 8px; }
.cn-jen .c-ic, .cn-jen-top { color: var(--ink); }
.cn-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 10px 0; font-size: 14px; }
.cn-who { color: var(--ink); overflow-wrap: anywhere; }
.cn-foot a { color: var(--muted); font-size: 13px; }
@media (min-width: 768px) {
  body.signed-in.client-mode .app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
  body.client-mode .client-nav { position: sticky; top: 0; height: 100vh; height: 100dvh; flex-direction: column; padding: 24px 14px; border-right: 1px solid var(--frame-line); background: var(--frame-bg); overflow-y: auto; }
  body.signed-in.client-mode .view { padding: 40px clamp(20px, 4vw, 56px) 64px; }
}
@media (max-width: 767.98px) {
  body.client-mode .client-top { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between; gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px; background: var(--frame-bg); border-bottom: 1px solid var(--frame-line); }
  .client-top .cn-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .client-top .cn-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.client-mode .client-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--frame-bg); border-top: 1px solid var(--frame-line); }
  .client-nav .cn-brand, .client-nav .cn-grow, .client-nav .cn-jen, .client-nav .cn-foot { display: none; }
  .client-nav .cn-preview { position: fixed; left: 8px; right: 8px; bottom: calc(var(--tabbar) + 14px); margin: 0; z-index: 41; }
  .client-nav .cn-items { flex-direction: row; width: 100%; gap: 2px; }
  .cn-item { flex: 1 1 0; flex-direction: column; gap: 3px; min-height: 52px; padding: 6px 2px; font-size: 11.5px; justify-content: center; position: relative; text-align: center; min-width: 0; }
  .cn-item .cn-count { position: absolute; top: 2px; left: 55%; min-width: 18px; padding: 0 5px; font-size: 10px; line-height: 16px; background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
  body.client-mode .view { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}
/* the screens */
.c-page { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.c-narrow { max-width: 900px; }
.c-head { display: flex; flex-direction: column; gap: 6px; }
.c-head h1 { font-size: clamp(30px, 4.4vw, 40px); margin: 0; }
.c-lead { margin: 0; color: var(--muted); font-size: 16px; }
.c-back { align-self: flex-start; }
.c-section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.c-section > .card, .c-page > .card { margin: 0; }
.eyebrow.accent { color: var(--accent-ink); }
.c-brief { display: flex; gap: 16px; align-items: flex-start; padding: 24px 26px; }
.c-jen-avatar { flex: none; display: inline-flex; width: 44px; height: 44px; border-radius: 50%; align-items: center; justify-content: center; background: var(--ink); }
.c-jen-avatar .jen-mark { color: var(--page); }
.c-brief-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.c-brief-text p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--text); }
.c-brief-text p.c-brief-first { color: var(--ink); }
.c-brief-who { font-size: 14px; color: var(--muted); }
.c-brief-who strong { color: var(--ink); }
.c-setup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 18px 22px; text-decoration: none; color: var(--text); border-color: var(--accent-ink); }
.c-setup:hover { text-decoration: none; }
.c-setup .muted { flex: 1 1 260px; }
.c-list { padding: 8px; display: flex; flex-direction: column; }
.c-yes, .c-reply { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 14px; color: var(--text); text-decoration: none; min-width: 0; }
.c-yes + .c-yes, .c-reply + .c-reply, .c-row + .c-row { border-top: 1px solid var(--line-soft); }
.c-yes:hover, .c-reply:hover { background: var(--hover); text-decoration: none; }
.c-reply.is-active { background: var(--hover); }
.c-num { flex: none; display: inline-flex; width: 36px; height: 36px; border-radius: 50%; align-items: center; justify-content: center; font: 900 18px/1 var(--dot); color: var(--accent-ink); border: 1px solid var(--accent-ink); }
.c-yes.is-done .c-num { color: var(--ok); border-color: var(--ok); font-family: var(--body); font-weight: 700; }
.c-yes-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.c-yes-title { font-size: 17px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.c-yes-sub { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.c-yes.is-done .c-yes-title { color: var(--text); }
.c-empty { padding: 18px 22px; color: var(--muted); margin: 0; }
.c-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.c-tile { display: flex; flex-direction: column; gap: 14px; padding: 22px; margin: 0; }
.c-big { font: 900 52px/1 var(--dot); color: var(--ink); }
.c-tile:first-child .c-big { color: var(--accent-ink); }
.c-tile-label { font-size: 15px; font-weight: 600; color: var(--ink); }
.c-team { display: flex; gap: 14px; align-items: flex-start; padding: 22px 24px; }
.c-team-dot { width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--idle); flex: none; }
.c-team-dot.on { background: var(--ok); }
.c-team-text { display: flex; flex-direction: column; gap: 4px; }
.c-pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font: 500 12px/1.3 var(--mono); border: 1px solid var(--line-strong); color: var(--text); white-space: nowrap; }
.c-state.wait { color: var(--warn); border-color: var(--warn); }
.c-state.ok { color: var(--ok); border-color: var(--ok); }
.c-state.off { color: var(--muted); }
.c-ok { color: var(--ok); }
/* this week's posts */
.c-approve, .c-done { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 18px 22px; margin: 0; }
.c-approve { border-color: var(--accent-ink); }
.c-done { justify-content: flex-start; border-color: var(--ok); }
.c-tick { color: var(--ok); font-weight: 700; font-size: 20px; }
.c-posts { display: flex; flex-direction: column; gap: 16px; }
.c-post { display: flex; flex-wrap: wrap; gap: 20px; padding: 20px; margin: 0; }
.c-post.is-skipped { opacity: 0.55; }
.c-post-img { flex: 0 0 180px; width: 180px; height: 180px; border-radius: 14px; object-fit: cover; border: 1px solid var(--line); background: var(--well); }
.c-post-noimg { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.c-post-body { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.c-post-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.c-post-meta .c-state { margin-left: auto; }
.c-post-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 520px) { .c-post-img { flex-basis: 100%; width: 100%; height: auto; aspect-ratio: 1; } }
/* content */
.c-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 14px 16px; min-width: 0; }
.c-day { flex: 0 0 170px; font-size: 14px; color: var(--ink); font-weight: 600; }
.c-row-title { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .c-day { flex-basis: 100%; } }
.c-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.c-lib { display: flex; flex-direction: column; gap: 8px; padding: 20px; margin: 0; color: var(--text); text-decoration: none; }
.c-lib:hover { text-decoration: none; border-color: var(--line-strong); }
.c-lib .c-pill { align-self: flex-start; }
.c-lib strong { color: var(--ink); font-size: 16px; overflow-wrap: anywhere; }
.c-read { white-space: pre-wrap; overflow-wrap: anywhere; padding: 26px; line-height: 1.7; margin: 0; }
/* replies */
.c-split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.c-reply-list { flex: 1 1 300px; min-width: 0; margin: 0; }
.c-reply-detail { flex: 2 1 420px; min-width: 0; padding: 26px; display: flex; flex-direction: column; gap: 16px; margin: 0; }
.c-reply-name { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.c-initial, .c-app-initial { flex: none; display: inline-flex; width: 40px; height: 40px; border-radius: 50%; align-items: center; justify-content: center; background: var(--hover); color: var(--ink); font-weight: 700; }
.c-app-initial { border-radius: 12px; }
.c-msg { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.c-draft { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; background: var(--well); border: 1px solid var(--line); }
.c-reply-actions { flex-wrap: wrap; gap: 10px; }
/* settings */
.c-card { padding: 24px; display: flex; flex-direction: column; gap: 14px; margin: 0; min-width: 0; }
.c-card h2 { margin: 0; font-size: 18px; }
.c-card-head p { margin: 4px 0 0; }
.c-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.c-part { padding: 16px; border-radius: 14px; background: var(--well); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.c-part-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.c-part-text.is-clipped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.c-note { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.c-routine { display: flex; gap: 14px; align-items: center; padding: 12px 0; }
.c-routine + .c-routine, .c-app + .c-app { border-top: 1px solid var(--line-soft); }
.c-switch { flex: none; width: 52px; height: 30px; border-radius: 999px; padding: 3px; border: 0; background: var(--line-strong); display: flex; justify-content: flex-start; cursor: pointer; }
.c-switch.on { background: var(--lime); justify-content: flex-end; }
.c-switch:disabled { cursor: default; opacity: 0.75; }
.c-knob { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); }
.c-switch.on .c-knob { background: var(--on-lime); }
.c-switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.c-catalog { display: flex; flex-direction: column; gap: 14px; }
.c-catalog input[type="search"] { width: 100%; }
.c-group { display: flex; flex-direction: column; gap: 4px; }
.c-group[hidden], .c-app[hidden] { display: none; }
.c-apps { display: flex; flex-direction: column; }
.c-app { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 12px 0; min-width: 0; }
.c-app .row { gap: 10px; }
.c-expand { flex-basis: 100%; min-width: 0; }
.c-expand[hidden] { display: none; }
.c-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.c-people { margin: 0; padding-left: 18px; }
/* Ask Jen */
.jen-panel { position: fixed; z-index: 60; top: 16px; right: 16px; bottom: 16px; width: min(440px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 12px; padding: 22px;
  background: var(--surface); border: 1px solid var(--accent-ink); border-radius: var(--radius); box-shadow: var(--shadow-3); }
.jen-panel[hidden] { display: none; }
.jen-panel p { margin: 0; }
.jen-messages { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.c-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.c-chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 500 12.5px/1.4 var(--mono); cursor: pointer; }
.c-chip:hover { background: var(--hover); }
.jen-compose { display: flex; gap: 8px; align-items: flex-end; }
.jen-compose textarea { flex: 1; min-width: 0; resize: none; }
.c-mic { width: 48px; padding: 0; justify-content: center; }
.c-mic.is-on { background: var(--lime); color: var(--on-lime); }
@media (max-width: 767.98px) { .jen-panel { inset: 0; width: auto; border-radius: 0; border: 0; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); } }
.c-page a.btn, .c-yes .btn, .jen-panel a.btn { text-decoration: none; }
@media (max-width: 520px) {
  .c-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .c-tile { padding: 16px; gap: 10px; }
  .c-big { font-size: 38px; }
  .c-yes { flex-wrap: wrap; gap: 10px 14px; padding: 14px 12px; }
  .c-yes > .btn { margin-left: 50px; }
}

/* 02-11-2026: Show me around, a tour that points at one thing at a time. */
.tour { position: fixed; inset: 0; z-index: 80; }
.tour-shade { position: absolute; inset: 0; background: rgba(10, 9, 8, .62); }
.tour-spot[hidden] { display: none; }
.tour-spot ~ .tour-tip { position: fixed; }
.tour-spot:not([hidden]) { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(10, 9, 8, .62), 0 0 0 2px var(--lime); pointer-events: none; transition: top .2s, left .2s, width .2s, height .2s; }
.tour:has(.tour-spot:not([hidden])) .tour-shade { background: transparent; }
.tour-tip { width: min(340px, calc(100vw - 32px)); margin: 0; display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--card-solid, var(--card)); box-shadow: 0 18px 48px rgba(0, 0, 0, .45); }
.tour-tip.is-center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.tour-title { margin: 0; font-size: 19px; line-height: 1.25; color: var(--ink); }
.tour-text { margin: 0; color: var(--text); font-size: 15px; line-height: 1.5; }
.tour-count { font: 500 12px/1.4 var(--mono); letter-spacing: .06em; color: var(--muted); }
.tour-skip { background: none; border: 0; padding: 8px 0 8px 8px; min-height: 36px; color: var(--muted); font-size: 13px; cursor: pointer; }
.tour-skip:hover { color: var(--ink); }
.tour-actions { justify-content: flex-end; gap: 8px; }
.tour-actions .btn[hidden] { display: none; }
.cn-tour { margin: 10px 6px 0; background: none; border: 0; padding: 8px; min-height: 40px; color: var(--muted); font-size: 13px; text-align: left; cursor: pointer; border-radius: 10px; }
.cn-tour:hover { color: var(--ink); background: var(--hover); }
@media (max-width: 767.98px) { .client-nav .cn-tour { display: none; } }
@media (prefers-reduced-motion: reduce) { .tour-spot:not([hidden]) { transition: none; } }

/* 03-11-2026: a radio keeps its own size (the input rule above is for text fields). */
.c-routine input[type="radio"] { width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; flex: 0 0 auto; box-shadow: none; accent-color: var(--lime); }
