/* ============================================================
   ProfBot | Midnight Studio Theme (Zinc-950 / Indigo-500 / Emerald)
   ============================================================ */
:root {
  --bg: #09090b;
  --surface: #121215;
  --surface-2: #18181b;
  --surface-3: #27272a;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #f4f4f5;
  --text-2: #d4d4d8;
  --text-muted: #a1a1aa;
  --muted: #a1a1aa;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-soft: rgba(99, 102, 241, 0.12);
  --primary-ring: rgba(99, 102, 241, 0.28);
  --primary-text: #ffffff;
  --accent: #818cf8;
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.12);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --warn-border: rgba(245, 158, 11, 0.25);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.12);

  --side-bg: rgba(9, 9, 11, 0.92);
  --side-bg-2: #09090b;
  --side-text: #a1a1aa;
  --side-muted: #71717a;
  --side-hover: rgba(255, 255, 255, 0.05);
  --side-active: rgba(99, 102, 241, 0.12);
  --side-accent: #818cf8;

  --term-bg: #000000;
  --term-head: #18181b;
  --term-border: rgba(255, 255, 255, 0.1);
  --term-text: #d4d4d8;
  --term-muted: #71717a;
  --term-ok: #34d399;
  --term-warn: #fbbf24;
  --term-error: #fb7185;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 24px -4px rgba(0, 0, 0, .5);
  --shadow-lg: 0 20px 48px -12px rgba(0, 0, 0, .75);
  --radius: 14px;
  --radius-sm: 10px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --surface: #121215;
    --surface-2: #18181b;
    --surface-3: #27272a;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.13);
    --text: #f4f4f5;
    --text-2: #d4d4d8;
    --text-muted: #a1a1aa;
    --muted: #a1a1aa;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-soft: rgba(99, 102, 241, 0.12);
    --primary-ring: rgba(99, 102, 241, 0.28);
    --primary-text: #ffffff;
    --accent: #818cf8;
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --warn: #f59e0b;
    --warn-soft: rgba(245, 158, 11, 0.12);
    --warn-border: rgba(245, 158, 11, 0.25);
    --danger: #f43f5e;
    --danger-soft: rgba(244, 63, 94, 0.12);
    --side-bg: rgba(9, 9, 11, 0.92);
    --side-bg-2: #09090b;
    --term-bg: #000000;
    --term-head: #18181b;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-underline-offset: 2px; }
