/* ==========================================================================
   BluestarAI Pipeline OS — Application design system
   Space Blue · Orange · Dark Blue · Blue Black
   Raleway (headlines) + Montserrat (body)
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face { font-family: "Raleway"; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/raleway-400.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-weight: 500; font-style: normal; font-display: swap; src: url("/static/fonts/raleway-500.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-weight: 600; font-style: normal; font-display: swap; src: url("/static/fonts/raleway-600.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-weight: 700; font-style: normal; font-display: swap; src: url("/static/fonts/raleway-700.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 300; font-style: normal; font-display: swap; src: url("/static/fonts/montserrat-300.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/montserrat-400.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 500; font-style: normal; font-display: swap; src: url("/static/fonts/montserrat-500.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-style: normal; font-display: swap; src: url("/static/fonts/montserrat-600.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-style: normal; font-display: swap; src: url("/static/fonts/montserrat-700.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  /* brand */
  --space-blue: #3148B9;
  --space-blue-600: #2A3EA6;
  --space-blue-400: #5C77E8;
  --space-blue-300: #8C9DF0;
  --orange: #F24C03;
  --orange-400: #FF6A2A;
  --ink: #0B1828;
  --blueblack: #020409;
  --grey: #232323;

  /* surfaces */
  --bg: #F4F6FC;
  --bg-2: #EEF1FA;
  --surface: #FFFFFF;
  --surface-2: #FAFBFE;
  --surface-sunken: #F3F5FB;
  --sidebar-1: #0C1A2E;
  --sidebar-2: #050B16;
  --sidebar-3: #020409;

  /* text */
  --text: #0E1B2E;
  --text-2: #3C4A61;
  --muted: #6B7790;
  --muted-2: #97A1B5;
  --on-dark: #EAF0FF;
  --on-dark-muted: #93A2C4;

  /* lines & accents */
  --line: #E4E8F2;
  --line-2: #EEF1F8;
  --line-strong: #D4DAE9;
  --focus: rgba(49, 72, 185, 0.35);

  /* semantic */
  --green: #17915C;
  --green-soft: #E5F6ED;
  --amber: #B7791F;
  --amber-soft: #FCF2DF;
  --red: #C6373B;
  --red-soft: #FCE9E9;
  --purple: #6D4AC7;
  --purple-soft: #EFEAFB;

  /* type */
  --font-head: "Raleway", "Segoe UI", system-ui, sans-serif;
  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, monospace;

  /* shape & motion */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-xs: 0 1px 2px rgba(14, 27, 46, 0.05);
  --shadow-sm: 0 2px 8px rgba(14, 27, 46, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(14, 27, 46, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(14, 27, 46, 0.28);
  --shadow-blue: 0 12px 28px -12px rgba(49, 72, 185, 0.55);
  --ring-soft: 0 0 0 1px rgba(49, 72, 185, 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 220ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-head); font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
::selection { background: rgba(49, 72, 185, 0.2); }

/* ---------- App layout ---------- */
body.app {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 100% -8%, rgba(49, 72, 185, 0.10), transparent 60%),
    radial-gradient(760px 420px at 0% 100%, rgba(242, 76, 3, 0.05), transparent 55%),
    var(--bg);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  -webkit-font-smoothing: antialiased;
}
/* Auth pages reuse the .app body tokens, but must not inherit the sidebar grid */
body.app:has(.auth-wrap) { display: block; grid-template-columns: none; }

/* ---------- Sidebar ---------- */
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 16px 18px;
  background:
    radial-gradient(420px 300px at 20% -10%, rgba(49, 72, 185, 0.45), transparent 70%),
    linear-gradient(180deg, var(--sidebar-1) 0%, var(--sidebar-2) 55%, var(--sidebar-3) 100%);
  color: var(--on-dark);
  z-index: 40;
  overflow: hidden;
}
.side::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(400px 300px at 50% 0%, #000, transparent 75%);
  pointer-events: none;
}
.side-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: -0.02em;
  color: #fff;
}
.side-logo img { width: 30px; height: 30px; }
.side-logo b { font-weight: 700; }

