/* ==========================================================================
   EmailIQ — Design Layer
   Augments app.css: public nav, public pages, landing, auth pages, polish.
   Only templates/CSS — no backend changes.
   ========================================================================== */

/* --------------------------------------------------------------------------
   PHASE 1: Public nav + footer upgrades
   -------------------------------------------------------------------------- */

/* Sticky nav with blur-on-scroll */
.public-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, backdrop-filter 0.2s ease;
}
.public-nav.scrolled {
  background: var(--bg-topbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}

/* Mobile nav menu */
.public-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}
.nav-menu-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 640px) {
  .public-nav { padding: 0 16px; }
  .nav-menu-toggle { display: flex; }
  .public-nav-right {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    gap: 8px;
  }
  .public-nav-right.open { display: flex; }
  .public-nav-right .nav-btn-secondary,
  .public-nav-right .nav-btn-primary {
    width: 100%;
    text-align: center;
  }
}

/* Nav buttons */
.nav-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
.nav-btn-secondary:hover { color: var(--text); background: var(--panel-hover); }
.nav-btn-secondary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  cursor: pointer;
}
.nav-btn-primary:hover { background: var(--accent-hover); }
.nav-btn-primary:active { transform: scale(0.98); }
.nav-btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text); }
.footer-links a:focus-visible { outline: 2px solid var(--accent); border-radius: 2px; }
.footer-merchant {
  font-size: 11.5px;
  color: var(--muted-dark);
  margin-top: 4px;
  flex-basis: 100%;
}
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: flex-start; padding: 20px 16px; }
}

/* --------------------------------------------------------------------------
   PHASE 2: Public legal / pricing pages
   -------------------------------------------------------------------------- */

.public-page-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 32px 96px;
}
@media (max-width: 640px) { .public-page-wrap { padding: 40px 16px 64px; } }

.public-page-eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.public-page-title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  margin: 0 0 8px;
}
.public-page-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 48px;
}

/* Legal prose */
.legal-prose { font-size: 14.5px; line-height: 1.75; color: var(--text-body); }
.legal-prose h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 40px 0 12px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.legal-prose h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.legal-prose p { margin: 0 0 16px; max-width: 68ch; }
.legal-prose ul { padding-left: 20px; margin: 0 0 16px; }
.legal-prose li { margin-bottom: 8px; max-width: 68ch; }
.legal-prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.legal-prose a:hover { opacity: 0.8; }
.legal-prose strong { color: var(--text); font-weight: 600; }
.legal-prose code { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; background: var(--panel); padding: 2px 6px; border-radius: var(--radius-xs); border: 1px solid var(--line); }

/* Paddle merchant note callout */
.merchant-callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--accent-surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 32px 0;
  font-size: 13.5px;
  color: var(--text-body);
  line-height: 1.6;
}
.merchant-callout svg { flex-shrink: 0; color: var(--accent-text); margin-top: 1px; }

/* --------------------------------------------------------------------------
   PHASE 2: Pricing page
   -------------------------------------------------------------------------- */

.pricing-page { max-width: 1100px; margin: 0 auto; padding: 64px 32px 96px; }
@media (max-width: 640px) { .pricing-page { padding: 40px 16px 64px; } }

.pricing-header { margin-bottom: 48px; }
.pricing-header h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.1;
  margin: 0 0 12px;
}
.pricing-header p { font-size: 15px; color: var(--muted); margin: 0; max-width: 56ch; }

/* Billing toggle */
.plans-cycle-bar {
  display: inline-flex;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 40px;
}
.cycle-tab {
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cycle-tab:hover { color: var(--text); }
.cycle-tab.active { background: var(--panel-hover); color: var(--text); font-weight: 600; }
.cycle-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cycle-save-pill {
  font-size: 10.5px;
  font-weight: 700;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  letter-spacing: 0.01em;
}

/* Plan cards */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}
.plan-card {
  background: var(--panel-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
}
.plan-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.plan-card-featured {
  border-color: var(--accent-border);
  background: color-mix(in srgb, var(--panel-card) 90%, var(--accent) 10%);
}
.plan-card-featured:hover { border-color: var(--accent); }

.plan-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}
.plan-card h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 8px;
}
.plan-description { font-size: 13.5px; color: var(--muted); margin: 0 0 20px; line-height: 1.6; }