h1 { margin: 0 0 6px; font-size: 1.75rem; line-height: 1.2; letter-spacing: -.022em; font-weight: 750; }
h2 { margin: 0 0 4px; font-size: 1.08rem; letter-spacing: -.012em; font-weight: 700; }
h3 { margin: 0; font-size: 1rem; font-weight: 650; }
p { margin: 0 0 12px; }
small { color: var(--muted); font-weight: 400; }
code, kbd { font-family: var(--mono); font-size: .84em; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
kbd { border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; }
::selection { background: var(--primary-ring); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px;
  padding: 22px 14px; color: var(--side-text);
  background: linear-gradient(180deg, var(--side-bg-2), var(--side-bg) 42%);
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; padding: 2px 8px; }
.brand-text strong { display: block; font-size: 15px; line-height: 1.2; letter-spacing: -.01em; }
.brand-text small { font-size: 12px; color: var(--side-muted); }
.logo {
  width: 38px; height: 38px; border-radius: 11px; color: #fff; flex: none; display: grid; place-items: center;
  background: linear-gradient(140deg, #3d6cf0, #1f45c4); box-shadow: 0 6px 16px -4px rgba(61, 108, 240, .6), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.logo .i { width: 21px; height: 21px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  border: 0; background: none; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  color: var(--side-text); font: inherit; font-size: 14.5px; font-weight: 500; text-align: left;
  transition: background .15s, color .15s;
}
.nav button .i { color: var(--side-muted); transition: color .15s; }
.nav button:hover { background: var(--side-hover); color: #fff; }
.nav button:hover .i { color: var(--side-text); }
.nav button.active { background: var(--side-active); color: #fff; font-weight: 600; }
.nav button.active .i { color: var(--side-accent); }
.nav button.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--side-accent);
}
.nav .badge {
  margin-left: auto; background: rgba(255, 255, 255, .08); color: var(--side-text); border-radius: 999px;
  padding: 0 8px; font-size: 11.5px; font-weight: 600; min-width: 24px; text-align: center; line-height: 20px;
}
.nav button.active .badge { background: var(--side-accent); color: var(--side-bg); }
.setup-dot, .live-dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; flex: none; }
.setup-dot { background: #fb8a65; box-shadow: 0 0 0 3px rgba(251, 138, 101, .2); }
.live-dot { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .2); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.sidebar-foot { margin-top: auto; display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--side-muted); padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar-foot .i { width: 14px; height: 14px; }

main { padding: 36px 44px 88px; max-width: 1140px; width: 100%; min-width: 0; outline: none; }
.tab { display: none; animation: fade .2s ease; }
.tab.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.page-head { margin-bottom: 22px; }
.page-head p { max-width: 720px; }
.row-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.row-head p { margin: 0; }

/* ---------- Generic ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card.narrow { max-width: 760px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head p { margin: 0; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 8px; }
.wrap { flex-wrap: wrap; }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; font-size: 14px; line-height: 1.35;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .06s; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); box-shadow: 0 1px 2px rgba(13, 23, 48, .1), 0 4px 12px -4px var(--primary-ring); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.small .i { width: 15px; height: 15px; }
.btn.lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn.ghost { border-color: transparent; background: none; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.loading > .i { display: none; }
.btn.loading::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--primary); border-right-color: transparent; animation: spin .7s linear infinite; vertical-align: -3px; margin-right: 10px; }
.danger-text { color: var(--danger) !important; }
.link { border: 0; background: none; color: var(--primary); cursor: pointer; font: inherit; padding: 0; font-weight: 600; }
.link:hover { text-decoration: underline; }

label, .field-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 16px; color: var(--text); }
.field-label { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.field-label .i { width: 16px; height: 16px; color: var(--primary); }
.hint { display: block; font-weight: 400; font-size: 12.5px; margin-top: 1px; color: var(--muted); }
.field-hint { margin: -2px 0 10px; }
input, textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, textarea:hover, select:hover { border-color: var(--muted); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
input:disabled { opacity: .6; cursor: not-allowed; }
textarea { resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364708a' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
.w-half { max-width: calc(50% - 10px); }
.secret { display: flex; gap: 6px; margin-top: 6px; }
.secret input { margin: 0; font-family: var(--mono); letter-spacing: .04em; }
.secret .eye { border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 10px; padding: 0 14px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); }
.secret .eye:hover { background: var(--surface-3); }
.checks { display: grid; gap: 11px; margin-bottom: 20px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 450; margin: 0; cursor: pointer; color: var(--text-2); }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); flex: none; }
.small-links { font-size: 13px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 20px; }
.chip {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  border-radius: 999px; padding: 5px 13px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; user-select: none;
  transition: all .12s;
}
.chip:hover { border-color: var(--primary); color: var(--text); }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }

.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 18px; border: 1px solid;
}
.banner > div { flex: 1; }
.banner.warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn); }
.banner.error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.notice { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; }
.notice summary { cursor: pointer; color: var(--primary); }
.notice summary strong { font-weight: 600; }
.notice.steps ol { margin: 10px 0 2px; padding-left: 20px; }
.notice.steps li { margin: 5px 0; }

.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; font-weight: 600; }
.pill.sent { background: var(--success-soft); color: var(--success); }
.pill.draft { background: var(--primary-soft); color: var(--primary); }
.pill.noemail { background: var(--warn-soft); color: var(--warn); }
.pill.failed { background: var(--danger-soft); color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 52px 20px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.empty-icon { width: 52px; height: 52px; border-radius: 14px; display: inline-grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 12px; }
.empty-icon .i { width: 24px; height: 24px; }

/* ---------- Home ---------- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 36px; align-items: start;
  padding: 40px; margin-bottom: 36px; border-radius: 20px; border: 1px solid var(--border);
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 60%),
    radial-gradient(60% 90% at 0% 100%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 65%),
    var(--surface);
  box-shadow: var(--shadow);
}
.hero::before {  /* faint grid, like graph paper */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(70% 80% at 25% 30%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 80% at 25% 30%, #000, transparent 75%);
}
.hero > * { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--primary);
  background: var(--primary-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; letter-spacing: .01em;
}
.eyebrow .i { width: 15px; height: 15px; }
.hero-title {
  font-size: clamp(1.45rem, 2.5vw, 2.15rem); font-weight: 800; line-height: 1.16; letter-spacing: -.005em;
  text-transform: uppercase; margin-bottom: 22px; text-wrap: balance;
}
.accent { color: var(--primary); }
.hero-points { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 11px; }
.hero-points li { display: flex; gap: 11px; align-items: flex-start; font-size: 15.5px; color: var(--text-2); }
.hero-points .i { width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px;
  box-shadow: var(--shadow-lg);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-head p { margin: 0; font-size: 13px; }
.ring {
  --p: 0; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-3) 0);
  transition: background .3s;
}
.ring span { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.checklist li {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface);
}
.checklist li.done { background: var(--surface-2); border-color: transparent; }
.checklist .tick {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 2px solid var(--border-strong); color: transparent;
}
.checklist li.done .tick { background: var(--success); border-color: var(--success); color: #fff; }
.checklist .tick .i { width: 13px; height: 13px; stroke-width: 3; }
.checklist .txt { flex: 1; min-width: 0; line-height: 1.35; }
.checklist .txt strong { display: block; font-size: 13.5px; }
.checklist .txt span { font-size: 12.5px; color: var(--muted); }
.checklist li.done .txt strong { color: var(--muted); }
.opt { font-size: 10.5px; font-weight: 600; color: var(--muted); background: var(--surface-3); border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); text-align: center; }
.mini-stats span { display: block; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.mini-stats label { margin: 0; font-size: 11.5px; font-weight: 500; color: var(--muted); }

.home-section { margin-bottom: 40px; }
.section-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.section-head h2 { font-size: 1.3rem; margin: 0; }
.section-head p { margin: 0; font-size: 14px; }
.section-num {
  font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); background: var(--primary-soft);
  border-radius: 9px; padding: 6px 9px; line-height: 1;
}
.quick-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick-menu button {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center;
  text-align: left; cursor: pointer; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); font: inherit; color: inherit; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.quick-menu button:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.quick-menu .qm-icon { grid-row: span 2; }
.quick-menu strong { font-size: 15px; }
.quick-menu small { font-size: 12.5px; line-height: 1.35; }
.qm-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); transition: background .15s, color .15s;
}
.quick-menu button:hover .qm-icon { background: var(--primary); color: var(--primary-text); }
.steps4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.step h3 { font-size: 15px; }
.step p { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; line-height: 1.55; }
.step-icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--primary-soft); color: var(--primary);
}
.howto { counter-reset: howto; list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.howto li {
  counter-increment: howto; position: relative; padding: 15px 18px 15px 62px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--muted); font-size: 14.5px;
}
.howto li strong { color: var(--text); }
.howto li::before {
  content: counter(howto); position: absolute; left: 18px; top: 14px; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; background: var(--primary); color: var(--primary-text); font-weight: 750; font-size: 13.5px;
}
.assurance { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--success-soft); }
.assurance .i { width: 18px; height: 18px; margin-top: 1px; color: var(--success); }

