/* Palette carried over from the n8n-infra queue dashboard so the two read as
   one system; platform colours keep the same two-letter keys. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/Inter.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url(/fonts/JetBrainsMono.woff2) format("woff2"); }

:root {
  --bg: #f3f4f6; --surface: #fff; --surface-2: #eef0f3; --surface-3: #e4e7ec; --border: #e0e3e8; --border-strong: #cdd2da;
  --text: #0f1114; --muted: #5f6873; --faint: #99a1ab;
  --ig: #c13584; --yt: #e00000; --tt: #0d9488;
  --li: #0a66c2; --x: #14171a; --fb: #1877f2; --rd: #ff4500;
  --pi: #e60023; --th: #14171a; --bs: #1185fe;
  --due: #c26a05; --due-bg: #fff7e6; --ok: #15803d; --ok-bg: #ecfdf3;
  --bad: #dc2626; --bad-bg: #fef1f1; --accent: #2563eb; --accent-bg: #edf3ff; --accent-ink: #fff;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 6px 18px rgba(16,24,40,.08);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.18);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  --radius: 12px; --radius-sm: 8px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f12; --surface: #15181c; --surface-2: #1c2026; --surface-3: #252a31; --border: #262b33; --border-strong: #353b45;
    --text: #e8eaed; --muted: #9097a1; --faint: #5b626d;
    --ig: #f77ab5; --yt: #ff6b6b; --tt: #2dd4bf;
    --li: #5fa8ff; --x: #e7e9ea; --fb: #5b9bff; --rd: #ff6b3d;
    --pi: #ff5c78; --th: #e7e9ea; --bs: #4fb2ff;
    --due: #fbbf24; --due-bg: #2a1f08; --ok: #4ade80; --ok-bg: #0b2416;
    --bad: #f87171; --bad-bg: #2c1111; --accent: #60a5fa; --accent-bg: #0f2140; --accent-ink: #0b1220;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 2px 8px rgba(0,0,0,.45), 0 16px 40px rgba(0,0,0,.45);
    --shadow-lg: 0 20px 60px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f12; --surface: #15181c; --surface-2: #1c2026; --surface-3: #252a31; --border: #262b33; --border-strong: #353b45;
  --text: #e8eaed; --muted: #9097a1; --faint: #5b626d;
  --ig: #f77ab5; --yt: #ff6b6b; --tt: #2dd4bf;
  --li: #5fa8ff; --x: #e7e9ea; --fb: #5b9bff; --rd: #ff6b3d;
  --pi: #ff5c78; --th: #e7e9ea; --bs: #4fb2ff;
  --due: #fbbf24; --due-bg: #2a1f08; --ok: #4ade80; --ok-bg: #0b2416;
  --bad: #f87171; --bad-bg: #2c1111; --accent: #60a5fa; --accent-bg: #0f2140; --accent-ink: #0b1220;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 2px 8px rgba(0,0,0,.45), 0 16px 40px rgba(0,0,0,.45);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
svg { display: block; flex-shrink: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.025em; margin: 0; line-height: 1.25; }
h2 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 0 0 10px; font-weight: 650; }
h3 { font-size: 14.5px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: -.01em; }
.err { color: var(--bad); white-space: pre-line; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px 14px;
}
.brand { display: flex; gap: 11px; align-items: center; color: var(--text); padding: 2px 8px 20px; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: var(--shadow); }
.brand span { display: grid; line-height: 1.2; }
.brand b { font-size: 15px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 11.5px; }
nav { display: grid; gap: 1px; }
nav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 550; font-size: 13.5px; transition: background .12s, color .12s;
}
nav a i { display: grid; place-items: center; width: 18px; height: 18px; }
nav a i svg { width: 17px; height: 17px; }
nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
nav a.active { background: var(--accent-bg); color: var(--accent); }
nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
nav a.nav-cta { margin: 8px 0 6px; background: var(--text); color: var(--bg); justify-content: flex-start; box-shadow: var(--shadow-sm); }
nav a.nav-cta::before { display: none; }
nav a.nav-cta:hover, nav a.nav-cta.active { background: var(--text); color: var(--bg); opacity: .9; }
.nav-sep { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 16px 10px 5px; }
.side-foot { margin-top: auto; padding-top: 14px; display: grid; gap: 8px; }
.side-actions { display: flex; gap: 4px; align-items: center; }
.worker-pill {
  display: flex; gap: 9px; align-items: flex-start; font-size: 12px; padding: 10px 11px; color: var(--muted);
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); line-height: 1.35; transition: border-color .12s;
}
.worker-pill:hover { text-decoration: none; border-color: var(--border-strong); }
.worker-pill b { color: var(--text); display: block; font-size: 12.5px; font-weight: 650; }
.worker-pill small { font-size: 11.5px; }
.worker-pill small b { display: inline; font-size: 11.5px; font-weight: 600; }
.worker-pill.stale, .worker-pill.never { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex-shrink: 0; margin-top: 4px; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); animation: pulse 2.4s ease-in-out infinite; }
.dot.stale, .dot.never { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 8%, transparent); } }

/* Workspace switcher and the signed-in person, in the sidebar. */
.ws-switch { position: relative; display: grid; gap: 4px; margin: 0 0 12px; }
.ws-switch > i { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.ws-switch > i svg { width: 16px; height: 16px; }
.ws-switch select { padding-left: 33px; font-weight: 600; background-color: var(--surface-2); }
.ws-switch select:disabled { cursor: default; opacity: 1; background-image: none; }
.ws-switch small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11.5px; padding-left: 10px; }
.ws-switch small svg { width: 12px; height: 12px; }
.me-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px 6px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.me-btn:hover { background: var(--surface-2); }
.me-t { display: grid; min-width: 0; line-height: 1.25; }
.me-t b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-t small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-av { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-bg); color: var(--accent); font-weight: 700; font-size: 12px; }

