/* ----- VoxPro design system -----
   light default — clean whites, single golden accent
   dark mode: add body.dark class
   ---------------------------------- */
:root {
  /* surfaces — layered whites */
  --c-canvas:      #f3f4f7;
  --c-bg:          #f7f8fb;
  --c-bg-2:        #eff0f5;
  --c-surface:     #ffffff;
  --c-surface-2:   #f5f6fa;
  --c-elev:        #ffffff;
  --c-elev-2:      #edeef4;

  /* lines — defined for crisp panels */
  --c-line:        rgba(0, 0, 0, 0.10);
  --c-line-2:      rgba(0, 0, 0, 0.16);
  --c-line-3:      rgba(0, 0, 0, 0.25);

  /* text — near-black */
  --c-text:        #0d1117;
  --c-text-2:      #3e4055;
  --c-text-3:      #72748a;
  --c-text-4:      #a2a4b8;

  /* single accent — futuristic teal-green */
  --a:             #0a9580;
  --a-2:           #077a67;
  --a-soft:        rgba(10, 149, 128, 0.12);
  --a-soft-2:      rgba(10, 149, 128, 0.07);
  --a-line:        rgba(10, 149, 128, 0.28);

  /* semantic */
  --ok:            #1a9156;
  --warn:          #b87010;
  --err:           #c63040;
  --info:          #2b6fcc;
  --ok-soft:       rgba(26, 145, 86, 0.10);
  --warn-soft:     rgba(184, 112, 16, 0.10);
  --err-soft:      rgba(198, 48, 64, 0.10);
  --info-soft:     rgba(43, 111, 204, 0.10);

  /* shadow — soft for light */
  --shadow-1:      0 1px 0 rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.09);
  --shadow-2:      0 4px 20px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-glow:   0 0 0 1px var(--a-line), 0 0 24px -4px rgba(10, 149, 128, 0.30);

  /* radii */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 14px;
  --r-4: 18px;

  /* type */
  --f-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-serif: "Instrument Serif", "Times New Roman", serif;

  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--f-sans);
  background: var(--c-canvas);
  color: var(--c-text);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-elev); border-radius: 8px; border: 2px solid var(--c-canvas); }
::-webkit-scrollbar-thumb:hover { background: var(--c-elev-2); }

/* ============== app shell ============== */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(141, 139, 255, 0.06), transparent 60%),
    radial-gradient(900px 400px at -10% 100%, rgba(141, 139, 255, 0.04), transparent 50%),
    var(--c-canvas);
}

/* ----- sidebar ----- */
.sb {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--c-line);
  background: linear-gradient(180deg, rgba(255,255,255,0.012), transparent 30%), var(--c-bg);
  padding: 14px 10px 12px;
  gap: 6px;
  overflow: hidden;
}
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 14px;
}
.sb-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 30%, rgba(10, 149, 128, 0.50), transparent 60%),
    linear-gradient(140deg, #e0f4f1, #c8ece7);
  border: 1px solid var(--c-line-2);
  display: grid; place-items: center;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}
.sb-mark::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--a);
  box-shadow: 0 0 12px var(--a);
}
.sb-brand-name {
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 14px;
}
.sb-brand-meta {
  font-size: 10.5px;
  color: var(--c-text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sb-ws {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin: 0 -2px 12px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-2);
  background: var(--c-bg-2);
  cursor: pointer;
  transition: border-color .15s;
}
.sb-ws:hover { border-color: var(--c-line-2); }
.sb-ws-avatar {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, #d0d3e6, #b8bcce);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600;
  color: var(--c-text-2);
  border: 1px solid var(--c-line-2);
}
.sb-ws-name { font-size: 12.5px; font-weight: 500; flex: 1; }
.sb-ws-chev { color: var(--c-text-3); }

.sb-search {
  margin: 0 -2px 14px;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: var(--r-2);
  color: var(--c-text-3);
  font-size: 12px;
  cursor: text;
  transition: border-color .15s;
}
.sb-search:hover { border-color: var(--c-line-2); }
.sb-search kbd {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-line-2);
  color: var(--c-text-3);
}

