@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ───────────────────────────────────────────────────────────
   THEME — dark by default, light via [data-theme="light"]
   ─────────────────────────────────────────────────────────── */

:root,
[data-theme="dark"] {
  --bg:        #0A0C10;
  --bg-2:      #13151A;
  --bg-3:      #1A1D24;
  --card:      #13151A;
  --card-2:    #1A1D24;
  --card-hover:#22252D;
  --line:      #2A2D35;
  --line-2:    #1E2128;
  --ink:       #E4E4E7;
  --ink-2:     #9CA3AF;
  --ink-3:     #6B7280;
  --naml-blue:        #126AFB;
  --naml-blue-dark:   #0B4FC4;
  --naml-blue-soft:   rgba(18,106,251,0.18);
  --naml-blue-glow:   rgba(18,106,251,0.35);
  --good:      #22C55E;
  --good-soft: rgba(34,197,94,0.14);
  --warn:      #F59E0B;
  --warn-soft: rgba(245,158,11,0.14);
  --crit:      #EF4444;
  --crit-soft: rgba(239,68,68,0.14);
  --purple:    #A855F7;
  --gold:      #D4A017;
  --shadow:    0 1px 3px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px -20px rgba(0,0,0,0.6);
  --sidebar-w: 260px;
  --header-h:  62px;
}

[data-theme="light"] {
  --bg:        #F4F6FA;
  --bg-2:      #FFFFFF;
  --bg-3:      #F7F9FD;
  --card:      #FFFFFF;
  --card-2:    #F7F9FD;
  --card-hover:#FAFBFE;
  --line:      #E3E8F1;
  --line-2:    #EDEFF4;
  --ink:       #0A1428;
  --ink-2:     #3A4660;
  --ink-3:     #6B7689;
  --naml-blue-soft: rgba(18,106,251,0.08);
  --naml-blue-glow: rgba(18,106,251,0.25);
  --good-soft: #E6F7EF;
  --warn-soft: #FFF1E6;
  --crit-soft: #FEE7E7;
  --shadow:    0 1px 3px rgba(10,20,40,0.05);
  --shadow-lg: 0 20px 60px -20px rgba(10,20,40,0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background: var(--bg); }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.18s ease, color 0.18s ease;
  overflow-x: hidden;
}

code, .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92em;
  letter-spacing: -0.01em;
}

a { color: var(--naml-blue); text-decoration: none; transition: color 0.15s; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* ───── BRAND ───── */
.logo-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--naml-blue), #6F2EFF);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 17px; flex-shrink: 0;
  box-shadow: 0 4px 14px var(--naml-blue-glow);
}
.brand-name {
  font-weight: 800; font-size: 17px; letter-spacing: -0.4px; color: var(--ink);
  display: flex; align-items: center;
}
.brand-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 500; color: var(--naml-blue);
  margin-left: 6px; text-transform: uppercase; letter-spacing: 1.5px;
}
.brand-meta {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  color: var(--ink-3); letter-spacing: 0.4px; margin-top: 2px;
}

/* ───── APP LAYOUT ───── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--line);
  flex-shrink: 0;
  padding: 22px 14px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
  z-index: 50;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 0 8px 18px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 18px;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--ink-3);
  padding: 4px 10px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  position: relative;
  transition: all 0.15s ease;
}
.nav-item:hover {
  background: var(--card-hover);
  color: var(--ink);
  text-decoration: none;
}
.nav-item.active {
  background: var(--naml-blue-soft);
  color: var(--naml-blue);
  font-weight: 700;
}
.nav-item.active::before {
  content: ''; position: absolute;
  left: -14px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--naml-blue);
  box-shadow: 0 0 12px var(--naml-blue-glow);
}
.nav-item svg { flex-shrink: 0; opacity: 0.75; }
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto; width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
}
.nav-badge.ok {
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
}
.nav-badge.pending { background: var(--ink-3); opacity: 0.4; }

.nav-meta {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--ink-3);
  letter-spacing: 0.5px;
}

.sidebar-foot {
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
  margin-top: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.theme-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border: none; background: transparent; cursor: pointer;
  border-radius: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; color: var(--ink-2); font-weight: 500;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.theme-toggle:hover { background: var(--card-hover); color: var(--ink); }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: inline-block; }
.signout {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px; color: var(--ink-3);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.signout:hover { background: var(--crit-soft); color: var(--crit); text-decoration: none; }

/* ───── MAIN ───── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--card);
  background: color-mix(in srgb, var(--card) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 14px 32px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
}
.page-title { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; color: var(--ink); }
.topbar-right { display: flex; gap: 14px; align-items: center; }

.live-badge {
  display: flex; align-items: center; gap: 6px;
  background: var(--good-soft);
  color: var(--good);
  padding: 5px 11px;
  border-radius: 100px;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.3px;
  border: 1px solid color-mix(in srgb, var(--good) 30%, transparent);
}
.live-dot {
  width: 6px; height: 6px;
  background: var(--good);
  border-radius: 50%;
  animation: pulse 1.6s infinite;
  box-shadow: 0 0 8px var(--good);
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
.topbar-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; color: var(--ink-3);
  letter-spacing: 0.4px;
}

.content { padding: 28px 32px 80px; max-width: 1480px; width: 100%; margin: 0 auto; }

/* ───── HERO CARD ───── */
.hero-card {
  background: linear-gradient(135deg, #0A1428 0%, #0B4FC4 100%);
  color: white;
  border-radius: 16px;
  padding: 32px 36px;
  display: flex; justify-content: space-between; align-items: center; gap: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -40%; right: -20%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.06), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-left { position: relative; z-index: 1; flex: 1; }
.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.4px;
  opacity: 0.7;
  margin-bottom: 10px;
}
.hero-title {
  font-size: 30px; font-weight: 800; letter-spacing: -0.6px;
  line-height: 1.15; margin-bottom: 8px;
  color: white;
}
.hero-sub { font-size: 14.5px; opacity: 0.85; max-width: 580px; margin-bottom: 20px; }
.hero-actions { display: flex; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 9px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  border: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--naml-blue); color: white; box-shadow: 0 4px 14px var(--naml-blue-glow); }
.btn.primary:hover { background: var(--naml-blue-dark); box-shadow: 0 6px 20px var(--naml-blue-glow); }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.btn.ghost:hover { background: var(--card-hover); color: var(--ink); border-color: var(--ink-3); }
.btn.small { padding: 7px 13px; font-size: 12px; border-radius: 7px; }
.hero-card .btn.primary { background: white; color: var(--ink); box-shadow: none; }
.hero-card .btn.primary:hover { background: rgba(255,255,255,0.92); }
.hero-card .btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
}
.hero-card .btn.ghost:hover { background: rgba(255,255,255,0.1); }

.hero-stats { display: flex; gap: 16px; position: relative; z-index: 1; }
.hero-stat {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 11px;
  padding: 14px 18px;
  text-align: center;
  min-width: 90px;
  backdrop-filter: blur(8px);
}
.hero-stat .num { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.hero-stat .lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; opacity: 0.8;
  text-transform: uppercase; letter-spacing: 1.2px; margin-top: 4px;
}

/* ───── KPI GRID ───── */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  position: relative;
  transition: border-color 0.15s, transform 0.15s;
  overflow: hidden;
}
.kpi-card:hover {
  border-color: var(--naml-blue-soft);
  transform: translateY(-1px);
}
.kpi-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0; width: 80px; height: 80px;
  background: radial-gradient(circle at 100% 0, var(--naml-blue-soft), transparent 70%);
  pointer-events: none;
  opacity: 0; transition: opacity 0.2s;
}
.kpi-card:hover::after { opacity: 1; }
.kpi-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--ink-3); margin-bottom: 10px;
}
.kpi-val {
  font-size: 28px; font-weight: 800; letter-spacing: -0.6px;
  color: var(--ink); line-height: 1; margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.kpi-unit { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.kpi-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

/* ───── CARD ───── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 18px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--ink-3); }
.card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-2);
}
.card-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; color: var(--ink); }
.card-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3); letter-spacing: 0.5px;
}
.card-body { padding: 22px; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }

/* ───── EMPTY STATES ───── */
.brief-empty, .empty-state {
  text-align: center; padding: 30px 20px;
}
.brief-empty {
  font-size: 13.5px; color: var(--ink-3); line-height: 1.7;
}
.brief-empty code {
  background: var(--bg-3); padding: 1px 6px; border-radius: 4px;
  color: var(--ink); margin: 0 2px;
}
.empty-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: var(--ink-3);
  margin: 0 auto 12px;
}
.empty-title {
  font-size: 14.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px;
}
.empty-sub {
  font-size: 12.5px; color: var(--ink-3); max-width: 320px; margin: 0 auto;
}

/* ───── INTEGRATION HEALTH ───── */
.integ-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.integ-cat {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--card-2);
}
.integ-cat-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; font-weight: 700;
  margin-bottom: 10px;
  color: var(--ink);
}
.integ-cat-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.4px;
}
.integ-list { display: flex; flex-direction: column; gap: 6px; }
.integ-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--ink-2);
}
.integ-pill.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.integ-pill .dot { flex-shrink: 0; }

.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
}
.dot.ok { background: var(--good); box-shadow: 0 0 6px var(--good); }
.dot.pending { background: var(--ink-3); opacity: 0.5; }

/* ───── SECTION PAGES ───── */
.section-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 28px;
  padding-bottom: 22px; margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.section-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--naml-blue); margin-bottom: 6px;
}
.section-title {
  font-size: 28px; font-weight: 800; letter-spacing: -0.5px;
  line-height: 1.2; margin-bottom: 6px; color: var(--ink);
}
.section-sub { color: var(--ink-2); font-size: 14px; max-width: 660px; line-height: 1.6; }
.section-sub code {
  background: var(--bg-3); padding: 1px 6px; border-radius: 4px;
}
.section-status { padding-top: 6px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.status-pill.ok { background: var(--good-soft); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 30%, transparent); }
.status-pill.pending { background: var(--card-2); color: var(--ink-3); border: 1px solid var(--line); }

.connect-prompt {
  background: linear-gradient(135deg, var(--naml-blue-soft) 0%, transparent 100%);
  border: 1px solid color-mix(in srgb, var(--naml-blue) 25%, transparent);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex; gap: 18px; align-items: center;
  margin-bottom: 22px;
}
.connect-icon {
  width: 44px; height: 44px;
  background: var(--naml-blue);
  color: white;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--naml-blue-glow);
}
.connect-body { flex: 1; }
.connect-body h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--ink); }
.connect-body p { font-size: 13.5px; color: var(--ink-2); margin-bottom: 4px; }
.connect-keys { font-size: 12px; color: var(--ink-3); }
.connect-keys code {
  background: var(--card); padding: 2px 7px; border-radius: 4px;
  font-size: 11px; color: var(--naml-blue); font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--naml-blue) 30%, transparent);
}

.section-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.section-grid .card { margin-bottom: 0; }

.placeholder-skeleton { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.skeleton-row { height: 16px; display: flex; align-items: center; }
.skel-bar {
  display: block; height: 9px;
  background: linear-gradient(90deg, var(--bg-3), var(--line), var(--bg-3));
  background-size: 200% 100%;
  border-radius: 100px;
  animation: shine 1.6s infinite;
}
.skel-bar.w-1 { width: 60%; }
.skel-bar.w-2 { width: 80%; }
.skel-bar.w-3 { width: 45%; }
@keyframes shine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ───── LOGIN ───── */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
  background: radial-gradient(circle at 50% 20%, var(--naml-blue-soft), transparent 60%), var(--bg);
}
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 40px;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-card .brand-row { display: flex; align-items: center; gap: 10px; }
.login-card h1 {
  font-size: 26px; font-weight: 800; letter-spacing: -0.5px;
  margin: 22px 0 4px; color: var(--ink);
}
.login-card .subtitle { color: var(--ink-3); font-size: 13.5px; margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; }
.login-form label > span {
  font-size: 12px; color: var(--ink-2); font-weight: 600;
}
.login-form input {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-3);
  color: var(--ink);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-form input:focus {
  outline: none;
  border-color: var(--naml-blue);
  box-shadow: 0 0 0 3px var(--naml-blue-soft);
}
.login-form button {
  margin-top: 6px;
  background: var(--naml-blue); color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 9px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--naml-blue-glow);
  transition: all 0.15s;
}
.login-form button:hover { background: var(--naml-blue-dark); box-shadow: 0 6px 20px var(--naml-blue-glow); }
.login-card .error {
  background: var(--crit-soft); color: var(--crit);
  padding: 10px 14px; border-radius: 9px;
  font-size: 13px; margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--crit) 30%, transparent);
}
.login-card .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 18px; text-align: center; }
.login-card code { background: var(--bg-3); padding: 1px 6px; border-radius: 4px; }

