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

:root {
  --ink: #1a1a1a;
  --muted: #666;
  --faint: #aaa;
  --surface: #fff;
  --raised: #f7f7f5;
  --line: #e5e5e3;
  --accent: #185FA5;
  --accent-hover: #0e4a82;
  --danger: #a32d2d;
  --success: #0f6e56;
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  font-family: 'Geist', sans-serif;
  color: var(--ink);
  background: #fafaf8;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }

/* ── Nav ── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem; border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.nav-logo { font-family: 'Instrument Serif', serif; font-size: 20px; color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: .75rem; }
.usage-badge { font-size: 13px; color: var(--muted); }
.pro-badge {
  font-size: 12px; font-weight: 500; background: #E6F1FB;
  color: var(--accent); padding: 3px 10px; border-radius: 100px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .5rem 1.125rem; border-radius: var(--radius);
  font-family: 'Geist', sans-serif; font-size: 14px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent; transition: all .12s;
}
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #bbb; }
.btn-sm { padding: .375rem .75rem; font-size: 13px; }
.btn-lg { padding: .75rem 1.75rem; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.full-width { width: 100%; justify-content: center; }

/* ── Hero ── */
.hero {
  max-width: 640px; margin: 6rem auto; padding: 0 2rem; text-align: center;
}
.hero-eyebrow {
  font-size: 13px; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1rem;
}
.hero-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1; margin-bottom: 1.25rem;
}
.hero-title em { font-style: italic; }
.hero-sub {
  font-size: 18px; color: var(--muted); font-weight: 300;
  max-width: 480px; margin: 0 auto 2rem;
}
.hero-fine { font-size: 13px; color: var(--faint); margin-top: .75rem; }

/* ── Features ── */
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem; max-width: 860px; margin: 0 auto 6rem; padding: 0 2rem;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.5rem;
}
.feature-icon { font-size: 24px; margin-bottom: .75rem; }
.feature-card h3 { font-size: 16px; font-weight: 500; margin-bottom: .5rem; }
.feature-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ── Dashboard ── */
.dashboard { max-width: 860px; margin: 2rem auto; padding: 0 1.5rem 4rem; }
.upgrade-banner {
  background: #FAEEDA; border: 1px solid #FAC775; border-radius: var(--radius);
  padding: .75rem 1rem; font-size: 14px; margin-bottom: 1.5rem; color: #633806;
}
.form-panel { margin-bottom: 2rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1rem; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.field label {
  display: block; font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: .5rem;
}
textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius);
  padding: .75rem 1rem; font-family: 'Geist', sans-serif; font-size: 14px;
  line-height: 1.6; color: var(--ink); background: var(--surface);
  resize: vertical; outline: none; transition: border-color .12s;
}
textarea:focus { border-color: var(--accent); }
textarea::placeholder { color: var(--faint); }
.error-msg {
  margin-top: .75rem; padding: .75rem 1rem; background: #FCEBEB;
  border: 1px solid #F09595; border-radius: var(--radius);
  font-size: 14px; color: var(--danger);
}

/* ── Results ── */
.tab-bar { display: flex; gap: 6px; margin-bottom: 1rem; }
.tab {
  padding: .375rem .875rem; border-radius: 100px; font-size: 13px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); cursor: pointer; transition: all .12s;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: white; }
.email-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; display: none;
}
.email-card.active { display: block; }
.email-header {
  padding: 1rem 1.25rem .75rem; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
.tone-badge {
  font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .07em; padding: 3px 8px; border-radius: 100px;
}
.tone-formal { background: #E6F1FB; color: #185FA5; }
.tone-casual { background: #E1F5EE; color: #0F6E56; }
.tone-bold   { background: #FAECE7; color: #993C1D; }
.email-body { padding: 1.25rem; font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.email-actions {
  padding: .75rem 1.25rem; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end;
}

/* ── Auth ── */
.auth-page { max-width: 400px; margin: 5rem auto; padding: 0 1.5rem; text-align: center; }
.auth-page h2 { font-family: 'Instrument Serif', serif; font-size: 2rem; margin-bottom: 2rem; }

/* ── Pricing ── */
.pricing-page { max-width: 680px; margin: 4rem auto; padding: 0 1.5rem; text-align: center; }
.pricing-page h2 { font-family: 'Instrument Serif', serif; font-size: 2.5rem; margin-bottom: .5rem; }
.pricing-sub { color: var(--muted); margin-bottom: 2.5rem; }
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; text-align: left; }
@media (max-width: 500px) { .pricing-grid { grid-template-columns: 1fr; } }
.pricing-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.75rem; position: relative;
}
.pricing-card.featured { border: 2px solid var(--accent); }
.plan-badge {
  font-size: 12px; font-weight: 500; background: #E6F1FB; color: var(--accent);
  padding: 3px 10px; border-radius: 100px; display: inline-block; margin-bottom: .75rem;
}
.plan-name { font-size: 16px; font-weight: 500; margin-bottom: .25rem; }
.plan-price { font-size: 2.5rem; font-weight: 300; margin-bottom: 1.25rem; }
.plan-price span { font-size: 16px; color: var(--muted); }
.plan-features { list-style: none; margin-bottom: 1.5rem; }
.plan-features li {
  font-size: 14px; color: var(--muted);
  padding: .35rem 0; border-bottom: 1px solid var(--line);
}
.plan-features li::before { content: '✓ '; color: var(--success); font-weight: 500; }