.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--c-line) transparent;
}
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-track { background: transparent; }
.sb-nav::-webkit-scrollbar-thumb { background: var(--c-line); border-radius: 2px; }

.sb-section {
  display: flex; flex-direction: column; gap: 1px;
  margin-top: 8px;
}
.sb-section-label {
  padding: 6px 10px 4px;
  font-size: 10.5px;
  color: var(--c-text-4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: var(--r-1);
  color: var(--c-text-2);
  font-size: 12.75px;
  cursor: pointer;
  position: relative;
  transition: background .12s, color .12s;
}
.sb-item:hover { background: var(--c-surface); color: var(--c-text); }
.sb-item.active {
  background: var(--c-surface-2);
  color: var(--c-text);
}
.sb-item.active::before {
  content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px;
  width: 2px; border-radius: 2px; background: var(--a);
  box-shadow: 0 0 12px var(--a);
}
.sb-item-icon {
  width: 14px; height: 14px;
  color: var(--c-text-3);
  flex: none;
}
.sb-item.active .sb-item-icon { color: var(--a); }
.sb-item-badge {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--c-text-3);
  background: var(--c-surface-2);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--c-line);
}
.sb-item-dot {
  margin-left: auto;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.sb-item.dev-only::after {
  content: "DEV";
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 9px; letter-spacing: 0.05em;
  color: var(--c-text-4);
  padding: 1px 4px;
  border: 1px solid var(--c-line);
  border-radius: 3px;
}

.sb-foot {
  margin-top: auto;
  padding: 8px;
  border-top: 1px solid var(--c-line);
}
.sb-foot-card {
  padding: 10px;
  border-radius: var(--r-2);
  background: linear-gradient(180deg, var(--a-soft), var(--a-soft-2));
  border: 1px solid var(--a-line);
}
.sb-foot-label {
  font-size: 10.5px;
  color: var(--c-text-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.sb-foot-amount {
  font-family: var(--f-mono);
  font-size: 18px;
  letter-spacing: -0.02em;
  margin: 4px 0 2px;
  color: var(--c-text);
}
.sb-foot-meta {
  font-size: 11px;
  color: var(--c-text-3);
}
.sb-foot-bar {
  margin-top: 8px;
  height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.sb-foot-bar > span {
  display: block; height: 100%;
  background: var(--a);
  box-shadow: 0 0 8px var(--a);
}

/* ----- main area ----- */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* topbar */
.tb {
  height: 52px;
  flex: none;
  border-bottom: 1px solid var(--c-line);
  background: rgba(247, 248, 251, 0.92);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
}
.tb-crumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--c-text-2);
}
.tb-crumb-current { color: var(--c-text); font-weight: 500; }
.tb-crumb-sep { color: var(--c-text-4); }

.tb-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-toggle {
  display: inline-flex;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 2px;
}
.mode-toggle button {
  padding: 4px 10px;
  font-size: 11.5px;
  border-radius: 6px;
  color: var(--c-text-3);
  font-weight: 500;
}
.mode-toggle button.active {
  background: var(--c-surface-2);
  color: var(--c-text);
  box-shadow: var(--shadow-1);
}

.tb-icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 7px;
  color: var(--c-text-3);
  border: 1px solid transparent;
  position: relative;
}
.tb-icon-btn:hover { background: var(--c-surface); color: var(--c-text); }
.tb-icon-btn .dot {
  position: absolute; top: 6px; right: 7px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--a);
  border: 2px solid var(--c-bg);
}

.tb-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #b8e8e2, #8fd4cc);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: var(--c-text);
  border: 1px solid var(--c-line-2);
  cursor: pointer;
}

/* ----- profile dropdown ----- */
.tb-profile { position: relative; }

.tb-profile-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 200px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 6px;
  z-index: 200;
  animation: fadeInDown .12s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tb-profile-head {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--c-line);
  margin-bottom: 4px;
}

.tb-profile-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--c-text-2);
  cursor: pointer;
  transition: background .1s;
}
.tb-profile-item:hover { background: var(--c-line); color: var(--c-text); }