/* ───── SETTINGS ───── */
.settings-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 28px;
  padding-bottom: 22px; margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.status-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 20px;
  min-width: 200px; text-align: right;
}
.status-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--ink-3); margin-bottom: 4px;
}
.status-num { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; color: var(--ink); }
.status-bar {
  margin-top: 8px; height: 4px;
  background: var(--bg-3); border-radius: 100px; overflow: hidden;
}
.status-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--naml-blue), #6F2EFF);
  border-radius: 100px; transition: width 0.3s;
}
.banner {
  padding: 12px 16px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  margin-bottom: 18px;
}
.banner.ok { background: var(--good-soft); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 30%, transparent); }
.cat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 26px;
  margin-bottom: 18px;
}
.cat-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line-2);
}
.cat-head h2 { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; color: var(--ink); }
.cat-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.6px;
}
.cat-grid { display: flex; flex-direction: column; gap: 16px; }
.cred-row {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 24px; align-items: start;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line-2);
}
.cred-row:last-child { border-bottom: none; }
.cred-meta label {
  font-size: 14px; font-weight: 700; color: var(--ink);
  display: block; margin-bottom: 3px;
}
.cred-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3); letter-spacing: 0.4px; margin-bottom: 4px;
}
.cred-desc { font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.cred-updated {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--good); margin-top: 4px;
}
.cred-input { display: flex; flex-direction: column; gap: 6px; }
.cred-input input,
.cred-input textarea {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 9px; width: 100%;
  background: var(--bg-3);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cred-input input:focus,
.cred-input textarea:focus {
  outline: none; border-color: var(--naml-blue);
  box-shadow: 0 0 0 3px var(--naml-blue-soft);
}
.cred-input textarea { resize: vertical; min-height: 90px; }
.cred-status {
  display: flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.4px;
  color: var(--ink-3);
}
.cred-row.ok .cred-input input,
.cred-row.ok .cred-input textarea {
  background: color-mix(in srgb, var(--good) 6%, var(--bg-3));
  border-color: color-mix(in srgb, var(--good) 30%, var(--line));
}
.actions {
  margin-top: 22px;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; bottom: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}
.actions .hint { font-size: 12px; color: var(--ink-3); }
.actions button.primary {
  background: var(--naml-blue); color: white;
  border: none;
  padding: 11px 22px;
  border-radius: 9px;
  font-size: 13.5px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--naml-blue-glow);
}
.actions button.primary:hover { background: var(--naml-blue-dark); }

/* ───── CONTEXT BAR (used in journey page) ───── */
.ctx-bar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.ctx-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ctx-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--ink-3);
}
.ctx-ref {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px; font-weight: 600;
  background: var(--bg-3); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 6px;
  color: var(--ink); letter-spacing: -0.01em;
}
.ctx-edit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  color: var(--naml-blue); text-decoration: none;
  letter-spacing: 0.4px;
}
.ctx-edit:hover { text-decoration: underline; }

/* ───── JOURNEY PAGE CONTROLS ───── */
.users-controls {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 18px;
}
.control-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-group.toggle-group { flex: 1; min-width: 280px; }
.control-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--ink-3);
}
.control-input {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-3);
  color: var(--ink);
  min-width: 180px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.control-input:focus {
  outline: none; border-color: var(--naml-blue);
  box-shadow: 0 0 0 3px var(--naml-blue-soft);
}
select.control-input { cursor: pointer; }

.toggle-pills {
  display: inline-flex;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  gap: 1px;
}
.toggle-pill {
  border: none; background: transparent;
  padding: 7px 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 600;
  color: var(--ink-3);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.toggle-pill:hover { color: var(--ink); }
.toggle-pill[aria-pressed="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

#run-queries, #reload-btn { margin-left: auto; }

.auth-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 12.5px; line-height: 1.5;
  text-align: right;
  max-width: 320px;
}
.auth-warn small { color: var(--warn); display: block; margin-top: 4px; }
.auth-warn small a { font-weight: 600; }

.data-table { min-height: 100px; }
.data-tbl {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.data-tbl thead th {
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ink-3);
  padding: 9px 12px;
  border-bottom: 1.5px solid var(--line);
}
.data-tbl tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink);
}
.data-tbl tbody tr:last-child td { border-bottom: none; }
.data-tbl tbody tr:hover { background: var(--card-hover); }
.data-tbl td.num {
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.data-tbl td.truncate {
  max-width: 280px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px;
  color: var(--ink-2);
}

.sql-block {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  white-space: pre-wrap;
  color: var(--ink-2);
  max-height: 220px;
  overflow-y: auto;
  line-height: 1.5;
}
.query-status { margin-top: 12px; }
.mcp-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg-3);
  color: var(--ink-2);
  letter-spacing: 0.2px;
}
.mcp-status.ok { background: var(--good-soft); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 30%, transparent); }
.mcp-status.err { background: var(--crit-soft); color: var(--crit); border: 1px solid color-mix(in srgb, var(--crit) 30%, transparent); }

/* ───── MCP SERVERS ───── */
.mcp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}
.mcp-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.mcp-card:hover { transform: translateY(-1px); }
.mcp-card.connected { border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.mcp-head {
  display: flex; gap: 14px; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-2);
}
.mcp-icon {
  font-size: 26px;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mcp-card.connected .mcp-icon { background: var(--good-soft); }
.mcp-info { flex: 1; min-width: 0; }
.mcp-info h3 {
  font-size: 15px; font-weight: 700; letter-spacing: -0.2px;
  margin-bottom: 3px; color: var(--ink);
}
.mcp-info p { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.mcp-body { padding: 16px 20px 18px; }
.mcp-meta { margin-bottom: 14px; }
.meta-row {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0;
  font-size: 12px;
}
.meta-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ink-3); min-width: 80px;
}
.meta-row code {
  background: var(--bg-3);
  padding: 2px 7px; border-radius: 4px;
  font-size: 11.5px; color: var(--ink);
}
.wires { display: flex; flex-wrap: wrap; gap: 6px; }
.wire-pill {
  background: var(--naml-blue-soft);
  color: var(--naml-blue);
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
  text-decoration: none;
  text-transform: capitalize;
}
.wire-pill:hover { background: var(--naml-blue); color: white; text-decoration: none; }
.mcp-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px dashed var(--line-2);
}
.btn.small.primary { background: var(--naml-blue); color: white; }
.btn.small.primary:hover { background: var(--naml-blue-dark); }
.btn.small.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
.btn.small.ghost:hover { background: var(--card-hover); border-color: var(--ink-3); color: var(--ink); }
.mcp-output { margin-top: 12px; }
.mcp-output:empty { display: none; }
.mcp-server-info {
  margin-top: 6px; display: flex; flex-direction: column; gap: 2px;
  font-size: 11px; color: var(--ink-3);
}
.mcp-server-info code {
  background: rgba(255,255,255,0.05);
  padding: 1px 5px; border-radius: 3px; color: var(--ink);
}
.mcp-tools-list {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  max-height: 320px;
  overflow-y: auto;
}
.tools-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--naml-blue);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-2);
}
.tool-row {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-2);
}
.tool-row:last-child { border-bottom: none; }
.tool-name code {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 5px;
  font-size: 11.5px; font-weight: 600;
  color: var(--ink);
}
.tool-desc { margin-top: 4px; font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.tool-args { margin-top: 4px; font-size: 11px; color: var(--ink-3); }
.tool-args code { background: var(--card); padding: 1px 6px; border-radius: 3px; font-size: 10.5px; }

/* ───────────────────────────────────────────
   USERS PAGE — main table + actions
   ─────────────────────────────────────────── */
.users-shell { display: block; }

.users-filters {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  margin-bottom: 16px;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-search { flex: 1; min-width: 240px; }
.filter-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--ink-3);
}
.filter-group .control-input { min-width: 170px; }

.users-card { padding: 0; overflow: hidden; }
.users-tablewrap { overflow-x: auto; }
.users-tbl {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.users-tbl thead th {
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ink-3);
  padding: 11px 14px;
  border-bottom: 1.5px solid var(--line);
  background: var(--bg-3);
  white-space: nowrap;
  position: sticky; top: 0;
}
.users-tbl thead th.num { text-align: right; }
.users-tbl tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink);
  vertical-align: middle;
  white-space: nowrap;
}
.users-tbl tbody tr:last-child td { border-bottom: none; }
.users-tbl tbody tr { transition: background 0.12s; }
.users-tbl tbody tr:hover { background: var(--card-hover); }
.users-tbl tbody tr.fading { opacity: 0.3; transition: opacity 0.4s; }
.users-tbl td.num {
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.users-tbl td.dim { color: var(--ink-3); }

.user-cell { display: flex; align-items: center; gap: 11px; }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--naml-blue), #6F2EFF);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-name {
  font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 240px; font-size: 13px;
}
.user-sub {
  font-size: 11.5px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 240px;
  font-family: 'JetBrains Mono', monospace;
}

.device-pill {
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--ink-2); letter-spacing: 0.3px;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.3px;
}
.badge.good { background: var(--good-soft); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 30%, transparent); }
.naml-tier-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.2px;
  background: color-mix(in srgb, var(--naml-blue) 14%, transparent);
  color: var(--naml-blue);
  border: 1px solid color-mix(in srgb, var(--naml-blue) 35%, transparent);
}
.dim { color: var(--ink-3); }

/* per-row action menu */
.row-actions { position: relative; }
.row-actions-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-2);
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px; font-weight: 700;
  transition: all 0.12s;
}
.row-actions-btn:hover { background: var(--card-hover); color: var(--ink); border-color: var(--ink-3); }
.row-actions-menu {
  position: absolute;
  right: 0; top: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-lg);
  z-index: 30;
  min-width: 200px;
  padding: 4px;
  display: none;
}
.row-actions-menu.open { display: block; }
.row-action-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  display: flex; align-items: center; gap: 8px;
  color: var(--ink);
  transition: background 0.12s;
}
.row-action-item:hover { background: var(--card-hover); }
.row-action-item.danger { color: var(--crit); }
.row-action-item .ico { width: 14px; opacity: 0.7; }
.row-action-divider { height: 1px; background: var(--line-2); margin: 4px 0; }

.loading-row { padding: 20px !important; }

.hint-box {
  background: linear-gradient(135deg, var(--naml-blue-soft) 0%, transparent 100%);
  border: 1px solid color-mix(in srgb, var(--naml-blue) 25%, transparent);
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 14px;
}
.hint-title {
  font-size: 12.5px; font-weight: 700; color: var(--naml-blue);
  margin-bottom: 4px;
}
.hint-body { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.hint-body code {
  background: var(--card); padding: 1px 6px; border-radius: 3px;
  font-size: 11.5px; color: var(--naml-blue); font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--naml-blue) 30%, transparent);
}

.toast {
  position: fixed; bottom: 100px; right: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 13px; color: var(--ink);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex; align-items: center; gap: 8px;
  animation: toastIn 0.25s ease, toastOut 0.3s ease 2.7s forwards;
}
.toast.ok { border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.toast.err { border-color: color-mix(in srgb, var(--crit) 30%, transparent); }
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateY(20px); opacity: 0; } }

/* ───────────────────────────────────────────
   ASK AI v2 — full page
   ─────────────────────────────────────────── */
