/* CV Builder web: design tokens first, then layout and components. No external assets. */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1d2126;
  --muted: #5b636d;
  --line: #d9d6cf;
  --accent: #1f5f8b;
  --accent-text: #ffffff;
  --accent-soft: #e5eef5;
  --warn-bg: #fff4d6;
  --warn-text: #6b4a00;
  --danger: #a4262c;
  --focus: #f0a400;
  --radius: 10px;
  --space: 1rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --surface: #1e2227;
    --text: #e8eaed;
    --muted: #a3abb5;
    --line: #353b43;
    --accent: #7db7e0;
    --accent-text: #0e1318;
    --accent-soft: #1f3040;
    --warn-bg: #3a2f12;
    --warn-text: #f3d690;
    --danger: #ff8a8f;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.55 var(--font); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 .5em; }
h2 { font-size: 1.25rem; margin: 0 0 .5em; }
h3 { font-size: 1.05rem; margin: 1em 0 .4em; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--surface); padding: .5rem 1rem; }
.skip:focus { left: 1rem; z-index: 10; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .75rem 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.topbar nav { display: flex; align-items: center; gap: 1rem; }
.devbar { margin: 0; padding: .4rem 16px; background: var(--warn-bg); color: var(--warn-text); font-size: .9rem; }
.page { max-width: 60rem; margin: 0 auto; padding: 1.5rem 16px 6rem; }
.footer { max-width: 60rem; margin: 0 auto; padding: 0 16px 2rem; color: var(--muted); font-size: .875rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin: 0 0 1rem; }
.card.note { background: var(--accent-soft); }
.card.danger { border-color: var(--danger); }
.narrow { max-width: 32rem; margin-inline: auto; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin-bottom: 1rem; }
.grid .card { margin: 0; }
.stack > * + * { margin-top: .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.lede { font-size: 1.1rem; color: var(--muted); }
.hero { padding-top: 1rem; }
.steps { padding-left: 1.25rem; }
.steps li { margin: .35rem 0; }
.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; color: var(--muted); }

label { display: block; font-weight: 600; font-size: .95rem; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; padding: .55rem .65rem; font: inherit;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
input[type="radio"] { display: inline; width: auto; margin: 0 .35rem 0 0; }
input[type="file"] { padding: .4rem; }
textarea { resize: vertical; }
.fields { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.fields .wide { grid-column: 1 / -1; }
.field .hint { margin-top: .1rem; }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); border-width: 2px; }
.alert a { color: inherit; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.row { display: grid; gap: .6rem; grid-template-columns: 9rem 1fr 1fr 6rem 6rem; align-items: end;
  padding: .75rem 0; border-bottom: 1px dashed var(--line); }
.row.appointment { grid-template-columns: 1fr 1fr 6rem 6rem; }
.row .wide { min-width: 0; }
@media (max-width: 720px) { .row, .row.appointment { grid-template-columns: 1fr 1fr; } .row .wide { grid-column: 1 / -1; } }

button, .button { display: inline-block; font: inherit; font-weight: 600; padding: .6rem 1.1rem; border-radius: 6px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); cursor: pointer;
  text-decoration: none; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.small { padding: .3rem .7rem; font-size: .85rem; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 400; text-decoration: underline; }
button.destructive { background: var(--danger); border-color: var(--danger); color: #fff; }
form.inline { display: inline; }

.alert { border: 1px solid var(--danger); border-left-width: 6px; background: var(--surface); padding: .75rem 1rem;
  border-radius: var(--radius); margin-bottom: 1rem; }
.error { color: var(--danger); font-size: .9rem; margin: .25rem 0 0; }
.warning { background: var(--warn-bg); color: var(--warn-text); padding: .3rem .6rem; border-radius: 6px; font-size: .9rem; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.count { font-family: var(--font); font-size: .85rem; color: var(--muted); font-weight: 400; margin-left: .35rem; }
.bulk { display: flex; gap: .5rem; }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.item.flagged { box-shadow: inset 4px 0 0 var(--focus); padding-left: .75rem; }
.item-title { font-weight: 600; margin: 0; }
.item-meta { margin: .15rem 0; color: var(--muted); font-size: .92rem; display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.tag { font-size: .8rem; border: 1px solid var(--line); border-radius: 4px; padding: 0 .35rem; }
.citation { font-size: .92rem; margin: .3rem 0; }
.item-body, .alert, .warning { overflow-wrap: anywhere; }
.evidence summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.evidence blockquote { margin: .4rem 0; padding-left: .75rem; border-left: 3px solid var(--line); font-size: .9rem; }
.choice { display: flex; flex-direction: column; gap: .25rem; min-width: 9rem; }
.choice label { font-weight: 400; cursor: pointer; }
@media (max-width: 720px) { .item { grid-template-columns: 1fr; } .choice { flex-direction: row; flex-wrap: wrap; gap: .5rem 1rem; } }

.submitbar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  flex-wrap: wrap; padding: .75rem 1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); }
.tally { margin: 0; color: var(--muted); }

.progress { height: 6px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; position: relative; }
.progress::after { content: ""; position: absolute; inset: 0; width: 35%; background: var(--accent);
  animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .progress::after { animation: none; width: 100%; opacity: .5; } }
