/* ============================================================
   eg-console — "Aurora" design system
   deep indigo-black · living aurora glow · tri-gradient accents
   ============================================================ */

:root {
  /* base */
  --bg: #080a11;
  --bg-2: #0c0f18;
  --ink: #eef1f8;
  --muted: #8a93a8;
  --faint: #5b6478;
  --line: rgba(140, 160, 200, 0.10);
  --line-strong: rgba(140, 160, 200, 0.18);

  /* surfaces (glass) */
  --surface: rgba(22, 27, 40, 0.55);
  --surface-2: rgba(28, 34, 50, 0.7);
  --surface-solid: #131826;

  /* accents */
  --emerald: #34e5a0;
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --amber: #fbbf24;
  --rose: #fb7185;
  --grad: linear-gradient(135deg, #34e5a0 0%, #38bdf8 55%, #7c9bff 100%);
  --grad-warm: linear-gradient(135deg, #fbbf24, #fb7185);

  --radius: 18px;
  --radius-sm: 12px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 100px -30px rgba(0, 0, 0, 0.8);
  font-size: 15px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

/* living aurora background */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(680px 480px at 12% -8%, rgba(52, 229, 160, 0.14), transparent 60%),
    radial-gradient(720px 520px at 92% 0%, rgba(56, 189, 248, 0.12), transparent 62%),
    radial-gradient(760px 620px at 78% 108%, rgba(167, 139, 250, 0.12), transparent 60%),
    radial-gradient(600px 500px at 20% 120%, rgba(52, 229, 160, 0.08), transparent 60%);
  animation: aurora 22s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.06); }
}

::selection { background: rgba(52, 229, 160, 0.28); }
* { scrollbar-width: thin; scrollbar-color: rgba(140,160,200,0.25) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(140,160,200,0.18); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(140,160,200,0.35); background-clip: content-box; }

/* ---------------- brand ---------------- */
.brand { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.04em; }
.brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand.big { font-size: 2.1rem; }

/* ---------------- login ---------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card {
  background: var(--surface);
  backdrop-filter: blur(30px) saturate(1.3);
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  padding: 3rem 3.2rem;
  width: min(380px, 94vw);
  text-align: center;
  display: flex; flex-direction: column; gap: 1rem;
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; inset: 0; padding: 1px; border-radius: 26px;
  background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.4; pointer-events: none;
}
.login-card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.4rem; }
.login-card input {
  background: rgba(0,0,0,0.3); border: 1px solid var(--line-strong); border-radius: 14px;
  color: var(--ink); padding: 0.85rem 1rem; text-align: center; font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-card input:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 4px rgba(52,229,160,0.12); }
.error { color: var(--rose); font-size: 0.82rem; min-height: 1em; }

/* ---------------- shell: top command bar + centered column ---------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topnav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(22px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  /* installed iOS PWA draws under the status bar (viewport-fit=cover) */
  padding-top: env(safe-area-inset-top);
}
/* installed app only: non-notched iPhones report env()=0 yet the translucent
   status bar still overlays us — enforce a real minimum there */
@media (display-mode: standalone) {
  .topnav { padding-top: max(env(safe-area-inset-top), 26px); }
  .drawer { padding-top: max(calc(1.5rem + env(safe-area-inset-top)), calc(1.5rem + 26px)); }
  .modal { padding-top: max(calc(12vh + env(safe-area-inset-top)), calc(12vh + 26px)); }
  .notif-panel { top: max(calc(62px + env(safe-area-inset-top)), 88px); }
  .user-menu { top: max(calc(60px + env(safe-area-inset-top)), 86px); }
}
.topnav-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; gap: 1.4rem;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
}
.topnav .brand { font-size: 1.15rem; flex-shrink: 0; }

nav { display: flex; align-items: center; gap: 0.2rem; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 0.45rem;
  color: var(--muted); text-decoration: none; cursor: pointer; user-select: none;
  font-size: 0.86rem; font-weight: 600;
  padding: 0.5rem 0.85rem; border-radius: 11px;
  transition: color 0.18s, background 0.18s;
}
.nav-ico { font-size: 0.95rem; }
.nav-item:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav-item.active { color: var(--ink); }
.nav-item.active::after {
  content: ""; position: absolute; left: 0.85rem; right: 0.85rem; bottom: -0.87rem;
  height: 2.5px; border-radius: 3px; background: var(--grad);
  box-shadow: 0 0 10px 0 rgba(52,229,160,0.6);
}

.topnav-right { margin-left: auto; display: flex; align-items: center; gap: 0.8rem; }
.avatar-list { display: flex; align-items: center; gap: -6px; }
.avatar-item { display: flex; align-items: center; }
.avatar-item:not(:first-child) { margin-left: -8px; }
.avatar-item span:not(.ring) { display: none; }
.avatar-item .ring {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center;
  color: #04140d; font-weight: 800; font-size: 0.66rem;
  box-shadow: 0 2px 10px -2px rgba(52,229,160,0.6); border: 2px solid var(--bg);
}
.master-toggle { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.76rem; cursor: pointer; white-space: nowrap; }
.master-toggle input { accent-color: var(--emerald); }
.icon-btn { background: transparent; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0.32rem 0.5rem; font-size: 0.9rem; cursor: pointer; transition: background 0.15s; }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rose); transition: all 0.3s; }
.dot.on { background: var(--emerald); box-shadow: 0 0 10px 1px rgba(52,229,160,0.8); }
.live-label, .side-block, .side-footer { display: none; }

main { padding: 2rem clamp(1rem, 3vw, 2rem) 4rem; }
.container { max-width: 1180px; margin: 0 auto; }

/* Today bento */
.bento { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.1rem; align-items: start; }
.bento-lg, .bento-sm { margin: 0; }
@media (max-width: 900px) { .bento { grid-template-columns: 1fr; } }
.view { display: flex; flex-direction: column; gap: 1.4rem; animation: viewIn 0.4s cubic-bezier(0.2,0.9,0.3,1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }

.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.topbar h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; }
.topbar p { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }

/* ---------------- buttons ---------------- */
button, .primary, .ghost { font-family: var(--font); cursor: pointer; }
.primary {
  position: relative; border: none; border-radius: 13px;
  padding: 0.6rem 1.2rem; font-weight: 700; font-size: 0.83rem;
  color: #04140d; background: var(--grad); background-size: 160% 160%;
  box-shadow: 0 10px 26px -10px rgba(52,229,160,0.6);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px rgba(52,229,160,0.7); filter: brightness(1.05); }
.primary:active { transform: translateY(0) scale(0.98); }
.big-cta { padding: 0.85rem 1.7rem; font-size: 1rem; border-radius: 16px; }

.ghost {
  background: rgba(255,255,255,0.03); color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 0.5rem 0.9rem; font-size: 0.8rem; font-weight: 500;
  transition: all 0.15s;
}
.ghost:hover { color: var(--ink); border-color: var(--faint); background: rgba(255,255,255,0.06); }
.ghost.danger { color: var(--rose); border-color: rgba(251,113,133,0.35); margin-right: auto; }
.small { padding: 0.32rem 0.65rem; font-size: 0.73rem; border-radius: 9px; }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible, .nav-item:focus-visible {
  outline: 2px solid var(--emerald); outline-offset: 2px;
}

