/* ==========================================================================
   Dren Group IT — Ops Console v2 design system  (light default + dark via html[data-theme="dark"])
   Tokens -> base -> layout -> components -> states -> responsive -> motion
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light;

  --bg: #FFFFFF;
  --bg-subtle: #F7F7F8;
  --bg-muted: #F1F1F3;
  --border: #ECECEF;
  --border-strong: #D9D9DE;
  --text: #111827;
  --text-muted: #6B7280;
  --text-faint: #9CA3AF;
  --accent: #DC2626;
  --accent-hover: #B91C1C;
  --accent-soft: #FEF2F2;
  --focus: #2563EB;
  --note-bg: #FFFBEB;
  --note-border: #FDE68A;
  --note-fg: #92400E;
  --note-hover: #FEF3C7;
  --strip-bg: #FEF3C7;

  /* surfaces & semantic extras (every colour used by a component lives here so dark can override it) */
  --card: #FFFFFF;
  --hover: #F7F7F8;
  --input-bg: #FFFFFF;
  --accent-fill: #DC2626;
  --accent-fill-hover: #B91C1C;
  --on-accent: #FFFFFF;
  --accent-border: #FECACA;
  --focus-ring: rgba(37,99,235,.15);
  --focus-ring-strong: rgba(37,99,235,.35);
  --sel-bg: #FEE2E2;
  --overlay: rgba(17,24,39,.4);
  --scrim: rgba(17,24,39,.3);
  --tip-bg: #111827;
  --tip-fg: #FFFFFF;
  --tip-border: transparent;
  --toast-bg: #111827;
  --toast-fg: #FFFFFF;
  --toast-border: transparent;
  --toast-err-bg: #7F1D1D;
  --toast-ok: #4ADE80;
  --toast-err: #FCA5A5;
  --toast-x: rgba(255,255,255,.6);
  --danger-border: #FCA5A5;
  --err-border: #FECACA;
  --info-border: #BFDBFE;
  --banner-err-fg: #7F1D1D;
  --banner-warn-fg: #78350F;
  --banner-info-fg: #1E3A8A;
  --notif-unread: #FAFAFF;
  --skel-hi: #F8F8FA;
  --star-on: #D97706;
  --warn-fill: #D97706;
  --pr-critical-ring: rgba(220,38,38,.15);
  --sh-up: 0 -4px 12px rgba(17,24,39,.04);
  --chart-ink: #111827;
  --ch-blue: #2563EB; --ch-violet: #7C3AED; --ch-gray: #9CA3AF; --ch-amber: #D97706; --ch-green: #16A34A;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  --st-open: #2563EB;            --st-open-bg: #EFF6FF;
  --st-in_progress: #B45309;     --st-in_progress-bg: #FFFBEB;
  --st-waiting_client: #7C3AED;  --st-waiting_client-bg: #F5F3FF;
  --st-resolved: #15803D;        --st-resolved-bg: #F0FDF4;
  --st-closed: #6B7280;          --st-closed-bg: #F3F4F6;

  --pr-critical: #DC2626;
  --pr-high: #EA580C;
  --pr-medium: #2563EB;
  --pr-low: #9CA3AF;

  --sla-ok: #15803D;
  --sla-warning: #B45309;
  --sla-breached: #DC2626;
  --sla-paused: #6B7280;
  --sla-met: #15803D;
  --sla-missed: #B91C1C;

  --ok: #15803D;  --ok-bg: #F0FDF4;
  --warn: #B45309; --warn-bg: #FFFBEB;
  --err: #B91C1C; --err-bg: #FEF2F2;

  --sh-1: 0 1px 2px rgba(17,24,39,.06);
  --sh-2: 0 4px 12px rgba(17,24,39,.08);
  --sh-3: 0 12px 32px rgba(17,24,39,.12);

  --r-sm: 6px; --r-md: 8px; --r-lg: 12px;

  --s-1: 2px; --s-2: 4px; --s-3: 8px; --s-4: 12px; --s-5: 16px; --s-6: 24px; --s-7: 32px; --s-8: 48px;

  --t-fast: 120ms ease-out;
  --t-panel: 180ms ease-out;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --nav-w: 224px;
  --nav-w-collapsed: 56px;
  --list-w: 420px;
  --side-w: 300px;
  --row-h: 36px;

  --z-nav: 20; --z-strip: 60; --z-menu: 80; --z-overlay: 90; --z-toast: 100;
}

/* ---------- 1b. Dark theme ("dim": charcoal-slate, never pure black / pure white) ---------- */
html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #262A33;
  --bg-subtle: #1F2329;
  --bg-muted: #323843;
  --card: #2E333D;
  --hover: #2D323C;
  --input-bg: #1F2329;
  --border: #3A404C;
  --border-strong: #4A5160;
  --text: #E6E8EC;
  --text-muted: #A9B0BC;
  --text-faint: #949CAA;
  --accent: #EF4444;
  --accent-hover: #F87171;
  --accent-soft: rgba(239,68,68,.10);
  --accent-fill: #DC2626;
  --accent-fill-hover: #CF2525;
  --on-accent: #F9FAFB;
  --accent-border: rgba(248,113,113,.35);
  --focus: #60A5FA;
  --focus-ring: rgba(96,165,250,.25);
  --focus-ring-strong: rgba(96,165,250,.5);
  --sel-bg: rgba(239,68,68,.35);
  --note-bg: rgba(251,191,36,.10);
  --note-border: rgba(251,191,36,.28);
  --note-fg: #E8C777;
  --note-hover: rgba(251,191,36,.18);
  --strip-bg: #3A3322;

  --st-open: #7CB3FB;            --st-open-bg: rgba(96,165,250,.16);
  --st-in_progress: #FBBF24;     --st-in_progress-bg: rgba(251,191,36,.16);
  --st-waiting_client: #B7A4FC;  --st-waiting_client-bg: rgba(167,139,250,.16);
  --st-resolved: #4ADE80;        --st-resolved-bg: rgba(74,222,128,.16);
  --st-closed: #A9B0BC;          --st-closed-bg: rgba(148,163,184,.16);

  --pr-critical: #F87171;
  --pr-high: #FB923C;
  --pr-medium: #60A5FA;
  --pr-low: #8B93A1;

  --sla-ok: #4ADE80;
  --sla-warning: #FBBF24;
  --sla-breached: #FA8F8F;
  --sla-paused: #A9B0BC;
  --sla-met: #4ADE80;
  --sla-missed: #FA8F8F;

  --ok: #4ADE80;  --ok-bg: rgba(74,222,128,.14);
  --warn: #FBBF24; --warn-bg: rgba(251,191,36,.14);
  --err: #FA8F8F; --err-bg: rgba(248,113,113,.14);

  --sh-1: 0 1px 2px rgba(0,0,0,.28);
  --sh-2: 0 4px 12px rgba(0,0,0,.32);
  --sh-3: 0 12px 32px rgba(0,0,0,.42);
  --sh-up: 0 -4px 12px rgba(0,0,0,.22);

  --overlay: rgba(14,16,20,.55);
  --scrim: rgba(14,16,20,.5);
  --tip-bg: #444B58;
  --tip-fg: #F1F3F6;
  --tip-border: #5A6272;
  --toast-bg: #353A45;
  --toast-fg: #E6E8EC;
  --toast-border: #4A5160;
  --toast-err-bg: #4A2A2E;
  --toast-ok: #4ADE80;
  --toast-err: #FCA5A5;
  --toast-x: rgba(230,232,236,.6);
  --danger-border: rgba(248,113,113,.45);
  --err-border: rgba(248,113,113,.35);
  --info-border: rgba(96,165,250,.35);
  --banner-err-fg: #FCA5A5;
  --banner-warn-fg: #E8C777;
  --banner-info-fg: #A5CBFD;
  --notif-unread: rgba(96,165,250,.08);
  --skel-hi: #3B414D;
  --star-on: #FBBF24;
  --warn-fill: #D99A12;
  --pr-critical-ring: rgba(248,113,113,.22);
  --chart-ink: #B8BFCB;
  --ch-blue: #60A5FA; --ch-violet: #A78BFA; --ch-gray: #8B93A1; --ch-amber: #FBBF24; --ch-green: #4ADE80;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A9B0BC' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