.ask-hero {
  position: relative;
  background: linear-gradient(135deg, #0A1428 0%, #0B4FC4 100%);
  border-radius: 16px;
  padding: 32px 36px;
  margin-bottom: 18px;
  overflow: hidden;
  color: white;
  box-shadow: var(--shadow-lg);
}
.ask-hero-glow {
  position: absolute;
  top: -50%; right: -20%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.07), transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.ask-hero-inner { position: relative; z-index: 1; }
.ask-hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 1.4px; text-transform: uppercase;
  opacity: 0.7; margin-bottom: 10px;
}
.ask-hero-title {
  font-size: 32px; font-weight: 800; letter-spacing: -0.6px;
  line-height: 1.1; margin-bottom: 8px; color: white;
}
.ask-hero-title .grad {
  background: linear-gradient(90deg, #4ABFFF, #FFD3A1);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.ask-hero-sub { font-size: 14px; opacity: 0.85; }
.ask-hero-sub code { background: rgba(255,255,255,0.12); padding: 1px 7px; border-radius: 4px; font-size: 12.5px; }

.ask2 {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 16px;
  height: calc(100vh - 290px); min-height: 480px;
}
.ask2-rail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 16px;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.rail-section { margin-bottom: 18px; }
.rail-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--ink-3);
  padding: 0 6px 8px;
}
.sugg-card {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12.5px; font-weight: 500;
  color: var(--ink); text-align: left;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.12s ease;
}
.sugg-card:hover {
  background: var(--card-hover);
  border-color: var(--naml-blue);
  color: var(--naml-blue);
}
.sugg-card:active { transform: translateY(1px); }
.sugg-icon { font-size: 16px; flex-shrink: 0; }
.sugg-text { flex: 1; }
.rail-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-2); }
.rail-clear {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
}
.rail-clear:hover { color: var(--crit); border-color: var(--crit); background: var(--crit-soft); }

.ask2-main {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
}
.ask2-feed { flex: 1; overflow-y: auto; padding: 26px 32px; display: flex; flex-direction: column; gap: 18px; }
.ask2-empty { margin: auto; text-align: center; max-width: 420px; padding: 32px 16px; }
.ask2-empty-icon { margin-bottom: 18px; display: inline-block; }
.ask2-empty h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.4px;
  color: var(--ink); margin-bottom: 6px;
}
.ask2-empty p { font-size: 13.5px; color: var(--ink-3); line-height: 1.55; }
.ask2-empty p code { background: var(--bg-3); padding: 1px 6px; border-radius: 4px; }

.msg2 { display: flex; gap: 12px; }
.msg2-user { flex-direction: row-reverse; }
.msg2-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--naml-blue);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 700;
  flex-shrink: 0; letter-spacing: 0.4px;
}
.msg2-avatar.ai { background: linear-gradient(135deg, #126AFB, #6F2EFF); }
.msg2-avatar.err { background: var(--crit); }
.msg2-bubble {
  max-width: 84%;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 13px;
  padding: 14px 18px;
  font-size: 14px; line-height: 1.7;
  color: var(--ink);
}
.msg2-user .msg2-bubble {
  background: var(--naml-blue-soft);
  border-color: color-mix(in srgb, var(--naml-blue) 30%, transparent);
  border-bottom-right-radius: 4px;
}
.msg2-assistant .msg2-bubble { border-bottom-left-radius: 4px; background: var(--card-2); }
.msg2-error .msg2-bubble { background: var(--crit-soft); border-color: color-mix(in srgb, var(--crit) 30%, transparent); color: var(--crit); }
.msg2-bubble p { margin-bottom: 8px; }
.msg2-bubble p:last-child { margin-bottom: 0; }
.msg2-bubble code {
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px;
  background: var(--bg-3); padding: 1px 5px; border-radius: 3px;
}
.msg2-bubble ul { margin: 6px 0 8px 18px; }
.msg2-bubble li { margin-bottom: 3px; }
.msg2-bubble strong { font-weight: 700; color: var(--ink); }

.msg2-tools { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.msg2-tools summary {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3);
  cursor: pointer; letter-spacing: 0.3px; user-select: none;
  display: flex; align-items: center; gap: 6px;
}
.tools-icon { color: var(--naml-blue); }
.msg2-tools summary:hover { color: var(--ink); }
.tool-call2 {
  margin-top: 10px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 10px 12px;
}
.tc-purpose { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.tc-sql {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 8px 10px;
  white-space: pre-wrap;
  color: var(--ink-2);
  margin-bottom: 6px;
  max-height: 200px; overflow-y: auto;
}
.tc-meta {
  display: flex; gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--ink-3);
}
.tc-meta .err { color: var(--crit); }

.msg2-thinking .dots { display: flex; gap: 5px; padding: 4px 0; }
.msg2-thinking .dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-3);
  animation: bounce 1.2s infinite ease-in-out;
}
.msg2-thinking .dots span:nth-child(2) { animation-delay: 0.2s; }
.msg2-thinking .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

.ask2-input { border-top: 1px solid var(--line); padding: 14px 26px 16px; background: var(--card); }
.ask2-input-wrap {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--bg-3);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px 8px 14px;
  transition: all 0.15s;
}
.ask2-input-wrap:focus-within {
  border-color: var(--naml-blue);
  box-shadow: 0 0 0 3px var(--naml-blue-soft);
}
#ask-input {
  flex: 1; border: none; background: transparent; outline: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14.5px; line-height: 1.5;
  resize: none;
  min-height: 24px; max-height: 200px;
  padding: 6px 0;
  color: var(--ink);
}
.icon-btn {
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; color: var(--ink-3);
  padding: 6px 10px; border-radius: 8px;
  transition: all 0.12s;
}
.icon-btn:hover { color: var(--naml-blue); background: var(--card); }
.send-btn {
  background: var(--naml-blue); color: white;
  border: none; border-radius: 8px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
  box-shadow: 0 2px 8px var(--naml-blue-glow);
}
.send-btn:hover { background: var(--naml-blue-dark); }
.send-btn:active { transform: scale(0.96); }
.ask2-input-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--ink-3);
  margin-top: 8px; letter-spacing: 0.2px; text-align: right;
}
.ask2-input-hint code { background: var(--bg-3); padding: 1px 4px; border-radius: 3px; }

/* ═══════════════════════════════════════════
   GLOBAL ASK AI WIDGET (floating)
   ═══════════════════════════════════════════ */
.ai-fab {
  /* Moved 2026-05-25: bottom-right → top-LEFT (was blocking content + colliding with toasts). */
  position: fixed; top: 12px; left: 14px;
  width: auto; height: 34px;
  padding: 0 12px 0 10px;
  background: linear-gradient(135deg, var(--naml-blue) 0%, #6F2EFF 100%);
  color: white;
  border-radius: 100px;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--naml-blue-glow), 0 1px 3px rgba(0,0,0,0.10);
  z-index: 1100; /* sit above topbar */
  transition: all 0.15s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 700;
  user-select: none;
  opacity: 0.92;
}
.ai-fab:hover {
  transform: scale(1.04);
  opacity: 1;
  box-shadow: 0 4px 14px var(--naml-blue-glow), 0 2px 6px rgba(0,0,0,0.14);
}
.ai-fab svg { width: 14px !important; height: 14px !important; }
.ai-fab-pulse { display: none !important; } /* kill the pulsing aura — too noisy at top */
.ai-fab svg {
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.3));
  animation: spinSlow 6s infinite linear;
}
@keyframes spinSlow {
  0% { transform: rotate(0); }
  50% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}
.ai-fab-label {
  letter-spacing: 0.2px;
}
.ai-fab-pulse {
  position: absolute;
  inset: 0;
  border-radius: 100px;
  background: var(--naml-blue);
  z-index: -1;
  animation: fabPulse 2.4s ease-out infinite;
}
@keyframes fabPulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.4); opacity: 0; }
}

.ai-panel {
  /* Anchored top-LEFT under the FAB (2026-05-25 reposition). */
  position: fixed;
  top: 56px; left: 14px;
  right: auto; bottom: auto;
  width: 540px; max-width: calc(100vw - 28px);
  height: 640px; max-height: calc(100vh - 80px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.04);
  z-index: 1090;
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: translateY(-12px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.ai-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0A1428 0%, #0B4FC4 100%);
  color: white;
  border-bottom: 1px solid var(--line);
}
.ai-panel-title { display: flex; align-items: center; gap: 10px; }
.ai-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--naml-blue), #6F2EFF);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--naml-blue-glow);
}
.ai-panel-name { font-size: 14px; font-weight: 700; letter-spacing: -0.2px; }
.ai-panel-sub {
  font-size: 11px; opacity: 0.75;
  display: flex; align-items: center; gap: 5px;
  margin-top: 1px;
}
.ai-panel-sub .dot { width: 5px; height: 5px; }
.ai-panel-actions { display: flex; gap: 4px; }
.ai-action-btn {
  width: 28px; height: 28px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: white;
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s;
}
.ai-action-btn:hover { background: rgba(255,255,255,0.22); }

.ai-panel-body {
  flex: 1; overflow-y: auto;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg);
}
.ai-empty { margin: auto; text-align: center; padding: 16px; max-width: 320px; }
.ai-empty-icon { margin-bottom: 10px; }
.ai-empty-title { font-size: 14.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.ai-empty-sub { font-size: 12px; color: var(--ink-3); line-height: 1.5; margin-bottom: 14px; }
.ai-suggestions-mini { display: flex; flex-direction: column; gap: 6px; }
.sugg-mini {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: all 0.12s;
}
.sugg-mini:hover {
  border-color: var(--naml-blue);
  background: var(--naml-blue-soft);
  color: var(--naml-blue);
}

.ai-msg { display: flex; gap: 8px; align-items: flex-start; }
.ai-msg-user { flex-direction: row-reverse; }
.ai-msg-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; font-weight: 700;
  flex-shrink: 0;
  color: white;
}
.ai-msg-avatar.user { background: var(--naml-blue); }
.ai-msg-avatar.ai { background: linear-gradient(135deg, #126AFB, #6F2EFF); }
.ai-msg-bubble {
  max-width: 86%;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13.5px; line-height: 1.65;
  color: var(--ink);
  word-wrap: break-word;
}
.ai-msg-user .ai-msg-bubble {
  background: var(--naml-blue-soft);
  border-color: color-mix(in srgb, var(--naml-blue) 30%, transparent);
  border-bottom-right-radius: 4px;
}
.ai-msg-assistant .ai-msg-bubble { border-bottom-left-radius: 4px; }
.ai-msg-error .ai-msg-bubble { background: var(--crit-soft); border-color: color-mix(in srgb, var(--crit) 30%, transparent); color: var(--crit); }
.ai-msg-bubble p { margin-bottom: 6px; }
.ai-msg-bubble p:last-child { margin-bottom: 0; }
.ai-msg-bubble strong { color: var(--ink); font-weight: 700; }
.ai-msg-bubble code {
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px;
  background: var(--bg-3); padding: 1px 5px; border-radius: 3px;
}
.ai-msg-bubble ul { margin: 4px 0 6px 16px; }
.ai-msg-bubble li { margin-bottom: 2px; }

.ai-msg-tools { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line-2); }
.ai-msg-tools summary {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--ink-3);
  cursor: pointer; user-select: none;
}
.ai-tc {
  margin-top: 6px;
  background: var(--bg-3);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
}
.ai-tc-purpose { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.ai-tc pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 5px 7px;
  white-space: pre-wrap;
  color: var(--ink-2);
  max-height: 100px;
  overflow-y: auto;
}
.ai-tc-err { color: var(--crit); margin-top: 3px; font-size: 10.5px; }

.ai-msg-thinking .ai-msg-bubble .dots {
  display: flex; gap: 4px; padding: 2px 0;
}
.ai-msg-thinking .dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-3);
  animation: bounce 1.2s infinite ease-in-out;
}
.ai-msg-thinking .dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-msg-thinking .dots span:nth-child(3) { animation-delay: 0.4s; }

.ai-panel-input {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  display: flex; gap: 8px; align-items: flex-end;
  background: var(--card);
}
#ai-input {
  flex: 1;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-3);
  color: var(--ink);
  resize: none;
  line-height: 1.45;
  min-height: 36px; max-height: 140px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#ai-input:focus {
  border-color: var(--naml-blue);
  box-shadow: 0 0 0 2px var(--naml-blue-soft);
}
.ai-send-btn {
  background: var(--naml-blue); color: white;
  border: none; border-radius: 9px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}
