/* ── CSS variables — light mode (default) ────────────────────────────────── */
:root {
  --color-bg:              #EFE6D2;
  --color-surface-1:       #E5DBC4;
  --color-surface-2:       #F5EDD9;
  --color-text-primary:    #1A1410;
  --color-text-secondary:  #4A4035;
  --color-text-muted:      #6B5F4F;
  --color-text-faint:      #8A7A5E;
  --color-accent:          #8B2C2C;
  --color-accent-text-on:  #EFE6D2;
  --color-accent-bg-faint: rgba(139, 44, 44, 0.04);
  --color-border:          #D4C9B0;
  --color-border-light:    #E5DBC4;
  --color-gold:            #C9A235;
  --color-google-blue:     #4285F4;
  --color-stack-applied:   #E8A89A;
  --color-stack-closed:    #B8AC9D;

  --font-heading: 'Newsreader', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
}

/* ── CSS variables — dark mode ───────────────────────────────────────────── */
[data-theme="dark"] {
  --color-bg:              #1A1612;
  --color-surface-1:       #241D16;
  --color-surface-2:       #2D251C;
  --color-text-primary:    #EFE6D2;
  --color-text-secondary:  #D4C9B0;
  --color-text-muted:      #8A7E68;
  --color-text-faint:      #6B5F4F;
  --color-accent:          #B23A35;
  --color-accent-text-on:  #EFE6D2;
  --color-accent-bg-faint: rgba(178, 58, 53, 0.06);
  --color-border:          #3A2F23;
  --color-border-light:    #2D251C;
  --color-gold:            #D4A547;
  --color-google-blue:     #4285F4;
  --color-stack-applied:   #8B4843;
  --color-stack-closed:    #4A3F33;
}

/* ── Global theme crossfade ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition:
    background-color 200ms ease,
    color 200ms ease,
    border-color 200ms ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ── Base ────────────────────────────────────────────────────────────────── */
html {
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background: var(--color-bg);
}

h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}

h3 {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text-primary);
}

p {
  color: var(--color-text-secondary);
  line-height: 1.6;
}

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

a:hover {
  opacity: 0.8;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: opacity 120ms ease, background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.btn-primary {
  font-family: var(--font-heading);
  background: var(--color-accent);
  color: var(--color-accent-text-on);
  border-color: var(--color-accent);
}

.btn-primary:hover {
  opacity: 0.85;
  color: var(--color-accent-text-on);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  font-family: var(--font-body);
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px;
}

.btn-secondary:hover {
  background: var(--color-surface-1);
  color: var(--color-text-primary);
}

.btn-ghost {
  font-family: var(--font-heading);
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
  font-size: 13px;
  padding: 9px 16px;
}

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

/* ── Inputs ──────────────────────────────────────────────────────────────── */
input[type="email"],
input[type="text"],
textarea {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.65;
  padding: 14px 16px;
  outline: none;
  transition: border-color 120ms ease;
}

input[type="email"]::placeholder,
input[type="text"]::placeholder,
textarea::placeholder {
  color: var(--color-text-faint);
}

input[type="email"]:focus,
input[type="text"]:focus,
textarea:focus {
  border-color: var(--color-accent);
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 20px 24px;
}

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

.nav-brand {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-brand:hover {
  opacity: 1;
  color: var(--color-text-primary);
}

.nav-brand__dot {
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ── Page layout ─────────────────────────────────────────────────────────── */
.dash-stat--accent { border-color: var(--color-accent); }
.dash-stat--accent .dash-stat__num { color: var(--color-accent); }

.app-table--clean tbody tr td { padding-top: 18px; padding-bottom: 18px; }
.app-table--clean tbody tr { border-bottom: 1px solid var(--color-border-light); }
.app-table--clean tbody tr:hover { background: var(--color-surface-1); }

.page--wide { max-width: 1280px !important; }

.dashboard-page .page-header { align-items: flex-end; }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--color-border);
}
.dash-stat {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 18px 20px;
}
.dash-stat__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: 10px;
}
.dash-stat__num {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  line-height: 1;
}
.dash-stat__hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 8px;
}
@media (max-width: 900px) { .dash-stats { grid-template-columns: repeat(2, 1fr); } }

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 32px;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-secondary { color: var(--color-text-secondary); }
.text-muted     { color: var(--color-text-muted); }
.text-faint     { color: var(--color-text-faint); }
.text-accent    { color: var(--color-accent); }

/* ── Upload page ─────────────────────────────────────────────────────────── */
.upload-page {
  max-width: 560px;
}

.upload-intro {
  margin-top: 12px;
  color: var(--color-text-secondary);
}

.existing-resume {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 12px 16px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.existing-resume__label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.existing-resume__info {
  color: var(--color-text-secondary);
  font-size: 13px;
}

.form-error {
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--color-accent-bg-faint);
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  color: var(--color-accent);
  font-size: 12px;
}