input, select {
  background: rgba(0,0,0,0.25); border: 1px solid var(--line-strong); border-radius: 12px;
  color: var(--ink); padding: 0.58rem 0.8rem; font-size: 0.83rem; font-family: var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(52,229,160,0.1); }
input::placeholder { color: var(--faint); }

select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%2334e5a0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center;
  padding-right: 2.2rem;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
select:hover { border-color: var(--faint); background-color: rgba(0,0,0,0.35); }
select option { background: var(--surface-solid); color: var(--ink); }

/* ---------------- panels ---------------- */
.panel, .client-card {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(1.15);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.2s;
}
.client-card { animation: cardIn 0.4s ease both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } }
.panel h2, .client-card h2 {
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 1rem; font-weight: 600;
  display: flex; align-items: center; gap: 0.5rem;
}
.panel h2::before, .client-card h2::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--grad);
  box-shadow: 0 0 8px 1px rgba(52,229,160,0.5);
}
.hint { color: var(--faint); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ---------------- hero / bento stats ---------------- */
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat {
  position: relative; overflow: hidden;
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}
.stat:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.stat::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad); opacity: 0; transition: opacity 0.25s;
}
.stat:hover::after { opacity: 0.9; }
.stat b {
  display: block; font-size: 2.2rem; font-weight: 800; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.stat.hot b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.5rem; display: block; }
.stat.spark { display: flex; flex-direction: column; justify-content: flex-end; }
.sparkline { display: flex; align-items: flex-end; gap: 3px; height: 40px; margin-bottom: 0.3rem; }
.sparkline i { flex: 1; background: rgba(255,255,255,0.07); border-radius: 3px 3px 0 0; transition: height 0.5s; }
.sparkline i.on { background: var(--grad); }

/* ---------------- pipeline / campaigns ---------------- */
#pipeline { display: flex; flex-direction: column; gap: 1.1rem; }
.client-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.client-head > div:last-child { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.client-head strong { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.03em; }
.client-head a { color: var(--faint); font-size: 0.78rem; text-decoration: none; margin-left: 0.6rem; }
.client-head a:hover { color: var(--cyan); }
.knowledge-badge { font-size: 0.68rem; font-weight: 700; padding: 0.28rem 0.7rem; border-radius: 20px; }
.knowledge-badge.ready { background: rgba(52,229,160,0.14); color: var(--emerald); }
.knowledge-badge.missing { background: rgba(251,191,36,0.14); color: var(--amber); }

.campaign {
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin-top: 0.95rem;
  transition: border-color 0.2s;
}
.campaign:hover { border-color: var(--line-strong); }
.campaign-head { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.campaign-head strong { font-size: 1rem; font-weight: 700; cursor: pointer; }
.campaign-head strong:hover { color: var(--emerald); }
.campaign-head .segment { color: var(--muted); font-size: 0.77rem; max-width: 54ch; margin-top: 0.2rem; }
.avatar-tag { color: var(--muted); font-size: 0.72rem; border: 1px solid var(--line-strong); border-radius: 16px; padding: 0.2rem 0.65rem; }

/* funnel */
.funnel { margin: 1rem 0 0.7rem; }
.funnel-bar { display: flex; height: 12px; border-radius: 7px; overflow: hidden; background: rgba(255,255,255,0.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03); }
.funnel-bar div { transition: width 0.7s cubic-bezier(0.2,0.9,0.3,1); }
.f-qualified { background: #3a465e; } .f-engaged { background: #64748b; }
.f-invited { background: #3b82f6; } .f-accepted { background: var(--violet); }
.f-messaged { background: var(--cyan); } .f-replied { background: var(--amber); }
.f-meeting { background: var(--emerald); box-shadow: 0 0 14px 1px rgba(52,229,160,0.6); }
.funnel-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.65rem; }
.funnel-legend span { color: var(--muted); font-size: 0.73rem; display: flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.funnel-legend span:hover b { color: var(--emerald); }
.funnel-legend b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-legend em { color: var(--cyan); font-style: normal; font-size: 0.66rem; }
.swatch { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* flow stepper */
.flow { display: flex; gap: 0; flex-wrap: wrap; align-items: center; margin-top: 0.7rem; }
.step-btn {
  background: rgba(255,255,255,0.03); color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 0;
  padding: 0.42rem 0.85rem; font-size: 0.76rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s; font-family: var(--font); letter-spacing: 0.01em;
}
.step-btn:first-child { border-radius: 10px 0 0 10px; }
.step-btn + .step-btn { border-left: none; }
.step-btn.last { border-radius: 0 10px 10px 0; }
.step-btn:hover { color: var(--emerald); background: rgba(52,229,160,0.09); position: relative; z-index: 1; }
.daily-btn {
  margin-left: 0.75rem; background: var(--grad); color: #04140d; border: none; border-radius: 11px;
  padding: 0.46rem 1.1rem; font-weight: 800; font-size: 0.78rem; cursor: pointer;
  box-shadow: 0 8px 22px -8px rgba(52,229,160,0.6); transition: all 0.15s; font-family: var(--font);
}
.daily-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -10px rgba(52,229,160,0.75); }
.dry { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.73rem; margin-left: auto; }
.dry input { accent-color: var(--emerald); }
.gear-btn, .pause-btn { margin-left: 0.4rem; }

/* forms */
details summary { cursor: pointer; color: var(--emerald); font-size: 0.86rem; font-weight: 600; padding: 0.4rem 0; list-style: none; }
details summary::-webkit-details-marker { display: none; }
/* create drawer */
#create.drawer {
  width: min(480px, 94vw);
  background:
    radial-gradient(420px 260px at 88% -6%, rgba(56,189,248,0.11), transparent 62%),
    radial-gradient(380px 240px at 6% -4%, rgba(52,229,160,0.11), transparent 60%),
    radial-gradient(360px 300px at 50% 112%, rgba(167,139,250,0.08), transparent 58%),
    rgba(11, 14, 22, 0.93);
}
#create::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2.5px;
  background: linear-gradient(90deg, #34e5a0, #38bdf8, #a78bfa, #38bdf8, #34e5a0);
  background-size: 300% 100%; animation: auroraSlide 7s linear infinite;
}
@keyframes auroraSlide { to { background-position: -300% 0; } }
#create .drawer-head h2 {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; font-size: 1.3rem;
}
.create-sub { color: var(--faint); font-size: 0.74rem; margin-top: 0.15rem; }
#create .tabs { gap: 0; margin-bottom: 1.2rem; background: rgba(0,0,0,0.3);
  border: 1px solid var(--line); border-radius: 13px; padding: 0.25rem; }
#create .tab { flex: 1; text-align: center; padding: 0.5rem 0; border-radius: 10px;
  border: none; background: transparent; transition: color 0.2s, background 0.25s, box-shadow 0.25s; }