.ai-send-btn:hover { background: var(--naml-blue-dark); }
.ai-send-btn:active { transform: scale(0.95); }

/* ───────────── LEADS PAGE ───────────── */
.header-actions { display: flex; gap: 8px; align-items: center; }

.tab-bar {
  display: flex; gap: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab-btn {
  border: none; background: transparent;
  padding: 9px 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}
.tab-btn:hover { background: var(--card-hover); color: var(--ink); }
.tab-btn.active {
  background: var(--naml-blue-soft);
  color: var(--naml-blue);
  font-weight: 700;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.18s; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-grid { display: grid; gap: 12px; max-width: 720px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row-wide { grid-column: span 2; }
.form-row label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ink-3);
}
.form-row input, .form-row select, .form-row textarea {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-3);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--naml-blue);
  box-shadow: 0 0 0 3px var(--naml-blue-soft);
}
.form-row textarea { resize: vertical; min-height: 80px; }
.form-actions { padding-top: 8px; }

.scrape-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--card-2);
  border-bottom: 1px solid var(--line-2);
}
.scrape-actions .control-input { flex: 1; min-width: 180px; }

.tag-list {
  display: flex; gap: 4px; flex-wrap: wrap;
  max-width: 240px;
}
.tag-pill {
  background: var(--naml-blue-soft);
  color: var(--naml-blue);
  padding: 1px 8px;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.src-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.status-pill-row {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.status-select {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-3);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Apify scrape table checkboxes */
.users-tbl input[type="checkbox"], .scrape-check, .amz-check {
  width: 16px; height: 16px;
  cursor: pointer;
  accent-color: var(--naml-blue);
}

/* ───────────── AMAZON SEARCH PAGE ───────────── */
.amz-form { display: flex; flex-direction: column; gap: 14px; }
.amz-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.amz-row .control-input { padding: 11px 14px; font-size: 14px; }
.amz-quicks {
  display: flex; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--ink-3);
  align-items: center;
}
.quick-chip {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 4px 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11.5px; font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.12s;
}
.quick-chip:hover {
  background: var(--naml-blue-soft);
  border-color: var(--naml-blue);
  color: var(--naml-blue);
}

.amz-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 16px 18px;
}
.amz-card {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
  transition: border-color 0.15s;
}
.amz-card:hover { border-color: var(--ink-3); }
.amz-card .amz-check {
  position: absolute; top: 10px; right: 10px;
  width: 18px; height: 18px;
}
.amz-img {
  width: 100%; height: 160px;
  object-fit: contain;
  background: white;
  border-radius: 8px;
}
.amz-img-empty {
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3);
  background: var(--bg-3);
}
.amz-info { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.amz-title {
  font-size: 13px; font-weight: 600; color: var(--ink);
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.amz-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.amz-brand {
  background: var(--purple-dim); color: var(--purple);
  padding: 1px 7px; border-radius: 100px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: 0.3px; text-transform: uppercase;
}
.amz-asin {
  background: var(--bg-3); color: var(--ink-3);
  padding: 1px 7px; border-radius: 100px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
}
.amz-bottom {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: auto;
}
.amz-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14.5px; font-weight: 700; color: var(--ink);
}
.amz-rating { font-size: 11.5px; color: var(--warn); }
.amz-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--naml-blue);
  text-decoration: none;
  margin-top: 4px;
}
.amz-link:hover { text-decoration: underline; }

:root, [data-theme="dark"] { --purple-dim: rgba(168,85,247,0.15); }
[data-theme="light"] { --purple-dim: rgba(168,85,247,0.1); }

/* ─────────── MARKDOWN OUTPUT (AI replies) ─────────── */
.md-h2 { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; margin: 12px 0 6px; color: var(--ink); }
.md-h3 { font-size: 14.5px; font-weight: 700; letter-spacing: -0.2px; margin: 14px 0 6px; color: var(--ink); }
.md-h4 { font-size: 13px; font-weight: 700; margin: 12px 0 4px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.6px; font-family: 'JetBrains Mono', monospace; }
.md-h5 { font-size: 12px; font-weight: 700; margin: 10px 0 3px; color: var(--ink-3); }
.msg2-bubble p, .ai-msg-bubble p { margin: 0 0 8px; }
.msg2-bubble p:last-child, .ai-msg-bubble p:last-child { margin-bottom: 0; }
.md-ul, .md-ol { margin: 6px 0 10px 22px; }
.md-ul li, .md-ol li { margin-bottom: 5px; line-height: 1.6; }
.md-quote {
  border-left: 3px solid var(--naml-blue);
  padding: 8px 14px;
  background: var(--bg-3);
  border-radius: 0 8px 8px 0;
  margin: 10px 0;
  color: var(--ink-2);
  font-style: italic;
}
.md-code {
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--ink-2);
  overflow-x: auto;
  margin: 8px 0;
  white-space: pre;
  line-height: 1.5;
}
.md-hr {
  border: none;
  border-top: 1px dashed var(--line);
  margin: 12px 0;
}
.md-table-wrap {
  margin: 10px 0 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  max-width: 100%;
}
.md-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.md-table thead th {
  background: var(--bg-3);
  text-align: left;
  padding: 9px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ink-3);
  border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
  position: sticky; top: 0;
}
.md-table tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink);
  vertical-align: middle;
  line-height: 1.5;
}
.md-table tbody tr:last-child td { border-bottom: none; }
.md-table tbody tr:hover { background: var(--card-hover); }
.md-table code {
  background: var(--bg-3); padding: 1px 5px; border-radius: 3px;
  font-size: 11px; color: var(--ink);
}

/* Inline content colors */
.m-price {
  color: var(--good);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.95em;
  letter-spacing: -0.01em;
  background: var(--good-soft);
  padding: 1px 6px;
  border-radius: 4px;
}
.m-rating {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.95em;
  background: rgba(212,160,23,0.15);
  padding: 1px 6px;
  border-radius: 4px;
}
.m-pos { color: var(--good); font-weight: 700; }
.m-neg { color: var(--crit); font-weight: 700; }
.m-strike { color: var(--ink-3); text-decoration: line-through; }
.m-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--naml-blue);
}
.msg2-bubble strong, .ai-msg-bubble strong { color: var(--ink); font-weight: 700; }
.msg2-bubble em, .ai-msg-bubble em { color: var(--ink-2); font-style: italic; }
.msg2-bubble code, .ai-msg-bubble code {
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px;
  background: var(--bg-3); padding: 2px 6px; border-radius: 4px;
  color: var(--ink);
}

/* ──────────── LAUNCH TRACKER ──────────── */
.launch-summary {
  display: grid; grid-template-columns: 320px 1fr; gap: 16px;
  margin-bottom: 18px;
}
.ls-overall {
  background: linear-gradient(135deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 26px;
  position: relative; overflow: hidden;
}
.ls-overall::before {
  content: ''; position: absolute;
  top: -40%; right: -20%; width: 300px; height: 300px;
  background: radial-gradient(circle, var(--naml-blue-glow), transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.ls-overall-num {
  font-size: 56px; font-weight: 800; letter-spacing: -1.5px;
  color: var(--ink);
  line-height: 1; display: flex; align-items: baseline; gap: 4px;
  position: relative; z-index: 1;
}
.ls-overall-num .ls-pct { font-size: 28px; color: var(--ink-3); margin-left: 4px; }
.ls-overall-bar {
  margin-top: 14px; height: 8px;
  background: var(--bg-3); border-radius: 100px; overflow: hidden;
  position: relative; z-index: 1;
}
.ls-overall-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--naml-blue), #6F2EFF);
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px var(--naml-blue-glow);
}
.ls-overall-lbl {
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3);
  letter-spacing: 0.5px; text-transform: uppercase;
  position: relative; z-index: 1;
}

.ls-counts {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
.ls-count {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  transition: all 0.15s;
}
.ls-count:hover { border-color: var(--ink-3); }
.ls-count[data-status="done"]        { border-left: 3px solid var(--good); }
.ls-count[data-status="in_progress"] { border-left: 3px solid var(--warn); }
.ls-count[data-status="planning"]    { border-left: 3px solid var(--naml-blue); }
.ls-count[data-status="not_started"] { border-left: 3px solid var(--ink-3); }
.ls-count[data-status="blocked"]     { border-left: 3px solid var(--crit); }
.ls-count-num {
  font-size: 26px; font-weight: 800; letter-spacing: -0.6px;
  color: var(--ink); line-height: 1;
}
.ls-count-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ink-3); margin-top: 6px;
}

.launch-filters {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  margin-bottom: 16px;
}

.launch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.ls-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
  transition: all 0.15s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.ls-card::after {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  opacity: 0; transition: opacity 0.15s;
}
.ls-card[data-status="done"]::after        { background: var(--good); opacity: 1; }
.ls-card[data-status="in_progress"]::after { background: var(--warn); opacity: 1; }
.ls-card[data-status="planning"]::after    { background: var(--naml-blue); opacity: 1; }
.ls-card[data-status="not_started"]::after { background: var(--ink-3); opacity: 0.5; }
.ls-card[data-status="blocked"]::after     { background: var(--crit); opacity: 1; }
.ls-card:hover {
  border-color: var(--naml-blue);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.3);
}
.ls-card-head { display: flex; align-items: flex-start; gap: 12px; }
.ls-icon {
  width: 40px; height: 40px;
  background: var(--bg-3);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.ls-meta { flex: 1; min-width: 0; }
.ls-name {
  font-size: 14.5px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.2px;
  line-height: 1.3;
  margin-bottom: 2px;
}
.ls-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 1px;
  font-weight: 600;
}
.ls-priority {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 800;
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.ls-desc {
  font-size: 12.5px; color: var(--ink-2);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}
.ls-progress-wrap { display: flex; align-items: center; gap: 10px; }
.ls-progress-track {
  flex: 1; height: 6px;
  background: var(--bg-3); border-radius: 100px; overflow: hidden;
}
.ls-progress-fill {
  height: 100%; border-radius: 100px;
  transition: width 0.6s ease;
}
.ls-progress-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  color: var(--ink-2);
  min-width: 38px; text-align: right;
}
.ls-foot {
  display: flex; align-items: center; gap: 10px;
  padding-top: 4px;
}
.ls-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.ls-dot { width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.ls-foot .btn { margin-left: auto; }

/* ──────────── DRAWER ──────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex; justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.drawer-overlay.open { pointer-events: auto; opacity: 1; }
.drawer {
  width: 480px; max-width: 100vw;
  height: 100vh;
  background: var(--card);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.4);
}
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card-2);
}
.drawer-title { display: flex; align-items: center; gap: 12px; }
.drawer-icon {
  width: 40px; height: 40px;
  background: var(--bg-3);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.drawer-name { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -0.2px; }
.drawer-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 1.2px; margin-top: 1px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-form { display: flex; flex-direction: column; gap: 14px; }
.drawer-form .form-row label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ink-3);
  margin-bottom: 5px; display: block;
}
.drawer-form input, .drawer-form select, .drawer-form textarea {
  width: 100%;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-3); color: var(--ink);
}
.drawer-form input:focus, .drawer-form select:focus, .drawer-form textarea:focus {
  outline: none; border-color: var(--naml-blue);
  box-shadow: 0 0 0 3px var(--naml-blue-soft);
}
.drawer-form textarea { resize: vertical; min-height: 70px; }
.range-input {
  -webkit-appearance: none; appearance: none;
  height: 8px; padding: 0;
  background: var(--bg-3); border: none;
  border-radius: 100px;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  background: var(--naml-blue);
  border: 2px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--naml-blue-glow);
}
.range-input::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--naml-blue);
  border: 2px solid white;
  border-radius: 50%;
  cursor: pointer;
}
.drawer-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center;
  background: var(--card-2);
}

/* ──────────── MODAL ──────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h2 { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.2px; }

/* ──────────── MENTIONS ──────────── */
.mentions-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.mention-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.15s, transform 0.15s;
}
.mention-card:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.mention-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sent-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: 100px;
  border: 1px solid;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase;
}
.mention-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  margin-left: auto;
}
.mention-title {
  font-size: 14px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.2px; line-height: 1.4;
}
.mention-body {
  font-size: 13px; color: var(--ink-2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}
.mention-foot {
  display: flex; align-items: center; gap: 12px;
  padding-top: 6px;
  font-size: 11.5px;
  border-top: 1px dashed var(--line-2);
}
.mention-foot a { font-family: 'JetBrains Mono', monospace; font-size: 11px; }

/* ───── RESPONSIVE ───── */
@media (max-width: 1100px) {
  .hero-card { flex-direction: column; align-items: stretch; gap: 22px; }
  .hero-stats { justify-content: flex-start; }
  .row-2, .section-grid { grid-template-columns: 1fr; }
  .ask2 { grid-template-columns: 1fr; height: auto; }
  .ask2-rail { order: 2; max-height: 280px; }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed; transform: translateX(-100%);
    transition: transform 0.2s; z-index: 60;
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { padding: 14px 16px; }
  .content { padding: 18px 16px 100px; }
  .cred-row { grid-template-columns: 1fr; gap: 10px; }
  .actions { flex-direction: column; gap: 12px; align-items: stretch; }
  .section-header, .settings-head { flex-direction: column; gap: 14px; }
  .ai-fab { top: 10px; left: 10px; padding: 0 10px 0 8px; height: 30px; font-size: 11.5px; }
  .ai-panel { left: 12px; right: auto; top: 50px; bottom: auto; width: calc(100vw - 24px); height: 70vh; }
}

/* ─── Strategic Advisor ─── */
.nav-pill-new {
  margin-left: auto;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.5px;
  padding: 2px 7px; border-radius: 10px;
  background: linear-gradient(135deg, var(--naml-blue), #6F2EFF);
  color: white;
}

.advisor-hero {
  position: relative;
  border-radius: 18px;
  padding: 28px 30px 26px;
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--naml-blue) 22%, transparent);
}
.advisor-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(18,106,251,0.32) 0%, transparent 38%),
    radial-gradient(circle at 88% 80%, rgba(111,46,255,0.25) 0%, transparent 42%),
    linear-gradient(135deg, var(--bg-2), var(--bg-3));
  z-index: 0;
}
.advisor-hero-inner { position: relative; z-index: 1; }
.advisor-eyebrow {
  display: inline-block;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--naml-blue);
  background: var(--naml-blue-soft);
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--naml-blue) 25%, transparent);
}
.advisor-headline {
  margin: 14px 0 8px; font-size: 28px; font-weight: 700; line-height: 1.2;
  color: var(--ink-1);
}
.advisor-accent {
  background: linear-gradient(120deg, var(--naml-blue), #A855F7);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.advisor-sub {
  margin: 0 0 18px; color: var(--ink-2); font-size: 14px; max-width: 720px; line-height: 1.55;
}
.advisor-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.advisor-stamp { font-size: 12px; color: var(--ink-2); margin-left: 6px; }

.advisor-tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  border-bottom: 1px solid var(--bg-3);
  overflow-x: auto;
}
.tab-btn {
  background: transparent; border: none; cursor: pointer;
  padding: 10px 16px; font-size: 13.5px; font-weight: 500;
  color: var(--ink-2); border-bottom: 2px solid transparent;
  transition: all 0.15s; white-space: nowrap;
}
.tab-btn:hover { color: var(--ink-1); }
.tab-btn.active {
  color: var(--naml-blue);
  border-bottom-color: var(--naml-blue);
}

