:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #2b2a28;
  --ink-soft: #6b6660;
  --accent: #2f7a5f;
  --accent-soft: #e4f2ec;
  --warn: #b5542a;
  --warn-soft: #fbe9e1;
  --border: #e7e2da;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(43, 42, 40, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

header.top a.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
}

header.top nav a {
  margin-left: 18px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
}

header.top nav a:hover,
header.top nav a.active {
  color: var(--accent);
  font-weight: 600;
}

h1 { font-size: 1.8rem; margin: 0.3em 0 0.2em; }
h2 { font-size: 1.3rem; margin-top: 2em; }
p.lede { color: var(--ink-soft); font-size: 1.05rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 20px;
}

.tool-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(43,42,40,0.1); }
.tool-card .icon { font-size: 1.8rem; }
.tool-card h3 { margin: 0.4em 0 0.3em; }
.tool-card p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: 14px;
  font-size: 0.92rem;
}
label .hint {
  display: block;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-top: 2px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="month"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.98rem;
  font-family: inherit;
  background: #fffdfb;
}
textarea { resize: vertical; min-height: 70px; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #266048; }
.btn-secondary { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--border); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.chip {
  display: inline-block;
  padding: 5px 12px;
  margin: 4px 6px 0 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}
.chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

.entry-block {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 14px;
  position: relative;
}
.entry-block .remove {
  position: absolute;
  top: 10px;
  right: 10px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 560px) {
  .two-col { grid-template-columns: 1fr; }
}

.helper-box {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.88rem;
  color: #235a44;
  margin-top: 8px;
}

.resume-preview {
  background: #fff;
  border: 1px solid var(--border);
  padding: 36px;
  font-family: Georgia, 'Times New Roman', serif;
  color: #1c1c1c;
  min-height: 400px;
}
.resume-preview h1 { font-family: inherit; font-size: 1.6rem; margin: 0; }
.resume-preview .contact { font-size: 0.85rem; color: #444; margin-top: 4px; }
.resume-preview h2.section {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid #333;
  padding-bottom: 3px;
  margin: 1.3em 0 0.5em;
}
.resume-preview .entry-title { font-weight: bold; }
.resume-preview .entry-sub { font-style: italic; font-size: 0.9rem; color: #333; }
.resume-preview ul { margin: 4px 0 0 18px; padding: 0; }
.resume-preview .skills-line { font-size: 0.92rem; }

.two-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 900px) {
  .two-pane { grid-template-columns: 1fr; }
}
.sticky { position: sticky; top: 20px; }

.job-result {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--surface);
}
.job-result h3 { margin: 0 0 2px; font-size: 1.05rem; }
.job-result .meta { color: var(--ink-soft); font-size: 0.88rem; }
.job-result .source-badge {
  display: inline-block;
  font-size: 0.72rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
}

.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.quiz-q { margin-bottom: 22px; }
.quiz-q p.question { font-weight: 600; margin-bottom: 8px; }
.quiz-q label.option {
  display: block;
  font-weight: 400;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  cursor: pointer;
}
.quiz-q label.option:hover { border-color: var(--accent); }
.quiz-q label.option input { margin-right: 8px; }
.quiz-q label.option.correct { border-color: var(--accent); background: var(--accent-soft); }
.quiz-q label.option.incorrect { border-color: var(--warn); background: var(--warn-soft); }
.quiz-q .explain { font-size: 0.85rem; color: var(--ink-soft); margin-top: 6px; display: none; }
.quiz-q .explain.show { display: block; }

.template-card h3 { margin: 0 0 10px; font-size: 1.05rem; }
.template-text {
  white-space: pre-wrap;
  font-family: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.92rem;
  color: var(--ink);
  margin: 0 0 12px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.95rem;
}
.breakdown-row + .breakdown-row { border-top: 1px solid var(--border); }

details.topic {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
details.topic summary { font-weight: 600; cursor: pointer; }
details.topic p, details.topic li { color: var(--ink-soft); font-size: 0.95rem; }

.score-banner {
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  margin-bottom: 20px;
  font-weight: 600;
}

@media print {
  body * { visibility: hidden; }
  #preview, #preview * { visibility: visible; }
  #preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    border: none;
    box-shadow: none;
    padding: 0.4in;
  }
}
