/* Circles Ai AaaS — design system v2
   Light-first · densidad Linear/Notion + enterprise light
   Acento #4F46E5 / #2563EB · marca solo Circles Ai
*/

:root {
  --bg: #f3f5fa;
  --bg-accent: #eef2ff;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f7;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --ink-3: #475569;
  --ink-4: #64748b;
  --ink-5: #94a3b8;
  --line: #e4e8f0;
  --line-strong: #cdd3df;
  --accent: #4f46e5;
  --accent-2: #2563eb;
  --accent-3: #4338ca;
  --accent-soft: #eef2ff;
  --accent-soft-2: #dbeafe;
  --cyan: #0e7490;
  --cyan-bg: #ecfeff;
  --success: #047857;
  --success-bg: #ecfdf5;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --purple: #6d28d9;
  --purple-bg: #f5f3ff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --sidebar: 248px;
  --topbar: 56px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
  min-height: 100%;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
code, .mono { font-family: var(--mono); font-size: 12px; }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
  color: inherit;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14px; font-weight: 650; letter-spacing: -0.02em; }
.brand-text span { font-size: 11px; color: var(--ink-4); font-weight: 500; }

.org-switch {
  margin: 0 12px 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 24px);
  text-align: left;
}
.org-switch:hover { border-color: #c7d2fe; background: var(--accent-soft); }
.org-avatar {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; flex-shrink: 0;
}
.org-avatar.alt { background: linear-gradient(135deg, #0e7490, #2563eb); }
.org-avatar.alt2 { background: linear-gradient(135deg, #b45309, #db2777); }
.org-meta { min-width: 0; flex: 1; }
.org-meta b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-meta small { color: var(--ink-4); font-size: 11px; }
.org-caret { color: var(--ink-5); font-size: 10px; }

.nav { flex: 1; overflow: auto; padding: 4px 10px 16px; }
.nav-label {
  font-size: 10px; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-5);
  padding: 12px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--ink-3); font-weight: 510; font-size: 13px;
  text-decoration: none; position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-item.is-active {
  background: var(--accent-soft); color: var(--accent-3); font-weight: 600;
}
.nav-item.is-active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-ico { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.nav-item span { flex: 1; }
.nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
}
.nav-badge.warn { background: var(--warning); }
.sidebar-foot {
  border-top: 1px solid var(--line);
  padding: 12px 14px 14px;
  display: flex; align-items: center; gap: 8px;
}
.user-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: #e0e7ff; color: var(--accent-3);
  display: grid; place-items: center; font-weight: 700; font-size: 11px;
}
.user-meta { min-width: 0; }
.user-meta b { display: block; font-size: 12px; }
.user-meta small { color: var(--ink-4); font-size: 11px; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: var(--topbar);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; position: sticky; top: 0; z-index: 15;
}
.crumb { display: flex; align-items: center; gap: 6px; color: var(--ink-4); font-size: 12.5px; }
.crumb a { color: var(--ink-3); }
.crumb strong { color: var(--ink); font-weight: 600; }
.crumb .sep { color: var(--ink-5); }
.search-trigger {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; height: 34px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--ink-4); font-size: 12.5px;
}
.search-trigger kbd {
  margin-left: auto; font-family: var(--font);
  font-size: 11px; border: 1px solid var(--line);
  background: #fff; border-radius: 5px; padding: 1px 6px; color: var(--ink-4);
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; position: relative; color: var(--ink-3);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; width: 7px; height: 7px;
  background: var(--danger); border-radius: 50%; border: 2px solid #fff;
}
.content { padding: 20px 24px 32px; flex: 1; }
.page-foot {
  margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--ink-5); font-size: 11.5px; display: flex; justify-content: space-between; gap: 12px;
}

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; letter-spacing: -0.03em; font-weight: 650; line-height: 1.2; }
.page-head p.lede { color: var(--ink-3); margin-top: 4px; max-width: 720px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow {
  font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 4px;
}

/* ---------- Buttons / badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-weight: 580; font-size: 13px; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-3); }
.btn-accent { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-ghost { background: transparent; }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-3); }
table.data .mono, table.data .nowrap { white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11px; font-weight: 620; background: var(--surface-3); color: var(--ink-3);
  white-space: nowrap;
}
.badge-ok { background: var(--success-bg); color: var(--success); }
.badge-warn { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--accent-soft); color: var(--accent-3); }
.badge-cyan { background: var(--cyan-bg); color: var(--cyan); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-neutral { background: #f1f5f9; color: var(--ink-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 14px; }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-sidebar { grid-template-columns: 1.6fr 1fr; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 12px; box-shadow: var(--shadow-sm); min-width: 0;
}
.kpi .k-label { color: var(--ink-4); font-size: 11.5px; font-weight: 560; display: flex; justify-content: space-between; }
.kpi .k-value { font-size: 22px; font-weight: 650; letter-spacing: -0.03em; margin: 6px 0 2px; }
.kpi .k-meta { color: var(--ink-4); font-size: 11.5px; }
.kpi .delta.up { color: var(--success); }
.kpi .delta.down { color: var(--danger); }
.kpi .delta.flat { color: var(--ink-4); }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.panel-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.panel-h h2, .panel-h h3 { font-size: 13.5px; font-weight: 650; }
.panel-h .sub { color: var(--ink-4); font-size: 12px; font-weight: 500; }
.panel-b { padding: 14px; }
.panel-b.tight { padding: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; font-size: 11px; font-weight: 650; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-4);
  padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafbff; }
table.data tr.is-selected { background: var(--accent-soft); }
table.data .title { font-weight: 600; color: var(--ink); }
table.data .muted { color: var(--ink-4); }
.bar {
  height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; width: 88px;
}
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.bar.risk > i { background: linear-gradient(90deg, #f59e0b, #dc2626); }
.bar.warn > i { background: #d97706; }
.bar.ok > i { background: #059669; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 8px; }
.tab {
  border: 0; background: transparent; height: 38px; padding: 0 12px;
  color: var(--ink-4); font-weight: 560; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.is-active { color: var(--accent-3); border-bottom-color: var(--accent); font-weight: 650; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------- Timeline / stepper ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.t-step { display: grid; grid-template-columns: 18px 1fr; gap: 10px; }
.t-rail { display: flex; flex-direction: column; align-items: center; }
.t-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line-strong); background: #fff; margin-top: 3px; flex-shrink: 0;
}
.t-step.is-done .t-dot { background: var(--success); border-color: var(--success); }
.t-step.is-current .t-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.t-step.is-wait .t-dot { background: var(--warning); border-color: var(--warning); }
.t-step.is-fail .t-dot { background: var(--danger); border-color: var(--danger); }
.t-line { width: 2px; flex: 1; background: var(--line); min-height: 18px; }
.t-body { padding-bottom: 14px; min-width: 0; }
.t-body h4 { font-size: 13px; font-weight: 620; }
.t-body .meta { color: var(--ink-4); font-size: 11.5px; margin-top: 2px; }

/* ---------- Process canvas ---------- */
.canvas-wrap {
  background:
    linear-gradient(90deg, rgba(79,70,229,0.04) 1px, transparent 1px),
    linear-gradient(rgba(79,70,229,0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  background-color: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: auto;
  min-height: 420px;
}
.swim { width: 100%; min-width: 0; height: auto; }
.lane-label { fill: #475569; font: 600 11px var(--font); }
.node {
  fill: #fff; stroke: #c7d2fe; stroke-width: 1.4;
}
.node.sys { fill: #eff6ff; stroke: #93c5fd; }
.node.pain { fill: #fff7ed; stroke: #fdba74; }
.node.auto { fill: #ecfdf5; stroke: #6ee7b7; }
.node-title { font: 650 11px var(--font); fill: #0f172a; }
.node-sub { font: 500 10px var(--font); fill: #64748b; }

/* ---------- Radar / score ---------- */
.radar-box { display: flex; gap: 18px; align-items: center; }
.score-list { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.score-row { display: grid; grid-template-columns: 120px 1fr 36px; gap: 8px; align-items: center; font-size: 12px; }
.score-row span { color: var(--ink-3); }
.score-row b { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Chat / evidence ---------- */
.split-3 {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 14px;
  align-items: start;
}
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 560px; overflow: auto; }
.bubble {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 9px 10px;
}
.bubble.orch { background: var(--accent-soft); border-color: #c7d2fe; }
.bubble .who { font-size: 11px; font-weight: 650; color: var(--accent-3); margin-bottom: 3px; display: flex; justify-content: space-between; }
.ev-item {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; margin-bottom: 8px;
}
.ev-item small { color: var(--ink-4); display: block; margin-top: 3px; }

/* ---------- Graph / studio ---------- */
.flow-graph { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 6px 0 10px; }
.flow-node {
  min-width: 104px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; text-align: left;
}
.flow-node.is-done { border-color: #a7f3d0; background: var(--success-bg); }
.flow-node.is-current { border-color: #a5b4fc; background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
.flow-node.is-wait { border-color: #fcd34d; background: var(--warning-bg); }
.flow-node b { display: block; font-size: 12px; }
.flow-node span { font-size: 11px; color: var(--ink-4); }
.flow-arr { color: var(--ink-5); padding: 0 6px; font-size: 16px; }

.md {
  font-size: 13.5px; line-height: 1.6; color: var(--ink-2);
}
.md h3 { font-size: 16px; margin: 0 0 8px; }
.md h4 { font-size: 13px; margin: 14px 0 6px; }
.md p { margin: 0 0 8px; }
.md ul { padding-left: 16px; list-style: disc; margin: 0 0 8px; }
.md li { margin: 3px 0; }
.md code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.pre {
  background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 12px 14px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.5; overflow: auto; margin: 0;
}
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare-col { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.compare-h { padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 650; display: flex; justify-content: space-between; }

/* ---------- Comments / gate ---------- */
.thread { display: flex; flex-direction: column; gap: 10px; }
.comment { display: grid; grid-template-columns: 32px 1fr; gap: 8px; }
.comment .body { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.comment .body b { font-size: 12px; }
.comment .body p { margin-top: 3px; color: var(--ink-2); }
.diff-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.diff-box { border: 1px dashed #cbd5e1; border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.diff-box.plus { background: #f0fdf4; border-color: #86efac; }
.diff-box h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-4); margin-bottom: 6px; }

/* ---------- Command palette / toast ---------- */
.cmdk-backdrop, .modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.38);
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 14vh; z-index: 80;
}
.cmdk-backdrop.is-open, .modal-backdrop.is-open { display: flex; }
.cmdk {
  width: min(560px, calc(100vw - 32px));
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  overflow: hidden; border: 1px solid var(--line);
}
.cmdk input {
  width: 100%; border: 0; outline: none; padding: 14px 16px;
  font-size: 15px; border-bottom: 1px solid var(--line);
}
.cmdk-list { max-height: 360px; overflow: auto; padding: 6px; }
.cmdk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
}
.cmdk-item:hover, .cmdk-item.is-active { background: var(--accent-soft); }
.cmdk-item .hint { margin-left: auto; color: var(--ink-5); font-size: 11px; }
.toasts {
  position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 90;
}
.toast {
  background: #0f172a; color: #fff; padding: 10px 14px; border-radius: 10px;
  box-shadow: var(--shadow-lg); min-width: 240px; font-size: 13px;
  animation: pop 0.18s ease-out;
}
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- States ---------- */
.state {
  padding: 36px 20px; text-align: center; color: var(--ink-3);
}
.state h3 { font-size: 15px; margin-bottom: 6px; color: var(--ink); }
.state p { max-width: 420px; margin: 0 auto 12px; }
.spinner {
  width: 22px; height: 22px; border: 2px solid #c7d2fe; border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login / hub ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--bg);
}
.auth-brand {
  padding: 40px 48px;
  background:
    radial-gradient(1200px 500px at -10% -20%, rgba(79,70,229,0.18), transparent 50%),
    radial-gradient(900px 400px at 80% 110%, rgba(37,99,235,0.14), transparent 45%),
    #0f172a;
  color: #e2e8f0;
  display: flex; flex-direction: column;
}
.auth-brand .brand { padding: 0; color: #fff; }
.auth-brand h1 { color: #fff; font-size: 34px; letter-spacing: -0.04em; line-height: 1.15; margin: 48px 0 14px; max-width: 520px; }
.auth-brand p { color: #94a3b8; max-width: 500px; font-size: 14.5px; line-height: 1.55; }
.auth-points { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; gap: 10px; color: #cbd5e1; font-size: 13.5px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 32px; }
.auth-card { width: min(440px, 100%); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 620; color: var(--ink-3); }
.field input, .field select, .field textarea {
  height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 72px; }
.org-pick { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 8px; }
.org-card {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; width: 100%;
}
.org-card:hover, .org-card:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.org-card .grow { flex: 1; min-width: 0; }
.org-card b { display: block; }
.org-card small { color: var(--ink-4); }

.hub { max-width: 1160px; margin: 0 auto; padding: 36px 28px 48px; }
.hub-hero { margin-bottom: 22px; }
.hub-hero h1 { font-size: 28px; letter-spacing: -0.04em; }
.flow-map {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 8px;
}
.flow-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; color: inherit; box-shadow: var(--shadow-sm); min-height: 118px;
}
.flow-card:hover { border-color: #a5b4fc; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.flow-card .n { font-size: 11px; font-weight: 700; color: var(--accent); }
.flow-card h3 { font-size: 14px; margin: 4px 0; }
.flow-card p { color: var(--ink-4); font-size: 12.5px; }
.legend {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  color: var(--ink-3); line-height: 1.55;
}

/* ---------- Misc ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters select, .filters input {
  height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 10px;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.activity { display: flex; flex-direction: column; }
.act { display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.act:last-child { border-bottom: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; font-size: 13px; }
.check input { margin-top: 3px; }
.sig {
  border: 1px dashed #a5b4fc; background: var(--accent-soft); border-radius: 10px; padding: 12px 14px;
}
.two-col { display: grid; grid-template-columns: 1.35fr 0.85fr; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.muted { color: var(--ink-4); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.grow { flex: 1; }

@media (max-width: 1280px) {
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .split-3 { grid-template-columns: 250px 1fr; }
  .split-3 .col-evidence { grid-column: 1 / -1; }
  .grid-sidebar, .two-col { grid-template-columns: 1fr; }
  .flow-map { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .grid-6, .grid-4 { grid-template-columns: 1fr 1fr; }
  .compare, .diff-row { grid-template-columns: 1fr; }
}