.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; scrollbar-width: thin; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--on-dark-muted);
  position: relative;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.side-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-nav a.active {
  background: linear-gradient(100deg, rgba(49, 72, 185, 0.55), rgba(49, 72, 185, 0.22));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(140, 157, 240, 0.28), 0 8px 20px -12px rgba(49, 72, 185, 0.9);
}
.side-nav a.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--space-blue-300), var(--space-blue));
}
.ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 13px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--space-blue-300);
  flex: none;
}
.side-nav a.active .ico { background: rgba(255, 255, 255, 0.16); color: #fff; }

.side-foot {
  margin-top: 10px;
  padding: 14px 12px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-org {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--on-dark-muted);
  font-weight: 600;
}
.side-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ava {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--space-blue-400), var(--space-blue));
  box-shadow: var(--shadow-blue);
}
.side-user b { display: block; font-size: 13px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user span { display: block; font-size: 11.5px; color: var(--on-dark-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Main ---------- */
.main {
  min-width: 0;
  padding: 26px 34px 60px;
  max-width: 1440px;
  width: 100%;
}

/* Topbar / command bar */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 2px 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  font-size: 26px;
  line-height: 1.15;
  color: var(--text);
}
.topbar .sub { margin-top: 6px; color: var(--muted); font-size: 13.5px; max-width: 66ch; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }

/* ---------- Flashes ---------- */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  box-shadow: var(--shadow-xs);
  animation: flash-in var(--dur) var(--ease);
}
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flash-success, .flash-message { background: var(--green-soft); color: #0C6B44; border-color: #BEE7D2; }
.flash-error, .flash-danger { background: var(--red-soft); color: #98272B; border-color: #F3C9CA; }
.flash-warning { background: var(--amber-soft); color: #8A5A12; border-color: #F0DCA8; }
.flash-info { background: #E8EDFC; color: #26398F; border-color: #CFD8F7; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-pad { padding: 20px 22px; }
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.card-title h2 { font-size: 15.5px; font-weight: 700; color: var(--text); }
.card-title a { font-size: 12.5px; font-weight: 600; color: var(--space-blue); transition: color var(--dur); }
.card-title a:hover { color: var(--orange); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur), border-color var(--dur), color var(--dur);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--space-blue-400), var(--space-blue) 55%, var(--space-blue-600));
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover { box-shadow: 0 16px 34px -12px rgba(49, 72, 185, 0.7); filter: brightness(1.04); }
.btn-blue {
  color: #fff;
  background: var(--space-blue);
}
.btn-blue:hover { background: var(--space-blue-600); box-shadow: var(--shadow-blue); }
.btn-ghost {
  color: var(--text-2);
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover { color: var(--text); border-color: var(--space-blue-300); background: var(--surface-2); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn-lg { padding: 13px 22px; font-size: 14.5px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-ghost-light { color: #fff; background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.22); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.18); color: #fff; }
.btn-ghost-dark { color: #fff; background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.20); backdrop-filter: blur(6px); }
.btn-ghost-dark:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.35); }

/* ---------- KPIs ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--space-blue), var(--space-blue-400));
  opacity: 0.9;
}
.kpi:nth-child(2)::before { background: linear-gradient(90deg, var(--orange), var(--orange-400)); }
.kpi:nth-child(4)::before { background: linear-gradient(90deg, var(--green), #34B57D); }
.kpi:nth-child(5)::before { background: linear-gradient(90deg, var(--purple), #9375DE); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi b {
  display: block;
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}
.kpi span { display: block; margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Layout grids ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.stack { display: flex; flex-direction: column; gap: 18px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.flex { display: flex; align-items: center; gap: 10px; }
.hidden { display: none !important; }

/* ---------- Briefing ---------- */
.brief-item {
  display: flex;
  gap: 13px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.brief-item:last-child { border-bottom: 0; padding-bottom: 0; }
.brief-kind {
  width: 34px; height: 34px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}
.k-focus { background: #E8EDFC; color: var(--space-blue); }
.k-stalled { background: var(--amber-soft); color: var(--amber); }
.k-capacity { background: var(--green-soft); color: var(--green); }
.k-risk { background: var(--red-soft); color: var(--red); }
.brief-item b { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.brief-item p { margin-top: 3px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.brief-item .act {
  display: inline-flex;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--space-blue);
}
.brief-item a.act:hover { color: var(--orange); text-decoration: underline; }
.brief-card { padding: 6px 22px 18px; }
.brief-lines { display: flex; flex-direction: column; gap: 0; }

/* ---------- Queue rows ---------- */
.q-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.q-row:last-child { border-bottom: 0; }
.q-main { flex: 1; min-width: 0; }
.q-main b { display: block; font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-main span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-sig { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.q-sig time { font-size: 11.5px; color: var(--muted-2); }
.sig {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  background: #E8EDFC;
  color: var(--space-blue);
  text-transform: capitalize;
  white-space: nowrap;
}
.sig.hot { background: linear-gradient(120deg, var(--orange), var(--orange-400)); color: #fff; }

/* ---------- Score ring ---------- */
.score-ring {
  --p: 0;
  --rc: var(--space-blue-400);
  width: 46px; height: 46px;
  flex: none;
  position: relative;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--rc) calc(var(--p) * 1%), var(--line-2) 0);
}
.score-ring::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.score-ring b {
  position: relative;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* ---------- Forms ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.input {
  width: 100%;
  padding: 10px 13px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}
.input:hover { border-color: #C3CBE0; }
.input:focus { border-color: var(--space-blue-400); box-shadow: 0 0 0 4px var(--focus); background: #fff; }
.input::placeholder { color: var(--muted-2); }
select.input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7790' stroke-width='2.5'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.filters .input { width: auto; }
.input-lg { padding: 13px 15px; font-size: 14.5px; border-radius: var(--radius); }
.lbl { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; }
.field { margin-bottom: 15px; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.55; }

/* Range rows (simulator) */
.range-row { display: grid; grid-template-columns: 148px minmax(0, 1fr) 92px; gap: 14px; align-items: center; padding: 9px 0; }
.range-row label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.range-row output { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--space-blue); text-align: right; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 99px;
  background: linear-gradient(90deg, var(--space-blue-400), var(--space-blue));
  outline: none; margin: 6px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid var(--space-blue);
  box-shadow: var(--shadow-sm); cursor: pointer;
}
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--space-blue); cursor: pointer; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
  text-align: left;
  padding: 13px 18px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody td { padding: 14px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { transition: background var(--dur); }
.table tbody tr:hover { background: #F7F9FE; }
.table tbody tr:last-child td { border-bottom: 0; }
.td-name a b { font-size: 14px; font-weight: 600; color: var(--text); }
.td-name a:hover b { color: var(--space-blue); }
.td-name span { display: block; font-size: 12px; color: var(--muted); }

/* ---------- Score pills & badges ---------- */
.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 5px 11px;
  border-radius: 99px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
}
.sp-hot { background: linear-gradient(120deg, var(--orange), var(--orange-400)); color: #fff; box-shadow: 0 6px 14px -8px rgba(242, 76, 3, 0.8); }
.sp-warm { background: var(--space-blue); color: #fff; }
.sp-mid { background: var(--space-blue-soft, #E8EDFC); background: #E8EDFC; color: var(--space-blue); }
.sp-cool { background: var(--surface-sunken); color: var(--muted); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-sunken);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.b-new, .b-imported { background: #E8EDFC; color: #26398F; border-color: #CFD8F7; }
.b-engaged, .b-contacted, .b-enrolled { background: var(--space-blue); color: #fff; border-color: transparent; }
.b-nurture, .b-nurturing { background: var(--amber-soft); color: #8A5A12; border-color: #F0DCA8; }
.b-won, .b-meeting, .b-qualified { background: var(--green-soft); color: #0C6B44; border-color: #BEE7D2; }
.b-lost, .b-unsubscribed, .b-bounced { background: var(--red-soft); color: #98272B; border-color: #F3C9CA; }
.b-paused { background: var(--surface-sunken); color: var(--muted); }

/* ---------- Score bars ---------- */
.scorebar {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) 58px;
  gap: 14px;
  align-items: center;
  padding: 9px 0;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.scorebar > b { text-align: right; color: var(--text); font-weight: 700; }
.bar { height: 9px; border-radius: 99px; background: var(--surface-sunken); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; min-width: 3px; }
.bar-blue { background: var(--surface-sunken); }
.bar-orange { background: var(--surface-sunken); }
.bar-purple { background: var(--surface-sunken); }
.bar-blue > i { background: linear-gradient(90deg, var(--space-blue-400), var(--space-blue)); }
.bar-orange > i { background: linear-gradient(90deg, var(--orange-400), var(--orange)); }
.bar-purple > i { background: linear-gradient(90deg, #9375DE, var(--purple)); }
.bar > i[style*="width"] { transition: width 600ms var(--ease); }

/* ---------- Timeline ---------- */
.tl { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.tl::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.tl li { position: relative; padding: 0 0 16px; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before {
  content: "";
  position: absolute;
  left: -21px; top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--space-blue-400);
}
.tl li > b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.tl li > p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tl li > time { display: block; font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }

/* ---------- Radar grid ---------- */
.radar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.sig-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: #E8EDFC; color: var(--space-blue); }
.sig-chip.hot { background: linear-gradient(120deg, var(--orange), var(--orange-400)); color: #fff; }
.sig-chip.channel-linkedin { background: #E8EDFC; color: #26398F; }
.sig-chip.channel-call { background: var(--green-soft); color: #0C6B44; }

/* ---------- Weight table (model) ---------- */
.weight-table { display: flex; flex-direction: column; gap: 12px; }
.weight-row { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 64px; gap: 14px; align-items: center; }
.w-name { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: capitalize; }
.w-bar { position: relative; height: 22px; border-radius: 8px; background: var(--surface-sunken); overflow: hidden; display: flex; }
.w-bar .pos, .w-fill.pos { background: linear-gradient(90deg, var(--space-blue-400), var(--space-blue)); }
.w-bar .neg, .w-fill.neg { background: linear-gradient(90deg, #E58A7E, var(--red)); }
.w-fill { height: 100%; border-radius: 6px; min-width: 3px; }
.w-val { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; text-align: right; }
.w-val.pos { color: var(--space-blue); }
.w-val.neg { color: var(--red); }

/* ---------- How-to / provider rows / pills ---------- */
.howto { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; }
.prov-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.prov-row:last-child { border-bottom: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-sunken); color: var(--muted); }
.pill.ok { background: var(--green-soft); color: #0C6B44; }
.pill.ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* ---------- Sequences ---------- */
.seq-step {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-2);
}
.seq-step:last-child { border-bottom: 0; }
.seq-no {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--space-blue-400), var(--space-blue));
}
.channel-tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.channel-call { background: var(--green-soft); color: #0C6B44; }
.channel-linkedin { background: #E8EDFC; color: #26398F; }
.channel-email { background: #E8EDFC; color: var(--space-blue); }

/* ---------- Simulator ---------- */
.sim-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sim-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sim-results .card { padding: 16px; }
.verdict { padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
.verdict b { display: block; font-family: var(--font-head); font-size: 20px; text-transform: capitalize; letter-spacing: -0.02em; }
.verdict p, .verdict div p { margin-top: 6px; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.v-go { background: var(--green-soft); border-color: #BEE7D2; }
.v-go b { color: #0C6B44; }
.v-fix { background: var(--amber-soft); border-color: #F0DCA8; }
.v-fix b { color: #8A5A12; }
.v-kill { background: var(--red-soft); border-color: #F3C9CA; }
.v-kill b { color: #98272B; }

.stat-trip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat-trip .cell { background: var(--surface); padding: 15px 16px; }
.stat-trip .cell span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.stat-trip .cell b { display: block; margin-top: 5px; font-family: var(--font-head); font-size: 19px; font-weight: 700; color: var(--text); }

/* ---------- Charts ---------- */
.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Auth ---------- */
.auth-wrap { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-side {
  position: relative;
  padding: 48px 52px;
  color: var(--on-dark);
  background:
    radial-gradient(560px 420px at 15% 0%, rgba(49, 72, 185, 0.55), transparent 65%),
    radial-gradient(400px 380px at 100% 100%, rgba(242, 76, 3, 0.22), transparent 60%),
    linear-gradient(160deg, var(--sidebar-1), var(--sidebar-3));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth-side::after {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(500px 500px at 60% 40%, #000, transparent 75%);
}
.auth-side > * { position: relative; z-index: 1; }
.auth-side h2 { font-size: 30px; line-height: 1.2; letter-spacing: -0.03em; color: #fff; margin-bottom: 12px; }
.auth-side p { color: var(--on-dark-muted); font-size: 14px; line-height: 1.65; }
.auth-points { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px 40px; background: var(--surface); }
.auth-box { width: 100%; max-width: 380px; margin: 0 auto; }
.auth-box h1 { font-size: 25px; letter-spacing: -0.03em; }
.auth-alt { margin-top: 20px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-alt a { color: var(--space-blue); font-weight: 600; }
.auth-alt a:hover { color: var(--orange); }

/* ---------- Console ---------- */
.console-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.console-side, .console-right { display: flex; flex-direction: column; gap: 16px; }
.console-main { display: flex; flex-direction: column; gap: 16px; min-height: 60vh; }
.chat-thread { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px; overflow-y: auto; max-height: 58vh; }
.chat-input { display: flex; gap: 10px; padding: 16px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.chat-input .input { flex: 1; }
.chat-hint { font-size: 12px; color: var(--muted-2); padding: 0 4px; }
.bubble-row { display: flex; gap: 12px; }
.bubble-row.me { flex-direction: row-reverse; }
.bubble {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.6;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
}
.bubble-row.me .bubble { background: linear-gradient(120deg, var(--space-blue-400), var(--space-blue)); color: #fff; border-color: transparent; box-shadow: var(--shadow-blue); }
.bubble-body { white-space: pre-wrap; }
.conv-list { display: flex; flex-direction: column; gap: 4px; }
.conv-item { display: block; padding: 10px 12px; border-radius: var(--radius-sm); transition: background var(--dur); }
.conv-item:hover { background: var(--surface-sunken); }
.conv-item.active { background: #E8EDFC; }
.conv-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-2); }
.live-feed { display: flex; flex-direction: column; gap: 0; max-height: 320px; overflow-y: auto; }
.live-card { padding: 4px 0; }
.feed-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--space-blue-400); margin-right: 8px; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-sunken); overflow: hidden; }
.progress-bar { height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, var(--space-blue-400), var(--space-blue)); transition: width 300ms var(--ease); }
.lane { border-left: 3px solid var(--line); padding-left: 14px; }
.lane-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lane-why { font-size: 12.5px; color: var(--muted); }

/* ---------- Marketing app-adjacent bits reused ---------------- */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.eyebrow { font-family: var(--font-head); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; color: var(--space-blue); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid, .detail-grid, .sim-grid { grid-template-columns: minmax(0, 1fr); }
  .console-wrap { grid-template-columns: minmax(0, 1fr) 300px; }
  .console-main { grid-column: 1 / -1; order: -1; }
  .console-side { order: 0; }
}
@media (max-width: 960px) {
  body.app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed;
    left: 0; top: 0;
    width: 280px;
    transform: translateX(-104%);
    transition: transform var(--dur) var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.app.nav-open .side { transform: none; }
  .main { padding: 18px 18px 48px; }
}
@media (max-width: 820px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console-wrap { grid-template-columns: minmax(0, 1fr); }
  .console-right { order: 2; }
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .sim-results, .stat-trip { grid-template-columns: minmax(0, 1fr); }
  .weight-row { grid-template-columns: minmax(0, 1fr) 56px; }
  .weight-row .w-bar { grid-column: 1 / -1; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .input, .filters .btn { width: 100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   App shell — mobile appbar + command palette
   ========================================================================== */
.appbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 8px 4px 16px;
  margin-bottom: 6px;
}
.appbar-burger {
  width: 40px; height: 40px;
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
}
.appbar-burger span { width: 16px; height: 2px; border-radius: 2px; background: var(--text-2); }
.appbar-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 700; font-size: 15px; }
.appbar-brand img { width: 26px; height: 26px; }
.appbar-cmd {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.appbar-cmd .cmd-k {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface-sunken);
  color: var(--text-2);
}
.appbar-user { flex: none; }
.appbar-user .ava { width: 38px; height: 38px; }

@media (max-width: 960px) { .appbar { display: flex; } }

/* Command palette */
.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 40px;
  background: rgba(6, 12, 24, 0.55);
  backdrop-filter: blur(6px);
  animation: cmd-fade var(--dur) var(--ease);
}
.cmd-overlay[hidden] { display: none; }
@keyframes cmd-fade { from { opacity: 0; } to { opacity: 1; } }
.cmd-modal {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cmd-pop 240ms var(--ease);
}
@keyframes cmd-pop { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }
.cmd-input {
  width: 100%;
  padding: 17px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  outline: none;
  background: var(--surface);
}
.cmd-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--dur);
}
.cmd-item:hover, .cmd-item.sel { background: #EEF2FD; }
.cmd-item .ico { background: #E8EDFC; color: var(--space-blue); }
.cmd-item b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.cmd-item em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.cmd-item[hidden] { display: none; }
.cmd-foot {
  display: flex;
  gap: 16px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11.5px;
  color: var(--muted-2);
}

/* ---------- Console extras ---------- */
.brief-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.brief-lines li { position: relative; padding-left: 18px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.brief-lines li::before { content: ""; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--space-blue-400); }
.missing { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--amber-soft); border: 1px solid #F0DCA8; }
.missing b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: #8A5A12; margin-bottom: 6px; }
.missing ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: #8A5A12; }
.feed-line { display: flex; align-items: flex-start; gap: 9px; padding: 8px 4px; font-size: 12.5px; color: var(--text-2); border-bottom: 1px solid var(--line-2); animation: flash-in 200ms var(--ease); }
.feed-line:last-child { border-bottom: 0; }
.feed-line .feed-dot { margin-top: 5px; flex: none; }
.feed-line.k-lead .feed-dot { background: var(--green); }
.feed-line.k-lane .feed-dot { background: var(--orange); }
.plan-card .lane { margin-top: 12px; border-left-color: var(--space-blue-400); }
.plan-card .lane:first-of-type { margin-top: 4px; }
.live-card .progress { margin: 0 22px 12px; }
.live-card .live-feed { padding: 4px 22px 14px; }

/* ---------- Model page extras ---------- */
.w-name b { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.w-name span { display: block; font-size: 11.5px; }
.w-bar { display: flex; align-items: center; }
.w-bar .w-fill { height: 100%; }
.howto { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: h; }
.howto li { position: relative; padding-left: 42px; font-size: 13.5px; color: var(--text-2); line-height: 1.6; counter-increment: h; }
.howto li::before {
  content: counter(h);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--space-blue-400), var(--space-blue));
  box-shadow: var(--shadow-blue);
}
.howto li b { color: var(--text); }
.prov-row b { font-size: 13.5px; font-weight: 600; }
.prov-row .small { flex: 1; text-align: right; }

/* ---------- Shared grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 820px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Sequence extras ---------- */
.seq-step b { font-size: 14px; font-weight: 600; color: var(--text); }
.seq-step p { margin-top: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.seq-step > div:last-child { min-width: 0; }

/* ---------- Code block ---------- */
.code-block {
  margin: 0;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #0A1526, var(--blueblack));
  color: #CFE0FF;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  overflow-x: auto;
  border: 1px solid rgba(140, 157, 240, 0.18);
}
.code-block::selection { background: rgba(92, 119, 232, 0.4); }

/* ---------- Auth extras ---------- */
.auth-side .logo { margin-bottom: 40px; }
.auth-side .logo img { height: 36px; width: auto; }
.auth-points div { display: flex; gap: 11px; align-items: center; font-size: 13.5px; color: var(--on-dark); }
.auth-points div i {
  width: 30px; height: 30px; flex: none;
  border-radius: 9px;
  display: grid; place-items: center;
  font-style: normal; font-size: 14px; color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.auth-box .sub { color: var(--muted); font-size: 13.5px; margin: 6px 0 22px; }
.auth-box > h1 { margin-bottom: 2px; }

/* ------------------------------------------------------- file inputs */
input[type="file"] {
  padding: 9px 12px;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(120deg, var(--space-blue-400), var(--space-blue) 55%, var(--space-blue-600));
  border: 0;
  border-radius: var(--radius-xs);
  padding: 7px 14px;
  margin-right: 12px;
  cursor: pointer;
  transition: filter var(--dur) var(--ease);
}
input[type="file"]::file-selector-button:hover { filter: brightness(1.06); }
input[type="file"]::-webkit-file-upload-button {
  font: inherit; font-weight: 600; font-size: 13px; color: #fff;
  background: var(--space-blue); border: 0; border-radius: var(--radius-xs);
  padding: 7px 14px; margin-right: 12px; cursor: pointer;
}

/* ---------- Mobile appbar: compact command trigger ---------- */
@media (max-width: 700px) {
  .appbar { gap: 10px; }
  .appbar-cmd {
    flex: 0 0 auto;
    width: 44px;
    height: 40px;
    padding: 0;
    justify-content: center;
    font-size: 0; /* hide the long label, keep the ⌘K badge */
  }
  .appbar-cmd .cmd-k { font-size: 12px; margin: 0; }
}

/* ==========================================================================
   Shell v2 — persistent appbar, search, menus, notifications, bottom nav
   ========================================================================== */

/* The appbar is now the primary chrome on every viewport (was mobile-only). */
.appbar {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 45;
  align-items: center;
  gap: 14px;
  margin: -6px -6px 16px;
  padding: 12px 6px;
  background: linear-gradient(180deg, var(--bg) 62%, rgba(244, 246, 252, 0.86) 100%);
  backdrop-filter: blur(10px);
}
.appbar-burger { display: none; }
.appbar-brand { display: none; }

/* ---------- Skip link + focus ---------- */
.skip-link {
  position: fixed;
  left: 12px; top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--space-blue);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 0; }
:focus-visible {
  outline: 2px solid var(--space-blue-400);
  outline-offset: 2px;
  border-radius: 6px;
}
.btn:focus-visible, .menu-item:focus-visible, .side-nav a:focus-visible { outline-offset: 3px; }

/* ---------- Sidebar additions ---------- */
.side-progress {
  display: block;
  margin: 4px 2px 2px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background var(--dur);
}
.side-progress:hover { background: rgba(255, 255, 255, 0.1); }
.side-progress-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--on-dark-muted); }
.side-progress-top b { color: #fff; font-weight: 700; }
.side-progress-bar { margin-top: 8px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.side-progress-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--space-blue-400), var(--orange)); transition: width 400ms var(--ease); }
.side-help {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 8px;
  border-radius: var(--radius-xs);
  font-size: 12.5px; color: var(--on-dark-muted);
  transition: background var(--dur), color var(--dur);
}
.side-help:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-help .ico { font-style: normal; }
.side-scrim {
  position: fixed; inset: 0; z-index: 39;
  background: rgba(6, 12, 24, 0.5);
  backdrop-filter: blur(2px);
  animation: cmd-fade var(--dur) var(--ease);
}
.side-scrim[hidden] { display: none; }

/* ---------- Appbar search ---------- */
.appbar-search {
  position: relative;
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(14, 27, 46, 0.04));
  transition: border-color var(--dur), box-shadow var(--dur);
}
.appbar-search:focus-within { border-color: var(--space-blue-400); box-shadow: 0 0 0 4px var(--focus); }
.appbar-search-ico { color: var(--muted-2); font-size: 16px; }
.appbar-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-family: var(--font-body); font-size: 14px; color: var(--text);
}
.appbar-search-kbd {
  font-family: var(--font-mono, monospace);
  font-size: 11px; color: var(--muted-2);
  padding: 3px 7px; border-radius: 6px;
  background: var(--surface-sunken); border: 1px solid var(--line);
}
.appbar-search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  z-index: 60;
  max-height: 60vh; overflow-y: auto;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.appbar-search-results[hidden] { display: none; }
.search-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.search-item, .notif, .menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  transition: background var(--dur);
}
.search-item:hover, .menu-item:hover, .notif:hover { background: #EEF2FD; }
.search-item .ico, .menu-item .ico {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px; font-style: normal; font-size: 14px;
  background: #E8EDFC; color: var(--space-blue);
}
.search-item b, .menu-item b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.search-item em, .menu-item em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.search-empty, .menu-empty { padding: 22px 14px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- Appbar actions & menus ---------- */
.appbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.appbar-icon {
  position: relative;
  width: 42px; height: 42px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2); font-size: 16px;
  cursor: pointer;
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.appbar-icon:hover { background: var(--surface-sunken); color: var(--space-blue); border-color: var(--line-strong); }
.appbar-icon .badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 99px;
  background: var(--orange); color: #fff;
  font-size: 10.5px; font-weight: 700;
  border: 2px solid var(--bg);
}
.appbar-user {
  width: 42px; height: 42px; padding: 0; flex: none;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer;
  display: grid; place-items: center;
}
.appbar-user .ava { width: 30px; height: 30px; }
.appbar-cmd-mobile { display: none; }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  z-index: 70;
  min-width: 244px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: cmd-pop 160ms var(--ease);
}
.menu[hidden] { display: none; }
.menu-wide { min-width: 340px; max-width: min(92vw, 380px); }
.menu-head { padding: 10px 12px; }
.menu-head b { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); }
.menu-head span { display: block; font-size: 12px; color: var(--muted); }
.menu-sep { height: 1px; margin: 6px 8px; background: var(--line); }

/* ---------- Notifications ---------- */
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif { align-items: flex-start; }
.notif-body { min-width: 0; }
.notif-body b { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.notif-body em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-body time { display: block; font-size: 11px; color: var(--muted-2); margin-top: 4px; }
.notif-dot { width: 9px; height: 9px; margin-top: 6px; flex: none; border-radius: 50%; background: var(--space-blue-400); }
.notif-orange .notif-dot { background: var(--orange); }
.notif-blue .notif-dot { background: var(--space-blue); }
.notif-grey .notif-dot { background: var(--muted-2); }

/* ---------- Command palette additions ---------- */
.cmd-group { padding: 10px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.cmd-empty { padding: 30px 16px; text-align: center; font-size: 13px; color: var(--muted); }
.cmd-modal-narrow { max-width: 460px; }

.shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 14px 16px 20px; }
.shortcut-grid > div { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.shortcut-grid kbd {
  font-family: var(--font-mono, monospace); font-size: 11px;
  padding: 3px 7px; border-radius: 6px;
  background: var(--surface-sunken); border: 1px solid var(--line); color: var(--text);
}
.shortcut-grid span { color: var(--muted); }

/* ---------- Mobile bottom nav ---------- */
.bottomnav { display: none; }

@media (max-width: 960px) {
  .appbar { margin: -4px -4px 14px; padding: 10px 4px; gap: 10px; }
  .appbar-burger { display: inline-flex; }
  .appbar-brand { display: flex; }
  .appbar-search { display: none; }
  .appbar-cmd-mobile { display: inline-grid; }
  .appbar-user { display: none; }
  body.app { padding-bottom: 72px; }
  .bottomnav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 46;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .bottomnav a, .bottomnav button {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 4px;
    border: 0; background: transparent; cursor: pointer;
    font-size: 10.5px; font-weight: 600; color: var(--muted);
    font-family: var(--font-body);
  }
  .bottomnav a .ico, .bottomnav button .ico { font-size: 17px; font-style: normal; }
  .bottomnav a.active, .bottomnav button.active { color: var(--space-blue); }
  .bottomnav-add {
    flex: 0 0 auto !important;
    width: 52px; height: 52px; margin: -18px 10px 0;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--space-blue-400), var(--space-blue)) !important;
    color: #fff !important;
    box-shadow: var(--shadow-blue);
  }
  .bottomnav-add .ico { font-size: 22px !important; }
  .bottomnav-add span:not(.ico) { display: none; }
}

@media (max-width: 560px) {
  .shortcut-grid { grid-template-columns: minmax(0, 1fr); }
  .menu, .menu-wide { right: -6px; }
}

/* ==========================================================================
   Workspace components — onboarding, tabs, timeline, bulk bar, pager, empty
   ========================================================================== */

/* Onboarding checklist */
.checklist { display: grid; gap: 10px; }
.check-item {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  transition: border-color var(--dur), background var(--dur);
}
.check-item:hover { border-color: var(--line-strong); background: var(--surface); }
.check-item.done { opacity: 0.72; }
.check-box {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1.5px solid var(--line-strong);
  font-size: 13px; color: var(--muted-2);
  background: var(--surface);
}
.check-item.done .check-box { background: var(--green-soft); border-color: transparent; color: var(--green); }
.check-body { min-width: 0; flex: 1; }
.check-body b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.check-body span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.check-item.done .check-body b { text-decoration: line-through; text-decoration-color: var(--muted-2); }
.check-go { flex: none; font-size: 12.5px; font-weight: 600; color: var(--space-blue); }

/* Goal ring */
.goal-ring {
  --p: 0;
  width: 128px; height: 128px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--orange) calc(var(--p) * 1%), var(--surface-sunken) 0);
  position: relative;
}
.goal-ring::before {
  content: ""; position: absolute; inset: 11px;
  border-radius: 50%; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.goal-ring > div { position: relative; text-align: center; }
.goal-ring b { display: block; font-family: var(--font-head); font-size: 27px; font-weight: 700; color: var(--text); line-height: 1; }
.goal-ring span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* Trend chips */
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; }
.trend-up { color: var(--green); background: var(--green-soft); }
.trend-down { color: var(--red); background: var(--red-soft, #FCE9EA); }
.trend-flat { color: var(--muted); background: var(--surface-sunken); }

/* Activity feed */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line-2); }
.feed-item:last-child { border-bottom: 0; }
.feed-ico {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border-radius: 9px; background: #E8EDFC; color: var(--space-blue); font-size: 13px;
}
.feed-body { min-width: 0; }
.feed-body b { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.feed-body span { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.feed-body time { display: block; font-size: 11px; color: var(--muted-2); margin-top: 4px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 11px 15px; margin-bottom: -1px;
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color var(--dur), border-color var(--dur);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--space-blue); border-bottom-color: var(--space-blue); }
.tab-panel[hidden] { display: none; }

/* Bulk action bar */
.bulkbar {
  position: sticky; bottom: 16px; z-index: 30;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 14px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--ink), var(--blueblack));
  color: var(--on-dark);
  box-shadow: var(--shadow-lg);
  animation: cmd-pop 200ms var(--ease);
}
.bulkbar[hidden] { display: none; }
.bulkbar b { font-size: 13.5px; font-weight: 600; }
.bulkbar .spacer { flex: 1; }
.bulkbar select, .bulkbar input {
  font-family: var(--font-body); font-size: 13px;
  padding: 7px 10px; border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08); color: #fff;
}
.bulkbar option { color: #111; }

/* Saved-view chips + pager */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line);
  transition: all var(--dur);
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.active { background: var(--space-blue); border-color: var(--space-blue); color: #fff; }
.chip.saved { border-style: dashed; }
.chip-x { font-style: normal; opacity: 0.6; }
.pager { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-top: 14px; flex-wrap: wrap; }
.pager-info { font-size: 12.5px; color: var(--muted); }
.pager-nav { display: flex; gap: 6px; align-items: center; }
.pager-nav a, .pager-nav span {
  min-width: 34px; height: 34px; padding: 0 10px;
  display: inline-grid; place-items: center;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--text-2);
}
.pager-nav a:hover { border-color: var(--line-strong); color: var(--space-blue); }
.pager-nav .cur { background: var(--space-blue); border-color: var(--space-blue); color: #fff; }
.pager-nav .off { opacity: 0.45; }

/* Sortable table headers */
th.sortable a { display: inline-flex; align-items: center; gap: 5px; color: inherit; }
th.sortable .dir { font-size: 10px; opacity: 0.55; }
.row-check { width: 16px; height: 16px; accent-color: var(--space-blue); cursor: pointer; }

/* Timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-ico {
  position: absolute; left: -26px; top: 0;
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line-strong);
  font-size: 9px; color: var(--muted);
}
.tl-item.t-note .tl-ico { border-color: var(--space-blue-400); color: var(--space-blue); }
.tl-item.t-meeting .tl-ico, .tl-item.t-meeting_booked .tl-ico { border-color: var(--orange); color: var(--orange); }
.tl-item.t-signal .tl-ico { border-color: var(--green); color: var(--green); }
.tl-body b { font-size: 13px; font-weight: 600; color: var(--text); }
.tl-body p { margin: 3px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.tl-body time { display: block; font-size: 11px; color: var(--muted-2); margin-top: 3px; }
.composer { margin-top: 4px; }
.composer-tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.composer-tab {
  appearance: none; cursor: pointer; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2);
  padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  font-family: var(--font-body);
}
.composer-tab.active { background: var(--space-blue); border-color: var(--space-blue); color: #fff; }

/* Copyable + info tiles */
.copy-row { display: flex; align-items: center; gap: 8px; }
.copy-btn {
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; color: var(--muted);
  display: grid; place-items: center; font-size: 12px;
}
.copy-btn:hover { color: var(--space-blue); border-color: var(--line-strong); }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a:hover { color: var(--space-blue); }
.breadcrumb .sep { opacity: 0.5; }

/* Empty states */
.empty { text-align: center; padding: 46px 22px; }
.empty-ico {
  width: 56px; height: 56px; margin: 0 auto 16px;
  display: grid; place-items: center; border-radius: 16px;
  background: #E8EDFC; color: var(--space-blue); font-size: 24px;
}
.empty h3 { font-family: var(--font-head); font-size: 17px; font-weight: 700; color: var(--text); }
.empty p { margin: 7px auto 0; max-width: 420px; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.empty .btn { margin-top: 18px; }

/* Danger zone */
.danger-zone { border: 1px solid #F2C6C8; border-radius: var(--radius); padding: 18px 20px; background: #FEF7F7; }
.danger-zone h3 { color: var(--red); }

/* Dashboard-specific */
.onboard-progress { height: 8px; border-radius: 99px; background: var(--surface-sunken); overflow: hidden; }
.onboard-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--space-blue-400), var(--orange)); transition: width 500ms var(--ease); }
.goal-card { display: flex; align-items: center; gap: 24px; }
.goal-copy { min-width: 0; }
.goal-copy p { font-size: 14px; color: var(--text-2); line-height: 1.6; }
.goal-copy p b { color: var(--text); }
.goal-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
#getting-started { margin-bottom: 18px; }
@media (max-width: 560px) {
  .goal-card { flex-direction: column; align-items: flex-start; gap: 18px; }
}

/* ==========================================================================
   Leads workspace + create form
   ========================================================================== */
.viewbar { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.viewbar .chips { flex: 1; }
.chip-on { background: var(--space-blue); border-color: var(--space-blue); color: #fff; }
.chip-on:hover { color: #fff; border-color: var(--space-blue); }
.chip-saved { border-style: dashed; }
.chip-holder { display: inline-flex; align-items: center; }
.chip-holder form { margin: 0; }
.chip-holder .chip { border-top-right-radius: 0; border-bottom-right-radius: 0; padding-right: 8px; }
.chip-x {
  appearance: none; cursor: pointer; font: inherit; line-height: 1;
  border: 1px solid var(--line); border-left: 0; background: var(--surface);
  color: var(--muted); padding: 6px 9px; border-radius: 0 99px 99px 0;
  font-size: 14px; transition: all var(--dur);
}
.chip-x:hover { color: #C2321C; border-color: #F2C6C8; background: #FEF7F7; }

.input-sm { font-size: 12.5px; padding: 7px 10px; }
.input-xs { font-size: 12px; padding: 5px 8px; border-radius: var(--radius-xs); max-width: 130px; }

.table-card { overflow-x: auto; }
.table-leads { min-width: 940px; }
.table-leads thead th { white-space: nowrap; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.th-check { width: 40px; text-align: center; }
.th-check input, .row-check { width: 15px; height: 15px; accent-color: var(--space-blue); cursor: pointer; }
.th-sort { display: inline-flex; align-items: center; gap: 5px; color: inherit; font: inherit; }
.th-sort:hover { color: var(--space-blue); }
.th-sort .so { font-size: 10px; opacity: 0.6; }
.th-actions, .td-actions { width: 74px; text-align: right; }
.table-leads tbody tr:hover { background: var(--surface-sunken); }
.table-leads tbody tr.selected { background: #EEF2FE; }
.td-name b { font-size: 13.5px; }
.co { font-weight: 500; color: var(--text); }
.owner-dot {
  display: inline-grid; place-items: center; width: 17px; height: 17px;
  border-radius: 50%; background: var(--blueblack); color: #fff;
  font-size: 10px; font-weight: 700; vertical-align: -3px; margin-left: 2px;
}
.td-tags { max-width: 210px; }
.tag {
  display: inline-block; margin: 1px 3px 1px 0; padding: 2px 7px;
  border-radius: 99px; background: #EEF2FE; color: var(--space-blue);
  font-size: 11.5px; font-weight: 600;
}
.tag:hover { background: #E0E7FD; }
.row-actions { display: inline-flex; gap: 4px; }
.icon-btn {
  appearance: none; cursor: pointer; width: 30px; height: 30px;
  display: inline-grid; place-items: center; font-size: 13px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: var(--radius-xs); transition: all var(--dur);
}
.icon-btn:hover { color: var(--space-blue); border-color: var(--line-strong); }

.bulkbar-count { font-size: 13px; }
.bulkbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.pagbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 5px; }
.pg {
  min-width: 34px; height: 34px; padding: 0 10px;
  display: inline-grid; place-items: center; border-radius: var(--radius-xs);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--text-2); transition: all var(--dur);
}
.pg:hover { border-color: var(--line-strong); color: var(--space-blue); }
.pg-on, .pg-on:hover { background: var(--space-blue); border-color: var(--space-blue); color: #fff; }
.pg-off { opacity: 0.45; pointer-events: none; }
.pg-gap { color: var(--muted); padding: 0 2px; }

.saveview { margin-top: 18px; }
.saveview-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.saveview-form .input { min-width: 200px; }

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.crumbs a:hover { color: var(--space-blue); }
.crumbs .cur { color: var(--text); font-weight: 600; }

.form-stack .field span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.check-list { list-style: none; margin: 14px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check-item { display: flex; gap: 10px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.check-item b { color: var(--text); }
.check-ico { color: var(--orange); font-size: 11px; margin-top: 2px; }
.check-ico .bsi { width: 14px; height: 14px; }

.btn-danger {
  background: #C2321C; border: 1px solid #C2321C; color: #fff;
  padding: 9px 16px; border-radius: var(--radius-xs); font: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--dur);
}
.btn-danger:hover { background: #A82A16; border-color: #A82A16; }

.empty-state { text-align: center; }
.empty-state h3 { font-family: var(--font-head); font-size: 17px; font-weight: 700; margin-top: 4px; }
.empty-state p { margin: 7px auto 0; max-width: 440px; line-height: 1.6; }
.empty-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

@media (max-width: 700px) {
  .field-row { grid-template-columns: 1fr; }
  .pagbar { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   Lead detail
   ========================================================================== */
.lead-head { align-items: center; }
.lead-identity { display: flex; align-items: center; gap: 16px; }
.lead-identity h1 { margin: 0; }
.lead-identity .sub { margin-top: 3px; }
.lead-ring {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: conic-gradient(var(--rc, var(--space-blue)) calc(var(--p, 0) * 1%), var(--surface-sunken) 0);
  position: relative; flex: none;
}
.lead-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.lead-ring b { position: relative; font-family: var(--font-head); font-size: 18px; font-weight: 700; line-height: 1; }
.lead-ring span { position: relative; font-size: 8.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.nba-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px; margin-bottom: 18px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(120deg, #EEF2FE, var(--surface));
  box-shadow: var(--shadow-sm);
}
.nba-ico {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 12px; background: var(--space-blue); color: #fff; font-size: 18px;
}
.nba-copy { min-width: 0; flex: 1; }
.nba-kicker { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--space-blue); margin-bottom: 3px; }
.nba-copy b { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.4; }
.nba-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }

.narr-line { font-size: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); color: var(--text-2); line-height: 1.6; }
.narr-line:last-child { border-bottom: 0; }

.contact-grid { display: grid; gap: 10px; font-size: 13.5px; }
.copy-row { display: flex; align-items: center; gap: 10px; }
.copy-row .ck { width: 78px; flex: none; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.copy-row .cv { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.copy-btn {
  appearance: none; cursor: pointer; flex: none;
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  display: grid; place-items: center; font-size: 12px; transition: all var(--dur);
}
.copy-btn:hover { color: var(--space-blue); border-color: var(--line-strong); }

.tag-edit { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 6px 3px 9px; border-radius: 99px;
  background: #EEF2FE; color: var(--space-blue); font-size: 12px; font-weight: 600;
}
.tag-del { appearance: none; border: 0; background: transparent; cursor: pointer; color: inherit; opacity: 0.55; font-size: 13px; line-height: 1; padding: 0 2px; }
.tag-del:hover { opacity: 1; color: #C2321C; }
.tag-input { width: 96px; }

.composer-actions { display: flex; align-items: center; gap: 12px; margin: 10px 0 22px; }
.draft-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.draft-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
#draft-out { margin-top: 4px; }

@media (max-width: 620px) {
  .nba-card { flex-direction: column; align-items: flex-start; }
  .nba-actions { width: 100%; }
}

/* Inline SVG icon sizing */
.ico .svg-ico { width: 14px; height: 14px; display: block; }
.bottomnav .ico .svg-ico { width: 18px; height: 18px; }
.bottomnav-add .ico .svg-ico { width: 22px; height: 22px; }
.menu-item .ico .svg-ico, .cmd-item .ico .svg-ico { width: 16px; height: 16px; }

/* ---------------- Help & docs ---------------- */
.help-layout { display: grid; grid-template-columns: 232px 1fr; gap: 24px; align-items: start; }
.help-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.help-nav a { display: block; padding: 9px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 550; color: var(--muted); text-decoration: none; }
.help-nav a:hover { background: var(--surface-sunken); color: var(--ink); }
.help-nav a.active { background: var(--space-blue-soft); color: var(--space-blue); }
.help-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.help-sec { scroll-margin-top: 16px; }
.help-prose { font-size: 14px; line-height: 1.65; color: var(--ink-soft, var(--ink)); display: grid; gap: 12px; }
.help-prose p { margin: 0; }
.help-prose a { color: var(--space-blue); font-weight: 600; text-decoration: none; }
.help-prose a:hover { text-decoration: underline; }
.help-prose ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.help-steps { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.help-steps li { padding-left: 4px; }
.help-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.help-tile { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-sunken); }
.help-tile b { font-size: 13.5px; color: var(--ink); }
.help-tile span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.help-note { padding: 12px 14px; border-left: 3px solid var(--space-blue); background: var(--space-blue-soft); border-radius: 0 10px 10px 0; font-size: 13px; color: var(--ink); }
.help-status-list { display: flex; flex-wrap: wrap; gap: 10px; }
.help-faq { border-top: 1px solid var(--line); padding: 12px 0; }
.help-faq:first-child { border-top: 0; }
.help-faq summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 8px; }
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::before { content: "+"; display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; border-radius: 6px; background: var(--space-blue-soft); color: var(--space-blue); font-size: 14px; }
.help-faq[open] summary::before { content: "\2212"; }
.help-faq p { margin: 8px 0 0 26px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.help-contact { background: linear-gradient(135deg, var(--space-blue-soft), var(--surface)); }

/* status pills */
.pill-new { background: var(--surface-sunken); color: var(--muted); }
.pill-working { background: #E8EDFC; color: #2B50C7; }
.pill-engaged { background: var(--space-blue-soft); color: var(--space-blue); }
.pill-meeting_booked { background: var(--green-soft); color: #0C6B44; }
.pill-won { background: #DCFCE7; color: #15803D; }
.pill-lost { background: #FEE2E2; color: #B91C1C; }
.pill-nurture { background: #FEF3C7; color: #B45309; }

@media (max-width: 860px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-nav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; }
  .help-nav a { white-space: nowrap; }
  .help-grid { grid-template-columns: 1fr; }
}

/* ---------------- Settings additions ---------------- */
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { color: var(--ink); text-align: right; }
.pref-list { display: grid; gap: 10px; }
.pref { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-sunken); cursor: pointer; }
.pref input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--space-blue); flex: none; }
.pref span { display: grid; gap: 3px; }
.pref b { font-size: 13.5px; color: var(--ink); }
.pref em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.stack-sm { display: grid; gap: 10px; justify-items: start; }
.danger-card { border: 1px solid #F3C9C9; }
.danger-card .card-title h2 { color: #B91C1C; }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.danger-row:last-of-type { border-bottom: 0; }
.danger-row b { font-size: 13.5px; color: var(--ink); }
.danger-row p { margin-top: 4px; max-width: 60ch; }
.btn-danger { background: #B91C1C; color: #fff; border-color: #B91C1C; }
.btn-danger:hover { background: #991B1B; border-color: #991B1B; color: #fff; }
@media (max-width: 640px) { .danger-row { flex-direction: column; align-items: flex-start; } }

/* ---------- u7: sequences presets, step editing, simulator plans, analytics ranges ---------- */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.preset-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; margin: 0;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-align: left; transition: border-color .15s, box-shadow .15s, transform .15s; }
.preset-card:hover { border-color: var(--space-blue-300); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.preset-head { display: flex; gap: 10px; align-items: flex-start; }
.preset-icon { flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--radius-xs); background: rgba(49, 72, 185, 0.1); color: var(--space-blue); font-size: 16px; }
.preset-head b { display: block; font-size: 14px; color: var(--text); }
.preset-channel { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; }
.preset-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.55; flex: 1; }
.preset-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.preset-count { font-size: 12px; color: var(--muted); font-weight: 600; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--text); }

.empty-state { text-align: center; padding: 34px 20px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; }
.empty-state b { font-family: var(--font-head); font-size: 15px; color: var(--text); }
.empty-state p { max-width: 42ch; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.empty-glyph { font-size: 22px; color: var(--space-blue-300); margin-bottom: 4px; }

.step-actions { display: flex; gap: 8px; margin-top: 10px; }
.step-actions form { margin: 0; }
.step-edit-form { margin-top: 12px; padding: 14px; background: var(--surface-sunken);
  border: 1px solid var(--line); border-radius: var(--radius-sm); }

.plan-row .q-sig { align-items: flex-end; gap: 8px; }
.plan-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.verdict-pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .03em; }
.verdict-pill.v-go { background: var(--green-soft); color: var(--green); }
.verdict-pill.v-fix { background: var(--amber-soft); color: var(--amber); }
.verdict-pill.v-kill { background: var(--red-soft); color: var(--red); }

.cmp-table table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.cmp-table th, .cmp-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
.cmp-table th { font-family: var(--font-head); font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); }
.cmp-table td:first-child { color: var(--muted); font-weight: 600; }
.cmp-table tbody tr:hover { background: var(--surface-2); }

@media (max-width: 640px) {
  .preset-grid { grid-template-columns: 1fr; }
  .plan-row .q-sig { align-items: flex-start; }
}

/* ---------- u8: empty states + error pages ---------- */
.empty-compact { padding: 22px 14px; }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.empty-state .empty-actions .btn { margin: 0; }

/* ---- inline SVG icon system (font-independent) ------------------------- */
.bsi { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex: none; }
.icon-badge .bsi { width: 24px; height: 24px; vertical-align: 0; }
.brief-kind .bsi { width: 17px; height: 17px; vertical-align: 0; }
.empty-ico .bsi { width: 24px; height: 24px; vertical-align: 0; }
.preset-icon .bsi { width: 18px; height: 18px; vertical-align: 0; }
.auth-points i .bsi { width: 16px; height: 16px; vertical-align: 0; }
.empty-glyph .bsi { width: 1em; height: 1em; display: block; }
.btn .bsi { width: 15px; height: 15px; vertical-align: -2px; }
.check-box .bsi { width: 12px; height: 12px; vertical-align: 0; }
.copy-btn .bsi, .icon-btn .bsi { width: 15px; height: 15px; vertical-align: -2px; }
.ico-svg { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
.ico-ok { color: #1D7A3E; }
.ico-bad { color: #C0392B; }

/* ---- app-shell SVG icons: defensive default size + quick-create button ----- */
/* The ico() macro emits a bare <svg class="svg-ico"> with no width/height; this
   default keeps any un-styled occurrence sane, while the rules in the shell
   section (.ico .svg-ico, .bottomnav .ico .svg-ico, …) override it per context. */
.svg-ico { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.2em; }
#quick-new { display: inline-flex; align-items: center; gap: 5px; }
.qnew-ico { display: inline-flex; align-items: center; }
.qnew-ico .svg-ico { width: 15px; height: 15px; }
.appbar-search-ico .svg-ico { width: 16px; height: 16px; }

/* Compact appbar on phones: keep the brand on one line and the controls reachable */
@media (max-width: 560px) {
  .appbar { gap: 6px; padding-left: 2px; padding-right: 2px; }
  .appbar-brand { gap: 6px; }
  .appbar-brand img { width: 22px; height: 22px; }
  .appbar-brand b { white-space: nowrap; font-size: 13.5px; letter-spacing: -0.2px; }
  .appbar-actions { gap: 6px; }
  .appbar-icon { width: 34px; height: 34px; }
  .qnew-txt { display: none; }
  #quick-new { padding: 8px 10px; }
}

/* ---- Leads table → stacked cards on phones ---------------------------------
   The desktop grid is 10 columns wide (min-width 940px). Below 700px we flip
   each row into a card so nothing is cut off or hidden behind a horizontal
   scroll: name + score on the first line, company/email under it, then the
   status control, tags and row actions. Industry / Band / Added stay in the
   desktop and tablet views.                                                */
@media (max-width: 700px) {
  .table-card { overflow-x: visible; }
  .table-leads { min-width: 0; }
  .table-leads thead { display: none; }
  .table-leads tbody tr {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--line-2);
  }
  .table-leads tbody td { padding: 0; border: 0; }
  .table-leads tbody tr:last-child { border-bottom: 0; }
  .table-leads .th-check { grid-column: 1; grid-row: 1; width: auto; }
  .table-leads .td-name { grid-column: 2; grid-row: 1; }
  .table-leads tbody td:nth-child(5) { grid-column: 3; grid-row: 1; justify-self: end; }
  .table-leads tbody td:nth-child(3) { grid-column: 2 / 4; grid-row: 2; }
  .table-leads tbody td:nth-child(7) { grid-column: 1 / 3; grid-row: 3; }
  .table-leads tbody td:nth-child(8) { grid-column: 1 / 4; grid-row: 4; }
  .table-leads tbody td:nth-child(4),
  .table-leads tbody td:nth-child(6),
  .table-leads tbody td:nth-child(9) { display: none; }
  .table-leads .td-actions { grid-column: 3; grid-row: 3; justify-self: end; width: auto; }
  .table-leads .row-status { width: 100%; }
  .table-leads .td-tags { max-width: none; }
  .table-card { border-radius: var(--radius); }
}

/* ==========================================================================
   Conversation Console v2 — folders, large composer, enrichment, cadence
   ========================================================================== */
.console-topbar { align-items: flex-start; }
.console-topbar .topbar-actions { flex-wrap: wrap; gap: 8px; }

.console-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; gap: 18px; align-items: start; }

/* ---- Sidebar ---- */
.conv-side-card { padding-bottom: 8px; }
.conv-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 108px; gap: 8px; padding: 0 14px 10px; }
.conv-search { min-width: 0; }
.folder-tree { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px 8px; border-bottom: 1px solid var(--line-2); }
.folder-row-wrap { position: relative; }
.folder-row {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; background: transparent; border-radius: var(--radius-sm);
  font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; transition: background var(--dur);
}
.folder-row:hover { background: var(--surface-sunken); }
.folder-row.active { background: #E8EDFC; color: var(--space-blue); font-weight: 600; }
.folder-ico { width: 16px; text-align: center; font-size: 12px; flex: none; }
.folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-n { font-size: 11px; color: var(--muted-2); background: var(--surface-sunken); border-radius: 99px; padding: 1px 7px; }
.folder-row.active .folder-n { background: #fff; }

.conv-list { display: flex; flex-direction: column; gap: 2px; padding: 8px; max-height: 52vh; overflow-y: auto; }
.conv-item { position: relative; display: flex; align-items: stretch; border-radius: var(--radius-sm); }
.conv-item:hover { background: var(--surface-sunken); }
.conv-item.active { background: #E8EDFC; }
.conv-link { flex: 1; min-width: 0; padding: 9px 8px 9px 12px; display: block; }
.conv-title { display: block; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item.active .conv-title { color: var(--space-blue); }
.pin-dot { color: var(--orange); font-size: 11px; }
.conv-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; font-size: 11px; color: var(--muted-2); }
.conv-status { font-style: normal; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; font-size: 9.5px; padding: 1px 6px; border-radius: 99px; background: var(--surface-sunken); color: var(--muted); }
.conv-status.status-ready { background: var(--space-blue-soft, #E8EDFC); color: var(--space-blue); }
.conv-status.status-delivered { background: var(--green-soft); color: #0C6B44; }
.conv-empty { padding: 14px 12px; }
.row-menu-wrap { position: relative; display: flex; align-items: center; }
.row-kebab {
  border: 0; background: transparent; color: var(--muted-2); font-size: 16px; line-height: 1;
  padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; opacity: 0; transition: opacity var(--dur), background var(--dur);
}
.conv-item:hover .row-kebab, .folder-row-wrap:hover .row-kebab, .folder-row-wrap:focus-within .row-kebab, .conv-item:focus-within .row-kebab { opacity: 1; }
.row-kebab:hover { background: var(--surface); color: var(--space-blue); }
.menu-sm { min-width: 180px; font-size: 13px; }
.menu-danger b { color: var(--red); }
.menu-head .muted { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; }

/* ---- Composer ---- */
.chat-suggest { display: flex; flex-direction: column; gap: 8px; padding: 6px 2px; }
.suggest-chip {
  text-align: left; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2);
  padding: 10px 14px; border-radius: var(--radius-sm); font: inherit; font-size: 13px; cursor: pointer; transition: border-color var(--dur), background var(--dur);
}
.suggest-chip:hover { border-color: var(--space-blue-400); background: #F5F7FE; color: var(--space-blue); }

.composer { border-top: 1px solid var(--line-2); background: var(--surface-2); padding: 12px 16px 8px; display: flex; flex-direction: column; gap: 8px; }
.composer-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.composer-chips:empty { display: none; }
.composer-box {
  width: 100%; resize: none; border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 12px 14px; font: inherit; font-size: 14px; line-height: 1.55; color: var(--text);
  background: var(--surface); min-height: 46px; max-height: 260px; overflow-y: auto; transition: border-color var(--dur), box-shadow var(--dur);
}
.composer-box:focus { outline: 0; border-color: var(--space-blue-400); box-shadow: 0 0 0 3px var(--focus); }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.composer-send { padding: 9px 22px; }
.chip-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px;
  padding: 6px 11px; border-radius: 99px; cursor: pointer; transition: border-color var(--dur), color var(--dur);
}
.chip-btn:hover { border-color: var(--space-blue-400); color: var(--space-blue); }
.composer-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.composer-hint { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted-2); padding: 6px 16px 0; }
.composer-hint b { color: var(--text-2); font-weight: 600; }

/* ---- Segmented control ---- */
.seg { display: inline-flex; background: var(--surface-sunken); border-radius: 99px; padding: 3px; gap: 2px; width: 100%; }
.seg-btn { flex: 1; border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); padding: 7px 10px; border-radius: 99px; cursor: pointer; transition: background var(--dur), color var(--dur); }
.seg-btn.active { background: var(--surface); color: var(--space-blue); box-shadow: var(--shadow-xs, 0 1px 2px rgba(11,24,40,.08)); }

/* ---- Enrichment ---- */
.enrich-ops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; }
.op-check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); cursor: pointer; padding: 3px 0; }
.op-check input { accent-color: var(--space-blue); width: 14px; height: 14px; }
.enrich-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.paste-area { width: 100%; margin-top: 10px; font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12px; resize: vertical; }
.enrich-paste-actions { display: flex; gap: 6px; margin-top: 8px; }
.batch-head { margin: 6px 0 8px; }
.batch-list { display: flex; flex-direction: column; gap: 10px; }
.batch-item { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px; }
.batch-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.batch-name { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.batch-links { display: flex; gap: 10px; }
.linkbtn { border: 0; background: transparent; color: var(--space-blue); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; text-decoration: none; }
.linkbtn:hover { text-decoration: underline; }
.pill-sm { font-size: 10px; padding: 2px 8px; }
.pill-green { background: var(--green-soft); color: #0C6B44; }
.pill-amber { background: var(--amber-soft); color: #8A5A12; }
.pill-muted { background: var(--surface-sunken); color: var(--muted); }
.status-queued { background: var(--surface-sunken); color: var(--muted); }
.status-running { background: #E8EDFC; color: #2B50C7; }
.status-done { background: var(--green-soft); color: #0C6B44; }
.status-error { background: #FEE2E2; color: #B91C1C; }

/* ---- Cadence ---- */
.field { display: block; margin-bottom: 12px; }
.field-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.switch-row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); margin-bottom: 14px; cursor: pointer; }
.switch-row input { accent-color: var(--space-blue); width: 16px; height: 16px; }
.cadence-next { margin-top: 10px; }

/* ---- Enrichment results modal ---- */
.cmd-modal-wide { max-width: 1040px; width: 94vw; }
.batch-table-wrap { max-height: 62vh; overflow: auto; padding: 4px 18px 18px; }
.batch-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.batch-table th, .batch-table td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.batch-table th { position: sticky; top: 0; background: var(--surface); text-transform: uppercase; font-size: 10px; letter-spacing: 0.06em; color: var(--muted); z-index: 1; }
.batch-table tbody tr:hover { background: var(--surface-2); }

/* ---- Responsive ---- */
@media (max-width: 1180px) {
  .console-wrap { grid-template-columns: 260px minmax(0, 1fr) 320px; }
}
@media (max-width: 1024px) {
  .console-wrap { grid-template-columns: minmax(0, 1fr) 340px; }
  .console-side { grid-column: 1 / -1; }
  .conv-list { max-height: 300px; }
}
@media (max-width: 780px) {
  .console-wrap { grid-template-columns: minmax(0, 1fr); }
  .console-side, .console-right { grid-column: auto; }
  .chat-thread { max-height: 46vh; }
  .composer-hint { flex-direction: column; gap: 4px; }
}

/* ensure [hidden] always wins over component display rules */
[hidden] { display: none !important; }

/* ==========================================================================
   Capture / omnichannel ingest (sources page + dashboard live-capture card)
   ========================================================================== */

/* ---- live indicator ---- */
.live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 10px;
  border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: #0C6B44; background: var(--green-soft);
  border: 1px solid #BEE7D2; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(23, 145, 92, 0.5); animation: live-pulse 2.2s infinite; }
.live-pill.ping .live-dot { animation: live-ping 0.9s ease; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(23,145,92,0.45); } 70% { box-shadow: 0 0 0 7px rgba(23,145,92,0); } 100% { box-shadow: 0 0 0 0 rgba(23,145,92,0); } }
@keyframes live-ping { 0% { transform: scale(1); } 40% { transform: scale(1.9); } 100% { transform: scale(1); } }

/* ---- capture simulator ---- */
.sim-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 14px; align-items: end; }
.sim-row .field { margin-bottom: 0; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.sim-actions { display: flex; }
.sim-actions .btn { width: 100%; }

/* ---- dashboard live-capture strip ---- */
.cap-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cap-summary .chip { background: var(--surface-sunken); }
.cap-stream { display: flex; flex-direction: column; }
.cap-visit { display: flex; align-items: center; gap: 12px; padding: 11px 4px;
  border-bottom: 1px solid var(--line-2); transition: background var(--dur); }
.cap-visit:last-child { border-bottom: 0; }
.cap-visit:hover { background: var(--surface-2); }
.cap-visit-body { flex: 1; min-width: 0; }
.cap-visit-body b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.cap-visit-body span { display: block; font-size: 12.5px; margin-top: 2px; }

/* ---- avatar ---- */
.visit-ava { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid;
  place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 14px;
  color: #fff; background: linear-gradient(135deg, var(--space-blue), var(--space-blue-400)); }

/* ---- de-anonymization stream ---- */
.visits-list { display: flex; flex-direction: column; gap: 12px; }
.visit-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  background: var(--surface-2); transition: border-color var(--dur), box-shadow var(--dur); }
.visit-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.visit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.visit-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.visit-id b { font-size: 14px; font-weight: 700; color: var(--text); }
.visit-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.visit-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 11px 0 0; }
.visit-meta .chip { padding: 4px 10px; font-size: 11.5px; }
.visit-summary { margin-top: 10px; color: var(--text-2); line-height: 1.55; }
.visit-foot { margin-top: 12px; }

/* ---- contact points ---- */
.contact-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.contact-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 99px; font-size: 12px; font-weight: 600;
  background: #E8EDFC; color: #26398F; border: 1px solid #CFD8F7; }
.contact-chip.c-email { background: #E5F6ED; color: #0C6B44; border-color: #BEE7D2; }
.contact-chip.c-phone { background: var(--orange-soft, #FCEDE6); color: #B23C0C; border-color: #F6D3C2; }
.contact-chip.c-company { background: var(--surface-sunken); color: var(--text-2); border-color: var(--line); }

/* ---- resolution trace ---- */
.trace { margin-top: 12px; border-top: 1px dashed var(--line-strong); padding-top: 10px; }
.trace > summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--space-blue);
  text-transform: uppercase; letter-spacing: 0.05em; list-style: none; }
.trace > summary::-webkit-details-marker { display: none; }
.trace > summary::before { content: "▸ "; }
.trace[open] > summary::before { content: "▾ "; }
.trace-steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.trace-step { display: grid; grid-template-columns: 22px minmax(0, 1fr) 46px; gap: 10px;
  align-items: start; padding: 7px 0; position: relative; }
.trace-step:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 26px; bottom: -6px;
  width: 1px; background: var(--line); }
.trace-ico { font-size: 12px; color: var(--space-blue-400); line-height: 1.5; }
.trace-body b { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); }
.trace-body span { display: block; margin-top: 1px; }
.trace-conf { text-align: right; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  color: var(--muted); padding-top: 1px; }
.trace-step.s-identity .trace-ico,
.trace-step.s-match .trace-ico,
.trace-step.s-enrich .trace-ico { color: var(--green); }
.trace-step.s-classify .trace-ico,
.trace-step.s-behaviour .trace-ico { color: var(--orange); }
.trace-step.s-contactability .trace-ico { color: var(--space-blue); }

/* ---- fabric summary bars ---- */
.fam-summary { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.fam-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 42px; gap: 12px; align-items: center; }
.fam-name { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.fam-bar { height: 8px; border-radius: 99px; background: var(--surface-sunken); overflow: hidden; }
.fam-bar > i { display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--space-blue-400), var(--space-blue)); transition: width 300ms var(--ease); }
.fam-row .small.muted { text-align: right; }

/* ---- channel grid ---- */
.fam-block { margin-bottom: 26px; }
.fam-block:last-child { margin-bottom: 0; }
.fam-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.fam-head h3 { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--text); }
.fam-head p { margin-top: 2px; max-width: 70ch; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.src-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px;
  background: var(--surface); display: flex; flex-direction: column; gap: 10px;
  transition: border-color var(--dur), box-shadow var(--dur); }
.src-card.on { border-color: #CFD8F7; }
.src-card.off { background: var(--surface-2); opacity: 0.86; }
.src-card:hover { box-shadow: var(--shadow-sm); }
.src-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.src-name b { font-size: 14px; font-weight: 700; color: var(--text); }
.src-name .small { margin-top: 2px; }
.src-blurb { color: var(--text-2); line-height: 1.5; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.tiny { padding: 3px 9px; font-size: 11px; font-weight: 600; cursor: default; }
.chip.ghost { background: transparent; border-style: dashed; color: var(--muted); }
.src-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.src-foot form { margin: 0; }

/* ---- badge variants ---- */
.badge.b-b2b { background: #E8EDFC; color: #26398F; border-color: #CFD8F7; }
.badge.b-b2c { background: #FCE9F0; color: #A3246A; border-color: #F4C9DD; }
.badge.b-info { background: var(--surface-sunken); color: var(--muted); }
.badge.b-conf { background: var(--amber-soft); color: #8A5A12; border-color: #F0DCA8; }

/* ---- lead detail: attribution + identities ---- */
.ident-head { display: flex; align-items: baseline; justify-content: space-between;
  margin: 16px 0 4px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.ident-head b { font-size: 13px; font-weight: 700; color: var(--text); }
.ident-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; }
.ident-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.ident-item:last-child { border-bottom: 0; }
.ident-body { flex: 1; min-width: 0; }
.ident-body b { display: block; font-size: 12.5px; font-weight: 600; color: var(--text);
  overflow-wrap: anywhere; }
.ident-body span { display: block; margin-top: 1px; }

/* ---- static feed row ---- */
.feed-item.static { cursor: default; }
.feed-item.static:hover { background: transparent; }

/* ---- responsive ---- */
@media (max-width: 1024px) {
  .sim-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sim-actions { grid-column: 1 / -1; }
}
@media (max-width: 780px) {
  .sim-row { grid-template-columns: minmax(0, 1fr); }
  .visit-head { flex-direction: column; }
  .visit-badges { justify-content: flex-start; }
  .fam-row { grid-template-columns: 110px minmax(0, 1fr) 40px; }
  .family-split { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   Round 8 — managed data fabric, capture setup, master switch
   ============================================================ */

/* Sidebar sub-links (Capture -> Capture setup) */
.side-sub { padding-left: 38px !important; font-size: 13px !important; opacity: 0.9; }
.side-sub .ico { width: 22px !important; height: 22px !important; font-size: 12px !important; }

/* Sidebar live-capture master switch */
.side-live { margin: 8px 12px 12px; padding: 12px 12px 11px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.09); }
.side-live-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.side-live-top b { color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.01em; }
.side-live-hint { display: block; margin-top: 7px; font-size: 11.5px; line-height: 1.4; color: rgba(255, 255, 255, 0.55); }
.switch { position: relative; display: inline-flex; align-items: center; width: 40px; height: 22px;
  border: 0; border-radius: 99px; padding: 0; cursor: pointer; background: rgba(255, 255, 255, 0.18);
  transition: background 0.18s ease; flex: none; }
.switch .switch-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); transition: transform 0.18s ease; }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid #9CC3FF; outline-offset: 2px; }

/* Live pill paused state */
.live-pill.paused { color: #8A5A00; background: #FDF3D8; border-color: #F1DDA1; }
.live-pill.paused .live-dot { background: #E0A800; animation: none; box-shadow: none; }

/* Setup progress meter */
.setup-meter { height: 8px; border-radius: 99px; background: var(--line, #E6EAF2); overflow: hidden; margin-bottom: 20px; }
.setup-meter > i { display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--space-blue), #5B8DEF); transition: width 0.4s ease; }

/* Capture setup form */
.setup-layout { align-items: start; }
.setup-group { border: 1px solid var(--line, #E6EAF2); border-radius: 12px; padding: 14px 16px 4px; margin: 0 0 16px; }
.setup-legend { display: flex; flex-direction: column; gap: 3px; padding: 0 6px; margin-bottom: 12px; }
.setup-legend b { font-size: 14px; color: var(--ink, #0B1828); }
.setup-legend .small { line-height: 1.4; }
.setup-group .field:last-of-type { margin-bottom: 12px; }
.setup-check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2, #4A5568);
  margin-bottom: 14px; cursor: pointer; }
.setup-check input { accent-color: var(--space-blue); width: 16px; height: 16px; }
.req { color: #C0392B; font-weight: 700; }
.setup-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }

/* Channel readiness list */
.setup-readiness { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.ready-row { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 2px; border-bottom: 1px solid var(--line, #EDF0F6); }
.ready-row:last-child { border-bottom: 0; }
.ready-name { font-size: 13px; font-weight: 600; color: var(--ink, #0B1828); text-transform: capitalize; }
.ready-on { display: inline-flex; align-items: center; gap: 5px; color: #1D7A3E; font-weight: 600; }
.ready-on svg { width: 13px; height: 13px; }

/* Managed fabric grid (shared by Capture + Capture setup) */
.fabric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fabric-card { border: 1px solid var(--line, #E6EAF2); border-radius: 12px; padding: 13px 14px; background: #fff; }
.fabric-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.fabric-head b { font-size: 13.5px; color: var(--ink, #0B1828); }

@media (max-width: 720px) {
  .fabric-grid { grid-template-columns: minmax(0, 1fr); }
  .setup-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .ready-row { flex-direction: column; align-items: flex-start; gap: 3px; }
}

/* Round 8b — managed AI engine console */
.engine-status {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface-2);
  margin-bottom: 16px; font-size: 13px; line-height: 1.5;
}
.engine-status .live-dot { margin-top: 5px; flex: 0 0 auto; }
.kpis-sm .kpi b { font-size: 19px; white-space: normal; overflow-wrap: anywhere; line-height: 1.15; }
.kpis-sm .kpi { padding: 12px 14px; }
.kpis-sm .kpi span { font-size: 10.5px; letter-spacing: 0.03em; margin-top: 4px; }
@media (max-width: 640px) {
  .kpis-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis-sm .kpi b { font-size: 19px; }
}

/* ==========================================================================
   Sidebar collapse — desktop rail mode (persisted; mobile drawer unchanged)
   ========================================================================== */
.side-collapse {
  margin-left: auto;
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--on-dark-muted);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.side-collapse:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.side-collapse svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
body.app.nav-collapsed .side-collapse svg { transform: rotate(180deg); }

@media (min-width: 961px) {
  body.app { transition: grid-template-columns 180ms var(--ease); }
  body.app.nav-collapsed { grid-template-columns: 84px minmax(0, 1fr); }

  body.app.nav-collapsed .side { padding: 16px 12px 18px; }

  body.app.nav-collapsed .side-logo {
    flex-direction: column;
    gap: 10px;
    padding: 2px 0 14px;
  }
  body.app.nav-collapsed .side-logo b { display: none; }
  body.app.nav-collapsed .side-collapse { margin-left: 0; }

  body.app.nav-collapsed .side-nav a {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
  body.app.nav-collapsed .side-label { display: none; }
  body.app.nav-collapsed .side-nav a.active::before { display: none; }

  body.app.nav-collapsed .side-progress,
  body.app.nav-collapsed .side-org,
  body.app.nav-collapsed .side-user,
  body.app.nav-collapsed .side-help,
  body.app.nav-collapsed .side-foot .btn { display: none; }

  body.app.nav-collapsed .side-live { padding: 10px 6px; }
  body.app.nav-collapsed .side-live-top { justify-content: center; }
  body.app.nav-collapsed .side-live-name,
  body.app.nav-collapsed .side-live-hint { display: none; }
  body.app.nav-collapsed .side-foot { padding: 12px 0 0; align-items: center; }
}

@media (max-width: 960px) {
  .side-collapse { display: none; }
}

/* ==========================================================================
   Mobile optimization pass (r19)
   App pages load app.css only. Fixes found by dev/tools/mobile_audit.py +
   dev/tools/probe_r18.py:
     * a bare `.table` inside `.card-pad` (Model "Source performance memory",
       Settings "Recent security events") has no horizontal scroll wrapper, so
       its 603px width was clipped by the card on phones
     * `.src-grid` forced a 290px grid track wider than the card content box
       (282px) at 320px, clipping the source card
     * long unbreakable values (emails) set a 228px min-content that expanded
       the `.contact-grid` auto track past the card and clipped the address
     * several tap targets were < 30px (kebab, copy, checkbox, link buttons)
   ========================================================================== */

/* 1. Keep wide data tables scrollable instead of clipped inside a card. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card-pad:has(> .table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 2. Source cards: never demand a track wider than the available width. */
.src-grid { grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); }

/* 3. Contact / copy rows: break long tokens so they ellipsize inside the card
      instead of expanding the grid track and getting cut off. */
.contact-grid { grid-template-columns: minmax(0, 1fr); }
.copy-row .cv { overflow-wrap: anywhere; word-break: break-word; }

/* 4. Touch targets — give small icon/text controls a comfortable hit area
      on touch/narrow screens. */
@media (max-width: 860px) {
  .linkbtn { padding: 8px 2px; }
  .row-kebab { width: 40px; height: 40px; padding: 0; font-size: 18px; }
  .copy-btn { width: 36px; height: 36px; }
  .th-check input, .lead-check, .row-check { width: 20px; height: 20px; }
  .th-check { width: 34px; }
}
/* Row actions that are revealed on hover never appear on a touch device. */
@media (hover: none) {
  .row-kebab { opacity: 1; }
}

/* --- r19b: .btn-sm was ~29px tall (below a comfortable touch size) ------- */
@media (max-width: 860px) {
  .btn-sm { min-height: 38px; padding: 9px 14px; }
}

/* --- r19c: app pages load app.css only (not brand.css), so UA-default
   checkboxes/radios (~13-14px) and the compact row-status select (~27px) sat
   below a comfortable touch size. Also the lead-check override above was
   losing to `.th-check input` (app.css:1552) until made equally specific. --- */
input[type="checkbox"], input[type="radio"] { min-width: 18px; min-height: 18px; }
@media (max-width: 860px) {
  .row-status { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
  .setup-check input { width: 20px; height: 20px; }
}

/* ==========================================================================
   Premium 3D enhancement layer (C4 + C5) — app shell
   Self-hosted, dependency-free (CSP: script-src 'self'). Additive only: the
   shell renders completely if static/js/three-d.js never runs. Motion is
   gated on `.js` (set inline in app_base) and prefers-reduced-motion.
   ========================================================================== */

/* ---------- C4: scroll-driven depth cards -------------------------------- */
.js .card3d {
  transform: rotateX(12deg) translateY(18px);
  opacity: 0;
  transform-origin: 50% 100%;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .7s ease;
}
.js .card3d.in { transform: none; opacity: 1; }

/* KPIs keep their hover lift once revealed: `.js .card3d.in` is more specific
   than `.kpi:hover`, so re-assert the lift and a snappy transition here. */
.js .kpi.card3d.in {
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.js .kpi.card3d.in:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- C5: sidebar logomark pointer-parallax ------------------------ */
.side-logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  transform-style: preserve-3d;
  will-change: transform;
  backface-visibility: hidden;
}

/* ---------- Motion safety ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .js .card3d { transform: none; opacity: 1; transition: none; }
  .side-logo-mark { transform: none !important; will-change: auto; }
}