.upload-form {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.file-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-field__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.file-field__input {
  width: 100%;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 120ms ease;
}

.file-field__input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.file-field__hint {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ── Tailor form ─────────────────────────────────────────────────────────── */
.tailor-form {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.jd-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.jd-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.jd-input {
  min-height: 280px;
  resize: vertical;
}

.char-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-faint);
  text-align: right;
}

/* ── Diff view ───────────────────────────────────────────────────────────── */
.diff-page {
  max-width: 1100px;
}

.diff-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
  align-items: start;
}

@media (max-width: 1023px) {
  .diff-layout {
    grid-template-columns: 1fr;
  }
}

.diff-panel {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 24px;
}

.diff-panel--tailored {
  border-color: var(--color-accent);
  background: var(--color-surface-1);
  background-color: color-mix(in srgb, var(--color-accent-bg-faint), var(--color-surface-1));
}

.diff-panel__label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.diff-panel__label--with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Page count beside the "TAILORED" label. Same tracked-uppercase look as
   the label, but in JetBrains Mono because it's a scannable number, and
   sitting inline to the right of the label text. */
.diff-panel__pagecount {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-left: 12px;
  margin-right: auto;
}

.diff-panel__edit {
  font-size: 14px;
  line-height: 1;
  color: var(--color-text-faint);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 3px;
  transition: color 200ms, background 200ms;
}

.diff-panel__edit:hover {
  color: var(--color-accent);
  background: var(--color-surface-2);
}

.edited-marker {
  font-family: var(--font-body);
  font-size: 11px;
  font-style: italic;
  color: var(--color-text-faint);
  margin-left: 6px;
  letter-spacing: 0.02em;
}

.diff-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 32px;
}

/* ── Resume rendering inside panels ──────────────────────────────────────── */
.resume-header {
  margin-bottom: 4px;
}

.resume-header-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 6px;
  line-height: 1.2;
}

.resume-header-contact {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.resume-section {
  margin-top: 0;
}

.resume-section-heading {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-top: 24px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.3;
}

.resume-entry {
  margin-bottom: 14px;
}

.resume-edu-entry {
  margin-bottom: 8px;
}

.resume-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.resume-entry-meta {
  font-size: 14px;
  font-weight: 500;
}

.resume-entry-title {
  font-weight: 400;
  font-style: italic;
}

.resume-entry-dates {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.resume-bullets {
  list-style: disc;
  padding-left: 20px;
  margin-top: 6px;
}

.resume-bullets li {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 3px;
}

.resume-summary-text {
  font-size: 13px;
  line-height: 1.6;
}

.resume-skills-text {
  font-size: 13px;
  line-height: 1.6;
}

.resume-project-entry {
  margin-bottom: 12px;
}

.resume-project-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

/* Original panel: dim body text, headings stay primary */
.diff-panel--original .resume-entry-meta,
.diff-panel--original .resume-summary-text,
.diff-panel--original .resume-skills-text,
.diff-panel--original .resume-project-name,
.diff-panel--original .resume-bullets li,
.diff-panel--original .resume-header-contact {
  color: var(--color-text-muted);
}

/* Tailored panel: full-brightness body text */
.diff-panel--tailored .resume-entry-meta,
.diff-panel--tailored .resume-summary-text,
.diff-panel--tailored .resume-skills-text,
.diff-panel--tailored .resume-project-name,
.diff-panel--tailored .resume-bullets li {
  color: var(--color-text-primary);
}

/* ── Changed-bullet highlight ────────────────────────────────────────────── */
.changed-bullet {
  border-left: 3px solid var(--color-accent);
  padding-left: 8px;
  margin-left: -11px;
  list-style-position: inside;
}

p.changed-bullet {
  margin-left: 0;
  list-style-position: unset;
}

/* Inline reason below each changed bullet */
.bullet-reason {
  display: block;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 11px;
  color: var(--color-text-faint);
  margin-top: 4px;
  line-height: 1.5;
}

/* Asterisk footnote */
.diff-footnote {
  margin-top: 16px;
  font-size: 11px;
  color: var(--color-text-faint);
  font-family: var(--font-body);
}

/* ── Diff tooltip ────────────────────────────────────────────────────────── */
#diff-tooltip {
  position: fixed;
  max-width: 280px;
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  display: none;
  z-index: 9999;
}

@media (max-width: 767px) {
  #diff-tooltip {
    left: 12px !important;
    right: 12px !important;
    max-width: none !important;
  }
}

/* ── History page ────────────────────────────────────────────────────────── */
.history-page {
  padding-top: 48px;
}

.history-list {
  margin-top: 32px;
  border-top: 1px solid var(--color-border);
}