/* avatars: soften saturated hues on dark and use a soft off-white initial for contrast */
html[data-theme="dark"] .avatar { background: color-mix(in srgb, var(--av, var(--accent-fill)) 72%, var(--bg)); color: #F3F4F6; }
html[data-theme="dark"] .avatar.unassigned { background: var(--bg-subtle); color: var(--text-faint); }
html[data-theme="dark"] input[type="color"].input { background: var(--input-bg); }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow: hidden;
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -.005em; }
h3 { font-size: 16px; font-weight: 600; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code, .mono { font-family: var(--mono); font-feature-settings: "zero" 1; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.caption { font-size: 11px; color: var(--text-muted); }
.meta { font-size: 12px; color: var(--text-muted); }
.dense { font-size: 13px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
::selection { background: var(--sel-bg); }
html { background: var(--bg); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
::-webkit-scrollbar-track { background: transparent; }

.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon.sz-12 { width: 12px; height: 12px; }
.icon.sz-20 { width: 20px; height: 20px; }
.icon.sz-24 { width: 24px; height: 24px; }
.icon.sz-32 { width: 32px; height: 32px; stroke-width: 1.5; }

/* ---------- 3. Layout ---------- */
.skip-link { position: absolute; left: 8px; top: -48px; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: var(--r-sm); z-index: 200; transition: top var(--t-fast); }
.skip-link:focus { top: 8px; text-decoration: none; }

.app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; overflow: clip; transition: grid-template-columns var(--t-panel); }
.app.nav-collapsed { grid-template-columns: var(--nav-w-collapsed) minmax(0, 1fr); }
.main { min-width: 0; min-height: 0; overflow: hidden; overflow: clip; background: var(--bg); position: relative; display: flex; flex-direction: column; }
.main:focus, .view:focus { outline: none; }
.view { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; position: relative; }
.route-root { flex: 1 0 auto; display: flex; flex-direction: column; min-width: 0; }
.route-root.fill { flex: 1 1 0; min-height: 0; overflow: hidden; overflow: clip; }

.page { padding: var(--s-6) var(--s-7) var(--s-8); max-width: 1280px; width: 100%; margin: 0 auto; flex: none; }
.page.narrow { max-width: 880px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-6); flex-wrap: wrap; }
.page-head .sub { color: var(--text-muted); font-size: 13px; margin-top: var(--s-2); }
.page-actions { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
.toolbar .grow { flex: 1 1 auto; }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s-3); }
.row { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-4); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-5); box-shadow: var(--sh-1); }
.card h3 { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: none; margin-bottom: var(--s-3); }
.card .big { font-size: 24px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.card .cap { font-size: 12px; color: var(--text-muted); margin-top: var(--s-2); }
.section { margin-top: var(--s-7); }
.section > .section-title { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: var(--s-3); }
.divider { height: 1px; background: var(--border); border: 0; margin: var(--s-4) 0; }

/* Three-pane inbox scaffold (modules fill the panes) */
.panes { display: grid; grid-template-columns: var(--list-w) minmax(0, 1fr); flex: 1 1 auto; min-height: 0; height: 100%; }
.pane-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.pane-detail { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: auto; }
.pane-head { padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--s-3); }
.pane-scroll { overflow: auto; flex: 1 1 auto; min-height: 0; }
.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); min-height: 0; flex: 1 1 auto; }
.detail-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.detail-side { border-left: 1px solid var(--border); background: var(--bg-subtle); padding: var(--s-5); overflow: auto; display: flex; flex-direction: column; gap: var(--s-5); }
.resizer { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; z-index: 5; }
.resizer::after { content: ""; position: absolute; left: 2px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background var(--t-fast); }
.resizer:hover::after, .resizer.dragging::after { background: var(--focus); }

/* ---------- 4. Left nav ---------- */
.nav { background: var(--bg-subtle); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; min-width: 0; z-index: var(--z-nav); }
.nav-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-4) var(--s-4) var(--s-3) var(--s-5); height: 52px; }
.brand { display: flex; align-items: center; gap: var(--s-3); font-weight: 600; font-size: 14px; letter-spacing: -.005em; min-width: 0; }
.brand-mark { width: 24px; height: 24px; border-radius: 6px; background: var(--accent-fill); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.brand-text { white-space: nowrap; overflow: hidden; }
.brand-text small { display: block; font-weight: 400; font-size: 11px; color: var(--text-muted); line-height: 1.1; }
.nav-search { margin: 0 var(--s-3) var(--s-3); height: 32px; display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-3); background: var(--card); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text-muted); font-size: 13px; box-shadow: var(--sh-1); transition: border-color var(--t-fast); }
.nav-search:hover { border-color: var(--border-strong); }
.nav-search .grow { flex: 1; text-align: left; }
.nav-scroll { flex: 1 1 auto; overflow: auto; padding: 0 var(--s-3) var(--s-4); }
.nav-group { margin-top: var(--s-4); }
.nav-group-title { font-size: 11px; font-weight: 600; color: var(--text-faint); letter-spacing: .04em; text-transform: uppercase; padding: var(--s-2) var(--s-3); }
.nav-item { display: flex; align-items: center; gap: var(--s-3); height: 32px; padding: 0 var(--s-3); border-radius: var(--r-sm); color: var(--text); font-size: 13px; font-weight: 500; position: relative; width: 100%; background: none; border: 0; text-align: left; transition: background var(--t-fast); }
.nav-item:hover { background: var(--bg-muted); text-decoration: none; }
.nav-item .icon { color: var(--text-muted); }
.nav-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item[aria-current="page"] { background: var(--card); box-shadow: var(--sh-1), 0 0 0 1px var(--border); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item[aria-current="page"] .icon { color: var(--text); }
.nav-item .count { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 16px; text-align: right; }
.nav-item .count.alert { color: var(--on-accent); background: var(--accent-fill); border-radius: 999px; padding: 0 6px; font-weight: 600; line-height: 18px; min-width: 18px; text-align: center; }
.nav-sub { margin-left: var(--s-5); border-left: 1px solid var(--border); padding-left: var(--s-2); }
.nav-sub .nav-item { height: 28px; font-weight: 400; color: var(--text-muted); }
.nav-sub .nav-item[aria-current="page"] { color: var(--text); font-weight: 500; }
.nav-foot { border-top: 1px solid var(--border); padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-3); }
.nav-foot-row { display: flex; align-items: center; gap: var(--s-3); }
.nav-user { display: flex; align-items: center; gap: var(--s-3); flex: 1; min-width: 0; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: none; border: 0; text-align: left; }
.nav-user:hover { background: var(--bg-muted); }
.nav-user .who { min-width: 0; line-height: 1.2; }
.nav-user .who b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user .who span { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

.app.nav-collapsed .brand-text, .app.nav-collapsed .nav-item .label, .app.nav-collapsed .nav-item .count,
.app.nav-collapsed .nav-group-title, .app.nav-collapsed .nav-search .grow, .app.nav-collapsed .nav-search .kbd,
.app.nav-collapsed .nav-user .who, .app.nav-collapsed .nav-sub { display: none; }
.app.nav-collapsed .nav-item { justify-content: center; padding: 0; }
.app.nav-collapsed .nav-item[aria-current="page"]::before { left: -8px; }
.app.nav-collapsed .nav-search { justify-content: center; padding: 0; margin: 0 var(--s-3) var(--s-3); }
.app.nav-collapsed .nav-head { padding: var(--s-4) var(--s-3) var(--s-3); justify-content: center; }
.app.nav-collapsed .nav-head .brand { display: none; }
.app.nav-collapsed .nav-foot-row { flex-direction: column; }
.app.nav-collapsed .timer-pill .tp-text { display: none; }

/* skeleton dots shown for counts that have not loaded */
.dots { display: inline-flex; gap: 2px; align-items: center; height: 16px; }
.dots i { width: 3px; height: 3px; border-radius: 50%; background: var(--text-faint); animation: dotpulse 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dotpulse { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* timer pill */
.timer-pill { display: flex; align-items: center; gap: var(--s-3); width: 100%; height: 32px; padding: 0 var(--s-3); border-radius: var(--r-sm); border: 1px solid var(--note-border); background: var(--note-bg); color: var(--note-fg); font-size: 12px; font-weight: 500; text-align: left; }
.timer-pill:hover { background: var(--note-hover); }
.timer-pill .rec { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; animation: recpulse 1.6s infinite; }
.timer-pill .tp-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-pill .timer { font-family: var(--mono); font-variant-numeric: tabular-nums; }
@keyframes recpulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.timer { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* bell */
.bell { position: relative; }
.badge { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--accent-fill); color: var(--on-accent); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; border: 2px solid var(--bg-subtle); box-sizing: content-box; }

/* reconnect strip */
.strip { position: fixed; left: 50%; bottom: var(--s-5); transform: translateX(-50%); z-index: var(--z-strip); width: max-content; max-width: calc(100vw - 32px); pointer-events: none; background: var(--strip-bg); color: var(--note-fg); border: 1px solid var(--note-border); border-radius: 999px; box-shadow: var(--sh-2); text-align: center; font-size: 12px; font-weight: 500; padding: 5px 14px; display: flex; justify-content: center; align-items: center; gap: var(--s-3); }

/* ---------- 5. Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-3); height: 32px; padding: 0 var(--s-4); border-radius: var(--r-sm); border: 1px solid transparent; background: var(--card); font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap; user-select: none; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.btn:active:not(:disabled) { transform: translateY(.5px); }
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 28px; padding: 0 var(--s-3); font-size: 12px; }
.btn-lg { height: 40px; padding: 0 var(--s-5); font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent-fill); color: var(--on-accent); box-shadow: var(--sh-1); }
.btn-primary:hover:not(:disabled) { background: var(--accent-fill-hover); }
.btn-secondary { background: var(--card); border-color: var(--border-strong); color: var(--text); box-shadow: var(--sh-1); }
.btn-secondary:hover:not(:disabled) { background: var(--hover); }
html[data-theme="dark"] .btn-secondary:hover:not(:disabled) { background: var(--bg-muted); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-muted); color: var(--text); }
.btn-danger { background: var(--card); color: var(--err); border-color: var(--danger-border); }
.btn-danger:hover:not(:disabled) { background: var(--err-bg); }
.btn-danger.solid { background: var(--accent-fill); color: var(--on-accent); border-color: transparent; }
.btn-danger.solid:hover:not(:disabled) { background: var(--accent-fill-hover); }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); border: 0; background: none; color: var(--text-muted); position: relative; transition: background var(--t-fast), color var(--t-fast); flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--bg-muted); color: var(--text); }
.icon-btn.sm { width: 24px; height: 24px; }
.icon-btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--focus); font-size: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 6. Form controls ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.field .hint { font-size: 12px; color: var(--text-muted); }
.field .err { font-size: 12px; color: var(--err); }
.field.invalid .input, .field.invalid select, .field.invalid textarea { border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.form-grid .span-2 { grid-column: 1 / -1; }
.input, select.select, textarea.textarea {
  width: 100%; height: 32px; padding: 0 var(--s-3); background: var(--input-bg); border: 1px solid var(--border-strong); border-radius: var(--r-sm); font-size: 13px; line-height: 1.4;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder, textarea.textarea::placeholder { color: var(--text-faint); }
.input:hover, select.select:hover, textarea.textarea:hover { border-color: var(--text-faint); }
.input:focus, select.select:focus, textarea.textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); outline: none; }
.input:disabled, select.select:disabled, textarea.textarea:disabled { background: var(--bg-subtle); color: var(--text-muted); cursor: not-allowed; }
textarea.textarea { height: auto; min-height: 80px; padding: var(--s-3); resize: vertical; }
select.select { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: var(--select-arrow); background-repeat: no-repeat; background-position: right 10px center; }
select.select.sm, .input.sm { height: 28px; font-size: 12px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .icon { position: absolute; left: 10px; color: var(--text-faint); pointer-events: none; }
.input-wrap > .input { padding-left: 32px; }

.check { display: inline-flex; align-items: center; gap: var(--s-3); font-size: 13px; cursor: pointer; user-select: none; }
.check input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--input-bg); display: grid; place-items: center; cursor: pointer; flex: none; transition: background var(--t-fast), border-color var(--t-fast); }
.check input:hover { border-color: var(--text-faint); }
.check input:checked { background: var(--accent-fill); border-color: var(--accent-fill); }
.check input:checked::after { content: ""; width: 8px; height: 4px; border-left: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent); transform: translateY(-1px) rotate(-45deg); }
.check input:indeterminate { background: var(--accent-fill); border-color: var(--accent-fill); }
.check input:indeterminate::after { content: ""; width: 8px; height: 2px; background: var(--on-accent); }
.check input:disabled { opacity: .5; cursor: not-allowed; }

.segmented { display: inline-flex; padding: 2px; background: var(--bg-muted); border-radius: var(--r-sm); gap: 2px; }
.segmented button { height: 26px; padding: 0 var(--s-4); border: 0; background: none; border-radius: 4px; font-size: 12px; font-weight: 500; color: var(--text-muted); transition: background var(--t-fast), color var(--t-fast); white-space: nowrap; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"], .segmented button[aria-checked="true"] { background: var(--card); color: var(--text); box-shadow: var(--sh-1); }

/* chips & filter chips */
.chip { display: inline-flex; align-items: center; gap: var(--s-2); height: 24px; padding: 0 var(--s-3); border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--card); font-size: 12px; color: var(--text); white-space: nowrap; }
button.chip:hover { background: var(--hover); }
.chip.active { background: var(--bg-muted); border-color: var(--text-faint); font-weight: 500; }
.chip .x { color: var(--text-faint); display: inline-grid; place-items: center; background: none; border: 0; padding: 0; }
.chip .x:hover { color: var(--text); }
.chip-row { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }

/* tag */
.tag { display: inline-flex; align-items: center; gap: var(--s-2); height: 20px; padding: 0 var(--s-3); border-radius: 999px; font-size: 11px; font-weight: 500; background: var(--bg-muted); color: var(--text); white-space: nowrap; max-width: 140px; }
.tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--tag-c, var(--text-faint)); flex: none; }
.tag span { overflow: hidden; text-overflow: ellipsis; }
.tag .x { background: none; border: 0; padding: 0; color: var(--text-faint); display: grid; place-items: center; }
.tag .x:hover { color: var(--text); }
.tag.more { background: transparent; color: var(--text-muted); padding: 0 var(--s-2); }
.tag-input { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; padding: 3px var(--s-2); min-height: 32px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--input-bg); position: relative; }
.tag-input:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.tag-input input { border: 0; outline: 0; background: none; flex: 1; min-width: 80px; height: 24px; font-size: 13px; }