.plan-price {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.plan-price small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-current { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.plan-billing-note { font-size: 12px; color: var(--muted-dark); margin-bottom: 20px; }

.plan-actions { margin-bottom: 24px; }
.plan-cta-btn, .plan-actions .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  text-align: center;
  text-decoration: none;
  border: 1px solid;
}
.plan-cta-btn:active, .plan-actions .btn:active { transform: scale(0.98); }
.plan-cta-btn:focus-visible, .plan-actions .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn.primary, .plan-cta-btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover, .plan-cta-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.secondary { background: transparent; border-color: var(--line-strong); color: var(--text-body); }
.btn.secondary:hover { background: var(--panel-hover); border-color: var(--line-strong); }
.btn.loading { opacity: 0.7; pointer-events: none; }
.btn.loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

.plan-status-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  padding: 10px;
  border: 1px solid var(--green-border);
  background: var(--green-bg);
  border-radius: var(--radius-sm);
  text-align: center;
}
.trial-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--accent-surface);
  color: var(--accent-text);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}
.plan-trial-note {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}
.plans-login-note {
  font-size: 13.5px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 24px;
}
.plan-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.plan-card li {
  font-size: 13.5px;
  color: var(--text-body);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}
.plan-card li::before {
  content: '';
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2310b981' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* --------------------------------------------------------------------------
   PHASE 3: Landing / home page
   Copy left, live extraction panel right. Here is exactly one interactive
   moment on the page; everything below it is quiet hairline structure.
   -------------------------------------------------------------------------- */

.landing-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px 96px;
}
@media (max-width: 640px) { .landing-page { padding: 0 20px 64px; } }

/* Hero */
.lm-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 64px;
  align-items: center;
  padding: 72px 0 64px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 980px) {
  .lm-hero { grid-template-columns: 1fr; gap: 40px; padding: 48px 0 40px; }
}

.lm-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 22px;
}
.lm-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.lm-title {
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.02;
  color: var(--text);
  margin: 0 0 20px;
  max-width: 15ch;
  text-wrap: balance;
}
.lm-lede {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 30px;
  max-width: 46ch;
}
.lm-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.lm-footnote { font-size: 12.5px; color: var(--muted-dark); margin: 0; }