/* ----- content scroll ----- */
.content {
  flex: 1;
  overflow: auto;
  padding: 28px 32px 80px;
}
.content-inner { max-width: 1280px; margin: 0 auto; }

/* ----- page header ----- */
.ph {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 24px;
}
.ph-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0;
}
.ph-subtitle {
  margin-top: 6px;
  color: var(--c-text-3);
  font-size: 12.5px;
}
.ph-actions {
  display: flex; align-items: center; gap: 8px;
}

/* ----- buttons ----- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  height: 30px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 7px;
  border: 1px solid var(--c-line-2);
  background: var(--c-surface);
  color: var(--c-text);
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--c-surface-2); border-color: var(--c-line-3); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--c-text-2); }
.btn-ghost:hover { background: var(--c-surface); color: var(--c-text); border-color: var(--c-line); }
.btn-primary {
  background: var(--a);
  color: #0c0c14;
  border-color: var(--a);
  font-weight: 600;
}
.btn-primary:hover { background: var(--a-2); border-color: var(--a-2); }
.btn-sm { height: 26px; padding: 4px 9px; font-size: 11.5px; border-radius: 6px; }
.btn-icon {
  width: 30px; height: 30px; padding: 0;
  display: grid; place-items: center;
}
.btn .ic { width: 13px; height: 13px; }

/* ----- inputs ----- */
.fld {
  display: block; width: 100%;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: var(--r-2);
  color: var(--c-text);
  padding: 8px 11px;
  font-size: 12.5px;
  transition: border-color .12s, background .12s;
  outline: none;
}
.fld:focus { border-color: var(--a-line); background: var(--c-surface); }
.fld::placeholder { color: var(--c-text-4); }
textarea.fld { resize: vertical; min-height: 80px; font-family: var(--f-sans); line-height: 1.55; }

.fld-label {
  display: block;
  font-size: 11.5px;
  color: var(--c-text-2);
  margin-bottom: 6px;
  font-weight: 500;
}
.fld-help {
  margin-top: 5px;
  font-size: 11.25px;
  color: var(--c-text-4);
}

.fld-group { margin-bottom: 16px; }

.fld-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ----- card ----- */
.card {
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: var(--r-3);
}
.card-body { padding: 18px; }
.card-pad-lg { padding: 22px; }
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.card-subtitle {
  font-size: 11.5px;
  color: var(--c-text-3);
  margin-top: 2px;
}

/* ----- stat ----- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  padding: 16px 18px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: var(--r-3);
  position: relative;
  overflow: hidden;
}
.stat-label {
  font-size: 11.5px;
  color: var(--c-text-3);
  letter-spacing: 0.01em;
  display: flex; align-items: center; gap: 6px;
}
.stat-value {
  font-family: var(--f-mono);
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-top: 6px;
  font-weight: 500;
}
.stat-delta {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ok);
  font-family: var(--f-mono);
}
.stat-delta.down { color: var(--err); }
.stat-delta.flat { color: var(--c-text-3); }

/* ----- badges / chips ----- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--f-mono);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 500;
  background: var(--c-surface-2);
  color: var(--c-text-2);
  border: 1px solid var(--c-line);
}
.badge-ok { color: var(--ok); background: var(--ok-soft); border-color: rgba(106, 209, 154, 0.22); }
.badge-warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(224, 182, 103, 0.22); }
.badge-err { color: var(--err); background: var(--err-soft); border-color: rgba(239, 123, 128, 0.22); }
.badge-info { color: var(--info); background: var(--info-soft); border-color: rgba(130, 179, 255, 0.22); }
.badge-accent { color: var(--a); background: var(--a-soft); border-color: var(--a-line); }
.badge-dot::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 8px currentColor;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--c-surface);
  color: var(--c-text-2);
  border: 1px solid var(--c-line);
}

/* ----- table ----- */
.tbl-wrap { overflow: auto; }
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-4);
  padding: 11px 14px;
  border-bottom: 1px solid var(--c-line);
  white-space: nowrap;
}
.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--c-line);
  color: var(--c-text-2);
  vertical-align: middle;
}
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: rgba(0,0,0,0.03); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .strong { color: var(--c-text); font-weight: 500; }
.tbl .mono { font-family: var(--f-mono); font-size: 11.5px; }
.tbl-logs td,
.tbl-logs th { white-space: nowrap; }

