/* ChatLens — main.css */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

/* ── CSS Variables ──────────────────────────────────── */
:root {
  --black:      #0C0C0C;
  --surface1:   #111111;
  --surface2:   #161616;
  --surface3:   #1C1C1C;
  --surface4:   #222222;
  --border:     rgba(240,239,232,0.07);
  --border-hov: rgba(240,239,232,0.13);
  --ghost:      rgba(240,239,232,0.08);
  --white:      #F0EFE8;
  --white-dim:  rgba(240,239,232,0.5);
  --white-faint:rgba(240,239,232,0.22);
  --green:      #5CB87A;
  --red:        #E05C5C;
  --yellow:     #D4A843;
  --blue:       #5B8DEE;
  --font-sans:  'DM Sans', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
  --font-serif: 'Playfair Display', serif;
  --radius:     8px;
  --radius-lg:  12px;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea { font: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ── Screen System ──────────────────────────────────── */
.screen {
  display: none;
  min-height: 100vh;
  animation: screenIn 0.3s ease;
}
.screen.active { display: flex; flex-direction: column; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Typography ─────────────────────────────────────── */
.serif   { font-family: var(--font-serif); letter-spacing: -0.3px; }
.mono    { font-family: var(--font-mono); }
.dim     { color: var(--white-dim); }
.faint   { color: var(--white-faint); }
.green   { color: var(--green); }
.red     { color: var(--red); }
.yellow  { color: var(--yellow); }

/* ── Logo ──────────────────────────────────────────── */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
}
.logo-dot {
  width: 6px; height: 6px;
  background: var(--white);
  border-radius: 50%;
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.12s ease;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

.btn-primary {
  background: var(--white);
  color: var(--black);
}
.btn-primary:hover:not(:disabled) { background: #e0dfd8; }

.btn-ghost {
  background: transparent;
  color: var(--white-dim);
  border: 1px solid var(--border);
  font-weight: 500;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--ghost);
  color: var(--white);
  border-color: var(--border-hov);
}

.btn-icon {
  width: auto;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--ghost);
  border: 1px solid var(--border);
  color: var(--white-dim);
}

.btn-danger {
  color: var(--red);
  border-color: rgba(224,92,92,0.2);
}
.btn-danger:hover { background: rgba(224,92,92,0.08); }

/* Spinner inside button */
.btn .spinner {
  width: 16px; height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Inputs ─────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--white-dim);
}
.input-wrap { position: relative; }
.input-wrap .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--white-faint);
  pointer-events: none;
  font-size: 15px;
}
.input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 40px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  font-size: 14px;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.input-wrap input:not(.has-icon) { padding-left: 14px; }
.input-wrap input:focus { outline: none; border-color: var(--border-hov); }
.input-wrap input.error { border-color: var(--red); }
.input-wrap input::placeholder { color: var(--white-faint); }
.input-wrap .toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--white-faint);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
}
.field-error { font-size: 11px; color: var(--red); font-family: var(--font-mono); }

/* ── Divider ─────────────────────────────────────────── */
.label-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white-faint);
  font-size: 11px;
  font-family: var(--font-mono);
}
.label-divider::before, .label-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Social Button ──────────────────────────────────── */
.btn-social {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--white-dim);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  transition: all 0.15s;
  cursor: pointer;
  width: 100%;
  font-size: 14px;
}
.btn-social:hover {
  background: var(--ghost);
  border-color: var(--border-hov);
  color: var(--white);
}

/* ── Auth Screens ────────────────────────────────────── */
.auth-screen {
  flex-direction: column;
  padding: 0 28px;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}
.auth-screen.active { display: flex; }
.auth-header { padding: 40px 0 48px; }
.auth-heading {
  font-family: var(--font-serif);
  font-size: 32px;
  color: var(--white);
  margin-bottom: 6px;
}
.auth-sub { font-size: 14px; color: var(--white-dim); line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--white-faint);
  padding: 28px 0 40px;
}
.auth-footer a { color: var(--white); font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }
.auth-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

/* Inline back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--white-dim);
  cursor: pointer;
}
.back-link:hover { color: var(--white); }

/* Checkbox row */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.checkbox-row input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--white);
  margin-top: 2px;
  flex-shrink: 0;
}
.checkbox-row span { font-size: 12px; color: var(--white-faint); line-height: 1.6; }
.checkbox-row span a { color: var(--white); }

/* Free badge */
.free-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--ghost);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--white-dim);
  margin-bottom: 24px;
}