/* Role gating: the server refuses these anyway; hiding them saves the click. */
:root:not([data-platform-admin]) [data-need="platform"],
:root[data-role="viewer"] [data-need="content"], :root[data-role="viewer"] [data-need="admin"],
:root[data-role="content"] [data-need="admin"],
:root:not([data-linked]) [data-linked-only],
:root[data-role="viewer"] .qcard-check, :root[data-role="viewer"] #list .check { display: none !important; }

.main-wrap { min-width: 0; }
#banner .banner { margin: 16px 32px 0; }
.main { padding: 28px 32px 90px; min-width: 0; outline: none; max-width: 1360px; animation: fade-in .18s ease-out; }
@keyframes fade-in { from { opacity: .55; transform: translateY(3px); } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 13.5px; }
.page-head p .pf { vertical-align: -5px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumb svg { width: 14px; height: 14px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { position: sticky; z-index: 5; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0; }
  .brand img { width: 30px; height: 30px; }
  .brand span, .nav-sep, .side-foot { display: none; }
  .ws-switch { margin: 0; flex-shrink: 0; }
  .ws-switch small { display: none; }
  .ws-switch select { width: 150px; padding-top: 5px; padding-bottom: 5px; }
  .ws-switch > i { top: 7px; }
  nav { display: flex; gap: 2px; }
  nav a { white-space: nowrap; padding: 6px 9px; }
  nav a span { display: none; }
  nav a.active::before { display: none; }
  nav a.nav-cta { margin: 0; }
  #banner .banner { margin: 12px 16px 0; }
  .main { padding: 18px 16px 70px; }
}

/* -------------------------------------------------------------- controls */
.btn {
  font: inherit; font-size: 13px; font-weight: 550; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 12px; cursor: pointer; line-height: 1.45;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, color .12s, transform .08s, box-shadow .12s;
}
.btn svg, .btn i svg { width: 15px; height: 15px; }
.btn i { display: contents; }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, var(--text)); border-color: transparent; }
.btn.dark { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.dark:hover:not(:disabled) { background: var(--text); opacity: .88; }
.btn.danger { color: var(--bad); }
.btn.danger:hover:not(:disabled) { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); border-color: transparent; color: var(--text); }
.btn.sm { font-size: 12px; padding: 4px 9px; gap: 5px; }
.btn.sm svg { width: 13px; height: 13px; }
.btn.icon { width: 32px; height: 32px; padding: 0; justify-content: center; }
.btn.icon.sm { width: 28px; height: 28px; }
.btn.round { border-radius: 999px; }
.btn.block { width: 100%; justify-content: center; padding: 9px; }