.advisor-empty {
  border: 1px dashed var(--bg-3); border-radius: 16px; padding: 60px 20px;
  text-align: center; color: var(--ink-2);
}
.advisor-running {
  display: flex; gap: 18px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--bg-3);
  border-radius: 16px; padding: 24px 26px;
}
.running-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--bg-3);
  border-top-color: var(--naml-blue);
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.running-title { font-weight: 600; color: var(--ink-1); font-size: 15px; }
.running-sub { color: var(--ink-2); font-size: 13px; margin-top: 3px; }

.briefing-sum-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--naml-blue) 8%, var(--bg-2)), var(--bg-2));
  border: 1px solid color-mix(in srgb, var(--naml-blue) 18%, transparent);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 18px 0 8px;
  font-size: 14.5px; line-height: 1.6; color: var(--ink-1);
}

.advisor-section-h {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 26px 0 12px;
}
.advisor-section-h h3 {
  margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-1);
  letter-spacing: 0.2px;
}
.advisor-section-h .small { font-size: 11.5px; }

.action-list { display: grid; gap: 10px; }
.action-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start;
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 14px;
  padding: 16px 18px; transition: all 0.15s;
}
.action-card:hover { border-color: color-mix(in srgb, var(--naml-blue) 25%, var(--bg-3)); transform: translateY(-1px); }
.action-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--bg-3); display: grid; place-items: center;
  font-size: 18px; flex-shrink: 0;
}
.action-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.urgency-pill {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  padding: 3px 9px; border-radius: 999px; border: 1px solid;
}
.cat-pill {
  font-size: 11px; font-weight: 500; color: var(--ink-2);
  padding: 3px 8px; border-radius: 999px;
  background: var(--bg-3);
}
.action-title { font-size: 14.5px; font-weight: 600; color: var(--ink-1); margin-bottom: 5px; }
.action-why, .action-how { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin-top: 4px; }
.action-why strong, .action-how strong { color: var(--ink-1); font-weight: 600; }
.btn.xs { padding: 5px 10px; font-size: 11.5px; }
.action-to-idea { white-space: nowrap; }

.rec-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.rec-card {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  padding: 14px 16px;
}
.rec-title { font-weight: 600; color: var(--ink-1); margin-bottom: 6px; font-size: 14px; }
.rec-detail { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.rec-foot { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.rec-pill {
  font-size: 11.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 999px;
  background: var(--bg-3);
}

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.tool-card {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  padding: 14px 16px;
}
.tool-name { font-weight: 600; color: var(--ink-1); margin-bottom: 5px; font-size: 13.5px; }
.tool-purpose { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-bottom: 6px; }
.tool-link { font-size: 12px; word-break: break-all; }

.advisor-raw {
  margin-top: 24px; border: 1px solid var(--bg-3); border-radius: 10px; padding: 10px 14px;
  background: var(--bg-2);
}
.advisor-raw summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.advisor-raw pre {
  margin-top: 10px; max-height: 360px; overflow: auto;
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; line-height: 1.5;
  color: var(--ink-2); white-space: pre-wrap; word-break: break-word;
}

/* Kanban */
.kanban {
  display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px; overflow-x: auto;
}
.kanban-col {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  display: flex; flex-direction: column; min-height: 360px;
}
.kanban-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--bg-3);
}
.kanban-title { font-size: 13px; font-weight: 600; color: var(--ink-1); }
.kanban-count {
  background: var(--bg-3); color: var(--ink-2);
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.kanban-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.kanban-empty { color: var(--ink-2); font-size: 12px; text-align: center; padding: 20px 0; }

.idea-card {
  background: var(--bg-3); border: 1px solid transparent; border-radius: 10px;
  padding: 11px 13px; cursor: pointer; transition: all 0.15s;
}
.idea-card:hover { border-color: var(--naml-blue); transform: translateY(-1px); }
.idea-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.idea-cat { font-size: 10.5px; font-weight: 600; color: var(--naml-blue); text-transform: uppercase; letter-spacing: 0.4px; }
.idea-src { font-size: 10px; color: var(--ink-2); }
.idea-src.ai { color: #A855F7; }
.idea-title { font-size: 13.5px; font-weight: 600; color: var(--ink-1); line-height: 1.35; margin-bottom: 5px; }
.idea-detail { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin-bottom: 8px; }
.idea-foot { display: flex; gap: 6px; }
.idea-pill {
  font-size: 10.5px; font-weight: 500;
  padding: 2px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg-2) 50%, transparent);
}

/* Competitive intel timeline */
.intel-timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.intel-card {
  display: grid; grid-template-columns: 110px 28px 1fr;
  gap: 14px; padding: 14px 0;
  cursor: pointer;
}
.intel-card:not(:last-child) {
  background:
    linear-gradient(to bottom, transparent, transparent calc(50% - 0px), var(--bg-3) calc(50% - 0px), var(--bg-3) calc(100%), transparent 100%);
  background-size: 1px 100%; background-position: 124px 0; background-repeat: no-repeat;
}
.intel-when { text-align: right; padding-top: 4px; }
.intel-when-date { font-size: 13px; font-weight: 600; color: var(--ink-1); }
.intel-when-market { font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.intel-line { position: relative; }
.intel-dot {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg-1);
}
.intel-body {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  padding: 14px 16px; transition: all 0.15s;
}
.intel-card:hover .intel-body { border-color: var(--naml-blue); }
.intel-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 7px; }
.intel-cat { font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--naml-blue); }
.intel-status { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid; }
.intel-impact { font-size: 12px; color: var(--ink-2); }
.intel-title { font-size: 15px; font-weight: 600; color: var(--ink-1); margin-bottom: 6px; }
.intel-detail { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin-bottom: 8px; }
.intel-action {
  font-size: 13px; line-height: 1.55;
  background: var(--naml-blue-soft); border-left: 3px solid var(--naml-blue);
  padding: 8px 12px; border-radius: 6px; margin-top: 6px;
  color: var(--ink-1);
}
.intel-action strong { color: var(--naml-blue); }

/* History cards */
.brief-history { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.hist-card {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; transition: all 0.15s;
}
.hist-card:hover { border-color: var(--naml-blue); transform: translateY(-1px); }
.hist-when { font-size: 11.5px; color: var(--ink-2); margin-bottom: 6px; }
.hist-title { font-weight: 600; color: var(--ink-1); margin-bottom: 6px; font-size: 14px; }
.hist-sum { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-bottom: 8px; }
.hist-meta { font-size: 11px; color: var(--ink-2); }

@media (max-width: 1100px) {
  .kanban { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
}
@media (max-width: 720px) {
  .advisor-headline { font-size: 22px; }
  .kanban { grid-template-columns: repeat(2, minmax(200px, 1fr)); }
  .intel-card { grid-template-columns: 80px 20px 1fr; gap: 8px; }
  .action-card { grid-template-columns: auto 1fr; }
  .action-to-idea { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
}

/* ─── Competitors / Queue / Analytics / Pulse ─── */
.live-dot-mini {
  margin-left: auto;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; transform: scale(1.18); } }

.comp-tabs {
  display: flex; gap: 6px; margin: 14px 0 18px;
  border-bottom: 1px solid var(--bg-3);
  overflow-x: auto;
}
.comp-tab {
  background: transparent; border: none; cursor: pointer;
  padding: 9px 14px; font-size: 13px; font-weight: 500;
  color: var(--ink-2); border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.comp-tab:hover { color: var(--ink-1); }
.comp-tab.active { color: var(--naml-blue); border-bottom-color: var(--naml-blue); }

.grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 14px;
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-32 { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; margin-bottom: 14px; }

.card {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 14px;
  padding: 18px 20px;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--ink-1); margin-bottom: 14px; }
.mb-24 { margin-bottom: 14px; }

.pain-list {
  list-style: none; padding: 0; margin: 0;
}
.pain-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--bg-3);
  font-size: 13px; color: var(--ink-1);
}
.pain-list li:last-child { border-bottom: none; }
.pain-count { font-size: 12px; color: var(--crit); font-weight: 600; }

.opp-card {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--naml-blue-soft);
  border-left: 3px solid var(--naml-blue);
  border-radius: 6px;
  font-size: 13px; line-height: 1.55; color: var(--ink-1);
}
.opp-ico { font-size: 17px; }