/* Live extraction panel */
.lm-demo {
  background: var(--panel-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.lm-demo-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.lm-demo-tab {
  flex: 1;
  padding: 11px 6px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lm-demo-tab:last-child { border-right: 0; }
.lm-demo-tab:hover { background: var(--panel-hover); color: var(--text); }
.lm-demo-tab[aria-selected="true"] { background: var(--accent-surface); color: var(--accent-text); }
.lm-demo-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.lm-demo-body { padding: 18px; }
.lm-mail-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.lm-mail-from { font-size: 12px; color: var(--muted); }
.lm-mail-time { font-size: 11.5px; color: var(--muted-dark); }
.lm-mail-subject { font-size: 13.5px; font-weight: 600; color: var(--text); margin: 0 0 12px; }
.lm-mail-quote {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-body);
  border-left: 2px solid var(--line-strong);
  padding-left: 12px;
  margin: 0 0 16px;
}
.lm-result {
  border-top: 1px dashed var(--line);
  padding-top: 14px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.lm-result.is-swapping { opacity: 0.25; transform: translateY(4px); }
.lm-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.lm-result-kind {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.lm-confidence { font-size: 11.5px; color: var(--muted-dark); font-variant-numeric: tabular-nums; }
.lm-result-title { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.45; margin: 0 0 10px; }
.lm-rows { display: grid; gap: 6px; margin: 0; }
.lm-row { display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; }
.lm-row dt { color: var(--muted-dark); margin: 0; }
.lm-row dd { color: var(--text-body); margin: 0; text-align: right; }
.lm-demo-src { font-size: 11.5px; color: var(--muted-dark); margin: 14px 0 0; }

/* Content sections */
.lm-section { padding: 64px 0; border-bottom: 1px solid var(--line); }
.lm-section:last-of-type { border-bottom: 0; padding-bottom: 0; }
.lm-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 40px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.lm-section-title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text);
  margin: 0;
  line-height: 1.15;
}
.lm-section-note { font-size: 13px; color: var(--muted); margin: 0; max-width: 44ch; line-height: 1.6; }

/* Item types */
.lm-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.lm-type {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.lm-type:nth-child(odd) { padding-right: 32px; border-right: 1px solid var(--line); }
.lm-type:nth-child(even) { padding-left: 32px; }
.lm-type-label { font-size: 12.5px; font-weight: 600; color: var(--accent-text); }
.lm-type p { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 0; }
@media (max-width: 760px) {
  .lm-types { grid-template-columns: 1fr; }
  .lm-type:nth-child(odd) { padding-right: 0; border-right: 0; }
  .lm-type:nth-child(even) { padding-left: 0; }
}

/* Steps — a real sequence, so the numbers carry information */
.lm-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.lm-step { padding: 22px 32px 0 0; border-right: 1px solid var(--line); }
.lm-step + .lm-step { padding-left: 32px; }
.lm-step:last-child { border-right: 0; padding-right: 0; }
.lm-step-num { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted-dark); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.lm-step h3 { font-size: 14.5px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; margin: 0 0 6px; }
.lm-step p { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 0; }
@media (max-width: 760px) {
  .lm-steps { grid-template-columns: 1fr; }
  .lm-step { padding: 18px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .lm-step + .lm-step { padding-left: 0; }
  .lm-step:last-child { border-bottom: 0; }
}

/* Limits / trust list */
.lm-limits { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.lm-limits li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}
.lm-limits svg { color: var(--muted-dark); margin-top: 3px; }
.lm-limits strong { color: var(--text-body); font-weight: 600; }

/* Plan list — a compact price list, not three identical cards */
.lm-plans { border-top: 1px solid var(--line); }
.lm-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 200px;
  gap: 24px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.lm-plan-name { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.lm-plan-name span { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 3px; letter-spacing: 0; }
.lm-plan-price { font-size: 13px; color: var(--muted); text-align: right; }
.lm-plan-price b { font-size: 24px; font-weight: 800; letter-spacing: -0.035em; color: var(--text); }
.lm-plan-cta { display: flex; justify-content: flex-end; }
.lm-plan.is-featured { box-shadow: inset 2px 0 0 var(--accent); padding-left: 20px; }
.lm-plan-flag { display: block; font-size: 11px; font-weight: 600; color: var(--accent-text); margin-top: 4px; }
.lm-limits code { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--text-body); }
@media (max-width: 760px) {
  .lm-plan { grid-template-columns: 1fr auto; gap: 10px 16px; }
  .lm-plan-price { grid-row: 2; }
  .lm-plan-cta { grid-row: 1 / span 2; }
  .lm-plan.is-featured { padding-left: 14px; }
}

/* Closing CTA */
.lm-close {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  padding: 64px 0 8px;
}
.lm-close h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
  color: var(--text);
  margin: 0;
  max-width: 26ch;
}

/* --------------------------------------------------------------------------
   PHASE 4: Auth pages (login / register)
   -------------------------------------------------------------------------- */

.auth-page {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
}
@media (max-width: 480px) { .auth-card { padding: 28px 20px; } }

.auth-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 28px;
  text-decoration: none;
}
.auth-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 6px;
}
.auth-subtitle { font-size: 13.5px; color: var(--muted); margin: 0 0 28px; }

/* OAuth button */
.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 11px 20px;
  font-size: 14.5px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-oauth:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); }