/* Legacy alias — kept for the retired /history template */
.history-empty,
.empty-state {
  margin-top: 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.history-empty p,
.empty-state__line {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 18px;
  color: var(--color-text-muted);
  margin: 0;
  max-width: 480px;
  line-height: 1.5;
}

.empty-state__cta { display: inline-block; }

.history-row {
  display: grid;
  grid-template-columns: 110px 1fr 100px auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  transition: background 120ms ease;
}

.history-row:hover {
  background: var(--color-surface-1);
}

.history-row__date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.history-row__snippet {
  font-size: 13px;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.history-row__changes {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  text-align: right;
}

.history-row__count {
  font-family: var(--font-mono);
}

.history-row__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.history-row__action {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 4px 10px;
  transition: color 120ms ease, border-color 120ms ease;
}

.history-row__action:hover {
  color: var(--color-text-primary);
  border-color: var(--color-text-primary);
}

@media (max-width: 767px) {
  .history-page {
    padding-left: 18px;
    padding-right: 18px;
  }

  .history-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0;
    row-gap: 6px;
    padding: 16px;
  }

  .history-row__date {
    order: 1;
    flex: 0 0 auto;
  }

  .history-row__changes {
    order: 2;
    flex: 0 0 auto;
    margin-left: auto;
    text-align: right;
  }

  .history-row__snippet {
    order: 3;
    flex: 0 0 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .history-row__actions {
    order: 4;
    flex: 0 0 100%;
  }
}

/* ── Project links (diff view) ───────────────────────────────────────────── */
.project-links {
  display: inline;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.project-link {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-decoration-color: var(--color-border);
  text-underline-offset: 2px;
}

.project-link:hover {
  color: var(--color-text-primary);
  opacity: 1;
}

/* ── Inspection pre ──────────────────────────────────────────────────────── */
.inspection-pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 960px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

/* ── Status pills ────────────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 3px;
  border: 1px solid transparent;
  line-height: 1.4;
  cursor: default;
}

.pill--drafting {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-muted);
}

.pill--applied {
  background: var(--color-accent-bg-faint);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.pill--interviewing {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-text-on);
}

.pill--offer {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: #1A1410;
}

.pill--closed {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-faint);
}

/* Clickable pill (dashboard status change) */
.pill--clickable {
  cursor: pointer;
  transition: opacity 120ms ease;
}
.pill--clickable:hover { opacity: 0.8; }

/* ── Fit pill ────────────────────────────────────────────────────────────── */
.fit-pill {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ── Stack bar ───────────────────────────────────────────────────────────── */
.stack-bar {
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--color-border-light);
}

.stack-bar__seg {
  flex-shrink: 0;
}

.stack-bar__seg--drafting     { background: var(--color-border); }
.stack-bar__seg--applied      { background: var(--color-stack-applied); }
.stack-bar__seg--interviewing { background: var(--color-accent); }
.stack-bar__seg--offer        { background: var(--color-gold); }
.stack-bar__seg--closed       { background: var(--color-stack-closed); }

.stack-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.stack-legend__item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.stack-legend__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Theme toggle ────────────────────────────────────────────────────────── */
.theme-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  line-height: 1;
  transition: background-color 120ms ease, border-color 120ms ease;
  flex-shrink: 0;
}

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

.theme-toggle__sun,
.theme-toggle__moon {
  font-size: 14px;
  line-height: 1;
  color: var(--color-text-secondary);
}
/* Light mode default — show moon ("switch to dark"), hide sun */
.theme-toggle__sun  { display: none; }
.theme-toggle__moon { display: inline; }
[data-theme="dark"] .theme-toggle__sun  { display: inline; }
[data-theme="dark"] .theme-toggle__moon { display: none; }

/* ── Animated 2019 wordmark ──────────────────────────────────────────────── */
@keyframes pulse-2019 {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1;    }
}

@keyframes pulse-2019-slow {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 1;    }
}

.wordmark {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.0;
  color: var(--color-text-primary);
  display: inline-block;
}

.h2019 {
  display: inline-block;
  animation: pulse-2019 1.6s ease-in-out infinite;
}

/* Per-digit staggered pulse, DESIGN_v2.md §4. Position-based selectors
   restate the full `animation` shorthand per digit so each rule is
   self-contained — no shorthand-vs-longhand cascade dependency, and no
   reliance on .a/.b/.c/.d modifier classes being intact. */
.wordmark .h2019:nth-child(1) { animation: pulse-2019 1.6s ease-in-out 0s    infinite; }
.wordmark .h2019:nth-child(2) { animation: pulse-2019 1.6s ease-in-out 0.18s infinite; }
.wordmark .h2019:nth-child(3) { animation: pulse-2019 1.6s ease-in-out 0.36s infinite; }
.wordmark .h2019:nth-child(4) { animation: pulse-2019 1.6s ease-in-out 0.54s infinite; }