/* status pill, priority, SLA */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 var(--s-3); border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; background: var(--pill-bg, var(--bg-muted)); color: var(--pill-c, var(--text-muted)); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill[data-status="open"] { --pill-bg: var(--st-open-bg); --pill-c: var(--st-open); }
.pill[data-status="in_progress"] { --pill-bg: var(--st-in_progress-bg); --pill-c: var(--st-in_progress); }
.pill[data-status="waiting_client"] { --pill-bg: var(--st-waiting_client-bg); --pill-c: var(--st-waiting_client); }
.pill[data-status="resolved"] { --pill-bg: var(--st-resolved-bg); --pill-c: var(--st-resolved); }
.pill[data-status="closed"] { --pill-bg: var(--st-closed-bg); --pill-c: var(--st-closed); }
.pill.neutral { --pill-bg: var(--bg-muted); --pill-c: var(--text-muted); }
.pill.ok { --pill-bg: var(--ok-bg); --pill-c: var(--ok); }
.pill.warn { --pill-bg: var(--warn-bg); --pill-c: var(--warn); }
.pill.err { --pill-bg: var(--err-bg); --pill-c: var(--err); }

.pdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--pr-low); }
.pdot[data-priority="critical"] { background: var(--pr-critical); box-shadow: 0 0 0 3px var(--pr-critical-ring); }
.pdot[data-priority="high"] { background: var(--pr-high); }
.pdot[data-priority="medium"] { background: var(--pr-medium); }
.pdot[data-priority="low"] { background: var(--pr-low); }
.pdot-label { display: inline-flex; align-items: center; gap: var(--s-3); font-size: 13px; text-transform: capitalize; }

.sla { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 var(--s-3); border-radius: 999px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; border: 1px solid transparent; }
.sla[data-state="ok"] { color: var(--sla-ok); background: var(--ok-bg); }
.sla[data-state="warning"] { color: var(--sla-warning); background: var(--warn-bg); border-color: var(--note-border); }
.sla[data-state="breached"] { color: var(--sla-breached); background: var(--err-bg); border-color: var(--err-border); }
.sla[data-state="paused"] { color: var(--sla-paused); background: var(--bg-muted); }
.sla[data-state="met"] { color: var(--sla-met); background: transparent; border-color: var(--border); }
.sla[data-state="missed"] { color: var(--sla-missed); background: transparent; border-color: var(--err-border); }
.sla[data-state="none"] { color: var(--text-faint); background: transparent; }

/* avatars */
.avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--av, var(--accent-fill)); color: var(--on-accent); font-size: 10px; font-weight: 600; letter-spacing: .02em; flex: 0 0 auto; align-self: center; aspect-ratio: 1 / 1; min-width: 0; min-height: 0; padding: 0; line-height: 1; user-select: none; box-shadow: 0 0 0 2px var(--bg); }
.avatar.sz-20 { width: 20px; height: 20px; font-size: 9px; }
.avatar.sz-32 { width: 32px; height: 32px; font-size: 12px; }
.avatar.unassigned { background: var(--bg-subtle); color: var(--text-faint); box-shadow: none; border: 1px dashed var(--border-strong); }
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar { margin-left: -6px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .more { margin-left: var(--s-2); font-size: 11px; color: var(--text-muted); }

.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--card); font: 500 11px/1 var(--font); color: var(--text-muted); }

/* tooltip */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); background: var(--tip-bg); color: var(--tip-fg); border: 1px solid var(--tip-border); font-size: 11px; font-weight: 500; line-height: 1.3; padding: 4px 8px; border-radius: var(--r-sm); white-space: pre; pointer-events: none; z-index: var(--z-menu); box-shadow: var(--sh-2); max-width: 280px; }
[data-tip][data-tip-pos="right"]:hover::after { left: calc(100% + 6px); bottom: auto; top: 50%; transform: translateY(-50%); }
[data-tip][data-tip-pos="bottom"]:hover::after { bottom: auto; top: calc(100% + 6px); }
.tooltip-pop { position: fixed; z-index: var(--z-toast); background: var(--tip-bg); color: var(--tip-fg); border: 1px solid var(--tip-border); font-size: 11px; padding: 6px 8px; border-radius: var(--r-sm); box-shadow: var(--sh-2); pointer-events: none; max-width: 280px; white-space: pre-line; }

/* ---------- 7. Table & list rows ---------- */
.table-wrap { border: 1px solid var(--border); border-radius: var(--r-md); overflow: auto; background: var(--card); max-height: 100%; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th { position: sticky; top: 0; z-index: 2; background: var(--bg-subtle); text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted); height: 32px; padding: 0 var(--s-4); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.table th button:hover { color: var(--text); }
.table th button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.table td { height: var(--row-h); padding: 0 var(--s-4); border-bottom: 1px solid var(--border); vertical-align: middle; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.selected { background: var(--accent-soft); }
.table tfoot td { background: var(--bg-subtle); font-weight: 600; border-top: 1px solid var(--border); }

.list { display: flex; flex-direction: column; }
.list-row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-3); min-height: var(--row-h); padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; background: var(--bg); transition: background var(--t-fast); }
.list-row:hover { background: var(--hover); }
.list-row.selected { background: var(--accent-soft); }
.list-row.selected::before, .list-row[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.list-row[aria-selected="true"] { background: var(--accent-soft); }
.list-row.focused { box-shadow: inset 0 0 0 2px var(--focus-ring-strong); }
.list-row .lr-lead { display: flex; align-items: center; gap: var(--s-3); }
.list-row .lr-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-row .lr-line1 { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.list-row .lr-num { font-family: var(--mono); font-size: 12px; color: var(--text-muted); flex: none; }
.list-row .lr-subject { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.list-row.unread .lr-subject { font-weight: 600; }
.list-row .lr-line2 { display: flex; align-items: center; gap: var(--s-3); font-size: 12px; color: var(--text-muted); min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.list-row .lr-line2 > * { flex: none; }
.list-row .lr-line2 .push { margin-left: auto; }
.list-row .lr-line2 .grow { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .lr-trail { display: flex; align-items: center; gap: var(--s-3); }
.list-row .unread-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--focus); flex: none; }
.list-row .lr-time { font-size: 11px; color: var(--text-faint); white-space: nowrap; }

/* ---------- 8. States ---------- */
.skeleton { display: block; background: linear-gradient(90deg, var(--bg-muted) 25%, var(--skel-hi) 37%, var(--bg-muted) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-sm); height: 12px; }
.skeleton.block { height: 96px; border-radius: var(--r-md); }
.skeleton.circle { border-radius: 50%; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-row { display: flex; align-items: center; gap: var(--s-4); height: var(--row-h); padding: 0 var(--s-5); border-bottom: 1px solid var(--border); }
.skeleton-rows .skeleton-row { height: 56px; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--s-4); padding: var(--s-8) var(--s-6); color: var(--text-muted); min-height: 240px; }
.empty .empty-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--bg-muted); display: grid; place-items: center; color: var(--text-muted); }
.empty p { font-size: 14px; color: var(--text); max-width: 360px; }
.empty .empty-sub { font-size: 13px; color: var(--text-muted); }

.banner { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); border: 1px solid; font-size: 13px; }
.banner .b-body { flex: 1; min-width: 0; }
.banner-error { background: var(--err-bg); border-color: var(--err-border); color: var(--banner-err-fg); }
.banner-warn { background: var(--note-bg); border-color: var(--note-border); color: var(--banner-warn-fg); }
.banner-info { background: var(--st-open-bg); border-color: var(--info-border); color: var(--banner-info-fg); }
.banner-muted { background: var(--bg-subtle); border-color: var(--border); color: var(--text-muted); }
.banner .icon { margin-top: 2px; }