.btn-oauth:active { transform: scale(0.98); }
.btn-oauth:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-oauth-google-white {
  background: #fff;
  border-color: var(--line-strong);
  color: #09090b;
}
.btn-oauth-google-white:hover { background: #f4f4f5; transform: translateY(-1px); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 12px;
  color: var(--muted-dark);
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-security-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 20px;
}
.auth-security-row svg { flex-shrink: 0; color: var(--muted-dark); margin-top: 1px; }
.auth-trust-bullets {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-trust-bullets li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.auth-trust-bullets li svg { color: var(--green); }
.auth-footer-link {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  line-height: 1.6;
}
.auth-footer-link a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   PHASE 5: Dashboard + app-shell polish
   -------------------------------------------------------------------------- */

/* Page heading */
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.page-heading h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.1;
}
.page-heading p { font-size: 13.5px; color: var(--muted); margin: 0; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-hover) 50%, var(--panel) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-line { height: 12px; border-radius: 6px; }
.skeleton-line.w-3-4 { width: 75%; }
.skeleton-line.w-1-2 { width: 50%; }
.skeleton-line.w-1-3 { width: 33%; }
.skeleton-block { height: 80px; border-radius: var(--radius); }
.skeleton-card {
  background: var(--panel-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Empty states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state svg { opacity: 0.4; }
.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-body);
  margin: 0;
}
.empty-state-desc { font-size: 13.5px; color: var(--muted); margin: 0; max-width: 44ch; line-height: 1.6; }
.empty-state-action {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.empty-state-action:hover { background: var(--accent-hover); transform: translateY(-1px); }
.empty-state-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Plans heading */
.plans-heading {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.plans-heading h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 4px;
}
.plans-heading p { font-size: 13.5px; color: var(--muted); margin: 0; }

/* --------------------------------------------------------------------------
   PHASE 6: Polish — micro-interactions, error pages, scroll reveal
   -------------------------------------------------------------------------- */

/* Scroll reveal (single-pass, no per-card noise) */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Error pages */
.error-page {
  min-height: calc(100vh - 56px - 73px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 24px;
  text-align: center;
}
.error-code {
  font-size: 80px;
  font-weight: 800;
  letter-spacing: -0.06em;
  color: var(--line-strong);
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
}
.error-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0;
}
.error-desc {
  font-size: 14px;
  color: var(--muted);
  max-width: 44ch;
  margin: 0;
  line-height: 1.65;
}
.error-actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }

/* Toasts (already in app.css — enhance with better style) */
.app-toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.app-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--panel-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  color: var(--text-body);
  pointer-events: all;
  animation: toastIn 0.2s ease;
  max-width: 340px;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
.app-toast-success { border-left: 3px solid var(--green); }
.app-toast-error { border-left: 3px solid var(--red); }
.app-toast-info { border-left: 3px solid var(--accent); }
.app-toast-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
  pointer-events: all;
}
.app-toast-close:hover { color: var(--text); }

/* Universal focus visible ring */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Spin animation */
@keyframes spin { to { transform: rotate(360deg); } }

/* Upgrade CTA banner (dashboard) */
.upgrade-cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--accent-surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.upgrade-cta-banner p {
  font-size: 13.5px;
  color: var(--text-body);
  margin: 0;
  flex: 1;
}
.upgrade-cta-banner a {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.upgrade-cta-banner a:hover { background: var(--accent-hover); transform: translateY(-1px); }
.upgrade-cta-banner a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Meta dot */
.meta-dot { color: var(--muted-dark); padding: 0 2px; }

/* Tag */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid;
}

/* --------------------------------------------------------------------------
   PHASE 7: Shared primitives — nav toggle, loading states, auth split
   -------------------------------------------------------------------------- */

/* Public nav layout: brand left, links right, toggle only on small screens */
.public-nav .brand { flex-shrink: 0; }
.public-nav-right { margin-left: auto; }
.nav-menu-toggle { margin-left: auto; align-items: center; justify-content: center; }
.nav-menu-toggle .icon-close { display: none; }
.nav-menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.public-nav-right {
  font-size: 13.5px;
}
.public-nav-right a.nav-btn-secondary { border-color: transparent; background: transparent; }
.public-nav-right a.nav-btn-secondary:hover { background: var(--panel-hover); color: var(--text); }
@media (max-width: 640px) {
  .public-nav-right { margin-left: 0; }
  .public-nav-right.open { display: flex; }
}

/* Button spinner */
.btn-spinner {
  width: 13px;
  height: 13px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}