/* Password strength */
.pass-strength {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.pass-strength.visible { display: flex; }
.strength-dot { width: 6px; height: 6px; border-radius: 50%; }
.strength-label { font-family: var(--font-mono); font-size: 10px; }

/* Forgot password link */
.forgot-link {
  text-align: right;
  font-size: 12px;
  color: var(--white-faint);
  cursor: pointer;
}
.forgot-link:hover { color: var(--white-dim); }

/* ── App Layout ──────────────────────────────────────── */
.app-screen {
  flex-direction: column;
  padding-bottom: 64px; /* bottom nav height */
  min-height: 100vh;
}
.app-screen.active { display: flex; }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface1);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-size: 18px; font-weight: 600; flex: 1; }
.topbar-back {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ghost);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white-dim);
  cursor: pointer;
  flex-shrink: 0;
}
.topbar-back:hover { background: var(--border); color: var(--white); }

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--surface1);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 100;
  max-width: 100vw;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  cursor: pointer;
  color: var(--white-faint);
  transition: color 0.15s;
  font-size: 10px;
  font-family: var(--font-mono);
}
.nav-item:hover { color: var(--white-dim); }
.nav-item.active { color: var(--white); }
.nav-item svg { width: 20px; height: 20px; }

/* ── Home Screen ─────────────────────────────────────── */
.home-content { flex: 1; overflow-y: auto; padding: 24px 20px 16px; }
.home-greeting { margin-bottom: 28px; }
.home-greeting .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--white-faint);
  margin-bottom: 6px;
}
.home-greeting h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.2;
}
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--ghost);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--white-faint);
  margin-top: 12px;
}

/* CTA Card */
.cta-card {
  background: var(--surface1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cta-card:hover { border-color: var(--border-hov); background: var(--surface2); }
.cta-card .label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--white-faint);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cta-card h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-bottom: 8px;
}
.cta-card p { font-size: 13px; color: var(--white-dim); line-height: 1.5; }
.cta-card .arrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}
.cta-card .arrow span {
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
}

/* Usage bar */
.usage-section { margin-bottom: 24px; }
.usage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.usage-header span { font-size: 12px; }
.usage-track {
  height: 3px;
  background: var(--surface3);
  border-radius: 2px;
  overflow: hidden;
}
.usage-fill {
  height: 100%;
  background: var(--white);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Recent section */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.section-head h3 { font-size: 13px; font-weight: 600; }
.section-head a { font-family: var(--font-mono); font-size: 11px; color: var(--white-faint); cursor: pointer; }
.section-head a:hover { color: var(--white-dim); }

/* Report card (mini) */
.report-card-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface1);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.report-card-mini:hover { border-color: var(--border-hov); }
.report-card-mini .avatar {
  width: 40px; height: 40px;
  background: var(--surface3);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: var(--white-dim);
  flex-shrink: 0;
}
.report-card-mini .info { flex: 1; min-width: 0; }
.report-card-mini .name { font-size: 13px; font-weight: 500; }
.report-card-mini .meta { font-family: var(--font-mono); font-size: 10px; color: var(--white-faint); margin-top: 2px; }
.report-card-mini .score-col { text-align: right; }
.report-card-mini .score-num { font-family: var(--font-mono); font-size: 18px; font-weight: 500; }
.report-card-mini .score-lbl { font-family: var(--font-mono); font-size: 9px; opacity: 0.7; }
.report-card-mini .chevron { color: var(--white-faint); font-size: 11px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}
.empty-state .emoji { font-size: 36px; margin-bottom: 12px; }
.empty-state h3 { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--white-faint); }

/* ── Upload Screen ───────────────────────────────────── */
.upload-content { flex: 1; overflow-y: auto; padding: 16px 20px; }
.upload-heading {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.25;
  margin-bottom: 8px;
}
.platform-guide { margin-bottom: 28px; }
.platform-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--surface1);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}
.platform-card .emoji { font-size: 18px; flex-shrink: 0; }
.platform-card .pname { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.platform-card .steps { font-family: var(--font-mono); font-size: 10px; color: var(--white-faint); line-height: 1.5; }

/* Drop zone */
.drop-zone {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface1);
  margin-bottom: 20px;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--border-hov);
  background: var(--ghost);
}
.drop-zone.has-file {
  border-color: var(--border-hov);
  background: var(--ghost);
  text-align: left;
}
.drop-zone .upload-icon { font-size: 30px; color: var(--white-dim); margin-bottom: 12px; }
.drop-zone .upload-label { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.drop-zone .upload-ext { font-family: var(--font-mono); font-size: 11px; color: var(--white-faint); }

.file-preview {
  display: flex;
  align-items: center;
  gap: 14px;
}
.file-preview .check-icon {
  width: 40px; height: 40px;
  background: rgba(92,184,122,0.1);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--green);
  flex-shrink: 0;
}
.file-preview .file-info { flex: 1; min-width: 0; }
.file-preview .file-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview .file-ready { font-family: var(--font-mono); font-size: 11px; color: var(--green); }
.file-preview .remove-btn { color: var(--white-faint); cursor: pointer; padding: 4px; }
.file-preview .remove-btn:hover { color: var(--red); }

