/* Ticket Relay admin console. Colors live only in the tokens below. */

:root {
  /* surfaces */
  --bg: #f7f8fa;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --surface-3: #e9ebef;
  --input-bg: #ffffff;
  --nav-hover: #f3f4f6;
  --nav-active: #eceef1;
  /* lines */
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --border-hover: #b8bdc6;
  /* text */
  --text: #111318;
  --muted: #646b78;
  --faint: #9ca3af;
  /* accent */
  --accent: #4f5bd5;
  --accent-hover: #4350c4;
  --accent-soft: #eef0fd;
  --accent-text: #3a46c4;
  --on-accent: #ffffff;
  --ring: rgba(79, 91, 213, 0.28);
  /* status: *-text on *-soft is AA; bare colors are for dots and icons */
  --ok: #16a34a;     --ok-text: #17703d;     --ok-soft: #e7f6ee;     --ok-border: #bfe5cf;
  --warn: #d97706;   --warn-text: #8a5800;   --warn-soft: #fdf4e1;   --warn-border: #f1d9a6;
  --danger: #dc2626; --danger-text: #b42318; --danger-soft: #fdecea; --danger-border: #f5c2bd;
  --danger-fill: #c4372d;
  --info-border: #d9ddfb;
  /* controls */
  --switch-off: #c4c9d1;
  --knob: #ffffff;
  --knob-shadow: 0 1px 2px rgba(16, 24, 40, 0.24);
  --seg-selected: #ffffff;
  /* elevation */
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-seg: 0 1px 2px rgba(16, 24, 40, 0.08), 0 0 0 1px rgba(16, 24, 40, 0.04);
  --shadow-pop: 0 8px 24px rgba(16, 24, 40, 0.12), 0 1px 3px rgba(16, 24, 40, 0.06);
  --scrim: rgba(17, 19, 24, 0.32);
  /* Discord preview (same in both themes) */
  --discord-bg: #313338; --discord-embed: #2b2d31; --discord-text: #dbdee1; --discord-head: #f2f3f5;
  --discord-muted: #949ba4; --discord-select: #1e1f22; --discord-blurple: #5865f2; --discord-green-btn: #248046;
  --discord-embed-green: #2e9e5b; --discord-mention-bg: rgba(88, 101, 242, 0.3); --discord-mention: #c9cdfb; --discord-on: #ffffff; --discord-red: #f23f43;
  --discord-link: #00a8fc; --discord-grey-btn: #4e5058; --discord-embed-amber: #d99a1e;
  /* data colors (dots only) */
  --dot-0: #d73a4a; --dot-1: #1a9fa8; --dot-2: #8250df; --dot-3: #0e8a16; --dot-4: #d97706; --dot-5: #3498db; --dot-6: #e4609b; --dot-7: #6b7280;
  --role-0: #2ecc71; --role-1: #3498db; --role-2: #9b59b6; --role-3: #e67e22; --role-4: #e91e63; --role-5: #1abc9c;

  /* spacing, radii, layout */
  --r-xs: 4px; --r-sm: 6px; --r: 8px; --r-full: 999px;
  --sidebar-w: 240px; --topbar-h: 52px; --page-max: 1080px; --page-max-full: 2400px;
  --ease: cubic-bezier(0.2, 0, 0, 1); --t-fast: 120ms; --t: 160ms;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* charts (validated categorical order: blue, orange, aqua, yellow) */
  --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-4: #eda100; --viz-5: #6250d6; --viz-6: #e87ba4;
  --viz-grid: #eceef1; --viz-base: #d1d5db; --viz-axis: #8a909b; --viz-hover: rgba(17, 19, 24, 0.05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0d10; --sidebar: #0c0d10; --surface: #131519; --surface-2: #1a1d22; --surface-3: #22262c;
    --input-bg: #0f1114; --nav-hover: #15171b; --nav-active: #1c1f25;
    --border: #24272e; --border-strong: #31353d; --border-hover: #444a54;
    --text: #ececf1; --muted: #8b929e; --faint: #5f6672;
    --accent: #5b66e6; --accent-hover: #4f5ad8; --accent-soft: #1c1f3d; --accent-text: #9aa2f5;
    --on-accent: #ffffff; --ring: rgba(124, 134, 240, 0.4);
    --ok: #3fb96f;     --ok-text: #5fd08f;     --ok-soft: #12261b;     --ok-border: #1f4a31;
    --warn: #e0a030;   --warn-text: #e8b45a;   --warn-soft: #2a210d;   --warn-border: #4a3a17;
    --danger: #ef5f55; --danger-text: #f28b82; --danger-soft: #2c1513; --danger-border: #4d2220;
    --danger-fill: #c4372d; --info-border: #2a2f55;
    --switch-off: #3a3f48; --knob: #ffffff; --knob-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    --seg-selected: #2a2e35;
    --shadow: none;
    --shadow-seg: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --scrim: rgba(0, 0, 0, 0.6);
    --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500; --viz-5: #9085e9; --viz-6: #d55181; --viz-grid: #20232a; --viz-base: #31353d; --viz-axis: #6b7280; --viz-hover: rgba(255, 255, 255, 0.05);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0d10; --sidebar: #0c0d10; --surface: #131519; --surface-2: #1a1d22; --surface-3: #22262c;
  --input-bg: #0f1114; --nav-hover: #15171b; --nav-active: #1c1f25;
  --border: #24272e; --border-strong: #31353d; --border-hover: #444a54;
  --text: #ececf1; --muted: #8b929e; --faint: #5f6672;
  --accent: #5b66e6; --accent-hover: #4f5ad8; --accent-soft: #1c1f3d; --accent-text: #9aa2f5;
  --on-accent: #ffffff; --ring: rgba(124, 134, 240, 0.4);
  --ok: #3fb96f;     --ok-text: #5fd08f;     --ok-soft: #12261b;     --ok-border: #1f4a31;
  --warn: #e0a030;   --warn-text: #e8b45a;   --warn-soft: #2a210d;   --warn-border: #4a3a17;
  --danger: #ef5f55; --danger-text: #f28b82; --danger-soft: #2c1513; --danger-border: #4d2220;
  --danger-fill: #c4372d; --info-border: #2a2f55;
  --switch-off: #3a3f48; --knob: #ffffff; --knob-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  --seg-selected: #2a2e35;
  --shadow: none;
  --shadow-seg: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --scrim: rgba(0, 0, 0, 0.6);
  --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500; --viz-5: #9085e9; --viz-6: #d55181; --viz-grid: #20232a; --viz-base: #31353d; --viz-axis: #6b7280; --viz-hover: rgba(255, 255, 255, 0.05);
  color-scheme: dark;
}

/* ---- Base ---------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/20px var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; font-weight: 600; }
h1 { font-size: 20px; line-height: 28px; letter-spacing: -0.01em; }
h2, h3 { font-size: 14px; line-height: 20px; }
p { margin: 0; }
b, strong { font-weight: 600; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
ul, ol { margin: 0; }
code, .mono { font: 12px/16px var(--mono); letter-spacing: 0; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: var(--r-xs); overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; line-height: 20px; }
.xs { font-size: 12px; line-height: 16px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.row.gap-4 { gap: 4px; }
.row.gap-12 { gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack.gap-8 { gap: 8px; }
.inline { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; min-width: 0; }
.inline.gap-4 { gap: 4px; }
.wrap-any { overflow-wrap: anywhere; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ml-auto { margin-left: auto; }
.inline-form { display: inline-flex; margin: 0; }
.js .nojs { display: none !important; }
.only-mobile { display: none !important; }

/* ---- Icons --------------------------------------------------------------------------------- */

.ic { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; color: inherit; }
.ic svg { width: 100%; height: 100%; display: block; }
.ic-12 { width: 12px; height: 12px; } .ic-14 { width: 14px; height: 14px; } .ic-20 { width: 20px; height: 20px; }
.ic-12 svg, .ic-14 svg { stroke-width: 2; }
.ic.ok { color: var(--ok); } .ic.warn { color: var(--warn); } .ic.danger { color: var(--danger); } .ic.muted { color: var(--muted); } .ic.faint { color: var(--faint); }

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

.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--sidebar);
  border-right: 1px solid var(--border); padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; margin-bottom: 8px; font-weight: 600; color: var(--text); }
.brand img { width: 24px; height: 24px; border-radius: var(--r-sm); flex: none; }
.brand .icon-btn { margin-left: auto; }
.ws {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 8px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text); font: inherit; cursor: pointer; text-align: left; text-decoration: none;
  transition: background var(--t-fast);
}
.ws:hover { background: var(--nav-hover); text-decoration: none; }
.ws-tile { width: 24px; height: 24px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-text); font: 600 11px/24px var(--font); text-align: center; flex: none; }
.ws-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A linked workspace: its main under the name. */
.ws-sub { display: block; font: 400 12px/16px var(--font); color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.ws:has(.ws-sub) { height: 44px; }
.ws .ic { color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font: 500 12px/16px var(--font); color: var(--muted); padding: 16px 8px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: var(--r-sm);
  color: var(--text); text-decoration: none; transition: background var(--t-fast);
}
.nav-item > .ic { color: var(--muted); }
.nav-item:hover { background: var(--nav-hover); text-decoration: none; }
.nav-item:hover > .ic, .nav-item[aria-current="page"] > .ic { color: var(--text); }
.nav-item[aria-current="page"] { background: var(--nav-active); font-weight: 500; }
.nav-item:focus-visible { outline-offset: -2px; }
.nav-item .trail { margin-left: auto; display: inline-flex; align-items: center; }

.side-foot { margin-top: auto; border-top: 1px solid var(--border); padding: 12px 8px 4px; display: flex; align-items: center; gap: 8px; }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who-role { font-size: 12px; line-height: 16px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar { display: none; }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 25; }

.main { min-width: 0; padding: 32px 40px 64px; }
.page { max-width: var(--page-max-full); margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
/*
 * Page widths. Every page starts at the same left edge, so titles never move between pages.
 * Readable pages (settings, forms, details) keep their content at --page-max; a section's
 * title and tabs still span the window, so switching tabs doesn't make them jump.
 * Full pages (tables, lists, logs) use the whole window, up to --page-max-full.
 */
.page:not(.full) > * { width: 100%; max-width: var(--page-max); }
.page:not(.full) > .tabs, .page:not(.full) > .ph:has(+ .tabs) { max-width: none; }
.page.full .readable { max-width: var(--page-max); }
/* On full pages, text still wraps at a comfortable line length. */
.page.full .card-note { padding-right: max(20px, calc(100% - 900px)); }
.page.full .notice .n-text, .page.full .log-d { max-width: 90ch; }
/* Wide tables: the main column takes the extra room, the others stay close to their content. */
@media (min-width: 1600px) { .page.full th.col-main { width: 50%; } }
@media (min-width: 2200px) { .page.full th.col-main { width: 60%; } }
.page > .ph + .tabs { margin-top: 4px; }
.page > .tabs + * { margin-top: 8px; }
.page > .ph + :not(.tabs) { margin-top: 8px; }

/* ---- Page header --------------------------------------------------------------------------- */

.ph { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: start; }
.ph-eyebrow { grid-column: 1 / -1; font: 500 12px/16px var(--font); color: var(--muted); margin-bottom: 4px; }
.crumbs { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; font: 500 12px/16px var(--font); color: var(--muted); margin-bottom: 8px; min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs .ic { color: var(--faint); }
.crumbs .current { color: var(--text); }
.ph-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ph-title h1 { min-width: 0; overflow-wrap: anywhere; }
.ph-actions { display: flex; gap: 8px; align-items: center; align-self: start; margin-top: -2px; flex-wrap: wrap; justify-content: flex-end; }
.ph-desc { grid-column: 1; color: var(--muted); margin-top: 4px; max-width: 720px; }

/* ---- Tabs ---------------------------------------------------------------------------------- */

.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  height: 36px; padding: 0; display: inline-flex; align-items: center; gap: 6px; position: relative; white-space: nowrap;
  font-weight: 500; color: var(--muted); text-decoration: none; transition: color var(--t-fast);
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); border-radius: 2px 2px 0 0; }
.tab:focus-visible { outline-offset: -2px; }
/* A page of the tool this person can't open: greyed out with a lock, like locked sidebar items. */
.tab.locked { opacity: 0.6; cursor: not-allowed; user-select: none; }
.tab.locked:hover { color: var(--muted); }
.tab.locked .ic { color: var(--faint); }

/* ---- Cards --------------------------------------------------------------------------------- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.card-h { padding: 16px 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--border); }
.card-h:last-child { border-bottom: 0; }
.card-h.strip { padding: 12px 20px; align-items: center; }
.card-h .title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.card-h .title > .ic { color: var(--muted); }
.card-h .desc { font-size: 13px; line-height: 20px; color: var(--muted); margin-top: 2px; max-width: 640px; }
.card-h .desc.inline { display: inline-flex; gap: 6px; align-items: center; }
.card-h > .actions { display: flex; gap: 8px; align-items: center; flex: none; }
.card-b { padding: 20px; }
.card-b.flush { padding: 0; }
.card-b.tight { padding: 12px 20px; }
.card-f {
  padding: 12px 20px; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  background: var(--surface-2); border-top: 1px solid var(--border);
}
.card-f.plain { background: var(--surface); }
.card-f .end { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.card-note { padding: 12px 20px; border-top: 1px solid var(--border); font-size: 12px; line-height: 16px; color: var(--muted); }
.section { padding: 20px; }
.section + .section { border-top: 1px solid var(--border); }
.section-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.section-h:last-child { margin-bottom: 0; }
.section-h .desc { font-size: 13px; line-height: 20px; color: var(--muted); margin-top: 2px; max-width: 560px; }
.sub-h { padding: 12px 20px; border-top: 1px solid var(--border); font: 500 12px/16px var(--font); color: var(--muted); }

details.card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; font-weight: 500; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary > .ic:first-child:not(.ok) { color: var(--muted); }
details.card > summary .chev { margin-left: auto; color: var(--muted); transition: transform var(--t) var(--ease); }
details.card[open] > summary { border-bottom: 1px solid var(--border); }
details.card[open] > summary .chev { transform: rotate(180deg); }
details.card > summary:focus-visible { outline-offset: -2px; }

.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.g-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.g2 > *, .g-2-1 > * { min-width: 0; }

/* ---- Settings rows ------------------------------------------------------------------------- */

.setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 16px 20px; }
.setting + .setting { border-top: 1px solid var(--border); }
.setting.flat { padding: 0; }
.setting .lbl { font-weight: 500; }
.setting .desc { font-size: 13px; line-height: 20px; color: var(--muted); max-width: 480px; margin-top: 2px; }
.setting .control { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; min-width: 0; }
.setting .control input[type="text"] { width: 280px; }
.setting .control .select { width: 240px; }
.setting .control .connector { font-size: 13px; color: var(--muted); }
.setting .value { font-size: 13px; color: var(--text); }
.setting.top { align-items: start; }

/* ---- Buttons ------------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 500 13px/1 var(--font); white-space: nowrap; cursor: pointer; text-decoration: none; user-select: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:hover { background: var(--surface-2); border-color: var(--border-hover); text-decoration: none; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.sm .ic { width: 14px; height: 14px; }
.btn.sm .ic svg { stroke-width: 2; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.ghost.muted { color: var(--muted); }
.btn.ghost.muted:hover { color: var(--text); }
.btn.ghost.danger { color: var(--danger-text); }
.btn.ghost.danger:hover { background: var(--danger-soft); }
.btn.danger-solid { background: var(--danger-fill); border-color: transparent; color: var(--on-accent); }
.btn.danger-solid:hover { filter: brightness(0.94); }
.btn.danger-outline { background: transparent; border-color: var(--danger-border); color: var(--danger-text); }
.btn.danger-outline:hover { background: var(--danger-soft); }
.btn.lg { height: 40px; padding: 0 16px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn .trail { margin-left: -2px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--muted); cursor: pointer; flex: none; position: relative; text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.xs { width: 24px; height: 24px; }
.icon-btn.xs .ic { width: 14px; height: 14px; }
.icon-btn.secondary { border: 1px solid var(--border-strong); background: var(--surface); }
.icon-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.icon-btn .dot { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--surface); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.go { display: inline-flex; align-items: center; gap: 4px; }
.btn .spin { display: none; }
.btn.loading .spin { display: inline-grid; animation: spin 0.8s linear infinite; }
.btn.loading .lead { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Inputs -------------------------------------------------------------------------------- */

input[type="text"], input[type="search"], input[type="number"], input[type="url"], select, textarea {
  height: 32px; padding: 0 10px; font: 400 13px/20px var(--font); color: var(--text); background: var(--input-bg);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); min-width: 0; max-width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--border-hover); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input[readonly] { background: var(--surface-2); }