#create .tab:hover { color: var(--ink); }
#create .tab.active { color: #04140d; background: var(--grad);
  box-shadow: 0 8px 22px -10px rgba(52,229,160,0.55); }
#create .cs-grid { gap: 0.95rem; margin-top: 0; }
#create .cs-grid label {
  font-size: 0.67rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em;
  transition: color 0.15s;
}
#create .cs-grid label:focus-within { color: var(--emerald); }
#create .cs-grid input, #create .cs-grid select {
  width: 100%; font-size: 0.87rem; padding: 0.7rem 0.9rem; border-radius: 13px;
  background-color: rgba(0,0,0,0.3);
}
#create .cs-grid input:focus, #create .cs-grid select:focus {
  background-color: rgba(0,0,0,0.42);
  box-shadow: 0 0 0 3px rgba(52,229,160,0.13), 0 12px 32px -16px rgba(52,229,160,0.45);
}
#create .cs-grid select { padding-right: 2.2rem; }
#create.open .create-pane:not(.hidden) > * { animation: fieldRise 0.34s cubic-bezier(0.2,0.9,0.3,1) both; }
#create.open .create-pane:not(.hidden) > :nth-child(1) { animation-delay: 0.04s; }
#create.open .create-pane:not(.hidden) > :nth-child(2) { animation-delay: 0.08s; }
#create.open .create-pane:not(.hidden) > :nth-child(3) { animation-delay: 0.12s; }
#create.open .create-pane:not(.hidden) > :nth-child(4) { animation-delay: 0.16s; }
#create.open .create-pane:not(.hidden) > :nth-child(5) { animation-delay: 0.20s; }
#create.open .create-pane:not(.hidden) > :nth-child(6) { animation-delay: 0.24s; }
#create.open .create-pane:not(.hidden) > :nth-child(7) { animation-delay: 0.28s; }
@keyframes fieldRise { from { opacity: 0; transform: translateY(10px); } }
#create .create-pane .hint {
  font-size: 0.75rem; line-height: 1.55; margin-top: 0.1rem;
  text-transform: none; letter-spacing: 0;
}
#create .modal-actions { margin-top: 0.5rem; }
#create .modal-actions .primary {
  width: 100%; padding: 0.78rem; font-size: 0.9rem; border-radius: 14px;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s, background-position 0.45s;
}
#create .modal-actions .primary:hover { background-position: 90% 50%; }
.create-hint {
  border: 1px solid rgba(52,229,160,0.28); border-radius: 12px; padding: 0.65rem 0.8rem;
  font-size: 0.78rem; line-height: 1.5; color: var(--ink);
  background: linear-gradient(135deg, rgba(52,229,160,0.12), rgba(56,189,248,0.08), rgba(167,139,250,0.1));
  background-size: 220% 220%;
  margin-bottom: 1rem;
  animation: modalIn 0.25s ease both, hintDrift 6s ease-in-out infinite alternate;
}
@keyframes hintDrift { to { background-position: 100% 100%; } }
.new-client-link { color: var(--emerald); cursor: pointer; font-weight: 600; }

/* terminology settings */
.term-presets { display: flex; gap: 0.45rem; margin: 0.8rem 0 0.9rem; }
.term-presets .tab { transition: all 0.2s; }
.term-presets .tab.active { color: #04140d; background: var(--grad); border-color: transparent;
  box-shadow: 0 8px 22px -10px rgba(52,229,160,0.55); }
.term-row { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; }
.term-row label { display: flex; flex-direction: column; gap: 0.28rem; color: var(--muted);
  font-size: 0.67rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; }
.term-row label:focus-within { color: var(--emerald); }
.term-row .primary { padding: 0.55rem 1.1rem; }
[data-theme="light"] #create.drawer {
  background:
    radial-gradient(420px 260px at 88% -6%, rgba(56,189,248,0.14), transparent 62%),
    radial-gradient(380px 240px at 6% -4%, rgba(52,229,160,0.14), transparent 60%),
    rgba(250, 251, 254, 0.94);
}
[data-theme="light"] #create .tabs, [data-theme="light"] #create .cs-grid input,
[data-theme="light"] #create .cs-grid select { background-color: rgba(255,255,255,0.75); }
@media (prefers-reduced-motion: reduce) {
  #create::before, .create-hint, #create.open .create-pane:not(.hidden) > * { animation: none; }
}
#campaign-filter { width: 100%; max-width: 340px; }

/* ---------------- Today: attention + heatmap ---------------- */
#attention { display: flex; flex-direction: column; gap: 0.7rem; }
.attn {
  display: flex; align-items: center; gap: 1rem;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 14px; padding: 1rem 1.2rem;
  animation: cardIn 0.35s ease both;
  transition: transform 0.15s, border-color 0.2s;
}
.attn:hover { transform: translateX(4px); }
.attn.meeting_ready { border-left-color: var(--emerald); box-shadow: 0 0 30px -10px rgba(52,229,160,0.3); }
.attn.accepted_waiting { border-left-color: var(--violet); }
.attn.ready_to_invite { border-left-color: var(--cyan); }
.attn.pool_low, .attn.no_leads { border-left-color: var(--amber); }
.attn-icon { font-size: 1.5rem; }
.attn-text { display: flex; flex-direction: column; gap: 0.12rem; }
.attn-text b { font-size: 0.95rem; }
.attn-text span { color: var(--muted); font-size: 0.76rem; }
.attn-btn { margin-left: auto; white-space: nowrap; }
.snooze-btn { opacity: 0.5; } .snooze-btn:hover { opacity: 1; }

.heatmap { display: flex; flex-direction: column; gap: 0.7rem; }
.heat-grid { display: grid; grid-auto-columns: 14px; grid-auto-rows: 14px; gap: 3px; }
.cell { width: 14px; height: 14px; border-radius: 4px; background: rgba(255,255,255,0.05); transition: transform 0.1s; }
.cell:hover { transform: scale(1.4); }
.cell.l1 { background: rgba(52,229,160,0.28); }
.cell.l2 { background: rgba(52,229,160,0.5); }
.cell.l3 { background: rgba(52,229,160,0.75); }
.cell.l4 { background: var(--emerald); box-shadow: 0 0 8px 1px rgba(52,229,160,0.6); }
.heat-legend { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 0.72rem; }

/* onboarding */
.onboard-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.2rem; font-size: 0.9rem; cursor: pointer; border-radius: 10px; }
.onboard-item:hover { background: rgba(52,229,160,0.06); }
.onboard-item.done { color: var(--faint); text-decoration: line-through; }

