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

:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-alt: #F5F3EE;
  --text: #1C1917;
  --text-secondary: #57534E;
  --muted: #A8A29E;
  --border: #E7E5E0;
  --border-strong: #D6D3CD;
  --accent: #B45309;
  --accent-light: #FFF7ED;
  --accent-border: #FDBA74;
  --green: #16A34A;
  --green-light: #F0FDF4;
  --green-border: #86EFAC;
  --amber: #D97706;
  --amber-light: #FFFBEB;
  --amber-border: #FDE68A;
  --blue: #2563EB;
  --blue-light: #EFF6FF;
  --slate: #64748B;
  --radius: 8px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── BACK NAV ─── */
.back-nav {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 24px 0;
}
.back-nav a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
  font-weight: 400;
}
.back-nav a:hover { color: var(--accent); }

/* ─── HERO ─── */
.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 28px;
  border-bottom: 1px solid var(--border);
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--accent-border);
}
.hero h1 {
  font-family: 'Lora', serif;
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 10px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 520px;
}
.hero-meta {
  display: flex;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.meta-pill {
  font-size: 12px;
  color: var(--slate);
  background: var(--surface-alt);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ─── LAYOUT ─── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ─── TOC ─── */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.toc-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toc-list a {
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.toc-list a:hover { background: var(--surface-alt); color: var(--accent); }
.toc-num {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  min-width: 20px;
}

/* ─── SECTIONS ─── */
section { margin-top: 36px; }
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.section-num {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.section-header h2 {
  font-family: 'Lora', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

/* ─── CALLOUTS ─── */
.callout {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-left: 3px solid;
}
.callout strong { font-weight: 500; }
.callout.warn { background: var(--amber-light); color: #92400E; border-color: var(--amber); }
.callout.info { background: var(--green-light); color: #166534; border-color: var(--green); }
.callout.neutral { background: var(--surface-alt); color: var(--text-secondary); border-color: var(--border-strong); }
.callout-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

/* ─── INTERACTIVE CHECKLIST ─── */
.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.checklist li {
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
  user-select: none;
}
.checklist li:hover { border-color: var(--border-strong); }
.checklist li.checked {
  background: var(--green-light);
  border-color: var(--green-border);
}
.checklist li.checked .check-label {
  text-decoration: line-through;
  color: var(--muted);
}
.checklist li.checked .check-box {
  background: var(--green);
  border-color: var(--green);
}
.checklist li.checked .check-box::after {
  content: '✓';
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.doc-item { flex-direction: column; }
.doc-item .check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.check-box {
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.check-label { color: var(--text); font-weight: 400; }
.check-note { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

/* Progress bar */
.progress-bar {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* ─── STEPS ─── */
.steps { display: flex; flex-direction: column; }
.step {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-content h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 3px;
}
.step-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ─── COVER LETTER ─── */
.cover-letter-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cl-header {
  background: var(--surface-alt);
  padding: 10px 18px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cl-body {
  padding: 24px 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}
.cl-body p { margin-bottom: 14px; }
.cl-body p:last-child { margin-bottom: 0; }

.placeholder {
  background: var(--accent-light);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--accent-border);
}

/* Action buttons */
.cl-actions { display: flex; gap: 6px; }
.cl-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.cl-btn:hover { border-color: var(--border-strong); background: var(--surface-alt); }
.cl-btn-print {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cl-btn-print:hover { opacity: 0.9; background: var(--accent); }

/* Editing state */
.cover-letter-box.editing {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.cover-letter-box.editing .cl-body {
  background: var(--blue-light);
  outline: none;
}

/* Status bar */
.cl-status {
  padding: 10px 18px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
}

/* ─── TIPS ─── */
.tips-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tip-row {
  display: flex;
  gap: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.tip-row:hover { border-color: var(--accent-border); }
.tip-row strong { font-weight: 500; color: var(--accent); }
.tip-icon { font-size: 14px; flex-shrink: 0; margin-top: 2px; }

/* ─── LINKS ─── */
.links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 520px) { .links-grid { grid-template-columns: 1fr; } }

.link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: block;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.link-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.link-card .flag { font-size: 20px; margin-bottom: 6px; display: block; }
.link-card .link-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.link-card .link-url { font-size: 11px; color: var(--blue); word-break: break-all; }

/* ─── BADGES ─── */
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ─── FOOTER ─── */
.footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.footer p { line-height: 1.6; }
.footer-back {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}
.footer-back:hover { opacity: 0.7; }

/* ─── ANIMATIONS ─── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── PRINT ─── */
@media print {
  body { background: #fff; }
  .back-nav, .footer-back { display: none; }
  .reveal { opacity: 1; transform: none; }
  .checklist li { break-inside: avoid; }
}