/* blast builder */
.blast-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.blast-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--c-line);
  background: var(--c-bg-2);
  color: var(--c-text-3);
  text-align: left;
}
.blast-step.active {
  border-color: var(--a);
  background: rgba(124,92,255,.08);
  color: var(--c-text);
}
.blast-step.done {
  border-color: rgba(88,214,141,.35);
  background: rgba(88,214,141,.08);
  color: var(--c-text);
}
.blast-step-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid currentColor;
  flex: none;
}
.blast-step-label {
  font-size: 12px;
  font-weight: 600;
}
.blast-pane { min-height: 260px; }
.blast-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.blast-review-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--c-line);
  background: var(--c-bg-2);
}
.blast-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}

/* ----- sparkline / bars ----- */
.spark {
  display: flex; align-items: flex-end; gap: 2px; height: 28px;
}
.spark > i {
  flex: 1;
  background: var(--a-soft);
  border-radius: 1px;
  min-width: 2px;
}
.spark > i.hi { background: var(--a); }

/* ----- segmented ----- */
.seg {
  display: inline-flex;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 2px;
}
.seg button {
  padding: 4px 10px;
  font-size: 11.5px;
  border-radius: 6px;
  color: var(--c-text-3);
  font-weight: 500;
}
.seg button.active {
  background: var(--c-surface-2);
  color: var(--c-text);
  box-shadow: var(--shadow-1);
}

/* ----- list rows ----- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--c-line);
  cursor: pointer;
  transition: background .12s;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: rgba(0,0,0,0.03); }

/* ----- divider ----- */
.hr {
  height: 1px;
  background: var(--c-line);
  margin: 20px 0;
}

/* ----- grids ----- */
.g-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.g-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.g-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.g-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; }

/* ----- mode visibility ----- */
.client-only { display: none; }
body.client-mode .dev-only,
body.client-mode .sb-item.dev-only { display: none; }
body.client-mode .client-only { display: initial; }
body.client-mode .client-only-grid { display: grid; }
body.client-mode .client-only-flex { display: flex; }

/* assistants builder layout */
.builder {
  display: grid;
  grid-template-columns: 220px 1fr 340px;
  gap: 0;
  height: calc(100vh - 52px - 28px - 80px);
  min-height: 600px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: var(--r-3);
  overflow: hidden;
}
.builder-side {
  border-right: 1px solid var(--c-line);
  background: var(--c-bg);
  display: flex; flex-direction: column;
}
.builder-side-head {
  padding: 14px 14px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.builder-side-list { flex: 1; overflow: auto; }
.builder-side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--c-text-2);
  position: relative;
}
.builder-side-item:hover { background: var(--c-surface); color: var(--c-text); }
.builder-side-item.active { background: var(--c-surface-2); color: var(--c-text); }
.builder-side-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 2px; background: var(--a); box-shadow: 0 0 10px var(--a);
}
.builder-side-item-avatar {
  width: 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2a2c3a, #14151c);
  border: 1px solid var(--c-line-2);
  font-size: 11px; font-weight: 600;
  color: var(--c-text-2);
}
.builder-side-item-meta {
  font-size: 10.5px; color: var(--c-text-4);
  font-family: var(--f-mono);
}

.builder-main {
  overflow: auto;
  padding: 0;
}
.builder-tabs {
  display: flex;
  padding: 0 20px;
  border-bottom: 1px solid var(--c-line);
  gap: 4px;
}
.builder-tab {
  padding: 12px 12px 13px;
  font-size: 12.25px;
  color: var(--c-text-3);
  position: relative;
}
.builder-tab.active { color: var(--c-text); }
.builder-tab.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 1.5px; background: var(--a);
  box-shadow: 0 0 10px var(--a);
}
.builder-tab:hover { color: var(--c-text); }
.builder-body { padding: 22px 24px; }