/* ---------------- tables ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
th { text-align: left; color: var(--faint); font-weight: 600; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; padding: 0.4rem 0.55rem; position: sticky; top: 0; background: var(--surface-solid); }
td { padding: 0.55rem 0.55rem; border-top: 1px solid var(--line); font-size: 0.83rem; font-variant-numeric: tabular-nums; }
tbody tr { cursor: pointer; transition: background 0.12s; }
tbody tr:hover { background: rgba(52,229,160,0.05); }
.score-pill { font-family: var(--mono); font-size: 0.74rem; color: var(--emerald); font-weight: 500; }

/* ---------------- status ---------------- */
.status { font-weight: 700; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.status.success { color: var(--emerald); } .status.failed { color: var(--rose); }
.status.orphaned { color: var(--faint); } .status.running { color: var(--amber); }
.status.running::after { content: " ●"; animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.chip-mini { font-size: 0.62rem; padding: 0.12rem 0.5rem; border-radius: 12px; background: rgba(255,255,255,0.06); color: var(--muted); margin-left: 0.35rem; }
.lead-status { font-size: 0.66rem; font-weight: 700; padding: 0.14rem 0.55rem; border-radius: 12px; background: rgba(255,255,255,0.06); color: var(--muted); }
.lead-status.invited { color: #60a5fa; } .lead-status.accepted { color: var(--violet); }
.lead-status.messaged { color: var(--cyan); } .lead-status.replied { color: var(--amber); }
.lead-status.engaged { color: #94a3b8; }
.lead-status.meeting_candidate, .lead-status.meeting_sent { color: var(--emerald); }
.lead-status.opt_out { color: var(--rose); }

/* ---------------- activity ---------------- */
.act-sep { color: var(--faint); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em; padding: 0.9rem 0.3rem 0.3rem; font-weight: 600; }
.act-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.75rem 0.4rem; border-top: 1px solid var(--line); cursor: pointer; transition: background 0.12s, padding-left 0.15s; }
.act-row:hover { background: rgba(52,229,160,0.05); padding-left: 0.7rem; }
.act-main b { font-size: 0.9rem; }
.act-camp { color: var(--muted); font-size: 0.78rem; margin-left: 0.6rem; }
.act-summary { color: var(--muted); font-size: 0.76rem; margin-top: 0.25rem; }
.act-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; }
.act-time { color: var(--faint); font-size: 0.72rem; white-space: nowrap; }
.act-actions { display: flex; gap: 0.3rem; }
.act-filters { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.9rem; }
#act-search { width: 200px; }

/* ---------------- insights ---------------- */
.trend { width: 100%; height: 200px; display: block; }
.chart-x { display: flex; justify-content: space-between; color: var(--faint); font-size: 0.68rem; margin-top: 0.4rem; }
.chart-legend { display: flex; gap: 1.1rem; margin-top: 0.7rem; }
.chart-legend span { color: var(--muted); font-size: 0.75rem; display: flex; align-items: center; gap: 0.4rem; }
.load-row { display: flex; align-items: center; gap: 1rem; padding: 0.5rem 0; }
.load-name { min-width: 120px; font-size: 0.87rem; font-weight: 600; }
.load-bar { flex: 1; height: 10px; border-radius: 6px; background: rgba(255,255,255,0.05); overflow: hidden; }
.load-bar div { height: 100%; background: var(--grad); transition: width 0.6s ease; border-radius: 6px; }
.load-bar div.hotbar { background: var(--grad-warm); }

/* ---------------- tabs ---------------- */
.tabs { display: flex; gap: 0.35rem; margin-bottom: 1rem; }
.tab { background: rgba(255,255,255,0.03); border: 1px solid var(--line-strong); color: var(--muted); border-radius: 10px; padding: 0.4rem 0.9rem; font-size: 0.77rem; font-weight: 600; }
.tab.active { color: #04140d; background: var(--grad); border-color: transparent; }

/* ---------------- drawer ---------------- */
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(700px, 94vw);
  background: rgba(11, 14, 22, 0.9);
  backdrop-filter: blur(30px) saturate(1.2);
  border-left: 1px solid var(--line-strong);
  box-shadow: -50px 0 130px -30px rgba(0,0,0,0.85);
  transform: translateX(105%);
  transition: transform 0.32s cubic-bezier(0.2,0.9,0.3,1);
  display: flex; flex-direction: column; padding: 1.5rem 1.6rem; z-index: 40;
  height: 100dvh;
  padding-top: calc(1.5rem + env(safe-area-inset-top));
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 0.9rem; position: sticky; top: 0; z-index: 2; }
.drawer-head h2 { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; }
#log { flex: 1; background: rgba(0,0,0,0.45); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; font-family: var(--mono); font-size: 0.75rem; line-height: 1.6; overflow: auto; white-space: pre-wrap; color: #9fb0c8; }
.log-steps { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.7rem; }
.step-chip { font-size: 0.7rem; font-weight: 600; padding: 0.24rem 0.7rem; border-radius: 16px; background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--line); }
.step-chip.done { color: var(--emerald); border-color: rgba(52,229,160,0.4); }
.step-chip.failed { color: var(--rose); border-color: rgba(251,113,133,0.4); }
.step-chip.running { color: var(--amber); }

/* thread bubbles */
.msg-card { background: rgba(0,0,0,0.25); border: 1px solid var(--line); border-radius: 14px; padding: 0.8rem 1rem; margin-bottom: 0.7rem; }
.msg-card.expandable { cursor: pointer; transition: border-color 0.2s; }
.msg-card.expandable:hover { border-color: var(--line-strong); }
.msg-card .who { display: flex; align-items: center; gap: 0.45rem; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.35rem; }
.msg-card .text { color: #a8b4ca; font-size: 0.8rem; line-height: 1.55; }
.thread { margin-top: 0.7rem; display: flex; flex-direction: column; gap: 0.4rem; }
.bubble { max-width: 78%; padding: 0.5rem 0.75rem; border-radius: 13px; font-size: 0.79rem; line-height: 1.45; white-space: pre-wrap; }
.bubble.them { background: rgba(255,255,255,0.07); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.us { background: linear-gradient(135deg, rgba(52,229,160,0.18), rgba(56,189,248,0.12)); align-self: flex-end; border-bottom-right-radius: 4px; }

/* ---------------- modals + palette ---------------- */
.modal { position: fixed; inset: 0; background: rgba(4,6,11,0.72); backdrop-filter: blur(6px); display: grid; place-items: start center; padding-top: calc(12vh + env(safe-area-inset-top)); z-index: 70; }
/* confirm is an interrupt — must stack above whatever modal asked for it */
#confirm.modal { z-index: 85; }
button:disabled { opacity: 0.55; cursor: progress; transform: none !important; filter: none !important; }
.modal-card { background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: 20px; padding: 1.8rem 2rem; width: min(440px, 92vw); box-shadow: var(--shadow-lg); animation: modalIn 0.22s ease both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-12px) scale(0.97); } }
.modal-card h2 { font-size: 1.15rem; margin-bottom: 0.6rem; font-weight: 800; }
.modal-card p { color: var(--muted); font-size: 0.86rem; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.3rem; }
.cs-grid { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.9rem; }
.cs-grid label { display: flex; flex-direction: column; gap: 0.28rem; color: var(--muted); font-size: 0.74rem; }
.cs-row { flex-direction: row !important; align-items: center; gap: 0.5rem !important; }
.palette-card { background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: 18px; width: min(600px, 94vw); box-shadow: var(--shadow-lg); overflow: hidden; animation: modalIn 0.2s ease both; }
#palette-input { width: 100%; border: none; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 1.05rem 1.2rem; font-size: 1rem; }
#palette-input:focus { outline: none; box-shadow: none; }
#palette-results { max-height: 340px; overflow: auto; padding: 0.5rem; }
.pal-item { display: flex; align-items: center; gap: 0.55rem; padding: 0.6rem 0.75rem; border-radius: 11px; cursor: pointer; font-size: 0.86rem; border: 1px solid transparent; }
.pal-item.active { background: rgba(52,229,160,0.12); border-color: rgba(52,229,160,0.35); }
.pal-hint { display: flex; align-items: center; gap: 0.3rem; padding: 0.55rem 0.75rem 0.3rem; color: var(--faint); font-size: 0.7rem; border-top: 1px solid var(--line); margin-top: 0.4rem; }
kbd { background: rgba(0,0,0,0.4); border: 1px solid var(--line-strong); border-radius: 6px; padding: 0.1rem 0.45rem; font-family: var(--mono); font-size: 0.72rem; margin: 0 0.1rem; }
.shortcut-list { display: flex; flex-direction: column; gap: 0.6rem; margin: 1rem 0; font-size: 0.86rem; color: var(--muted); }
.shortcut-list div { color: var(--ink); }

/* ---------------- health ---------------- */
.health-row { display: flex; gap: 1.8rem; flex-wrap: wrap; align-items: center; }
.health-item { display: flex; align-items: center; gap: 0.55rem; font-size: 0.88rem; }

/* ---------------- toasts + confetti ---------------- */
#toasts { position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 0.5rem; z-index: 60; }
.toast { background: var(--surface-solid); border: 1px solid var(--line-strong); border-left: 3px solid var(--emerald); border-radius: 12px; padding: 0.7rem 1.2rem; font-size: 0.84rem; box-shadow: var(--shadow); animation: rise 0.25s ease; }
.toast.err { border-left-color: var(--rose); color: var(--rose); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.confetti { position: fixed; top: -14px; width: 10px; height: 15px; z-index: 90; border-radius: 2px; animation: drop 2.6s ease-in forwards; pointer-events: none; }
@keyframes drop { to { transform: translateY(108vh) rotate(720deg); opacity: 0.7; } }

.empty-state { color: var(--muted); font-size: 0.86rem; line-height: 1.7; padding: 0.5rem 0; }
.empty-state b { color: var(--ink); }
.empty-state.loading { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; min-height: 44px; }
@keyframes shimmer { to { background-position: -200% 0; } }
a { transition: color 0.15s; }

/* ---------------- responsive ---------------- */
@media (max-width: 820px) {
  .topnav-inner { flex-wrap: wrap; gap: 0.7rem 1rem; }
  /* nav scrolls sideways — fade the clipped edges so it's obvious there's more */
  nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 30px), transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 30px), transparent); }
  nav::-webkit-scrollbar { display: none; }
  .nav-item { font-size: 0.84rem; padding: 0.55rem 0.7rem; white-space: nowrap; }
  .nav-item.active::after { bottom: -0.35rem; }
  .master-toggle span { display: none; }
  .topbar h1 { font-size: 1.5rem; }
  .hero { grid-template-columns: repeat(2, 1fr); }
  .drawer { width: 100vw; padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
  .attn { flex-wrap: wrap; } .attn-btn { margin-left: 0; width: 100%; }
  .flow { gap: 0.3rem; } .daily-btn { margin-left: 0; } .dry { margin-left: 0; width: 100%; }
  /* campaign header: title takes its own line, tag + controls share the next one */
  .campaign-head { flex-wrap: wrap; align-items: center; row-gap: 0.45rem; }
  .campaign-head > div[style] { min-width: 68%; }
  .client-head { flex-direction: column; align-items: flex-start; }
  .heat-grid { overflow-x: auto; }
  /* activity filters overflowed the page on phones */
  .act-filters { flex-wrap: wrap; row-gap: 0.5rem; }
  #act-search { width: 100%; margin-left: 0 !important; }
  #campaign-filter { max-width: 100%; }
  /* real thumbs: bigger targets, and 16px inputs so iOS doesn't zoom on focus */
  .small, .ghost.small, .bc-link, .step-btn { min-height: 34px; }
  .tab { min-height: 36px; }
  input, select, #create .cs-grid input, #create .cs-grid select { min-height: 42px; font-size: 16px; }
  .modal { padding-top: calc(5vh + env(safe-area-inset-top)); overflow-y: auto; }
  .modal-card { padding: 1.5rem 1.3rem; margin-bottom: 3rem; }
  .board { grid-auto-columns: minmax(280px, 82vw); scroll-snap-type: x proximity; }
  .board-col { scroll-snap-align: start; }
  #toasts { width: max-content; max-width: 94vw; bottom: calc(1rem + env(safe-area-inset-bottom)); }
  .toast { max-width: 100%; }
}
/* never let any control force the page wider than the screen */
input, select, textarea { max-width: 100%; }