.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--bg-3);
  border-radius: 10px; border: 1px solid transparent;
  transition: border-color 0.15s;
}
.alert-card:hover { border-color: var(--naml-blue); }
.alert-icon { font-size: 22px; padding-top: 2px; }
.alert-text { font-size: 13.5px; line-height: 1.55; color: var(--ink-1); }
.alert-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 11.5px; color: var(--ink-2); }
.alert-time { color: var(--ink-2); }
.alert-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px;
  padding: 2px 7px; border-radius: 999px; text-transform: uppercase;
}
.alert-tag.urgent { background: rgba(239,68,68,0.15); color: #EF4444; }
.alert-tag.info   { background: rgba(245,158,11,0.15); color: #F59E0B; }
.alert-tag.good   { background: rgba(34,197,94,0.15); color: #22C55E; }
.alert-tag.opp    { background: rgba(168,85,247,0.15); color: #A855F7; }
.alert-actions { display: flex; flex-direction: column; gap: 6px; }

.btn-sm {
  padding: 5px 10px; font-size: 11.5px;
  border-radius: 6px; border: 1px solid var(--bg-3);
  background: var(--bg-2); color: var(--ink-2); cursor: pointer;
  text-decoration: none; display: inline-block;
  transition: all 0.15s;
}
.btn-sm:hover { color: var(--ink-1); border-color: var(--naml-blue); }
.btn-sm.primary { background: var(--naml-blue); color: white; border-color: var(--naml-blue); }
.btn-sm.primary:hover { background: var(--naml-blue-dark); color: white; }

/* Queue */
.queue-card {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 12px;
}
.queue-header {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px;
}
.priority-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px;
  padding: 3px 9px; border-radius: 999px; border: 1px solid;
}
.queue-platform { font-size: 12.5px; color: var(--ink-2); }
.queue-time { font-size: 11.5px; color: var(--ink-2); margin-left: auto; }
.queue-mention {
  font-size: 13.5px; line-height: 1.6; color: var(--ink-1);
  background: var(--bg-3); padding: 11px 14px; border-radius: 8px; margin-bottom: 12px;
}
.queue-reply {
  background: var(--naml-blue-soft); border-left: 3px solid var(--naml-blue);
  padding: 10px 14px; border-radius: 6px; margin-bottom: 12px;
}
.queue-reply.queue-reply-empty {
  background: var(--bg-3); border-left-color: var(--bg-3);
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
}
.queue-reply-label { font-size: 11px; font-weight: 600; color: var(--naml-blue); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.queue-reply-text {
  width: 100%; min-height: 76px; padding: 8px 0; resize: vertical;
  background: transparent; border: none; outline: none;
  font-family: inherit; font-size: 13px; color: var(--ink-1); line-height: 1.55;
}
.queue-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-bar { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-btn {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 999px;
  padding: 6px 14px; font-size: 12px; cursor: pointer; color: var(--ink-2);
  transition: all 0.15s;
}
.filter-btn:hover { color: var(--ink-1); }
.filter-btn.active { background: var(--naml-blue); color: white; border-color: var(--naml-blue); }

/* Analytics */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-step {
  display: grid; grid-template-columns: 130px 1fr 70px; gap: 12px; align-items: center;
}
.funnel-label { font-size: 13px; color: var(--ink-1); font-weight: 500; }
.funnel-bar-wrap { background: var(--bg-3); border-radius: 6px; overflow: hidden; height: 32px; }
.funnel-bar {
  height: 100%; display: flex; align-items: center;
  padding: 0 12px; color: white; font-weight: 600; font-size: 12.5px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); min-width: 50px;
}
.funnel-pct { font-size: 12px; color: var(--ink-2); text-align: right; font-weight: 600; }

.line-chart, .sentiment-chart {
  height: 160px; padding: 8px 0;
}
.chart-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--ink-2); }

.platform-bars { display: flex; flex-direction: column; gap: 8px; }
.platform-bar { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; }
.platform-bar .label { font-size: 12.5px; color: var(--ink-1); }
.bar-wrap { background: var(--bg-3); border-radius: 6px; height: 28px; overflow: hidden; }
.bar-fill {
  height: 100%; display: flex; align-items: center; justify-content: flex-end;
  padding: 0 10px; color: white; font-size: 11.5px; font-weight: 600;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulse */
.pulse-stamp { font-size: 11.5px; color: var(--ink-2); margin-right: 8px; }

.probe-row, .mcp-row {
  display: grid; grid-template-columns: 14px 1fr auto auto; gap: 12px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--bg-3);
}
.probe-row:last-child, .mcp-row:last-child { border-bottom: none; }
.probe-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--ink-2);
}
.probe-dot.good { background: var(--good); box-shadow: 0 0 8px var(--good); }
.probe-dot.crit { background: var(--crit); box-shadow: 0 0 8px var(--crit); }
.probe-dot.unknown { background: var(--ink-2); opacity: 0.4; }
.probe-name, .mcp-name { font-size: 13.5px; font-weight: 600; color: var(--ink-1); }
.probe-url { margin-top: 2px; }
.probe-url a { font-size: 11.5px; word-break: break-all; }
.probe-err { font-size: 11.5px; color: var(--crit); margin-top: 4px; }
.probe-stats { text-align: right; }
.probe-status { font-size: 13px; font-weight: 700; color: var(--ink-1); }
.probe-ms { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.probe-uptime { font-size: 10.5px; color: var(--ink-2); margin-top: 2px; }
.mcp-state { font-size: 12px; color: var(--ink-2); }

.db-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.db-cell {
  background: var(--bg-3); border-radius: 8px; padding: 11px 13px;
}
.db-cell-name { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.5px; }
.db-cell-val { font-size: 18px; font-weight: 700; color: var(--ink-1); margin-top: 4px; }

.activity-row {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--bg-3);
  font-size: 12.5px; color: var(--ink-2);
}
.activity-row:last-child { border-bottom: none; }
.activity-row strong { color: var(--ink-1); font-weight: 600; flex: 1; text-align: right; margin-right: 12px; font-size: 12px; }

@media (max-width: 900px) {
  .grid-2, .grid-32 { grid-template-columns: 1fr; }
  .funnel-step { grid-template-columns: 100px 1fr 50px; }
  .db-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Mention Sources ─── */
.src-presets {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-bottom: 18px;
}
.src-preset-label { font-size: 12px; color: var(--ink-2); margin-right: 4px; }
.chip-btn {
  background: var(--bg-2); border: 1px solid var(--bg-3);
  border-radius: 999px; padding: 6px 12px;
  font-size: 12px; color: var(--ink-1); cursor: pointer;
  transition: all 0.15s;
}
.chip-btn:hover { border-color: var(--naml-blue); color: var(--naml-blue); transform: translateY(-1px); }

.src-card {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: start;
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px;
  transition: all 0.15s;
}
.src-card:hover { border-color: color-mix(in srgb, var(--naml-blue) 30%, var(--bg-3)); }
.src-card.inactive { opacity: 0.55; }
.src-card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--bg-3);
  display: grid; place-items: center;
  font-size: 22px;
}
.src-card-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.src-name { font-weight: 600; color: var(--ink-1); font-size: 14px; }
.src-platform {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--naml-blue); background: var(--naml-blue-soft);
  padding: 2px 8px; border-radius: 999px;
}
.src-kind {
  font-size: 10.5px; color: var(--ink-2); background: var(--bg-3);
  padding: 2px 7px; border-radius: 999px;
}
.src-active {
  font-size: 9.5px; font-weight: 700; color: var(--good);
  background: var(--good-soft); padding: 2px 7px; border-radius: 999px;
}
.src-inactive {
  font-size: 9.5px; color: var(--ink-2); background: var(--bg-3);
  padding: 2px 7px; border-radius: 999px;
}
.src-card-meta {
  font-size: 11.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.6;
}
.src-card-meta code { background: var(--bg-3); padding: 1px 5px; border-radius: 4px; font-size: 11px; color: var(--ink-1); }
.src-err { font-size: 11.5px; color: var(--crit); margin-top: 6px; }
.src-notes { font-size: 12px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; font-style: italic; }
.src-card-actions { display: flex; flex-direction: column; gap: 6px; }

.secrets-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.secret-row {
  display: grid; grid-template-columns: 1fr 2fr auto; gap: 6px;
}
.secret-row input {
  background: var(--bg-3); border: 1px solid var(--bg-3); border-radius: 6px;
  padding: 8px 10px; color: var(--ink-1); font-size: 12.5px;
  font-family: 'JetBrains Mono', monospace;
}
.secret-row input:focus { border-color: var(--naml-blue); outline: none; }
.form-hint {
  font-size: 11.5px; color: var(--ink-2); margin-top: 5px; line-height: 1.5;
}
.form-hint code {
  background: var(--bg-3); padding: 1px 5px; border-radius: 4px;
  font-size: 11px; color: var(--ink-1); font-family: 'JetBrains Mono', monospace;
}
.checkbox-label {
  display: flex; gap: 8px; align-items: center;
  font-size: 13px; color: var(--ink-1); cursor: pointer;
}
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--naml-blue); }

/* ─── Products / listings ─── */
.prod-row {
  display: grid; grid-template-columns: 80px 1fr auto; gap: 14px; align-items: start;
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 14px;
  padding: 16px; margin-bottom: 12px;
  transition: border-color 0.15s;
}
.prod-row:hover { border-color: color-mix(in srgb, var(--naml-blue) 25%, var(--bg-3)); }
.prod-image {
  width: 80px; height: 80px; border-radius: 10px; background: var(--bg-3);
  display: grid; place-items: center; font-size: 30px; overflow: hidden;
}
.prod-image img { width: 100%; height: 100%; object-fit: cover; }
.prod-head {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px;
}
.prod-name { font-weight: 600; color: var(--ink-1); font-size: 14px; }
.prod-sku {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  background: var(--bg-3); color: var(--ink-2);
  padding: 2px 7px; border-radius: 4px;
}
.prio-pill {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px;
  padding: 3px 9px; border-radius: 999px; border: 1px solid;
}
.prio-interval { font-size: 11px; color: var(--ink-2); }
.prod-tag {
  font-size: 10.5px; color: var(--naml-blue);
  background: var(--naml-blue-soft);
  padding: 2px 7px; border-radius: 999px;
}
.prod-next { margin-bottom: 8px; }
.prod-actions { display: flex; flex-direction: column; gap: 6px; }

.listings-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px; margin-top: 8px;
}
.listing-cell {
  background: var(--bg-3); border-radius: 10px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.listing-head {
  display: flex; justify-content: space-between; align-items: center;
}
.lst-plat { font-size: 11.5px; font-weight: 600; color: var(--ink-1); }
.lst-price {
  font-size: 17px; font-weight: 700; color: var(--ink-1);
}
.lst-cur { font-size: 11px; color: var(--ink-2); font-weight: 500; margin-left: 3px; }
.lst-was {
  font-size: 12px; text-decoration: line-through; color: var(--ink-2); margin-left: 6px; font-weight: 400;
}
.lst-meta {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  font-size: 11.5px; color: var(--ink-2);
}
.stock-pill {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  padding: 2px 7px; border-radius: 999px;
  background: var(--bg-2);
}
.stock-pill.good { color: var(--good); background: var(--good-soft); }
.stock-pill.crit { color: var(--crit); background: var(--crit-soft); }
.stock-pill.unknown { color: var(--ink-2); background: var(--bg-2); }

.lst-sellers {
  display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px;
}
.seller-chip {
  font-size: 10.5px; color: var(--ink-2); background: var(--bg-2);
  padding: 2px 7px; border-radius: 4px;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lst-err { font-size: 11px; color: var(--crit); }
.listing-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--bg-2);
}

.listing-row-edit {
  display: grid; grid-template-columns: 1fr 2fr 1.2fr auto; gap: 6px;
  margin-bottom: 6px;
}
.listing-row-edit select, .listing-row-edit input {
  background: var(--bg-3); border: 1px solid var(--bg-3); border-radius: 6px;
  padding: 8px 10px; color: var(--ink-1); font-size: 12.5px;
}
.listing-row-edit input:focus, .listing-row-edit select:focus { border-color: var(--naml-blue); outline: none; }

@media (max-width: 720px) {
  .prod-row { grid-template-columns: 60px 1fr; }
  .prod-actions { grid-column: 1 / -1; flex-direction: row; }
  .listing-row-edit { grid-template-columns: 1fr 1fr; }
}