input[readonly]:focus { box-shadow: none; border-color: var(--border-strong); }
input[type="text"].full, textarea { width: 100%; }
textarea { height: auto; min-height: 80px; padding: 6px 10px; resize: vertical; display: block; }
input[type="number"] { width: 64px; text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
input[type="number"].wide { width: 96px; text-align: left; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.6; cursor: not-allowed; }
.select { position: relative; display: inline-flex; min-width: 0; max-width: 100%; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 28px; width: 100%; cursor: pointer; }
.select .ic { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.select.sm select { height: 28px; font-size: 12px; }
.search { position: relative; width: 240px; max-width: 100%; display: inline-flex; }
.search input { width: 100%; padding-left: 30px; }
.search > .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search.sm input { height: 28px; font-size: 12px; }
.input-group { display: flex; min-width: 0; }
.input-group .addon {
  display: inline-flex; align-items: center; height: 32px; padding: 0 10px; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); font: 12px/16px var(--mono); color: var(--muted); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.input-group input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.copy-field { display: flex; gap: 8px; align-items: center; min-width: 0; }
.copy-field input { flex: 1; min-width: 0; font: 12px/16px var(--mono); }

.fields { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.field label, .field .label { font-size: 13px; line-height: 20px; font-weight: 500; }
.field .opt { color: var(--muted); font-weight: 400; }
.field .counter { font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.field .hint { font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 6px; }
.field .select, .field input[type="text"] { width: 100%; }
.fields-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px 16px; min-height: 20px; }

/* ---- Switch -------------------------------------------------------------------------------- */

.switch { position: relative; display: inline-block; width: 32px; height: 18px; flex: none; vertical-align: middle; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: var(--r-full); background: var(--switch-off); transition: background var(--t) var(--ease); }
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--knob);
  box-shadow: var(--knob-shadow); transition: transform var(--t) var(--ease);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .track { opacity: 0.5; }
.locked { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; }

/* ---- Segmented control --------------------------------------------------------------------- */

.seg { position: relative; display: inline-flex; gap: 2px; padding: 2px; height: 32px; background: var(--surface-2); border-radius: var(--r-sm); max-width: 100%; overflow-x: auto; scrollbar-width: none; flex: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-item {
  height: 28px; padding: 0 10px; border-radius: var(--r-xs); font: 500 13px/1 var(--font); color: var(--muted); display: inline-flex;
  gap: 6px; align-items: center; white-space: nowrap; text-decoration: none; border: 0; background: transparent; cursor: pointer;
  transition: color var(--t-fast);
}
.seg-item:hover { color: var(--text); text-decoration: none; }
.seg-item[aria-current="true"], .seg-item[aria-pressed="true"], .seg-item[aria-selected="true"], .seg input:checked + .seg-item { background: var(--seg-selected); color: var(--text); box-shadow: var(--shadow-seg); }
.seg-item .n { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.seg-item[aria-current="true"] .n, .seg-item[aria-pressed="true"] .n { color: var(--text); }
.seg-item:focus-visible { outline-offset: -2px; }
.seg label { display: contents; }
.seg input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.seg input:focus-visible + .seg-item { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---- Pills, tags, badges, avatars ---------------------------------------------------------- */

.pill { display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 8px; border-radius: var(--r-full); font: 500 12px/1 var(--font); white-space: nowrap; flex: none; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { background: var(--ok-soft); color: var(--ok-text); }
.pill.ok::before { background: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn-text); }
.pill.warn::before { background: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger-text); }
.pill.danger::before { background: var(--danger); }
.pill.neutral { background: var(--surface-2); color: var(--text); }
.pill.neutral::before { background: var(--muted); }
.pill.closed { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.pill.closed::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }

.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: var(--r-xs); border: 1px solid var(--border);
  background: var(--surface); font: 500 12px/1 var(--font); color: var(--text); white-space: nowrap; flex: none; max-width: 100%;
}
.tag > .ic { width: 14px; height: 14px; color: var(--muted); }
.tag > .ic svg { stroke-width: 2; }
.tag.subtle { height: 18px; border: 0; background: var(--surface-2); font-size: 11px; color: var(--muted); }
.tag.label { font: 12px/1 var(--mono); }
.tag .dot, .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); display: inline-block; }
.tag.role { font-weight: 500; }
.dot.c0 { background: var(--dot-0); } .dot.c1 { background: var(--dot-1); } .dot.c2 { background: var(--dot-2); } .dot.c3 { background: var(--dot-3); }
.dot.c4 { background: var(--dot-4); } .dot.c5 { background: var(--dot-5); } .dot.c6 { background: var(--dot-6); } .dot.c7 { background: var(--dot-7); }
.dot.r0 { background: var(--role-0); } .dot.r1 { background: var(--role-1); } .dot.r2 { background: var(--role-2); }
.dot.r3 { background: var(--role-3); } .dot.r4 { background: var(--role-4); } .dot.r5 { background: var(--role-5); }
/* Bars drawn by meter() in ui.ts, in SVG since the CSP blocks inline widths. */
.meter { display: block; overflow: hidden; border-radius: var(--r-full); }
.meter-track { fill: var(--surface-2); }
.meter-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.mh-bg.warn { fill: var(--warn-soft); } .mh-fg.warn { fill: var(--warn); }
.mh-bg.muted { fill: var(--surface-3); } .mh-fg.muted { fill: var(--faint); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }

.badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full); font: 600 11px/18px var(--font); text-align: center; font-variant-numeric: tabular-nums; background: var(--surface-2); color: var(--muted); flex: none; }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }

/* Header status chip: a dot and one short line. */
.chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; max-width: 100%; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface); font: 500 12px/1 var(--font); color: var(--muted); white-space: nowrap; }
.chip .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
a.chip:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.chip .dot.ok { background: var(--ok); }
.chip .dot.warn { background: var(--warn); }

.av { border-radius: var(--r-full); background: var(--surface-3); color: var(--text); font-weight: 600; display: inline-grid; place-items: center; flex: none; overflow: hidden; object-fit: cover; text-transform: uppercase; }
img.av { display: inline-block; }
.av-20 { width: 20px; height: 20px; font-size: 10px; } .av-24 { width: 24px; height: 24px; font-size: 11px; }
.av-28 { width: 28px; height: 28px; font-size: 12px; } .av-32 { width: 32px; height: 32px; font-size: 13px; }
.av.sq { border-radius: var(--r-sm); }
.av.pending { background: transparent; border: 1px dashed var(--border-strong); }
.who-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-cell .name { font-weight: 500; display: flex; align-items: center; gap: 6px; min-width: 0; }

/* ---- Tables -------------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { height: 36px; padding: 0 16px; text-align: left; font: 500 12px/16px var(--font); color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; vertical-align: middle; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; height: 48px; }
tbody tr:first-child td { border-top: 0; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td .sub, .sub { font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 2px; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.num { font-size: 13px; color: var(--muted); }
td.center, th.center { text-align: center; }
td.actions, th.actions { width: 1%; white-space: nowrap; text-align: right; }
td.actions .row { justify-content: flex-end; gap: 4px; flex-wrap: nowrap; }
td .cell-title { font-weight: 500; color: var(--text); }
a.cell-title:hover { text-decoration: underline; }
tr.click { cursor: pointer; }
tr.click:hover td, tr.click:focus-within td { background: var(--surface-2); }
tr.off td > * { opacity: 0.6; }
tr.off td.actions > * { opacity: 1; }
th.th-perm { height: auto; padding: 12px 16px; vertical-align: bottom; white-space: normal; }
th.th-perm .l { font: 500 13px/20px var(--font); color: var(--text); }
th.th-perm .d { font: 400 12px/16px var(--font); color: var(--muted); max-width: 180px; margin-top: 2px; }
td.perm { height: 52px; }
.em { color: var(--faint); }
tr.flash td { animation: flash 1200ms var(--ease); }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }

/* ---- List rows ----------------------------------------------------------------------------- */

ul.list { list-style: none; margin: 0; padding: 0; }
ul.list > li + li { border-top: 1px solid var(--border); }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 16px; min-height: 64px; color: inherit; text-decoration: none; align-items: center; }
a.list-row:hover, .list-row:focus-within { background: var(--surface-2); text-decoration: none; }
.list-row .l1 { font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 0; }
.list-row .l2 { grid-column: 1 / -1; font-size: 12px; line-height: 16px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; display: flex; gap: 6px; align-items: center; }
.list-row.with-action { grid-template-columns: auto minmax(0, 1fr) auto; }
.list-row.with-action .l2 { grid-column: 2 / 3; }
.line { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 20px; }
.line + .line { border-top: 1px solid var(--border); }
.line .grow { flex: 1; min-width: 0; }
.line.sm { min-height: 40px; padding: 0 20px; }

/* ---- Menus --------------------------------------------------------------------------------- */