/* ============================================================
   Daylight theme — a real light mode, not an inversion
   ============================================================ */
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #eef1f8;
  --ink: #131722;
  --muted: #5a6478;
  --faint: #8b95a8;
  --line: rgba(30, 45, 80, 0.10);
  --line-strong: rgba(30, 45, 80, 0.16);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-2: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --shadow: 0 18px 50px -22px rgba(40, 60, 110, 0.28);
  --shadow-lg: 0 40px 90px -34px rgba(40, 60, 110, 0.4);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(680px 480px at 12% -8%, rgba(52, 229, 160, 0.18), transparent 60%),
    radial-gradient(720px 520px at 92% 0%, rgba(56, 189, 248, 0.16), transparent 62%),
    radial-gradient(760px 620px at 78% 108%, rgba(167, 139, 250, 0.16), transparent 60%);
}
[data-theme="light"] .topnav { background: color-mix(in srgb, #ffffff 78%, transparent); }
[data-theme="light"] #log { background: #0d1017; color: #9fb0c8; }
[data-theme="light"] .bubble.them { background: rgba(30,45,80,0.07); }
[data-theme="light"] .avatar-item .ring { border-color: var(--surface-solid); }
[data-theme="light"] input, [data-theme="light"] select { background-color: rgba(255,255,255,0.8); }
[data-theme="light"] select:hover { background-color: rgba(255,255,255,0.95); }
[data-theme="light"] select option { background: #fff; color: #1a2030; }
[data-theme="light"] .campaign, [data-theme="light"] .attn, [data-theme="light"] .msg-card { background: rgba(255,255,255,0.55); }
[data-theme="light"] .primary, [data-theme="light"] .daily-btn { color: #04140d; }

/* ---------- pulse ticker ---------- */
.pulse-ticker { flex: 1 1 auto; min-width: 0; max-width: 340px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.78rem; padding: 0 0.6rem; }
@media (max-width: 1150px) { .pulse-ticker { display: none; } }
.pulse-dim { color: var(--faint); }
.pulse-live { color: var(--emerald); font-weight: 600; animation: pulseFade 0.4s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
@keyframes pulseFade { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- notifications ---------- */
.bell { position: relative; }
.notif-badge { position: absolute; top: -6px; right: -6px; background: var(--rose); color: #fff; font-size: 0.6rem; font-weight: 800; min-width: 15px; height: 15px; border-radius: 8px; display: grid; place-items: center; padding: 0 3px; }
.notif-panel { position: fixed; top: calc(62px + env(safe-area-inset-top)); right: clamp(1rem, 3vw, 2rem); width: min(340px, 90vw); max-height: 420px; overflow: auto; background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 80; padding: 0.5rem; animation: modalIn 0.18s ease both; }
.notif-item { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.6rem 0.7rem; border-radius: 10px; }
.notif-item.unread { background: rgba(52,229,160,0.06); }
.notif-item b { font-size: 0.84rem; }

/* ---------- cockpit + goal ring ---------- */
.cockpit { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: stretch; }
@media (max-width: 760px) { .cockpit { grid-template-columns: 1fr; } }
.goal-card { display: flex; align-items: center; gap: 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.6rem; box-shadow: var(--shadow); }
.ring { width: 150px; height: 150px; }
.ring-pct { font: 800 1.6rem var(--font); fill: var(--ink); letter-spacing: -0.03em; }
.ring-lbl { font: 600 0.6rem var(--font); fill: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.goal-meta b { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.05em; line-height: 1; display: block; }
.goal-meta span { color: var(--muted); font-size: 0.82rem; }
.goal-meta em { color: var(--ink); font-style: normal; font-weight: 700; }
.goal-sub { color: var(--faint); font-size: 0.78rem; margin-top: 0.6rem; max-width: 22ch; }
.cockpit .hero { align-content: center; }

/* ---------- conversion ring ---------- */
.conv-ring { width: 46px; height: 46px; flex-shrink: 0; }
.conv-pct { font: 800 0.85rem var(--font); fill: var(--ink); }

/* ---------- consolidated account menu ---------- */
.account-btn {
  display: flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line-strong);
  border-radius: 20px; padding: 0.3rem 0.6rem 0.3rem 0.7rem; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.account-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); border-color: var(--faint); }
.account-caret { color: var(--muted); font-size: 0.7rem; }

.user-menu {
  position: fixed; top: calc(60px + env(safe-area-inset-top)); right: clamp(1rem, 3vw, 2rem);
  width: 260px; background: var(--surface-solid);
  border: 1px solid var(--line-strong); border-radius: 16px;
  box-shadow: var(--shadow-lg); z-index: 80; padding: 0.7rem;
  animation: modalIn 0.18s ease both;
}
.um-head { display: flex; justify-content: space-between; align-items: center; padding: 0.2rem 0.4rem 0.6rem; }
.um-title { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--faint); font-weight: 600; }
.um-live { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.72rem; }
.dot-mini { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 6px 1px rgba(52,229,160,0.7); }
.user-menu .avatar-list { flex-direction: column; align-items: stretch; gap: 0.3rem; padding: 0 0.2rem; }
.user-menu .avatar-item { margin: 0 !important; gap: 0.6rem; padding: 0.35rem 0.2rem; }
.user-menu .avatar-item span:not(.ring) { display: inline; font-size: 0.84rem; color: var(--ink); }
.user-menu .avatar-item .ring { width: 26px; height: 26px; border: none; }
.um-divider { height: 1px; background: var(--line); margin: 0.5rem 0.2rem; }
.um-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  width: 100%; text-align: left; background: transparent; border: none;
  color: var(--ink); font-size: 0.86rem; font-family: var(--font);
  padding: 0.55rem 0.5rem; border-radius: 10px; cursor: pointer; text-decoration: none;
  transition: background 0.12s;
}
.um-row:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.um-hint { color: var(--faint); font-size: 0.72rem; }
.um-logout { color: var(--rose); }
.master-toggle.um-row input { accent-color: var(--emerald); }

/* ---------- kanban board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 0.9rem; overflow-x: auto; padding-bottom: 0.6rem; align-items: start; }
.board-col {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 0; overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}
.board-col::before { content: ""; display: block; height: 3px; background: var(--col); opacity: 0.85; }
.board-col-head {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 0.85rem 0.65rem;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); font-weight: 700;
}
.col-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--col); box-shadow: 0 0 8px 0 color-mix(in srgb, var(--col) 70%, transparent); }
.col-label { flex: 1; }
.board-col-head b { color: var(--ink); background: color-mix(in srgb, var(--col) 20%, transparent); border-radius: 10px; padding: 0.08rem 0.5rem; font-size: 0.72rem; }
.board-col-body { display: flex; flex-direction: column; gap: 0.55rem; padding: 0.2rem 0.7rem 0.8rem; min-height: 60px; max-height: 62vh; overflow-y: auto; transition: background 0.15s; }
.board-card {
  position: relative; background: var(--surface-2); border: 1px solid var(--line-strong);
  border-left: 3px solid var(--col); border-radius: 12px; padding: 0.7rem 0.8rem;
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
}
.board-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -12px rgba(0,0,0,0.6); border-color: var(--col); }
.bc-top { display: flex; gap: 0.55rem; align-items: flex-start; }
.bc-avatar {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 800; color: #fff;
  background: color-mix(in srgb, var(--col) 55%, #1a2030);
}
.bc-id { min-width: 0; }
.bc-name { font-weight: 700; font-size: 0.86rem; line-height: 1.2; }
.bc-sub { color: var(--muted); font-size: 0.72rem; margin-top: 0.15rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 0.6rem; }
.bc-score { font-family: var(--mono); font-size: 0.72rem; font-weight: 600; color: var(--col); background: color-mix(in srgb, var(--col) 14%, transparent); border-radius: 8px; padding: 0.1rem 0.45rem; }
.bc-link { color: var(--muted); text-decoration: none; font-size: 0.72rem; }
.bc-link:hover { color: var(--cyan); }
.board-empty { color: var(--faint); text-align: center; font-size: 0.75rem; padding: 1rem 0.5rem; border: 1.5px dashed var(--line-strong); border-radius: 10px; }
[data-theme="light"] .board-card { background: rgba(255,255,255,0.72); }
[data-theme="light"] .bc-avatar { color: #fff; }

/* ---------- board client/campaign switcher ---------- */
.board-nav { margin-bottom: 0.9rem; }
.switcher {
  display: flex; align-items: stretch; gap: 0.4rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 0.7rem 0.9rem; box-shadow: var(--shadow); flex-wrap: wrap;
}
.switch-tier { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.switch-tier.grow { flex: 1; }
.switch-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--faint); font-weight: 700; padding-left: 0.2rem; }
.switch-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.switch-arrow { align-self: center; color: var(--faint); font-size: 1.4rem; padding: 0 0.3rem; margin-top: 0.9rem; }
.switch-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line-strong); color: var(--muted);
  border-radius: 11px; padding: 0.42rem 0.75rem; font-size: 0.83rem; font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: all 0.15s;
}
.switch-pill:hover { color: var(--ink); border-color: var(--faint); transform: translateY(-1px); }
.switch-pill.on {
  color: #04140d; background: var(--grad); border-color: transparent;
  box-shadow: 0 8px 20px -8px rgba(52,229,160,0.55);
}
.sp-badge {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  font-size: 0.62rem; font-weight: 800; color: #fff;
  background: color-mix(in srgb, var(--violet) 55%, #1a2030);
}
.switch-pill.on .sp-badge { background: rgba(0,0,0,0.18); color: #04140d; }
.pill-count { background: rgba(0,0,0,0.16); border-radius: 9px; padding: 0.02rem 0.42rem; font-size: 0.68rem; font-weight: 700; }
.switch-pill:not(.on) .pill-count { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--muted); }
.pill-ap { font-size: 0.7rem; }
@media (max-width: 700px) { .switch-arrow { display: none; } .switch-tier.grow { width: 100%; } }


/* ---------- UI bug fixes ---------- */
.file-head { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 1rem 0 0.5rem; }
.file-head:first-child { margin-top: 0; }
.scrim { position: fixed; inset: 0; background: rgba(4,6,11,0.45); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity 0.28s; z-index: 39; }
.scrim.on { opacity: 1; pointer-events: auto; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--emerald); }
/* balanced cockpit: 2x2 stat grid beside the goal ring */
.cockpit .hero { grid-template-columns: repeat(2, 1fr); align-content: stretch; }
@media (max-width: 760px) { .cockpit .hero { grid-template-columns: 1fr 1fr; } }

/* ---------- campaign action bar ---------- */
:root {
  --st-qualified: #64748b; --st-engaged: #a78bfa; --st-invited: #3b82f6;
  --st-connected: #38bdf8; --st-talking: #fbbf24; --st-meeting: #34e5a0;
}
.action-bar {
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.action-flow { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.act-step {
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.25rem;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line-strong);
  border-radius: 13px; padding: 0.55rem 0.7rem; min-width: 66px; cursor: pointer;
  color: var(--muted); font-family: var(--font); font-size: 0.72rem; font-weight: 600;
  transition: transform 0.14s, border-color 0.14s, color 0.14s, background 0.14s, box-shadow 0.14s;
}
.act-ico { font-size: 1.05rem; line-height: 1; filter: saturate(0.4) opacity(0.85); transition: filter 0.14s; }
.act-step:hover {
  color: var(--ink); border-color: var(--s); background: color-mix(in srgb, var(--s) 12%, transparent);
  transform: translateY(-3px); box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--s) 60%, transparent);
}
.act-step:hover .act-ico { filter: none; }
.act-link { color: var(--faint); font-size: 0.85rem; user-select: none; }
.action-cta { display: flex; align-items: center; gap: 0.9rem; }
.action-cta .dry { margin: 0; }
.action-bar .daily-btn {
  margin: 0; padding: 0.7rem 1.35rem; font-size: 0.85rem; border-radius: 13px;
}
@media (max-width: 640px) {
  .action-bar { flex-direction: column; align-items: stretch; }
  .action-cta { justify-content: space-between; }
  .action-flow { justify-content: center; }
}