/* ---------- 9. Overlays ---------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: var(--z-overlay); display: flex; align-items: flex-start; justify-content: center; padding: 10vh var(--s-5) var(--s-5); animation: fadein var(--t-panel); overflow: auto; }
.overlay.center { align-items: center; padding-top: var(--s-5); }
.dialog { width: 100%; max-width: 520px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-3); border: 1px solid var(--border); display: flex; flex-direction: column; max-height: 84vh; animation: popin var(--t-panel); }
.dialog.wide { max-width: 720px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) var(--s-5) var(--s-3); }
.dialog-head h3 { font-size: 16px; }
.dialog-body { padding: var(--s-3) var(--s-5) var(--s-5); overflow: auto; font-size: 14px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); background: var(--bg-subtle); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.drawer-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-overlay); animation: fadein var(--t-panel); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--card); border-left: 1px solid var(--border); box-shadow: var(--sh-3); z-index: calc(var(--z-overlay) + 1); display: flex; flex-direction: column; animation: slidein var(--t-panel); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-5); border-bottom: 1px solid var(--border); }
.drawer-body { padding: var(--s-5); overflow: auto; flex: 1; }
.drawer-foot { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: var(--s-3); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes popin { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.menu { position: fixed; z-index: var(--z-menu); min-width: 200px; max-width: 320px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-2); padding: var(--s-2); animation: popin var(--t-fast); max-height: 70vh; overflow: auto; }
.menu-item { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 32px; padding: 0 var(--s-3); border: 0; background: none; border-radius: var(--r-sm); text-align: left; font-size: 13px; color: var(--text); }
.menu-item:hover, .menu-item.active, .menu-item:focus-visible { background: var(--bg-muted); outline: none; }
.menu-item .icon { color: var(--text-muted); }
.menu-item .kbd { margin-left: auto; }
.menu-item.danger { color: var(--err); }
.menu-item[aria-checked="true"]::after { content: "\2713"; margin-left: auto; color: var(--text-muted); }
.menu-sep { height: 1px; background: var(--border); margin: var(--s-2) calc(var(--s-2) * -1); }
.menu-label { font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; padding: var(--s-3) var(--s-3) var(--s-2); }
.menu-head { padding: var(--s-3); border-bottom: 1px solid var(--border); margin: calc(var(--s-2) * -1) calc(var(--s-2) * -1) var(--s-2); }
.menu-head b { display: block; font-size: 13px; }
.menu-head span { font-size: 12px; color: var(--text-muted); }

.popover-panel { position: fixed; z-index: var(--z-menu); width: 360px; max-width: calc(100vw - 16px); background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-3); animation: popin var(--t-fast); display: flex; flex-direction: column; max-height: 70vh; }
.popover-panel .pp-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.popover-panel .pp-body { overflow: auto; }
.popover-panel .pp-foot { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); text-align: center; font-size: 12px; }

.notif-row { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-3); align-items: start; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.notif-row:hover { background: var(--hover); }
.notif-row.unread { background: var(--notif-unread); }
.notif-row .n-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: transparent; }
.notif-row.unread .n-dot { background: var(--focus); }
.notif-row .n-sub { font-size: 12px; color: var(--text-muted); }

/* command palette */
.palette { width: 100%; max-width: 620px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-3); border: 1px solid var(--border); overflow: hidden; animation: popin var(--t-panel); }
.palette-input { display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-5); height: 52px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.palette-input input { flex: 1; border: 0; outline: 0; font-size: 15px; background: none; color: var(--text); height: 100%; }
.palette-list { max-height: 52vh; overflow: auto; padding: var(--s-2); }
.palette-group { font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; padding: var(--s-3) var(--s-3) var(--s-2); }
.palette-item { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 36px; padding: 0 var(--s-3); border: 0; background: none; border-radius: var(--r-sm); text-align: left; font-size: 13px; }
.palette-item .icon { color: var(--text-muted); }
.palette-item .pi-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .pi-sub { color: var(--text-muted); font-size: 12px; }
.palette-item[aria-selected="true"] { background: var(--bg-muted); }
.palette-foot { display: flex; gap: var(--s-5); padding: var(--s-3) var(--s-5); border-top: 1px solid var(--border); background: var(--bg-subtle); font-size: 12px; color: var(--text-muted); }
.palette-foot span { display: inline-flex; gap: var(--s-2); align-items: center; }

/* shortcuts overlay */
.keys-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
.keys-group h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin-bottom: var(--s-3); }
.keys-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); min-height: 28px; font-size: 13px; }
.keys-row .ks { display: inline-flex; gap: 4px; align-items: center; color: var(--text-faint); font-size: 11px; }

/* toasts */
.toasts { position: fixed; right: var(--s-5); bottom: var(--s-5); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--s-3); align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--s-3); min-width: 240px; max-width: 420px; padding: var(--s-3) var(--s-4); background: var(--toast-bg); color: var(--toast-fg); border: 1px solid var(--toast-border); border-radius: var(--r-md); box-shadow: var(--sh-3); font-size: 13px; animation: popin var(--t-panel); }
.toast .icon { flex: none; }
.toast.success .icon { color: var(--toast-ok); }
.toast.error { background: var(--toast-err-bg); }
.toast.error .icon { color: var(--toast-err); }
.toast .t-msg { flex: 1; min-width: 0; }
.toast .t-act { background: none; border: 0; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; padding: 0 var(--s-2); }
.toast .t-x { background: none; border: 0; color: var(--toast-x); padding: 0; display: grid; place-items: center; }
.toast .t-x:hover { color: var(--toast-fg); }

/* combobox / mention listbox */
.combo { position: relative; }
.listbox { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: var(--z-menu); background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-2); max-height: 260px; overflow: auto; padding: var(--s-2); }
.listbox.up { top: auto; bottom: calc(100% + 4px); }
.option { display: flex; align-items: center; gap: var(--s-3); min-height: 32px; padding: 4px var(--s-3); border-radius: var(--r-sm); cursor: pointer; font-size: 13px; }
.option .o-sub { margin-left: auto; font-size: 12px; color: var(--text-muted); padding-left: var(--s-3); }
.option[aria-selected="true"], .option:hover { background: var(--bg-muted); }
.option.muted { color: var(--text-muted); cursor: default; }
.mention-wrap { position: relative; }

/* date range */
.daterange { display: inline-flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.daterange .input { width: 140px; }

/* progress */
.progress { display: flex; flex-direction: column; gap: var(--s-2); }
.progress-track { height: 6px; background: var(--bg-muted); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--text); border-radius: 999px; transition: width var(--t-panel); }
.progress-fill.warn { background: var(--warn-fill); }
.progress-fill.over { background: var(--accent); }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* charts */
.chart { width: 100%; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--text-muted); }
.chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .bar { fill: var(--chart-ink); }
.chart .bar.alt { fill: var(--border-strong); }
.chart .bar:hover { opacity: .8; }
.chart .val { fill: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: 12px; color: var(--text-muted); margin-top: var(--s-3); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart-n { font-size: 11px; color: var(--text-muted); margin-top: var(--s-2); }
.spark { display: inline-block; vertical-align: middle; }
.spark path { fill: none; stroke: var(--chart-ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: var(--chart-ink); }

/* tabs */
.tabs { display: flex; gap: var(--s-5); border-bottom: 1px solid var(--border); margin-bottom: var(--s-5); overflow-x: auto; }
.tab { position: relative; height: 36px; padding: 0 2px; background: none; border: 0; font-size: 13px; font-weight: 500; color: var(--text-muted); white-space: nowrap; display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; }
.tab .count { font-size: 11px; color: var(--text-muted); background: var(--bg-muted); border-radius: 999px; padding: 0 6px; }

/* file chips */
.file-chip { display: inline-flex; align-items: center; gap: var(--s-2); height: 28px; padding: 0 var(--s-3); border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--card); font-size: 12px; max-width: 220px; }
.file-chip:hover { background: var(--hover); text-decoration: none; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip small { color: var(--text-faint); }

/* ticket-stream helpers (conversation) */
.note { background: var(--note-bg); border: 1px solid var(--note-border); border-radius: var(--r-md); padding: var(--s-4); }
.note-label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--note-fg); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- 10. Login ---------- */
.login { height: 100vh; height: 100dvh; display: grid; place-items: center; padding: var(--s-5); background: var(--bg-subtle); overflow: auto; }
.login-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-2); padding: var(--s-7); }
.login-brand { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-6); font-weight: 600; }
.login-card h1 { font-size: 20px; margin-bottom: var(--s-2); }
.login-card .lead { color: var(--text-muted); font-size: 13px; margin-bottom: var(--s-5); }
.login-card form { display: flex; flex-direction: column; gap: var(--s-4); }
.code-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.code-grid input { width: 100%; min-width: 0; aspect-ratio: 4 / 5; text-align: center; font: 600 18px var(--mono); padding: 0; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--input-bg); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.code-grid input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); outline: none; }
.code-grid input.filled { border-color: var(--text-faint); }
.code-grid.invalid input { border-color: var(--accent); background: var(--accent-soft); }
.code-grid.shake { animation: shake .35s; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.login-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); font-size: 12px; color: var(--text-muted); margin-top: var(--s-4); flex-wrap: wrap; }
.login-error { color: var(--err); font-size: 13px; }
.login-hint { font-size: 12px; color: var(--text-muted); }