/* ---------- Run ---------- */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.choice {
  position: relative; display: flex; gap: 15px; align-items: flex-start; text-align: left; cursor: pointer;
  padding: 22px; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--surface);
  font: inherit; color: inherit; box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.choice:hover:not(:disabled) { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.choice:disabled { opacity: .55; cursor: not-allowed; }
.choice-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.choice-icon .i { width: 22px; height: 22px; }
.choice-icon.safe { background: var(--success-soft); color: var(--success); }
.choice-icon.go { background: var(--primary-soft); color: var(--primary); }
.choice-body strong { display: block; font-size: 16px; margin-bottom: 3px; }
.choice-body span { color: var(--muted); font-size: 14px; }
.choice-tag { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; color: var(--success); background: var(--success-soft); padding: 2px 8px; border-radius: 999px; }

.run-panel { transition: border-color .2s, box-shadow .2s; }
.run-panel.running { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: var(--shadow), 0 0 0 4px var(--primary-ring); }
.run-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.run-state { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.run-state-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.run-state-text .muted { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); flex: none; }
.running .status-dot { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 22%, transparent); animation: pulse 1.4s infinite; }
.elapsed { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.elapsed .i { width: 15px; height: 15px; }
.progress { position: relative; height: 8px; border-radius: 999px; background: var(--surface-3); margin: 16px 0 6px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--accent))); border-radius: inherit; transition: width .5s ease; }
.running .progress:not(.determinate) .bar { width: 30%; animation: slide 1.5s ease-in-out infinite; }
.running .progress.determinate::after {  /* sheen while the run is going */
  content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: translateX(-100%); animation: sheen 1.8s ease-in-out infinite;
}
@keyframes slide { from { transform: translateX(-110%); } to { transform: translateX(340%); } }
@keyframes sheen { to { transform: translateX(100%); } }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 0; }
.kpis > div { background: var(--surface-2); border-radius: 12px; padding: 13px 16px; min-width: 0; }
.kpis span { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpis label { margin: 0; font-weight: 500; font-size: 12.5px; color: var(--muted); }
.run-after { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--success-soft); color: var(--success); font-weight: 600; }
.run-after span { flex: 1; }