.menu-wrap { position: relative; display: inline-flex; }
.menu {
  position: fixed; min-width: 200px; max-width: calc(100vw - 16px); padding: 4px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-pop); z-index: 50; display: none; opacity: 0; transform: translateY(4px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.menu.open { display: block; }
.menu.shown { opacity: 1; transform: none; }
.menu form { margin: 0; display: block; }
.menu-item {
  display: flex; align-items: center; gap: 8px; height: 32px; width: 100%; padding: 0 8px; border: 0; border-radius: var(--r-xs);
  background: transparent; font: 400 13px/20px var(--font); color: var(--text); text-align: left; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.menu-item > .ic { color: var(--muted); }
.menu-item:hover, .menu-item:focus { background: var(--surface-2); outline: none; text-decoration: none; }
.menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.menu-item.danger, .menu-item.danger > .ic { color: var(--danger-text); }
.menu-item.current { font-weight: 500; }
.menu-item .trail { margin-left: auto; color: var(--muted); }
.menu-item[disabled] { opacity: 0.5; cursor: not-allowed; }
.menu-sep { height: 1px; background: var(--border); margin: 4px -4px; }
.menu-label { padding: 6px 8px 4px; font: 500 12px/16px var(--font); color: var(--muted); }

/* ---- Dialogs ------------------------------------------------------------------------------- */

dialog.dialog {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 0; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-pop);
}
dialog.dialog::backdrop { background: var(--scrim); }
dialog.dialog form { margin: 0; }
.dlg-h { padding: 20px 20px 0; display: flex; align-items: flex-start; gap: 12px; }
.dlg-h h2 { font-size: 16px; line-height: 24px; flex: 1; min-width: 0; }
.dlg-h .icon-btn { margin: -2px -6px 0 0; }
.dlg-b { padding: 8px 20px 20px; color: var(--muted); display: flex; flex-direction: column; gap: 16px; }
.dlg-b .field, .dlg-b .choices { color: var(--text); }
.dlg-f { padding: 12px 20px; background: var(--surface-2); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.choice:hover { border-color: var(--border-hover); }
.choice input { margin: 2px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.choice .t { font-weight: 500; }
.choice .d { font-size: 13px; color: var(--muted); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* ---- Notices ------------------------------------------------------------------------------- */

.notice { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.notice > .ic { margin-top: 2px; color: var(--muted); }
.notice.warn { border-color: var(--warn-border); }
.notice.warn > .ic { color: var(--warn); }
.notice.danger { border-color: var(--danger-border); }
.notice.danger > .ic { color: var(--danger); }
.notice.ok { border-color: var(--ok-border); }
.notice.ok > .ic { color: var(--ok); }
.notice.info { border-color: var(--info-border); }
.notice .n-title { font-size: 13px; line-height: 20px; font-weight: 600; color: var(--text); }
.notice .n-text { font-size: 13px; line-height: 20px; color: var(--muted); overflow-wrap: anywhere; }
.notice .n-text ul { padding-left: 18px; margin-top: 4px; }
.notice .n-action { align-self: center; display: flex; gap: 8px; }
.notice.flat { border-radius: 0; border-width: 1px 0 0; }
.viewonly { min-height: 36px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }

/* ---- Toast --------------------------------------------------------------------------------- */

.toasts { position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px) + var(--dock-space, 0px) + var(--kn-space, 0px)); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; max-width: 360px; min-height: 40px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-pop); font: 500 13px/20px var(--font); color: var(--text);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.toast.enter, .toast.leave { opacity: 0; transform: translateY(4px); }
.toast > .ic.lead { align-self: flex-start; margin-top: 2px; }
.toast .icon-btn { margin: -4px -8px -4px 0; }

/* ---- Empty states -------------------------------------------------------------------------- */

.empty { padding: 48px 16px; text-align: center; display: grid; justify-items: center; }
.empty .circle { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.empty .circle .ic.ok { color: var(--ok); }
.empty h3 { margin-top: 12px; }
.empty p { font-size: 13px; color: var(--muted); max-width: 360px; margin-top: 4px; }
.empty .actions { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---- Stats --------------------------------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { display: block; text-align: left; padding: 16px 20px; background: none; border: 0; border-left: 1px solid var(--border); color: var(--text); text-decoration: none; min-width: 0; transition: background var(--t-fast); }
.stat:first-child { border-left: 0; }
a.stat:hover { background: var(--surface-2); text-decoration: none; }
.stat:focus-visible { outline-offset: -2px; }
.stat .l { font-size: 12px; line-height: 16px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .v { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.stat .v.warn { color: var(--warn-text); }
.stat .v .ic { width: 14px; height: 14px; color: var(--warn); }

/* ---- Checklist, timeline, properties ------------------------------------------------------- */

.checklist { list-style: none; margin: 0; padding: 0; }
.check-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 36px; padding: 4px 0; font-size: 13px; }
.check-row .detail { color: var(--muted); }
.check-row .ic.ok, .check-row > .ic { align-self: start; margin-top: 2px; }

ol.activity { list-style: none; margin: 0; padding: 0; }
ol.activity li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding-bottom: 16px; position: relative; font-size: 13px; line-height: 20px; }
ol.activity li:last-child { padding-bottom: 0; }
ol.activity li:not(:last-child)::before { content: ''; position: absolute; left: 11.5px; top: 28px; bottom: 4px; width: 1px; background: var(--border); }
.marker { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); }
.marker .ic.ok { color: var(--ok); } .marker .ic.warn { color: var(--warn); } .marker .ic.danger { color: var(--danger); }
ol.activity .actor { font-weight: 500; }
ol.activity .when { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
ol.activity .extra { font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 2px; }

dl.props { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; padding: 16px 20px; margin: 0; }
dl.props dt { font-size: 12px; line-height: 16px; color: var(--muted); }
dl.props dd { margin: 0; font-size: 13px; line-height: 20px; overflow-wrap: anywhere; display: flex; gap: 6px; align-items: center; min-width: 0; flex-wrap: wrap; }
dl.props dd .ic { color: var(--muted); }

.ticket-text { font-size: 14px; line-height: 22px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-family: var(--font); }

/* ---- Discord preview ----------------------------------------------------------------------- */

.dp-cap { display: flex; align-items: center; gap: 6px; font: 500 12px/16px var(--font); color: var(--muted); margin-bottom: 8px; min-height: 24px; }
.dp-cap .ic { color: var(--muted); }
.dp-cap .btn { margin-left: auto; }
.dp { background: var(--discord-bg); color: var(--discord-text); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.dp-msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
.dp-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--discord-blurple); }
.dp-avatar img { width: 100%; height: 100%; display: block; }
.dp-name { color: var(--discord-head); font-weight: 500; }
.dp-tag { background: var(--discord-blurple); color: var(--discord-on); font-size: 10px; font-weight: 600; padding: 0 4px; border-radius: 3px; margin-left: 4px; vertical-align: 1px; }
.dp-embed { margin-top: 6px; background: var(--discord-embed); border-left: 4px solid var(--discord-blurple); border-radius: 4px; padding: 10px 14px 12px; }
.dp-embed.green { border-left-color: var(--discord-embed-green); }
.dp-embed.amber { border-left-color: var(--discord-embed-amber); }
.dp-embed h4 { color: var(--discord-head); font-size: 15px; line-height: 22px; margin: 0 0 4px; }
.dp-embed p { margin: 0; font-size: 13px; line-height: 19px; }
.dp-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; background: var(--discord-select); border-radius: 3px; padding: 1px 4px; }
.dp-h { display: block; color: var(--discord-head); font-weight: 600; font-size: 14px; margin-top: 6px; }
.dp-mention { background: var(--discord-mention-bg); color: var(--discord-mention); border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dp-select { margin-top: 8px; background: var(--discord-select); color: var(--discord-muted); border-radius: 4px; height: 40px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.dp-select .ic { width: 16px; height: 16px; }
.dp-options { margin-top: 4px; background: var(--discord-select); border-radius: 4px; padding: 4px; }
.dp-option { padding: 6px 8px; border-radius: 3px; font-size: 13px; }
.dp-option strong { display: block; color: var(--discord-head); font-weight: 500; }
.dp-option span { color: var(--discord-muted); font-size: 12px; }
.dp-button { display: inline-flex; align-items: center; margin-top: 8px; background: var(--discord-green-btn); color: var(--discord-on); border-radius: 3px; height: 32px; padding: 0 16px; font-size: 14px; font-weight: 500; }
.dp-modal-title { color: var(--discord-head); font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.dp-field { margin-top: 10px; }
.dp-field .dp-l { color: var(--discord-head); font-size: 12px; font-weight: 600; }
.dp-field .dp-input { margin-top: 4px; background: var(--discord-select); border-radius: 3px; height: 32px; }
.dp-field .dp-input.tall { height: 64px; }
.dp-note { font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 8px; }
.dp + .dp-cap, .dp-note + .dp-cap { margin-top: 16px; }

/* Announcements: text above the embed, a linked title, list items, the date, link buttons in a row. */
.dp-content { margin-top: 2px; }
.dp-a { color: var(--discord-link); }
.dp-li { display: block; position: relative; padding-left: 16px; }
.dp-li::before { content: '•'; position: absolute; left: 4px; }
.dp-time { margin-top: 8px; color: var(--discord-muted); font-size: 12px; line-height: 16px; }
.dp-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dp-buttons .dp-button { margin-top: 0; }
.dp-button.grey { background: var(--discord-grey-btn); gap: 6px; }
.dp-button.blurple { background: var(--discord-blurple); }
.dp-content[hidden], .dp-embed h4[hidden], .dp-buttons[hidden] { display: none; }

/* Discord tickets › Panel: the menu or the buttons (My tickets), and the private My tickets reply. */
.panel-preview [data-layout][hidden] { display: none; }
/* Discord tickets › Panel › My tickets: what members can do on an open ticket, under the switch. */
.member-actions { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.member-actions .section-h h4 { font-size: 14px; line-height: 20px; }
/* A linked workspace on its main's panel: no My tickets switch above, so nothing to separate from. */
.section > [hidden]:first-child + .member-actions { margin-top: 0; padding-top: 0; border-top: 0; }
.member-action + .member-action { margin-top: 20px; }
.member-action > .fields { margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--border); }
.member-action code { font-size: 12px; }
@media (max-width: 640px) { .member-actions .section-h { flex-wrap: wrap; } .member-actions .section-h > div { flex: 1 1 100%; } }
.panel-preview [data-layout] > .dp-cap:first-child, .panel-preview [data-layout] + .dp-cap { margin-top: 16px; }
.dp-ts { color: var(--discord-muted); }
.dp-ephemeral { display: flex; align-items: center; gap: 4px; margin-top: 6px; color: var(--discord-muted); font-size: 12px; line-height: 16px; }

/* ---- Page grids ---------------------------------------------------------------------------- */

.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.panel-grid > * { min-width: 0; }
.panel-preview { position: sticky; top: 24px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto 1fr; gap: 24px; align-items: start; grid-template-areas: "desc details" "activity details"; }
.detail-grid > * { min-width: 0; }
.detail-grid .a-desc { grid-area: desc; }
.detail-grid .a-activity { grid-area: activity; }
.detail-grid .a-details { grid-area: details; }
.detail-grid .a-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.toolbar { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.toolbar .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .search { width: 220px; }
.toolbar .filters-btn { display: none; }
.pager { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }

.tile { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }

/* ---- Standalone pages (sign-in, invitations, errors) ---------------------------------------- */

.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth { width: 100%; max-width: 400px; }
.auth .brand { justify-content: center; margin-bottom: 16px; }
.auth .card-b { display: flex; flex-direction: column; gap: 16px; }
.auth h1 { font-size: 18px; line-height: 26px; }
.auth-result { display: grid; justify-items: center; text-align: center; gap: 8px; }
.auth-result .circle { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }
.auth-result .circle .ic { width: 20px; height: 20px; }
.ws-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.ws-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--text); }
.ws-list a + a { border-top: 1px solid var(--border); }
.ws-list a:hover { background: var(--surface-2); text-decoration: none; }
.ws-list .ic { margin-left: auto; color: var(--muted); }
.ws-list a.linked { padding-left: 32px; }
/* Settings › Linked workspaces: the new workspace's name, then its button (stacked on phones). */
.linked-new { flex-wrap: wrap; gap: 8px; }
.linked-new > input { flex: 1 1 240px; min-width: 0; }
@media (max-width: 640px) { .linked-new > .end { flex: 1 1 100%; justify-content: flex-end; } }

/* ---- Responsive ---------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
  .panel-preview { position: static; }
}
@media (max-width: 1000px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "desc" "details" "activity"; }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .topbar { display: flex; align-items: center; gap: 8px; height: var(--topbar-h); padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
  .topbar .brand { margin: 0; padding: 0; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 280px; max-width: 86vw; height: 100%; padding-top: calc(12px + env(safe-area-inset-top, 0px));
    transform: translateX(-100%); visibility: hidden; box-shadow: none; transition: transform var(--t) var(--ease), visibility var(--t);
  }
  .sidebar.open { transform: none; visibility: visible; box-shadow: var(--shadow-pop); }
  .main { padding: 24px; }
  .g2, .g-2-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 901px) {
  .drawer-only { display: none !important; }
}
@media (max-width: 640px) {
  .main { padding: 16px 16px 48px; }
  .card-h { padding: 12px 16px; }
  .card-h.strip { padding: 12px 16px; }
  .card-b, .section { padding: 16px; }
  .card-b.tight { padding: 12px 16px; }
  .card-f, .card-note, .sub-h { padding-left: 16px; padding-right: 16px; }
  .line { padding-left: 16px; padding-right: 16px; }
  .ph { grid-template-columns: minmax(0, 1fr); }
  .ph-actions { grid-row: auto; margin-top: 12px; justify-content: flex-start; }
  .setting { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; }
  .setting.switch-row { grid-template-columns: minmax(0, 1fr) auto; }
  .setting .control { justify-content: flex-start; }
  .setting .control input[type="text"], .setting .control .select { width: 100%; }
  .setting.flat { padding: 0; }
  .only-desktop { display: none !important; }
  .only-mobile { display: block !important; }
  .table-wrap table { min-width: 640px; }
  .table-wrap.wide table { min-width: 720px; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .seg { width: 100%; }
  .toolbar .tools { width: 100%; }
  .toolbar .search { width: auto; flex: 1; }
  .toolbar .filters-btn { display: inline-flex; }
  .toolbar .filter-selects { display: none; width: 100%; gap: 8px; }
  .toolbar .filter-selects.show, .no-js .toolbar .filter-selects { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar .filter-selects .select { width: 100%; }
  .stat { padding: 12px; }
  .stat .v { font-size: 20px; line-height: 28px; }
  .toasts { left: 16px; right: 16px; bottom: calc(16px + var(--dock-space, 0px) + var(--kn-space, 0px)); align-items: stretch; }
  .toast { max-width: none; }
  .fields-2 { grid-template-columns: minmax(0, 1fr); }
  dl.props { grid-template-columns: 88px minmax(0, 1fr); padding: 16px; }
  .search { width: 100%; }
  .copy-field { flex-wrap: wrap; }
  .invite-grid { grid-template-columns: minmax(0, 1fr) !important; }
}
.choice .t, .choice .d { display: block; }
.sidebar > .menu-wrap { display: flex; margin-bottom: 4px; }
.mt-16 { margin-top: 16px; }
html:not(.js) [data-reset-fields] { display: none; }
.invite-grid { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px 16px; align-items: start; }
.invite-grid > .lbl { font-weight: 500; line-height: 32px; }
.who-cell .sub { display: block; }
.who-cell > span { min-width: 0; }
.name { font-weight: 500; }
a.line { color: var(--text); text-decoration: none; }
a.line:hover { background: var(--surface-2); text-decoration: none; }
a.line:focus-visible { outline-offset: -2px; }
.line.provider { min-height: 64px; }
.setting .control .copy-field { width: 420px; max-width: 100%; }
.setting.top .control { padding-top: 0; }
details.setup-done > summary .truncate { flex: 0 1 auto; }
ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
ol.steps > li { counter-increment: step; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 13px; line-height: 20px; }
ol.steps > li::before { content: counter(step); width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font: 600 12px/1 var(--font); color: var(--muted); }
ol.steps strong { font-weight: 500; }
@media (max-width: 640px) { .setting .control .copy-field { width: 100%; } }
.mt-8 { margin-top: 8px; }
.ws-list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ws-list .ws-tile { flex: none; }
.grow { flex: 1; min-width: 0; }
th.th-perm:first-child { padding-left: 20px; }
.setting.flat + .setting.flat { margin-top: 16px; padding-top: 16px; }
.ph-actions { margin-bottom: -2px; }
@media (max-width: 640px) { th.th-perm:first-child { padding-left: 16px; } }
.setting.stacked { grid-template-columns: minmax(0, 1fr); gap: 12px; }
/* The label column never collapses, even when a control is wide. */
.setting:not(.stacked) > :first-child { min-width: min(220px, 100%); }
.setting.stacked .control { justify-content: flex-start; }
@media (max-width: 640px) { .ph-desc { order: 1; } .ph-actions { order: 2; } }
@media (max-width: 640px) {
  .notice { grid-template-columns: 16px minmax(0, 1fr); }
  .notice > span:last-child:empty { display: none; }
  .notice .n-action { grid-column: 2; justify-self: start; }
}

/* ---- Legal pages ------------------------------------------------------------------------- */

.legal { max-width: 720px; margin: 0 auto; padding: 40px 24px 64px; }
.legal > .brand { display: inline-flex; padding: 0; margin-bottom: 32px; color: var(--text); text-decoration: none; }
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 40px 48px; }
.prose header { padding-bottom: 24px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.prose h1 { font-size: 24px; line-height: 32px; letter-spacing: -0.01em; }
.prose .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.prose header > p:not(.meta) { margin-top: 16px; }
.prose h2 { font-size: 16px; line-height: 24px; margin-top: 32px; }
.prose h3 { font-size: 14px; line-height: 20px; margin-top: 20px; }
.prose p, .prose li { font-size: 14px; line-height: 22px; color: var(--text); }
.prose p { margin-top: 12px; }
.prose ul { margin-top: 12px; padding-left: 20px; }
.prose li + li { margin-top: 6px; }
.prose strong { font-weight: 600; }
.prose .toc { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 16px; padding: 0; list-style: none; }
.prose .toc li { font-size: 13px; margin: 0; }
.legal-links { display: flex; justify-content: center; gap: 8px; margin-top: 16px; font-size: 12px; line-height: 16px; color: var(--faint); }
.legal-links a { color: var(--muted); }
.legal-links a:hover { color: var(--text); }
@media (max-width: 640px) {
  .legal { padding: 24px 16px 48px; }
  .prose { padding: 24px 20px; }
}

/* ---- Triage ------------------------------------------------------------------------------ */
.dot.p-critical { background: var(--danger); } .dot.p-high { background: var(--warn); }
.dot.p-medium { background: var(--dot-5); } .dot.p-low { background: var(--faint); }
.tri-row { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 0; font-size: 13px; line-height: 20px; }
.tri-row + .tri-row { border-top: 1px solid var(--border); }
.tri-row > .ic:first-child { align-self: center; }
.mt-8 { margin-top: 8px; }
.tri-suggest { flex-wrap: wrap; }
.tri-suggest .tri-actions { flex-basis: 100%; display: flex; gap: 4px; padding: 0 0 4px 22px; }
.rule-check { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; cursor: pointer; vertical-align: middle; }
#rules th.th-perm .d { max-width: none; }

/* ---- Form builder -------------------------------------------------------------------------- */
html:not(.js) .js-only { display: none !important; }
.slots { display: flex; align-items: center; gap: 8px; flex: none; }
.pips { display: inline-flex; gap: 3px; }
.pip { width: 14px; height: 6px; border-radius: var(--r-full); background: var(--surface-3); transition: background var(--t-fast); }
.pip.on { background: var(--accent); }
ol.fsecs { list-style: none; margin: 0; padding: 0; counter-reset: fsec; }
.fsec { counter-increment: fsec; border-bottom: 1px solid var(--border); }
.fsec-h { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
.fsec-n { width: 20px; flex: none; font: 600 12px/16px var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.fsec-n::before { content: counter(fsec); }
.fsec-t { font-weight: 500; overflow-wrap: anywhere; }
.fsec-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.fsec-b { padding: 0 20px 16px 84px; }
.fsec[data-kind="intro"] .fsec-h .tile, .fsec[data-kind="title"] .fsec-h .tile, .fsec[data-kind="description"] .fsec-h .tile { color: var(--muted); }
.fsec.enter { animation: fsec-in var(--t) var(--ease); }
@keyframes fsec-in { from { background: var(--accent-soft); } to { background: transparent; } }
.fadd { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.fadd .btn[disabled] { pointer-events: none; }
.form-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
.form-link .grow { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .fsec-h { padding: 12px 16px; gap: 8px; }
  .fsec-h .tile { display: none; }
  .fsec-b { padding: 0 16px 16px; }
  .fadd { padding: 16px; }
  .card-h .slots { margin-top: 4px; }
}

/* Form preview (Discord modal) */
.dp-form { padding: 16px 16px 12px; }
.dp-text { margin: 0 0 4px; font-size: 13px; line-height: 19px; }
.dp-field .dp-d { color: var(--discord-muted); font-size: 12px; line-height: 16px; margin-top: 2px; }
.dp-req { color: var(--discord-red); }
.dp-field .dp-input { display: flex; align-items: flex-start; padding: 7px 10px; font-size: 13px; line-height: 18px; min-height: 32px; height: auto; }
.dp-field .dp-input.tall { min-height: 64px; }
.dp-ph { color: var(--discord-muted); overflow-wrap: anywhere; }
.dp-drop { margin-top: 4px; border: 1px dashed var(--discord-muted); border-radius: 4px; min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--discord-muted); font-size: 13px; padding: 8px; text-align: center; }
.dp-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dp-btn { display: inline-flex; align-items: center; height: 32px; padding: 0 16px; border-radius: 3px; background: var(--discord-blurple); color: var(--discord-on); font-size: 13px; font-weight: 500; }
.dp-btn.link { background: transparent; color: var(--discord-text); }

/* ---- Files ---------------------------------------------------------------------------------- */
ul.file-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.file-tile { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); min-width: 0; display: flex; flex-direction: column; }
.file-thumb { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); overflow: hidden; border-bottom: 1px solid var(--border); }
a.file-thumb:hover { text-decoration: none; }
a.file-thumb:focus-visible { outline-offset: -2px; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-meta { display: flex; align-items: center; gap: 4px; padding: 8px 6px 8px 10px; min-width: 0; }
.file-name { font-size: 13px; line-height: 18px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tile .sub { overflow-wrap: anywhere; }
.file-tile.off .file-name { color: var(--muted); font-weight: 400; }
.upload { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.card-b > .upload:first-child { margin-top: 0; }
.sr-only-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: var(--r); background: var(--surface-2); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone > span { display: flex; flex-direction: column; min-width: 0; }
.dz-title { font-size: 13px; line-height: 20px; font-weight: 500; overflow-wrap: anywhere; }
.sr-only-input:focus-visible + .dropzone { outline: 2px solid var(--accent); outline-offset: 2px; }
.upload-f { display: flex; justify-content: flex-end; }
.answer-q { font-size: 13px; margin-top: 16px; color: var(--muted); font-weight: 500; }

.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); min-height: 44px; }
th.check-col, td.check-col { width: 1%; padding-right: 0; }
.thumbs { display: inline-flex; }
.thumb { width: 28px; height: 28px; border-radius: var(--r-xs); object-fit: cover; background: var(--surface-2); border: 2px solid var(--surface); display: inline-grid; place-items: center; color: var(--muted); font: 600 10px/1 var(--font); }
.thumb + .thumb { margin-left: -8px; }
progress.bar { display: block; width: 100%; max-width: 200px; height: 6px; margin-top: 8px; border: 0; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; -webkit-appearance: none; appearance: none; }
progress.bar::-webkit-progress-bar { background: var(--surface-3); border-radius: var(--r-full); }
progress.bar::-webkit-progress-value { background: var(--accent); border-radius: var(--r-full); }
progress.bar::-moz-progress-bar { background: var(--accent); border-radius: var(--r-full); }
progress.bar.warn::-webkit-progress-value { background: var(--warn); }
progress.bar.warn::-moz-progress-bar { background: var(--warn); }
.stat .sub { margin-top: 4px; }

fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.plain[disabled] .setting .control { opacity: 0.7; }

/* ---- Issues tab ----------------------------------------------------------------------------- */
ul.list.issues > li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px; }
.issue-ic { margin-top: 2px; flex: none; }
.issue-t { font-weight: 500; overflow-wrap: anywhere; }
.issue-t a { color: var(--text); }
.issue-snip { margin-top: 4px; font-size: 13px; line-height: 20px; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.issue-snip mark { background: var(--accent-soft); color: var(--text); border-radius: 2px; padding: 0 1px; }
.issue-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
@media (max-width: 640px) {
  ul.list.issues > li { padding: 12px 16px; flex-wrap: wrap; }
  .issue-meta { flex-direction: row; align-items: center; width: 100%; padding-left: 28px; }
}

/* ---- Server health -------------------------------------------------------------------------- */
.meter-cell { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.meter-cell progress.bar { margin-top: 0; max-width: 220px; }
.setting .control .meter-cell { align-items: flex-end; }
.warn-text { color: var(--warn-text); font-weight: 600; }
@media (max-width: 640px) { .setting .control .meter-cell { align-items: flex-start; width: 100%; } }

/* ---- Server health page --------------------------------------------------------------------- */
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.card-h + .stats.four, .card-b + .stats.four { border-top: 1px solid var(--border); }
.stat .l { display: flex; align-items: center; gap: 6px; }
.stat .l .ic { color: var(--muted); }
.stat progress.bar { margin-top: 8px; }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.live { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-full); font: 500 12px/1 var(--font); color: var(--muted); white-space: nowrap; }
.live .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s var(--ease) infinite; }
.live.off .pulse { background: var(--warn); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--ok-border); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.chart-h { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
figure.chart { margin: 0; min-width: 0; }
figure.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
figure.chart .grid { stroke: var(--border); stroke-width: 1; }
figure.chart .limit { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 4 4; }
figure.chart .axis { fill: var(--muted); font: 11px var(--font); font-variant-numeric: tabular-nums; }
figure.chart path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; background: var(--faint); }
.s-host { stroke: var(--accent); } .key.s-host { background: var(--accent); }
.s-web { stroke: var(--dot-5); } .key.s-web { background: var(--dot-5); }
.s-worker { stroke: var(--dot-1); } .key.s-worker { background: var(--dot-1); }
.s-triage { stroke: var(--dot-2); } .key.s-triage { background: var(--dot-2); }
svg.spark { width: 120px; height: 28px; display: block; }
svg.spark path { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
td.num svg.spark { margin-left: auto; margin-top: 2px; width: 72px; height: 20px; }
.spark.empty { display: block; width: 120px; height: 1px; background: var(--border); margin: 13px 0; }
tr.off-row td { background: var(--danger-soft); }
@media (max-width: 900px) { .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats.four .stat:nth-child(3) { border-left: 0; } .stats.four .stat:nth-child(n+3) { border-top: 1px solid var(--border); } .charts { grid-template-columns: minmax(0, 1fr); } }

/* ---- Triage: what Apply does, settings pages, re-runs ---------------------------------------- */
.tri-summary { margin: 4px 0 8px; }
.tri-more { flex-basis: 100%; padding: 0 0 4px 22px; font-size: 13px; line-height: 20px; }
.tri-more > summary { list-style: none; display: block; cursor: pointer; color: var(--text); font-weight: 500; border-radius: var(--r-xs); }
.tri-more > summary .chev { vertical-align: -2px; margin-right: 4px; }
.tri-more > summary::-webkit-details-marker { display: none; }
.tri-more > summary .chev { color: var(--muted); transition: transform var(--t) var(--ease); }
.tri-more[open] > summary .chev { transform: rotate(90deg); }
.tri-more > summary .muted { font-weight: 400; }
.tri-effects { list-style: none; margin: 6px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tri-effects li { display: flex; gap: 8px; align-items: flex-start; }
.tri-effects li > .ic { color: var(--muted); margin-top: 3px; flex: none; }
.tri-effects li > span { min-width: 0; }
.tri-effects .tags { display: inline-flex; vertical-align: middle; }
.tri-comment { display: block; margin-top: 6px; padding: 8px 12px; background: var(--surface-2); border-left: 2px solid var(--border-strong); border-radius: 0 var(--r-sm) var(--r-sm) 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.act-more { margin-top: 12px; }
.act-more > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; line-height: 20px; color: var(--muted); border-radius: var(--r-xs); }
.act-more > summary::-webkit-details-marker { display: none; }
.act-more > summary .chev { transition: transform var(--t) var(--ease); flex: none; }
.act-more[open] > summary .chev { transform: rotate(90deg); }
.act-more > summary .what { color: var(--text); font-weight: 500; flex: none; }
.act-more > summary .truncate { min-width: 0; }
.act-more > .fields { margin-top: 16px; }
.prompt-pre { margin: 0; padding: 16px 20px; font: 12px/18px var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); background: var(--surface-2); max-height: 70vh; overflow: auto; }
.opt-list { font-family: var(--mono); font-size: 12px; line-height: 18px; }
.run-cell { display: flex; flex-direction: column; gap: 4px; min-width: 180px; font-size: 13px; line-height: 20px; }
.run-cell .tri-line { display: flex; gap: 6px; align-items: flex-start; }
.run-cell .tri-line > .ic { margin-top: 3px; flex: none; }
.run-cell details > summary { list-style: none; cursor: pointer; color: var(--accent-text); font-size: 12px; }
.run-cell details > summary::-webkit-details-marker { display: none; }
.run-cell details[open] > summary { margin-bottom: 4px; }
tr.changed > td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.diff-tag { white-space: nowrap; }
.tri-line .tags, .tri-row .tags { display: inline-flex; vertical-align: middle; }
th.half { width: 38%; }
.run-cell .tags { display: inline-flex; vertical-align: middle; }
.check-list.stacked { flex-direction: column; gap: 8px; }
input[type="number"].narrow { width: 88px; height: 28px; margin-left: 4px; }
progress.bar.wide { max-width: none; }
/* Triage: modes per source (Discord tickets, issues opened on GitHub) */
.src-modes { display: grid; grid-template-columns: auto auto; gap: 6px 10px; align-items: center; justify-items: end; flex: none; }
.src-l { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; }
.src-l .ic { color: var(--faint); }
.src-modes.gh-off .gh { opacity: 0.5; }
.src-summary { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 12px; line-height: 16px; color: var(--muted); }
.src-summary span { display: inline-flex; align-items: center; gap: 6px; }
.group-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 0; margin-top: 12px; border-top: 1px solid var(--border); }
.group-row .cell-title { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 720px) {
  .section-h:has(.src-modes), .group-row { flex-direction: column; align-items: stretch; }
  /* Each label above its control, full width. */
  .src-modes { grid-template-columns: minmax(0, 1fr); justify-items: stretch; gap: 4px; }
  .src-modes > .gh:not(.src-l) { display: block; }
  .src-l.gh { margin-top: 6px; }
  .src-modes .seg { display: flex; width: 100%; }
  .src-modes .seg-item { flex: 1; justify-content: center; }
}
/* Triage › Activity */
.danger-text { color: var(--danger-text); }
.log { list-style: none; margin: 0; padding: 0; }
.log-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; border-top: 1px solid var(--border); }
.log-row:first-child { border-top: 0; }
.log-ic { flex: none; margin-top: 2px; }
.log-t { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; line-height: 20px; }
.log-d { margin-top: 2px; color: var(--text); }
.log-d > div + div { margin-top: 2px; }
.log-k { color: var(--muted); }
.log-row .when { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.log-failed { background: color-mix(in srgb, var(--danger-soft) 40%, transparent); }
.dot.s-review { background: var(--warn); } .dot.s-partial { background: var(--dot-5); } .dot.s-applied { background: var(--ok); } .dot.s-failed { background: var(--danger); }
.dot.s-queued, .dot.s-nothing, .dot.s-reviewed, .dot.s-skipped { background: var(--faint); }
@media (max-width: 640px) { .log-row { padding: 12px 16px; flex-wrap: wrap; } .log-row .when { order: -1; margin-left: auto; } }
.log-d .tags { display: inline-flex; vertical-align: middle; }
/* Bulk triage */
.bulk-status { display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--border); }
.bulk-line { display: flex; align-items: center; gap: 12px; }
.bulk-line > .ic { flex: none; }
.issue-row .check-cell { flex: none; display: flex; align-items: center; padding-top: 2px; }
.select-all-row { min-height: 40px; align-items: center; }
/* A page this person can't open (moderators): visible, greyed out, with a lock. */
.nav-item.locked { opacity: 0.6; cursor: not-allowed; user-select: none; }
.nav-item.locked:hover { background: transparent; }
.nav-item.locked:hover > .ic { color: var(--muted); }
.nav-item.locked .trail .ic { color: var(--faint); }
.list-row .l2.tri-line-m { overflow: visible; white-space: normal; }
.seg-item.locked { opacity: 0.6; cursor: not-allowed; }
.seg-item.locked:hover { color: var(--muted); }
.seg-item.locked svg { flex: none; }
/* A page someone can see but not change: readable, clearly not editable. */
fieldset.view-only[disabled] .setting .control { opacity: 1; }
fieldset.view-only input[type="text"]:disabled, fieldset.view-only input[type="number"]:disabled, fieldset.view-only select:disabled, fieldset.view-only textarea:disabled { opacity: 1; color: var(--text); background: var(--surface-2); cursor: default; }
fieldset.view-only .seg-item, fieldset.view-only label.check, fieldset.view-only input:disabled { cursor: default; }
fieldset.view-only .seg-item:hover { color: var(--muted); }
fieldset.view-only .seg input:checked + .seg-item:hover { color: var(--text); }
fieldset.view-only .seg input:not(:checked) + .seg-item { opacity: 0.55; }
fieldset.view-only .link-btn { display: none; }

/* ---- Alerts that follow you around (the corner panel) ------------------------------------- */
.dock { position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 20; width: min(408px, calc(100vw - 48px)); display: flex; flex-direction: column; align-items: flex-end; }
.dock.min { width: auto; }
.dock-panel { width: 100%; max-height: min(70vh, 560px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); }
.dock.min .dock-panel, .dock:not(.min) .dock-pill { display: none; }
.dock-panel, .dock-pill { transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.dock.enter .dock-panel, .dock.enter .dock-pill { opacity: 0; transform: translateY(8px) scale(0.98); }
.dock-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--border); font: 500 12px/16px var(--font); color: var(--muted); }
.dock:not(.multi) .dock-h, .dock.multi .da-tools [data-dock-min] { display: none; }
.dock-alert { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 14px 12px 16px 16px; }
.dock-alert + .dock-alert:not([hidden]), .dock-alert[hidden] + .dock-alert { border-top: 1px solid var(--border); }
.dock-alert::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--warn); }
.dock-alert.danger::before { background: var(--danger); }
.dock-alert .da-ic { color: var(--warn); padding-top: 1px; }
.dock-alert.danger .da-ic { color: var(--danger); }
.da-top { display: flex; align-items: flex-start; gap: 8px; }
.da-title { flex: 1; min-width: 0; margin: 0; font: 600 14px/22px var(--font); color: var(--text); }
.da-tools { display: flex; gap: 2px; margin: -3px -4px 0 0; flex: none; }
.da-text { margin: 2px 0 0; font-size: 13px; line-height: 20px; color: var(--text); }
.da-meta { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 12px; line-height: 16px; color: var(--muted); }
.da-meta li { display: flex; gap: 8px; align-items: flex-start; }
.da-meta .ic { flex: none; margin-top: 1px; color: var(--faint); }
.da-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
/* Minimized: a small icon that stays in the corner, with how many alerts there are. */
.dock-pill { position: relative; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--warn-border); color: var(--warn); box-shadow: var(--shadow-pop); cursor: pointer; }
.dock-pill:hover { border-color: var(--warn); }
.dock-pill.danger { border-color: var(--danger-border); color: var(--danger); }
.dock-pill.danger:hover { border-color: var(--danger); }
.dock-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dock-pill .n { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full); background: var(--warn); color: #fff; font: 600 11px/18px var(--font); text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--surface); }
.dock-pill.danger .n { background: var(--danger); }
.dock-pill::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 2px solid currentColor; opacity: 0; pointer-events: none; animation: dock-ring 2.4s var(--ease) 3; }
@keyframes dock-ring { 0% { opacity: 0.45; transform: scale(1); } 100% { opacity: 0; transform: scale(1.45); } }
@media (prefers-reduced-motion: reduce) { .dock-pill::after { animation: none; } .dock-panel, .dock-pill { transition: none; } }
@media (max-width: 640px) {
  .dock { right: 12px; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto; }
  .dock.min { left: auto; }
}
@media print { .dock { display: none; } }

