/* Stripe-style light palette (mirrors outreach UI-T1..T16) */
:root {
  --bg: #f6f9fc;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --fg: #0a2540;
  --fg-muted: #425466;
  --fg-subtle: #6b7c93;
  --border: #e3e8ee;
  --border-strong: #cdd5df;
  --accent: #635bff;
  --accent-fg: #ffffff;
  --gold: #b88a00;
  --gold-bg: #fff7e6;
  --gold-border: #f0d68f;
  --pill-bg: #eef2f7;
  --shadow-sm: 0 1px 2px rgba(10, 37, 64, 0.06);
  --shadow-md: 0 4px 12px rgba(10, 37, 64, 0.08);
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
}

/* Topbar / nav */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--fg);
  letter-spacing: -0.01em;
}
nav a {
  margin-right: 1.25rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 500;
}
nav a:hover { color: var(--fg); }
button.logout {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
button.logout:hover { border-color: var(--border-strong); color: var(--fg); }

main {
  max-width: 960px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}
h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
}

.muted { color: var(--fg-subtle); font-size: 0.85rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.login-card {
  max-width: 460px;
  margin: 5rem auto;
  text-align: center;
  background: var(--surface);
  padding: 2.5rem 2.25rem 2rem;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}
.login-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--gold, #b88a00);
  background: var(--gold-bg, #fff7e0);
  border: 1px solid var(--gold-border, #e5cc7a);
  border-radius: 12px;
}
.login-card h1 { margin: 0 0 0.4rem; font-size: 1.5rem; line-height: 1.2; }
.login-tagline { margin: 0 0 1.75rem; color: var(--fg-subtle); font-size: 0.97rem; }
.login-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}
.login-steps li { display: flex; gap: 0.85rem; align-items: flex-start; }
.login-steps .step-num {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-alt, #eef2f6);
  color: var(--fg);
  font-weight: 600;
  font-size: 0.85rem;
}
.tg-button {
  display: inline-flex;
  align-items: center;
  margin-top: 0.55rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: #229ED9;       /* Telegram blue */
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.15s ease;
}
.tg-button:hover { background: #1d8fc4; text-decoration: none; }
.login-footnote {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #e5e7eb);
  color: var(--fg-subtle);
  font-size: 0.82rem;
}

/* === Feed: Worth replying (gold triage block) === */
section.worth-replying {
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
section.worth-replying h2 {
  margin-top: 0;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.feed-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow-sm);
}
.feed-item:last-child { margin-bottom: 0; }
.feed-item header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 13px;
}
.feed-item header strong { color: var(--fg); }
.feed-item p {
  margin: 0.25rem 0 0.5rem;
  color: var(--fg-muted);
  font-size: 13.5px;
}
.feed-item a { font-size: 12.5px; }

/* Badges + reason chips */
.badge {
  display: inline-block;
  background: var(--pill-bg);
  color: var(--fg-muted);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.reason {
  display: inline-block;
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* === Feed: By lead (collapsible groups) === */
section.by-lead h2 { color: var(--fg-muted); }
.lead-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow-sm);
}
.lead-group summary {
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.lead-group summary::-webkit-details-marker { display: none; }
.lead-group summary::before {
  content: "▸";
  color: var(--fg-subtle);
  font-size: 12px;
  margin-right: 0.25rem;
}
.lead-group[open] summary::before { content: "▾"; }
.lead-group .lead-post {
  border-top: 1px solid var(--border);
  margin: 0.65rem -1rem -0.65rem;
  padding: 0.6rem 1rem;
}
.lead-group .lead-post:first-of-type { margin-top: 0.65rem; }
.lead-group .lead-post p {
  margin: 0 0 0.35rem;
  color: var(--fg-muted);
  font-size: 13.5px;
}
.lead-group .lead-post button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.lead-group .lead-post button:hover {
  background: var(--pill-bg);
  color: var(--fg);
}

/* Expandable post text — "show all" */
.expandable {
  margin: 0.25rem 0 0.5rem;
}
.expandable > summary {
  list-style: none;
  cursor: pointer;
  color: var(--fg-muted);
  font-size: 13.5px;
  line-height: 1.5;
  display: block;
}
.expandable > summary::-webkit-details-marker { display: none; }
.expandable[open] > summary { display: none; }
.expand-hint {
  color: var(--accent);
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
}
.expand-hint:hover { text-decoration: underline; }
.full-text {
  margin: 0;
  color: var(--fg-muted);
  font-size: 13.5px;
  white-space: pre-wrap;
}

/* Lead search input */
.lead-search-input {
  width: 100%;
  max-width: 420px;
  margin-bottom: 0.75rem;
  font-size: 14px;
}

/* Post action row (Reply via bot, Open on LinkedIn, comments toggle) */
.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.4rem;
}
.post-actions a { font-size: 12.5px; }
.action-btn {
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.action-btn:hover { filter: brightness(1.08); }
.action-btn.ghost {
  background: var(--surface-2);
  color: var(--fg-muted);
  border: 1px solid var(--border);
}
.action-btn.ghost:hover { background: var(--pill-bg); color: var(--fg); }
.toast-inline {
  display: inline-block;
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
}

/* HTMX-loaded comments */
.lead-post .comment {
  background: var(--surface-2);
  border-left: 2px solid var(--border-strong);
  padding: 0.45rem 0.65rem;
  margin-top: 0.45rem;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
}
.lead-post .comment strong { color: var(--fg); }
.lead-post .comment p {
  margin: 0.25rem 0 0;
  color: var(--fg-muted);
}

/* Forms (login, onboarding, etc.) */
input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.15);
}
button:not(.logout) {
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  font-size: 13.5px;
}
button:not(.logout):hover { filter: brightness(1.08); }
/* Override for ghost-style buttons inside collapsible lead posts */
.lead-group .lead-post button {
  background: var(--surface-2);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  font-weight: 500;
}

/* Tables */
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
th { color: var(--fg-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Toast */
.toast {
  background: var(--fg);
  color: var(--surface);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  box-shadow: var(--shadow-md);
  font-size: 13px;
}