/* Activity console */
.console { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--term-border); background: var(--term-bg); box-shadow: var(--shadow); }
.console-head {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 14px;
  background: var(--term-head); border-bottom: 1px solid var(--term-border);
}
.console-title { display: inline-flex; align-items: center; gap: 8px; color: var(--term-text); font-weight: 600; font-size: 13.5px; }
.console-title .i { width: 16px; height: 16px; color: var(--side-accent); }
.console-btn { border: 1px solid var(--term-border); background: transparent; color: var(--term-muted); font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 7px; cursor: pointer; }
.console-btn:hover { color: var(--term-text); border-color: var(--term-muted); }
.log {
  height: 380px; overflow-y: auto; padding: 12px 6px 12px 14px; font: 12.75px/1.65 var(--mono); color: var(--term-text);
  scrollbar-width: thin; scrollbar-color: #2a3657 transparent;
}
.log .line { display: flex; gap: 12px; padding: 1px 0; white-space: pre-wrap; word-break: break-word; }
.log .line time { color: var(--term-muted); flex: none; font-variant-numeric: tabular-nums; }
.log .line.warn span { color: var(--term-warn); }
.log .line.error span { color: var(--term-error); font-weight: 500; }
.log .line.ok span { color: var(--term-ok); }
.log .line.muted span { color: var(--term-muted); font-style: italic; }
.log .line.info span::before { content: "› "; color: var(--term-muted); }
.log-empty { color: var(--term-muted); text-align: center; padding: 40px 12px; font-family: var(--font); font-size: 14px; }
.cursor { width: 8px; height: 15px; background: var(--side-accent); margin-top: 4px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Drafts ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select { width: auto; margin: 0; }
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { margin: 0; padding-left: 38px; }
.draft { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow); overflow: hidden; transition: border-color .15s; }
.draft.open { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.draft-head { display: flex; gap: 14px; align-items: center; padding: 14px 18px; cursor: pointer; }
.draft-head:hover { background: var(--surface-2); }
.draft-head .who { flex: 1; min-width: 0; }
.draft-head h3 { font-size: 15px; }
.draft-head .meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px;
}
.draft-body { border-top: 1px solid var(--border); padding: 18px; display: none; background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); }
.draft.open .draft-body { display: block; animation: fade .18s ease; }
.draft-body .links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.draft-body .links a {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; text-decoration: none;
  padding: 3px 10px; border-radius: 999px; background: var(--primary-soft);
}
.draft-body .links a .i { width: 12px; height: 12px; }
.draft-body .links a:hover { text-decoration: underline; }
.draft-paper { font-size: 13.5px; margin-bottom: 14px; }
.draft-body textarea { min-height: 260px; line-height: 1.65; }
.draft-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.draft-actions input { width: 260px; margin: 0; }
.draft-actions .src { font-size: 12px; margin-left: auto; }

/* ---------- Contacted / find ---------- */
.add-row { display: flex; gap: 8px; margin-bottom: 8px; }
.add-row input { margin: 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.table th, .table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.result { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); white-space: pre-wrap; font-size: 14px; }
.result.pending { color: var(--muted); }
.result.found { background: var(--success-soft); }
.result.found strong { color: var(--success); font-size: 16px; }
.result details { margin-top: 8px; }
.result summary { cursor: pointer; color: var(--muted); font-size: 13px; }