.btn[disabled], .btn.is-busy { opacity: 0.7; cursor: progress; }
@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation-duration: 2s; }
}

/* Auth: asymmetric split — copy on the left, form on the right */
.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  gap: 72px;
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
  padding: 72px 32px 96px;
  min-height: calc(100vh - 56px - 120px);
}
.auth-split .auth-aside { max-width: 44ch; }
.auth-aside-title {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--text);
  margin: 0 0 14px;
}
.auth-aside-copy {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 32px;
}
.auth-facts { border-top: 1px solid var(--line); }
.auth-fact {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.auth-fact svg { flex-shrink: 0; color: var(--accent-text); margin-top: 2px; }
.auth-fact strong { color: var(--text-body); font-weight: 600; display: block; margin-bottom: 2px; }
.auth-fact code, .auth-trust-bullets code { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.auth-split .auth-card { max-width: none; }
.auth-card .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.auth-card label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.auth-card input[type="text"], .auth-card input[type="email"], .auth-card input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-surface); }
.auth-card .btn-block { width: 100%; justify-content: center; }
.auth-error {
  font-size: 12.5px;
  color: #fca5a5;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 16px;
  line-height: 1.5;
}
@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr; gap: 40px; padding: 40px 16px 64px; min-height: 0; }
  .auth-split .auth-aside { max-width: none; }
  .auth-facts { display: none; }
}

/* Legal page actions + terms acceptance */
.legal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.legal-accept {
  margin-top: 40px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.legal-accept-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--text-body);
  line-height: 1.55;
  cursor: pointer;
}
.legal-accept-label input { margin-top: 3px; accent-color: var(--accent); }
.legal-accept .btn { align-self: flex-start; }
.legal-prose .merchant-callout { margin-bottom: 40px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Error pages */
.error-desc a, .lm-footnote a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

/* Pricing cycle switcher */
.plans-cycle-bar { flex-wrap: nowrap; }
.cycle-tab { white-space: nowrap; }
.cycle-save-pill { font-size: 10px; padding: 1px 6px; }
@media (max-width: 520px) {
  .plans-cycle-bar { flex-direction: row; max-width: 100%; }
  .cycle-tab { font-size: 11.5px; padding: 8px 4px; }
}
.plan-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted-dark);
}
.plan-card h2 { font-size: 24px; letter-spacing: -0.03em; }

/* --------------------------------------------------------------------------
   PHASE 8: List, review and card surfaces
   Flattens the legacy shadowed cards into the same hairline language as the
   public pages. No lift-on-hover, no stacked shadows.
   -------------------------------------------------------------------------- */

.panel { box-shadow: none; }
.panel:hover { border-color: var(--line); }

.cards-list-container { padding: 16px 18px; gap: 10px; }

.item-card,
.overview-item-card,
.overview-email-card,
.review-item-card {
  box-shadow: none;
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.item-card:hover,
.overview-item-card:hover,
.overview-email-card:hover,
.review-item-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--line-strong);
}

.card-header-row { margin-bottom: 10px; align-items: flex-start; }
.card-title { font-size: 14.5px; letter-spacing: -0.01em; line-height: 1.4; }

.badge-kind {
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.card-body-text p { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 0 0 10px; }

.item-evidence-quote {
  border-left: 2px solid var(--accent-border);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  margin: 0 0 14px;
  padding-left: 12px;
}

/* Footer row becomes a real footer: hairline, flatter meta, quieter controls */
.card-footer-row {
  border-top: 1px solid var(--line-subtle);
  padding-top: 12px;
  margin-top: 2px;
  align-items: center;
}
.meta-tag {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 11.5px;
  color: var(--muted);
}
.meta-tag-label { color: var(--muted-dark); }
.meta-tag.meta-overdue, .meta-tag.meta-overdue .meta-tag-label { color: #fca5a5; }
.meta-link { font-size: 11.5px; }
.meta-checkbox-label { font-size: 11.5px; color: var(--muted); cursor: pointer; }
.meta-checkbox-label input { accent-color: var(--accent); }

/* Filter bar */
.filter-bar { padding: 14px 18px; gap: 12px 14px; }
.filter-label { font-size: 11px; letter-spacing: 0.04em; color: var(--muted-dark); text-transform: none; }
.filter-input {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 10px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease;
}
.filter-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-surface); }
.filter-input::placeholder { color: var(--muted-dark); }
.filter-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Bulk toolbar */
.bulk-actions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel-card);
}
.bulk-actions-hint { font-size: 12.5px; color: var(--muted); }