/* Landing hero: slower, quieter */
.h2019--slow {
  animation-name: pulse-2019-slow;
  animation-duration: 2.4s;
}

/* ── Google sign-in button ───────────────────────────────────────────────── */
.btn-google {
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.btn-google:hover {
  background: var(--color-surface-1);
  border-color: var(--color-text-muted);
  color: var(--color-text-primary);
  opacity: 1;
}

.btn-google__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.g-letter {
  color: var(--color-google-blue);
  font-weight: 700;
  font-size: 14px;
}

/* ── Page subtitle (italic Newsreader under page titles) ─────────────────── */
.page-subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Landing ─────────────────────────────────────────────────────────────── */
.landing {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

.landing-hero {
  text-align: center;
  padding: 80px 0 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-hero__wordmark {
  font-size: 76px;
  letter-spacing: -0.04em;
  margin-bottom: 28px;
}

.landing-hero__headline {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  max-width: 560px;
  margin: 0 0 22px;
}

.landing-hero__accent {
  font-style: italic;
  color: var(--color-accent);
  font-weight: 500;
}

.landing-hero__sub {
  font-family: var(--font-heading);
  font-size: 17px;
  line-height: 1.55;
  color: var(--color-text-secondary);
  max-width: 460px;
  margin: 0 0 32px;
}

.landing-hero__ctas {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 16px;
}

.landing-hero__cta-primary {
  font-size: 14px;
  padding: 12px 22px;
}

.landing-hero__microcopy {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
  margin-top: 6px;
}

.landing-rule {
  border: none;
  height: 1px;
  background: var(--color-border-light);
  margin: 28px 0 56px;
}

/* ── Landing pillars ─────────────────────────────────────────────────────── */
.landing-pillars {
  text-align: center;
  padding-bottom: 64px;
}

.landing-pillars__title {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.landing-pillars__sub {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 16px;
  color: var(--color-text-faint);
  margin: 0 auto 36px;
}

.landing-pillars__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  text-align: left;
  max-width: 760px;
  margin: 0 auto;
}

.landing-pillar__name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 10px;
}

.landing-pillar__body {
  font-size: 17px;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin: 0;
}

/* ── Landing brand story ─────────────────────────────────────────────────── */
.landing-story {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 0 80px;
}

.landing-story__rule {
  border: none;
  height: 1px;
  width: 24px;
  background: var(--color-text-faint);
  margin: 0;
}

.landing-story__line {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 13px;
  color: var(--color-text-faint);
  text-align: center;
  margin: 0;
  max-width: 520px;
}

@media (max-width: 720px) {
  .landing-hero__wordmark { font-size: 60px; }
  .landing-hero__headline { font-size: 34px; }
  .landing-hero__sub      { font-size: 15px; }
  .landing-pillars__title { font-size: 28px; }
  .landing-pillar__name   { font-size: 19px; }
  .landing-pillar__body   { font-size: 16px; line-height: 1.55; }
}

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-page {
  display: flex;
  justify-content: center;
  padding-top: 80px;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.form-error-inline {
  font-size: 12px;
  color: var(--color-accent);
  margin-bottom: 8px;
  display: none;
}

.login-success {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 15px;
  color: var(--color-text-primary);
  line-height: 1.5;
}

.login-success .sent-to {
  color: var(--color-text-secondary);
}

/* ── Tailor form ─────────────────────────────────────────────────────────── */
.tailor-form form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Nav page indicator ──────────────────────────────────────────────────── */
.nav-link {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  transition: color 120ms ease;
}
.nav-link:hover {
  color: var(--color-text-primary);
}
.nav-link--active {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* ── Field label (11px tracked uppercase) ────────────────────────────────── */
.field-label {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

/* ── Form group ──────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
}

/* ── Credit badge ────────────────────────────────────────────────────────── */
.credit-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: 6px 10px;
  border-radius: 3px;
}
.credit-badge__num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
}

/* ── Resume picker ───────────────────────────────────────────────────────── */
.resume-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.resume-picker-card {
  display: block;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  padding: 14px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.resume-picker-card:hover {
  background: var(--color-surface-2);
}
.resume-picker-card--selected {
  border-color: var(--color-accent);
  background: var(--color-accent-bg-faint);
}
.resume-picker-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.resume-picker-card__name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-primary);
}
.resume-picker-card__count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-faint);
  margin-top: 4px;
}

/* ── Fit recap (top of fit screen) ───────────────────────────────────────── */
.fit-recap {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-light);
  padding: 12px 16px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 16px;
}
.fit-recap__sep { color: var(--color-text-faint); }
.fit-recap__item--faint { color: var(--color-text-faint); font-style: italic; }