/* ---------- Find paper ---------- */
.paper-search {
  position: relative; display: flex; gap: 10px; align-items: center; padding: 8px; margin-bottom: 16px;
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-lg);
  transition: border-color .15s, box-shadow .15s;
}
.paper-search:focus-within { border-color: var(--primary); box-shadow: var(--shadow-lg), 0 0 0 4px var(--primary-ring); }
.paper-search > .i { width: 22px; height: 22px; margin-left: 10px; color: var(--primary); }
.paper-search input { margin: 0; border: 0; box-shadow: none !important; font-size: 16px; padding: 10px 4px; background: transparent; }
.paper-search .btn { flex: none; }
.paper-bar { gap: 10px; margin-bottom: 12px; font-size: 14px; }
.paper-bar .check { font-size: 14px; }
.paper { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 10px; box-shadow: var(--shadow); }
.paper-top { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.paper-top h3 { font-size: 15.5px; line-height: 1.45; }
.paper-top h3 a { color: var(--text); text-decoration: none; }
.paper-top h3 a:hover { color: var(--primary); text-decoration: underline; }
.paper .meta { font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.paper .abstract {
  font-size: 13.5px; color: var(--muted); margin: 0 0 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.paper-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.paper-actions .src { margin-left: auto; font-size: 12px; }
.skeleton .sk { height: 11px; border-radius: 6px; margin: 10px 0; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skeleton .sk:first-child { height: 15px; margin-top: 2px; }
.w90 { width: 90%; } .w85 { width: 85%; } .w70 { width: 70%; } .w40 { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- About ---------- */
.contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.contact h2 { margin: 6px 0 4px; text-transform: capitalize; }
.contact a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 500; word-break: break-all; }
.contact a:hover { text-decoration: underline; }
.avatar.lg { width: 54px; height: 54px; font-size: 17px; }

/* ---------- Settings ---------- */
.save-state { transition: color .2s; }
.save-state.saved { color: var(--success); font-weight: 600; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-bottom: 16px; }
.option {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 11px 14px; cursor: pointer; font-weight: 500;
  border: 1.5px solid var(--border-strong); border-radius: 12px; transition: border-color .15s, background .15s;
}
.option:hover { border-color: var(--primary); }
.option input { width: 17px; height: 17px; margin: 0; flex: none; accent-color: var(--primary); }
.option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.project-list { display: grid; gap: 8px; margin-bottom: 10px; }
.project-row { display: flex; gap: 10px; align-items: center; }
.project-row input { margin: 0; }
.num.small { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; }
.icon-btn { padding: 6px; }
.add-project { margin-bottom: 24px; }
#methodList label > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; margin-bottom: 22px;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.tag-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.tags { display: contents; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 11px; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 600;
}
.tag button { border: 0; background: none; color: inherit; cursor: pointer; padding: 2px; border-radius: 5px; display: grid; place-items: center; opacity: .7; }
.tag button:hover { opacity: 1; background: color-mix(in srgb, var(--primary) 15%, transparent); }
.tag .i { width: 13px; height: 13px; }
.tag-input input { flex: 1; min-width: 180px; width: auto; margin: 0; border: 0; box-shadow: none !important; padding: 6px 6px; background: transparent; }

.switch-row {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; margin-bottom: 22px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-weight: 400;
}
.switch-row.disabled { cursor: not-allowed; opacity: .7; }
.switch-text strong { display: block; font-size: 14px; }
.switch-text small { font-size: 13px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; margin-top: 1px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; z-index: 1; }
.slider { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background .2s; }
.slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 3px solid var(--primary-ring); outline-offset: 2px; }

.toggle-state {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 6px;
  line-height: 1.4;
}
.toggle-state.on {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.toggle-state.off {
  background: var(--surface-3);
  color: var(--muted);
  border: 1px solid var(--border);
}

.outreach-template-mode {
  font-size: 13px;
  margin-top: -12px;
  margin-bottom: 18px;
}

.template-field { margin-top: 6px; padding-top: 20px; border-top: 1px solid var(--border); }
.template-field .switch-row { margin-top: 12px; margin-bottom: 14px; }
.template-field textarea { font-family: var(--mono); font-size: 13px; line-height: 1.65; margin-top: 0; }
.field-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.field-chip {
  font-family: var(--mono); font-size: 12px; padding: 3px 9px; border-radius: 7px; cursor: pointer;
  border: 1px dashed var(--border-strong); background: var(--surface-2); color: var(--text-2); transition: all .12s;
}
.field-chip:hover { border-style: solid; border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.subnav {
  display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px;
  position: sticky; top: 0; z-index: 5; padding: 10px 0; background: var(--bg);
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  text-decoration: none; color: var(--text-2); font-size: 13.5px; font-weight: 600; white-space: nowrap;
  padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.subnav a:hover { color: var(--primary); border-color: var(--primary); }
.sec-title { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.sec-title p { margin: 0; font-size: 14px; }
.num {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--primary); color: var(--primary-text); font-weight: 800;
}
.card[id], details[id] { scroll-margin-top: 70px; }
.file-field { margin-bottom: 14px; }
.drop {
  position: relative; display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer;
  padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: 12px; font-weight: 500; color: var(--muted);
  transition: border-color .15s, background .15s;
}
.drop:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.drop.has-file { border-style: solid; border-color: var(--success); background: var(--success-soft); color: var(--success); }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-field .btn { margin-top: 6px; }
.advanced { padding: 0; }
.advanced summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 20px 26px; cursor: pointer; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary h2 { margin: 0; }
.advanced summary .muted { font-size: 13px; }
.advanced .chev { transform: rotate(90deg); transition: transform .2s; color: var(--muted); }
.advanced[open] .chev { transform: rotate(-90deg); }
.adv-body { padding: 0 26px 24px; }
.backup-row { padding-top: 18px; border-top: 1px solid var(--border); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px);
  background: var(--side-bg); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 500; font-size: 14px;
  transition: transform .25s cubic-bezier(.2, .9, .3, 1.2), opacity .2s, visibility .25s; z-index: 50; max-width: min(520px, calc(100% - 32px));
  box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--success); }
@media (prefers-color-scheme: dark) { .toast.ok, .toast.error { color: #08102a; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .steps4 { grid-template-columns: 1fr 1fr; }
  .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  main { padding: 28px 24px 80px; }
  .hero { grid-template-columns: 1fr; padding: 30px; }
  .quick-menu { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 20;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid rgba(255, 255, 255, .06);
    background: var(--side-bg);
  }
  .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { flex: 1 0 66px; flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 10.5px; text-align: center; justify-content: center; white-space: nowrap; }
  .nav button.active::before { left: 25%; right: 25%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .nav button .i { width: 21px; height: 21px; }
  .nav .badge { position: absolute; top: 0; right: calc(50% - 24px); margin: 0; font-size: 10px; padding: 0 5px; min-width: 0; line-height: 16px; }
  .setup-dot, .live-dot { position: absolute; top: 4px; right: calc(50% - 16px); margin: 0; }
  main { padding: 20px 16px 110px; }
  h1 { font-size: 1.45rem; }
  .hero { padding: 24px 18px; border-radius: 16px; gap: 24px; margin-bottom: 28px; }
  .hero-title { font-size: 1.3rem; }
  .hero-points li { font-size: 14.5px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .grid2, .grid3, .grid4, .choices, .steps4, .contacts { grid-template-columns: 1fr; }
  .w-half { max-width: none; }
  .quick-menu { grid-template-columns: 1fr 1fr; gap: 10px; }
  .quick-menu button { grid-template-columns: 1fr; padding: 14px; row-gap: 2px; }
  .quick-menu .qm-icon { grid-row: auto; margin-bottom: 8px; width: 38px; height: 38px; }
  .kpis span { font-size: 1.3rem; }
  .log { height: 320px; font-size: 12px; }
  .paper-search { flex-wrap: wrap; }
  .paper-search input { flex: 1; min-width: 0; width: auto; }
  .paper-search .btn { width: 100%; }
  .paper-top { flex-direction: column; gap: 6px; }
  .paper-actions .src { margin-left: 0; }
  .card { padding: 18px; }
  .advanced summary { padding: 18px; }
  .adv-body { padding: 0 18px 18px; }
  .draft-actions input { width: 100%; }
  .draft-actions .src { margin-left: 0; }
  .add-row { flex-direction: column; }
  .toast { bottom: 90px; }
}
@media (max-width: 380px) {
  .mini-stats { grid-template-columns: 1fr 1fr; row-gap: 10px; }
}

/* ---- accounts, schedule, outreach ---- */
.auth-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: var(--bg); overflow-y: auto; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; padding: 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.auth-card h1 { margin: 0; font-size: 24px; }
.auth-card p { margin: 0; }
.auth-error { color: var(--danger); font-size: 14px; }
.sidebar-foot span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { margin-left: auto; white-space: nowrap; background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.sync-row { align-items: center; margin: 4px 0 16px; }
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); }
.status-pill.sent { color: var(--primary); }
.status-pill.failed, .status-pill.cancelled { background: var(--danger-soft); color: var(--danger); }
.status-pill.pending, .status-pill.sending { background: var(--warn-soft); color: var(--warn); }
.status-pill.active { background: var(--success-soft); color: var(--success); }
.status-pill.inactive { background: var(--surface-2); color: var(--muted); }
#tab-schedule textarea { width: 100%; }

/* ---- Multi-Sender & Scaled Outreach ---- */
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.card.subtle { background: var(--surface-2); border-color: var(--border); box-shadow: none; padding: 18px 20px; }
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--primary-soft); color: var(--primary); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.outreach-scaling-info { background: var(--primary-soft); border: 1px solid var(--primary-ring); border-radius: var(--radius-sm); padding: 12px 16px; margin: 12px 0; }
.senders-panel { margin: 18px 0; border-top: 1px solid var(--border); padding-top: 18px; }
.add-sender-box { border-radius: 12px; border: 1px solid var(--border); }
.sender-actions { display: inline-flex; gap: 6px; align-items: center; }
.sender-from-pill { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); font-family: var(--mono); }

/* ---- Global Scholarships ---- */
.scholarship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.scholarship-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.scholarship-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.scholarship-card .sch-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}
.scholarship-card .sch-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px 0;
  line-height: 1.35;
}
.scholarship-card .sch-provider {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 10px 0;
}
.scholarship-card .sch-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 14px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.scholarship-card .sch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.scholarship-card .sch-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.badge.ok { background: var(--success-soft); color: var(--success); }

/* ============================================================
   Progressive Disclosure Settings Dashboard (Dark Slate + Indigo/Purple)
   ============================================================ */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  background: #0b1120;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 22px;
}
.settings-tab-btn {
  flex: 1;
  min-width: 145px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.settings-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.settings-tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(139, 92, 246, 0.22));
  color: #e0e7ff;
  border-color: rgba(129, 140, 248, 0.45);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.18);
}
.settings-pane {
  display: none;
  animation: fadeInPane 0.16s ease-out;
}
.settings-pane.active {
  display: block;
}
@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Info Tooltip (ℹ️) */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  margin-left: 6px;
  vertical-align: middle;
  transition: background 0.15s ease, color 0.15s ease;
}
.info-tip:hover,
.info-tip:focus {
  background: rgba(99, 102, 241, 0.28);
  color: #c7d2fe;
  outline: none;
}
.info-tip .info-tip-box {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 280px;
  padding: 10px 12px;
  background: #0b1120;
  color: #e2e8f0;
  border: 1px solid #33456e;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 60;
  text-align: left;
}
.info-tip:hover .info-tip-box,
.info-tip:focus .info-tip-box {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Project Collapsible Accordions */
.proj-accordion {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.proj-accordion.open {
  border-color: rgba(99, 102, 241, 0.5);
}
.proj-acc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
}
.proj-acc-head input[data-proj="title"] {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 8px;
  font-weight: 600;
  color: var(--text);
  border-radius: 6px;
}
.proj-acc-head input[data-proj="title"]:focus,
.proj-acc-head input[data-proj="title"]:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}
.proj-acc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.proj-acc-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.proj-acc-body {
  display: none;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.proj-accordion.open .proj-acc-body {
  display: block;
}

/* Green Success State for Attached Files */
.drop.has-file {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  color: #34d399 !important;
}
.drop.has-file svg {
  color: #10b981 !important;
}
.file-attached-pill {
  display: none;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  margin-left: auto;
}
.drop.has-file .file-attached-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Compact Toggle Row with Tooltip */
.compact-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.compact-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.compact-toggle-label {
  display: inline-flex;
  align-items: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

/* ============================================================
   Midnight Studio Layout, Sidebar Categories, Terminal & Cards
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #52525b; }

body {
  background-color: #09090b;
  background-image: radial-gradient(ellipse at top right, rgba(24, 24, 27, 0.55), #09090b 65%);
}

.shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 45;
}

.sidebar-brand-bar {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  padding: 0;
}

.logo-midnight {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #4f46e5;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 16px rgba(79, 70, 229, 0.45);
}

.brand-title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 14px 0 6px 12px;
}
.nav-section-label:first-child {
  margin-top: 2px;
}

.nav button {
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13.75px;
  font-weight: 500;
  color: #a1a1aa;
  gap: 11px;
}
.nav button i.ph {
  font-size: 18px;
  color: #a1a1aa;
  transition: color 0.15s ease;
}
.nav button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f4f4f5;
}
.nav button:hover i.ph {
  color: #f4f4f5;
}
.nav button.active {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  font-weight: 600;
}
.nav button.active i.ph {
  color: #818cf8;
}
.nav button.active::before {
  display: none;
}
.nav .badge {
  background: rgba(99, 102, 241, 0.18);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
}
.nav button.active .badge {
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

.sidebar-user-box {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: #27272a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d4d4d8;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-user-info strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #e4e4e7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-info small {
  display: block;
  font-size: 10.5px;
  color: #71717a;
}

/* Mobile Top Bar & Overlay */
.mobile-topbar {
  display: none;
  height: 60px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 35;
}
.mobile-menu-btn {
  background: transparent;
  border: 0;
  color: #a1a1aa;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-menu-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 40;
  display: none;
}
.mobile-overlay.open {
  display: block;
}

/* Midnight Studio Hero & KPI Cards */
.hero {
  background: rgba(24, 24, 27, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  backdrop-filter: blur(8px);
}
.hero::before {
  opacity: 0.22;
}
.hero-glow-orb {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 220px;
  height: 220px;
  background: #6366f1;
  filter: blur(90px);
  opacity: 0.22;
  border-radius: 999px;
  pointer-events: none;
}

.midnight-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.midnight-kpi-card {
  background: rgba(24, 24, 27, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 20px;
  backdrop-filter: blur(6px);
}
.midnight-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.midnight-kpi-icon.emerald { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.midnight-kpi-icon.indigo { background: rgba(99, 102, 241, 0.12); color: #818cf8; }
.midnight-kpi-icon.amber { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.midnight-kpi-card h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: #e4e4e7;
  margin: 0 0 4px 0;
}
.midnight-kpi-card .kpi-num {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
}

/* Midnight Studio Cards & Inputs */
.card {
  background: rgba(24, 24, 27, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(6px);
}
input, textarea, select {
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f4f4f5;
  border-radius: 8px;
}
input:focus, textarea:focus, select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px #6366f1;
}
.btn.primary {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.3);
}
.btn.primary:hover {
  background: #6366f1;
  border-color: #6366f1;
}

/* Midnight Terminal Window Dots */
.term-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.term-dot.red { background: rgba(244, 63, 94, 0.55); }
.term-dot.amber { background: rgba(245, 158, 11, 0.55); }
.term-dot.green { background: rgba(16, 185, 129, 0.55); }

/* Find Paper 2x2 Grid */
.papers-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}
.papers-grid-2x2 > .card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

/* About Team Cards (Midnight Studio Centered Profile Style) */
.team-card {
  background: rgba(24, 24, 27, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.team-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.16);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 14px;
}
.team-role {
  font-size: 12px;
  color: #a1a1aa;
  margin: 2px 0 18px 0;
}
.team-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: auto;
}
.team-link-email {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: #d4d4d8 !important;
  background: #27272a;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none !important;
  transition: background 0.15s ease;
}
.team-link-email:hover {
  background: #3f3f46;
}
.team-link-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.22);
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none !important;
  transition: background 0.15s ease;
}
.team-link-wa:hover {
  background: rgba(16, 185, 129, 0.2);
}

/* Responsive Drawer on Mobile / Tablet */
@media (max-width: 980px) {
  .papers-grid-2x2 {
    grid-template-columns: 1fr;
  }
  .midnight-kpi-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
  }
  .shell {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
  }
  .mobile-topbar {
    display: flex;
    width: 100%;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    max-width: 82vw;
    height: 100vh;
    border-top: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;
    overflow-x: hidden;
    transition: transform 0.25s ease, visibility 0.25s ease;
    z-index: 50;
    padding: 0;
  }
  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .sidebar-brand-bar,
  .sidebar-user-box {
    display: flex;
  }
  .nav {
    flex-direction: column;
    overflow-y: auto;
    padding: 16px 12px;
  }
  .nav button {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    font-size: 13.75px;
    padding: 9px 12px;
    gap: 11px;
  }
  .nav .badge {
    position: static;
    margin-left: auto;
  }
  .setup-dot, .live-dot {
    position: static;
    margin-left: auto;
  }
  main {
    padding: 20px 16px 64px;
    width: 100%;
    max-width: 100%;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar .search-box,
  .toolbar select {
    width: 100%;
    min-width: 0;
  }
  .scholarship-grid {
    grid-template-columns: 1fr;
  }
  .console-head {
    gap: 8px;
    padding: 12px;
  }
  .console-filters {
    width: 100%;
    justify-content: space-between;
  }
  .console-filter-pill {
    flex: 1;
    text-align: center;
  }
  .term-dots {
    display: none;
  }
}

/* ============================================================
   Professional Dynamic Activity Telemetry Console
   ============================================================ */
.console {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, #0b0b0f 0%, #050507 100%);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(99, 102, 241, 0.08);
  position: relative;
}
.console.is-running {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.85), 0 0 28px -4px rgba(99, 102, 241, 0.25);
}