.builder-right {
  border-left: 1px solid var(--c-line);
  background: var(--c-bg);
  display: flex; flex-direction: column;
}
.builder-right-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-line);
  display: flex; align-items: center; justify-content: space-between;
}

/* call viz */
.call-viz {
  height: 84px;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  padding: 0 12px;
}
.call-viz > i {
  width: 3px;
  background: var(--a);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--a-soft);
  animation: voxbar 1.2s ease-in-out infinite;
}
@keyframes voxbar {
  0%, 100% { height: 12%; opacity: 0.55; }
  50% { height: 100%; opacity: 1; }
}

/* ribbon for assistant card */
.agent-card {
  padding: 16px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: var(--r-3);
  cursor: pointer;
  transition: border-color .12s, background .12s;
  display: flex; flex-direction: column;
  gap: 12px;
}
.agent-card:hover { border-color: var(--c-line-2); }
.agent-card-head {
  display: flex; align-items: flex-start; gap: 12px;
}
.agent-avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 30%, rgba(10, 149, 128, 0.40), transparent 60%),
    linear-gradient(135deg, #e0f4f1, #c8ece8);
  border: 1px solid var(--c-line-2);
  display: grid; place-items: center;
  font-size: 14px; font-weight: 600;
  color: var(--c-text);
  flex: none;
}
.agent-name {
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em;
}
.agent-meta {
  font-size: 11.5px;
  color: var(--c-text-3);
  margin-top: 2px;
}
.agent-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--c-line);
  padding-top: 12px;
}
.agent-stat-label {
  font-size: 10px;
  color: var(--c-text-4);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.agent-stat-value {
  font-family: var(--f-mono);
  font-size: 13px;
  margin-top: 2px;
  color: var(--c-text);
}

/* ===== command palette ===== */
.cp-back {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 80;
  display: grid; place-items: flex-start center;
  padding-top: 14vh;
  animation: cpfade .15s ease-out;
}
@keyframes cpfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
.cp {
  width: min(640px, calc(100% - 40px));
  background: var(--c-elev);
  border: 1px solid var(--c-line-3);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px var(--a-line);
  overflow: hidden;
}
.cp-search {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-line);
}
.cp-search input {
  flex: 1; background: transparent; border: 0; outline: none;
  font-size: 14px; color: var(--c-text);
}
.cp-list { max-height: 380px; overflow: auto; padding: 6px; }
.cp-group { padding: 8px 10px 4px; font-size: 10.5px; color: var(--c-text-4); text-transform: uppercase; letter-spacing: 0.06em; }
.cp-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.75px;
  color: var(--c-text-2);
}
.cp-item:hover, .cp-item.active { background: var(--c-surface-2); color: var(--c-text); }
.cp-item-kbd {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--c-text-4);
}
.cp-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--c-line);
  display: flex; gap: 14px;
  font-size: 10.5px;
  color: var(--c-text-4);
}
.cp-foot kbd {
  font-family: var(--f-mono);
  background: var(--c-surface-2);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--c-line);
  color: var(--c-text-3);
}

/* live call panel */
.live-call {
  display: grid;
  grid-template-columns: 320px 1fr;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: var(--r-3);
  overflow: hidden;
  min-height: 460px;
}
.live-call-side {
  border-right: 1px solid var(--c-line);
  padding: 18px;
  background: var(--c-bg);
}
.live-call-main { display: flex; flex-direction: column; }
.live-transcript {
  flex: 1; overflow: auto; padding: 18px 22px;
}
.bubble {
  display: flex; gap: 10px; margin-bottom: 12px;
  max-width: 78%;
}
.bubble.user { margin-left: auto; flex-direction: row-reverse; }
.bubble-avatar {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--c-elev); flex: none;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600; color: var(--c-text-2);
  border: 1px solid var(--c-line-2);
}
.bubble.assistant .bubble-avatar {
  background: linear-gradient(135deg, var(--a-soft), var(--a-soft-2));
  color: var(--c-text);
}
.bubble-body {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.5;
}
.bubble.assistant .bubble-body {
  background: var(--c-surface-2);
}
.bubble-meta {
  margin-top: 4px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--c-text-4);
}

