﻿/* ============ SignalScout — professional fintech ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --body-c: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --accent: #2563eb;
  --accent-dark: #1e40af;
  --accent-soft: #eff6ff;
  --accent-line: #bfdbfe;
  --ink-panel: #0e2242;
  --red: #b42318;
  --red-soft: #fef3f2;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --gray-soft: #f2f4f7;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, 0.07);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--body-c);
  overflow: hidden;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; }
svg { width: 15px; height: 15px; flex-shrink: 0; }
h1, h2, h3 { color: var(--text); font-weight: 600; letter-spacing: -0.015em; }

/* ============ Shared ============ */
.brand-lockup { display: flex; align-items: center; gap: 9px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.logo-mark svg { width: 16px; height: 16px; }
.brand-name { font-size: 15.5px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: 10px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-primary:disabled { opacity: 0.45; cursor: default; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); color: var(--body-c);
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 7px 14px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, background 0.15s;
}
.btn-ghost:hover { border-color: var(--faint); background: var(--surface-2); }

/* ============ Auth (split screen) ============ */
.auth-wrap { display: flex; height: 100vh; }

.auth-side {
  width: 480px; flex-shrink: 0;
  background: var(--ink-panel); color: #e8edf7;
  display: flex; flex-direction: column;
  padding: 44px 48px;
}
.auth-side .logo-mark { background: rgba(255, 255, 255, 0.12); color: #fff; }
.auth-side .brand-name { color: #fff; }
.auth-side-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.auth-side-body h1 {
  color: #fff; font-size: 32px; line-height: 1.2; letter-spacing: -0.02em;
  margin-bottom: 36px; max-width: 320px;
}
.value-props { list-style: none; display: flex; flex-direction: column; gap: 24px; }
.value-props li { display: flex; gap: 14px; align-items: flex-start; }
.value-props svg {
  width: 18px; height: 18px; margin-top: 2px; padding: 3px;
  background: rgba(255, 255, 255, 0.12); border-radius: 50%; color: #8ab8f8;
}
.value-props strong { display: block; color: #fff; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.value-props span { color: #9fb0cc; font-size: 13px; line-height: 1.55; }
.auth-side-foot { color: #6f80a0; font-size: 12px; }

.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-card { width: 400px; max-width: 100%; }
.auth-card h2 { font-size: 24px; margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }

.auth-tabs {
  display: flex; background: var(--gray-soft); border-radius: 9px; padding: 3px; gap: 3px;
  margin-bottom: 22px;
}
.auth-tabs button {
  flex: 1; padding: 8px; border-radius: 7px; border: none;
  background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 500;
}
.auth-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.field { display: block; margin-bottom: 15px; }
.field span { display: block; font-size: 12.5px; font-weight: 500; color: var(--body-c); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 13px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-size: 14px; font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.field input::placeholder { color: var(--faint); }
#auth-submit { width: 100%; margin-top: 6px; }
.form-error { color: var(--red); font-size: 13px; margin-top: 14px; text-align: center; }
.auth-notice {
  margin-top: 14px; padding: 11px 14px; border-radius: 8px;
  font-size: 13px; line-height: 1.5; text-align: center;
}
.auth-notice.info { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid var(--accent-line); }
.auth-notice.success { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid var(--accent-line); }
.auth-notice.error { background: var(--red-soft); color: var(--red); border: 1px solid #fecaca; }
.link-btn {
  background: none; border: none; padding: 0; margin-top: 6px;
  color: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer;
}

/* ============ Landing page ============ */
.landing { height: 100vh; overflow-y: auto; overflow-x: hidden; background: var(--surface); }
.lp-container { max-width: 1080px; margin: 0 auto; padding: 0 28px; }

.lp-nav { border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.lp-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.lp-nav-actions { display: flex; align-items: center; gap: 10px; }

.lp-hero { padding: 72px 0 64px; background:
  radial-gradient(ellipse 70% 60% at 80% 0%, var(--accent-soft), transparent 70%); }
.lp-hero-inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.lp-eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--accent-dark);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 20px;
}
.lp-hero-text h1 {
  font-size: 44px; line-height: 1.1; letter-spacing: -0.025em; color: var(--text); margin-bottom: 18px;
}
.lp-hero-text > p { font-size: 16.5px; line-height: 1.6; color: var(--muted); max-width: 500px; margin-bottom: 28px; }
.lp-cta-row { display: flex; gap: 12px; margin-bottom: 20px; }
.lp-cta-lg { padding: 13px 24px; font-size: 15px; border-radius: 10px; }
.lp-trust { font-size: 12.5px; color: var(--faint); }

/* Hero product-preview: a fanned stack of alert cards, reshuffled each load */
.lp-hero-visual { display: flex; justify-content: center; }
.lp-card-stack { position: relative; width: 340px; max-width: 100%; min-height: 288px; margin: 8px auto 0; }
.lp-alert-card {
  position: absolute; top: 16px; left: 0; width: 100%;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px;
  box-shadow: 0 20px 48px rgba(16, 24, 40, 0.14);
  transform-origin: bottom center;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.lp-alert-card.d0 { z-index: 3; }
.lp-alert-card.d1 { z-index: 2; transform: rotate(-5deg) scale(0.97); opacity: 0.92; }
.lp-alert-card.d2 { z-index: 1; transform: rotate(5deg) scale(0.94); opacity: 0.82; }
.lp-alert-head {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); margin-bottom: 16px;
}
.lp-alert-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.lp-alert-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.lp-alert-ticker {
  font-family: var(--mono); font-weight: 700; font-size: 17px; color: var(--text);
  background: var(--gray-soft); border: 1px solid var(--border); padding: 6px 11px; border-radius: 8px;
}
.lp-alert-price { font-family: var(--mono); font-weight: 600; font-size: 16px; color: var(--text); }
.lp-alert-badge {
  margin-left: auto; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-dark);
}
.lp-alert-cond { font-size: 13px; color: var(--body-c); margin-bottom: 14px; }
.lp-alert-cond span { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-left: 4px; }
.lp-alert-note {
  font-size: 12.5px; line-height: 1.6; color: var(--muted);
  background: var(--surface-2); border-radius: 10px; padding: 12px 14px;
}

.lp-section { padding: 64px 0; }
.lp-section-title { font-size: 28px; letter-spacing: -0.02em; text-align: center; margin-bottom: 40px; }

.lp-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.lp-feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px 20px;
}
.lp-feat-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.lp-feat-icon svg { width: 20px; height: 20px; }
.lp-feature h3 { font-size: 15.5px; margin-bottom: 8px; }
.lp-feature p { font-size: 13.5px; line-height: 1.6; color: var(--muted); }

.lp-steps-section { background: var(--bg); }
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.lp-step { text-align: center; padding: 0 12px; }
.lp-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; margin-bottom: 16px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 16px;
}
.lp-step h3 { font-size: 16px; margin-bottom: 8px; }
.lp-step p { font-size: 13.5px; line-height: 1.6; color: var(--muted); max-width: 280px; margin: 0 auto; }

.lp-band { background: var(--ink-panel); }
.lp-band-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 48px 28px; flex-wrap: wrap;
}
.lp-band h2 { color: #fff; font-size: 26px; letter-spacing: -0.02em; }

.lp-footer { border-top: 1px solid var(--border); background: var(--surface); }
.lp-footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 28px; flex-wrap: wrap;
}
.lp-footer-note { font-size: 12px; color: var(--faint); }

.lp-back {
  background: none; border: none; padding: 0; margin-bottom: 16px;
  color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer;
}
.lp-back:hover { color: var(--text); }

@media (max-width: 860px) {
  .lp-hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .lp-hero-visual { order: -1; }
  .lp-hero-text h1 { font-size: 34px; }
  .lp-features { grid-template-columns: repeat(2, 1fr); }
  .lp-steps { grid-template-columns: 1fr; }
  .lp-band-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 520px) {
  .lp-features { grid-template-columns: 1fr; }
  .lp-nav-actions .btn-ghost { display: none; }
}
/* Wide screens: widen the centered column and scale the hero so a large monitor
   doesn't leave big empty gutters. The base 1080px stays the "condensed" look. */
@media (min-width: 1440px) {
  .lp-container { max-width: 1240px; }
  .lp-hero { padding: 92px 0 80px; }
  .lp-hero-inner { gap: 72px; }
  .lp-hero-text h1 { font-size: 52px; }
  .lp-hero-text > p { font-size: 17.5px; max-width: 560px; }
  .lp-card-stack { width: 384px; }
  .lp-features { gap: 24px; }
  .lp-section-title { font-size: 32px; }
}
@media (min-width: 1800px) {
  .lp-container { max-width: 1400px; }
  .lp-hero { padding: 108px 0 92px; }
  .lp-hero-text h1 { font-size: 58px; }
  .lp-hero-text > p { font-size: 18px; }
  .lp-card-stack { width: 420px; }
}

/* ============ App shell ============ */
.app { display: flex; height: 100vh; }

.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 14px 16px;
}
.sidebar .brand-lockup { padding: 4px 8px 22px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-label {
  font-size: 11px; font-weight: 600; color: var(--faint);
  text-transform: uppercase; letter-spacing: 0.07em;
  padding: 0 10px 8px;
}
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px; border-radius: 8px; border: none;
  background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 500;
  text-align: left;
  transition: background 0.13s, color 0.13s;
}
.nav-btn svg { width: 16px; height: 16px; }
.nav-btn:hover { color: var(--text); background: var(--gray-soft); }
.nav-btn.active { background: var(--gray-soft); color: var(--text); font-weight: 600; }
.nav-btn.active svg { color: var(--accent); }

.side-convs {
  margin-top: 22px; flex: 1; min-height: 0;
  display: flex; flex-direction: column;
}
#conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; padding-bottom: 8px; }
.conv-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 7px;
  color: var(--muted); font-size: 12.5px; cursor: pointer;
  transition: background 0.13s, color 0.13s;
}
.conv-item:hover { background: var(--gray-soft); color: var(--text); }
.conv-item.active { background: var(--accent-soft); color: var(--accent-dark); }
.conv-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-del {
  visibility: hidden; border: none; background: transparent;
  color: var(--faint); font-size: 15px; line-height: 1; padding: 0 3px; border-radius: 4px;
}
.conv-item:hover .conv-del { visibility: visible; }
.conv-del:hover { color: var(--red); }
.conv-empty { color: var(--faint); font-size: 12px; padding: 4px 10px; }