/* ---------- 11. Responsive ---------- */
@media (max-width: 1100px) {
  :root { --list-w: 360px; --side-w: 260px; }
  .detail-cols { grid-template-columns: minmax(0, 1fr); }
  .detail-side { border-left: 0; border-top: 1px solid var(--border); }
  .panes { grid-template-columns: minmax(0, 1fr); }
  .panes.has-detail .pane-list { display: none; }
  .panes:not(.has-detail) .pane-detail { display: none; }
  .pane-list { border-right: 0; }
  .page { padding: var(--s-5) var(--s-5) var(--s-7); }
  .resizer { display: none; }
}
@media (max-width: 768px) {
  .app, .app.nav-collapsed { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .nav { position: fixed; inset: 0 auto 0 0; width: min(280px, 86vw); transform: translateX(-100%); transition: transform var(--t-panel); box-shadow: var(--sh-3); z-index: calc(var(--z-overlay) + 2); }
  .app.nav-open .nav { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: var(--scrim); z-index: calc(var(--z-overlay) + 1); }
  .app.nav-collapsed .brand-text, .app.nav-collapsed .nav-item .label, .app.nav-collapsed .nav-item .count,
  .app.nav-collapsed .nav-group-title, .app.nav-collapsed .nav-search .grow, .app.nav-collapsed .nav-user .who { display: revert; }
  .app.nav-collapsed .nav-item { justify-content: flex-start; padding: 0 var(--s-3); }
  .app.nav-collapsed .nav-head .brand { display: flex; }
  .topbar-mobile { display: flex !important; }
  .page { padding: var(--s-4) var(--s-4) var(--s-7); }
  .page-head { margin-bottom: var(--s-4); }
  .form-grid, .keys-grid { grid-template-columns: minmax(0, 1fr); }
  .table td { max-width: 200px; }
  .overlay { padding-top: var(--s-4); }
  .toasts { left: var(--s-4); right: var(--s-4); align-items: stretch; }
  .login-card { padding: var(--s-5); }
  .code-grid { gap: 4px; }
  .code-grid input { font-size: 16px; }
}
.topbar-mobile { display: none; align-items: center; gap: var(--s-3); height: 48px; padding: 0 var(--s-4); border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 10; }

/* ---------- 12. Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .skeleton { animation: none; }
}

@media print { .nav, .toasts, .strip { display: none !important; } body { overflow: visible; } .app { display: block; height: auto; } .main { overflow: visible; } }

/* WP6 — reports, inbound, settings, activity */
.wp6-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: var(--s-4); }
.wp6-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s-4); align-items: start; }
.wp6-pre { white-space: pre-wrap; word-break: break-word; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4); font-size: 13px; max-height: 320px; overflow: auto; }
.wp6-meta { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-2) var(--s-4); font-size: 13px; }
.wp6-meta dt { color: var(--text-muted); }
.wp6-meta dd { margin: 0; word-break: break-word; }
.wp6-row-actions { gap: var(--s-2); justify-content: flex-end; flex-wrap: nowrap; }
.wp6-list { display: flex; flex-direction: column; gap: var(--s-2); }
.wp6-list .row .input { flex: 1; }
.wp6-stat { padding: var(--s-2) 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.wp6-preview h3 { margin-bottom: var(--s-3); }
.wp6-hl { margin-top: var(--s-4); font-size: 13px; }
.wp6-hl ul { margin: var(--s-2) 0 0 var(--s-5); padding: 0; }
.wp6-chips { gap: var(--s-2); margin-top: var(--s-2); }
.wp6-act-list { padding: 0; }
.wp6-act-row { display: flex; gap: var(--s-4); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
.wp6-act-row:last-child { border-bottom: 0; }
.wp6-act-row .lr-main { flex: 1; min-width: 0; }
.wp6-act-row .lr-line1 { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.wp6-act-ticket { color: var(--text); text-decoration: none; }
.wp6-act-ticket:hover { text-decoration: underline; }

/* WP5 — clients, contacts, fleet, time, workload (tokens only) */
.wp5-kv { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr); gap: var(--s-3) var(--s-5); font-size: 13px; margin: 0; }
.wp5-kv dt { color: var(--text-muted); }
.wp5-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.wp5-cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.wp5-sub { font-size: 12px; color: var(--text-muted); }
.wp5-neg { color: var(--err); font-weight: 600; }
.wp5-hours { min-width: 150px; }
.wp5-disk { display: flex; align-items: center; gap: var(--s-3); min-width: 120px; }
.wp5-disk .progress { flex: 1; }
.wp5-actions { display: flex; gap: var(--s-2); justify-content: flex-end; }
.wp5-cols .card .progress { margin-bottom: var(--s-4); }
@media (max-width: 900px) { .wp5-cols { grid-template-columns: minmax(0, 1fr); } .wp5-kv { grid-template-columns: minmax(0, 1fr); gap: var(--s-1) 0; } .wp5-kv dd { margin-bottom: var(--s-3); } }

/* ==========================================================================
   WP4 — Inbox, ticket detail, composer  (light only; tokens reused)
   ========================================================================== */
.ib-head .ib-row, .ib-row { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.ib-head { gap: var(--s-3); }
.ib-h { font-size: 16px; font-weight: 600; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; min-width: 0; flex: 1 1 auto; }
.ib-row.ib-top { align-items: flex-start; }
.ib-row.ib-top .ib-bm { margin-top: 2px; }
.ib-row.ib-top .caption { flex: 0 0 auto; white-space: nowrap; margin-top: 2px; }
.ib-row.ib-tools { flex-wrap: wrap; }
.ib-row.ib-tools .input-wrap { flex: 1 1 72px; min-width: 72px; }
.ib-row.ib-tools > * { flex-shrink: 0; }
.ib-row.ib-tools > .input-wrap { flex-shrink: 1; }
.ib-bm { color: var(--accent); display: inline-flex; }
.ib-head .grow, .td .grow, .composer .grow, .link-row .grow { flex: 1 1 auto; min-width: 0; }
.ib-row select.select { width: auto; max-width: 140px; }
.ib-row .input-wrap { min-width: 0; }
.ib-row .input-wrap > .input { width: 100%; }
.chip .chip-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.chip.active { padding-right: var(--s-2); }
.chip-row .link-btn { font-size: 12px; margin-left: var(--s-2); }
.bulkbar { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-3) var(--s-5); background: var(--accent-soft); border-bottom: 1px solid var(--accent-border); font-size: 13px; }
.list-foot { padding: var(--s-4) var(--s-5); text-align: center; border-top: 1px solid var(--border); }
.list-foot .skeleton-row { border-bottom: 0; }
.popover-panel.filter-pop { width: 260px; }
.fp-list { max-height: 320px; overflow: auto; padding: var(--s-2); display: flex; flex-direction: column; }
.fp-item { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); width: 100%; min-height: 32px; padding: 0 var(--s-3); border: 0; background: none; border-radius: var(--r-sm); text-align: left; font-size: 13px; }
.fp-item:hover { background: var(--bg-muted); }
.fp-pick[aria-pressed="true"] { font-weight: 600; }
.fp-pick[aria-pressed="true"]::after { content: "\2713"; color: var(--text-muted); margin-left: auto; }
.pane-detail > .empty { flex: 1 1 auto; }
.pane-detail > .td { flex: 1 1 auto; min-height: 0; }

/* ticket detail */
.td { display: flex; flex-direction: column; min-width: 0; min-height: 0; flex: 1 1 auto; overflow: hidden; overflow: clip; background: var(--bg); }
.td .detail-cols { flex: 1 1 auto; min-height: 0; overflow: hidden; overflow: clip; }
.td .detail-main { min-height: 0; }
.td-head { padding: var(--s-4) var(--s-6) 0; border-bottom: 1px solid var(--border); flex: none; }
.td-top { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.td-num { font-size: 13px; color: var(--text-muted); flex: none; }
.td-subj { flex: 1 1 auto; min-width: 0; display: flex; }
.td-subject { display: inline-flex; align-items: center; gap: var(--s-3); max-width: 100%; min-width: 0; padding: 2px 6px; margin-left: -6px; background: none; border: 0; border-radius: var(--r-sm); font-size: 18px; font-weight: 600; letter-spacing: -.005em; text-align: left; }
.td-subject:hover { background: var(--bg-muted); }
.td-subject .icon { opacity: 0; color: var(--text-faint); }
.td-subject:hover .icon, .td-subject:focus-visible .icon { opacity: 1; }
.td-subject-input { font-size: 16px; font-weight: 600; height: 32px; width: 100%; }
.td-back { display: none; }
.td-props { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-3) 0 var(--s-4); }
.td-props select.select { width: auto; min-width: 112px; }
.td-status { display: inline-flex; align-items: center; gap: var(--s-3); padding: 2px var(--s-3) 2px var(--s-4); border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--card); }
.td-status-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.td-status select.select { font-weight: 600; border-color: transparent; background-color: transparent; }
.td-status-banner { padding: var(--s-2) var(--s-4); align-items: center; }
.td-status-banner .icon { margin-top: 0; }
.td-sb { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-4); flex-wrap: wrap; }
.td-sb strong { font-weight: 600; color: var(--text); }
.td-sb-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.td-sb-actions .btn .spin { margin-right: var(--s-2); }
.td-assignee { gap: var(--s-3); }
.td-assignee .kbd { margin-left: var(--s-2); }
.td-banners { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-3) var(--s-6) 0; flex: none; }
.td-stream { flex: 1 1 auto; min-height: 0; overflow: auto; padding: var(--s-5) var(--s-6); }
.td-composer { flex: none; border-top: 1px solid var(--border); background: var(--bg); box-shadow: var(--sh-up); }
.td-loading, .td-error { padding: var(--s-5) var(--s-6); }