/* ── Fit verdict block ───────────────────────────────────────────────────── */
.fit-verdict-block {
  text-align: center;
  padding: 56px 0 32px;
}
.fit-verdict-word {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 44px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}
.fit-verdict-word--fit     { color: var(--color-text-primary); }
.fit-verdict-word--stretch { color: var(--color-text-secondary); }
.fit-verdict-word--pass    { color: var(--color-accent); }

/* ── Fit reasons ─────────────────────────────────────────────────────────── */
.fit-reasons {
  max-width: 540px;
  margin: 16px auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fit-reason-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-secondary);
}
.fit-reason-marker {
  font-family: var(--font-mono);
  font-weight: 500;
  width: 14px;
  flex-shrink: 0;
}
.fit-reason-row--hard .fit-reason-marker { color: var(--color-accent); }
.fit-reason-row--soft .fit-reason-marker { color: var(--color-text-muted); }

/* ── Fit actions row ─────────────────────────────────────────────────────── */
.fit-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  gap: 12px;
}

/* ── Loading splash (during tailor + fit-check) ──────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 999;
  align-items: center;
  justify-content: center;
  /* default hidden — JS adds .loading-overlay--visible to show */
  display: none;
}
.loading-overlay--visible { display: flex; }

.splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.splash-mark {
  display: flex;
  gap: 28px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 120px;
  line-height: 1.0;
  letter-spacing: -6px;
  color: var(--color-text-primary);
}
@media (max-width: 720px) {
  .splash-mark { font-size: 84px; gap: 18px; }
}

.splash-msg {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 16px;
  color: var(--color-text-muted);
  transition: opacity 200ms ease;
}
.splash-msg--swap,
.loading-overlay__status--swap { opacity: 0; }

.splash-bar {
  position: relative;
  width: 220px;
  height: 3px;
  background: var(--color-border);
  overflow: hidden;
}
.splash-bar__fill {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 0;
  background: var(--color-accent);
  animation: splash-progress var(--loading-fill-duration, 14s) ease-out forwards;
}
@keyframes splash-progress {
  from { width: 0%; }
  to   { width: 75%; }
}

/* Inline button spinner — used for any Sonnet/Haiku call that isn't tailor
   or fit-check (cover letter, Q&A, follow-up, resume parse). The splash
   overlay is reserved for those two; everywhere else, the button itself
   reports progress. */
.btn--loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  opacity: 0.85;
}
.btn-spinner {
  display: inline-block;
  animation: btn-spinner-rotate 0.9s linear infinite;
}
.btn-spinner__label { display: inline-block; }
@keyframes btn-spinner-rotate {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation: none; }
}

/* ── Status pills ────────────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 5px 11px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.pill--drafting {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.pill--applied {
  background: var(--color-accent-bg-faint);
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
}
.pill--interviewing {
  background: var(--color-accent);
  color: var(--color-accent-text-on);
}
.pill--offer {
  background: var(--color-gold);
  color: #1A1410;
}
.pill--closed {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-faint);
}

/* ── Fit pill (italic Newsreader, not actually a pill) ───────────────────── */
.fit-pill {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 13px;
  color: var(--color-text-muted);
}
.fit-pill--sm { font-size: 12px; }

/* ── Workspace header ────────────────────────────────────────────────────── */
.workspace-page { max-width: 1100px; }
.workspace-actionbar {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  position: relative;
}
.workspace-actionbar__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 6px;
  display: none;
  flex-direction: column;
  min-width: 180px;
  z-index: 10;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.workspace-actionbar__menu--open { display: flex; }
.workspace-actionbar__opt {
  padding: 8px 12px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--color-text-primary);
  text-decoration: none;
  text-align: left;
}
.workspace-actionbar__opt:hover { background: var(--color-surface-1); }
.workspace-actionbar__opt--danger { color: var(--color-accent); }
.workspace-header { padding-bottom: 18px; }
.workspace-header__back {
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: none;
  margin-bottom: 12px;
  display: inline-block;
}
.workspace-header__back:hover { color: var(--color-text-primary); }
.workspace-header__role {
  font-size: 28px;
  margin-top: 6px;
}
.workspace-header__meta { margin-top: 6px; }
.workspace-header__pills {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── Workspace sections ──────────────────────────────────────────────────── */
.workspace-section {
  border-top: 1px solid var(--color-border-light);
  padding-top: 28px;
  margin-top: 36px;
}
.workspace-section__header {
  margin-bottom: 8px;
}
.workspace-section__header h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

/* ── Diff layout ─────────────────────────────────────────────────────────── */
.diff-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.diff-panel {
  border-radius: 4px;
  padding: 20px;
}
.diff-panel--original {
  background: var(--color-surface-1);
  color: var(--color-text-muted);
}
.diff-panel--tailored {
  background: var(--color-accent-bg-faint);
  border: 1px solid var(--color-accent);
}
.diff-panel__label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}
.diff-panel--tailored .diff-panel__label { color: var(--color-accent); }