/* Review cards */
.review-meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.review-meta-line strong { color: var(--muted-dark); font-weight: 500; }
.candidate-consensus-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: grid;
  gap: 6px;
}
.candidate-row { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.candidate-row strong { color: var(--muted-dark); font-weight: 500; }
.candidate-cat { color: var(--text-body); }
.email-snippet-body { font-size: 13px; line-height: 1.65; color: var(--muted); margin: 0 0 14px; }

/* Skeleton stack used by async lists */
.skeleton-stack { display: grid; gap: 10px; }

/* Command palette */
.command-palette { background: rgba(9, 9, 11, 0.72); }
.command-palette-content { width: min(620px, 92vw); border-color: var(--line-strong); box-shadow: none; }
.command-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-dark);
}
.command-search { padding: 0; font-size: 15px; }
.command-search-row .kbd { margin-left: auto; }
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 2px 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted);
  background: var(--panel-card);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.command-sections { gap: 24px; padding: 16px 18px 18px; min-height: 0; }
.command-section-title { font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted-dark); }
.command-hint {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: transparent;
}
.command-hint span { display: inline-flex; align-items: center; gap: 5px; }
.command-selections:empty { display: none; }
.command-selections { padding: 10px 18px 0; display: flex; flex-wrap: wrap; gap: 6px; }

/* Long email bodies: four lines, expandable on demand */
.email-snippet-body.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -6px 0 14px;
  padding: 4px 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent-text);
  background: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}
.link-btn:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Flatter source links inside card footers */
.meta-link {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.meta-link:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

.command-search:focus-visible { outline: none; }
.command-search-row:focus-within { border-bottom-color: var(--line-strong); }
#cmd-actions-container, #cmd-filters-container { display: flex; flex-direction: column; gap: 2px; }
#cmd-actions-container .custom-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-body);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
#cmd-actions-container .custom-select-item:hover,
#cmd-actions-container .custom-select-item:focus-visible { background: var(--panel-hover); color: var(--text); }

/* --------------------------------------------------------------------------
   PHASE 9: Settings + dashboard defects
   -------------------------------------------------------------------------- */

/* .form label uppercased every nested choice label; keep real labels, not toggles */
.form label.settings-choice,
.form label.settings-choice b,
.form label.settings-choice small,
.form label.notification-setting-row,
.form label.notification-setting-row b,
.form label.notification-setting-row small {
  text-transform: none;
  letter-spacing: 0;
}
.settings-choice b { font-size: 13.5px; font-weight: 600; }
.settings-choice small { font-size: 12.5px; }

/* Stat cards: wrap instead of squeezing five columns into any width */
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat-label { font-size: 12.5px; }
.stat-foot { font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }

/* Cards inside a panel were boxes inside boxes — make them rows */
.panel .overview-item-card,
.panel .overview-email-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-subtle);
}
.panel .overview-item-card:hover,
.panel .overview-email-card:hover { background: transparent; border-color: var(--line-subtle); }
.panel .overview-item-card:last-child,
.panel .overview-email-card:last-child { border-bottom: 0; padding-bottom: 0; }

/* Kind chips read as words, not all-caps stamps */
.badge-kind { text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 600; }

/* Settings: one calm column instead of a two-column grid with a hole in it */
.settings-page-grid { grid-template-columns: minmax(0, 860px); gap: 16px; }
.settings-page-grid .settings-card { padding: 22px 24px; }
.settings-form > .btn,
.settings-form > button[type="submit"] { align-self: flex-start; }
.notification-category-heading {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted-dark);
}

/* Sample-output disclosure on the landing demo */
.lm-demo-note{margin:0 0 .6rem;font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;color:#8b98a8}
