:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --surface: #faf8f2;
  --card: #fffdf8;
  --ink: #17201c;
  --muted: #59635d;
  --line: #cbc7bc;
  --line-strong: #9b988e;
  --accent: #9b3d24;
  --accent-dark: #772d1c;
  --success: #2f6b53;
  --success-soft: #e3eee7;
  --danger: #9f3732;
  font-family: "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
a { color: var(--ink); text-underline-offset: 4px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* App shell: sidebar rail + work area (matches the account dashboard) */
.app-shell { display: flex; align-items: stretch; min-height: 100vh; }
.app-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 250px;
  flex: 0 0 250px;
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.pac-brand { display: inline-flex; min-height: 44px; align-items: center; color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 760; letter-spacing: -0.035em; }
.pac-brand span { color: var(--accent); }
.rail-body { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 18px; margin-top: 14px; }
.rail-section { margin: 0; padding: 0 14px 4px; color: var(--muted); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; }
.rail-nav { display: grid; gap: 2px; }
.rail-item {
  display: flex;
  min-height: 40px;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.rail-item:hover:not([aria-current="page"]) { color: var(--ink); background: #efece2; }
.rail-item[aria-current="page"] { background: var(--ink); color: #fffdf8; }
.rail-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.rail-back { color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; }
.rail-back:hover { color: var(--ink); }
.app-main { flex: 1; min-width: 0; padding: 34px clamp(24px, 4vw, 56px) 72px; }

/* Compact page header (no landing-page hero) */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-head .eyebrow { margin-bottom: 8px; }
.page-title { max-width: 720px; margin: 0; font-size: 28px; font-weight: 720; letter-spacing: -0.03em; line-height: 1.15; }
.head-sub { margin: 6px 0 0; max-width: 620px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.credit-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.credit-chip b { color: var(--accent-dark); font-weight: 750; }
.credit-chip a { border-left: 1px solid var(--line); padding-left: 10px; color: var(--accent); font-weight: 750; text-decoration: none; }
.credit-chip a:hover { text-decoration: underline; }

/* Tailor-flow stepper */
.flow-steps { display: flex; flex-wrap: wrap; align-items: center; margin: 0 0 24px; padding: 0; list-style: none; }
.flow-step { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.flow-step .flow-num {
  display: inline-flex;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}
.flow-step em { color: var(--accent); font-style: normal; font-weight: 700; }
.flow-step.is-current { color: var(--ink); }
.flow-step.is-current .flow-num { border-color: var(--accent); background: var(--accent); color: #fffdf8; }
.flow-step.is-done { color: var(--muted); }
.flow-step.is-done .flow-num { border-color: var(--success); background: var(--success); color: #fffdf8; }
.flow-step a { color: inherit; text-decoration: none; }
.flow-step a:hover { color: var(--ink); text-decoration: underline; }
.flow-join { width: 44px; height: 1px; margin: 0 12px; background: var(--line-strong); }

/* Work panels and guided form layout */
.card, .score-card { border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: 0 12px 34px rgba(23, 32, 28, 0.05); padding: clamp(20px, 3vw, 28px); margin-bottom: 18px; }
.work-panel { padding: 24px 26px; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); gap: 26px; align-items: start; }
.side-stack { display: grid; gap: 14px; align-content: start; }
.info-box { border: 1px solid #9ab4a6; border-left: 4px solid var(--success); border-radius: 6px; background: var(--success-soft); padding: 13px 15px; color: #355846; font-size: 12.5px; line-height: 1.55; }
.info-box strong { display: block; margin-bottom: 2px; }
.info-box.is-used { border-color: var(--line); border-left-color: var(--line-strong); background: var(--surface); color: var(--muted); }
.field-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }

form, label { display: grid; gap: 9px; }
form { gap: 24px; }
#newJobFields { display: grid; gap: 24px; }
label { font-weight: 700; font-size: 13px; }
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: #fffdf8; color: var(--ink); padding: 12px; font: inherit; font-weight: 400; }
select { min-height: 48px; }
textarea { resize: vertical; line-height: 1.5; }
.form-footer { display: flex; gap: 18px; align-items: center; justify-content: space-between; color: var(--muted); }
button { min-height: 46px; border: 0; border-radius: 6px; padding: 11px 18px; background: var(--ink); color: #fffdf8; font: inherit; font-weight: 750; cursor: pointer; }
button:hover:not(:disabled) { background: var(--accent-dark); }
button:disabled { opacity: 0.58; cursor: wait; }
.btn-block { display: flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; border-radius: 6px; padding: 11px 18px; font-weight: 750; text-decoration: none; cursor: pointer; }
.btn-block.primary { background: var(--ink); color: #fffdf8; border: 0; }
.btn-block.primary:hover { background: var(--accent-dark); }
.btn-block.quiet { border: 1px solid var(--line-strong); background: transparent; color: var(--ink); }
.btn-block.quiet:hover { background: #efece2; }
.btn-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Purchase row (compact, not a hero card) */
.purchase-panel { display: grid; gap: 12px; }
.purchase-panel.is-empty { border-color: var(--accent); }
.purchase-row { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.purchase-copy { margin: 0; max-width: 460px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.purchase-panel small { color: var(--muted); }
.purchase-panel a { color: var(--accent-dark); }
.rewrite-purchase-options { display: flex; gap: 10px; flex-wrap: wrap; }
.rewrite-purchase-options button { min-height: 44px; white-space: nowrap; }

/* Next-step call to action on the report page */
.next-step-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-left: 4px solid var(--accent); }
.next-step-card h2 { margin: 0 0 6px; }
.next-step-card p { margin: 0; }
.next-step-card .button-link { flex: 0 0 auto; }

/* Section titles + recent-work rows */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 30px 0 4px; }
.section-title h2 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.section-title a { color: var(--accent); font-size: 12.5px; font-weight: 700; text-decoration: none; }
.section-title a:hover { text-decoration: underline; }

/* Shared bits */
h2 { margin: 0 0 14px; font-size: 20px; letter-spacing: -0.03em; }
p { line-height: 1.6; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; }
.status, .muted { color: var(--muted); }
.status { min-height: 20px; }
.error { min-height: 20px; color: var(--danger); font-weight: 700; }
.report-list { display: grid; gap: 10px; }
.report-link { display: flex; min-height: 54px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; align-items: center; justify-content: space-between; gap: 14px; text-decoration: none; }
.report-link:hover { background: #efece2; }
.report-link strong { color: var(--accent); }
.score-card { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.score-card .score-figure { margin: 0; color: var(--accent); font-size: clamp(56px, 9vw, 84px); font-weight: 650; letter-spacing: -0.05em; line-height: 1; }
.score-card small { color: var(--muted); font-size: 22px; letter-spacing: 0; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.report-grid .card { margin: 0; }
.report-grid .full { grid-column: 1 / -1; }
ul { margin: 0; padding-left: 22px; }
li { margin: 0 0 12px; line-height: 1.5; }
.job-description-card { margin-top: 18px; }
pre { max-height: 420px; margin: 0; overflow: auto; white-space: pre-wrap; word-break: break-word; font: inherit; line-height: 1.55; }
.disclaimer { border-left: 4px solid var(--accent); border-radius: 4px; padding: 12px 16px; background: #f4e9e3; color: #572416; font-size: 12.5px; font-weight: 700; }
.version-summary { margin: 0 0 22px; font-size: clamp(26px, 4vw, 38px); font-weight: 690; letter-spacing: -0.03em; line-height: 1.2; }
.bullet-list { display: grid; gap: 14px; margin-bottom: 30px; }
.bullet-row { border: 1px solid var(--line); border-radius: 7px; padding: 16px; }
.bullet-row p { margin-top: 0; font-weight: 700; }
details summary { color: var(--accent); cursor: pointer; font-weight: 750; }
blockquote { margin: 14px 0 0; border-left: 3px solid var(--line); padding: 8px 14px; color: var(--muted); white-space: pre-wrap; }
.text-diff { max-height: 680px; }
.text-diff span { display: block; min-height: 1.5em; }
.diff-added { background: #e1f1e5; color: #20512d; }
.diff-removed { background: #f5dedd; color: #782727; }
.button-link { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; border-radius: 6px; padding: 11px 18px; font-weight: 750; text-decoration: none; }
.primary-link { background: var(--ink); color: #fffdf8; }
.primary-link:hover { background: var(--accent-dark); }
.card-heading, .entry-heading, .builder-list-heading { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; }
.builder-list-heading h2, .builder-list-heading p { margin-top: 0; }

/* Structured builder (two-pane editor keeps a slim top bar instead of the rail) */
.builder-body { background: #dedbd3; }
.builder-topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 57px; padding: 0 clamp(16px, 3vw, 40px); border-bottom: 1px solid var(--line); background: var(--surface); }
.builder-topbar nav { display: flex; gap: 18px; align-items: center; }
.builder-topbar nav a { color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; }
.builder-topbar nav a:hover { color: var(--ink); }
.builder-shell { display: grid; grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr); min-height: calc(100vh - 57px); }
.builder-controls { min-width: 0; padding: 30px clamp(20px, 3vw, 48px) 80px; }
.builder-intro { margin-bottom: 18px; }
.builder-intro h1 { margin: 0 0 8px; font-size: 26px; font-weight: 720; letter-spacing: -0.03em; }
.builder-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.builder-toolbar { position: sticky; z-index: 2; top: 12px; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.secondary-button, .small-button { border: 1px solid var(--ink); background: transparent; color: var(--ink); }
.secondary-button:hover:not(:disabled), .small-button:hover:not(:disabled) { background: #efece2; }
.danger-button, .remove-button { border: 1px solid var(--danger); background: transparent; color: var(--danger); }
.danger-button:hover:not(:disabled), .remove-button:hover:not(:disabled) { background: #f5dedd; }
.small-button, .remove-button { min-height: 40px; padding: 8px 12px; font-size: 13px; }
.structured-editor { display: grid; gap: 18px; }
.editor-section { margin: 0; }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.entry-editor { display: grid; gap: 16px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.entry-heading h3 { margin: 8px 0 0; }
.repeating-list { display: grid; gap: 10px; margin-top: 16px; }
.repeating-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.preview-pane { min-width: 0; padding: 42px clamp(20px, 4vw, 64px) 80px; background: #c9c6bd; }
.resume-preview { width: min(8.5in, 100%); min-height: 11in; margin: 0 auto; background: white; color: #111; padding: 0.62in 0.68in; box-shadow: 0 10px 36px rgba(23, 32, 28, 0.16); font-family: Arial, Helvetica, sans-serif; font-size: 10.5pt; line-height: 1.35; }
.resume-preview .preview-name { margin: 0; color: #111; font-size: 24pt; line-height: 1.05; letter-spacing: 0.01em; text-align: center; }
.preview-contact { margin: 7px 0 16px; text-align: center; overflow-wrap: anywhere; }
.preview-section { margin-top: 15px; }
.preview-section > h2 { margin: 0 0 7px; border-bottom: 1px solid #222; padding-bottom: 2px; color: #111; font-size: 11.5pt; letter-spacing: 0.08em; text-transform: uppercase; }
.preview-section p { margin: 4px 0; line-height: 1.35; }
.preview-entry { margin: 0 0 10px; break-inside: avoid; }
.preview-entry-heading { display: flex; gap: 14px; align-items: baseline; justify-content: space-between; }
.preview-entry h3 { margin: 0; color: #111; font-size: 10.5pt; }
.preview-entry-heading span { flex: 0 0 auto; }
.resume-preview ul { margin: 4px 0 0; padding-left: 18px; }
.resume-preview li { margin: 0 0 3px; line-height: 1.35; }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .app-rail { position: static; height: auto; width: auto; flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-nav { display: flex; overflow-x: auto; }
  .rail-item { width: auto; min-width: max-content; flex: 0 0 auto; }
  .rail-section { display: none; }
  .app-main { padding: 26px 18px 56px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .work-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .report-grid .full { grid-column: auto; }
  .score-card, .form-footer, .next-step-card { align-items: flex-start; flex-direction: column; }
  .editor-grid { grid-template-columns: 1fr; }
  .card-heading { align-items: stretch; flex-direction: column; }
  .flow-join { width: 18px; margin: 0 8px; }
}
@media (max-width: 1050px) {
  .builder-shell { grid-template-columns: 1fr; }
  .preview-pane { order: -1; }
  .resume-preview { min-height: auto; }
}
@media print {
  @page { size: auto; margin: 0; }
  body, .builder-body { background: white; }
  .no-print { display: none !important; }
  .builder-shell { display: block; min-height: 0; }
  .preview-pane { padding: 0; background: white; }
  .resume-preview { width: auto; min-height: 0; margin: 0; padding: 0.55in 0.62in; box-shadow: none; }
  .preview-section, .preview-entry { break-inside: avoid; }
}
