/* ─── Variables ─────────────────────────────────────────── */
:root {
  --bg:           #080809;
  --surface:      #0f0f11;
  --surface-2:    #161618;
  --surface-3:    #1e1e21;
  --border:       #2a2a2e;
  --border-light: #38383f;
  --text:         #f0ede8;
  --text-muted:   #9a9aa6;
  --text-dim:     #62626e;
  --accent:       #d94f3d;
  --accent-dim:   rgba(217, 79, 61, 0.12);
  --accent-glow:  rgba(217, 79, 61, 0.25);
  --gold:         #c9964a;
  --gold-dim:     rgba(201, 150, 74, 0.1);
  --green:        #4a9e6b;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'DM Sans', -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
  --radius:       6px;
  --radius-lg:    12px;
  --transition:   150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Light mode variables ───────────────────────────────── */
[data-theme="light"] {
  --bg:           #f7f5f2;
  --surface:      #eeece8;
  --surface-2:    #e5e2dc;
  --surface-3:    #dad7d0;
  --border:       #cac6be;
  --border-light: #b2ada5;
  --text:         #16140f;
  --text-muted:   #57534a;
  --text-dim:     #8c8880;
  --accent:       #c43b2a;
  --accent-dim:   rgba(196, 59, 42, 0.1);
  --accent-glow:  rgba(196, 59, 42, 0.18);
  --gold:         #9c7428;
  --gold-dim:     rgba(156, 116, 40, 0.12);
  --green:        #2e7a50;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17.6px; -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.4px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Grain overlay ──────────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ─── Typography ─────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
code { font-family: var(--font-mono); font-size: 0.85em; background: var(--surface-2); padding: 2px 6px; border-radius: 3px; color: var(--gold); }

/* ─── App container ──────────────────────────────────────── */
.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  min-height: 100vh;
}

/* ─── Header ─────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(8, 8, 9, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 19.8px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  font-style: italic;
}

.logo-dot {
  color: var(--accent);
}

.header-tagline {
  font-size: 12.1px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--surface);
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.1px;
  color: var(--accent);
  font-weight: 600;
}

#userEmailDisplay {
  font-size: 13.2px;
  color: var(--text-muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14.3px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: -0.01em;
}

.btn-primary:hover {
  background: #d9d6d1;
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary.btn-large {
  padding: 12px 24px;
  font-size: 15.4px;
  border-radius: var(--radius-lg);
}

.btn-connect {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14.3px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-connect:hover {
  border-color: var(--text-muted);
  background: var(--surface-2);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13.2px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--text-dim);
}

.btn-ghost {
  padding: 7px 12px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13.2px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

.btn-ghost-sm {
  padding: 6px 12px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13.2px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-ghost-sm:hover { color: var(--text); border-color: var(--border-light); }

/* ─── Session-aware initial render (before JS runs) ─────── */
/* Prevents flash: correct view is visible on first paint    */
html.has-session .page-landing  { display: none !important; }
html.has-session #dashboardState { display: block !important; }
html.has-session #appHeader      { display: flex !important; }

/* ─── Landing page ───────────────────────────────────────── */
.page-landing {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Nav */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.btn-signin-nav {
  padding: 7px 16px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14.3px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-signin-nav:hover { color: var(--text); border-color: var(--text-muted); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 60px;
  align-items: center;
  min-height: calc(100vh - 69px);
  padding: 60px 0 80px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12.1px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.hero-title {
  font-size: clamp(41.8px, 6.05vw, 63.8px);
  line-height: 1.1;
  margin-bottom: 24px;
  color: var(--text);
}

.hero-title em {
  color: var(--accent);
  font-style: italic;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 16.5px;
  line-height: 1.8;
  max-width: 480px;
  margin-bottom: 36px;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.btn-signin-hero {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: var(--text);
  color: #111;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: 15.4px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: -0.01em;
}
.btn-signin-hero:hover {
  background: #d9d6d1;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.btn-signin-hero:active { transform: translateY(0); }

.hero-privacy {
  font-size: 12.1px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  letter-spacing: 0.04em;
  line-height: 1.6;
}

/* Hero visual / preview card */
.hero-visual {
  display: flex;
  justify-content: flex-end;
}

.vis-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.vis-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: radial-gradient(ellipse at 50% -20%, var(--accent-dim) 0%, transparent 70%);
  pointer-events: none;
}

.vis-header {
  display: flex;
  gap: 6px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.vis-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.vis-dot.red    { background: #ff5f56; }
.vis-dot.yellow { background: #ffbd2e; }
.vis-dot.green  { background: #27c93f; }

.vis-counter {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.vis-num {
  font-family: var(--font-display);
  font-size: 61.6px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 0 0 40px var(--accent-glow);
}

.vis-label {
  font-family: var(--font-mono);
  font-size: 11.0px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 8px;
}

.vis-rows {
  padding: 6px 0;
}

.vis-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.vis-row--dim { opacity: 0.4; }

.vis-row-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14.3px;
  font-weight: 700;
  color: var(--text-muted);
}

.vis-row-co {
  font-size: 13.2px;
  font-weight: 500;
  color: var(--text);
}

.vis-row-sub {
  font-size: 12.1px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.vis-row-badge {
  font-family: var(--font-mono);
  font-size: 9.9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(217,79,61,0.2);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

/* How it works */
.how-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.how-label {
  font-family: var(--font-mono);
  font-size: 11.0px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 36px;
}

.how-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.how-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.how-num {
  font-family: var(--font-mono);
  font-size: 12.1px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.how-step strong {
  font-size: 16.5px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}

.how-step p {
  font-size: 14.3px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 240px;
}

.how-step-arrow {
  padding: 0 24px;
  padding-top: 36px;
  font-size: 19.8px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* Privacy callout */
.privacy-section {
  margin-bottom: 80px;
}

.privacy-inner {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-lg);
}

.privacy-icon {
  font-size: 22.0px;
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 1px;
}

.privacy-text {
  font-size: 14.3px;
  color: var(--text-muted);
  line-height: 1.7;
}

.privacy-text strong {
  color: var(--text);
  font-weight: 500;
}

/* Footer */
.landing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  margin-bottom: 24px;
}

.footer-copy {
  font-size: 13.2px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ─── Dashboard ──────────────────────────────────────────── */
.dashboard {
  padding-top: 48px;
  padding-bottom: 80px;
}

/* Scan progress */
.scan-progress {
  margin-bottom: 36px;
}

.scan-bar {
  height: 2px;
  background: var(--surface-3);
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 8px;
}

.scan-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  width: 0%;
  transition: width 600ms ease;
  position: relative;
}

.scan-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.scan-label {
  font-family: var(--font-mono);
  font-size: 12.1px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* Hero section */
.hero-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.counter-number {
  font-family: var(--font-display);
  font-size: clamp(79.2px, 13.2vw, 132px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--accent);
  text-shadow: 0 0 80px var(--accent-glow);
  transition: all 400ms ease;
  position: relative;
}

.counter-label {
  font-family: var(--font-mono);
  font-size: 13.2px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 14px;
}

.counter-sub {
  font-size: 14.3px;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
  font-family: var(--font-display);
}

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
  max-width: 340px;
  text-align: right;
}

.hero-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15.4px;
  color: var(--text-muted);
  line-height: 1.65;
  border-left: 2px solid var(--border-light);
  padding-left: 16px;
  text-align: left;
}

.hero-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Stats bar */
.stats-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  margin-bottom: 48px;
  gap: 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 22.0px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 11.0px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  margin: 0 24px;
  flex-shrink: 0;
}

/* List section */
.list-section {}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 20px;
}

.list-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.list-title h2 {
  font-size: 19.8px;
}

.list-count {
  font-family: var(--font-mono);
  font-size: 12.1px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.list-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}

.filter-tab {
  padding: 5px 12px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 13.2px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.filter-tab:hover { color: var(--text); }

.filter-tab.active {
  background: var(--surface-3);
  color: var(--text);
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-control label {
  font-size: 12.1px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sort-control select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13.2px;
  padding: 5px 8px;
  cursor: pointer;
  outline: none;
}

/* ─── Rejection cards ────────────────────────────────────── */
.rejection-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rejection-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  animation: cardIn 250ms ease forwards;
  opacity: 0;
  transform: translateY(6px);
  cursor: default;
  transition: background var(--transition);
}

.rejection-card:hover {
  background: var(--surface);
  border-radius: var(--radius);
  margin: 0 -12px;
  padding: 16px 12px;
}

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

.company-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 17.6px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: -0.03em;
}

.card-body {}

.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.card-company {
  font-size: 15.4px;
  font-weight: 500;
  color: var(--text);
}

.card-count {
  font-family: var(--font-mono);
  font-size: 11.0px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(217, 79, 61, 0.2);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.card-subject {
  font-size: 13.2px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 500px;
}

.card-snippet {
  font-size: 13.2px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 500px;
  margin-top: 2px;
  font-style: italic;
}

.card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.card-date {
  font-family: var(--font-mono);
  font-size: 12.1px;
  color: var(--text-muted);
  white-space: nowrap;
}

.card-badge {
  font-family: var(--font-mono);
  font-size: 11.0px;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
}

.badge-rejection {
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(217, 79, 61, 0.2);
}

/* ─── Shared section header ──────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-title h2 { font-size: 19.8px; }

.section-sub {
  font-family: var(--font-mono);
  font-size: 12.1px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ─── Heatmap ────────────────────────────────────────────── */
.heatmap-section {
  margin-bottom: 56px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11.0px;
  color: var(--text-dim);
}

.legend-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.heatmap-scroll { overflow-x: auto; padding-bottom: 4px; }

.heatmap-months {
  display: flex;
  margin-left: 28px;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 11.0px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  gap: 0;
}

.heatmap-month-label {
  flex-shrink: 0;
}

.heatmap-body {
  display: flex;
  gap: 4px;
}

.heatmap-days {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.heatmap-days span {
  height: 12px;
  font-family: var(--font-mono);
  font-size: 9.9px;
  color: var(--text-dim);
  line-height: 12px;
  width: 24px;
  text-align: right;
}

.heatmap-grid {
  display: flex;
  gap: 2px;
}

.heatmap-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  cursor: default;
  transition: opacity 150ms;
}

.heatmap-cell:hover { opacity: 0.75; }

.heatmap-cell.level-0 { background: var(--surface-3); }
.heatmap-cell.level-1 { background: rgba(217, 79, 61, 0.25); }
.heatmap-cell.level-2 { background: rgba(217, 79, 61, 0.55); }
.heatmap-cell.level-3 { background: var(--accent); box-shadow: 0 0 4px var(--accent-glow); }

.legend-cell.level-0 { background: var(--surface-3); }
.legend-cell.level-1 { background: rgba(217, 79, 61, 0.25); }
.legend-cell.level-2 { background: rgba(217, 79, 61, 0.55); }
.legend-cell.level-3 { background: var(--accent); }

/* ─── W Counter / Wins ────────────────────────────────────── */
.wins-section {
  margin-bottom: 56px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.ratio-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin-bottom: 20px;
}

.ratio-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.ratio-value {
  font-family: var(--font-display);
  font-size: 24.2px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.02em;
}

.ratio-label {
  font-family: var(--font-mono);
  font-size: 11.0px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.ratio-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  margin: 0 20px;
  flex-shrink: 0;
}

.add-win-form {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.win-type-picker {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.win-type-btn {
  padding: 5px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 13.2px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.win-type-btn:hover { color: var(--text); border-color: var(--border-light); }

.win-type-btn.active {
  background: rgba(74, 158, 107, 0.15);
  border-color: rgba(74, 158, 107, 0.4);
  color: var(--green);
}

.win-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.win-form-row input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.3px;
  outline: none;
}

.win-form-row input[type="text"]:focus { border-color: var(--text-dim); }
.win-form-row input[type="text"]::placeholder { color: var(--text-dim); }

.win-form-row input[type="date"] {
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13.2px;
  outline: none;
  color-scheme: dark;
}

.wins-list {
  display: flex;
  flex-direction: column;
}

.wins-empty {
  padding: 32px 0;
  font-size: 14.3px;
  color: var(--text-dim);
  font-style: italic;
}

.win-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  animation: cardIn 200ms ease forwards;
  opacity: 0;
}

.win-type-badge {
  font-family: var(--font-mono);
  font-size: 11.0px;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.win-badge-interview  { color: #60a5fa; background: rgba(96,165,250,0.1); border: 1px solid rgba(96,165,250,0.25); }
.win-badge-final_round{ color: var(--gold); background: var(--gold-dim); border: 1px solid rgba(201,150,74,0.25); }
.win-badge-offer      { color: var(--green); background: rgba(74,158,107,0.1); border: 1px solid rgba(74,158,107,0.25); }
.win-badge-callback   { color: #c084fc; background: rgba(192,132,252,0.1); border: 1px solid rgba(192,132,252,0.25); }

.win-company {
  font-size: 14.3px;
  font-weight: 500;
  color: var(--text);
}

.win-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.win-date {
  font-family: var(--font-mono);
  font-size: 12.1px;
  color: var(--text-muted);
}

.win-auto-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 3px;
  padding: 1px 6px;
}

.win-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15.4px;
  padding: 2px 6px;
  border-radius: 3px;
  transition: var(--transition);
  line-height: 1;
}

.win-delete:hover { color: var(--accent); background: var(--accent-dim); }

.win-open {
  font-size: 15.4px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 3px;
  transition: var(--transition);
  line-height: 1;
  border: 1px solid var(--border-light);
}
.win-open:hover { color: var(--text); background: var(--surface-2); border-color: var(--text-muted); }

/* ─── Share modal ────────────────────────────────────────── */
.share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 9, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  padding: 24px;
}

.share-modal {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 700px;
  width: 100%;
  animation: modalIn 250ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.share-modal-title {
  font-size: 15.4px;
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.share-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 17.6px;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.share-close:hover { color: var(--text); background: var(--surface-2); }

.share-preview {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.share-preview canvas {
  width: 100%;
  display: block;
}

.share-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ─── Empty & Loading states ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-icon {
  font-size: 39.6px;
  color: var(--text-dim);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

.empty-title {
  font-family: var(--font-display);
  font-size: 22.0px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.empty-desc {
  font-size: 14.3px;
  color: var(--text-dim);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.65;
}

.loading-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.loading-row {
  height: 77px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ─── Load more ──────────────────────────────────────────── */
.load-more-container {
  display: flex;
  justify-content: center;
  padding-top: 28px;
}

/* ─── Toast ──────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14.3px;
  color: var(--text);
  min-width: 220px;
  max-width: 340px;
  animation: toastIn 250ms ease forwards;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.toast.error { border-color: rgba(217, 79, 61, 0.4); }
.toast.success { border-color: rgba(74, 158, 107, 0.4); }

.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.error .toast-dot   { background: var(--accent); }
.toast.success .toast-dot { background: var(--green); }
.toast.info .toast-dot    { background: var(--gold); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(12px); height: 0; padding: 0; margin: 0; }
}

/* ─── Counter animation ──────────────────────────────────── */
@keyframes countPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.counter-number.pulse { animation: countPulse 300ms ease; }

/* ─── Theme toggle ───────────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12.1px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: var(--surface-2);
}
.theme-toggle-icon {
  font-size: 14.3px;
  line-height: 1;
}

/* ─── Light mode overrides ───────────────────────────────── */
[data-theme="light"] .header {
  background: rgba(247, 245, 242, 0.95);
}

[data-theme="light"] .btn-signin-hero {
  color: var(--bg);
}
[data-theme="light"] .btn-signin-hero:hover {
  background: #2d2a24;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}
[data-theme="light"] .btn-primary:hover {
  background: #2d2a24;
}

[data-theme="light"] .win-form-row input[type="date"],
[data-theme="light"] .sort-control select {
  color-scheme: light;
}

[data-theme="light"] .counter-number {
  text-shadow: 0 0 40px var(--accent-glow);
}

[data-theme="light"] .vis-card {
  box-shadow: 0 16px 48px rgba(0,0,0,0.1);
}

[data-theme="light"] .win-form-row input[type="text"]:focus {
  border-color: var(--text-muted);
}

[data-theme="light"] .heatmap-cell.level-0 { background: var(--surface-3); }
[data-theme="light"] .legend-cell.level-0  { background: var(--surface-3); }

[data-theme="light"] .toast {
  background: var(--surface);
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

[data-theme="light"] .grain { opacity: 0.018; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 48px 0;
    gap: 36px;
  }

  .hero-visual { display: none; }

  .how-steps { flex-direction: column; gap: 24px; }
  .how-step-arrow { display: none; }

  .hero-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }

  .hero-right {
    align-items: flex-start;
    text-align: left;
    max-width: 100%;
  }

  .hero-quote { text-align: left; }

  .stats-bar {
    flex-wrap: wrap;
    gap: 16px;
  }

  .stat-divider { display: none; }
  .stat-item { flex: 0 0 calc(50% - 8px); }

  .list-header { flex-direction: column; align-items: flex-start; }
  .list-controls { flex-wrap: wrap; }

  .rejection-card { grid-template-columns: 40px 1fr; }
  .card-meta { display: none; }
}

@media (max-width: 560px) {
  .app, .page-landing { padding: 0 16px; }
  .stats-bar { padding: 16px; }
  .stat-item { flex: 0 0 100%; }
}