.msg { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4) var(--s-5); margin: 0 0 var(--s-4); background: var(--card); }
.msg.from-client { background: var(--bg-subtle); }
.msg.note { background: var(--note-bg); border-color: var(--note-border); }
.msg-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); min-width: 0; flex-wrap: wrap; }
.msg-author { font-size: 13px; }
.msg-src { display: inline-flex; align-items: center; gap: var(--s-2); font-size: 11px; color: var(--text-muted); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.msg .chip-row { margin-top: var(--s-3); }
.ev { display: flex; align-items: center; gap: var(--s-3); font-size: 12px; color: var(--text-muted); padding: var(--s-2) var(--s-3); margin: 0 0 var(--s-2); }
.ev .ev-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

.detail-side .sb-sec { padding-bottom: var(--s-5); border-bottom: 1px solid var(--border); }
.detail-side .sb-sec:last-child { border-bottom: 0; padding-bottom: 0; }
.sb-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); min-height: 24px; }
.sb-title h3 { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.sb-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.sb-name a:hover { text-decoration: underline; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-2) var(--s-4); margin: var(--s-3) 0 0; font-size: 12px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv.wide { margin-top: 0; grid-template-columns: 104px minmax(0, 1fr); }
.err-text { color: var(--err); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tasks { display: flex; flex-direction: column; gap: var(--s-1); margin-bottom: var(--s-3); }
.task { display: flex; align-items: center; gap: var(--s-2); padding: 2px var(--s-2); border: 1px solid transparent; border-radius: var(--r-sm); background: var(--card); }
.task:hover { border-color: var(--border); }
.task.done .task-title { text-decoration: line-through; color: var(--text-muted); }
.task-title { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.task-add { display: flex; gap: var(--s-3); }
.task-add .input { flex: 1 1 auto; min-width: 0; }
/* ticket checklists (migration 120) */
.cl-block { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-subtle); padding: var(--s-3); margin-bottom: var(--s-4); }
.cl-block-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-2); }
.cl-block-title { display: inline-flex; align-items: center; gap: var(--s-2); font-size: 12px; font-weight: 600; color: var(--text); }
.cl-block .progress { margin-bottom: var(--s-2); }
.cl-req-left { color: var(--warn); margin-bottom: var(--s-2); }
.cl-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.cl-item { display: flex; align-items: flex-start; gap: var(--s-2); padding: var(--s-2); border: 1px solid transparent; border-radius: var(--r-sm); background: var(--card); }
.cl-item:hover { border-color: var(--border); }
.cl-item.req-open { border-left: 3px solid var(--warn); }
.cl-item .check { margin-top: 1px; }
.cl-main { flex: 1 1 auto; min-width: 0; }
.cl-line { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); }
.cl-help, .cl-by { font-size: 11px; color: var(--text-muted); margin-top: 2px; overflow-wrap: anywhere; }
.cl-note { font-size: 11px; color: var(--text-muted); font-style: italic; margin-top: 2px; overflow-wrap: anywhere; }
.cl-item.done .task-title, .cl-item.na .task-title { text-decoration: line-through; color: var(--text-muted); }
.cl-item.na { opacity: .8; }
.cl-acts { display: flex; align-items: center; gap: var(--s-1); flex: none; }
.cl-other-head { margin: var(--s-2) 0 var(--s-2); }
.cl-warn-list { margin: 0; padding-left: var(--s-6); font-size: 13px; color: var(--text); }
.cl-warn-list li { margin: 2px 0; overflow-wrap: anywhere; }
/* checklist template editor (client page + Settings) */
.cl-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.cl-card h3 { display: flex; align-items: center; gap: var(--s-2); }
.cl-status { margin-bottom: var(--s-4); }
.cl-read { margin: 0; padding-left: var(--s-6); font-size: 13px; display: flex; flex-direction: column; gap: var(--s-3); }
.cl-rows { list-style: none; margin: 0 0 var(--s-3); padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.cl-row { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-subtle); }
.cl-num { flex: none; width: 20px; text-align: right; font-size: 12px; font-weight: 600; color: var(--text-muted); padding-top: 6px; }
.cl-fields { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.cl-fields .input { width: 100%; }
.cl-fields .input.invalid { border-color: var(--accent); background: var(--accent-soft); }
.cl-row-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-2); }
.cl-row-btns { display: flex; gap: var(--s-1); }
.cl-add { margin-bottom: var(--s-4); }
.cl-foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-3); }
@media (max-width: 1100px) { .cl-cards { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .cl-row { flex-wrap: wrap; } .cl-row-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; } }
.links, .watchers, .time-list, .inbound-list { display: flex; flex-direction: column; gap: var(--s-2); }
.link-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) 0; }
.time-row { padding: var(--s-3) 0; border-bottom: 1px solid var(--border); }
.time-row:last-child { border-bottom: 0; }
.inbound-list li { padding: var(--s-2) 0; border-bottom: 1px solid var(--border); font-size: 13px; min-width: 0; }
.inbound-list li:last-child { border-bottom: 0; }
.stars { display: flex; gap: 2px; color: var(--border-strong); }
.stars .icon.on { color: var(--star-on); fill: currentColor; }
.csat-comment { margin-top: var(--s-3); padding: var(--s-3); border-left: 3px solid var(--border-strong); background: var(--card); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: recpulse 1.6s infinite; }
.td-dialog-pad { min-height: 190px; }

/* composer */
.composer { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4) var(--s-6) var(--s-4); position: relative; }
.composer.dragging { outline: 2px dashed var(--focus); outline-offset: -4px; }
.composer.locked { opacity: .75; }
.cmp-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.cmp-tabs { display: flex; gap: var(--s-2); }
.cmp-tab { display: inline-flex; align-items: center; gap: var(--s-3); height: 28px; padding: 0 var(--s-4); border: 0; background: none; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; color: var(--text-muted); }
.cmp-tab:hover:not(:disabled) { color: var(--text); background: var(--hover); }
.cmp-tab[aria-selected="true"] { background: var(--bg-muted); color: var(--text); }
.composer.note-mode .cmp-tab[aria-selected="true"] { background: var(--note-bg); color: var(--note-fg); box-shadow: inset 0 0 0 1px var(--note-border); }
.composer.note-mode textarea.cmp-text { background: var(--note-bg); border-color: var(--note-border); }
textarea.cmp-text { min-height: 84px; max-height: 240px; }
.cmp-macro { display: flex; align-items: center; gap: var(--s-3); font-size: 12px; color: var(--text-muted); background: var(--bg-muted); border-radius: var(--r-sm); padding: 2px var(--s-2) 2px var(--s-3); }
.cmp-files { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.file-chip.pending { height: 26px; }
.file-chip.pending .x { background: none; border: 0; padding: 0; display: inline-grid; place-items: center; color: var(--text-faint); cursor: pointer; }
.file-chip.pending .x:hover { color: var(--text); }
.cmp-opts { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.cmp-log { display: flex; align-items: center; gap: var(--s-3); }
.cmp-min { width: 76px; }
.cmp-log select.select { width: auto; }
.cmp-after { display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--border); }
.cmp-after-row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.cmp-after-label { font-size: 13px; font-weight: 600; color: var(--text); }
.cmp-after-preview { font-size: 12px; color: var(--text-muted); }
.cmp-foot { display: flex; align-items: center; gap: var(--s-4); }
.cmp-notify { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cmp-reason { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--text-muted); text-align: right; }
.cmp-reason[data-tone="err"] { color: var(--err); }
.cmp-reason[data-tone="warn"] { color: var(--warn); }
.composer .btn .kbd { margin-left: var(--s-2); background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); color: var(--on-accent); }
.composer.sending { opacity: .85; }

@media (max-width: 1100px) {
  .td { overflow: auto; }
  .td .detail-cols { overflow: visible; display: flex; flex-direction: column; flex: none; }
  .td-stream { overflow: visible; flex: none; }
  .td-composer { position: sticky; bottom: 0; z-index: 3; }
  .td-back { display: inline-grid; }
  .td-head, .td-stream, .composer { padding-left: var(--s-5); padding-right: var(--s-5); }
  .td-banners { padding-left: var(--s-5); padding-right: var(--s-5); }
}
@media (max-width: 768px) {
  .cmp-foot { flex-wrap: wrap; }
  .cmp-reason { text-align: left; order: 3; flex-basis: 100%; }
}
/* WP6 — toolbar selects */
.toolbar > .select, .toolbar .select.sm, .toolbar .daterange .select { width: auto; min-width: 150px; max-width: 260px; }
.page.narrow .toolbar > .select { max-width: 320px; }