/* ─── Inbox ─── */
.inbox-layout {
  display: grid; grid-template-columns: 320px 1fr; gap: 14px; min-height: 600px;
}
.inbox-list, .inbox-thread {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  overflow: hidden;
}
.inbox-list { max-height: 720px; overflow-y: auto; }
.thread-row {
  display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start;
  padding: 12px 14px; border-bottom: 1px solid var(--bg-3); cursor: pointer;
  transition: background 0.12s;
}
.thread-row:hover { background: var(--bg-3); }
.thread-row.active { background: var(--naml-blue-soft); }
.thread-row.unread .thread-name { color: var(--ink-1); font-weight: 700; }
.thread-ic { font-size: 22px; }
.thread-head { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.thread-name { font-size: 13.5px; font-weight: 600; color: var(--ink-1); }
.thread-badge { background: var(--crit); color: white; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.thread-last { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.thread-when { margin-top: 3px; font-size: 10.5px; }

.inbox-thread { display: flex; flex-direction: column; padding: 0; }
.thread-header { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--bg-3); }
.thread-ic-lg { font-size: 28px; }
.thread-name-lg { font-size: 15px; font-weight: 600; color: var(--ink-1); }

.msg-stream { flex: 1; padding: 18px; overflow-y: auto; max-height: 420px; }
.msg { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.msg.in { align-items: flex-start; }
.msg.out { align-items: flex-end; }
.msg-bubble {
  max-width: 70%; padding: 10px 14px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.5;
}
.msg.in .msg-bubble { background: var(--bg-3); color: var(--ink-1); border-bottom-left-radius: 4px; }
.msg.out .msg-bubble { background: var(--naml-blue); color: white; border-bottom-right-radius: 4px; }
.msg-time { font-size: 10.5px; color: var(--ink-2); }

.reply-form {
  display: grid; grid-template-columns: 200px 200px 1fr auto; gap: 8px;
  padding: 12px 14px; border-top: 1px solid var(--bg-3);
}
.reply-form select, .reply-form input, .reply-form textarea {
  background: var(--bg-3); border: 1px solid var(--bg-3); border-radius: 6px;
  padding: 8px 10px; color: var(--ink-1); font-size: 12.5px;
}

/* ─── Posts ─── */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.post-card {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  overflow: hidden; transition: border-color 0.15s;
}
.post-card:hover { border-color: var(--naml-blue); }
.post-img {
  height: 180px; background: var(--bg-3); display: grid; place-items: center;
  font-size: 50px; overflow: hidden;
}
.post-img img { width: 100%; height: 100%; object-fit: cover; }
.post-body { padding: 12px 14px; }
.post-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.post-cap { font-size: 12.5px; color: var(--ink-1); line-height: 1.55; margin-bottom: 8px; min-height: 36px; }
.post-stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.post-eng { color: var(--naml-blue); font-weight: 600; }

/* ─── Reviews ─── */
.review-card {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px;
}
.review-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.review-src { font-size: 11.5px; font-weight: 600; }
.review-stars { font-size: 14px; letter-spacing: 1px; }
.review-author { font-size: 11.5px; }
.review-body { font-size: 13.5px; line-height: 1.55; color: var(--ink-1); margin-bottom: 10px; padding: 8px 12px; background: var(--bg-3); border-radius: 6px; }
.status-pill {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px;
  padding: 3px 9px; border-radius: 999px; border: 1px solid;
}

@media (max-width: 720px) {
  .inbox-layout { grid-template-columns: 1fr; }
  .reply-form { grid-template-columns: 1fr; }
}

/* ─── Amazon search v2 ─── */
.amz-mode-tabs { display: flex; gap: 4px; }
.mode-btn {
  background: var(--bg-3); border: 1px solid var(--bg-3); border-radius: 8px;
  padding: 6px 12px; font-size: 12.5px; cursor: pointer; color: var(--ink-2);
  transition: all 0.15s;
}
.mode-btn:hover { color: var(--ink-1); }
.mode-btn.active { background: var(--naml-blue); color: white; border-color: var(--naml-blue); }

.amz-inline-field {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-2);
}
.amz-inline-field .control-input { padding: 6px 8px; font-size: 12px; }
.amz-inline-field.amz-checkbox {
  background: var(--bg-3); border-radius: 6px; padding: 6px 10px; color: var(--ink-1);
  cursor: pointer;
}
.amz-inline-field.amz-checkbox input { accent-color: var(--naml-blue); }

.amz-results-tabs {
  display: flex; gap: 6px; padding: 12px 18px 0;
  border-bottom: 1px solid var(--bg-3);
}

.amz-buybox {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--bg-3);
  font-size: 11.5px;
}
.bb-name { color: var(--ink-1); font-weight: 500; }
.bb-id {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  background: var(--naml-blue-soft); color: var(--naml-blue);
  padding: 2px 7px; border-radius: 4px; cursor: pointer;
  transition: all 0.15s;
}
.bb-id:hover { background: var(--naml-blue); color: white; }
.amz-sellers-line { margin-top: 4px; }
.brand-click, .asin-click { cursor: pointer; transition: all 0.15s; }
.brand-click:hover, .asin-click:hover { color: var(--naml-blue); }

.seller-row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
  padding: 14px 16px; margin-bottom: 8px;
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 10px;
  align-items: center;
}
.seller-row-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.seller-row-name { font-size: 14px; font-weight: 600; color: var(--ink-1); }
.seller-row-stats { font-size: 12px; color: var(--ink-2); }
.seller-row-stats strong { color: var(--ink-1); }
.seller-row-asins { margin-top: 6px; font-size: 11px; }
.seller-row-asins code {
  background: var(--bg-3); padding: 1px 6px; border-radius: 3px;
  margin-right: 4px; color: var(--ink-2); font-size: 10.5px;
}

/* ─── Templates / Vouchers / Assets ─── */
.tpl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px;
}
.tpl-card {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  padding: 16px; transition: border-color 0.15s;
}
.tpl-card:hover { border-color: var(--naml-blue); }
.tpl-card-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.tpl-kind { font-size: 11px; font-weight: 700; color: var(--naml-blue); background: var(--naml-blue-soft); padding: 2px 8px; border-radius: 999px; }
.tpl-purpose { font-size: 11px; color: var(--ink-2); background: var(--bg-3); padding: 2px 8px; border-radius: 999px; }
.tpl-seed { font-size: 9.5px; font-weight: 700; color: #A855F7; background: rgba(168,85,247,0.14); padding: 2px 6px; border-radius: 4px; }
.tpl-name { font-weight: 600; color: var(--ink-1); font-size: 14px; margin-bottom: 6px; }
.tpl-subj { font-size: 12px; color: var(--ink-2); margin-bottom: 8px; line-height: 1.4; }
.tpl-vars { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.tpl-vars code { background: var(--bg-3); color: var(--ink-2); padding: 2px 6px; border-radius: 4px; font-size: 10.5px; font-family: 'JetBrains Mono', monospace; }
.tpl-actions { display: flex; gap: 6px; }

.tpl-edit-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-height: 78vh; }
.tpl-edit-form { overflow-y: auto; max-height: 78vh; }
.tpl-preview-pane {
  background: var(--bg-3); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
  max-height: 78vh; overflow: hidden;
}
.tpl-preview-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-2); }
.tpl-preview-iframe {
  width: 100%; flex: 1; min-height: 320px; background: white; border: none; border-radius: 8px;
}
.tpl-preview-text {
  background: var(--bg-2); border-radius: 6px; padding: 10px 12px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-2);
  white-space: pre-wrap; max-height: 140px; overflow-y: auto;
}

/* Vouchers */
.voucher-row {
  display: grid; grid-template-columns: 140px 1fr auto; gap: 14px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 8px;
}
.voucher-row.inactive { opacity: 0.5; }
.vch-code {
  font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 700;
  color: var(--ink-1); background: var(--bg-3); padding: 10px 14px;
  border-radius: 8px; text-align: center; letter-spacing: 1px;
  border: 1px dashed var(--naml-blue);
}
.vch-title { font-size: 14px; font-weight: 600; color: var(--ink-1); margin-bottom: 4px; }
.vch-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.vch-value { font-size: 13px; font-weight: 700; }
.vch-desc { font-size: 12px; color: var(--ink-2); margin-top: 6px; }

/* Assets */
.asset-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.asset-card {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 10px; overflow: hidden;
}
.asset-img {
  width: 100%; height: 200px; object-fit: cover; background: var(--bg-3); display: block;
}
.asset-img-empty {
  height: 200px; background: var(--bg-3); display: grid; place-items: center; color: var(--ink-2);
}
.asset-body { padding: 10px 12px; }
.asset-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); margin-bottom: 6px; }
.asset-prompt { font-size: 12px; color: var(--ink-1); line-height: 1.45; min-height: 36px; margin-bottom: 8px; }
.asset-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Outreach campaign edit layout */
.campaign-edit-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-height: 80vh; }
.campaign-edit-form { overflow-y: auto; max-height: 80vh; }
.campaign-edit-preview {
  background: var(--bg-3); padding: 14px; display: flex; flex-direction: column; gap: 10px;
  max-height: 80vh; overflow: hidden;
}

@media (max-width: 1100px) {
  .tpl-edit-layout, .campaign-edit-layout { grid-template-columns: 1fr; }
  .voucher-row { grid-template-columns: 120px 1fr; }
}

/* ─── Cockpit (overview) ─── */
.cockpit-hero {
  position: relative; border-radius: 18px; padding: 26px 30px;
  margin-bottom: 18px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--naml-blue) 22%, transparent);
}
.cockpit-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(18,106,251,0.32) 0%, transparent 38%),
    radial-gradient(circle at 88% 80%, rgba(34,197,94,0.22) 0%, transparent 42%),
    linear-gradient(135deg, var(--bg-2), var(--bg-3));
  z-index: 0;
}
.cockpit-hero-inner { position: relative; z-index: 1; }
.cockpit-greeting { font-size: 30px; font-weight: 700; color: var(--ink-1); }
.cockpit-stamp { color: var(--ink-2); margin: 6px 0 16px; font-size: 13.5px; }
.cockpit-quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.cockpit-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.cockpit-tile {
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  padding: 14px 16px;
  display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: center;
  transition: all 0.15s; text-decoration: none; color: inherit;
}
.cockpit-tile.clickable { cursor: pointer; }
.cockpit-tile.clickable:hover {
  border-color: var(--naml-blue);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.cockpit-tile-i {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--bg-3); display: grid; place-items: center; font-size: 18px;
}
.cockpit-tile.naml .cockpit-tile-i { background: var(--naml-blue-soft); }
.cockpit-tile.good .cockpit-tile-i { background: var(--good-soft); }
.cockpit-tile-l { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.4px; }
.cockpit-tile-v { font-size: 24px; font-weight: 700; color: var(--ink-1); margin: 2px 0; }
.cockpit-tile-m { font-size: 11px; color: var(--ink-2); }
.delta { font-weight: 600; }
.delta.good { color: var(--good); }
.delta.crit { color: var(--crit); }

.cockpit-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px;
}
.cockpit-feed-card, .cockpit-needs-card { padding: 16px 18px; }
.feed-row {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start;
  padding: 10px 0; border-bottom: 1px solid var(--bg-3);
  text-decoration: none; color: inherit; transition: background 0.12s;
}
.feed-row:hover { background: var(--bg-3); margin: 0 -8px; padding: 10px 8px; border-radius: 6px; }
.feed-row:last-child { border-bottom: none; }
.feed-ic { font-size: 18px; }
.feed-text { font-size: 13px; color: var(--ink-1); line-height: 1.45; }
.feed-meta { margin-top: 2px; }

.need-row {
  display: grid; grid-template-columns: 24px 1fr 18px; gap: 10px; align-items: center;
  padding: 10px 12px; margin-bottom: 6px;
  background: var(--naml-blue-soft); border-radius: 8px;
  text-decoration: none; color: var(--ink-1); transition: all 0.15s;
}
.need-row:hover { background: var(--naml-blue); color: white; }
.need-row:hover .need-arr, .need-row:hover .need-ic { color: white; }
.need-ic { font-size: 16px; }
.need-text { font-size: 13px; }
.need-arr { font-weight: 700; opacity: 0.6; }