.side-foot {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--border); padding: 14px 4px 0;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; text-transform: uppercase;
}
.side-user { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.side-user #user-email {
  font-size: 12.5px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-plan { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.side-plan::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
#logout-btn {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 7px;
  border: none; background: transparent; color: var(--faint);
  transition: color 0.15s, background 0.15s;
}
#logout-btn:hover { color: var(--red); background: var(--red-soft); }

main { flex: 1; overflow: hidden; display: flex; justify-content: center; min-width: 0; }
.view {
  flex: 1; display: flex; flex-direction: column; overflow-y: auto;
  max-width: 880px; margin: 0 auto; width: 100%; padding: 0 36px;
}

.view-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 30px 2px 20px;
}
.view-toolbar h2 { font-size: 21px; }
.view-toolbar p { color: var(--muted); font-size: 13px; margin-top: 5px; max-width: 540px; line-height: 1.55; }

/* ============ Stats ============ */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 15px 18px; box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.stat-value {
  font-size: 24px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1;
}
.stat-value small { font-size: 13px; font-weight: 500; color: var(--faint); margin-left: 4px; letter-spacing: 0; }

/* ============ Chat ============ */
#view-chat { padding-bottom: 0; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 18px; }

.msg { display: flex; gap: 10px; max-width: 84%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.assistant, .msg.system { align-self: flex-start; }

.msg-avatar {
  width: 28px; height: 28px; border-radius: 8px;
  flex-shrink: 0; margin-top: 2px; color: #fff; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.msg-avatar svg { width: 14px; height: 14px; }

.bubble {
  padding: 11px 15px; border-radius: 12px; font-size: 14px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.msg.assistant .bubble { background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 4px; box-shadow: var(--shadow-sm); }
.msg.user .bubble { background: var(--text); color: #fff; border-top-right-radius: 4px; }
.msg.system .bubble {
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-dark); font-size: 13px;
}
.bubble em { color: var(--muted); }

/* Current-matches card shown after saving an alert */
.matches-msg { align-self: flex-start; max-width: 84%; }
.matches-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; border-top-left-radius: 4px; box-shadow: var(--shadow-sm);
  padding: 14px 16px; width: 100%;
}
.matches-crit {
  font-size: 13px; color: var(--body-c); font-weight: 500; line-height: 1.5;
  padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border);
}
.matches-head { font-size: 11.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.match-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 0;
  border-top: 1px solid var(--border); font-size: 13px;
}
.match-row:first-of-type { border-top: none; }
.match-ticker {
  font-family: var(--mono); font-weight: 700; color: var(--text);
  background: var(--gray-soft); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px;
}
.match-name { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-price { font-family: var(--mono); font-weight: 600; color: var(--text); margin-left: auto; }
.matches-more { font-size: 12px; color: var(--faint); margin-top: 10px; }
.matches-empty { font-size: 12.5px; color: var(--muted); }

/* Per-message actions (Edit / Regenerate) */
.msg-action {
  align-self: flex-end; background: none; border: none; cursor: pointer;
  color: var(--faint); font-size: 11.5px; padding: 2px 7px; border-radius: 6px;
  white-space: nowrap; line-height: 1.6;
}
.msg-action:hover { color: var(--accent); background: var(--accent-soft); }

/* Inline prompt editor — expand the message to full width while editing */
.msg.editing { max-width: 100%; width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
.edit-textarea {
  width: 100%; min-height: 56px; border: 1px solid var(--accent-line); border-radius: 12px;
  padding: 11px 14px; font: inherit; font-size: 14px; line-height: 1.6; resize: vertical;
  box-sizing: border-box; background: var(--surface); color: var(--text);
}
.edit-actions { display: flex; gap: 8px; justify-content: flex-end; }
.edit-actions .btn-primary, .edit-actions .btn-ghost { padding: 7px 15px; font-size: 13px; }

.typing-dots { display: inline-flex; gap: 5px; padding: 4px 2px; }
.typing-dots i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--faint);
  animation: blink 1.2s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 70%, 100% { opacity: 0.3; } 35% { opacity: 1; } }

.suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 2px 14px; }
.chip {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px;
  color: var(--body-c); font-size: 12.5px; padding: 7px 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }

.composer { display: flex; gap: 10px; padding: 6px 2px 24px; align-items: flex-end; }
#chat-text {
  flex: 1; padding: 13px 16px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-size: 14px; font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: none; overflow-y: auto; max-height: 160px; line-height: 1.5;
}
#chat-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
#chat-text::placeholder { color: var(--faint); }
.send-btn { width: 46px; height: 46px; padding: 0; border-radius: 10px; }
.send-btn svg { width: 17px; height: 17px; }

/* ============ Criteria cards ============ */
.card-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 32px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px 14px; box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 5px; }
.card-top h3 { font-size: 15px; flex: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.on { background: var(--accent-soft); color: var(--accent-dark); }
.badge.off { background: var(--gray-soft); color: var(--muted); }
.badge.pending { background: var(--amber-soft); color: var(--amber); }
.badge.fail { background: var(--red-soft); color: var(--red); }
.badge.done { background: #ecfdf5; color: #059669; }

.onetime {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: 12.5px; color: var(--muted); user-select: none; margin-right: auto;
}
.onetime input { cursor: pointer; accent-color: var(--accent); margin: 0; }

.cond-line {
  display: flex; align-items: baseline; gap: 8px;
  color: var(--body-c); font-size: 13px; line-height: 1.7;
}
.cond-line .check { color: var(--accent); font-weight: 700; }

.ticker-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.tk {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  background: var(--gray-soft); color: var(--body-c);
  border: 1px solid var(--border);
  padding: 3px 9px; border-radius: 6px;
}
.tk.more { background: transparent; color: var(--faint); border-style: dashed; }
.tk.market {
  font-family: var(--font); font-weight: 500;
  background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent-line);
}

.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.card-meta { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.card-meta strong { color: var(--text); font-weight: 600; }

.card-actions { display: flex; gap: 8px; }
.card-actions .btn-ghost { padding: 6px 13px; font-size: 12.5px; box-shadow: none; }
.card-actions .btn-ghost.danger { color: var(--muted); }
.card-actions .btn-ghost.danger:hover { color: var(--red); border-color: var(--red); background: var(--surface); }

/* ============ History table ============ */
.table-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 32px;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--surface-2); }