/* visual elements */
.kbd {
  font-family: var(--f-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-line-2);
  color: var(--c-text-3);
}

/* simple chart */
.chart-card { padding: 18px; }
.chart-wrap { position: relative; height: 260px; }
.chart-svg { width: 100%; height: 100%; }

/* tabs */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--c-line);
  margin-bottom: 20px;
}
.tab {
  padding: 8px 12px 10px;
  font-size: 12.25px;
  color: var(--c-text-3);
  position: relative;
}
.tab:hover { color: var(--c-text); }
.tab.active { color: var(--c-text); }
.tab.active::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px;
  height: 1.5px; background: var(--a);
  box-shadow: 0 0 10px var(--a);
}

/* toggle switch */
.tog {
  width: 32px; height: 18px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-line-2);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background .15s;
}
.tog::after {
  content: ""; position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--c-text-2);
  transition: transform .18s, background .18s;
}
.tog.on { background: var(--a); }
.tog.on::after { transform: translateX(13px); background: #0c0c14; }

/* code */
.code {
  font-family: var(--f-mono);
  font-size: 11.75px;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--c-text-2);
  overflow: auto;
  line-height: 1.6;
  white-space: pre;
}
.code .k { color: var(--a); }
.code .s { color: var(--ok); }
.code .c { color: var(--c-text-4); }
.code .n { color: var(--warn); }

/* empty */
.empty-state {
  padding: 50px 20px;
  text-align: center;
  color: var(--c-text-3);
  font-size: 12.5px;
}
.empty-state-title { color: var(--c-text); font-size: 14px; font-weight: 500; margin-bottom: 6px; }

/* responsive */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-3 { grid-template-columns: 1fr; }
  .builder { grid-template-columns: 200px 1fr; }
  .builder-right { display: none; }
  .blast-stepper,
  .blast-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .sb { display: none; }
  .blast-stepper,
  .blast-review-grid { grid-template-columns: 1fr; }
}

/* utility */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.muted { color: var(--c-text-3); }
.mono { font-family: var(--f-mono); }
.serif { font-family: var(--f-serif); }
.center { text-align: center; }
.right { text-align: right; }
.flex-1 { flex: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strong { font-weight: 600; color: var(--c-text); }
.text-12 { font-size: 12px; } .text-11 { font-size: 11px; } .text-14 { font-size: 14px; }

/* modal overlay */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: grid; place-items: center;
}
.modal {
  width: min(540px, calc(100% - 40px));
  background: var(--c-elev);
  border: 1px solid var(--c-line-3);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.modal-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--c-line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-body { padding: 20px; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--c-line);
  display: flex; justify-content: flex-end; gap: 8px;
}


.app {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(10, 149, 128, 0.07), transparent 60%),
    radial-gradient(900px 400px at -10% 100%, rgba(0, 180, 150, 0.05), transparent 50%),
    var(--c-canvas);
}
body.dark .app {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(0, 212, 170, 0.07), transparent 60%),
    radial-gradient(900px 400px at -10% 100%, rgba(0, 160, 130, 0.06), transparent 50%),
    var(--c-canvas);
}

.sb-backdrop {
  display: none;
}

.sb-close {
  display: none;
  margin-left: auto;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--c-text-3);
}

.sb-ws-meta {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--c-text-4);
}

.sb-focus-card {
  margin: 0 -2px 12px;
  padding: 12px 12px 13px;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(242, 184, 75, 0.12), rgba(242, 184, 75, 0.03)),
    var(--c-bg-2);
}

.sb-focus-label {
  font-size: 10px;
  color: var(--c-text-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sb-focus-title {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sb-focus-copy {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--c-text-3);
  line-height: 1.55;
}

.tb-nav-btn {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--c-line);
  align-items: center;
  justify-content: center;
  color: var(--c-text-2);
  background: var(--c-bg-2);
}

.hero-strip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 32px 16px;
  border-bottom: 1px solid var(--c-line);
  background: var(--c-surface);
}