/* ── Diff bullet (changed) ───────────────────────────────────────────────── */
.changed-bullet {
  border-left: 3px solid var(--color-accent);
  padding: 6px 10px;
  margin: 4px 0;
  list-style: none;
}
.changed-bullet .bullet-reason {
  display: block;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 11px;
  color: var(--color-text-faint);
  margin-top: 6px;
  line-height: 1.5;
}
.diff-footnote {
  font-size: 11px;
  color: var(--color-text-faint);
}
.text-accent { color: var(--color-accent); }

/* ── Resume rendering inside diff panels ─────────────────────────────────── */
.resume-header { margin-bottom: 14px; }
.resume-header-name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-primary);
}
.resume-header-contact {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.resume-header-contact a { color: var(--color-text-muted); text-decoration: underline; }
.resume-section { margin-top: 16px; }
.resume-section-heading {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: 4px;
}
.resume-summary-text { font-size: 12px; line-height: 1.55; }
.resume-entry, .resume-edu-entry, .resume-project-entry { margin-bottom: 10px; }
.resume-entry-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
}
.resume-entry-meta { color: var(--color-text-primary); }
.resume-entry-title { font-weight: 400; color: var(--color-text-secondary); }
.resume-entry-dates {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-faint);
  font-weight: 400;
}
.resume-bullets {
  list-style: disc;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--color-text-secondary);
}
.resume-bullets li { margin: 2px 0; }
.resume-skills-text { font-size: 12px; color: var(--color-text-secondary); }
.resume-project-name {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}
.project-links { font-family: var(--font-body); font-weight: 400; font-size: 11px; }
.project-link { color: var(--color-text-muted); text-decoration: underline; }

/* ── Cover letter text block ─────────────────────────────────────────────── */
.cover-letter-text {
  white-space: pre-wrap;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-light);
  border-radius: 4px;
  padding: 18px 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* ── Q&A pairs ───────────────────────────────────────────────────────────── */
.qa-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.qa-pair {
  background: var(--color-surface-1);
  border-left: 2px solid var(--color-border);
  padding: 12px 16px;
  border-radius: 0 4px 4px 0;
}
.qa-pair__question {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 14px;
  color: var(--color-text-primary);
  margin-bottom: 10px;
}
.qa-pair__answer {
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
}

/* ── Q&A expander (details/summary) ──────────────────────────────────────── */
.qa-expander summary { display: inline-block; }
.qa-expander summary::-webkit-details-marker { display: none; }

/* ── Workspace actions row ───────────────────────────────────────────────── */
.workspace-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ── Status timeline ─────────────────────────────────────────────────────── */
.timeline {
  border-left: 2px solid var(--color-border);
  padding: 4px 0 4px 16px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.timeline-entry {
  display: flex;
  gap: 12px;
  font-size: 12px;
}
.timeline-entry__status {
  color: var(--color-text-primary);
  font-weight: 500;
  min-width: 100px;
}
.timeline-entry__date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-faint);
}

/* ── Status change dropdown (workspace) ──────────────────────────────────── */
.status-change-wrap { position: relative; display: inline-block; }
.status-change {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 10;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  min-width: 180px;
  padding: 6px 0;
  display: none;
}
.status-change--open { display: block; }
.status-change form { margin: 0; padding: 0; }
.status-change__opt {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-primary);
  cursor: pointer;
}
.status-change__opt:hover { background: var(--color-surface-1); }

/* ── Follow-up emails ────────────────────────────────────────────────────── */
.follow-up-list { display: flex; flex-direction: column; gap: 16px; }
.follow-up-item {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-light);
  border-radius: 4px;
  padding: 16px 18px;
}
.follow-up-item--sent { opacity: 0.65; }
.follow-up-item__content {
  white-space: pre-wrap;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0;
}
.follow-up-item__sent {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 12px;
  color: var(--color-text-faint);
  margin-top: 8px;
}