.cell-ticker {
  font-family: var(--mono); font-weight: 600; font-size: 13px; color: var(--text);
  background: var(--gray-soft); border: 1px solid var(--border);
  padding: 3px 9px; border-radius: 6px; display: inline-block;
}
.cell-price { font-family: var(--mono); font-weight: 600; color: var(--text); white-space: nowrap; }
.cell-signal { color: var(--body-c); }
.cell-signal .sig-vals { display: block; font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 2px; }
.cell-crit { color: var(--muted); font-size: 12.5px; max-width: 180px; }
.cell-time { color: var(--muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-del { width: 1%; text-align: right; }
.alert-del {
  border: none; background: transparent; cursor: pointer;
  color: var(--faint); font-size: 17px; line-height: 1; padding: 0 4px; border-radius: 4px;
}
.alert-del:hover { color: var(--red); }
.alert-del:disabled { opacity: 0.4; cursor: default; }

.alerts-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.alerts-count { color: var(--muted); font-size: 12.5px; }

.empty {
  color: var(--muted); font-size: 13.5px; text-align: center;
  padding: 48px 20px; line-height: 1.7;
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 12px;
  margin-bottom: 32px;
}

/* ============ Settings ============ */
.auth-forgot { display: block; margin: 12px auto 0; color: var(--muted); }
.auth-forgot:hover { color: var(--accent-dark); }

#view-settings { max-width: 640px; }
.settings-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.settings-card h3 { font-size: 15px; margin-bottom: 14px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border);
}
.settings-label { font-size: 13px; color: var(--muted); }
.settings-value { font-size: 13.5px; color: var(--text); font-weight: 500; }
.settings-inline .field { margin-bottom: 14px; }
.settings-inline .btn-primary { margin-top: 2px; }
.settings-hint { font-size: 12.5px; color: var(--muted); margin: -6px 0 14px; line-height: 1.5; }
.danger-card { border-color: #f4c9c4; }
.danger-card h3 { color: var(--red); }

/* ============ Toasts ============ */
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.toast {
  background: var(--surface); color: var(--body-c); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px 18px; font-size: 13px; max-width: 380px;
  line-height: 1.5; box-shadow: var(--shadow-md);
  border-left-width: 3px;
}
.toast.success { border-left-color: var(--accent); }
.toast.error { border-left-color: var(--red); }
.toast.info { border-left-color: var(--faint); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .auth-side { display: none; }
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; flex-direction: row; align-items: center;
    padding: 10px 14px; border-right: none; border-bottom: 1px solid var(--border);
  }
  .sidebar .brand-lockup { padding: 0 10px 0 0; }
  .side-nav { flex-direction: row; flex: 1; }
  .side-label { display: none; }
  .side-convs { display: none; }
  .nav-btn { width: auto; padding: 8px 12px; }
  .nav-btn svg { display: none; }
  .side-foot { margin: 0; border: none; padding: 0; }
  .side-user { display: none; }
  .stats-row { grid-template-columns: 1fr; }
  .msg { max-width: 94%; }
  .view { padding: 0 16px; }
  .cell-crit, .data-table th:nth-child(4) { display: none; }
}