.hero-copy {
  min-width: 0;
  flex: 1;
}

.hero-eyebrow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-4);
}

.hero-title {
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 650;
}

.hero-summary {
  margin-top: 8px;
  max-width: 760px;
  color: var(--c-text-3);
  font-size: 12.5px;
  line-height: 1.6;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: 420px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--c-line);
  background: var(--c-bg-2);
  color: var(--c-text-2);
  font-size: 11.5px;
}

@media (max-width: 1100px) {
  .hero-strip {
    flex-direction: column;
  }

  .hero-pills {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 800px) {
  .sb-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    z-index: 89;
  }

  .sb {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, calc(100vw - 32px));
    transform: translateX(-100%);
    transition: transform .18s ease;
    z-index: 90;
  }

  .sb.open {
    transform: translateX(0);
  }

  .sb-close {
    display: inline-flex;
  }

  .tb-nav-btn {
    display: inline-flex;
  }

  .tb {
    padding: 0 14px;
    gap: 10px;
  }

  .hero-strip {
    padding: 14px;
  }

  .hero-title {
    font-size: 20px;
  }

  .content {
    padding: 16px 14px 48px;
  }
}

/* ===== dark mode — body.dark class overrides ===== */
body.dark {
  /* surfaces */
  --c-canvas:      #08090c;
  --c-bg:          #0b0c10;
  --c-bg-2:        #101117;
  --c-surface:     #14151c;
  --c-surface-2:   #181922;
  --c-elev:        #1d1e28;
  --c-elev-2:      #23252f;

  /* lines */
  --c-line:        rgba(255, 255, 255, 0.06);
  --c-line-2:      rgba(255, 255, 255, 0.10);
  --c-line-3:      rgba(255, 255, 255, 0.16);

  /* text */
  --c-text:        #f1f1f4;
  --c-text-2:      #b7b8c0;
  --c-text-3:      #80818b;
  --c-text-4:      #5a5b65;

  /* accent — electric teal for dark backgrounds */
  --a:             #00d4aa;
  --a-2:           #00b090;
  --a-soft:        rgba(0, 212, 170, 0.14);
  --a-soft-2:      rgba(0, 212, 170, 0.08);
  --a-line:        rgba(0, 212, 170, 0.32);

  /* semantic */
  --ok:            #6ad19a;
  --warn:          #e0b667;
  --err:           #ef7b80;
  --info:          #82b3ff;
  --ok-soft:       rgba(106, 209, 154, 0.12);
  --warn-soft:     rgba(224, 182, 103, 0.12);
  --err-soft:      rgba(239, 123, 128, 0.12);
  --info-soft:     rgba(130, 179, 255, 0.12);

  /* shadow */
  --shadow-1:      0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2:      0 10px 30px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.04) inset;
  --shadow-glow:   0 0 0 1px var(--a-line), 0 0 32px -8px rgba(0, 212, 170, 0.40);

  color-scheme: dark;
}

/* dark-mode selector overrides for hardcoded colors */
body.dark .sb-mark {
  background:
    radial-gradient(circle at 30% 30%, rgba(0, 212, 170, 0.55), transparent 60%),
    linear-gradient(140deg, #0d1e1c, #081512);
  box-shadow: inset 0 0 0 1px rgba(0, 212, 170, 0.12);
}
body.dark .sb-ws-avatar {
  background: linear-gradient(135deg, #3d3f55, #1c1d27);
}
body.dark .tb {
  background: rgba(11, 12, 16, 0.7);
}
body.dark .tb-avatar {
  background: linear-gradient(135deg, #0d3530, #061f1c);
}
body.dark .tb-profile-menu {
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
body.dark .hero-strip {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)),
    rgba(11, 12, 16, 0.5);
}
body.dark .tbl tbody tr:hover { background: rgba(255,255,255,0.015); }
body.dark .list-row:hover { background: rgba(255,255,255,0.015); }
body.dark .agent-avatar {
  background:
    radial-gradient(circle at 30% 30%, rgba(0, 212, 170, 0.40), transparent 60%),
    linear-gradient(135deg, #0d2420, #091816);
}