/* security */
.sec-summary { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-bottom: var(--s-5); }
.sec-stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-3) var(--s-5); min-width: 112px; box-shadow: var(--sh-1); }
.sec-stat .big { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sec-stat .big.err { color: var(--err); }
.sec-stat .cap { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.sec-card { padding: 0; overflow: hidden; }
.sec-card .table-wrap { border: 0; }
.sec-when { display: flex; flex-direction: column; line-height: 1.3; white-space: nowrap; }
.sec-when .muted { font-size: 11px; }
.sec-who { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.sec-email { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-ip { background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; font-size: 12px; text-decoration: underline dotted; text-underline-offset: 3px; }
.sec-ip:hover { color: var(--accent, var(--text)); }
.sec-device { white-space: nowrap; cursor: default; }
.sec-fields { display: flex; flex-direction: column; gap: var(--s-4); margin: 0; }
.sec-field dt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 2px; }
.sec-field dd { margin: 0; word-break: break-word; }
.sec-ua { font-size: 11px; display: block; margin-top: 2px; }
.sec-detail { margin: 0; padding: var(--s-3); background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-sm); font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.chip-row + .chip-row, .chip-row + .sec-summary, .toolbar + .chip-row { margin-top: 0; }
.chip-row { margin-bottom: var(--s-4); }
.chip-row:empty { display: none; }
/* settings help (?) */
.help-wrap { display: flex; align-items: flex-start; gap: var(--s-3); margin-bottom: var(--s-4); }
.info-btn { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-muted); cursor: pointer; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--text); background: var(--bg-muted); }
.info-btn[data-tip]:hover::after, .info-btn[data-tip]:focus-visible::after { white-space: normal; width: 300px; max-width: 80vw; left: 0; transform: none; }
.help-inline { margin: 0; padding: var(--s-3) var(--s-4); background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 13px; color: var(--text-muted); line-height: 1.5; max-width: 760px; }
.help-inline[hidden] { display: none; }

/* (?) help component — ui.Help(text) */
.help { display: inline-flex; vertical-align: middle; margin-left: 6px; position: relative; font-weight: 400; text-transform: none; letter-spacing: 0; }
.help .help-btn { display: inline-grid; place-items: center; width: 16px; height: 16px; min-width: 16px; padding: 0; margin: 0; border: 1px solid var(--border-strong, var(--border)); border-radius: 50%; background: var(--card); color: var(--text-muted); font: 600 10px/1 var(--font, inherit); cursor: help; transition: background var(--t-fast), color var(--t-fast); }
.help .help-btn:hover, .help .help-btn[aria-expanded="true"] { background: var(--bg-muted); color: var(--text); }
.help .help-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.help .help-tip { position: fixed; z-index: 95; width: max-content; max-width: min(300px, calc(100vw - 16px)); background: var(--tip-bg); color: var(--tip-fg); border: 1px solid var(--tip-border); font-size: 12px; font-weight: 500; line-height: 1.4; text-align: left; white-space: pre-line; padding: 8px 10px; border-radius: var(--r-sm); box-shadow: var(--sh-2); pointer-events: none; }
.help .help-tip[hidden] { display: none; }
.with-help { display: inline-flex; align-items: center; gap: 0; }
.help-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-5); font-size: 12px; color: var(--text-muted); margin: 0 0 var(--s-4); }
.help-legend .with-help { gap: 0; }
.sla[data-tip]:hover::after, .sla[data-tip]:focus-visible::after { white-space: pre-line; width: max-content; max-width: 260px; }
.info-banner { margin-bottom: var(--s-4); }
.ib-date { display: inline-flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.ib-date .input { width: 140px; }
.nav-row { display: flex; align-items: center; }
.nav-row .nav-item { flex: 1; min-width: 0; width: auto; }
.nav-row .help { margin: 0 2px 0 4px; flex: none; }
.app.nav-collapsed .nav-row .help { display: none; }
@media (max-width: 768px) { .app.nav-collapsed .nav-row .help { display: inline-flex; } }

.ib-row[hidden], .ib-date[hidden] { display: none; }

/* drag-and-drop reordering — ui.DragHandle + ui.Sortable */
.drag-handle { flex: none; display: inline-grid; place-items: center; width: 20px; height: 24px; border-radius: var(--r-sm); color: var(--text-faint); cursor: grab; user-select: none; -webkit-user-select: none; transition: background var(--t-fast), color var(--t-fast); }
.drag-handle:hover { color: var(--text); background: var(--bg-muted); }
.drag-handle:active, .sortable.sorting, .sortable.sorting * { cursor: grabbing; }
.drag-handle:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; color: var(--text); }
.sortable > * { position: relative; }
.sortable > .dragging { opacity: .4; }
.sortable > .drop-before::before, .sortable > .drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: var(--focus); box-shadow: 0 0 0 1px var(--focus-ring); pointer-events: none; z-index: 2; }
.sortable > .drop-before::before { top: -3px; }
.sortable > .drop-after::after { bottom: -3px; }
.cl-rows.sortable > .drop-before::before { top: -6px; }
.cl-rows.sortable > .drop-after::after { bottom: -6px; }
.cl-row > .drag-handle { margin-top: 4px; height: 24px; }
.cl-item > .drag-handle { height: 20px; }
.task > .drag-handle { height: 22px; }

/* radio buttons share the .check look */
.check input[type="radio"] { border-radius: 50%; }
.check input[type="radio"]:checked::after { width: 6px; height: 6px; border: 0; border-radius: 50%; background: var(--on-accent); transform: none; }

/* client › Policies & software (migration 122) */
.cfg-chips { display: inline-flex; flex-wrap: wrap; gap: var(--s-2); }
.cfg-chips .chip { cursor: pointer; }
.cfg-devs { margin-bottom: 0; gap: 4px; }
.cfg-devs a.chip:hover { background: var(--hover); text-decoration: none; }
.cfg-name { min-width: 180px; max-width: 420px; }
.cfg-title { font-weight: 500; overflow-wrap: anywhere; }
.cfg-secret { display: flex; align-items: center; gap: 4px; }
.cfg-secret .icon { flex: none; }
.cfg-err { font-size: 12px; color: var(--err); }
.cfg-err[hidden] { display: none; }
.cfg-pick { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-2); padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-subtle); }
.cfg-pick[hidden] { display: none; }
.cfg-pick .input { max-width: 260px; }
.cfg-pick-list { max-height: 280px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.cfg-pick-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: var(--s-4); padding: var(--s-2) 0; background: var(--bg-subtle); font-size: 12px; }
.cfg-pick-title { font-weight: 600; color: var(--text-muted); }
.cfg-pick-row { display: flex; align-items: center; gap: var(--s-3); padding: 4px var(--s-2); border-radius: var(--r-sm); min-width: 0; }
.cfg-pick-row:hover { background: var(--hover); }
.cfg-pick-host { flex: none; font-size: 12px; }
.cfg-pick-none { padding: var(--s-2); }
.cfg-dev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.cfg-dev-list li { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3); font-size: 13px; min-width: 0; }
.cfg-dev-list li a { overflow-wrap: anywhere; }

/* ---- usage billing (usage.js, 123) ---- */
.pill.violet { --pill-bg: var(--bg-muted); --pill-c: var(--ch-violet); }
.us-rules h3 { display: flex; align-items: center; gap: var(--s-2); }
.us-rules-list { margin: 0; padding-left: var(--s-6); font-size: 13px; color: var(--text); display: flex; flex-direction: column; gap: var(--s-2); }
.us-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s-4); }
.us-total { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--border); }
.us-total .big { font-size: 22px; font-weight: 600; }
.us-status { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-1); }
.us-ids { font-size: 10px; overflow-wrap: anywhere; max-width: 260px; }
.us-desc { max-width: 280px; }
.us-approve td { font-size: 13px; }