/* ── Stack bar (dashboard) ───────────────────────────────────────────────── */
.stack-bar {
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--color-border-light);
}
.stack-bar__seg { height: 100%; }
.stack-bar__seg--drafting     { background: #D4C9B0; }
.stack-bar__seg--applied      { background: var(--color-stack-applied); }
.stack-bar__seg--interviewing { background: var(--color-accent); }
.stack-bar__seg--offer        { background: var(--color-gold); }
.stack-bar__seg--closed       { background: var(--color-stack-closed); }

[data-theme="dark"] .stack-bar__seg--drafting { background: #3A2F23; }

.stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--color-text-muted);
}
.stack-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.stack-legend__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.stack-legend__dot--drafting     { background: #D4C9B0; }
.stack-legend__dot--applied      { background: var(--color-stack-applied); }
.stack-legend__dot--interviewing { background: var(--color-accent); }
.stack-legend__dot--offer        { background: var(--color-gold); }
.stack-legend__dot--closed       { background: var(--color-stack-closed); }
[data-theme="dark"] .stack-legend__dot--drafting { background: #3A2F23; }

/* ── Dashboard table ─────────────────────────────────────────────────────── */
.app-table {
  width: 100%;
  border-collapse: collapse;
}
.app-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  vertical-align: bottom;
}
.app-row td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
}
.app-row:hover td { background: var(--color-surface-1); }
.app-row--closed { opacity: 0.55; }
.app-row__company {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary);
}
.app-row__role {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.app-row__cell--date { text-align: right; white-space: nowrap; }
.stale-hint {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 11px;
  color: var(--color-accent);
  margin-top: 2px;
}

/* ── Status popover (dashboard rows) ─────────────────────────────────────── */
.status-popover-wrap { position: relative; display: inline-block; }
.status-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 10;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  min-width: 160px;
  padding: 6px 0;
  display: none;
}
.status-popover--open { display: block; }
.status-popover form { margin: 0; padding: 0; }
.status-popover__btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-primary);
  cursor: pointer;
}
.status-popover__btn:hover { background: var(--color-surface-1); }

/* ── Mobile (narrow viewport) ────────────────────────────────────────────── */
@media (max-width: 720px) {
  .diff-layout { grid-template-columns: 1fr; }
  .resume-picker { grid-template-columns: 1fr 1fr; }
  .app-table th:nth-child(3),
  .app-table td:nth-child(3) { display: none; }
  .pack-grid { grid-template-columns: 1fr; }
}

/* ── Billing page ────────────────────────────────────────────────────────── */
.credit-badge--lg {
  padding: 10px 16px;
  font-size: 13px;
}
.credit-badge--lg .credit-badge__num {
  font-size: 18px;
}

.billing-flash {
  margin: 20px 0 0;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-body);
  border: 1px solid var(--color-border);
  background: var(--color-surface-1);
  color: var(--color-text-primary);
}
.billing-flash--success {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}
.pack-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pack-card--hunting {
  border-color: var(--color-accent);
  background: var(--color-surface-2);
}
.pack-card__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.pack-card__credits {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.pack-card__credits-num {
  font-family: var(--font-heading);
  font-size: 44px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1;
}
.pack-card__credits-unit {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 14px;
  color: var(--color-text-muted);
}
.pack-card__price {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--color-text-primary);
  margin-top: 4px;
}
.pack-card__per {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 12px;
  color: var(--color-text-faint);
}
.pack-card__buy {
  margin-top: 14px;
  align-self: stretch;
}
.pack-card__buy:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.billing-fineprint {
  margin-top: 16px;
  font-size: 12px;
}

.tx-table {
  width: 100%;
  border-collapse: collapse;
}
.tx-table th,
.tx-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border-light);
}
.tx-table__date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-faint);
  white-space: nowrap;
}
.tx-table__reason {
  font-size: 12px;
  color: var(--color-text-secondary);
}
.tx-table__delta {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
}
.tx-table__delta--plus { color: var(--color-accent); }
.tx-table__delta--minus { color: var(--color-text-muted); }

/* ── Settings page ───────────────────────────────────────────────────────── */
.settings-page { max-width: 720px; }

.settings-saved {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 13px;
  color: var(--color-accent);
}

.settings-form { margin-top: 24px; }

.settings-section {
  padding: 28px 0;
  border-top: 1px solid var(--color-border-light);
}
.settings-section:first-of-type {
  border-top: none;
  padding-top: 12px;
}
.settings-section h2 {
  margin-bottom: 18px;
}

.settings-select {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.65;
  padding: 14px 16px;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.settings-select:focus { border-color: var(--color-accent); }

.settings-hint {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 13px;
  color: var(--color-text-faint);
}

.theme-radio-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.theme-radio {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.theme-radio:hover {
  background: var(--color-surface-2);
}
.theme-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.theme-radio__label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}
.theme-radio--selected {
  border-color: var(--color-accent);
  background: var(--color-surface-2);
}
.theme-radio--selected .theme-radio__label {
  color: var(--color-text-primary);
}

.settings-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.settings-checkbox input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent);
  cursor: pointer;
}
.settings-checkbox__label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-checkbox__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
}
.settings-checkbox__hint {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 12px;
  color: var(--color-text-faint);
  line-height: 1.5;
}

.settings-actions {
  margin-top: 32px;
  display: flex;
  justify-content: flex-end;
}

.settings-danger {
  margin-top: 32px;
  padding: 24px 20px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface-1);
}
.settings-danger h2 {
  color: var(--color-accent);
  margin-bottom: 8px;
}
.settings-danger .page-subtitle {
  margin-bottom: 16px;
}