.console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(24, 24, 27, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}
.console-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.console-live-ring {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #52525b;
  transition: all 0.25s ease;
}
.console.is-running .console-live-ring {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2), 0 0 12px #10b981;
  animation: pulse 1.4s infinite;
}
.console-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #f4f4f5;
}
.console-file-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1px 7px;
  border-radius: 6px;
}
.console-count-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.28);
  padding: 2px 8px;
  border-radius: 999px;
}

.console-filters {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #09090b;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.console-filter-pill {
  border: 0;
  background: transparent;
  color: #71717a;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.console-filter-pill:hover {
  color: #d4d4d8;
}
.console-filter-pill.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}

.console-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.console-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: #a1a1aa;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.console-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}
.console-btn.active {
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.1);
}

/* Stage & Telemetry Strip */
.console-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 16px;
  background: rgba(18, 18, 24, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-size: 12px;
}
.console-stage-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.console-stage-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 5px;
  flex-shrink: 0;
}
.console-stage-pill.idle {
  background: rgba(113, 113, 122, 0.18);
  color: #a1a1aa;
  border: 1px solid rgba(113, 113, 122, 0.3);
}
.console-stage-pill.scan {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.console-stage-pill.hit {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.console-stage-pill.ai {
  background: rgba(168, 85, 247, 0.16);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}
.console-stage-pill.wait {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.console-stage-msg {
  color: #a1a1aa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.console-pct {
  color: #818cf8;
  font-weight: 700;
}

/* Log Viewport & Dynamic Rows */
.log {
  height: 410px;
  overflow-y: auto;
  padding: 12px 14px;
  font: 12.5px/1.6 var(--mono);
  color: #d4d4d8;
  background:
    radial-gradient(circle at 90% 10%, rgba(99, 102, 241, 0.05), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(16, 185, 129, 0.04), transparent 45%);
}
.log .line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 10px;
  margin-bottom: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-left: 3px solid #3f3f46;
  animation: logSlideIn 0.2s ease-out;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.log .line:hover {
  background: rgba(255, 255, 255, 0.04);
}
@keyframes logSlideIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.log .line.ok {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.04);
}
.log .line.warn {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.04);
}
.log .line.error {
  border-left-color: #f43f5e;
  background: rgba(244, 63, 94, 0.06);
}
.log .line.scan {
  border-left-color: #38bdf8;
}
.log .line.ai {
  border-left-color: #a855f7;
}
.log .line.info span::before {
  content: none;
}

.log .line time {
  color: #71717a;
  font-size: 11px;
  padding-top: 1px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.log-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  min-width: 52px;
  text-align: center;
}
.log-badge.sys { background: rgba(161, 161, 170, 0.14); color: #a1a1aa; }
.log-badge.scan { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.log-badge.hit { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.log-badge.sent { background: rgba(16, 185, 129, 0.24); color: #6ee7b7; box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }
.log-badge.ai { background: rgba(168, 85, 247, 0.18); color: #c084fc; }
.log-badge.wait { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.log-badge.err { background: rgba(244, 63, 94, 0.22); color: #fb7185; }

.log-msg {
  flex: 1;
  min-width: 0;
  word-break: normal;
  overflow-wrap: anywhere;
  white-space: normal;
  color: #e4e4e7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}
.log .line:hover .log-msg,
.log .line:active .log-msg {
  -webkit-line-clamp: unset;
}

@media (max-width: 760px) {
  .log .line {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    padding: 8px 10px;
  }
  .log .line time {
    order: 2;
    margin-left: auto;
    font-size: 10.5px;
  }
  .log .line .log-badge {
    order: 1;
  }
  .log .line .log-msg {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    font-size: 12px;
    line-height: 1.45;
  }
}
.log-hl-email {
  color: #34d399;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.1);
  padding: 0 5px;
  border-radius: 4px;
}
.log-hl-quote {
  color: #93c5fd;
}

/* Empty Telemetry State */
.log-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  min-height: 320px;
  padding: 32px 20px;
  color: #a1a1aa;
  font-family: var(--font);
}
.log-empty-orb {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 14px;
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.2);
}
.log-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: #f4f4f5;
  margin-bottom: 6px;
}
.log-empty-sub {
  font-size: 13px;
  color: #71717a;
  max-width: 460px;
  line-height: 1.55;
  margin-bottom: 18px;
}
.log-empty-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.log-empty-pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 5px 11px;
  border-radius: 999px;
}
.log-empty-pills span i {
  color: #818cf8;
}