/* clickable notifications */
.notif-item.clickable { cursor: pointer; transition: background 0.12s; }
.notif-item.clickable:hover { background: color-mix(in srgb, var(--emerald) 8%, transparent); }
.notif-go { margin-left: auto; color: var(--emerald); font-size: 0.72rem; font-weight: 600; white-space: nowrap; align-self: center; }

/* ============================================================
   Aurora v2 — grain, motion & new components
   ============================================================ */

/* film grain over the aurora — kills gradient banding, adds depth */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
}

/* living brand gradient */
.brand span, .stat.hot b { background-size: 200% 200%; animation: brandShift 7s ease-in-out infinite alternate; }
@keyframes brandShift { to { background-position: 100% 60%; } }

/* subtle top edge-light on glass surfaces */
.panel, .client-card, .stat, .goal-card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow);
}

/* ---------- running-now strip ---------- */
.run-strip { display: flex; gap: 0.55rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.2rem; }
.run-chip {
  display: inline-flex; align-items: center; gap: 0.55rem;
  background: var(--surface); backdrop-filter: blur(16px);
  border: 1px solid rgba(251, 191, 36, 0.35); border-radius: 20px;
  padding: 0.4rem 0.95rem; font-size: 0.78rem; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow); animation: cardIn 0.3s ease both;
  transition: border-color 0.15s, transform 0.15s;
}
.run-chip:hover { border-color: var(--amber); transform: translateY(-2px); }
.run-chip .rc-target { color: var(--muted); font-weight: 500; }
.spinner {
  width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(251, 191, 36, 0.25); border-top-color: var(--amber);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- insights: week-over-week deltas ---------- */
.delta {
  font-style: normal; font-size: 0.68rem; font-weight: 800; letter-spacing: 0;
  border-radius: 12px; padding: 0.12rem 0.5rem; margin-left: 0.5rem; vertical-align: middle;
}
.delta.up { color: var(--emerald); background: rgba(52, 229, 160, 0.12); }
.delta.down { color: var(--rose); background: rgba(251, 113, 133, 0.12); }
.delta.flat { color: var(--muted); background: rgba(255, 255, 255, 0.06); }

/* ---------- chart hover tooltip ---------- */
.chart-wrap { position: relative; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 0.45rem 0.7rem; font-size: 0.73rem; line-height: 1.5; white-space: nowrap;
  box-shadow: var(--shadow); transform: translate(-50%, -115%);
}
.chart-tip b { font-variant-numeric: tabular-nums; }
.chart-cursor { stroke: rgba(255, 255, 255, 0.18); stroke-width: 1; }
[data-theme="light"] .chart-cursor { stroke: rgba(30, 45, 80, 0.25); }

/* ---------- heatmap weekday labels ---------- */
.heat-wrap { display: flex; gap: 7px; }
.heat-days { display: grid; grid-auto-rows: 14px; gap: 3px; color: var(--faint); font-size: 0.58rem; align-items: center; }

/* ---------- board polish ---------- */
/* per-stage tint bleeding from the accent bar */
.board-col {
  background:
    linear-gradient(color-mix(in srgb, var(--col) 5%, transparent), transparent 36%),
    var(--surface);
}
/* cards enter with a stagger (delay set inline per card) */
.board-card { animation: cardIn 0.3s ease both; }
/* loading / error states shouldn't be squeezed by the column grid */
.board > .empty-state { align-self: center; min-width: 300px; }
/* marathon names/titles must never escape the card */
.bc-name, .bc-sub { overflow-wrap: anywhere; }

/* ---------- Today: second row (pipeline / plan / feed) ---------- */
.today-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 1.1rem; align-items: start; }
@media (max-width: 1000px) { .today-grid { grid-template-columns: 1fr; } }
.plan-row { display: flex; gap: 0.65rem; align-items: flex-start; padding: 0.55rem 0.2rem; border-top: 1px solid var(--line); }
.plan-row:first-child { border-top: none; }
.plan-ico { font-size: 1rem; line-height: 1.3; }
.plan-row b { display: block; font-size: 0.84rem; }
.plan-row span { color: var(--muted); font-size: 0.74rem; }
.plan-link { color: var(--emerald); cursor: pointer; font-size: 0.78rem; font-weight: 600; margin-top: 0.7rem; }
.plan-link:hover { text-decoration: underline; }
.feed-row { display: flex; gap: 0.6rem; align-items: center; padding: 0.5rem 0.3rem; border-top: 1px solid var(--line); cursor: pointer; border-radius: 8px; transition: background 0.12s; }
.feed-row:first-child { border-top: none; }
.feed-row:hover { background: rgba(52, 229, 160, 0.05); }
.feed-main b { display: block; font-size: 0.83rem; }
.feed-main span { color: var(--faint); font-size: 0.72rem; }
.feed-more { color: var(--emerald); cursor: pointer; text-decoration: none; text-transform: none; letter-spacing: 0; }
.funnel-legend .leg-static { cursor: default; }
.funnel-legend .leg-static:hover b { color: var(--ink); }