.btn-danger {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
  font-family: var(--font-body);
}
.btn-danger:hover:not(:disabled) {
  background: var(--color-accent);
  color: var(--color-accent-text-on);
  opacity: 1;
}
.btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Error pages ─────────────────────────────────────────────────────────── */
.error-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}

.error-page__inner {
  max-width: 520px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.error-page__title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  margin: 0;
}

.error-page__sub {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text-muted);
  margin: 0;
}

.error-page__detail {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-faint);
  margin: 4px 0 0;
  word-break: break-word;
}

.error-page__detail-disclosure {
  margin-top: 4px;
  max-width: 100%;
}
.error-page__detail-disclosure summary {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-faint);
  cursor: pointer;
}
.error-page__detail-disclosure summary:hover {
  color: var(--color-text-muted);
}
.error-page__detail-disclosure[open] summary {
  margin-bottom: 6px;
}

.error-page__actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Inline field error ──────────────────────────────────────────────────── */
.field-error {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-accent);
  margin-top: 6px;
  line-height: 1.4;
}

input.field--error,
textarea.field--error,
select.field--error {
  border-color: var(--color-accent);
}

/* ── Edit tailored resume page ───────────────────────────────────────────── */
.edit-page { max-width: 880px; }

.edit-disclaimer {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
  margin: 0 0 24px;
}

.edit-form { display: flex; flex-direction: column; gap: 32px; }

.edit-section {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edit-section h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 500;
  margin: 0;
}

.edit-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.edit-grid__full { grid-column: 1 / -1; }

.edit-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edit-entry {
  position: relative;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-light);
  border-radius: 4px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.edit-entry__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--color-text-faint);
  font-size: 18px;
  line-height: 1;
  width: 24px;
  height: 24px;
  cursor: pointer;
  border-radius: 3px;
  transition: color 200ms, background 200ms;
}

.edit-entry__remove:hover {
  color: var(--color-accent);
  background: var(--color-surface-1);
}

.edit-bullets,
.edit-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.edit-bullet-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.edit-bullet-row textarea {
  flex: 1;
  min-height: 0;
}

.edit-link-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 8px;
  align-items: center;
}

.edit-bullet-row__remove {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-faint);
  font-size: 14px;
  line-height: 1;
  width: 28px;
  height: 28px;
  cursor: pointer;
  border-radius: 3px;
  flex-shrink: 0;
  transition: color 200ms, border-color 200ms;
}

.edit-bullet-row__remove:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.edit-add-btn {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed var(--color-border);
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 3px;
  cursor: pointer;
  transition: color 200ms, border-color 200ms;
}

.edit-add-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.edit-add-btn--small {
  font-size: 10px;
  padding: 6px 10px;
}

.edit-hint {
  font-size: 12px;
  color: var(--color-text-faint);
  margin: 0 0 8px;
}

.edit-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

@media (max-width: 720px) {
  .edit-grid { grid-template-columns: 1fr; }
  .edit-link-row { grid-template-columns: 1fr; }
}

/* ── Modal overlay ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-card {
  background: var(--color-surface-2);
  border-radius: 8px;
  padding: 32px;
  max-width: 480px;
  width: calc(100% - 32px);
}

/* ── Nav hamburger + mobile drawer ───────────────────────────────────────── */
.nav__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--color-text-primary);
  padding: 4px 8px;
  line-height: 1;
}
.nav__mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  padding: 8px 20px;
}
.nav__mobile-menu--open { display: flex; }
.nav__mobile-link {
  color: var(--color-text-primary);
  text-decoration: none;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border-light);
}
.nav__mobile-link:last-child { border-bottom: none; }
.nav__mobile-link:hover { color: var(--color-accent); }

/* done-label-short hidden by default; swapped in at mobile */
.done-label-short { display: none; }

@media (max-width: 720px) {
  .nav-link--desktop { display: none; }
  .nav__hamburger { display: block; }
  .workspace-actionbar { flex-wrap: wrap; gap: 8px; }
  .done-label-long { display: none; }
  .done-label-short { display: inline; }
  .diff-panel__edit {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Legal pages */
.site-footer {
  padding: 32px;
  text-align: center;
}

.site-footer__links {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.site-footer__link {
  color: var(--color-text-muted);
  font-size: 13px;
  text-decoration: none;
}

.site-footer__link:hover {
  color: var(--color-text-primary);
}

.legal-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 0 80px;
}

.legal-page h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0;
}

.legal-page h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  margin-top: 36px;
}

.legal-page p {
  line-height: 1.7;
  margin-bottom: 12px;
  color: var(--color-text-secondary);
}

.legal-page a {
  color: var(--color-accent);
}

.legal-page .legal-page__date {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 36px;
}
