/* K-Wired Command Center — static mockup (FLYNN) */

:root {
  --bg: #000000;
  --surface: #0E0E12;
  --surface-2: #14141A;
  --surface-3: #191921;
  --border: rgba(255,255,255,0.09);
  --border-2: rgba(255,255,255,0.16);
  --text: #FFFFFF;
  --muted: rgba(255,255,255,0.62);
  --faint: rgba(255,255,255,0.40);

  --rail: 88px;
  --topbar: 54px;
  --radius: 14px;
  --radius-sm: 9px;

  --green: #35d07f;
  --yellow: #f5c451;
  --red: #ff5563;

  --dov: #606c38;
  --dov-2: #283618;
  --suat: #FF8A3D;
  --will: #f7f8fa;
  --will-line: #2563eb;
  --afmb: #00D4FF;
  --ann-blue: #2d9cff;
  --ann-green: #7cff3d;
  --kw: #c30000;
  --kwai: #f5e463;

  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.muted { color: var(--muted); font-weight: 400; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

/* ---------- rail ---------- */
.rail {
  background: #050506;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 0 8px; gap: 6px; z-index: 40;
}
.rail-k {
  width: 56px; height: 56px; border-radius: 14px;
  background: #000; border: 1.5px solid var(--border-2);
  color: #fff; cursor: pointer; margin-bottom: 6px;
  display: grid; place-items: center; transition: .15s;
  padding: 0; overflow: hidden;
}
.rail-k:hover { border-color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.06); }
.k-mark { font-weight: 900; font-size: 30px; line-height: 1; }
.k-logo { width: 40px; height: auto; display: block; object-fit: contain; }
.rail-nav { display: flex; flex-direction: column; gap: 4px; width: 100%; align-items: center; overflow-y: auto; }
.rail-btn {
  width: 72px; padding: 9px 0 7px; border-radius: 12px;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; transition: .14s; font-family: var(--font);
}
.rail-btn span { font-size: 10px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.rail-btn:hover { background: var(--surface); color: #fff; }
.rail-btn.is-active { background: var(--surface-2); color: #fff; border-color: var(--border-2); }
.rail-btn.is-active .ico { stroke: #fff; }
.rail-foot { margin-top: auto; padding-top: 8px; }

/* ---------- topbar ---------- */
.main { display: grid; grid-template-rows: var(--topbar) 1fr; min-width: 0; min-height: 0; overflow: hidden; }
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px 0 10px; border-bottom: 1px solid var(--border); background: #050506;
  position: relative; z-index: 30; flex-wrap: wrap; min-height: var(--topbar, 52px);
}
.global-add {
  display: flex; align-items: center; gap: 6px; flex: 1; min-width: 280px;
  justify-content: flex-end; margin-left: auto; flex-wrap: wrap;
}
.global-add input[type=text] { min-width: 140px; flex: 1; max-width: 240px; padding: 7px 10px; }
.global-add select { max-width: 120px; padding: 7px 8px; }
.g-sub { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.g-parent { max-width: 140px; }
.quick-add {
  display: flex; gap: 6px; margin-top: auto; padding-top: 8px;
  border-top: 1px solid var(--border); flex: none;
}
.quick-add input { flex: 1; min-width: 0; padding: 6px 8px; font-size: 12px; }
.tile-top3 { display: flex; flex-direction: column; }
.tile-top3 .t3 { flex: 1; min-height: 0; overflow: auto; }
.btn-push {
  background: rgba(53,208,127,.15); border: 1px solid rgba(53,208,127,.45); color: var(--green);
  font-weight: 800; letter-spacing: .04em;
}
.btn-push:hover { background: rgba(53,208,127,.28); }
.tk-actions { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.tk-actions select { font-size: 11px; padding: 3px 4px; max-width: 100px; }
.tk-actions .btn-x {
  background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 6px;
}
.tk-actions .btn-x:hover { color: #ff6b6b; }
.top3-warn { font-size: 11px; color: var(--yellow, #f5c451); margin: 0 0 6px; }
.hamb { display: none; background: none; border: 0; color: #fff; cursor: pointer; padding: 4px; }
.topbar-title { font-weight: 800; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.topmenu { margin-left: auto; display: flex; gap: 2px; }
.tm {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-family: var(--font); font-size: 12.5px; font-weight: 600;
  padding: 7px 10px; border-radius: 8px; transition: .12s;
}
.tm:hover { color: #fff; background: var(--surface); }
.tm-out { color: var(--faint); }

/* ---------- workspace / pages ---------- */
.workspace { min-height: 0; overflow: hidden; position: relative; height: 100%; }
.page { display: none; height: 100%; min-height: 0; }
.page.is-active { display: block; }
.page-tasks, .page-sites, .page-crm, .page-agents, .page-email, .page-files, .page-ann, .page-businesses, .page-admin, .page-sublanding { overflow-y: auto; padding: 20px 24px 40px; }
.page-home {
  padding: 16px;
  overflow: hidden;
  height: 100%;
  max-height: 100%;
  box-sizing: border-box;
}
.page-home.is-active {
  display: flex;
  flex-direction: column;
}

.page-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 24px; }
.page-head .muted { font-size: 12.5px; }
.page-head #ann-refresh { margin-left: auto; }

/* ---------- home cockpit ---------- */
.bento {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  overflow: hidden;
}
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 0;
  height: auto;
  max-height: 100%;
  display: flex; flex-direction: column; overflow: hidden;
}
.tile-row1,
.tile-agents-home,
.tile-biz-home,
.tile-ann-home,
.tile-subs-home { min-height: 0; overflow: hidden; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.rows-2 { grid-row: span 2; }
.tile-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tile-h h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.link { background: none; border: 0; color: var(--afmb); font-family: var(--font); font-size: 12px; font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; }

.tile-top3 { border-color: rgba(53,208,127,.35); box-shadow: inset 0 0 0 1px rgba(53,208,127,.12); }
.t3 { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; overflow-y: auto; }
.t3 li { margin: 0; padding: 0; background: none; border: 0; }
.t3-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: rgba(53,208,127,.08); border: 1px solid rgba(53,208,127,.28); border-radius: 10px;
  padding: 10px 12px; color: inherit; font: inherit; cursor: pointer; transition: .14s;
}
.t3-btn:hover { background: rgba(53,208,127,.16); border-color: rgba(53,208,127,.5); }
.t3-n { width: 26px; height: 26px; border-radius: 7px; background: var(--green); color: #05130b; font-weight: 900; display: grid; place-items: center; flex: none; }
.t3-t { font-weight: 600; flex: 1; }
.t3-empty { display: flex; align-items: center; gap: 12px; background: rgba(53,208,127,.08); border: 1px solid rgba(53,208,127,.28); border-radius: 10px; padding: 10px 12px; }
.tk-flash { outline: 2px solid var(--green); background: rgba(53,208,127,.12); }
.chip { font-size: 11px; font-weight: 700; color: var(--green); border: 1px solid rgba(53,208,127,.5); border-radius: 20px; padding: 2px 8px; }

.rollup { display: flex; gap: 6px; margin-bottom: 10px; }
.rr {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px; text-align: center; color: inherit; font-family: var(--font); cursor: pointer;
}
button.rr { appearance: none; }
.rr:hover { border-color: var(--border-2); background: var(--surface-3); }
.rr b { display: block; font-size: 20px; font-weight: 800; }
.rr span:last-child { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; flex: 1; min-height: 0; overflow-y: auto; }
.mini li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mini li.clickable { cursor: pointer; border-radius: 8px; padding: 4px 6px; margin: 0 -6px; }
.mini li.clickable:hover { background: var(--surface-2); }
.mini em { margin-left: auto; color: var(--muted); font-style: normal; font-size: 12px; }
.agents-mini .badge { margin-left: auto; }

.badge { font-size: 11px; font-weight: 700; min-width: 20px; text-align: center; border-radius: 20px; padding: 1px 7px; background: var(--surface-2); color: var(--faint); border: 1px solid var(--border); }
.badge-on { background: rgba(0,212,255,.15); color: var(--afmb); border-color: rgba(0,212,255,.4); }

.statrow {
  display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px;
  border-bottom: 1px solid var(--border); width: 100%;
  background: none; border-left: 0; border-right: 0; border-top: 0; color: inherit;
  font-family: var(--font); text-align: left;
}
button.statrow { cursor: pointer; border-radius: 0; }
button.statrow:hover { color: #fff; }
.statrow:last-child { border-bottom: 0; }
.statrow b { font-size: 16px; font-weight: 800; }
.statrow em { color: var(--muted); font-style: normal; margin-left: auto; font-size: 12px; }

.countgrid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; flex: 1; align-content: start; }
.countgrid div, .countgrid button {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px; text-align: center;
  color: inherit; font-family: var(--font); cursor: pointer;
}
.countgrid button:hover { border-color: var(--border-2); }
.countgrid b { display: block; font-size: 18px; font-weight: 800; }
.countgrid span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* Soft whole-tile glow (ANN / Alerts) */
.tile.glow-yellow {
  box-shadow: 0 0 0 1px rgba(245,196,81,.35), 0 0 28px rgba(245,196,81,.22);
  animation: softGlowY 2.8s ease-in-out infinite;
}
.tile.glow-red {
  box-shadow: 0 0 0 1px rgba(255,85,99,.35), 0 0 28px rgba(255,85,99,.22);
  animation: softGlowR 2.4s ease-in-out infinite;
}
.tile.glow-green {
  box-shadow: 0 0 0 1px rgba(53,208,127,.35), 0 0 28px rgba(53,208,127,.2);
  animation: softGlowG 2.8s ease-in-out infinite;
}
@keyframes softGlowY {
  0%, 100% { box-shadow: 0 0 0 1px rgba(245,196,81,.28), 0 0 18px rgba(245,196,81,.14); }
  50% { box-shadow: 0 0 0 1px rgba(245,196,81,.45), 0 0 32px rgba(245,196,81,.28); }
}
@keyframes softGlowR {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,85,99,.28), 0 0 18px rgba(255,85,99,.14); }
  50% { box-shadow: 0 0 0 1px rgba(255,85,99,.5), 0 0 34px rgba(255,85,99,.3); }
}
@keyframes softGlowG {
  0%, 100% { box-shadow: 0 0 0 1px rgba(53,208,127,.28), 0 0 18px rgba(53,208,127,.14); }
  50% { box-shadow: 0 0 0 1px rgba(53,208,127,.48), 0 0 32px rgba(53,208,127,.28); }
}

/* Task Load flip */
.tile-tasks-home { position: relative; }
.taskflip { position: relative; flex: 1; min-height: 0; }
.taskflip-pane {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transform: scale(.96);
  transition: opacity .45s ease, transform .45s ease;
  overflow: hidden;
}
.taskflip-pane.is-visible { opacity: 1; pointer-events: auto; transform: scale(1); z-index: 2; }
.taskflip-pane.is-leaving { opacity: 0; transform: scale(1.02); z-index: 1; }
.pie-wrap { display: flex; align-items: center; gap: 10px; height: 100%; min-height: 0; }
.task-pie { width: 42%; max-width: 140px; height: auto; flex: none; }
.pie-slice { cursor: pointer; transition: opacity .15s; }
.pie-slice:hover { opacity: .85; }
.pie-legs { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; overflow-y: auto; }
.pie-leg {
  display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600;
  background: none; border: 0; color: #fff; font-family: var(--font); cursor: pointer;
  padding: 3px 0; text-align: left;
}
.pie-leg .swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.pie-leg b { margin-left: auto; color: var(--muted); }

/* Alerts — business Urgent (red) + weekly report */
.alerts-stack { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.alerts-block h3 {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 0 0 6px; font-weight: 700;
}
.alerts-block.alerts-urgent h3 { color: var(--red); }
.alert-row, .date-row, .alert-weekly {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 10px; color: #fff; font-family: var(--font); cursor: pointer; text-align: left;
  margin-bottom: 5px;
}
.alert-row:hover, .date-row:hover, .alert-weekly:hover { border-color: var(--border-2); }
.alert-weekly {
  border-color: rgba(61,183,199,.35);
  background: linear-gradient(135deg, rgba(61,183,199,.12), var(--surface-2));
}
.alert-weekly .alert-weekly-mark {
  flex: none; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(61,183,199,.18); color: #3db7c7; font-weight: 900; font-size: 11px;
}
.alert-text { font-size: 12.5px; font-weight: 600; }
.alert-weekly .alert-text { letter-spacing: .02em; }
.alert-weekly .alert-sub {
  display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); margin-top: 2px;
}
.date-when {
  flex: none; min-width: 64px; font-size: 11px; font-weight: 800; text-align: center;
  padding: 4px 6px; border-radius: 7px; background: rgba(255,255,255,.06);
}
.date-row.urg-red .date-when { background: rgba(255,85,99,.18); color: var(--red); }
.date-row.urg-yellow .date-when { background: rgba(245,196,81,.16); color: var(--yellow); }
.date-row.urg-green .date-when { background: rgba(53,208,127,.12); color: var(--green); }
.date-row.urg-red {
  border-color: rgba(255,85,99,.35);
  background: rgba(255,85,99,.08);
}
.date-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.date-body strong { font-size: 12.5px; }
.date-body em { font-size: 10.5px; color: var(--muted); font-style: normal; }
.alerts-clear {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 12px; border-radius: 10px;
  border: 1px solid rgba(53,208,127,.28);
  background: rgba(53,208,127,.08);
}
.alerts-clear-check {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(53,208,127,.18); color: var(--green);
  font-size: 18px; font-weight: 900; line-height: 1;
}
.alerts-clear-label {
  font-size: 14px; font-weight: 800; color: var(--green); letter-spacing: .04em;
}
.alerts-clear-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Sites health filters */
.health-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.health-filters.is-hidden,
.health-filters[hidden] { display: none !important; }
.sites-organize {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}
.sites-organize-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 2px;
}
.sitelist-group {
  list-style: none;
  margin: 14px 0 6px;
  padding: 0 2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.sitelist-group:first-child { margin-top: 2px; }
.site .s-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
}
.site .s-status.is-build { color: #f0c14a; border-color: rgba(240, 193, 74, 0.45); }
.site .s-status.is-live { color: var(--green, #35d07f); border-color: rgba(53, 208, 127, 0.4); }
.site .s-status.is-hold { color: #ff8a3d; border-color: rgba(255, 138, 61, 0.45); }
.site .s-status.is-other { color: var(--faint); }
.site .s-status.is-completed { color: var(--green, #35d07f); border-color: rgba(53, 208, 127, 0.45); }
.site .s-status.is-vip { color: #9ec5ff; border-color: rgba(158, 197, 255, 0.45); }
.site .s-status.is-lost { color: #ff8a9a; border-color: rgba(255, 138, 154, 0.45); }
.hfilt {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-family: var(--font); font-weight: 700; font-size: 12px; padding: 7px 12px;
  border-radius: 999px; cursor: pointer;
}
.hfilt.is-active { color: #fff; border-color: var(--border-2); background: var(--surface-2); }
.site.muted-row { color: var(--muted); cursor: default; }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; overflow-y: auto; }
.feed li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.feed-lg li { padding: 10px 0; border-bottom: 1px solid var(--border); }

/* ---------- dots ---------- */
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.dot-green { background: var(--green); box-shadow: 0 0 8px rgba(53,208,127,.6); }
.dot-yellow { background: var(--yellow); box-shadow: 0 0 8px rgba(245,196,81,.5); }
.dot-red { background: var(--red); box-shadow: 0 0 8px rgba(255,85,99,.6); }

/* ---------- business squares ---------- */
.biz-strip { display: flex; gap: 12px; flex-wrap: wrap; }
/* Home: equal squares fill the tile edge-to-edge; shrink (stay square) if the section shortens */
.biz-strip.biz-strip--compact {
  --biz-count: 7;
  --biz-gap: 10px;
  container-type: size;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--biz-gap);
  overflow: hidden;
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
}
.biz-strip.biz-strip--compact .biz {
  /* side = min(full row height, equal share of width minus gaps) */
  --biz-side: min(
    100cqh,
    calc((100cqi - (var(--biz-count) - 1) * var(--biz-gap)) / var(--biz-count))
  );
  flex: 0 0 var(--biz-side);
  width: var(--biz-side);
  height: var(--biz-side);
  aspect-ratio: 1 / 1;
  max-width: var(--biz-side);
  max-height: var(--biz-side);
  padding: clamp(6px, 8%, 12px);
  border-radius: clamp(10px, 14%, 16px);
}
.biz-strip.biz-strip--compact .biz--photo { padding: 0; }
.biz-strip.biz-strip--compact .biz-label {
  font-size: clamp(8px, 12%, 13px);
  line-height: 1.1;
}
.tile-biz-home, .tile-ann-home, .tile-subs-home { min-height: 0; height: 100%; }
.tile-biz-home .tile-h { flex: none; }
.tile-subs-home .sub-home-list { max-height: none; flex: 1; min-height: 0; }
.tile-ann-home .statrow { font-size: 12px; padding: 5px 0; }
.tile-ann-home .statrow em { font-size: 11px; }
/* fill leftover space in ANN / email-style tiles evenly */
.tile-ann-home .statrow:last-child,
.tile > .statrow:last-of-type { margin-top: auto; }
.biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.biz-hubs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.biz-hub-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  align-items: start;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  text-align: left;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
  cursor: pointer;
}
a.biz-hub-card:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: var(--surface-2);
}
a.biz-hub-card:hover h3 {
  color: var(--afmb, #4aa3ff);
  text-decoration: underline;
}
.biz-hub-icon {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  flex: 0 0 auto;
}
.biz-hub-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.biz-hub-body { min-width: 0; }
.biz-hub-body h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.biz-hub-kv {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 12.5px;
}
.biz-hub-kv li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: baseline;
}
.biz-hub-kv .k { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 10.5px; }
.biz-hub-kv .v { font-weight: 700; text-align: right; }
.biz-hub-kv .v em { font-style: normal; font-weight: 500; color: var(--faint); font-size: 11px; display: block; }
.biz-hub-chart-wrap {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.biz-hub-chart-wrap .cht-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.biz-pnl-svg { width: 100%; height: 88px; display: block; }
.biz-pnl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--faint);
}
.biz-pnl-legend span { display: inline-flex; align-items: center; gap: 4px; }
.biz-pnl-legend i {
  width: 8px; height: 8px; border-radius: 2px; display: inline-block;
}
.biz-hub-empty { color: var(--faint); font-size: 12px; }
.biz-hub-card { cursor: default; }
.biz-hub-card h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.biz-note-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--afmb, #4aa3ff);
  border: 1px solid rgba(74, 163, 255, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
}
.biz-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}
.biz-hub-card .biz-notes {
  margin-top: 4px;
  grid-column: 1 / -1;
}
@media (max-width: 900px) {
  .biz-hubs { grid-template-columns: 1fr; }
}
.biz {
  position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border-2); cursor: pointer; background: #0a0a0c;
  display: flex; align-items: flex-end; padding: 12px; transition: transform .15s, box-shadow .15s;
  font-family: var(--font);
}
.biz--photo {
  padding: 0;
  align-items: stretch;
  background: transparent;
}
.biz-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
  pointer-events: none;
}
.biz-strip .biz { width: 96px; height: 96px; aspect-ratio: auto; padding: 9px; border-radius: 14px; }
.biz-strip .biz--photo { padding: 0; }
.biz-strip .biz-label { font-size: 12px; }

/* ---------- home subcontractors ---------- */
.btn-sm { font-size: 11px; padding: 6px 10px; white-space: nowrap; }
.sub-home-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; overflow-y: auto; flex: 1; }
.sub-home-list li {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  cursor: pointer; font-size: 12px; transition: .12s;
}
.sub-home-list li:hover { border-color: var(--border-2); background: var(--surface-3); }
.sub-home-list .sh-name { font-weight: 700; flex: 1; min-width: 0; }
.sub-home-list .sh-role { color: var(--faint); font-size: 10px; max-width: 42%; text-align: right; }
.tile-subs-home .tile-h { gap: 8px; flex-wrap: wrap; }
.tile-subs-home .tile-h h2 { flex: 1; min-width: 0; }
.tile-subs-home .btn-sm { font-size: 10px; padding: 5px 8px; }

/* ---------- subcontractor landing ---------- */
.sub-landing { max-width: 920px; }
.sub-back { background: none; border: 0; color: var(--afmb); font-family: var(--font); font-weight: 700; font-size: 13px; cursor: pointer; margin-bottom: 14px; padding: 0; }
.sub-hero {
  background: linear-gradient(145deg, #12121a 0%, #0a0a10 100%);
  border: 1px solid var(--border-2); border-radius: 18px; padding: 28px 28px 24px; margin-bottom: 18px;
}
.sub-hero h1 { font-size: 32px; margin-bottom: 4px; }
.sub-hero .sub-tag { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.sub-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sub-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px;
}
.sub-card h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.sub-card .kv { margin: 0; }
.sub-slot {
  border: 1px dashed var(--border-2); border-radius: 10px; padding: 16px;
  color: var(--faint); font-size: 13px; text-align: center; margin-top: 10px;
}
.proj-link {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  color: #fff; text-decoration: none; font-weight: 600; font-size: 13px;
}
.proj-link:hover { border-color: var(--afmb); color: var(--afmb); }
.proj-link .muted { font-weight: 400; margin-left: auto; font-size: 11px; }
.biz:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.6); }
.biz-label { position: relative; z-index: 3; font-weight: 800; font-size: 14px; letter-spacing: .02em; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.biz-strip .biz-label { font-size: 12px; }
.biz-fx, .biz-fx * { position: absolute; }
.biz-fx { inset: 0; z-index: 1; }

/* DOV — olive */
.biz--dov { background: linear-gradient(145deg, var(--dov) 0%, var(--dov-2) 100%); }
.biz--dov .fx-diag { inset: -20% -10% auto auto; width: 150%; height: 46%; background: rgba(0,0,0,.18); transform: rotate(-18deg); border-radius: 40px; }
/* SUAT — orange sun */
.biz--suat { background: radial-gradient(circle at 72% 28%, #ffd39a 0%, var(--suat) 42%, #e2661c 100%); }
.biz--suat .fx-rays { inset: 0; background: repeating-conic-gradient(from 0deg at 72% 28%, rgba(255,255,255,.16) 0deg 6deg, transparent 6deg 14deg); mix-blend-mode: overlay; }
.biz--suat .biz-label { color: #3a2410; text-shadow: none; }
/* theonenamedwill — light gray, blurred black lines w/ dot ends */
.biz--will { background: linear-gradient(160deg, #ffffff 0%, var(--will) 100%); }
.biz--will .fx-line { height: 2px; width: 78%; background: rgba(15,18,25,.75); filter: blur(1.1px); border-radius: 2px; }
.biz--will .fx-line::after { content: ""; position: absolute; right: -4px; top: 50%; transform: translateY(-50%); width: 7px; height: 7px; border-radius: 50%; background: #0f1219; filter: blur(.4px); }
.biz--will .l1 { top: 30%; left: 8%; transform: rotate(-14deg); }
.biz--will .l2 { top: 48%; left: 12%; width: 64%; transform: rotate(-14deg); opacity: .7; }
.biz--will .l3 { top: 64%; left: 6%; width: 70%; transform: rotate(-14deg); opacity: .55; }
.biz--will .biz-label { color: #12151d; text-shadow: none; }
.biz--will .biz-label b { color: var(--will-line); }
/* AFMB — black + cyan */
.biz--afmb { background: radial-gradient(circle at 30% 20%, #0a1418 0%, #000 70%); }
.biz--afmb .fx-cyan { height: 1.5px; background: linear-gradient(90deg, transparent, var(--afmb), transparent); box-shadow: 0 0 8px rgba(0,212,255,.7); }
.biz--afmb .a { top: 34%; left: 0; width: 100%; transform: rotate(-8deg); }
.biz--afmb .b { top: 62%; left: 0; width: 100%; transform: rotate(6deg); opacity: .6; }
.biz--afmb .biz-label { color: var(--afmb); }
/* ANN — neon electricity */
.biz--ann { background: radial-gradient(circle at 50% 40%, #0a1a12 0%, #05070d 75%); }
.biz--ann .biz-label { color: var(--ann-green); text-shadow: 0 0 10px rgba(124,255,61,.7); }
.biz--ann svg { inset: 0; width: 100%; height: 100%; }
.biz--ann .bolt-g { stroke: var(--ann-green); stroke-width: 1.6; fill: none; filter: drop-shadow(0 0 4px var(--ann-green)); }
.biz--ann .bolt-b { stroke: var(--ann-blue); stroke-width: 1.4; fill: none; filter: drop-shadow(0 0 5px var(--ann-blue)); opacity: .85; }
/* K-Wired.com — black + angled rounded squares + red */
.biz--kw { background: #000; }
.biz--kw .fx-sq { width: 46%; height: 46%; border: 1.5px solid rgba(255,255,255,.14); border-radius: 14px; transform: rotate(38deg); }
.biz--kw .s1 { top: -12%; left: 8%; }
.biz--kw .s2 { top: 30%; left: 44%; border-color: rgba(195,0,0,.5); }
.biz--kw .s3 { top: 52%; left: -6%; opacity: .7; }
.biz--kw .biz-label { color: #fff; }
.biz--kw .biz-label b { color: var(--kw); }
/* K-Wired AI — light yellow */
.biz--kwai { background: linear-gradient(160deg, #fbf3b0 0%, var(--kwai) 100%); }
.biz--kwai .fx-diag { inset: auto -10% -20% auto; width: 140%; height: 44%; background: rgba(255,255,255,.4); transform: rotate(-16deg); border-radius: 40px; }
.biz--kwai .biz-label { color: #4a3d05; text-shadow: none; }

/* ---------- tasks ---------- */
.add-row { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.add-row input[type=text] { min-width: 220px; }
.tasklists { column-count: 2; column-gap: 16px; }
.tl { break-inside: avoid; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 16px; overflow: hidden; }
.tl-top3 { border-color: rgba(53,208,127,.4); }
.tl-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface-2); }
.tl-top3 .tl-h { background: rgba(53,208,127,.12); }
.tl-h h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.tl-top3 .tl-h h3 { color: var(--green); }
.count { font-size: 12px; font-weight: 800; min-width: 24px; text-align: center; background: #000; border: 1px solid var(--border-2); border-radius: 20px; padding: 2px 8px; }
.tl ul { list-style: none; margin: 0; padding: 6px 8px; }
.tl .subs { padding: 4px 0 4px 30px; }
.tk { display: flex; align-items: center; gap: 8px; padding: 9px 8px; border-radius: 8px; font-size: 14px; position: relative; }
.tk:hover { background: var(--surface-2); }
.tl-top3 .tk.parent { background: rgba(53,208,127,.07); border: 1px solid rgba(53,208,127,.25); margin-bottom: 4px; }
.tk label { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; }
.tk input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--green); }
.tag { font-size: 11px; font-weight: 700; color: var(--afmb); background: rgba(0,212,255,.12); border: 1px solid rgba(0,212,255,.3); border-radius: 20px; padding: 2px 8px; }
.cad { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-3); border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px; text-transform: uppercase; }
.chev { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; }
.chev .ico { width: 16px; height: 16px; }
.subs .tk { font-size: 13px; color: var(--muted); }
.collapsed-more { color: var(--afmb); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.board-meta { width: 100%; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.status { min-height: 1.2em; font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.status.err { color: var(--red, #ff6b6b); }
.status.ok { color: var(--green); }
.btn-end { background: var(--surface-2); border: 1px solid var(--border-2); }
.btn-end:hover { border-color: var(--green); color: var(--green); }
.tk.pending-done { opacity: .55; }
.tk.pending-done label { text-decoration: line-through; color: var(--muted); }
.pending-tag { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tk .agent-badge { font-size: 11px; font-weight: 700; color: var(--afmb); background: rgba(0,212,255,.12); border: 1px solid rgba(0,212,255,.3); border-radius: 20px; padding: 2px 8px; }

/* ---------- menu shell panel ---------- */
.menu-scrim {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.5); border: 0; padding: 0; cursor: pointer;
}
.menu-scrim.show { display: block; }
.menu-panel {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 94vw);
  background: var(--surface); border-left: 1px solid var(--border-2);
  transform: translateX(100%); transition: transform .22s ease; z-index: 90;
  display: flex; flex-direction: column;
}
.menu-panel.show { transform: translateX(0); }
.menu-panel[hidden] { display: none !important; }
.menu-panel.show[hidden] { display: flex !important; }
.menu-panel-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.menu-panel-h h2 { font-size: 16px; }
.menu-panel-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.menu-panel-body .menu-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.menu-panel-body h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.menu-panel-body p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text); }
.menu-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.menu-actions .btn { min-height: 40px; }
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.menu-grid .btn { width: 100%; justify-content: center; min-height: 40px; }
.btn.is-menu-on {
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.25);
  background: rgba(0, 212, 255, 0.08);
}
.menu-warn { color: #ff8a96; }
.menu-panel-body code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  color: var(--afmb, #00d4ff);
}
.swatch-row { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 36px; height: 36px; border-radius: 10px; border: 2px solid transparent;
  cursor: pointer; background: var(--sw, #35d07f);
}
.swatch.is-active { border-color: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13.5px; }
body.hide-recurring .tl:has(#list-recurring) { display: none; }
body.hide-home-quick #top3-quick-add { display: none; }
body.view-compact .tk { padding: 6px 6px; font-size: 13px; }
body.view-compact .tile { padding: 10px 12px; }
body.view-compact .tl-h { padding: 8px 12px; }
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* ---------- inputs / buttons ---------- */
input[type=text], input[type=number], select, textarea {
  background: var(--surface-2); border: 1px solid var(--border-2); color: #fff;
  border-radius: 9px; padding: 9px 11px; font-family: var(--font); font-size: 13px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--afmb); }
textarea { width: 100%; resize: vertical; }
.btn { background: var(--surface-2); border: 1px solid var(--border-2); color: #fff; font-family: var(--font); font-weight: 700; font-size: 13px; padding: 9px 14px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: #fff; }
.btn-primary { background: #fff; color: #000; border-color: #fff; }
.btn-primary .ico { stroke: #000; }
.tk-empty { justify-content: center; opacity: .7; pointer-events: none; padding: 14px 8px; font-size: 13px; }
.g-owner { max-width: 130px; }
.global-add .g-owner { max-width: 118px; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--muted);
}
.btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; }
.icon-btn:hover { color: #fff; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.tab { background: none; border: 0; color: var(--muted); font-family: var(--font); font-weight: 700; font-size: 13px; padding: 8px 16px; border-radius: 7px; cursor: pointer; }
.tab.is-active { background: var(--surface-3); color: #fff; }
.tabpane { display: none; }
.tabpane.is-active { display: block; }

/* ---------- sites ---------- */
.page-head--sites { align-items: stretch; }
.page-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.page-head-row h1 { margin: 0; }
.sites-print-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.sitelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site {
  display: block;
  padding: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px; cursor: pointer;
}
.site:hover { border-color: var(--border-2); }
.site-summary {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
}
.site .s-name { font-weight: 600; }
.site .s-url { color: var(--faint); font-size: 12px; }
.site .s-grade { margin-left: auto; font-weight: 800; font-size: 13px; }
.site .s-chev {
  color: var(--muted);
  font-size: 12px;
  transition: transform .15s ease;
  flex-shrink: 0;
}
.site.is-open .s-chev { transform: rotate(90deg); }
.site .s-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 20px; padding: 2px 9px; }
.site.needs { border-left: 3px solid var(--red); }
.site.watch { border-left: 3px solid var(--yellow); }
.site-detail {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
  cursor: default;
}
.site.is-open .site-detail { display: block; }
.site-detail .kv { margin: 12px 0 0; }
.site-detail .kv dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.site-detail .kv dd { margin: 0 0 10px; font-size: 13px; }
.site-detail-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.site-detail-actions .btn { text-decoration: none; }
.site-data-src {
  margin: 8px 0 0;
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.site-pipe-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}
.site-pipe-select {
  font: inherit;
  font-size: 11px;
  color: #fff;
  background: #050506;
  border: 1px solid var(--border-2);
  border-radius: 7px;
  padding: 4px 8px;
  max-width: 220px;
}
.site-notes {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.site-notes h4 {
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.site-notes .muted { margin: 0 0 8px; font-size: 11px; }
.site-note-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 72px;
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-2);
  background: #050506;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  resize: vertical;
}
.site-note-log { margin-top: 10px; max-height: 140px; }

.sites-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 28%);
  gap: 18px;
  align-items: start;
  min-height: 0;
}
.sites-main { min-width: 0; }
.sites-aside-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  position: sticky;
  top: 8px;
  max-height: calc(100vh - var(--topbar) - 48px);
  overflow: hidden;
}
.sites-aside-stack .sites-domains {
  position: static;
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
}
.sites-domains {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 10px;
}
.sites-domains-h h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 4px;
}
.sites-domains-h .muted { font-size: 11px; margin: 0 0 10px; }
.domainlist {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.domainlist li {
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
}
.domainlist .d-name { font-weight: 700; display: block; word-break: break-all; }
.domainlist .d-meta { color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.35; }
.domainlist .d-subs { margin-top: 4px; color: var(--faint); font-size: 10px; line-height: 1.4; }
.domainlist li.urg-red { border-color: rgba(255,85,99,.45); }
.domainlist li.urg-yellow { border-color: rgba(245,196,81,.4); }
.domainlist li.urg-expired { border-color: rgba(255,85,99,.7); background: rgba(255,85,99,.08); }

/* Sites 10-step pipeline board (Client Sites only) */
.sites-pipeline-wrap {
  margin: 0 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
  width: 100%;
}
.sites-pipeline-h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 0 0 10px;
}
.sites-pipeline-h h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0;
}
.sites-pipeline-h .muted { font-size: 11px; margin: 0; }
.sites-pipeline-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  width: 100%;
}
.sites-pipe-col {
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 140px;
}
.sites-pipe-col.is-dragover {
  border-color: rgba(120, 180, 255, .55);
  background: rgba(80, 140, 220, .08);
}
.sites-pipe-col-h {
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 2px;
}
.sites-pipe-col-num {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 2px;
}
.sites-pipe-col-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 3px;
}
.sites-pipe-col-blurb {
  display: block;
  font-size: 9px;
  line-height: 1.3;
  color: var(--faint);
}
.sites-pipe-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-height: 48px;
}
.sites-pipe-card {
  padding: 6px 7px;
  border-radius: 8px;
  background: #050506;
  border: 1px solid var(--border-2);
  cursor: grab;
  font-size: 11px;
  line-height: 1.25;
  user-select: none;
}
.sites-pipe-card:active { cursor: grabbing; }
.sites-pipe-card.is-dragging { opacity: .45; }
.sites-pipe-card .pc-name {
  display: block;
  font-weight: 650;
  word-break: break-word;
}
.sites-pipe-card .pc-host {
  display: block;
  color: var(--faint);
  font-size: 9px;
  margin-top: 2px;
  word-break: break-all;
}
.sites-pipe-empty {
  font-size: 10px;
  color: var(--faint);
  padding: 6px 2px;
}

/* 7-step legend (above Client Domains, below 10-step board) */
.sites-steps-legend {
  flex: 0 0 auto;
  max-height: 42%;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
}
.sites-steps-legend-h h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 4px;
}
.sites-steps-legend-h .muted { font-size: 11px; margin: 0 0 8px; line-height: 1.35; }
.sites-steps-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sites-steps-legend-list li {
  padding: 7px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.sites-steps-legend-list .sl-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .04em;
}
.sites-steps-legend-list .sl-title {
  display: block;
  font-size: 12px;
  font-weight: 650;
  margin-top: 1px;
}
.sites-steps-legend-list .sl-blurb {
  display: block;
  font-size: 10px;
  color: var(--faint);
  line-height: 1.35;
  margin-top: 2px;
}

@media (max-width: 1100px) {
  .sites-pipeline-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .sites-layout { grid-template-columns: 1fr; }
  .sites-aside-stack {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .sites-aside-stack .sites-domains { max-height: 320px; }
  .sites-steps-legend { max-height: none; }
  .sites-pipeline-board {
    grid-template-columns: 1fr;
  }
}

/* ---------- split (crm / agents) ---------- */
.split { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.split-agents { grid-template-columns: minmax(280px, 42%) 1fr; }
.reclist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rec { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.rec:hover, .rec.is-active { border-color: var(--border-2); background: var(--surface-2); }
.rec > span:first-child { flex: 1 1 auto; min-width: 0; }
.rec .r-name { font-weight: 600; font-size: 14px; }
.rec .r-sub { color: var(--faint); font-size: 12px; }
.rec .badge,
.rec .dot { margin-left: auto; flex: none; align-self: center; }
.recdetail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; min-height: 320px; }
.recdetail h2 { font-size: 18px; margin-bottom: 4px; }

/* CRM list: lock health dots to one vertical column on the right */
.page-crm .reclist .rec {
  position: relative;
  padding-right: 28px;
}
.page-crm .reclist .rec .dot {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}

/* ---------- CRM layout (list+detail | portfolio charts) ---------- */
.crm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 32%);
  gap: 18px;
  align-items: start;
  min-height: 0;
}
.crm-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.crm-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
}
.crm-toolbar-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.crm-sort { display: flex; flex-wrap: wrap; gap: 6px; }
.page-crm .split { grid-template-columns: 280px minmax(0, 1fr); }
.crm-insights {
  position: sticky;
  top: 8px;
  max-height: calc(100vh - var(--topbar) - 48px);
  min-height: 420px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
}
.crm-insights-h h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0;
}
.crm-insights-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.crm-insights .crm-score {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  line-height: 1.1;
}
.crm-insights .crm-score__nums {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #dff4ff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.crm-insights .crm-score__label {
  font-size: 9px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.crm-chart-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.crm-insights-h .muted { font-size: 11px; margin: 0 0 10px; line-height: 1.4; }
.crm-chart-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.crm-acq-chart {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 280px;
  padding: 8px 4px 0;
}
.crm-acq-bars-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  padding-bottom: 2px;
}
.crm-acq-bars-scroll.is-scrollable {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  padding-bottom: 4px;
}
.crm-acq-bars-scroll.is-scrollable::-webkit-scrollbar { height: 8px; }
.crm-acq-bars-scroll.is-scrollable::-webkit-scrollbar-track {
  background: rgba(255,255,255,.06);
  border-radius: 8px;
}
.crm-acq-bars-scroll.is-scrollable::-webkit-scrollbar-thumb {
  background: rgba(45,156,255,.55);
  border-radius: 8px;
}
.crm-acq-bars {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: end;
  min-height: 220px;
  width: max-content;
  min-width: 100%;
}
/* 2025–2028 (≤4 years): fill Portfolio width, moderate bar width + gaps */
.crm-acq-bars--fill {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  gap: 20px;
  justify-items: center;
  padding: 0 4px;
}
.crm-acq-bars--fill .crm-acq-col {
  width: 100%;
  max-width: 64px;
  flex: none;
  min-width: 0;
}
.crm-acq-bars--fill .crm-acq-bar-wrap {
  max-width: 56px;
}
.crm-acq-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: 100%;
  min-height: 180px;
  width: 64px;
  flex: 0 0 64px;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
}
button.crm-acq-col--year {
  cursor: pointer;
  border-radius: 10px;
  transition: background .15s ease, box-shadow .15s ease;
}
button.crm-acq-col--year:hover,
button.crm-acq-col--year:focus-visible {
  background: rgba(45,156,255,.1);
  box-shadow: inset 0 0 0 1px rgba(45,156,255,.35);
  outline: none;
}
.crm-acq-bar-wrap {
  flex: 1;
  width: 100%;
  max-width: 72px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px 8px 4px 4px;
  overflow: hidden;
}
.crm-acq-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, rgba(0,212,255,.85) 0%, rgba(45,156,255,.45) 100%);
  box-shadow: 0 0 16px rgba(45,156,255,.35);
  transition: height .35s ease;
}
.crm-acq-bar.is-unknown {
  background: linear-gradient(180deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,.1) 100%);
  box-shadow: none;
}
.crm-acq-count { font-size: 15px; font-weight: 800; color: #dff4ff; }
.crm-acq-label { font-size: 11px; color: var(--muted); text-align: center; letter-spacing: .02em; }
.crm-acq-foot { margin-top: 12px; font-size: 11px; color: var(--faint); line-height: 1.45; }
.crm-acq-chart--months { min-height: 260px; }
.crm-acq-bars--months {
  min-width: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
}
.crm-acq-col--month {
  width: auto;
  flex: none;
  min-height: 160px;
}
.crm-acq-col--month .crm-acq-label { font-size: 10px; }
.crm-acq-col--month .crm-acq-count { font-size: 12px; }

.crm-status-bars .crm-status-bar { cursor: pointer; }
.crm-status-bars .crm-status-bar:hover,
.crm-status-bars .crm-status-bar:focus-visible {
  border-color: rgba(45,156,255,.55);
  outline: none;
}

/* CRM pop-up (year / status lists) — mobile-first */
.crm-pop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 560px) {
  .crm-pop {
    align-items: center;
    padding: 24px;
  }
}
.crm-pop[hidden] { display: none !important; }
.crm-pop__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(2px);
}
.crm-pop__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: min(78vh, 560px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 24px 64px rgba(0,0,0,.55);
}
@media (min-width: 560px) {
  .crm-pop__panel {
    border-radius: 14px;
    width: min(420px, 96vw);
  }
}
.crm-pop__h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex: none;
  background: var(--surface);
}
.crm-pop__h h2 { font-size: 16px; margin: 0; }
.crm-pop__body {
  padding: 10px 14px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-gutter: stable;
}
.crm-pop__body::-webkit-scrollbar { width: 8px; }
.crm-pop__body::-webkit-scrollbar-track {
  background: rgba(255,255,255,.06);
  border-radius: 8px;
}
.crm-pop__body::-webkit-scrollbar-thumb {
  background: rgba(45,156,255,.55);
  border-radius: 8px;
}
body.crm-pop-open { overflow: hidden; }

.crm-status-namelist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.crm-status-namelist li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 14px;
  line-height: 1.3;
}
.crm-status-namelist li:last-child { border-bottom: 0; }
.crm-status-namelist__name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  word-break: break-word;
}
.crm-status-namelist__step {
  flex: none;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #9fd6ff;
  min-width: 1.25em;
  text-align: right;
}
.crm-status-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.crm-status-bars .agent-bar { cursor: default; }
.crm-status-bars .agent-bar__fill {
  background: linear-gradient(90deg, rgba(45,156,255,.5) 0%, rgba(0,212,255,.22) 75%, rgba(45,156,255,.06) 100%);
}
.crm-status-bars .agent-bar.is-hold .agent-bar__fill,
.crm-status-bars .agent-bar.is-inactive .agent-bar__fill {
  background: linear-gradient(90deg, rgba(255,85,99,.45) 0%, rgba(255,85,99,.15) 100%);
}
.crm-status-bars .agent-bar.is-live .agent-bar__fill {
  background: linear-gradient(90deg, rgba(53,208,127,.5) 0%, rgba(53,208,127,.18) 100%);
}
.crm-value-chart { display: flex; flex-direction: column; gap: 14px; min-height: 260px; }
.crm-value-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 24px 12px;
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
}
.crm-value-empty b { font-size: 14px; color: #dff4ff; }
.crm-value-empty p { margin: 0; font-size: 12px; color: var(--muted); max-width: 26ch; line-height: 1.45; }
.crm-value-preview { opacity: .45; pointer-events: none; }
@media (max-width: 1100px) {
  .crm-layout { grid-template-columns: 1fr; }
  .crm-insights {
    position: static;
    max-height: none;
    min-height: 360px;
  }
}

/* ---------- CRM detail (v2 panels) ---------- */
.crm-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 18px; align-items: start; }
.crm-detail-aside { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 8px; }
.crm-shot { background: #0b0f16; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; position: relative; }
.crm-shot img { display: block; width: 100%; height: auto; min-height: 160px; object-fit: cover; object-position: top; background: #111827; opacity: 0; transition: opacity .25s ease; }
.crm-shot.is-ready img { opacity: 1; }
.crm-shot.is-loading img,
.crm-shot.is-error img { opacity: 0; }
.crm-shot-loading { position: absolute; inset: 0 0 36px 0; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; background: #0b0f16; z-index: 1; }
.crm-shot.is-ready .crm-shot-loading { display: none; }
.crm-shot-empty { padding: 48px 12px; text-align: center; }
.crm-shot-meta { padding: 8px 10px; font-size: 12px; border-top: 1px solid var(--border); }
.crm-block { margin: 14px 0; padding: 12px 12px 10px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,0.02); }
.crm-block h3, .crm-h3 { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.crm-path { margin: 6px 0; word-break: break-all; font-size: 12px; }
.crm-drive-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crm-domlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.crm-dom { display: grid; grid-template-columns: 12px 1fr; gap: 8px; align-items: start; font-size: 13px; }
.crm-dom-main b { font-weight: 600; }
.crm-pkgs { display: grid; gap: 8px; }
.crm-pkg { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding: 8px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; }
.crm-pkg:hover { border-color: var(--border); background: rgba(255,255,255,0.03); }
.crm-pkg input { margin-top: 3px; }
.crm-pkg-price { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: #d7e0f2; background: rgba(53, 208, 127, 0.14); border: 1px solid rgba(53, 208, 127, 0.28); }
.crm-blog-meta { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.crm-blog-meta li { display: flex; gap: 8px; align-items: flex-start; }
.crm-blog-meta .dot { flex: 0 0 auto; margin-top: 4px; }
.crm-blog-errors { margin: 0 0 8px; padding-left: 18px; color: #f0a0a0; font-size: 12px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--afmb); cursor: pointer; font: inherit; text-decoration: underline; }
.crm-seo-grade { margin: 0 0 6px; font-size: 15px; }
.crm-seo-svg { width: 100%; height: auto; display: block; background: rgba(0,0,0,0.25); border-radius: 8px; }
.crm-chart-empty { padding: 24px 8px; text-align: center; font-size: 12px; }
@media (max-width: 980px) {
  .crm-detail { grid-template-columns: 1fr; }
  .crm-detail-aside { position: static; }
}
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 14px 0; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.logbox { background: #050506; border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; line-height: 1.7; color: var(--muted); max-height: 220px; overflow-y: auto; }
.logbox .ts { color: var(--afmb); }
.noteadd { display: flex; gap: 8px; margin-top: 12px; }
.noteadd input { flex: 1; }
.token { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--faint); word-break: break-all; background: #050506; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-top: 12px; }
.subctl { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.avail { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }

/* ---------- agent bars (homepage workload chart) ---------- */
.agent-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.agent-bars--home {
  flex: 1 1 0;
  min-height: 0;
  height: 0; /* flex-basis trick: force scroll inside equal-height row */
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  gap: 5px;
  padding-right: 2px;
}
/* Always-visible scrollbar track on Agents home tile */
.agent-bars--home::-webkit-scrollbar { width: 10px; }
.agent-bars--home::-webkit-scrollbar-track {
  background: rgba(255,255,255,.06);
  border-radius: 8px;
}
.agent-bars--home::-webkit-scrollbar-thumb {
  background: rgba(45,156,255,.55);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.agent-bars--home::-webkit-scrollbar-thumb:hover { background: rgba(0,212,255,.75); background-clip: padding-box; }
.agent-bars--home {
  scrollbar-width: thin;
  scrollbar-color: rgba(45,156,255,.65) rgba(255,255,255,.06);
}
.agent-bar {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 8px 12px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; overflow: hidden; isolation: isolate;
  flex: none;
}
.agent-bars--home .agent-bar {
  min-height: 28px; padding: 5px 10px; border-radius: 8px;
  background: var(--surface-2);
}
.agent-bar:hover, .agent-bar.is-active { border-color: rgba(45,156,255,.55); }
.agent-bar__fill {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 0;
  background: linear-gradient(90deg, rgba(45,156,255,.55) 0%, rgba(0,212,255,.28) 70%, rgba(45,156,255,.08) 100%);
  box-shadow: 0 0 18px rgba(45,156,255,.55), inset 0 0 12px rgba(0,212,255,.25);
  border-radius: 9px 0 0 9px;
  transition: width .35s ease;
  pointer-events: none;
}
.agent-bars--home .agent-bar__fill {
  box-shadow: 0 0 12px rgba(45,156,255,.45), inset 0 0 8px rgba(0,212,255,.2);
  border-radius: 8px 0 0 8px;
}
.agent-bar__meta { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.agent-bar__name { font-weight: 800; font-size: 14px; letter-spacing: .02em; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.agent-bars--home .agent-bar__name { font-size: 11.5px; }
.agent-bar__role { font-size: 11px; color: rgba(255,255,255,.72); }
.agent-bar__count {
  position: relative; z-index: 1; margin-left: auto;
  font-size: 13px; font-weight: 800; min-width: 28px; text-align: center;
  border-radius: 20px; padding: 3px 9px;
  background: rgba(0,0,0,.55); color: #9fd6ff; border: 1px solid rgba(45,156,255,.45);
}
.agent-bars--home .agent-bar__count {
  font-size: 11px; min-width: 22px; padding: 1px 7px;
}
.agent-bar.has-work .agent-bar__count { color: #dff4ff; border-color: rgba(0,212,255,.65); box-shadow: 0 0 10px rgba(45,156,255,.4); }
.agent-bars--home .agent-bar.has-work {
  animation: agentWorkFlash 2.6s ease-in-out infinite;
}
.agent-bars--home .agent-bar.has-work .agent-bar__fill {
  animation: agentFillPulse 2.6s ease-in-out infinite;
}
@keyframes agentWorkFlash {
  0%, 100% { border-color: var(--border); box-shadow: none; }
  40%, 55% { border-color: rgba(45,156,255,.7); box-shadow: 0 0 14px rgba(45,156,255,.35); }
}
@keyframes agentFillPulse {
  0%, 100% { filter: brightness(1); opacity: 1; }
  45% { filter: brightness(1.35); opacity: 1; }
  55% { filter: brightness(1.1); }
}

.agent-tasks { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.agent-tasks li {
  padding: 10px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  background: rgba(45,156,255,.08); border: 1px solid rgba(45,156,255,.28);
}
.agent-tasks .empty { color: var(--muted); font-weight: 400; background: transparent; border-style: dashed; }
.agent-notes-block { margin-top: 18px; }
.agent-notes-block h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px;
}
.agent-notes-block .priority {
  font-size: 11.5px; color: var(--yellow); margin: -2px 0 10px; font-weight: 600;
}
.agent-notes-box {
  width: 100%; min-height: 110px; resize: vertical;
  background: #050506; border: 1px solid var(--border-2); color: #fff;
  border-radius: 10px; padding: 12px; font-family: var(--font); font-size: 13.5px; line-height: 1.5;
}
.agent-notes-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.agent-notes-status { font-size: 12px; color: var(--green); min-height: 1em; }
.agent-duty-hint { margin: 0 0 8px; }
.agent-duty-box { max-height: 420px; }
.agent-duty-md {
  margin: 0; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px; line-height: 1.55; color: #d7dce8;
}
.sec-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 8px; font-weight: 700; }

/* ---------- email ---------- */
.email-banner {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(90, 160, 255, 0.35);
  background: rgba(40, 90, 160, 0.18);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}
.email-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.email-compose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field-row { flex-direction: row; gap: 12px; }
.field-row > div { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; max-height: 160px; overflow-y: auto; }
.echip {
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--text);
}
.echip.is-on { border-color: var(--afmb, #4aa3ff); background: rgba(74, 163, 255, 0.18); }
.echip.is-off { opacity: 0.45; }
.echip.no-mail { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }
.email-select-meta, .email-source-note, .email-merge-preview { font-size: 12px; margin: 0 0 12px; }
.email-manual-row .grow { flex: 1 1 180px; }
.email-manual-add-wrap { display: flex; align-items: flex-end; }
.email-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.btn-email-send {
  min-width: 110px;
  font-weight: 600;
  letter-spacing: 0.02em;
  justify-content: center;
  text-align: center;
}
.btn-email-send-all {
  margin-left: auto;
  min-width: 168px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: #8b1a1a;
  border: 2px solid #ff6b6b;
  box-shadow: 0 0 0 1px rgba(255, 80, 80, 0.25);
  justify-content: center;
  text-align: center;
}
.btn-email-send-all:hover { background: #a82222; filter: brightness(1.08); }
.btn-email-send-all:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn-email-test { font-weight: 500; opacity: 0.92; }
.email-status { min-height: 1.2em; font-size: 12px; margin: 10px 0 0; color: var(--muted); }
.email-status.is-ok { color: #7dcea0; }
.email-status.is-err { color: #f0a0a0; }
.email-queue { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.email-queue-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.email-queue h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.qlist { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.qlist li { position: relative; padding-right: 28px; }
.qlist span { color: var(--faint); font-size: 11px; display: block; }
.qlist li.q-sent b { color: var(--green); }
.qlist li.q-failed b { color: #f0a0a0; }
.qlist li.q-queued b, .qlist li.q-sending b { color: var(--yellow); }
.qlist .q-cancel {
  position: absolute; right: 0; top: 0;
  border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 14px; line-height: 1;
}
.qlist .q-cancel:hover { color: #f0a0a0; }
.email-confirm-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.email-confirm-scrim.is-open {
  display: flex;
}
.email-confirm-scrim[hidden] {
  display: none !important;
}
.email-confirm {
  width: min(420px, 100%);
  background: var(--surface);
  border: 2px solid #ff6b6b;
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.email-confirm h3 { margin: 0 0 8px; color: #ff8a8a; letter-spacing: 0.06em; }
.email-confirm input {
  width: 100%; margin: 8px 0 14px; padding: 10px 12px;
  font-family: inherit; font-size: 14px; font-weight: 700; letter-spacing: 0.04em;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px; color: var(--text);
}
.email-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.email-confirm-actions .btn-email-send-all { margin-left: 0; }

/* ---------- files ---------- */
.files-controls { display: flex; gap: 8px; margin-left: auto; }
.note-drive { font-size: 12px; margin: -6px 0 14px; }
.files-status { font-size: 12px; min-height: 1.2em; margin: 0 0 10px; color: var(--muted); }
.files-status.is-ok { color: #7dcea0; }
.files-status.is-err { color: #f0a0a0; }
.filelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.filelist-pins { margin-bottom: 8px; }
.file { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.file-pin .f-meta { max-width: 36%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pin-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 8px; flex-shrink: 0; }
.file .f-name { font-weight: 600; }
.file .f-meta { color: var(--faint); font-size: 12px; margin-left: auto; }
.file .icon-btn:hover .ico { stroke: #fff; }
.file .btn-sm { flex-shrink: 0; }
.file.is-missing { opacity: 0.55; }

/* ---------- ann ---------- */
.ann-status { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.ann-stat { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 12px 16px; }
.ann-stat b { font-size: 14px; } .ann-stat span { color: var(--muted); font-size: 12px; }
.ann-cols { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.ann-cols h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.stocks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.stk { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.stk .t { font-weight: 800; } .stk .p { margin-left: auto; } .stk .up { color: var(--green); } .stk .down { color: var(--red); }

/* ---------- launch ---------- */
.page-admin .launch-head {
  text-align: center;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}
.page-admin .launch-banner {
  text-align: center;
  max-width: 920px;
  margin: 0 auto 18px;
}
.launch-shell {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 24px;
}
.launch-groups { display: flex; flex-direction: column; gap: 28px; }
.launch-group h3 {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px 16px;
  justify-items: stretch;
}
.launch-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 16px 18px;
  text-decoration: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  min-height: 132px;
  transition: .14s;
}
.launch-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.launch-card-ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  flex: none;
}
.launch-card b { font-size: 14px; line-height: 1.25; }
.launch-card span { color: var(--muted); font-size: 11.5px; line-height: 1.3; word-break: break-word; }
.launch-card .ext {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  opacity: .7;
}
.launch-card-remove {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,85,99,.12);
  color: var(--red);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font);
  display: grid;
  place-items: center;
  padding: 0;
}
.launch-card-remove:hover { border-color: var(--red); background: rgba(255,85,99,.22); }
.launch-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
  text-align: center;
}
.launch-add {
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  background: rgba(255,255,255,.02);
}
.launch-add h3 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.launch-add-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(220px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
}
.launch-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.launch-field span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.launch-field input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  padding: 10px 12px;
}
.launch-field input:focus {
  outline: none;
  border-color: var(--border-2);
}
.launch-add-status {
  margin: 10px 0 0;
  font-size: 12px;
  text-align: center;
  min-height: 1.2em;
}
.launch-add-status.is-ok { color: var(--green); }
.launch-add-status.is-err { color: var(--red); }
@media (max-width: 720px) {
  .launch-add-row { grid-template-columns: 1fr; }
  .launch-add-row .btn { width: 100%; justify-content: center; min-height: 44px; }
}

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: .2s; z-index: 50; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: 420px; max-width: 92vw; background: var(--surface); border-left: 1px solid var(--border-2); transform: translateX(100%); transition: transform .22s ease; z-index: 60; display: flex; flex-direction: column; }
.drawer.show { transform: translateX(0); }
.drawer-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-h h2 { font-size: 16px; }
.drawer-body { padding: 18px; overflow-y: auto; }

.more-btn {
  display: none; margin-left: auto; background: none; border: 0; color: #fff;
  cursor: pointer; padding: 6px; border-radius: 8px;
}
.more-btn:hover { background: var(--surface); }
.more-btn .ico { fill: currentColor; stroke: none; width: 22px; height: 22px; }
.rail-scrim {
  display: none; position: fixed; inset: 0; z-index: 35;
  background: rgba(0,0,0,.55); border: 0; padding: 0; cursor: pointer;
}
.rail-scrim[hidden] { display: none !important; }

/* ---------- responsive / mobile ---------- */
@media (max-width: 860px) {
  :root {
    --rail: 0px;
    --topbar: 56px;
    --mobile-pad: 12px;
  }

  /* Topbar grows with wrapped Add row — do not clip into home tiles */
  .main {
    grid-template-rows: auto 1fr;
  }

  .topbar-title { order: 2; flex: 1 1 auto; min-width: 0; }
  .hamb { order: 1; }
  .more-btn { order: 3; }
  .topmenu { order: 4; }

  .global-add {
    order: 5;
    flex: 1 1 100%;
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
    justify-content: stretch;
    align-items: stretch;
    gap: 8px;
    padding: 0 0 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "task task"
      "sub parent"
      "board owner"
      "add add";
  }
  .global-add input[type=text] {
    grid-area: task;
    max-width: none;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    font-size: 14px;
  }
  .global-add .g-sub {
    grid-area: sub;
    align-self: center;
    font-size: 12px;
    padding: 4px 0;
  }
  .global-add .g-parent {
    grid-area: parent;
    max-width: none;
    width: 100%;
  }
  .global-add #g-add-board {
    grid-area: board;
    max-width: none;
    width: 100%;
    padding: 10px 8px;
  }
  .global-add .g-owner,
  .global-add #g-add-owner {
    grid-area: owner;
    max-width: none;
    width: 100%;
    padding: 10px 8px;
  }
  .global-add #g-add-btn {
    grid-area: add;
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  .global-add .g-parent[hidden] {
    display: none !important;
  }
  .global-add:not(:has(.g-parent:not([hidden]))) .g-sub {
    grid-column: 1 / -1;
  }

  body.rail-open { overflow: hidden; }

  .app {
    grid-template-columns: 1fr;
    height: 100dvh;
    max-height: 100dvh;
  }

  .rail-scrim {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
  }
  body.rail-open .rail-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .rail {
    position: fixed;
    left: 0; top: 0;
    width: min(280px, 86vw);
    height: 100%;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform .22s ease;
    z-index: 45;
    align-items: stretch;
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
    border-right: 1px solid var(--border-2);
    box-shadow: 12px 0 40px rgba(0,0,0,.45);
    background: #050506;
  }
  .rail.open { transform: translateX(0); }
  .rail-k {
    width: 100%; height: 52px; margin: 0 0 10px;
    border-radius: 12px;
  }
  .rail-nav {
    width: 100%;
    align-items: stretch;
    gap: 4px;
  }
  .rail-btn {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    min-height: 48px;
  }
  .rail-btn span {
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
  }
  .rail-btn .ico { width: 22px; height: 22px; flex: none; }
  .rail-foot { align-self: center; }

  .main { min-width: 0; }
  .topbar {
    padding: 6px 10px 4px 6px;
    padding-top: calc(6px + env(safe-area-inset-top));
    height: auto;
    min-height: calc(var(--topbar) + env(safe-area-inset-top));
    max-height: none;
    gap: 6px 8px;
    align-items: center;
    overflow: visible;
  }
  .hamb { display: grid; place-items: center; min-width: 44px; min-height: 44px; flex: none; }
  .more-btn { display: grid; place-items: center; min-width: 44px; min-height: 44px; flex: none; }
  .topbar-title {
    flex: 1 1 auto; min-width: 0;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 44px;
  }
  .topmenu {
    display: none;
    position: absolute;
    top: calc(env(safe-area-inset-top) + 52px);
    right: 8px;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 12px;
    padding: 6px;
    z-index: 70;
    min-width: 160px;
    box-shadow: 0 12px 32px rgba(0,0,0,.5);
  }
  .topmenu.open { display: flex; }
  .topmenu .tm { text-align: left; padding: 12px 14px; width: 100%; }

  .workspace { -webkit-overflow-scrolling: touch; }

  /* Home: condensed vertical stack */
  .page-home {
    overflow-y: auto;
    height: 100%;
    max-height: 100%;
    padding: var(--mobile-pad);
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .page-home.is-active { display: block; }
  .bento {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    grid-template-columns: none;
    grid-template-rows: none;
  }
  .tile {
    height: auto;
    max-height: none;
    min-height: 0;
    flex: none;
    width: 100%;
  }
  .span-2, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 {
    grid-column: auto;
    width: 100%;
  }
  .rows-2 { grid-row: auto; }

  .tile-top3 { order: 1; }
  .tile-sites-home { order: 2; }
  .tile-agents-home { order: 3; }
  .tile-alerts-home { order: 4; }
  .tile-tasks-home { order: 5; }
  .tile-email-home { order: 6; }
  .tile-ann-home { order: 7; }
  .tile-subs-home { order: 8; }
  .tile-biz-home { order: 9; }

  .tile-agents-home {
    max-height: 280px;
    display: flex;
  }
  .agent-bars--home {
    flex: 1 1 auto;
    height: auto;
    max-height: 220px;
    min-height: 120px;
  }

  .tile-tasks-home { min-height: 220px; }
  .taskflip { min-height: 180px; }
  .pie-wrap {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    overflow-y: auto;
  }
  .task-pie { width: min(46%, 120px); align-self: center; }
  .pie-legs { flex-direction: row; flex-wrap: wrap; gap: 6px 10px; }
  .pie-leg { font-size: 11px; min-height: 32px; }

  .biz-strip.biz-strip--compact {
    flex-wrap: wrap;
    justify-content: flex-start;
    container-type: normal;
    height: auto;
    gap: 8px;
  }
  .biz-strip.biz-strip--compact .biz {
    --biz-side: 64px;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
  }

  .tile-alerts-home { max-height: 340px; }
  .alerts-stack { max-height: 280px; }

  .page-tasks, .page-sites, .page-crm, .page-agents, .page-email,
  .page-files, .page-ann, .page-businesses, .page-admin, .page-sublanding {
    padding: 14px var(--mobile-pad) calc(28px + env(safe-area-inset-bottom));
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .page-head h1 { font-size: 20px; }
  .health-filters { width: 100%; }
  .hfilt { flex: 1 1 auto; justify-content: center; min-height: 40px; }
  .tabs { width: 100%; overflow-x: auto; }
  .tab { flex: 1; white-space: nowrap; min-height: 40px; }

  .add-row {
    margin-left: 0;
    width: 100%;
    flex-direction: column;
  }
  .add-row input[type=text],
  .add-row select,
  .add-row .btn { width: 100%; min-height: 44px; }

  .tasklists { column-count: 1; }
  .split, .split-agents, .email-wrap, .ann-cols, .sub-grid { grid-template-columns: 1fr; }
  /* CRM: higher-specificity desktop split (280px | 1fr) must re-stack on mobile */
  .page-crm .split {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .page-crm .crm-toolbar {
    width: 100%;
  }
  .page-crm .crm-sort,
  .page-crm .crm-chart-tabs {
    width: 100%;
  }
  .page-crm .crm-sort .hfilt,
  .page-crm .crm-chart-tabs .hfilt {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 40px;
  }
  /* Horizontal client/sub strip — ~3 cards visible, scroll for more */
  .page-crm .reclist {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding: 2px 2px 10px;
    margin: 0 0 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(45,156,255,.55) rgba(255,255,255,.06);
  }
  .page-crm .reclist::-webkit-scrollbar { height: 6px; }
  .page-crm .reclist::-webkit-scrollbar-track {
    background: rgba(255,255,255,.06);
    border-radius: 6px;
  }
  .page-crm .reclist::-webkit-scrollbar-thumb {
    background: rgba(45,156,255,.55);
    border-radius: 6px;
  }
  .page-crm .reclist .rec {
    position: relative;
    flex: 0 0 calc((100% - 16px) / 3);
    width: calc((100% - 16px) / 3);
    min-width: calc((100% - 16px) / 3);
    max-width: none;
    scroll-snap-align: start;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    padding: 10px 28px 10px 10px;
    min-height: 68px;
    box-sizing: border-box;
  }
  .page-crm .reclist .rec > span:first-child {
    min-width: 0;
    width: 100%;
  }
  .page-crm .reclist .rec .r-name {
    display: block;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .page-crm .reclist .rec .r-sub {
    display: block;
    font-size: 10px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .page-crm .reclist .rec .dot {
    position: absolute;
    top: 10px;
    right: 10px;
    transform: none;
    margin: 0;
    flex: none;
  }
  .page-crm .reclist .rec.is-active {
    border-color: rgba(0,212,255,.55);
    box-shadow: 0 0 0 1px rgba(0,212,255,.25);
  }
  .page-crm .recdetail {
    min-height: 0;
    padding: 14px;
    width: 100%;
    box-sizing: border-box;
  }
  .page-crm .recdetail h2 {
    font-size: 17px;
    line-height: 1.25;
    word-break: break-word;
  }
  .page-crm .kv {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px 10px;
    margin: 12px 0;
  }
  .page-crm .kv dd {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .page-crm .noteadd {
    flex-direction: column;
    align-items: stretch;
  }
  .page-crm .noteadd .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  .page-crm .crm-detail {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .page-crm .crm-detail-aside { position: static; }
  .page-crm .crm-block { padding: 10px; }
  .page-crm .subctl { flex-direction: column; }
  .page-crm .subctl .btn { width: 100%; justify-content: center; }
  .field-row { flex-direction: column; }
  .email-actions { flex-direction: column; }
  .email-actions .btn { width: 100%; justify-content: center; min-height: 44px; }
  .btn-email-send-all { margin-left: 0; }

  .drawer {
    width: 100%;
    max-width: 100vw;
  }
  .sub-hero { padding: 20px 16px; }
  .sub-hero h1 { font-size: 24px; }
  .sub-actions .btn { width: 100%; justify-content: center; }

  .t3-btn { padding: 12px; }
  .rr { min-height: 64px; }
  .btn, .btn-sm { min-height: 40px; }
}

@media (max-width: 420px) {
  .topbar-title { font-size: 12px; letter-spacing: .02em; }
  .biz-strip.biz-strip--compact .biz {
    --biz-side: 56px;
    flex-basis: 56px;
    width: 56px;
    height: 56px;
    max-width: 56px;
    max-height: 56px;
  }
  .countgrid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Sites print / PDF ---------- */
@media print {
  @page { margin: 12mm; size: letter; }

  /* Hide chrome — do NOT use visibility:hidden (clips list under overflow parents) */
  body.print-sites .rail,
  body.print-sites .topbar,
  body.print-sites .drawer,
  body.print-sites .scrim,
  body.print-sites #rail-scrim,
  body.print-sites #menu-scrim,
  body.print-sites #topmenu,
  body.print-sites #menu-panel,
  body.print-sites .sites-print-actions,
  body.print-sites .sites-organize,
  body.print-sites .health-filters,
  body.print-sites #sites-tabs,
  body.print-sites .sites-domains,
  body.print-sites .site-notes,
  body.print-sites .site-detail-actions,
  body.print-sites .s-chev {
    display: none !important;
  }

  body.print-sites .page {
    display: none !important;
  }
  body.print-sites .page.page-sites {
    display: block !important;
    position: static !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #fff !important;
    color: #111 !important;
  }

  body.print-sites,
  body.print-sites .app,
  body.print-sites .main,
  body.print-sites .workspace {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: #fff !important;
    color: #111 !important;
  }

  body.print-sites .page-sites .tabpane {
    display: block !important;
  }
  body.print-sites .page-sites .tabpane + .tabpane {
    margin-top: 18px;
  }
  body.print-sites .page-sites .tabpane::before {
    content: attr(data-print-label);
    display: block;
    font-weight: 800;
    font-size: 14px;
    margin: 12px 0 8px;
    color: #111;
  }
  body.print-sites .sites-layout {
    display: block !important;
  }
  body.print-sites .sites-main {
    overflow: visible !important;
  }
  body.print-sites .sitelist {
    display: block !important;
  }
  body.print-sites .site {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
    background: #fff !important;
    color: #111 !important;
    margin: 0 0 8px !important;
    display: block !important;
  }
  body.print-sites .site-summary {
    display: flex !important;
    color: #111 !important;
  }
  body.print-sites .site .s-name,
  body.print-sites .site .s-grade {
    color: #111 !important;
  }
  body.print-sites .site .s-url,
  body.print-sites .site-detail .kv dt,
  body.print-sites .board-meta,
  body.print-sites .muted {
    color: #444 !important;
  }
  body.print-sites.print-sites-condensed .site-detail {
    display: none !important;
  }
  body.print-sites.print-sites-expanded .site .site-detail {
    display: block !important;
    border-top: 1px solid #ddd !important;
  }
  body.print-sites .page-head h1 {
    color: #111 !important;
    font-size: 18pt !important;
  }
}