/* ============================================================
   Today redesign — command deck + two-column layout
   ============================================================ */
.deck {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.15fr auto 1.3fr; gap: clamp(1.2rem, 3vw, 2.6rem);
  align-items: center;
  background: var(--surface);
  backdrop-filter: blur(26px) saturate(1.25);
  border: 1px solid var(--line); border-radius: 24px;
  padding: 1.9rem clamp(1.4rem, 3vw, 2.4rem);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* gradient edge, same treatment as the login card but quieter */
.deck::before {
  content: ""; position: absolute; inset: 0; padding: 1px; border-radius: 24px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.22; pointer-events: none;
}
/* soft glow anchored behind the goal ring */
.deck::after {
  content: ""; position: absolute; top: -40%; left: 34%; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(52, 229, 160, 0.12), transparent 65%);
  pointer-events: none;
}
.deck-left h1 { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.04em; }
.deck-left p { color: var(--muted); font-size: 0.85rem; margin: 0.35rem 0 1.3rem; max-width: 30ch; }
.deck-ring { display: flex; align-items: center; gap: 1.2rem; position: relative; z-index: 1; }

/* week numbers live inside the deck — no boxes, just type */
.deck-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 2rem; position: relative; z-index: 1; }
.deck-stats .stat {
  background: transparent; border: none; box-shadow: none; backdrop-filter: none;
  padding: 0.55rem 0; border-radius: 0;
}
.deck-stats .stat:hover { transform: none; border: none; }
.deck-stats .stat::after { display: none; }
.deck-stats .stat b { font-size: 2rem; }
.deck-stats .stat span { margin-top: 0.25rem; }
.deck-stats .stat.spark { justify-content: center; }
.deck-stats .sparkline { height: 34px; }