/* ---------- multi-asset picker (ticket.js AssetMultiPicker) + ticket "Assets" section ---------- */
.amp { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.amp-head { display: flex; align-items: center; gap: var(--s-2); }
.amp-count { color: var(--text-muted); font-size: 12px; }
.amp-label { gap: var(--s-2); align-items: center; }
.amp-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.amp-chip { display: flex; align-items: center; gap: var(--s-2); min-width: 0; padding: 3px var(--s-2) 3px var(--s-1); background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-md); font-size: 13px; }
.amp-chip.primary { border-color: var(--border-strong); background: var(--card); }
.amp-chip.gone .amp-chip-name { color: var(--text-muted); }
.amp-chip .pill { flex: none; }
.amp-pos { flex: none; min-width: 20px; text-align: center; font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.amp-chip-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.amp-chip-note { flex: none; font-size: 11px; color: var(--text-muted); }
.amp-chip-acts { flex: none; display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.amp-err:empty { display: none; }
.amp-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--input-bg); padding: var(--s-1) 0; }
.amp-group { position: sticky; top: calc(-1 * var(--s-1)); z-index: 1; padding: var(--s-2) var(--s-3) var(--s-1); font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted); background: var(--input-bg); }
.amp-row { display: flex; align-items: flex-start; gap: var(--s-3); padding: 6px var(--s-3); cursor: pointer; font-size: 13px; }
.amp-row:hover { background: var(--hover); }
.amp-row.on { background: var(--bg-muted); }
.amp-row.off { cursor: not-allowed; opacity: .6; }
.amp-row input { margin-top: 2px; flex: none; }
.amp-row-main { display: flex; flex-direction: column; min-width: 0; }
.amp-row-name { font-weight: 500; overflow-wrap: anywhere; }
.amp-row-sub { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.amp-empty { padding: var(--s-3); }
.amp-other { display: flex; gap: var(--s-2); align-items: center; }
.amp-other .input { flex: 1 1 auto; }
.amp-view { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.amp-view-name { display: flex; align-items: center; gap: var(--s-2); font-size: 14px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.amp-view-name a:hover { text-decoration: underline; }
.amp-view-item.gone .amp-view-name { font-weight: 500; }
.amp-primary-kv { margin-top: var(--s-3); }
@media (max-width: 560px) { .amp-chip-note { display: none; } }

/* ---------- software tracking (software.js, 128): NEW = blue accent, update available = amber accent ---------- */
.sw-filters { margin-top: var(--s-5); }
.sw-filters .input[type="search"] { width: 220px; }
.sw-count { font-size: 12px; margin: var(--s-3) 0 var(--s-2); display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.sw-count .link-btn { font-size: 12px; }
.sw-chiprow { display: flex; align-items: flex-start; gap: var(--s-3); margin-top: var(--s-3); }
.sw-chiplbl { flex: none; width: 64px; padding-top: 4px; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.sw .chip.sw-chip-zero { color: var(--text-faint); }
.sw-bid { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: baseline; }
.sw-cat-lbl { font-size: 10px; font-weight: 600; color: var(--text-muted); background: var(--bg-muted); border-radius: var(--r-sm); padding: 0 6px; white-space: nowrap; }
.sw-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.sw-acts { display: flex; gap: 2px; justify-content: flex-end; flex-wrap: nowrap; }
@media (max-width: 768px) { .sw-chiprow { flex-direction: column; gap: var(--s-2); } .sw-chiplbl { width: auto; padding-top: 0; } }
.sw .chip .count, .corr .chip .count { margin-left: 4px; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sw .chip.sw-chip-new .count { color: var(--st-open); font-weight: 600; }
.sw .chip.sw-chip-upd .count { color: var(--warn); font-weight: 600; }
.sw-table td { white-space: normal; height: auto; padding-top: 6px; padding-bottom: 6px; vertical-align: top; max-width: 320px; }
.sw-table td.sw-act-col { width: 1%; white-space: nowrap; }
.sw-table tbody tr.sw-new, .sw-devs tr.sw-new { background: var(--st-open-bg); }
.sw-table tbody tr.sw-new > td:first-child, .sw-devs tr.sw-new > td:first-child { box-shadow: inset 3px 0 0 var(--st-open); }
.sw-table tbody tr.sw-upd:not(.sw-new) > td:first-child, .sw-devs tr.sw-upd:not(.sw-new) > td:first-child { box-shadow: inset 3px 0 0 var(--warn-fill); }
.sw-table tbody tr.sw-new.sw-upd > td:first-child { box-shadow: inset 3px 0 0 var(--st-open), inset 6px 0 0 var(--warn-fill); }
.sw-table tbody tr.sw-new:hover { background: var(--st-open-bg); filter: brightness(.98); }
.sw-name { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.sw-title { font-weight: 500; overflow-wrap: anywhere; }
.sw-bid { font-size: 11px; overflow-wrap: anywhere; }
.pill.sw-new-pill { --pill-bg: var(--st-open); --pill-c: var(--on-accent); height: 18px; padding: 0 6px; font-size: 10px; letter-spacing: .04em; }
.pill.sw-new-pill::before { display: none; }
html[data-theme="dark"] .pill.sw-new-pill { --pill-c: var(--bg); }
.pill.sw-sys { opacity: .75; }
.sw-latest { display: inline-flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.sw-src { font-size: 10px; font-weight: 600; color: var(--text-muted); background: var(--bg-muted); border-radius: var(--r-sm); padding: 1px 6px; white-space: nowrap; }
.sw-when { line-height: 1.35; }
.sw-when .muted { font-size: 11px; }
.sw-stale-txt { color: var(--text-faint); }
.sw-warn-txt { color: var(--warn); }
.sw-exp { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.sw-exp[aria-expanded="true"] .icon { transform: rotate(180deg); }
.sw-table tr.sw-sub > td { background: var(--bg-subtle); padding: var(--s-3) var(--s-4) var(--s-4) var(--s-7); max-width: none; }
.sw-devs { width: 100%; border-collapse: collapse; font-size: 12px; }
.sw-devs th { text-align: left; font-weight: 600; color: var(--text-muted); padding: 4px var(--s-3); border-bottom: 1px solid var(--border); }
.sw-devs td { padding: 6px var(--s-3); border-bottom: 1px solid var(--border); vertical-align: top; }
.sw-devs td .pill.sw-new-pill { margin-left: var(--s-2); }
.sw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-4); }
.sw-card { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.sw-card.stale { border-color: var(--note-border); }
.sw-card-host { font-weight: 600; font-size: 14px; }
.sw-card-stats { display: flex; gap: var(--s-4); font-size: 12px; color: var(--text-muted); }
.sw-card-stats b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.sw-card-stats .sw-c-new b, .num.sw-c-new { color: var(--st-open); }
.sw-card-stats .sw-c-upd b, .num.sw-c-upd { color: var(--warn); }
.sw-card-rep { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }
.sw-card-rep.sw-warn-txt { color: var(--warn); }
.sw-cat { margin-top: var(--s-3); }
.sw-h3 { display: flex; align-items: center; gap: var(--s-2); font-size: 14px; font-weight: 600; margin: var(--s-6) 0 var(--s-3); }
.sw-badge { font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--bg-muted); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.sw-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card); }
.sw-events li { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--border); font-size: 13px; }
.sw-events li:last-child { border-bottom: 0; }
.sw-ev-ic { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-muted); color: var(--text-muted); margin-top: 1px; }
.sw-ev-new .sw-ev-ic { background: var(--st-open-bg); color: var(--st-open); }
.sw-ev-upd .sw-ev-ic { background: var(--warn-bg); color: var(--warn); }
.sw-ev-rm .sw-ev-ic { background: var(--err-bg); color: var(--err); }
.sw-ev-main { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.sw-events time { flex: none; white-space: nowrap; }
.sw-changes { margin-top: var(--s-2); }
.sw-ov-sec { margin-top: var(--s-4); }

/* ---------- correspondence (correspondence.js, 129) ---------- */
.corr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-4); }
.corr-card { padding: var(--s-4); }
.corr-card h3 { display: flex; align-items: center; gap: 4px; font-size: 12px; margin-bottom: var(--s-2); }
.corr-card .big { font-size: 20px; }
.corr-card.bad { border-color: var(--err-border); }
.corr-card.bad .big, .corr-card.bad .cap { color: var(--err); }
.corr-filters { margin-top: var(--s-2); }
.corr-filters .input[type="search"] { width: 200px; }
.corr-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card); }
.corr-item { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
.corr-item:last-child { border-bottom: 0; }
.corr-item.bad { box-shadow: inset 3px 0 0 var(--err); }
.corr-item.internal { background: var(--note-bg); }
.corr-ic { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-muted); color: var(--text-muted); }
.corr-item.ch-email_out .corr-ic, .corr-item.ch-staff_reply .corr-ic { background: var(--st-open-bg); color: var(--st-open); }
.corr-item.ch-client_reply .corr-ic, .corr-item.ch-email_in .corr-ic { background: var(--ok-bg); color: var(--ok); }
.corr-item.ch-internal_note .corr-ic { background: var(--note-border); color: var(--note-fg); }
.corr-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.corr-top { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; font-size: 13px; }
.corr-who { color: var(--text-muted); overflow-wrap: anywhere; }
.corr-time { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.corr-subj { font-weight: 500; font-size: 13px; overflow-wrap: anywhere; }
.corr-preview { font-size: 13px; color: var(--text-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.corr-more { align-self: flex-start; font-size: 12px; }
.corr-proof { font-size: 12px; font-weight: 500; margin-top: 2px; }
.corr-proof .cp.ok { color: var(--ok); }
.corr-proof .cp.err { color: var(--err); font-weight: 600; }
.corr-proof .cp.warn { color: var(--warn); }
.corr-proof .cp.muted { color: var(--text-muted); font-weight: 400; }
.pill.dlv { font-weight: 500; }
.corr-print { display: none; }
@media print {
  body.corr-printing > *:not(.corr-print) { display: none !important; }
  body.corr-printing .corr-print { display: block; color: #000; background: #fff; font: 11px/1.4 var(--font); }
  .corr-print h1 { font-size: 16px; margin: 0 0 6px; }
  .corr-print .cpr-meta { margin: 0 0 4px; color: #333; }
  .cpr-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
  .cpr-table th, .cpr-table td { border: 1px solid #999; padding: 4px 6px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
  .cpr-table th { background: #eee; }
  .cpr-table tr { break-inside: avoid; }
  .cpr-subj { font-weight: 600; }
}

/* ---------- 131: approvals, escalation pills, scheduled tickets ---------- */
.pill.pill-xs { height: 18px; padding: 0 6px; font-size: 10px; }
.pill.pill-xs::before { width: 5px; height: 5px; }
.td-props .pill[data-tip] { cursor: default; }
.appr-item { display: flex; flex-direction: column; gap: 4px; padding: var(--s-3) 0; border-top: 1px solid var(--border); }
.appr-item:first-child { border-top: 0; padding-top: 0; }
.appr-pending { background: var(--warn-bg); border: 1px solid var(--note-border); border-radius: var(--r-md); padding: var(--s-3); }
.appr-pending + .appr-item { border-top: 0; }
.appr-note { font-size: 12px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg-subtle); border-radius: var(--r-sm); padding: 4px var(--s-3); }
.appr-pending .appr-note { background: var(--card); }
.appr-approvers { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.appr-approvers li { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); font-size: 12px; min-width: 0; }
.appr-approvers li .truncate { min-width: 0; }
.appr-acts { margin-top: 4px; gap: var(--s-2); }
.rc-group { margin-bottom: var(--s-5); }
.rc-group .sw-h3 a { color: inherit; }
.rc-runs { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.rc-run { display: inline-flex; align-items: center; gap: var(--s-2); white-space: nowrap; }
.rc-items { list-style: none; margin: 0 0 var(--s-2); padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.rc-item { position: relative; display: flex; align-items: center; gap: var(--s-2); }
.rc-item .input { flex: 1 1 auto; min-width: 0; }
.rc-item .check { flex: none; white-space: nowrap; font-size: 12px; }
.rc-items .rc-item.dragging { opacity: .5; }