/* Analysis progress */
.analysis-progress {
  background: var(--surface1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  display: none;
}
.analysis-progress.visible { display: block; }
.progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mini-spinner {
  width: 14px; height: 14px;
  border: 1.5px solid transparent;
  border-top-color: var(--white-dim);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.progress-label { font-size: 13px; color: var(--white-dim); flex: 1; }
.progress-pct { font-family: var(--font-mono); font-size: 11px; color: var(--white-faint); }
.progress-track { height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--white); border-radius: 2px; transition: width 0.4s ease; }

.privacy-note { text-align: center; font-family: var(--font-mono); font-size: 10px; color: var(--white-faint); margin-top: 12px; }

/* ── Report Screen ───────────────────────────────────── */
.report-screen { padding-bottom: 0; }
.report-content { flex: 1; overflow-y: auto; }

/* Hero */
.report-hero {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.report-contact-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.report-avatar {
  width: 44px; height: 44px;
  background: var(--surface3);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; color: var(--white-dim);
  flex-shrink: 0;
}
.report-contact-name { font-family: var(--font-serif); font-size: 22px; line-height: 1; margin-bottom: 3px; }
.report-meta-row { font-family: var(--font-mono); font-size: 10px; color: var(--white-faint); }

/* Big score */
.score-ring-wrap { display: flex; gap: 16px; align-items: center; }
.score-ring { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .ring-bg { fill: none; stroke: var(--surface3); stroke-width: 4; }
.score-ring .ring-fill { fill: none; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.score-ring .ring-text {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-ring .ring-num { font-family: var(--font-mono); font-size: 18px; font-weight: 500; line-height: 1; }
.score-ring .ring-lbl { font-family: var(--font-mono); font-size: 8px; color: var(--white-faint); margin-top: 1px; }
.score-info .score-title { font-family: var(--font-serif); font-size: 20px; margin-bottom: 4px; }
.score-info .score-sub { font-size: 13px; color: var(--white-dim); line-height: 1.5; }

/* Stats chips */
.stats-chips { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.chip {
  padding: 6px 10px;
  background: var(--ghost);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--white-faint);
}

/* Report sections */
.report-sections { padding: 0 20px 80px; }
.report-section { margin-top: 24px; }
.report-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--white-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

/* Flag card */
.flag-card {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid;
  margin-bottom: 8px;
}
.flag-card.high   { background: rgba(224,92,92,0.06);  border-color: rgba(224,92,92,0.2); }
.flag-card.medium { background: rgba(212,168,67,0.06); border-color: rgba(212,168,67,0.2); }
.flag-card.low    { background: rgba(91,141,238,0.06); border-color: rgba(91,141,238,0.15); }
.flag-card.positive{ background: rgba(92,184,122,0.06); border-color: rgba(92,184,122,0.2); }
.flag-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.severity-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.severity-dot.high   { background: var(--red); }
.severity-dot.medium { background: var(--yellow); }
.severity-dot.low    { background: var(--blue); }
.severity-dot.positive { background: var(--green); }
.flag-title { font-size: 13px; font-weight: 500; }
.flag-desc { font-size: 12px; color: var(--white-dim); line-height: 1.6; }
.flag-excerpt { font-family: var(--font-mono); font-size: 10px; color: var(--white-faint); margin-top: 6px; font-style: italic; }

/* Balance bars */
.balance-row { margin-bottom: 14px; }
.balance-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--white-dim); margin-bottom: 5px; }
.balance-track { height: 4px; background: var(--surface3); border-radius: 2px; overflow: hidden; position: relative; }
.balance-you  { height: 100%; background: var(--white); border-radius: 2px; }
.balance-them { position: absolute; top: 0; right: 0; height: 100%; background: var(--white-dim); border-radius: 2px; }

/* Response time */
.rt-row { display: flex; gap: 12px; margin-bottom: 12px; }
.rt-card {
  flex: 1;
  padding: 12px;
  background: var(--ghost);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.rt-card .rt-val { font-family: var(--font-mono); font-size: 20px; font-weight: 500; }
.rt-card .rt-lbl { font-family: var(--font-mono); font-size: 9px; color: var(--white-faint); margin-top: 3px; }
.rt-analysis { font-size: 12px; color: var(--white-dim); line-height: 1.6; }

/* Sentiment */
.sentiment-row { display: flex; gap: 8px; margin-bottom: 12px; }
.sentiment-bar {
  flex: 1;
  padding: 10px 8px;
  border-radius: var(--radius);
  text-align: center;
}
.sentiment-bar .s-count { font-family: var(--font-mono); font-size: 16px; font-weight: 500; }
.sentiment-bar .s-label { font-family: var(--font-mono); font-size: 9px; margin-top: 2px; }
.sentiment-bar.positive { background: rgba(92,184,122,0.1); color: var(--green); }
.sentiment-bar.neutral  { background: rgba(240,239,232,0.05); color: var(--white-dim); }
.sentiment-bar.negative { background: rgba(224,92,92,0.1); color: var(--red); }

/* Rewrite card */
.rewrite-card {
  padding: 14px;
  background: var(--surface1);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
}
.rewrite-ctx { font-family: var(--font-mono); font-size: 10px; color: var(--white-faint); margin-bottom: 10px; }
.rewrite-msgs { display: flex; flex-direction: column; gap: 8px; }
.rewrite-orig, .rewrite-new {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}
.rewrite-orig { background: rgba(224,92,92,0.08); border: 1px solid rgba(224,92,92,0.15); }
.rewrite-new  { background: rgba(92,184,122,0.08); border: 1px solid rgba(92,184,122,0.15); }
.rewrite-tag { font-family: var(--font-mono); font-size: 9px; margin-bottom: 4px; }
.rewrite-orig .rewrite-tag { color: var(--red); }
.rewrite-new  .rewrite-tag { color: var(--green); }
.rewrite-why { font-size: 11px; color: var(--white-faint); margin-top: 8px; line-height: 1.5; font-style: italic; }

/* Insight card */
.insight-card {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid;
  margin-bottom: 8px;
}
.insight-card.warning { background: rgba(212,168,67,0.06); border-color: rgba(212,168,67,0.2); }
.insight-card.success { background: rgba(92,184,122,0.06); border-color: rgba(92,184,122,0.2); }
.insight-card.info    { background: rgba(91,141,238,0.06); border-color: rgba(91,141,238,0.2); }
.insight-title { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.insight-body  { font-size: 12px; color: var(--white-dim); line-height: 1.6; }

/* Activity chart */
.activity-chart { display: flex; align-items: flex-end; gap: 3px; height: 60px; margin-bottom: 8px; }
.activity-bar-wrap { flex: 1; display: flex; flex-direction: column; gap: 2px; align-items: center; height: 100%; justify-content: flex-end; }
.activity-bar { width: 100%; border-radius: 2px 2px 0 0; min-height: 2px; transition: height 0.5s ease; }
.activity-bar.you  { background: var(--white); }
.activity-bar.them { background: var(--white-dim); }
.activity-legend { display: flex; gap: 16px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--white-faint); }
.legend-dot { width: 8px; height: 8px; border-radius: 1px; }

/* ── History Screen ───────────────────────────────────── */
.history-content { flex: 1; overflow-y: auto; padding: 16px 20px 20px; }
.history-count { font-family: var(--font-mono); font-size: 11px; color: var(--white-faint); }

/* ── Settings Screen ──────────────────────────────────── */
.settings-content { flex: 1; overflow-y: auto; padding: 20px; }
.settings-section { margin-bottom: 20px; }
.settings-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--white-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.settings-group {
  background: var(--surface1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row .icon { color: var(--white-faint); font-size: 17px; flex-shrink: 0; }
.settings-row .label { font-size: 13px; color: var(--white-dim); flex: 1; }
.settings-row .label small { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--white-faint); margin-top: 1px; }
.settings-row .value { font-family: var(--font-mono); font-size: 12px; color: var(--white-faint); text-align: right; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

.plan-badge {
  padding: 3px 8px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.plan-badge.free { background: var(--ghost); color: var(--white-faint); border: 1px solid var(--border); }
.plan-badge.pro  { background: rgba(92,184,122,0.1); color: var(--green); border: 1px solid rgba(92,184,122,0.3); }

/* Toggle switch */
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--ghost);
  border-radius: 24px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: var(--white-faint);
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(240,239,232,0.2); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--white); }

/* ── Snackbar ────────────────────────────────────────── */
#snackbar {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface3);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 200;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
#snackbar.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
#snackbar.error { background: rgba(224,92,92,0.9); }

/* ── Splash ──────────────────────────────────────────── */
#screen-splash {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}
#screen-splash .tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--white-faint);
  letter-spacing: 0.08em;
}

/* ── Utilities ───────────────────────────────────────── */
.mt8  { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.mb8  { margin-bottom: 8px; }
.mb16 { margin-bottom: 16px; }
.mb24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap8 { gap: 8px; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ── Loading overlay ─────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(12,12,12,0.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  backdrop-filter: blur(4px);
}
.loading-overlay .spinner-lg {
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Responsive / Desktop centering ─────────────────── */
@media (min-width: 640px) {
  body { display: flex; justify-content: center; }
  #app {
    width: 390px;
    min-height: 100vh;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    position: relative;
  }
  .bottom-nav { left: auto; right: auto; width: 390px; }
}