.today-cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 1.15rem; align-items: start; }
.col-main, .col-rail { display: flex; flex-direction: column; gap: 1.15rem; min-width: 0; }
.col-rail .panel { padding: 1.15rem 1.3rem; }

@media (max-width: 1020px) {
  .today-cols { grid-template-columns: 1fr; }
  .deck { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 1.4rem; }
  .deck-left p { max-width: none; }
  .deck-stats { width: 100%; grid-template-columns: repeat(2, 1fr); text-align: left; }
}

/* ---------- attention "inbox zero" state ---------- */
.zero-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 0.45rem; padding: 2.2rem 1rem 1.8rem;
}
.zero-badge {
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; color: #04140d;
  background: var(--grad);
  box-shadow: 0 10px 34px -8px rgba(52, 229, 160, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  margin-bottom: 0.5rem;
  animation: zeroPop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes zeroPop { from { transform: scale(0.4) rotate(-14deg); opacity: 0; } }
.zero-state b { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.zero-state p { color: var(--muted); font-size: 0.84rem; max-width: 34ch; line-height: 1.55; }
.zero-state .primary { margin-top: 0.9rem; }

/* ---------- heatmap day drill-down ---------- */
#heatmap .cell[data-date] { cursor: pointer; }
.cell.sel { outline: 2px solid var(--emerald); outline-offset: 1px; transform: scale(1.25); }
/* collapsed by default; .open slides it in — no display:none jumps */
.day-detail {
  max-height: 0; opacity: 0; transform: translateY(-6px); overflow: hidden;
  margin-top: 0; padding: 0 0.9rem;
  background: rgba(0, 0, 0, 0.22); border: 1px solid transparent; border-radius: 12px;
  transition: max-height 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.22s ease,
    transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1), margin 0.3s ease, padding 0.3s ease;
}
.day-detail.open {
  max-height: 420px; opacity: 1; transform: none;
  margin-top: 0.8rem; padding: 0.8rem 0.9rem; border-color: var(--line);
}
[data-theme="light"] .day-detail { background: rgba(255, 255, 255, 0.55); }
.dd-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.dd-head b { font-size: 0.9rem; }
.dd-kinds { display: flex; gap: 0.9rem; flex-wrap: wrap; padding: 0.3rem 0 0.4rem; }
.dd-kind { color: var(--muted); font-size: 0.78rem; }
.dd-kind b { color: var(--ink); }
.dd-sec { color: var(--faint); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; margin: 0.6rem 0 0.2rem; }
.dd-row { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.3rem 0; font-size: 0.78rem; }
.dd-camp { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-nums { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ============================================================
   Campaigns redesign — deck hero + elevated client cards
   ============================================================ */
.deck-row { grid-template-columns: 1fr 1.5fr; }
.deck-row::after { left: 60%; top: -60%; }
.deck-actions { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.deck-actions input { min-width: 240px; background: rgba(0, 0, 0, 0.3); }
/* five totals flow as typography, wrapping 3 + 2 */
.deck-stats-flow { display: flex; flex-wrap: wrap; gap: 0.2rem 2.4rem; align-content: center; }
.deck-stats-flow .stat { min-width: 118px; }

/* client identity */
.client-id { display: flex; align-items: center; gap: 0.85rem; }
.client-badge {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--grad); color: #04140d; font-weight: 800; font-size: 1rem;
  box-shadow: 0 8px 22px -8px rgba(52, 229, 160, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.client-url { display: block; color: var(--faint); font-size: 0.75rem; text-decoration: none; margin-top: 0.15rem; }
.client-url:hover { color: var(--cyan); }
.client-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.client-head { align-items: center; padding-bottom: 0.85rem; border-bottom: 1px solid var(--line); }

/* card depth to match the Today deck language */
.client-card { position: relative; }
.client-card::before {
  content: ""; position: absolute; inset: 0; padding: 1px; border-radius: var(--radius);
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.client-card:hover::before { opacity: 0.16; }
.campaign { transition: border-color 0.2s, transform 0.18s, box-shadow 0.2s; }
.campaign:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.6); }

@media (max-width: 900px) {
  .deck-row { grid-template-columns: 1fr; }
  .deck-actions { justify-content: center; }
  .deck-stats-flow { justify-content: center; gap: 0.2rem 1.6rem; }
  .client-head { flex-direction: row !important; }
}