/* ---- Dev mode ------------------------------------------------------------------------------ */
.nav-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-text); font: 600 11px/18px var(--font); white-space: nowrap; }
.dev-switch { align-items: center; gap: 8px; height: 28px; padding: 0 4px 0 10px; border: 1px solid var(--border); border-radius: var(--r-full); }
.dev-switch label { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; }
.dev-switch:has(input:checked) { border-color: var(--info-border); background: var(--accent-soft); }
.dev-switch:has(input:checked) label { color: var(--accent-text); }

/* ---- AI triage › Review: the queue of suggestions waiting, from tickets and GitHub issues ---- */
.rv-stats > .stats.four { border-top: 0; }
.rv-stats .stat .v.accent { color: var(--accent-text); }
.bulk-lead { display: flex; align-items: center; gap: 14px; min-width: 0; padding-left: 4px; }
/* One row per ticket or issue: its title, where it came from, then its suggestions. */
.rv-list { list-style: none; margin: 0; padding: 0; }
.rv-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 16px 20px; }
.rv-list.sel .rv-item { grid-template-columns: 16px minmax(0, 1fr); }
.rv-item + .rv-item { border-top: 1px solid var(--border); }
.rv-check { display: flex; height: 20px; align-items: center; cursor: pointer; }
.rv-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.rv-title { font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.rv-title:hover { text-decoration: underline; }
.rv-ext { display: inline-flex; margin-left: 2px; vertical-align: -2px; color: var(--faint); }
.tag.rv-src { border-radius: var(--r-full); padding: 0 8px 0 6px; }
.tag.rv-src > .ic { width: 12px; height: 12px; }
.rv-ref { font: 12px/16px var(--mono); color: var(--muted); }
/* Its suggestions, side by side when there's room: what Claude found, what Apply does, how sure it is. */
.rv-suggs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 8px; }
.rv-sugg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; min-height: 44px; padding: 7px 8px 7px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--input-bg); font-size: 13px; line-height: 20px; }
.rv-sugg-b { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.rv-sugg-b .t { font-weight: 500; }
.rv-sugg-b .tags { display: inline-flex; vertical-align: middle; }
.rv-sugg-b .tag { vertical-align: middle; }
.rv-sugg-b .eff { color: var(--muted); }
.rv-conf { flex: none; font: 500 12px/20px var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.rv-sugg-act { display: flex; gap: 4px; flex: none; margin-left: auto; }
/* Outside the current filter: still there, but bulk Apply and Dismiss leave it. */
.rv-sugg.off { border-style: dashed; background: transparent; }
.rv-sugg.off .rv-sugg-b, .rv-sugg.off .rv-conf { opacity: 0.6; }
.rv-note { font-size: 12px; line-height: 16px; text-align: right; }
@media (max-width: 640px) {
  .rv-filters .select { flex: 1 1 140px; }
  .rv-item { gap: 12px; padding: 12px 16px; }
  .bulk-lead { padding-left: 0; gap: 12px; }
  .rv-note { display: none; }
}

/* ---- Overview: a card per tool, Latest and Your access (routes/workspace.ts) ---------------- */
.tool-grid { align-items: stretch; }
.tool-card { display: flex; flex-direction: column; }
.tool-card > .card-h { justify-content: flex-start; }
.tile.accent { background: var(--accent-soft); color: var(--accent-text); }
/* Cards in a row line up their numbers and buttons, even when a description wraps. */
.tool-card > .stats { margin-top: auto; }
.tool-card .stat { display: flex; flex-direction: column; }
.tool-card .stat .l { white-space: normal; text-wrap: balance; }
.tool-card .stat .v { margin-top: auto; padding-top: 4px; }
.tool-card > .card-f { padding: 12px 16px; }
.stat .v.accent { color: var(--accent-text); }
.stat .v.split { align-items: baseline; }
.stat .v.split .ic { align-self: center; }
.stat .v .of { font-size: 13px; line-height: 20px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed > li + li { border-top: 1px solid var(--border); }
.feed-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 20px; font-size: 13px; line-height: 20px; color: var(--text); }
a.feed-row { text-decoration: none; transition: background var(--t-fast); }
a.feed-row:hover { background: var(--surface-2); text-decoration: none; }
a.feed-row:focus-visible { outline-offset: -2px; }
.feed-src { width: 24px; height: 24px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); display: grid; place-items: center; flex: none; }
.feed-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-t { font-weight: 500; }
.feed-sep, .feed-d { color: var(--muted); }
.feed-row > time { flex: none; font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.my-access.two { flex-wrap: wrap; row-gap: 2px; padding-top: 10px; padding-bottom: 10px; }
.my-access .ma-pages { flex: 0 0 100%; padding-left: 28px; font-size: 12px; line-height: 16px; color: var(--muted); }
@media (max-width: 640px) {
  .feed-row { align-items: flex-start; padding: 10px 16px; }
  .feed-src { margin-top: 2px; }
  .feed-text { white-space: normal; }
  .feed-t, .feed-d { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .feed-sep { display: none; }
  .feed-row > time { margin-top: 2px; }
}

/* ---- Members › Moderator access: one moderator at a time, tool by tool ------------------------ */
/* The card lets its moderator header and the floating bar stick to the window. */
.access-card { overflow: visible; }
.acc-editor[hidden] { display: none; }
/* Whose access this is: stays at the top while you scroll through their tools. */
.acc-who { position: sticky; top: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.acc-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.acc-quick .seg-item { font-size: 12px; }
/* A tool: its icon, name and summary (click to open its pages), and a switch to open or close all of it. */
.acc-tool { border-bottom: 1px solid var(--border); }
.acc-tool-h { display: flex; align-items: center; gap: 12px; padding: 8px 20px 8px 12px; }
.acc-expand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 6px 8px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.acc-expand:hover { background: var(--nav-hover); }
.acc-expand:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.acc-tile { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); color: var(--faint); transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.acc-tool.on .acc-tile { background: var(--accent-soft); color: var(--accent-text); }
.acc-tool-t { min-width: 0; display: flex; flex-direction: column; }
.acc-tool-t .n { font: 600 14px/20px var(--font); }
.acc-tool:not(.on) .acc-tool-t .n { color: var(--muted); }
.acc-tool-t .s { font-size: 12px; line-height: 16px; color: var(--muted); }
.acc-tool.on .acc-tool-t .s { color: var(--accent-text); }
.acc-expand .chev { margin-left: auto; color: var(--faint); transition: transform var(--t) var(--ease); }
.acc-tool.expanded .acc-expand .chev { transform: rotate(180deg); }
/* Pages fold away until the tool is opened (without JavaScript they're always shown). */
.js .acc-tool:not(.expanded) .acc-pages { display: none; }
.acc-pages { padding: 0 20px 10px 64px; }
.acc-page { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.acc-page .l { font: 500 13px/20px var(--font); color: var(--text); }
.acc-page .l .tag { margin-left: 6px; vertical-align: 1px; }
.acc-page .d { font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 2px; max-width: 560px; }
/* One click per page: No access / View / Edit. Edit is tinted, No access reads as off. */
.lvl-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-sm); background: var(--surface-2); }
.lvl-seg label { display: contents; }
.lvl-seg input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.lvl-seg span { min-width: 78px; height: 28px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-xs); font: 500 12px/1 var(--font); color: var(--muted); white-space: nowrap; cursor: pointer; transition: color var(--t-fast), background var(--t-fast); }
.lvl-seg span:hover { color: var(--text); }
.lvl-seg input:checked + span { background: var(--seg-selected); color: var(--text); box-shadow: var(--shadow-seg); }
.lvl-seg input[value="none"]:checked + span { color: var(--muted); }
.lvl-seg input[value="edit"]:checked + span { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--info-border); }
.lvl-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.lvl-seg input:disabled + span { cursor: progress; }
.acc-save { padding: 12px 20px; }
@media (max-width: 720px) {
  .acc-who { top: var(--topbar-h); padding: 12px 16px; }
  .acc-tool-h { padding: 6px 16px 6px 8px; }
  .acc-pages { padding: 0 16px 10px; }
  .acc-page { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lvl-seg { display: flex; }
  .lvl-seg span { flex: 1; min-width: 0; }
}

/* The moderator's name is the picker: click it (or press ⌘K) to choose another. */
.acc-name { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 12px 4px 6px; border: 1px solid var(--info-border); border-radius: 10px; background: var(--accent-soft); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color var(--t-fast); }
.acc-name:hover { border-color: var(--accent); }
.acc-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acc-name[aria-expanded="true"] { border-color: var(--accent); }
.acc-name.static { background: transparent; border-color: transparent; padding-left: 0; cursor: default; }
.acc-name-t { display: flex; flex-direction: column; min-width: 0; }
.acc-name-t .nm { font: 600 14px/18px var(--font); }
.acc-name-t .hd { font: 400 12px/16px var(--font); color: var(--accent-text); }
.acc-name.static .hd { color: var(--muted); }
.acc-name .chev { color: var(--accent-text); transition: transform var(--t) var(--ease); }
.acc-name[aria-expanded="true"] .chev { transform: rotate(180deg); }
.acc-who-sum { font-size: 12px; line-height: 16px; color: var(--muted); }
/* ‹ 7 of 50 › steps through everyone in order. */
.acc-step { display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; }
.acc-step > span { padding: 0 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-step-btn { width: 30px; height: 30px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); text-decoration: none; }
.acc-step-btn:hover { background: var(--surface-3); text-decoration: none; }
.acc-step-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* The picker: search, filters, every moderator; floats over the page under the name. */
.acc-picker { position: fixed; z-index: 55; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-pop); overflow: hidden; }
.acc-picker[hidden] { display: none; }
.acc-picker kbd { font: 500 11px/1 var(--mono); padding: 3px 5px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted); }
.acc-picker-search { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--muted); }
.acc-picker-search input { flex: 1; min-width: 0; border: 0; padding: 0; background: transparent; color: var(--text); font: 400 14px/20px var(--font); outline: none; }
.acc-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.acc-filter { height: 26px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-full); background: transparent; color: var(--muted); font: 500 12px/1 var(--font); cursor: pointer; }
.acc-filter:hover { color: var(--text); }
.acc-filter span { color: var(--faint); font-variant-numeric: tabular-nums; margin-left: 2px; }
.acc-filter[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--info-border); color: var(--accent-text); }
.acc-filter[aria-pressed="true"] span { color: var(--accent-text); }
.acc-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.acc-options-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.acc-options-h { padding: 10px 16px 4px; font: 600 11px/16px var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.acc-options { flex: 1; min-height: 0; max-height: 360px; overflow-y: auto; padding: 0 6px 6px; scroll-padding: 6px; }
.acc-opt { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.acc-opt:hover { text-decoration: none; }
.acc-opt.active { background: var(--nav-hover); }
.acc-opt[aria-selected="true"] { background: var(--accent-soft); }
.acc-opt-t { display: flex; flex-direction: column; min-width: 0; }
.acc-opt-t .nm { font: 500 13px/18px var(--font); }
.acc-opt-t .hd { font: 400 12px/16px var(--font); color: var(--muted); }
.acc-opt-sum { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.acc-opt[aria-selected="true"] .acc-opt-sum { color: var(--accent-text); }
.acc-opt .tick { visibility: hidden; color: var(--accent-text); flex: none; }
.acc-opt[aria-selected="true"] .tick { visibility: visible; }
.acc-none { margin: 0; padding: 16px; font-size: 13px; color: var(--muted); text-align: center; }
.acc-keys { display: flex; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.acc-fallback { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.acc-fallback a[aria-current="true"] { font-weight: 600; }
@media (max-width: 720px) {
  .acc-quick { margin-left: 0; }
  .acc-keys { display: none; }
}

/* ---- AI triage › Knowledge (each app's TRIAGE.md) ---------------------------------------------- */
.kn-of { font-size: 13px; font-weight: 400; color: var(--muted); }
.kn-spin { animation: spin 1s linear infinite; }
.kn-busy { display: inline-flex; align-items: center; gap: 8px; height: 32px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.kn-auto { border-top: 1px solid var(--border); }
.kn-auto .setting .desc { max-width: 640px; }
.kn-cadence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 10px; color: var(--text); transition: opacity var(--t) var(--ease); }
.kn-cadence label { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); }
.kn-every { display: inline-flex; align-items: stretch; }
.kn-every input[type="number"] { width: 64px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.kn-every .select select { min-width: 112px; margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.kn-every input:hover, .kn-every select:hover, .kn-every input:focus, .kn-every select:focus { position: relative; z-index: 1; }
.kn-cadence-cost { display: block; margin-top: 8px; font-size: 12px; line-height: 16px; color: var(--muted); }
/* The schedule only applies while the switch is on. */
.kn-auto:has(input[name="auto"]:not(:checked)) .kn-cadence { opacity: 0.6; }
.kn-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.kn-card { display: flex; flex-direction: column; gap: 12px; height: 100%; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: border-color var(--t-fast), background var(--t-fast); }
.kn-card:hover { border-color: var(--border-hover); text-decoration: none; }
.kn-card.blank { border-style: dashed; background: transparent; box-shadow: none; }
.kn-card.blank:hover { background: var(--surface); }
.kn-card-h { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kn-card-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.kn-card-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-new { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-text); font: 500 12px/1 var(--font); white-space: nowrap; flex: none; }
.kn-file { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; line-height: 20px; color: var(--text); }
.kn-file > .ic { color: var(--muted); flex: none; }
.kn-file-state { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.kn-file.is-done .kn-file-state { color: var(--text); }
.kn-file.is-running .kn-file-state, .kn-file.is-queued .kn-file-state { color: var(--accent-text); }
.kn-file.is-failed .kn-file-state { color: var(--warn-text); }
.kn-file.is-failed > .ic { color: var(--warn); }
.kn-card-lines { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.kn-card-lines > * { max-width: 100%; }
.kn-changes { display: inline-flex; align-items: flex-start; gap: 6px; min-width: 0; font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kn-changes > .ic { flex: none; margin-top: 1px; }
.kn-changes > span { min-width: 0; }
.kn-changes.has { color: var(--text); }
.kn-changes.has > .ic { color: var(--accent-text); }
.kn-card-text { flex: 1; font-size: 13px; line-height: 20px; color: var(--muted); }
.kn-card-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kn-card-meta { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.kn-open { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-weight: 500; }
.kn-open .ic { transition: transform var(--t-fast) var(--ease); }
.kn-card:hover .kn-open .ic { transform: translateX(2px); }

.kn-title { display: inline-flex; align-items: center; gap: 10px; }
.kn-layout { grid-template-columns: minmax(0, 1fr) 360px; }
.kn-written .card-h .title .ic { color: var(--accent-text); }
.kn-progress { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--accent-soft); }
.kn-progress > .ic { color: var(--accent-text); flex: none; }
.kn-progress strong { font-size: 13px; line-height: 20px; font-weight: 500; }
.kn-progress p { margin: 2px 0 0; }
.kn-empty { padding: 28px 20px 24px; }
.kn-empty-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-text); }
.kn-empty h3 { margin: 12px 0 4px; font-size: 15px; line-height: 22px; font-weight: 600; }
.kn-empty > p { margin: 0 0 12px; max-width: 640px; font-size: 13px; line-height: 20px; color: var(--muted); }
.kn-sections { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px 24px; }
.kn-sections li { display: grid; gap: 2px; padding-left: 12px; border-left: 2px solid var(--border); font-size: 13px; line-height: 18px; }
.kn-sections span { color: var(--muted); font-size: 12px; line-height: 16px; }

/* Claude's TRIAGE.md, rendered. */
.kn-doc { font-size: 13px; line-height: 21px; max-width: 860px; }
.kn-doc h3 { margin: 22px 0 6px; font-size: 14px; line-height: 20px; font-weight: 600; }
.kn-doc h4 { margin: 16px 0 4px; font-size: 13px; line-height: 20px; font-weight: 600; }
.kn-doc > :first-child { margin-top: 0; }
.kn-doc p { margin: 0 0 10px; }
.kn-doc ul, .kn-doc ol { margin: 0 0 10px; padding-left: 20px; }
.kn-doc li { margin: 3px 0; }
.kn-doc li::marker { color: var(--faint); }
.kn-doc code { padding: 1px 4px; border-radius: var(--r-xs); background: var(--surface-2); }
.kn-doc a { font-variant-numeric: tabular-nums; }
.kn-raw { border-top: 1px solid var(--border); }
.kn-raw > summary { display: flex; align-items: center; gap: 4px; padding: 10px 20px; font-size: 12px; line-height: 16px; font-weight: 500; cursor: pointer; list-style: none; }
.kn-raw > summary::-webkit-details-marker { display: none; }
.kn-raw > summary .chev { color: var(--muted); transition: transform var(--t) var(--ease); }
.kn-raw[open] > summary .chev { transform: rotate(90deg); }
.kn-raw .prompt-pre { border-top: 1px solid var(--border); max-height: 480px; }

.kn-editor { display: flex; flex-direction: column; overflow: hidden; }
.kn-editor .card-h { align-items: flex-start; }
.kn-meter { font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kn-meter.near { color: var(--warn-text); }
textarea.kn-text { min-height: 200px; padding: 14px 20px; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: var(--surface); font: 13px/22px var(--mono); tab-size: 2; }
textarea.kn-text:hover { border-color: var(--border); }
textarea.kn-text:focus { border-color: var(--border); box-shadow: inset 0 0 0 2px var(--ring); }
.kn-keys kbd { font: 500 11px/1 var(--mono); padding: 2px 5px; margin-left: 2px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted); }

/* The app page's tabs: its TRIAGE.md, then Claude's questions by where they stand. */
.kn-tabs .tab .ic { color: var(--muted); }
.kn-tabs .tab[aria-current="page"] .ic { color: var(--text); }

/* Claude's questions: a feed, each under the ticket it last came from (days added by app.js). */
.kn-feed-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 940px; }
.kn-feed-h { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.kn-feed-h p { margin: 0; max-width: 620px; font-size: 13px; line-height: 20px; color: var(--muted); }
.kn-sort { display: inline-flex; flex: none; padding: 3px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.kn-sort a { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--r-sm); font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; }
.kn-sort a:hover { color: var(--text); text-decoration: none; }
.kn-sort a[aria-current="true"] { background: var(--surface-3); color: var(--text); }
.kn-feed { display: flex; flex-direction: column; gap: 12px; }
.kn-day { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 0 78px; font-size: 15px; line-height: 22px; font-weight: 600; }
.kn-day:first-child { margin-top: 0; }
.kn-day .n { font-size: 12px; font-weight: 400; color: var(--muted); }
.kn-fe { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; scroll-margin-top: 96px; }
.kn-fe-when { padding-top: 16px; text-align: right; font-size: 12px; line-height: 16px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kn-fe-n { font-size: 13px; font-weight: 600; color: var(--warn-text); }
.kn-fe-card { display: flex; flex-direction: column; min-width: 0; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; transition: box-shadow var(--t) var(--ease); }
.kn-fe:target .kn-fe-card { box-shadow: 0 0 0 2px var(--accent); }
.kn-fe-ticket { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; }
.kn-fe-who { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; line-height: 20px; color: var(--muted); }
.kn-fe-who .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-fe-who strong { color: var(--text); font-weight: 600; }
.kn-fe-ref { flex: none; font-size: 12px; color: var(--faint); }
.kn-fe-quote { margin: 0; padding-left: 34px; font-size: 14px; line-height: 21px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kn-fe-q { display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 16px 52px; background: var(--surface-2); border-top: 1px solid var(--border); }
.kn-fe-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--accent-text); }
.kn-fe-text { margin: 0; font-size: 15px; line-height: 23px; font-weight: 600; text-wrap: pretty; }
.kn-fe-answer { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r); background: var(--ok-soft); border: 1px solid var(--ok-border); font-size: 13px; line-height: 20px; }
.kn-fe-answer p { margin: 0; white-space: pre-line; }
.kn-fe-answer .kn-doc p { white-space: normal; }
.kn-fe-by { font-size: 12px; line-height: 16px; color: var(--ok-text); }
.kn-fe-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.kn-fe-once { font-size: 12px; color: var(--faint); }
.kn-fe-more > summary { font-size: 12px; color: var(--muted); cursor: pointer; list-style: none; }
.kn-fe-more > summary::-webkit-details-marker { display: none; }
.kn-fe-more > summary:hover { color: var(--text); }
.kn-fe-more[open] { flex-basis: 100%; order: 3; }
.kn-fe-more ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 12px; line-height: 18px; }
.kn-fe-reply { margin-left: auto; }
.kn-fe-reply > summary { list-style: none; }
.kn-fe-reply > summary::-webkit-details-marker { display: none; }
.kn-fe-reply[open] { flex-basis: 100%; order: 4; margin-left: 0; }
.kn-fe-reply[open] > summary { display: none; }
.kn-fe-form { display: flex; flex-direction: column; gap: 8px; }
.kn-fe-form textarea { width: 100%; min-height: 84px; font-size: 14px; line-height: 21px; }
.kn-fe-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kn-fe-actions .small { flex: 1 1 220px; }
.kn-feed-more { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-left: 78px; }
.kn-chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--r-full); font-size: 11px; font-weight: 600; white-space: nowrap; }
.kn-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.kn-chip.is-team { background: var(--warn-soft); color: var(--warn-text); }
.kn-chip.is-look { background: var(--accent-soft); color: var(--accent-text); }
.kn-chip.is-done { background: var(--ok-soft); color: var(--ok-text); }
@media (max-width: 640px) {
  .kn-fe { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .kn-fe-when { padding-top: 0; text-align: left; }
  .kn-day, .kn-feed-more { margin-left: 0; padding-left: 0; }
  .kn-fe-q { padding-left: 18px; }
  .kn-fe-quote { padding-left: 0; }
}

/* The team's answers to Claude's questions (TRIAGE.md tab). */
.kn-ta { list-style: none; margin: 0; padding: 0; }
.kn-ta li { display: flex; flex-direction: column; gap: 4px; padding: 12px 20px; border-top: 1px solid var(--border); }
.kn-ta .q { margin: 0; font-size: 13px; line-height: 20px; font-weight: 600; }
.kn-ta .kn-doc p { margin: 0; }
.kn-props dd { flex-wrap: wrap; min-width: 0; font-size: 13px; }
.kn-paths { display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
@media (max-width: 1100px) { .kn-layout { grid-template-columns: minmax(0, 1fr); } }

/* "Claude would be surer if it knew…": on a ticket's triage card and on Review (team-only). */
.tri-ask { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--accent-soft); border: 1px solid var(--info-border); font-size: 13px; line-height: 20px; }
.tri-ask > .ic { margin-top: 2px; color: var(--accent-text); }
.tri-ask .k { display: block; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--accent-text); }
.tri-ask p { margin: 2px 0 0; }
.tri-ask a { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; font-weight: 500; }
.rv-ask { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 12px; line-height: 18px; color: var(--muted); }
.rv-ask > .ic { flex: none; margin-top: 2px; color: var(--accent-text); }
.rv-ask q { color: var(--text); }
.rv-ask a { white-space: nowrap; font-weight: 500; }

/* What was merged (the app's page): newest first, with what Claude did with each. */
.kn-chs { list-style: none; margin: 0; padding: 0; }
.kn-ch { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 10px 20px; }
.kn-ch + .kn-ch { border-top: 1px solid var(--border); }
.kn-ch > .ic { margin-top: 3px; color: var(--muted); }
.kn-ch.is-pending { box-shadow: inset 2px 0 0 var(--accent); }
.kn-ch.is-pending > .ic { color: var(--accent-text); }
.kn-ch.is-added > .ic { color: var(--ok); }
.kn-ch-b { min-width: 0; }
.kn-ch-t { display: block; font-size: 13px; line-height: 20px; color: var(--text); overflow-wrap: anywhere; }
.kn-ch-t:hover { color: var(--accent-text); }
.kn-ch.is-skipped .kn-ch-t { color: var(--muted); }
.kn-ch-m { margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kn-ch-m a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-hover); text-underline-offset: 2px; }
.kn-ch-m a:hover { color: var(--accent-text); }
.kn-ch-note { margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--muted); }
.tag.kn-ch-chip { height: 20px; margin-top: 0; border: 0; font-size: 11px; white-space: nowrap; }
.tag.kn-ch-chip.added { background: var(--ok-soft); color: var(--ok-text); }
.tag.kn-ch-chip.waiting { background: var(--accent-soft); color: var(--accent-text); }
.tag.kn-ch-chip.skipped { background: var(--surface-2); color: var(--muted); }

/* ---- AI triage › Knowledge: the Live studio and its pill ---------------------------------------- */
.kn-studio { width: min(1240px, calc(100vw - 48px)); height: min(800px, calc(100vh - 48px)); max-width: none; max-height: none; padding: 0; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); overflow: hidden; }
.kn-studio[open] { display: flex; flex-direction: column; }
.kn-studio::backdrop { background: var(--scrim); }
.kn-st-h { display: flex; align-items: center; gap: 14px; padding: 16px 20px; flex-wrap: wrap; }
.kn-st-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); }
.kn-studio.is-done .kn-st-ic { background: var(--ok-soft); color: var(--ok-text); }
.kn-st-tt { flex: 1; min-width: 240px; }
.kn-st-tt h2 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; }
.kn-st-sub { margin: 0; font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kn-st-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.kn-st-confirm { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.kn-st-confirm[hidden], .kn-st-stop[hidden] { display: none; }
.kn-st-msg { font-size: 12px; color: var(--muted); }
.kn-st-msg:empty { display: none; }
.kn-st-bar { height: 3px; flex: none; background: var(--surface-3); }
.kn-st-bar > span { display: block; width: 0; height: 100%; background: var(--accent); transition: width 600ms var(--ease); }
.kn-studio.is-done .kn-st-bar > span { background: var(--ok); }
.kn-st-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr) 340px; }
.kn-st-queue { padding: 14px 10px; border-right: 1px solid var(--border); overflow-y: auto; }
.kn-st-lbl { padding: 0 10px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.kn-st-queue ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.kn-sq { width: 100%; height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font: 400 13px/1 var(--font); text-align: left; cursor: pointer; }
.kn-sq:hover { background: var(--surface-2); }
.kn-sq[aria-current="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--info-border); font-weight: 600; }
.kn-sq .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-sq .m { font-size: 12px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kn-sq.is-done > .ic { color: var(--ok); }
.kn-sq.is-failed > .ic { color: var(--warn); }
.kn-sq.is-running > .ic, .kn-sq.is-running .m { color: var(--accent-text); }
.kn-sq.is-queued > .ic, .kn-sq.is-stopped > .ic { color: var(--muted); }
.kn-sq.is-stopped .n { color: var(--muted); }
.kn-st-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.kn-st-doch { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.kn-st-av { width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 6px; background: var(--surface-3); font-size: 11px; font-weight: 600; }
.kn-st-av:empty { display: none; }
.kn-st-name { font-size: 14px; font-weight: 600; }
.kn-st-file { font: 12px/16px var(--mono); color: var(--muted); }
.kn-st-steps { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px; }
.kn-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-full); background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kn-chip.is-done { background: var(--ok-soft); color: var(--ok-text); }
.kn-chip.is-active { background: var(--accent-soft); color: var(--accent-text); }
.kn-chip .ic { width: 10px; height: 10px; }
.kn-st-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 28px 24px; }
.kn-st-scroll .kn-doc { max-width: 780px; }
.kn-st-empty { margin: 18px 0 0; font-size: 13px; line-height: 20px; color: var(--muted); }
.kn-caret { display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: -3px; background: var(--accent-text); animation: kn-blink 1s steps(1) infinite; }
@keyframes kn-blink { 50% { opacity: 0; } }
.kn-st-docf { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.kn-spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.kn-st-docact { margin-left: auto; display: flex; gap: 8px; }
.kn-st-log { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border); background: var(--bg); }
.kn-st-logh { display: flex; align-items: center; gap: 8px; padding: 14px 16px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.kn-st-live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.kn-st-live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: kn-pulse 2s var(--ease) infinite; }
.kn-st-live.off .dot { background: var(--muted); animation: none; }
@keyframes kn-pulse { 0% { box-shadow: 0 0 0 0 var(--ok-border); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.kn-st-lines { flex: 1; min-height: 0; list-style: none; margin: 0; padding: 0 16px 12px; overflow-y: auto; }
.kn-l { display: grid; grid-template-columns: 38px 64px minmax(0, 1fr); gap: 8px; padding: 5px 0; font-size: 12px; line-height: 17px; }
.kn-l .t { font-family: var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.kn-l .x { overflow-wrap: anywhere; }
.kn-tag { justify-self: start; height: 18px; padding: 0 6px; border-radius: 4px; background: var(--surface-3); color: var(--text); font-size: 10.5px; font-weight: 600; line-height: 18px; letter-spacing: 0.02em; text-transform: uppercase; }
.kn-tag.claude { background: var(--accent-soft); color: var(--accent-text); }
.kn-tag.answer, .kn-tag.done { background: var(--ok-soft); color: var(--ok-text); }
.kn-tag.error { background: var(--warn-soft); color: var(--warn-text); }
.kn-tag.stop { background: var(--surface-2); color: var(--muted); }
.kn-st-qs { max-height: 42%; padding: 12px 16px 16px; border-top: 1px solid var(--border); overflow-y: auto; }
.kn-st-qs[hidden] { display: none; }
.kn-st-qsh { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.kn-st-qsh span:last-child { font-weight: 400; }
.kn-st-qs ul { list-style: none; margin: 0; padding: 0; }
.kn-a { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; padding: 6px 0; font-size: 12px; line-height: 17px; }
.kn-a > .ic { margin-top: 1px; color: var(--muted); }
.kn-a.is-found > .ic { color: var(--ok); }
.kn-a.is-pending { color: var(--muted); }
.kn-a .aa { color: var(--muted); }
.kn-a .aa:empty { display: none; }
.kn-a .aa p { margin: 0; }
@media (max-width: 1000px) {
  .kn-studio { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .kn-st-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) minmax(0, 34%); }
  .kn-st-queue { border-right: 0; border-bottom: 1px solid var(--border); padding: 8px 10px; overflow-x: auto; }
  .kn-st-lbl { display: none; }
  .kn-st-queue ul { display: flex; gap: 4px; }
  .kn-sq { width: auto; white-space: nowrap; }
  .kn-sq .n { overflow: visible; }
  .kn-st-log { border-left: 0; border-top: 1px solid var(--border); }
  .kn-st-qs { max-height: 50%; }
}

/* Minimized: the pill, above the alert dock, with each app's note above it. */
.kn-pill-wrap { position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px) + var(--dock-space, 0px)); z-index: 21; display: flex; align-items: center; gap: 6px; }
.kn-pill-wrap[hidden] { display: none; }
.kn-pill { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 10px 0 8px; border: 1px solid var(--border-strong); border-radius: var(--r-full); background: var(--surface); box-shadow: var(--shadow-pop); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color var(--t-fast); }
.kn-pill:hover { border-color: var(--border-hover); }
.kn-ring { position: relative; width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; }
.kn-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.kn-ring-track { fill: none; stroke: var(--surface-3); stroke-width: 4; }
.kn-ring-bar { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dasharray 600ms var(--ease); }
.kn-pill.is-done .kn-ring-bar { stroke: var(--ok); }
.kn-ring-n { position: relative; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kn-pill-t { display: flex; flex-direction: column; min-width: 0; }
.kn-pill-t .t { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600; white-space: nowrap; }
.kn-pill-t .s { font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kn-pill-ic .ic { width: 12px; height: 12px; color: var(--accent-text); }
.kn-pill.is-done .kn-pill-ic .ic { color: var(--ok); }
.kn-pill-go { width: 32px; height: 32px; margin-left: 6px; flex: none; display: inline-grid; place-items: center; border-radius: var(--r-full); background: var(--surface-3); color: var(--text); }
.kn-pill-x { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--r-full); background: var(--surface); box-shadow: var(--shadow-pop); color: var(--muted); cursor: pointer; }
.kn-pill-x:hover { color: var(--text); }
.kn-pill-x[hidden] { display: none; }
.toast.kn-note > .ic { color: var(--ok); }
.toast.kn-note.is-failed > .ic { color: var(--warn); }
.kn-note-go { margin-left: 4px; font-weight: 500; pointer-events: auto; }
@media (max-width: 720px) {
  .kn-pill-wrap { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--dock-space, 0px)); }
}

/* ---- Repo status --------------------------------------------------------------------------- */
.rs-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rs-fresh { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.rs-err { margin-bottom: 12px; }
.rs-card { overflow: hidden; }
.rs-scroll { overflow-x: auto; }
.rs-table { font-size: 13px; }
.rs-table th, .rs-table td { padding: 0 8px; height: 40px; }
.rs-table th:first-child, .rs-table td:first-child { padding-left: 16px; padding-right: 20px; }
.rs-table th:last-child, .rs-table td:last-child { padding-right: 16px; }
.rs-table td { border-top: 1px solid var(--border); }
.rs-table .rs-l { border-left: 1px solid var(--border); }
/* Group labels: Fix first, Open, Latest, the activity window, Builds */
.rs-groups th { height: 32px; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); border-bottom: 0; }
.rs-groups .rs-window { padding-top: 2px; padding-bottom: 2px; }
.rs-window-pick .select select { height: 24px; font: 600 11px/16px var(--font); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: transparent; border-color: transparent; padding-left: 6px; margin-left: -6px; }
.rs-window-pick .select select:hover { border-color: var(--border-strong); background: var(--input-bg); }
.rs-cols th { height: 32px; }
.rs-cols th.num { padding-left: 16px; }
.rs-cols th button { all: unset; position: relative; display: inline-block; cursor: pointer; color: inherit; border-radius: var(--r-xs); }
.rs-cols th button:hover { color: var(--text); }
.rs-cols th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The arrow floats beside the label (before it in number columns), so it takes no room. */
.rs-arrow { position: absolute; top: 50%; margin-top: -6px; left: calc(100% + 2px); opacity: 0; transition: transform var(--t-fast) var(--ease); }
.rs-cols th.num .rs-arrow { left: auto; right: calc(100% + 2px); }
.rs-cols th[aria-sort="descending"], .rs-cols th[aria-sort="ascending"] { color: var(--text); }
.rs-cols th[aria-sort="descending"] .rs-arrow, .rs-cols th[aria-sort="ascending"] .rs-arrow { opacity: 1; }
.rs-cols th[aria-sort="ascending"] .rs-arrow { transform: rotate(180deg); }
.rs-cols th button:hover .rs-arrow { opacity: 0.5; }
.rs-cols th[aria-sort="descending"] button:hover .rs-arrow, .rs-cols th[aria-sort="ascending"] button:hover .rs-arrow { opacity: 1; }
/* The repository column stays put while the rest scrolls sideways. */
.rs-table .rs-repo { position: sticky; left: 0; z-index: 1; min-width: 148px; background: var(--surface); border-right: 1px solid var(--border); text-align: left; }
.rs-table thead .rs-repo { background: var(--surface-2); }
.rs-table tbody th.rs-repo { font: 500 13px/20px var(--font); color: var(--text); border-top: 1px solid var(--border); white-space: nowrap; }
.rs-table tbody tr:first-child th.rs-repo, .rs-table tbody tr:first-child td { border-top: 0; }
.rs-table tbody th.rs-repo > * { vertical-align: middle; }
.rs-table tbody th.rs-repo a { color: var(--text); margin-left: 8px; }
.rs-table tbody th.rs-repo a:hover { text-decoration: underline; }
.rs-table tbody tr:hover td, .rs-table tbody tr:hover th.rs-repo { background: var(--surface-2); }
.rs-icon { width: 20px; height: 20px; border-radius: var(--r-xs); object-fit: cover; }
.rs-dot { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: var(--r-full); background: var(--border-strong); }
.rs-dot.ok { background: var(--ok); }
.rs-dot.stale { background: var(--warn); }
.rs-dot.failed { background: var(--danger); }
.rs-table td.num { color: var(--text); font-size: 13px; }
.rs-table td.zero, .rs-table td.muted { color: var(--faint); }
.rs-table tr.is-stale td { opacity: 0.72; }
a.rs-n { color: inherit; text-decoration: none; border-radius: var(--r-xs); padding: 2px 4px; margin: -2px -4px; }
a.rs-n:hover { background: var(--accent-soft); color: var(--accent-text); }
.rs-crit.has { color: var(--danger-text) !important; font-weight: 600; }
.rs-build { white-space: nowrap; }
.rs-build a { font-family: var(--mono); font-size: 12px; color: var(--text); }
.rs-build a:hover { text-decoration: underline; }
.rs-pre { display: inline-block; padding: 0 4px; border-radius: var(--r-xs); font: 600 10px/16px var(--font); letter-spacing: 0.04em; color: var(--warn-text); background: var(--warn-soft); }
.rs-wait { color: var(--muted); font-size: 13px; }
/* Urgency: how it compares with the most urgent repository (u4) */
.rs-score { display: inline-block; min-width: 32px; padding: 1px 6px; border-radius: var(--r-full); font: 600 12px/18px var(--font); font-variant-numeric: tabular-nums; text-align: center; color: var(--muted); background: var(--surface-2); text-decoration: none; }
a.rs-score:hover { box-shadow: 0 0 0 1px var(--border-hover); text-decoration: none; }
.rs-score.u1 { color: var(--text); background: var(--surface-3); }
.rs-score.u2 { color: var(--warn-text); background: var(--warn-soft); }
.rs-score.u3 { color: var(--danger-text); background: var(--danger-soft); }
.rs-score.u4 { color: var(--on-accent); background: var(--danger-fill); }
.rs-table tfoot th, .rs-table tfoot td { height: 40px; background: var(--surface-2); border-top: 1px solid var(--border-strong); font-weight: 600; color: var(--text); }
.rs-table tfoot th.rs-repo { background: var(--surface-2); font: 600 12px/16px var(--font); color: var(--muted); }
.rs-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
/* Off */
.rs-off .card-b { max-width: 680px; display: flex; flex-direction: column; gap: 10px; padding: 24px; }
.rs-off h2 { margin: 0; font-size: 16px; }
.rs-off p { margin: 0; }
.rs-off .row { margin-top: 6px; }
/* Fix first */
.rs-fix-h { margin-bottom: 12px; }
.rs-fxs { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.rs-fx { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--border); }
.rs-fx:first-child { border-top: 0; }
.rs-fx:hover { background: var(--surface-2); }
.rs-fx .rs-score { margin-top: 1px; }
.rs-fx-t { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 500; color: var(--text); line-height: 20px; }
.rs-fx-t:hover { text-decoration: underline; }
.rs-flame { color: var(--danger); align-self: center; flex: none; }
.rs-fx-m { margin-top: 2px; font-size: 12px; color: var(--muted); }
.rs-fx-why { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rs-fx-why:empty { display: none; }
.rs-why { padding: 0 6px; border-radius: var(--r-xs); font-size: 11px; line-height: 18px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.rs-fx.critical .rs-why:first-child { color: var(--danger-text); background: var(--danger-soft); border-color: var(--danger-border); }
.rs-fix-note { margin: 12px 2px 0; max-width: 900px; }
/* Most reported */
.rs-rp-filters { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.rs-rp-filters .seg:last-child { margin-left: auto; }
.rs-count { display: flex; flex-direction: column; align-items: center; min-width: 44px; padding-top: 1px; font: 500 10px/14px var(--font); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.rs-count b { font: 600 18px/22px var(--font); letter-spacing: 0; text-transform: none; color: var(--text); font-variant-numeric: tabular-nums; }
.rs-rp-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rs-rp-h .pill { flex: none; }
.rs-why.sug { color: var(--accent-text); background: var(--accent-soft); border-color: var(--info-border); }
.rs-why.warn { color: var(--warn-text); background: var(--warn-soft); border-color: var(--warn-border); }
a.rs-why { text-decoration: none; }
a.rs-why:hover { border-color: currentColor; }
.rs-rp-d { margin-top: 6px; }
.rs-rp-d > summary { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--accent-text); cursor: pointer; list-style: none; border-radius: var(--r-xs); }
.rs-rp-d > summary::-webkit-details-marker { display: none; }
.rs-rp-d > summary::before { content: ""; width: 0; height: 0; border-left: 4px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform var(--t-fast) var(--ease); }
.rs-rp-d[open] > summary::before { transform: rotate(90deg); }
.rs-rp-d > summary:hover { text-decoration: underline; }
.rs-rp-d > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rs-rp-list { list-style: none; margin: 8px 0 0; padding: 0; border-left: 2px solid var(--border); }
.rs-rp-list li { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; padding: 4px 0 4px 12px; font-size: 13px; }
.rs-rp-list li a { color: var(--text); }
.rs-rp-list li a:hover { text-decoration: underline; }
.rs-rp-list li .muted { font-size: 12px; }
.rs-once { margin-top: 16px; }
.rs-once > summary { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; font-weight: 500; font-size: 13px; color: var(--muted); cursor: pointer; }
.rs-once > summary:hover { color: var(--text); }
.rs-once > summary .n { padding: 0 6px; border-radius: var(--r-full); background: var(--surface-2); font-size: 12px; font-variant-numeric: tabular-nums; }
/* Pull requests */
.rs-pr { grid-template-columns: 20px minmax(0, 1fr); }
.rs-pr-ic { display: inline-flex; justify-content: center; padding-top: 2px; }
.rs-pr-ic.open { color: var(--ok); }
.rs-pr-ic.draft { color: var(--muted); }
.rs-pr-ic.merged { color: var(--dot-2); }
.rs-pr-for { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.rs-pr-for li { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.rs-pr-for a { color: var(--text); }
.rs-pr-for a:hover { text-decoration: underline; }
.rs-pr-for a.rs-why { color: var(--muted); }
.rs-pr-it { color: var(--muted); }
.rs-pr-errs { margin: 4px 0 0; padding-left: 16px; }
.rs-why.ok { color: var(--ok-text); background: var(--ok-soft); border-color: var(--ok-border); }
/* Settings: the repository list */
.rs-pick { list-style: none; margin: 0; padding: 4px 0; max-height: 440px; overflow-y: auto; }
.rs-pick li { padding: 6px 20px; border-top: 1px solid var(--border); }
.rs-pick li:first-child { border-top: 0; }
.rs-pick .check { width: 100%; }
.rs-pick .tag { margin-left: auto; }
.rs-pick .tag + .tag { margin-left: 0; }
@media (max-width: 720px) {
  .rs-fresh { margin-left: 0; width: 100%; }
  .rs-rp-filters .seg:last-child { margin-left: 0; }
  .rs-table .rs-repo { min-width: 140px; }
}
.rs-err-text { color: var(--warn-text); }

/* ---- Analytics ------------------------------------------------------------------------------- */
.an { display: flex; flex-direction: column; gap: 16px; }
.an-filters { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.an-filters .select select { min-width: 160px; }
.seg-item.off { color: var(--faint); cursor: not-allowed; }
.seg-item.off:hover { color: var(--faint); }
.an-steps.off { opacity: 0.5; cursor: not-allowed; }
.an-steps.off .seg-item { cursor: not-allowed; }
.an-note .notice { margin: 0; }
.an-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 12px; }
.an-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.an-kl { font-size: 12px; color: var(--muted); }
.an-kv { margin-top: 4px; font: 600 24px/30px var(--font); color: var(--text); }
.an-ks { margin-top: 2px; font-size: 12px; color: var(--muted); }
.an-d { margin-top: 2px; font-size: 12px; color: var(--muted); }
.an-d.good { color: var(--ok-text); }
.an-d.bad { color: var(--danger-text); }
.an-d .muted { color: var(--muted); }
.an-d .an-vs { display: block; }
.an-arrow { font-size: 9px; margin-right: 3px; }
.an-card { padding: 16px 20px 14px; overflow: visible; }
.an-ch { display: flex; align-items: baseline; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.an-ch h2 { margin: 0; font-size: 14px; font-weight: 600; }
.an-metric { height: 30px; }
.an-metric .seg-item { height: 26px; font-weight: 600; }
.an-up { color: var(--ok-text); font-size: 12px; margin-left: 4px; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; align-items: start; }
.an-chart { margin: 0; }
.an-plot { position: relative; height: 240px; }
.an-chart.small .an-plot { height: 96px; }
.an-svg { display: block; overflow: visible; }
.an-svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--r-xs); }
.an-gl line { stroke: var(--viz-grid); stroke-width: 1; }
.an-base { stroke: var(--viz-base); stroke-width: 1; }
.an-axis { fill: var(--viz-axis); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.an-hover { fill: var(--viz-hover); }
.an-unknown { stroke: var(--viz-grid); stroke-width: 2; }
.an-norec { fill: var(--surface-2); opacity: 0.6; }
.an-norec-t { fill: var(--faint); font: 12px var(--font); }
.an-bar-s.s1, .an-bars .fill.s1, .an-key.s1 { fill: var(--viz-1); background: var(--viz-1); }
.an-bar-s.s2, .an-bars .fill.s2, .an-key.s2 { fill: var(--viz-2); background: var(--viz-2); }
.an-bar-s.s3, .an-bars .fill.s3, .an-key.s3 { fill: var(--viz-3); background: var(--viz-3); }
.an-bar-s.s4, .an-bars .fill.s4, .an-key.s4 { fill: var(--viz-4); background: var(--viz-4); }
.an-bar-s.s5, .an-bars .fill.s5, .an-key.s5 { fill: var(--viz-5); background: var(--viz-5); }
.an-bar-s.s6, .an-bars .fill.s6, .an-key.s6 { fill: var(--viz-6); background: var(--viz-6); }
.an-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.an-legend span { display: inline-flex; align-items: center; gap: 6px; }
.an-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.an-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop); font-size: 12px; color: var(--muted); }
.an-tip-h { margin-bottom: 4px; color: var(--muted); }
.an-tip-r, .an-tip-t { display: flex; align-items: center; gap: 8px; line-height: 20px; }
.an-tip-r b, .an-tip-t b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 48px; }
.an-tip-t { margin-top: 2px; padding-top: 4px; border-top: 1px solid var(--border); padding-left: 22px; }
.an-line { display: inline-block; width: 14px; height: 2px; border-radius: 1px; }
.an-line.s1 { background: var(--viz-1); } .an-line.s2 { background: var(--viz-2); } .an-line.s3 { background: var(--viz-3); } .an-line.s4 { background: var(--viz-4); } .an-line.s5 { background: var(--viz-5); } .an-line.s6 { background: var(--viz-6); }
.an-tip-none { color: var(--faint); }
.an-tv { margin-top: 8px; }
.an-tv > summary { display: inline-flex; font-size: 12px; color: var(--muted); cursor: pointer; }
.an-tv > summary:hover { color: var(--text); }
.an-tv .table-wrap { margin-top: 8px; max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-sm); }
.an-table { font-size: 13px; }
.an-table th, .an-table td { height: 34px; padding: 0 12px; }
.an-hb { margin: 0; }
.an-hsvg { width: 100%; }
.an-hlab { fill: var(--text); font: 13px var(--font); }
.an-hval { fill: var(--text); font: 600 12px var(--font); font-variant-numeric: tabular-nums; }
.an-hpct { fill: var(--muted); font-weight: 400; }
.an-hup { fill: var(--ok-text); font-weight: 500; }
.an-hband { fill: transparent; }
.an-hrow:hover .an-hband { fill: var(--viz-hover); }
.an-hb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.an-hb-list li { display: flex; justify-content: space-between; gap: 12px; }
.an-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.an-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; font-size: 13px; }
.an-bl { display: inline-flex; align-items: center; gap: 8px; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.an-bv { color: var(--text); }
.an-bv .muted { font-size: 12px; margin-left: 4px; }
.an-bar { grid-column: 1 / -1; width: 100%; height: 6px; display: block; }
.an-bars .track { fill: var(--surface-2); }
.an-bars .fill { fill: var(--viz-1); }
.an-none { margin: 0; }
.an-multi { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px 24px; }
.an-mh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.an-mh b { color: var(--text); font-weight: 600; font-size: 15px; }
.an-mini .an-tv { margin-top: 4px; }
.an-rel td:first-child, .an-rel th:first-child { padding-left: 12px; }
.an-foot { margin: 10px 0 0; }
@media (max-width: 720px) {
  .an-card { padding: 14px; }
  .an-kv { font-size: 20px; line-height: 26px; }
}

/* ---- Announcements ------------------------------------------------------------------------- */

.ann-spin { display: inline-grid; animation: spin 0.8s linear infinite; }
.ann-gh summary { cursor: pointer; color: var(--muted); }
.ann-gh-notes { margin: 8px 0 0; max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/18px var(--mono); color: var(--text); background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; }
.ann-apps td { vertical-align: middle; }
.ann-apps .select select { min-width: 150px; }
@media (prefers-reduced-motion: reduce) { .ann-spin { animation: none; } }
/* Settings › Buttons: a row per button (label, link, which apps, remove), what its link finds underneath. */
.ann-btns { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.ann-notes-label { margin-top: 12px; }
.ann-btn-head, .ann-btn { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) minmax(0, 0.7fr) 32px; gap: 8px; align-items: center; }
.ann-btn-head { font: 500 12px/16px var(--font); color: var(--muted); }
.ann-btn > input { width: 100%; min-width: 0; }
.ann-btn > .select select { width: 100%; min-width: 0; }
.ann-btn-st { grid-column: 1 / -1; margin-top: -4px; overflow-wrap: anywhere; }
.ann-btn-st:empty { display: none; }
[data-btn-rows] { display: flex; flex-direction: column; gap: 12px; }
.ann-btn-add { flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) {
  .ann-btn-head { display: none; }
  .ann-btn { grid-template-columns: minmax(0, 1fr) 32px; }
  .ann-btn > input[name="btn_url"], .ann-btn > .select { grid-column: 1 / 2; }
}

/* ---- Bot features › Known issues --------------------------------------------------------------- */

/* The feature's card on top, then lists of closed rows (issues, settings) that open to edit. */
.ki-page { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ki-hero { padding: 14px 20px; display: flex; flex-direction: column; gap: 12px; }
.ki-now { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.ki-state { font-size: 13px; line-height: 20px; color: var(--muted); }
.ki-state .icon { vertical-align: -2px; }
.ki-stats { display: flex; gap: 8px; flex-wrap: wrap; }
a.chip-stat { text-decoration: none; transition: background var(--t-fast); }
a.chip-stat:hover { background: var(--surface-3); }
.ki-hero .checklist { margin: 0; padding-top: 12px; border-top: 1px solid var(--border); }
.ki-sec { margin: 14px 2px 0; scroll-margin-top: 24px; }
.ki-sec h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 22px; font-weight: 600; }
.ki-sec p { margin: 2px 0 0; max-width: 680px; }
.ki-count { padding: 0 8px; border-radius: var(--r-full); background: var(--surface-2); font-size: 12px; line-height: 20px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.ki-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.ki-list > * + * { border-top: 1px solid var(--border); }
.ki-row[open] { background: var(--surface); }
.ki-row[open] + * { border-top-color: var(--border-strong); }
.ki-sum { list-style: none; cursor: pointer; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 12px 16px; transition: background var(--t-fast); }
.ki-sum::-webkit-details-marker { display: none; }
.ki-sum:hover { background: var(--surface-2); }
.ki-sum:hover .cl-open { border-color: var(--border-hover); }
.ki-sum:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ki-row[open] > .ki-sum { background: var(--surface-2); }
.ki-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ki-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; line-height: 18px; color: var(--muted); }
.ki-meta .tag { height: 18px; font-size: 11px; }
.ki-title { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.ki-note { font-size: 12px; line-height: 18px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ki-side { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.ki-status { max-width: 230px; font-size: 13px; line-height: 18px; color: var(--text); }
.ki-status.ok { color: var(--ok-text); }
.ki-status.warn { color: var(--warn-text); }
.ki-reports { min-width: 68px; text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ki-reports b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ki-body { border-top: 1px solid var(--border); }
.ki-body .cl-tools { padding: 10px 16px; }
.ki-body .card-f { border-top: 1px solid var(--border); }
.ki-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); }
.ki-row[open] .ki-ico, .ki-sum:hover .ki-ico { background: var(--surface-3); color: var(--text); }
.ki-gist { display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 18px; color: var(--muted); }
.ki-gist-main { color: var(--text); font-family: var(--mono); font-size: 12px; }
.ki-quote { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: italic; }
.ki-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ki-chip { padding: 0 8px; border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface-2); font-size: 12px; line-height: 20px; color: var(--text); white-space: nowrap; }
.ki-chip.off { color: var(--faint); text-decoration: line-through; }
.ki-check { display: inline-flex; align-items: center; gap: 5px; }
.ki-check.ok { color: var(--ok-text); }
.ki-check.warning { color: var(--warn-text); }
.ki-check.error { color: var(--danger-text); }
.ki-lead { margin: 0 0 4px; }
/* Number boxes line up whatever their unit (reports, issues, days). */
.ki-body .control > .row > .small.muted:last-child { min-width: 46px; }
.ki-add { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface-2); }
.ki-add input { flex: 1; min-width: 0; }
.ki-empty { margin: 0; padding: 16px 20px; font-size: 13px; color: var(--muted); }
@media (max-width: 720px) {
  .ki-hero { padding: 14px 16px; }
  .ki-sum { grid-template-columns: 26px minmax(0, 1fr); }
  .ki-side { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; gap: 6px 12px; }
  .ki-reports { min-width: 0; text-align: left; }
  .ki-set .ki-side { display: none; }
}

/* ---- Bot features: a row per feature, with its switch and a gear that opens it ------------------ */

.bf-list { display: flex; flex-direction: column; gap: 12px; }
.bf-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px 18px; align-items: center; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); transition: border-color var(--t-fast); }
.bf-row:hover { border-color: var(--border-strong); }
.bf-icon { display: grid; place-items: center; align-self: start; width: 44px; height: 44px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-text); }
.bf-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bf-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bf-title h2 { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.bf-title h2 a { color: var(--text); text-decoration: none; }
.bf-title h2 a:hover { color: var(--accent-text); }
.bf-about { margin: 0; max-width: 640px; font-size: 13px; line-height: 19px; color: var(--muted); }
.bf-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bf-fact { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 9px; border-radius: var(--r-full); background: var(--surface-2); font-size: 12px; line-height: 18px; color: var(--muted); text-decoration: none; transition: background var(--t-fast); }
.bf-fact b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.bf-fact.mono { font-family: var(--mono); color: var(--text); }
a.bf-fact:hover { background: var(--surface-3); }
.bf-fact.accent { background: var(--accent-soft); color: var(--accent-text); }
.bf-fact.warn { background: var(--warn-soft); color: var(--warn-text); }
.bf-fact.accent b, .bf-fact.warn b { color: inherit; }
.bf-side { display: flex; align-items: center; gap: 14px; }
.bf-power label { gap: 8px; cursor: pointer; min-width: 64px; }
.bf-gear { width: 36px; height: 36px; padding: 0; justify-content: center; }
.bf-foot { display: flex; align-items: center; gap: 6px; margin: 4px 2px 0; }
@media (max-width: 640px) {
  .bf-row { grid-template-columns: 40px minmax(0, 1fr); padding: 16px; }
  .bf-icon { width: 40px; height: 40px; }
  .bf-side { grid-column: 2; }
}

/* ---- Announcements: the list, and the editor beside its preview ------------------------------- */

.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.pc-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 12px 16px; color: inherit; text-decoration: none; transition: background var(--t-fast); }
.pc-row:hover { background: var(--surface-2); }
.pc-row .ki-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-row .ki-side { gap: 12px; }
.pc-where { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
a.ki-chip { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
a.ki-chip:hover { border-color: var(--border-hover); }
.pc-when { white-space: nowrap; }
.pc-filter { width: 100%; margin-bottom: 8px; }
.pc-note { margin: 8px 0 0; }
.pc-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 264px; overflow: auto; padding: 1px; }
.pc-ch { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.pc-ch:hover { border-color: var(--border-hover); }
.pc-ch:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pc-ch.off { opacity: 0.55; cursor: not-allowed; }
.pc-ch .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-ch .xs { white-space: nowrap; }
.pc-more > summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; }
.pc-more > summary::-webkit-details-marker { display: none; }
.pc-more[open] > summary { margin-bottom: 14px; }
.pc-btns { display: flex; flex-direction: column; gap: 6px; }
.pc-btn { display: grid; grid-template-columns: minmax(120px, 0.4fr) minmax(0, 1fr) 32px; gap: 8px; align-items: center; }
.pc-btn > input { width: 100%; min-width: 0; }
.dp-embed.pc-green { border-left-color: #57f287; }
.dp-embed.pc-yellow { border-left-color: #fee75c; }
.dp-embed.pc-red { border-left-color: #ed4245; }
.dp-embed.pc-grey { border-left-color: #99aab5; }
.dp-embed[hidden], .dp-content[hidden], .pc-pv-empty[hidden] { display: none; }
.pc-pv-empty { margin: 4px 0 0; font-size: 13px; font-style: italic; color: var(--discord-muted); }
@media (max-width: 640px) {
  .pc-row { grid-template-columns: 26px minmax(0, 1fr); }
  .pc-row .ki-side { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .pc-btn { grid-template-columns: minmax(0, 1fr) 32px; }
  .pc-btn > input[name="btn_url"] { grid-column: 1; grid-row: 2; }
}

/* ---- AI triage › Custom labels: a closed row per category, its editor when opened ---------------- */

.cl-page { display: flex; flex-direction: column; gap: 12px; }
.cl-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.cl-top h2 { margin: 0; font-size: 16px; line-height: 24px; }
.cl-top p { margin: 2px 0 0; max-width: 640px; }
.cl-sum-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.chip-stat { display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 10px; border-radius: var(--r-full); background: var(--surface-2); font-size: 12px; color: var(--muted); }
.chip-stat b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.cl-cat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; transition: border-color var(--t-fast); }
.cl-cat[open] { border-color: var(--border-strong); }
.cl-sum { list-style: none; cursor: pointer; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px 16px; align-items: start; padding: 16px 20px; }
.cl-sum::-webkit-details-marker { display: none; }
.cl-sum:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cl-sum:hover .cl-open { border-color: var(--border-hover); }
.cl-chev { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); transition: transform var(--t) var(--ease); }
details[open] > summary .cl-chev { transform: rotate(90deg); }
.cl-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cl-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cl-title h2 { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.cl-pick { padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--r-xs); font-size: 12px; line-height: 18px; color: var(--muted); white-space: nowrap; }
.cl-about { color: var(--muted); font-size: 13px; line-height: 19px; }
.cl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.cl-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 7px; border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface-2); }
.cl-chip .tag { border: 0; padding: 0; height: auto; background: none; }
.cl-chip .n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cl-modes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cl-cov { display: flex; align-items: center; gap: 8px; font-size: 12px; white-space: nowrap; }
.cl-cover-bar { flex: 0 0 90px; display: block; }
.cl-cover-bar .meter-track { fill: var(--surface-3); }
.cl-cover-fill { fill: var(--ok); }
.cl-open .c, details[open] > summary .cl-open .o { display: none; }
details[open] > summary .cl-open .c { display: inline; }
.cl-body { border-top: 1px solid var(--border); }
.cl-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 10px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cl-foot { margin: 4px 0 0; }
.lbl-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.lbl-row .lbl { font-size: 13px; line-height: 20px; font-weight: 500; }
.cl-rows { display: flex; flex-direction: column; gap: 6px; }
.cl-head, .cl-row { display: grid; grid-template-columns: minmax(110px, 0.32fr) minmax(0, 1fr) 76px 32px; gap: 8px; align-items: center; }
.cl-head { font: 500 12px/16px var(--font); color: var(--muted); padding: 0 2px; }
.cl-row > input, .cl-row > textarea { width: 100%; min-width: 0; }
.cl-row > textarea { resize: vertical; min-height: 36px; field-sizing: content; line-height: 20px; }
.cl-row > input[name="opt_label"] { font-family: var(--mono); font-size: 13px; }
.cl-n { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.cl-bf { display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-xs); color: var(--muted); }
.cl-bf:hover { background: var(--surface-2); color: var(--accent-text); }
.cl-add { margin-top: 10px; gap: 10px; }
.view-only .cl-row .icon-btn { visibility: hidden; }
@media (max-width: 720px) {
  .cl-sum { grid-template-columns: 26px minmax(0, 1fr); padding: 14px 16px; }
  .cl-side { grid-column: 2; align-items: flex-start; }
  .cl-modes { justify-content: flex-start; }
  .cl-head { display: none; }
  .cl-row { grid-template-columns: minmax(0, 1fr) auto 32px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
  .cl-row > input[name="opt_desc"] { grid-column: 1 / -1; grid-row: 2; }
}

/* ---- AI triage › Re-run: Custom labels only ---------------------------------------------------- */

.what-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice.what { align-items: flex-start; }
.what-i { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); }
.choice.what:has(input:checked) .what-i { background: var(--accent); color: var(--on-accent); }
.choice.off { opacity: 0.55; cursor: not-allowed; }
.bf-cats { display: flex; flex-direction: column; gap: 10px; }
.bf-cat { margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); min-width: 0; transition: border-color var(--t-fast), background var(--t-fast); }
.bf-cat:has(.bf-cat-h input:checked) { border-color: var(--info-border); background: var(--accent-soft); }
.bf-cat-h { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; cursor: pointer; }
.bf-cat-n { font-weight: 600; font-size: 14px; }
.bf-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bf-cat:has(.bf-cat-h input:not(:checked)) .bf-labels { opacity: 0.45; }
.bf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 6px; border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface); cursor: pointer; transition: border-color var(--t-fast); }
.bf-chip:hover { border-color: var(--border-hover); }
.bf-chip input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; }
.bf-chip .tag { border: 0; padding: 0; height: auto; background: none; }
.bf-chip .n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bf-chip:has(input:not(:checked)) { opacity: 0.6; }
.bf-pick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 24px; }
.bf-pick + .bf-pick { margin-top: 4px; }
.bf-pick-g { font-size: 12px; color: var(--muted); min-width: 64px; }
.bf-add { display: inline-flex; align-items: center; gap: 2px; border-radius: var(--r-xs); }
.bf-add .tag { background: none; }
.bf-add.sure { color: var(--ok-text); }
.bf-add.sure .tag { border-color: var(--ok-border); background: var(--ok-soft); }
.bf-add.unsure { color: var(--warn-text); }
.bf-add.unsure .tag { border-style: dashed; border-color: var(--warn-border); }
.bf-add.has .tag { opacity: 0.55; }
.bf-conf { font-size: 11px; font-variant-numeric: tabular-nums; }
.bf-conf.ok { color: var(--ok-text); }
.bf-conf.warn { color: var(--warn-text); }
.bf-totals { border-top: 1px solid var(--border); }
.bf-totals-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.bf-totals-h h3 { margin: 0; font-size: 14px; }
.bf-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }
.bf-key.sure { background: var(--ok); }
.bf-key.unsure { background: var(--warn-border); }
.bf-bar .sure { fill: var(--ok); }
.bf-bar .unsure { fill: var(--warn-border); }
.bf-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bf-bars li { display: grid; grid-template-columns: minmax(150px, 0.28fr) minmax(0, 1fr) 11em; gap: 12px; align-items: center; }
.bf-bar-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bf-bar { display: block; min-width: 0; }
.bf-bar-n { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th.bf-ticket { width: 34%; }
th.bf-had { width: 16%; }
.ok-text { color: var(--ok-text); }
@media (max-width: 720px) {
  .what-pick { grid-template-columns: minmax(0, 1fr); }
  .bf-bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .bf-bars .bf-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* ---- AI triage › Overview ------------------------------------------------------------------------ */

.ov-kpi { color: inherit; text-decoration: none; transition: border-color var(--t-fast); }
.ov-kpi:hover { border-color: var(--border-hover); text-decoration: none; }
.ov-ch-a { margin-left: auto; }
.ov-labels .an-ch { align-items: center; }
.p-crit { background: var(--danger); } .p-high { background: var(--viz-2); } .p-med { background: var(--viz-1); } .p-low { background: var(--faint); }
.ov-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ov-split { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; margin: 20px 0 0; padding-top: 20px; border-top: 1px solid var(--border); font-size: 15px; font-weight: 600; }
.ov-split span { font-size: 13px; font-weight: 400; color: var(--muted); }
.ov-none { margin: 0; }

/* Grouped tables (labels on open issues, what triage did): a group per category, every bar on one scale. */
.lt-tools { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.lt-tools .search { margin-left: auto; }
.lt-table { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 4px; }
.lt-head, .lt-row { display: grid; grid-template-columns: minmax(0, 18rem) 6.5rem minmax(0, 1fr) 2.75rem; align-items: center; }
.lt-head { height: 34px; font-size: 12px; font-weight: 500; color: var(--muted); }
.lt-head > span:first-child { padding-left: 16px; }
.lt-n { text-align: right; padding-right: 16px; font-variant-numeric: tabular-nums; }
.lt-bar { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0 16px; }
.lt-track, .lt-scale { position: relative; flex: 1; min-width: 0; }
.lt-track { padding: 6px 0; background: linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 25% 100% repeat-x; }
.lt-track .meter-track { fill: var(--surface-3); }
.lt-pct { flex: none; width: 3em; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lt-scale { height: 16px; font-variant-numeric: tabular-nums; }
.lt-scale i { position: absolute; top: 0; font-style: normal; line-height: 16px; transform: translateX(-50%); }
.lt-scale i:first-child { left: 0; transform: none; }
.lt-scale .t25 { left: 25%; } .lt-scale .t50 { left: 50%; } .lt-scale .t75 { left: 75%; }
.lt-scale .t100 { right: 0; transform: none; }
.lt-head .lt-pct { font-size: inherit; color: inherit; }
.lt-group { border-top: 1px solid var(--border); }
.lt-gh { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; min-height: 46px; padding: 6px 16px 6px 12px; background: var(--surface-2); }
.lt-gh::-webkit-details-marker { display: none; }
.lt-chev { display: inline-flex; color: var(--muted); transition: transform var(--t-fast); }
.lt-group[open] > .lt-gh .lt-chev { transform: rotate(90deg); }
.lt-gh:hover .lt-chev { color: var(--text); }
.lt-gname { font-size: 13px; font-weight: 600; }
.lt-kind { font-size: 12px; color: var(--muted); }
.lt-cov { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.lt-cov b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.lt-cov.low b { color: var(--warn-text); }
.lt-cov-bar { display: block; width: 96px; }
.lt-cov-bar .meter-track { fill: var(--surface-3); }
.lt-cov-fill, .lt-fill { fill: var(--accent); }
.lt-wait { fill: var(--viz-4); }
.lt-skip { fill: var(--faint); }
.lt-keys { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.lt-key { width: 10px; height: 10px; border-radius: 2px; margin-left: 6px; }
.lt-key.a { background: var(--accent); } .lt-key.s { background: var(--viz-4); }
.lt-plus { margin-left: 6px; font-size: 11px; font-weight: 400; color: var(--muted); }
.lt-sub { margin-left: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-prio { display: inline-flex; align-items: center; gap: 8px; align-self: center; }
.lt-sum { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.lt-sum b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.lt-group[open] .lt-sum { display: none; }
.lt-act { margin-left: auto; }
.lt-rows { list-style: none; margin: 0; padding: 0; }
.lt-rows > li { border-top: 1px solid var(--border); }
.lt-row { min-height: 36px; color: var(--text); text-decoration: none; }
a.lt-row:hover { background: var(--surface-2); text-decoration: none; }
.lt-row.zero { opacity: 0.55; }
.lt-l { display: flex; align-items: baseline; min-width: 0; padding-left: 40px; font-size: 13px; }
.lt-l .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.lt-row .lt-n { font-size: 13px; font-weight: 600; }
.lt-nolabel { font-size: 13px; font-weight: 500; color: var(--muted); }
.lt-nolabel.warn { color: var(--warn-text); }
.lt-go { justify-self: center; display: inline-flex; color: var(--faint); }
a.lt-row:hover .lt-go { color: var(--text); }
.lt-nil { margin: 0; padding: 12px 16px 12px 40px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); }
.lt-nomatch { padding-left: 16px; }
.lt-empty { border-top: 1px solid var(--border); }
.lt-empty .empty { padding: 16px 8px; }
@media (max-width: 720px) {
  .ov-ch-a { margin-left: 0; }
  .lt-tools .search { margin-left: 0; width: 100%; }
  .lt-head { display: none; }
  .lt-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; padding: 8px 0; }
  .lt-l { padding-left: 16px; }
  .lt-row .lt-bar { grid-column: 1 / -1; padding-left: 16px; }
  .lt-go { display: none; }
  .lt-cov { margin-left: 0; }
  .lt-act { margin-left: 0; }
}

/* Re-run: what a run will cost, by Start; and on a running one, what it cost so far. */
.run-est { align-items: center; }
.run-est-b { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.run-est-m { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; font-size: 13px; }
.run-est-cost { font: 600 20px/26px var(--font); font-variant-numeric: tabular-nums; color: var(--text); }
.run-prog { justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
.run-cost { font-variant-numeric: tabular-nums; }

/* ---- Moderation › Ticket management: the list on the left, the open ticket on the right ------ */

.mod-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.mod-filters { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mod-filters .search { width: 260px; }
.mod-orig { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mod-split { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
/* The list keeps its place while the ticket scrolls. */
.mod-list { position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.mod-list > .mod-rows, .mod-list > .mod-groups { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.mod-bulk { flex: none; }
.mod-more { flex: none; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.mod-rows, .mod-groups { list-style: none; margin: 0; padding: 0; }
.mod-row { display: flex; gap: 10px; align-items: flex-start; padding: 0 0 0 14px; border-top: 1px solid var(--border); position: relative; }
.mod-rows > .mod-row:first-child { border-top: 0; }
.mod-row > .rule-check { margin: 14px 0 0; flex: none; }
.mod-row-a { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 11px 14px 11px 0; color: inherit; text-decoration: none; }
.mod-row:not(:has(> .rule-check)) .mod-row-a { padding-left: 0; }
.mod-row:hover { background: var(--surface-2); }
.mod-row-a:hover { text-decoration: none; }
.mod-row.open { background: var(--nav-active); box-shadow: inset 3px 0 0 var(--accent); }
.mod-row-l1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mod-row-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--text); }
.mod-row-age { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mod-row-l2 { font-size: 12px; line-height: 16px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-row-c { display: flex; flex-wrap: wrap; gap: 6px; }
.mod-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface-2); font: 600 11px/1 var(--font); color: var(--text); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.mod-chip.accent { background: var(--accent-soft); border-color: var(--info-border); color: var(--accent-text); }
.mod-chip.ok { background: var(--ok-soft); border-color: var(--ok-border); color: var(--ok-text); }
.mod-chip.warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn-text); }
.mod-chip.danger { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger-text); }
/* Repeat bugs: each original, then its duplicates. */
.mod-group + .mod-group { border-top: 1px solid var(--border-strong); }
.mod-group-h { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--surface-2); }
.mod-group-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mod-group-t { font-size: 13px; line-height: 20px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.mod-group-s { font-size: 12px; line-height: 16px; color: var(--muted); }
.mod-group-fix { font-size: 12px; line-height: 16px; color: var(--muted); }
.mod-group-fix.ok { color: var(--ok-text); }
.mod-group-fix.warn { color: var(--warn-text); }
.mod-group-fix.accent { color: var(--accent-text); }
.mod-group-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.mod-group-n { font: 600 16px/20px var(--font); font-variant-numeric: tabular-nums; }
.mod-group .mod-rows > .mod-row:first-child { border-top: 1px solid var(--border); }
.mod-group-more { display: block; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; }

/* The open ticket. */
.mod-detail { display: flex; flex-direction: column; min-height: 320px; }
.mod-d-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.mod-d-actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mod-d-b { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.mod-d-t { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; overflow-wrap: anywhere; }
.mod-d-meta { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12px; line-height: 16px; color: var(--muted); }
.mod-verdict { border: 1px solid var(--info-border); background: var(--accent-soft); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.mod-v-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; line-height: 20px; }
.ic.accent { color: var(--accent-text); }
.mod-refs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.mod-ref { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); min-width: 0; }
.mod-ref > .ic { flex: none; margin-top: 2px; }
.mod-ref-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mod-ref-e { font-size: 12px; line-height: 16px; color: var(--muted); }
.mod-ref-t { font-size: 13px; line-height: 20px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.mod-ref-s { font-size: 12px; line-height: 16px; color: var(--muted); }
.mod-d-cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.mod-d-main { flex: 999 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.mod-sec-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.mod-sec-h h3 { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
/* One history: Discord, Ticket Relay and GitHub. */
.mod-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.mod-history-box { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* While GitHub's side is read: a line under the history, its spinner in the markers' column. */
.mod-loading { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: center; margin: 0; }
.mod-loading .mod-spin { justify-self: center; animation: spin 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .mod-loading .mod-spin { animation: none; } }
.mod-h { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 13px; line-height: 20px; position: relative; }
.mod-h:not(:last-child)::before { content: ''; position: absolute; left: 11.5px; top: 28px; bottom: -10px; width: 1px; background: var(--border); }
.mod-h .actor { font-weight: 500; }
.mod-h .extra { font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 2px; }
.mod-h-b { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mod-h-l { display: flex; gap: 8px; justify-content: space-between; align-items: baseline; min-width: 0; }
.mod-h-l > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.mod-h-l .tag.label { vertical-align: middle; }
.mod-h .when { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mod-text, .mod-bubble { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); padding: 12px; min-width: 0; overflow-wrap: anywhere; }
.mod-bubble { background: var(--surface); }
.mod-md { max-width: none; }
.mod-md > :first-child { margin-top: 0; }
.mod-md img { max-width: 100%; height: auto; }
.mod-md pre { overflow-x: auto; }
.mod-answers { margin: 10px 0 0; display: grid; grid-template-columns: minmax(100px, 160px) minmax(0, 1fr); gap: 4px 12px; font-size: 13px; }
.mod-answers dt { color: var(--muted); }
.mod-answers dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.mod-reply { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.mod-reply-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mod-reply-h label { font-size: 13px; font-weight: 600; }
.mod-reply-h .select { margin-left: auto; min-width: 200px; }
.mod-reply-text { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; line-height: 20px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.mod-reply .row.end, .mod-form + .card-f .end { justify-content: flex-end; }
/* What's known about it, on the right. */
.mod-facts { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 14px; font-size: 13px; line-height: 20px; }
.mod-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mod-f-k { font-size: 12px; line-height: 16px; color: var(--muted); }
.mod-f-v { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.mod-add { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border: 1px dashed var(--border-strong); border-radius: var(--r-xs); background: transparent; color: var(--muted); font: 500 12px/1 var(--font); cursor: pointer; }
.mod-add:hover { color: var(--text); border-color: var(--border-hover); }
.mod-similar { padding-top: 12px; border-top: 1px solid var(--border); }
.mod-similar a { display: flex; flex-direction: column; gap: 1px; color: var(--text); text-decoration: none; }
.mod-similar a:hover > span:first-child { text-decoration: underline; }
.mod-similar a > span:last-child { font-size: 12px; line-height: 16px; }
.mod-keys { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.mod-keys kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--border-strong); border-radius: var(--r-xs); font: 500 11px/16px var(--font); text-align: center; color: var(--text); background: var(--surface); }
/* Closing: the reasons, then what happens on GitHub for the one picked. */
.mod-reasons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mod-gh { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.mod-gh-h { font-size: 13px; font-weight: 600; }
.mod-gh p { margin: 0; }
.mod-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.mod-check input { margin: 0; accent-color: var(--accent); }
.mod-label-list { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; }
.mod-form { display: flex; flex-direction: column; gap: 14px; }
.mod-form .setting { padding: 0; }
@media (max-width: 960px) {
  .mod-split { grid-template-columns: minmax(0, 1fr); }
  .mod-list { position: static; max-height: 60vh; }
  .mod-filters { margin-left: 0; width: 100%; }
  .mod-filters .search { flex: 1; width: auto; }
}
@media (max-width: 560px) {
  .mod-filters .search { flex: 1 1 100%; }
  .mod-reasons { grid-template-columns: minmax(0, 1fr); }
  .mod-d-b { padding: 14px 16px 16px; }
  .mod-d-actions { margin-left: 0; width: 100%; }
  .mod-reply-h .select { margin-left: 0; width: 100%; }
  .mod-answers { grid-template-columns: minmax(0, 1fr); }
}

/* ---- MCP ------------------------------------------------------------------------------------------ */

/* Members & permissions: a moderator's MCP tools, in Read and Write, each with a switch for the group. */
.acc-mcp-note { margin: 0 0 4px; font-size: 12px; line-height: 16px; color: var(--muted); max-width: 560px; }
.acc-mcp-g { margin-top: 8px; padding: 12px 0 0; border-top: 1px solid var(--border); }
.acc-mcp-gh { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.acc-mcp-gh .t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.acc-mcp-gh .n { display: inline-flex; align-items: center; gap: 6px; font: 600 13px/20px var(--font); color: var(--text); }
.acc-mcp-gh .n .ic { color: var(--muted); }
.acc-mcp-gh .c { font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.acc-mcp-g > .d { margin: 2px 0 6px; font-size: 12px; line-height: 16px; color: var(--muted); max-width: 560px; }
.acc-mcp-g .acc-page { padding-left: 20px; }

/* The Connect tab. */
.mcp-new { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 16px; align-items: start; }
.mcp-new input[type="text"] { width: 100%; }
.mcp-new .select { width: 100%; }
.mcp-kind, .mcp-kind-note, .mcp-new-go { grid-column: 1 / -1; }
.mcp-kind .label { margin-bottom: 6px; }
.mcp-kind .choices { display: grid; grid-template-columns: 1fr 1fr; }
.mcp-kind-note { display: flex; align-items: center; gap: 6px; margin: 0; }
.mcp-setup { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mcp-setup .seg { align-self: flex-start; max-width: 100%; overflow-x: auto; }
.mcp-pane { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mcp-pane p { margin: 0; }
.mcp-pane-name { font: 600 13px/20px var(--font); }
.mcp-code { position: relative; min-width: 0; }
.mcp-code pre { margin: 0; padding: 12px 44px 12px 14px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); font: 12px/18px var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.mcp-code .icon-btn { position: absolute; top: 8px; right: 8px; }
.mcp-how { border-top: 1px solid var(--border); }
.mcp-how > summary { display: flex; align-items: center; gap: 4px; padding: 12px 20px; font-size: 13px; line-height: 20px; font-weight: 500; cursor: pointer; list-style: none; }
.mcp-how > summary::-webkit-details-marker { display: none; }
.mcp-how > summary .chev { color: var(--muted); transition: transform var(--t) var(--ease); }
.mcp-how[open] > summary .chev { transform: rotate(90deg); }
.mcp-how > .card-b { padding-top: 0; }
/* What your agent can do: Read and Write side by side. */
.mcp-cols { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); }
.mcp-col { min-width: 0; padding: 16px 20px 8px; }
.mcp-col + .mcp-col { border-left: 1px solid var(--border); }
.mcp-col-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mcp-col-h h3 { display: inline-flex; align-items: center; gap: 6px; margin: 0; font: 600 14px/20px var(--font); }
.mcp-col-h h3 .ic { color: var(--muted); }
.mcp-col-n { font: 500 12px/16px var(--font); color: var(--accent-text); font-variant-numeric: tabular-nums; }
.mcp-col-n.none { color: var(--muted); }
.mcp-col-d { margin: 2px 0 8px; font-size: 12px; line-height: 16px; color: var(--muted); }
.mcp-tools { list-style: none; margin: 0; padding: 0; }
.mcp-tools li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--border); }
.mcp-tools li > .ic { margin-top: 2px; }
.mcp-tools .n { display: flex; align-items: center; gap: 6px; font: 500 13px/20px var(--font); color: var(--text); }
.mcp-tools .d { font-size: 12px; line-height: 16px; color: var(--muted); }
.mcp-tools li.off .n { color: var(--muted); }

/* A tool's Docs tab: contents beside the guide. */
.docs { display: grid; grid-template-columns: 200px minmax(0, 760px); gap: 40px; align-items: start; margin-top: 8px; }
.docs-toc { position: sticky; top: 24px; font-size: 13px; line-height: 20px; }
.docs-toc-h { font: 600 12px/16px var(--font); color: var(--muted); margin-bottom: 8px; }
.docs-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.docs-toc a { display: block; padding: 4px 10px; border-left: 2px solid var(--border); color: var(--muted); text-decoration: none; }
.docs-toc a:hover { color: var(--text); border-left-color: var(--border-hover); }
.docs-body { min-width: 0; }
.docs-intro h1 { margin: 0; font-size: 22px; line-height: 30px; letter-spacing: -0.01em; }
.docs-intro p { margin: 8px 0 0; font-size: 15px; line-height: 24px; color: var(--muted); }
.docs-s { padding-top: 28px; margin-top: 28px; border-top: 1px solid var(--border); scroll-margin-top: 16px; }
.docs-s h2 { margin: 0 0 8px; font-size: 17px; line-height: 24px; }
.docs-s h3 { margin: 24px 0 6px; font-size: 14px; line-height: 20px; }
.docs-s p, .docs-s li { font-size: 14px; line-height: 22px; }
.docs-s p { margin: 8px 0 0; }
.docs-s ul, .docs-s ol { margin: 8px 0 0; padding-left: 20px; }
.docs-s li + li { margin-top: 6px; }
.docs-s strong { font-weight: 600; }
.docs-steps { margin-bottom: 12px !important; }
.docs-s .mcp-setup { margin: 4px 0 12px; }
.docs-tools { margin: 12px 0 0; }
.docs-tools dt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding-top: 12px; border-top: 1px solid var(--border); font: 600 14px/20px var(--font); }
.docs-tools dt:first-child { border-top: 0; padding-top: 0; }
.docs-tools .fns { display: inline-flex; flex-wrap: wrap; gap: 4px; font-weight: 400; }
.docs-tools dd { margin: 4px 0 12px; }
.docs-tools dd p { margin: 0; color: var(--muted); }
.docs-tools dd p + p { margin-top: 6px; }
.docs-tools + .docs-tools { margin-top: 0; }
.docs-tools + .docs-tools dt:first-child { padding-top: 12px; border-top: 1px solid var(--border); }
.docs-table td:first-child { width: 38%; font-weight: 500; }
.docs-table td { vertical-align: top; font-size: 13px; line-height: 20px; }
.docs-s .table-wrap { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.docs-note { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--info-border); border-radius: var(--r-sm); background: var(--accent-soft); font-size: 13px; line-height: 20px; }
.docs-note.warn { border-color: var(--warn-border); background: var(--warn-soft); }

@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .docs-toc { position: static; }
  .docs-toc ol { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
  .docs-toc a { padding: 2px 0; border-left: 0; }
}
@media (max-width: 640px) {
  .mcp-new { grid-template-columns: minmax(0, 1fr); }
  .mcp-kind .choices { grid-template-columns: minmax(0, 1fr); }
  .mcp-cols { grid-template-columns: minmax(0, 1fr); }
  .mcp-col { padding: 16px 16px 8px; }
  .mcp-col + .mcp-col { border-left: 0; border-top: 1px solid var(--border); }
  .mcp-how > summary { padding: 12px 16px; }
  .acc-mcp-g .acc-page { padding-left: 0; }
}