.evt-wrap { overflow-x: auto; }
.evt-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.evt-table th, .evt-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--bg-3); text-align: left;
}
.evt-table th { color: var(--ink-2); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.evt-table td code { background: var(--bg-3); padding: 1px 6px; border-radius: 3px; font-size: 11px; }
.evt-page { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt-ic { font-size: 14px; }
.evt-tabs { display: inline-flex; gap: 4px; }
.evt-tab {
  background: var(--bg-3); border: 1px solid var(--line);
  color: var(--ink-2); cursor: pointer;
  padding: 4px 10px; border-radius: 100px;
  font-size: 11.5px; font-weight: 600;
  transition: all .12s;
}
.evt-tab:hover { color: var(--ink-1); border-color: var(--ink-3); }
.evt-tab.active {
  background: color-mix(in srgb, var(--naml-blue) 14%, transparent);
  color: var(--naml-blue);
  border-color: color-mix(in srgb, var(--naml-blue) 35%, transparent);
}
.evt-tab.active .dim { color: var(--naml-blue); opacity: 0.7; }

/* ─── Journey filters + table + drawer ─── */
.journey-filters {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: end;
  background: var(--bg-2); border: 1px solid var(--bg-3); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 14px;
}
.jf-group { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.jf-group-search { flex: 2; min-width: 240px; }
.toggle-row { display: flex; gap: 6px; }
.toggle-pill {
  display: flex; gap: 6px; align-items: center; cursor: pointer;
  padding: 7px 12px; background: var(--bg-3); border-radius: 999px;
  font-size: 12px; color: var(--ink-2);
  border: 1px solid var(--bg-3);
}
.toggle-pill input { accent-color: var(--naml-blue); }
.toggle-pill:has(input:checked) { background: var(--naml-blue-soft); color: var(--naml-blue); border-color: color-mix(in srgb, var(--naml-blue) 30%, transparent); }

.users-table-wrap { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th, .users-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--bg-3); text-align: left;
}
.users-table th {
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: 0.4px;
  cursor: pointer; user-select: none; position: sticky; top: 0;
  background: var(--bg-2); z-index: 1;
}
.users-table th:hover { color: var(--naml-blue); }
.users-table th.num, .users-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.usr-row { cursor: pointer; transition: background 0.12s; }
.usr-row:hover { background: var(--bg-3); }
.usr-cell { display: flex; gap: 10px; align-items: center; }
.usr-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--naml-blue), #6F2EFF);
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.usr-handle { font-size: 13px; font-weight: 500; color: var(--ink-1); }
.usr-meta { margin-top: 2px; font-size: 11px; }
.emp-tag {
  font-size: 9.5px; font-weight: 700; color: white;
  background: #6B7280; padding: 1px 6px; border-radius: 4px;
  letter-spacing: 0.5px;
}

/* Drawer wide variant for journey */
.drawer-wide { max-width: 920px; width: 92vw; }
.drawer-title-wrap h2 { margin: 0; font-size: 17px; font-weight: 600; }
.drawer-body { overflow-y: auto; max-height: calc(100vh - 70px); padding: 20px 24px; }

.d-stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px; margin-bottom: 18px;
}
.d-stat {
  background: var(--bg-3); border-radius: 8px; padding: 10px 12px;
}
.d-stat-l { font-size: 10.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.3px; }
.d-stat-v { font-size: 17px; font-weight: 700; color: var(--ink-1); margin-top: 2px; }

.d-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

.d-tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--bg-3); margin-bottom: 14px;
  overflow-x: auto;
}
.d-tab {
  background: transparent; border: none; cursor: pointer;
  padding: 9px 14px; font-size: 12.5px; font-weight: 500;
  color: var(--ink-2); border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.d-tab:hover { color: var(--ink-1); }
.d-tab.active { color: var(--naml-blue); border-bottom-color: var(--naml-blue); }

.d-timeline { display: flex; flex-direction: column; }
.d-tl-row { display: grid; grid-template-columns: 130px 16px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bg-3); }
.d-tl-row:last-child { border-bottom: none; }
.d-tl-time { font-size: 11px; color: var(--ink-2); padding-top: 3px; font-variant-numeric: tabular-nums; }
.d-tl-line { position: relative; }
.d-tl-dot { position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 8px; height: 8px; border-radius: 50%; background: var(--naml-blue);
  box-shadow: 0 0 0 3px var(--bg-1); }
.d-tl-action { font-size: 13px; color: var(--ink-1); }
.d-tl-action code { background: var(--bg-3); padding: 1px 6px; border-radius: 3px; font-size: 11px; }
.d-tl-page { font-size: 12px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; }

.d-pages { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.d-pages th, .d-pages td { padding: 8px 12px; border-bottom: 1px solid var(--bg-3); text-align: left; }
.d-pages th { color: var(--ink-2); font-size: 11px; }
.d-pages td.num, .d-pages th.num { text-align: right; }
.d-page-title { font-weight: 500; color: var(--ink-1); margin-bottom: 2px; }

.d-session {
  background: var(--bg-3); border-radius: 8px; padding: 12px 14px; margin-bottom: 8px;
}
.d-session-head { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.d-session-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }

.d-camps, .d-lead-card { display: flex; flex-direction: column; gap: 8px; }
.d-camp, .d-lead-card { background: var(--bg-3); padding: 10px 14px; border-radius: 8px; display: flex; gap: 12px; justify-content: space-between; align-items: center; font-size: 13px; }

@media (max-width: 1100px) {
  .cockpit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .users-table { font-size: 11.5px; }
  .users-table td, .users-table th { padding: 8px; }
  .d-tl-row { grid-template-columns: 80px 14px 1fr; }
  .drawer-wide { width: 100vw; }
}

/* ─── Journey bulk + watch + lookup ─── */
.bulk-bar {
  display: flex; gap: 10px; align-items: center;
  background: linear-gradient(135deg, var(--naml-blue), #6F2EFF);
  color: white; border-radius: 10px; padding: 10px 16px;
  margin-bottom: 12px;
  position: sticky; top: 16px; z-index: 5;
  box-shadow: 0 8px 24px var(--naml-blue-glow);
}
.bulk-count { font-weight: 600; font-size: 13px; flex: 1; }
.bulk-bar .btn { color: white; }
.bulk-bar .btn.primary { background: white; color: var(--naml-blue); }
.bulk-bar .btn.ghost { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.25); color: white; }

.sel-col, .watch-col {
  width: 32px; padding-left: 14px !important; padding-right: 6px !important;
}
.usr-sel { accent-color: var(--naml-blue); cursor: pointer; }
.watch-star {
  background: transparent; border: none; cursor: pointer;
  font-size: 16px; color: var(--ink-2); padding: 4px;
  transition: all 0.15s;
}
.watch-star:hover { transform: scale(1.2); }
.watch-star.watching { color: #F59E0B; }

.d-lookup-section {
  margin-top: 14px; padding: 12px 14px;
  background: var(--bg-3); border-radius: 8px;
}
.d-lookup-h { font-size: 12.5px; font-weight: 600; color: var(--ink-1); margin-bottom: 8px; }
.d-lookup-row {
  font-size: 12px; color: var(--ink-2); padding: 5px 0;
  border-bottom: 1px solid var(--bg-2); line-height: 1.4;
}
.d-lookup-row:last-child { border-bottom: none; }

/* ─── Naml prod profile banner (Journey drawer) ─── */
.naml-banner {
  background: linear-gradient(135deg, var(--naml-blue-soft), rgba(168,85,247,0.10));
  border: 1px solid color-mix(in srgb, var(--naml-blue) 25%, transparent);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 14px;
}
.naml-banner-h {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--naml-blue); text-transform: uppercase; margin-bottom: 6px;
}
.naml-banner-stats {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  font-size: 13px; color: var(--ink-1);
}
.naml-banner-stats span strong { color: var(--ink-1); font-weight: 600; }

.naml-section { margin-bottom: 18px; }
.naml-section-h { font-size: 12px; font-weight: 700; color: var(--ink-1); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.4px; }
.naml-vouchers { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.naml-voucher {
  background: var(--bg-3); border-radius: 8px; padding: 8px 12px;
  border-left: 3px solid var(--good);
}
.naml-voucher.used { opacity: 0.5; border-left-color: var(--ink-2); }
.naml-voucher-code { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px; color: var(--ink-1); }
.naml-voucher-meta { font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.naml-review { font-size: 12.5px; color: var(--ink-1); padding: 6px 0; border-bottom: 1px solid var(--bg-3); line-height: 1.5; }
.naml-review:last-child { border-bottom: none; }

/* ─── catalog grid (used by marketplace, content) ─── */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}
.cat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .12s, transform .12s;
}
.cat-card:hover { border-color: var(--naml-blue); transform: translateY(-1px); }
.cat-img {
  background: var(--bg-3);
  aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--ink-3);
  overflow: hidden;
}
.cat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cat-sku-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cat-sku {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px;
}
.cat-stock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
  padding: 2px 8px; border-radius: 100px;
  background: var(--bg-3); border: 1px solid var(--line);
}
.cat-stock.good  { color: var(--good); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.cat-stock.amber { color: #F59E0B;     border-color: color-mix(in srgb, #F59E0B 30%, transparent); }
.cat-stock.crit  { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 30%, transparent); }
.cat-name {
  font-size: 13.5px; font-weight: 600; color: var(--ink-1);
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.cat-price-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cat-price { color: var(--ink-1); font-weight: 700; font-size: 13px; }
.cat-price-sale { color: var(--good); font-weight: 700; font-size: 13px; }
.cat-price-was { color: var(--ink-3); font-size: 11px; text-decoration: line-through; }
.cat-stats {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 11px; color: var(--ink-2);
  margin-top: auto; padding-top: 4px;
}
.evt-stat-link {
  color: var(--ink-2); text-decoration: none; cursor: pointer;
  border-radius: 4px; padding: 1px 4px;
  transition: background .12s, color .12s;
}
.evt-stat-link:hover { background: color-mix(in srgb, var(--naml-blue) 12%, transparent); color: var(--naml-blue); }

/* ─── 2-column card grid ─── */
.grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.card-head h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -0.2px; color: var(--ink-1); }

/* ───── #8 MOBILE PASS (2026-05-23) ───── */
.mobile-hamburger { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 6px 10px; margin-right: 8px; }
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 55; }
.mobile-overlay.show { display: block; }

@media (max-width: 760px) {
  .mobile-hamburger { display: inline-flex !important; align-items: center; }
  .topbar { display: flex; align-items: center; }
  .page-title { font-size: 16px !important; }
  .sidebar-brand { font-size: 16px !important; }

  /* Tables — scroll horizontally instead of breaking layout */
  table.ax, table.ax-compact, table.dd-lines, table.preview, .ax {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  table.ax thead, table.ax tbody { display: table; width: 100%; min-width: 580px; }

  /* Forms — collapse 2-col layout to single column */
  .frow, .form-row, .map-row, .ci-row { grid-template-columns: 1fr !important; gap: 4px !important; }
  .frow label, .form-row label { padding-top: 0 !important; }

  /* KPI cards: keep grid but allow shrinking */
  .kpi, .grid, .ah-grid { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .kpi .v, .v, .stat .v { font-size: 18px !important; }
  .kpi .c, .c, .stat, .ah-card { padding: 10px !important; }

  /* Customer 360 header */
  .hdr { flex-direction: column; align-items: flex-start !important; gap: 12px !important; padding: 16px !important; }
  .twocol { grid-template-columns: 1fr !important; }

  /* Doc detail print page on mobile */
  .dd-doc { padding: 16px !important; font-size: 13px !important; }
  .dd-head { flex-direction: column; gap: 12px; }
  .dd-meta { grid-template-columns: 1fr !important; gap: 10px !important; }

  /* Sidebar nav groups: nudge font down a bit */
  .nav-group-header { font-size: 10px !important; padding: 8px 14px 4px !important; }
  .nav-item { padding: 9px 14px !important; font-size: 13px !important; }

  /* Cards default — tighter spacing */
  .card { padding: 14px !important; margin-bottom: 10px !important; }

  /* Searchbar in topbar — full width */
  #naml-search-wrap { max-width: 100% !important; margin: 0 8px !important; }
  #naml-search { font-size: 14px !important; }
}

@media (max-width: 480px) {
  .kpi, .grid, .ah-grid { grid-template-columns: 1fr !important; }
  .kpi .v, .v { font-size: 22px !important; }
  .topbar { padding: 10px 12px !important; }
}