input, select, textarea {
  font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 10px; width: 100%; min-width: 0; transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: none; box-shadow: var(--ring); }
input[readonly], textarea[readonly] { background: var(--surface-2); color: var(--muted); }
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
textarea.mono { font-family: var(--mono); font-size: 12px; }
select { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2399a1ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 14px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; cursor: pointer; flex-shrink: 0; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
.field { display: grid; gap: 6px; font-size: 13px; align-content: start; }
.field > span { font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field > span small { font-weight: 450; }
.field small { color: var(--muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check-row { display: flex; gap: 9px; align-items: center; font-size: 13px; cursor: pointer; }

.search { position: relative; flex: 1; min-width: 180px; max-width: 320px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.search input { padding-left: 32px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 12.5px; font-weight: 550; border: 0; border-radius: 6px; background: transparent; color: var(--muted);
  padding: 4px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .12s, color .12s; }
.seg button svg { width: 14px; height: 14px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.pill {
  font: inherit; font-size: 12.5px; font-weight: 550; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .12s;
}
.pill:hover { border-color: var(--border-strong); color: var(--text); }
.pill b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.pill svg { width: 13px; height: 13px; }
.pill.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.pill.on b { color: var(--bg); }
.pill.icon { width: 32px; height: 32px; padding: 0; justify-content: center; }
.pill.icon svg { width: 14px; height: 14px; }
.pill.icon.p-yt { color: var(--yt); } .pill.icon.p-ig { color: var(--ig); } .pill.icon.p-tt { color: var(--tt); }
.pill.icon.p-fb { color: var(--fb); } .pill.icon.p-li { color: var(--li); } .pill.icon.p-x, .pill.icon.p-th { color: var(--x); }
.pill.icon.p-bs { color: var(--bs); } .pill.icon.p-pi { color: var(--pi); }
.pill.icon.on { background: color-mix(in srgb, currentColor 14%, var(--surface)); border-color: currentColor; box-shadow: 0 0 0 1px currentColor; }
.pill-group { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.pill-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-width: 0; box-shadow: var(--shadow-sm); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.card-title h2 { margin: 0; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.kpi {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  color: var(--text); display: block; box-shadow: var(--shadow-sm); transition: border-color .14s, box-shadow .14s, transform .14s;
}
a.kpi:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi small { color: var(--muted); font-size: 12px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi small svg { width: 14px; height: 14px; color: var(--faint); }
.kpi b { font-size: 28px; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; display: block; margin-top: 4px; line-height: 1.15; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.bad b { color: var(--bad); } .kpi.bad { border-color: color-mix(in srgb, var(--bad) 30%, var(--border)); }
.kpi.due b { color: var(--due); }
.kpi.ok b { color: var(--ok); }

/* ----------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; line-height: 1;
  padding: 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge > i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
a.badge:hover { text-decoration: none; filter: brightness(.96); }
.badge svg { width: 12px; height: 12px; }
.badge.accent { background: var(--accent-bg); color: var(--accent); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.due { background: var(--due-bg); color: var(--due); }
.badge.s-publishing > i { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* Platform avatar: brand mark on its own 15% tint, as in n8n-infra. */
.pf {
  --c: var(--muted);
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c);
}
.pf svg { width: 11px; height: 11px; }
.pf.lg { width: 32px; height: 32px; } .pf.lg svg { width: 16px; height: 16px; }
.pf.xl { width: 40px; height: 40px; } .pf.xl svg { width: 19px; height: 19px; }
.pf.sm { width: 18px; height: 18px; } .pf.sm svg { width: 9px; height: 9px; }
.pf-yt { --c: var(--yt); } .pf-ig { --c: var(--ig); } .pf-tt { --c: var(--tt); } .pf-fb { --c: var(--fb); }
.pf-li { --c: var(--li); } .pf-x { --c: var(--x); } .pf-th { --c: var(--th); } .pf-bs { --c: var(--bs); } .pf-pi { --c: var(--pi); }
.pf-count { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }
.kind { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); color: var(--muted); flex-shrink: 0; }
.kind svg { width: 13px; height: 13px; }
.kind-label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.kind-label svg { width: 13px; height: 13px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11px; font-weight: 550; padding: 2px 7px; border-radius: 5px; background: var(--surface-2); color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.tag svg { width: 11px; height: 11px; }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.due { background: var(--due-bg); color: var(--due); } .tag.accent { background: var(--accent-bg); color: var(--accent); }

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
tr.group-row td { background: var(--surface-2); padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
tr.group-row .row { gap: 10px; flex-wrap: wrap; }
tr.group-row a b { color: var(--text); }
@media (max-width: 860px) { .table-wrap table { min-width: 680px; } }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 650; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th.num, td.num { text-align: right; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
tbody tr.selected td { background: var(--accent-bg); }
td.check, th.check { width: 38px; padding-right: 0; }
.cell-main { display: grid; gap: 2px; min-width: 0; }
.cell-main .t { font-weight: 580; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.cell-main .s { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cell-main .s svg { width: 12px; height: 12px; }
.empty { padding: 44px 16px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 4px; font-size: 13px; }
.empty p { margin: 0; }
.empty b { color: var(--text); display: block; font-size: 14.5px; }
.empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--faint); margin-bottom: 8px; }
.empty-icon svg { width: 22px; height: 22px; }
.empty-act { margin-top: 12px; }
div.empty:not(.card *):not(.picker *) { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters > input[type=search] { max-width: 280px; }
.filters select { width: auto; max-width: 220px; }
.status-tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.status-tabs button {
  font: inherit; font-size: 13px; font-weight: 550; border: 0; background: none; color: var(--muted); position: relative;
  padding: 8px 12px 10px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; transition: color .12s;
}
.status-tabs button b { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.status-tabs button:hover { color: var(--text); }
.status-tabs button.on { color: var(--text); }
.status-tabs button.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.status-tabs button.on b { background: var(--accent-bg); color: var(--accent); }
.status-tabs button.bad b { background: var(--bad-bg); color: var(--bad); }
.bulkbar {
  position: sticky; bottom: 18px; z-index: 4; margin-top: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  background: var(--text); color: var(--bg); padding: 9px 10px 9px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
  animation: rise .18s ease-out;
}
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.bulkbar .btn { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 25%, transparent); box-shadow: none; }
.bulkbar .btn:hover:not(:disabled) { background: color-mix(in srgb, var(--bg) 14%, transparent); border-color: transparent; }
.bulkbar .btn.danger { color: color-mix(in srgb, var(--bad) 70%, var(--bg)); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pager.bare { border: 0; padding: 14px 0 0; }
@media (max-width: 640px) {
  .status-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .status-tabs button { white-space: nowrap; }
  .filters .search { max-width: none; flex-basis: 100%; }
  .filters select { flex: 1; max-width: none; }
  .pill-sep { display: none; }
}

/* ------------------------------------------------------------------ lists */
.list { display: grid; }
.list-item { display: flex; gap: 11px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--border); color: var(--text); transition: background .1s; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, button.list-item:hover { background: var(--surface-2); text-decoration: none; }
button.list-item { font: inherit; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.list-item .cell-main { flex: 1; }

/* ------------------------------------------------------- charts (overview) */
.bars { display: grid; grid-template-columns: repeat(var(--n, 14), 1fr); gap: 5px; align-items: end; height: 130px; padding-top: 8px; }
.bar { display: flex; flex-direction: column-reverse; border-radius: 4px 4px 1px 1px; overflow: hidden; min-height: 3px; background: var(--surface-2); transition: filter .12s; }
.bar:hover { filter: brightness(1.1); }
.bar span { display: block; }
.bar-labels { display: grid; grid-template-columns: repeat(var(--n, 14), 1fr); gap: 5px; font-size: 10.5px; color: var(--faint); text-align: center; margin-top: 6px; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }

.an-summary { display: flex; gap: 30px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.an-metric b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.an-metric span { font-size: 11.5px; color: var(--muted); }
.an-summary.compact { border: 0; padding: 0; margin: 0; gap: 22px; }
.an-summary.compact .an-metric b { font-size: 17px; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 36px; }
.an-section { margin-top: 18px; min-width: 0; }
.an-rows { display: flex; flex-direction: column; gap: 11px; }
.an-row { display: grid; grid-template-columns: 124px 1fr auto; align-items: center; gap: 12px; }
.an-plat { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text); min-width: 0; white-space: nowrap; }
.an-bar { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; display: flex; }
.an-bar i { display: block; height: 100%; background: var(--c, var(--accent)); }
.an-bar i.up { background: color-mix(in srgb, var(--c, var(--accent)) 35%, transparent); }
.an-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 104px; }
.an-week-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.an-week-val { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 14px; }
.an-week-bar i { display: block; width: 100%; max-width: 32px; background: var(--accent); border-radius: 5px 5px 2px 2px; }
.an-week-bar.today i { background: var(--text); }
.an-week-day { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.an-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------- queue: day timeline */
.day-group { margin-bottom: 28px; }
.day-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; padding: 8px 0;
  background: linear-gradient(var(--bg) 75%, transparent); font-size: 16.5px; font-weight: 700; letter-spacing: -.02em; }
.day-header small { font-size: 12px; font-weight: 500; color: var(--faint); letter-spacing: 0; }
.qrow { display: grid; grid-template-columns: 78px 1fr; gap: 14px; align-items: start; margin-bottom: 12px; }
.qtime { padding-top: 15px; }
.qtime b { display: block; font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qtime span { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.qtime span svg { width: 11px; height: 11px; }
.qcard {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--edge, transparent);
  border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color .14s, box-shadow .14s, transform .14s;
}
.qcard:hover { border-color: var(--accent); border-left-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.qcard.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.qcard[data-tone="due"] { --edge: var(--due); } .qcard[data-tone="bad"] { --edge: var(--bad); }
.qcard[data-tone="ok"] { --edge: var(--ok); } .qcard[data-tone="accent"] { --edge: var(--accent); } .qcard[data-tone="muted"] { --edge: var(--border-strong); }
.qcard-body { display: flex; gap: 16px; padding: 15px 16px 14px 16px; min-width: 0; }
.qcard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.qcard-top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.qcard-top .who { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.qcard-top .who b { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qcard-top .who small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qcard-title { font-weight: 650; font-size: 13.5px; margin: 0; }
.qcard-cap { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text); white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.qcard-cap.empty { color: var(--faint); font-style: italic; padding: 0; display: block; text-align: left; }
.qcard-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qcard-foot { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; border-top: 1px solid var(--border); background: var(--surface-2); min-height: 44px; }
.qcard-foot .info { font-size: 12px; color: var(--muted); flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.qcard-foot .info svg { width: 13px; height: 13px; }
.qcard-foot .info.bad { color: var(--bad); }
.qcard-foot .info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcard-foot .acts { display: flex; gap: 4px; }
.qcard-check { position: absolute; top: 10px; right: 10px; z-index: 1; padding: 4px; border-radius: 6px; background: var(--surface); opacity: 0; transition: opacity .12s; }
.qcard:hover .qcard-check, .qcard.selected .qcard-check, .qcards.selecting .qcard-check { opacity: 1; }
.thumb { width: 132px; height: 132px; flex-shrink: 0; position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb video { opacity: 0; transition: opacity .2s; pointer-events: none; }
.thumb video.ready { opacity: 1; }
.thumb-badge { position: absolute; left: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.55); color: #fff; border: 1.5px solid rgba(255,255,255,.35); backdrop-filter: blur(4px); }
.thumb-badge svg { width: 12px; height: 12px; }
.thumb-badge.play svg { width: 10px; height: 10px; margin-left: 2px; fill: currentColor; }
.thumb-n { position: absolute; right: 8px; top: 8px; font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; }
@media (max-width: 640px) {
  .qrow { grid-template-columns: 1fr; gap: 4px; }
  .qtime { padding-top: 0; display: flex; gap: 8px; align-items: baseline; }
  .thumb { width: 84px; height: 84px; }
}

/* --------------------------------------------------------------- calendar */
.cal-head { display: flex; align-items: center; gap: 8px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--border); gap: 1px; box-shadow: var(--shadow-sm); }
.cal-dow { background: var(--surface-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 8px; font-weight: 650; text-align: center; }
.cal-day { background: var(--surface); min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.other { background: var(--bg); }
.cal-day.other .cal-num { color: var(--faint); }
.cal-day.weekend:not(.other) { background: color-mix(in srgb, var(--surface) 70%, var(--surface-2)); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.today .cal-num { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.cal-num { font-size: 12px; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.cal-day-top { display: flex; align-items: center; justify-content: space-between; }
.cal-day-top small { font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; padding-right: 3px; }
.cal-ev {
  --c: var(--muted);
  display: flex; gap: 5px; align-items: center; font-size: 11.5px; font-weight: 550; padding: 3px 6px; border-radius: 6px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c); border: 0; font-family: inherit; text-align: left; width: 100%; min-width: 0;
  transition: filter .1s, transform .1s;
}
.cal-ev:hover { filter: brightness(1.12) saturate(1.1); transform: translateX(1px); }
.cal-ev svg { width: 11px; height: 11px; flex-shrink: 0; }
.cal-ev .t { font-variant-numeric: tabular-nums; flex-shrink: 0; }
.cal-ev .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; color: var(--text); opacity: .8; font-weight: 500; }
.cal-ev .k { display: flex; opacity: .7; }
.cal-ev.c-yt { --c: var(--yt); } .cal-ev.c-ig { --c: var(--ig); } .cal-ev.c-tt { --c: var(--tt); } .cal-ev.c-fb { --c: var(--fb); }
.cal-ev.c-li { --c: var(--li); } .cal-ev.c-x, .cal-ev.c-th { --c: var(--x); } .cal-ev.c-bs { --c: var(--bs); } .cal-ev.c-pi { --c: var(--pi); }
/* Status is layered on the platform colour (ring, dash, strike), never replaces it. */
.cal-ev.s-posted { box-shadow: inset 0 0 0 1px var(--ok); }
.cal-ev.s-failed, .cal-ev.s-unknown, .cal-ev.s-missed { box-shadow: inset 0 0 0 1px var(--bad); }
.cal-ev.s-held { opacity: .65; outline: 1px dashed currentColor; outline-offset: -1px; }
.cal-ev.s-draft { opacity: .55; }
.cal-ev.s-cancelled .n, .cal-ev.s-cancelled .t { text-decoration: line-through; }
.cal-more { font-size: 11px; font-weight: 550; color: var(--muted); background: none; border: 0; cursor: pointer; text-align: left; padding: 2px 6px; border-radius: 5px; font-family: inherit; }
.cal-more:hover { background: var(--surface-2); color: var(--text); }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 14px; height: 10px; border-radius: 3px; background: var(--surface-2); }
@media (max-width: 860px) { .cal-day { min-height: 74px; padding: 4px; } .cal-ev .n, .cal-ev .k, .cal-ev .t { display: none; } .cal-ev { justify-content: center; padding: 3px; } }

/* ---------------------------------------------------------------- compose */
.compose { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.compose > .stack:last-child { position: sticky; top: 18px; }
@media (max-width: 1100px) { .compose { grid-template-columns: 1fr; } .compose > .stack:last-child { position: static; } }
.kind-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kind-pick label { cursor: pointer; position: relative; }
.kind-pick input { position: absolute; opacity: 0; pointer-events: none; }
.kind-pick span { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--border); border-radius: 10px; font-size: 12px; font-weight: 550; color: var(--muted); text-align: center; transition: all .12s; }
.kind-pick span svg { width: 20px; height: 20px; }
.kind-pick label:hover span { border-color: var(--border-strong); color: var(--text); }
.kind-pick input:checked + span { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.kind-pick input:focus-visible + span { box-shadow: var(--ring); }
@media (max-width: 520px) { .kind-pick { grid-template-columns: repeat(2, 1fr); } }
.picker { max-height: 440px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.picker-acc { border-bottom: 1px solid var(--border); }
.picker-acc:last-child { border-bottom: 0; }
.picker-acc > label { display: flex; gap: 9px; align-items: center; padding: 9px 12px; background: var(--surface-2); font-weight: 600; font-size: 13px; cursor: pointer; position: sticky; top: 0; z-index: 1; }
.picker-ch { display: flex; gap: 9px; align-items: center; padding: 7px 12px 7px 34px; font-size: 13px; cursor: pointer; transition: background .1s; }
.picker-ch:hover { background: var(--surface-2); }
.picker-ch.off { color: var(--faint); }
.picker-ch:has(input:checked) { background: var(--accent-bg); }
.quick-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.preview { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: grid; gap: 9px; background: var(--surface); }
.preview.bad { border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }
.preview pre { white-space: pre-wrap; word-break: break-word; margin: 0; font: inherit; font-size: 13px; max-height: 220px; overflow: auto; line-height: 1.55; }
.preview-title { font-weight: 650; font-size: 13.5px; }
.charbar { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.charbar .meter { flex: 1; height: 4px; }
.charbar.over { color: var(--bad); font-weight: 600; } .charbar.over .meter span { background: var(--bad); }
.charbar.near .meter span { background: var(--due); }
.issues { margin: 0; padding: 0; list-style: none; font-size: 12.5px; display: grid; gap: 4px; }
.issues li { display: flex; gap: 7px; align-items: flex-start; }
.issues li svg { width: 14px; height: 14px; margin-top: 2px; }
.issues li.e { color: var(--bad); }
.issues li.w { color: var(--due); }
.summary-line { display: flex; gap: 10px; align-items: flex-start; }
.summary-line svg { width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 550; }
details > summary::-webkit-details-marker { display: none; }
details > summary svg { width: 14px; height: 14px; transition: transform .15s; }
details[open] > summary svg { transform: rotate(180deg); }

/* ------------------------------------------------------- drawer and modal */
.drawer, .modal { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.drawer[aria-hidden="false"], .modal[aria-hidden="false"] { pointer-events: auto; }
.drawer-back, .modal-back { position: absolute; inset: 0; background: rgba(8,10,14,.45); opacity: 0; transition: opacity .2s; backdrop-filter: blur(2px); }
.drawer[aria-hidden="false"] .drawer-back, .modal[aria-hidden="false"] .modal-back { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); background: var(--bg); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .26s cubic-bezier(.22,.8,.3,1), width .22s ease; overflow-y: auto; padding: 0 22px 22px;
}
.drawer-panel.wide { width: min(900px, 96vw); }
.drawer[aria-hidden="false"] .drawer-panel { transform: none; }
.drawer-panel > .panel-head { position: sticky; top: 0; z-index: 3; margin: 0 -22px 18px; padding: 14px 18px 14px 22px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); align-items: center; }
.modal-panel {
  position: absolute; left: 50%; top: 10vh; transform: translate(-50%, 10px) scale(.98); width: min(560px, calc(100vw - 32px)); max-height: 80vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px;
  opacity: 0; transition: opacity .16s, transform .18s cubic-bezier(.22,.8,.3,1);
}
.modal[aria-hidden="false"] .modal-panel { opacity: 1; transform: translate(-50%, 0) scale(1); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.panel-head h3 { font-size: 16px; }
.panel-head .head-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; }
.panel-head .head-main > div { min-width: 0; display: grid; gap: 3px; }
.panel-head .head-main h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-head .head-main small { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.panel-head .head-acts { display: flex; gap: 2px; align-items: center; }
.panel-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.drawer-foot { position: sticky; bottom: -22px; z-index: 3; margin: 22px -22px -22px; padding: 12px 22px; background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px); border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.sec { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 24px 0 9px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sec .count { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 7px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; font-variant-numeric: tabular-nums; }
.kv dd .faint { font-family: var(--mono); font-size: 11px; margin-left: 6px; }
.media-prev { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.media-prev img, .media-prev video { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.media-hero { background: #000; border-radius: 12px; overflow: hidden; display: flex; justify-content: center; }
.media-hero video { width: 100%; max-height: 420px; display: block; }
.drawer-panel.wide .media-hero video { max-height: 560px; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.strip img { height: 200px; border-radius: 9px; border: 1px solid var(--border); scroll-snap-align: start; }
.strip-note { font-size: 11.5px; color: var(--faint); margin-top: 6px; }
.media-links { display: grid; gap: 4px; margin-top: 8px; }
.media-links a { display: flex; align-items: center; gap: 6px; overflow: hidden; }
.media-links a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-links svg { width: 12px; height: 12px; }
.timeline { display: grid; gap: 0; font-size: 12.5px; position: relative; }
.timeline > div { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding-bottom: 12px; position: relative; }
.timeline > div::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 0; width: 1px; background: var(--border); }
.timeline > div:last-child::before { display: none; }
.timeline > div > i { width: 9px; height: 9px; border-radius: 50%; margin: 4px 0 0 2px; background: var(--faint); box-shadow: 0 0 0 3px var(--bg); position: relative; }
.timeline > div > i.admin { background: var(--accent); } .timeline > div > i.n8n { background: var(--ok); } .timeline > div > i.system { background: var(--due); }
.timeline .t-when { color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.callout { border-radius: 10px; padding: 11px 13px; font-size: 13px; background: var(--surface-2); line-height: 1.5; }
.callout:has(> svg) { display: flex; gap: 10px; align-items: flex-start; }
.callout > svg { width: 16px; height: 16px; margin-top: 2px; }
.callout > span, .callout > div { flex: 1; min-width: 0; }
.callout.bad { background: var(--bad-bg); color: var(--bad); }
.callout.due { background: var(--due-bg); color: var(--due); }
.callout.ok { background: var(--ok-bg); color: var(--ok); }
.callout.accent { background: var(--accent-bg); color: var(--accent); }
.callout a { color: inherit; text-decoration: underline; }
.banner { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; font-size: 13px; border: 1px solid; }
.banner > svg { width: 18px; height: 18px; }
.banner > span { flex: 1; }
.banner.bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.banner .btn { color: var(--text); }

.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 30; display: grid; gap: 8px; justify-items: center; width: max-content; max-width: min(480px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 9px; background: var(--text); color: var(--bg); padding: 10px 16px 10px 13px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500; white-space: pre-line; animation: toast-in .2s cubic-bezier(.22,.8,.3,1); transition: opacity .2s, transform .2s; }
.toast svg { width: 16px; height: 16px; margin-top: 1px; color: var(--ok); }
.toast.bad { background: var(--bad); color: #fff; }
.toast.bad svg { color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { transform: translateY(10px) scale(.97); opacity: 0; } }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%), var(--bg); }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px 28px 26px; box-shadow: var(--shadow-lg); display: grid; gap: 16px; text-align: center; }
.login-card img { width: 60px; height: 60px; border-radius: 15px; margin: 0 auto; box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 4px; }
.login-card .field { text-align: left; }
.login-card p { margin: 0; }
.login-marks { display: flex; justify-content: center; gap: 6px; }

.skeleton { color: var(--muted); padding: 60px 0; display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 13px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------------------------------------------------------------- members */
.role-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.role-guide > div { display: grid; gap: 6px; justify-items: start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 12.5px; color: var(--muted); }
.ws-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 9px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; white-space: nowrap; }
.secret { padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 17px; letter-spacing: .04em; text-align: center; user-select: all; }

/* ------------------------------------------------------------ two-factor */
.tfa { width: min(440px, 100%); text-align: left; }
.tfa > img, .tfa > div:first-of-type { text-align: center; }
.tfa h1 { display: flex; gap: 8px; align-items: center; justify-content: center; }
.tfa h1 svg { width: 22px; height: 22px; color: var(--ok); }
.tfa-steps { margin: 0; padding-left: 20px; display: grid; gap: 12px; font-size: 13.5px; }
.tfa-steps b { font-weight: 650; }
.tfa-qr { margin: 10px auto 2px; width: 200px; height: 200px; padding: 8px; border-radius: 12px; background: #fff; }
.tfa-qr svg { width: 100%; height: 100%; display: block; }
.tfa-manual { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.tfa-manual summary { cursor: pointer; color: var(--accent); }
.tfa-key { display: block; margin-top: 6px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-family: var(--mono); font-size: 13px; letter-spacing: .06em; color: var(--text); user-select: all; word-break: break-all; }
.tfa-code { text-align: center; font-family: var(--mono); font-size: 22px; letter-spacing: .35em; padding: 10px; }
.tfa-codes { margin: 0; padding: 12px 12px 12px 34px; columns: 2; column-gap: 24px; font-size: 14px; line-height: 1.9;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
