/* Layout: invoer links (sticky), rechts je seizoen als parcoursprofiel en daaronder het weekschema per fase. */
:root {
  --paper: #F3F6F6;
  --surface: #FFFFFF;
  --ink: #142129;
  --ink-2: #52636D;
  --line: #D6DFE2;
  --line-2: #E7EDEF;
  --accent: #0A7683;
  --accent-ink: #FFFFFF;
  --accent-soft: #E0EFF1;
  --warn-bg: #FFF4E5;
  --warn-ink: #7A4A0B;
  --ph-pre: #8E9EA7;
  --ph-ab: #3A9576;
  --ph-sb: #2C69AF;
  --ph-bu: #CF7425;
  --ph-ra: #C1384F;
  --run: #7A4FB0;
  --font: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --narrow: 72%;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E161B; --surface: #152129; --ink: #E5EDF0; --ink-2: #9AABB4; --line: #27363F; --line-2: #1D2A32;
    --accent: #43B6C2; --accent-ink: #062428; --accent-soft: #123239; --warn-bg: #33270F; --warn-ink: #F3C77E;
    --ph-pre: #7D8D96; --ph-ab: #59BE97; --ph-sb: #5F9BE0; --ph-bu: #EC984A; --ph-ra: #E7647A; --run: #B08EE6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E161B; --surface: #152129; --ink: #E5EDF0; --ink-2: #9AABB4; --line: #27363F; --line-2: #1D2A32;
  --accent: #43B6C2; --accent-ink: #062428; --accent-soft: #123239; --warn-bg: #33270F; --warn-ink: #F3C77E;
  --ph-pre: #7D8D96; --ph-ab: #59BE97; --ph-sb: #5F9BE0; --ph-bu: #EC984A; --ph-ra: #E7647A; --run: #B08EE6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1240px; margin: 0 auto; padding-block: 36px 72px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; }

/* kop */
.masthead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; padding-bottom: 24px; border-bottom: 2px solid var(--ink); margin-bottom: 28px; }
.masthead h1 { font-size: clamp(40px, 6.4vw, 68px); font-weight: 800; font-stretch: 64%; line-height: .9; letter-spacing: -0.01em; }
.masthead p { margin: 0; max-width: 46ch; color: var(--ink-2); }

.layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 36px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }

/* invoer */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); display: grid; gap: 18px; }
/* hoger dan het scherm? dan scrollt het paneel zelf, zodat je altijd alle velden bereikt */
@media (min-width: 901px) { .panel { max-height: calc(100vh - 32px - env(safe-area-inset-top, 0px)); overflow-y: auto; scrollbar-width: thin; } }
@media (max-width: 900px) { .panel { position: static; } }
.panel h2 { font-size: 22px; font-weight: 750; font-stretch: var(--narrow); }
.sample { font-size: 13px; color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; }
.field { display: grid; gap: 6px; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12.5px; color: var(--ink-2); }
input[type="text"], input[type="date"], input[type="number"], select {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; width: 100%; min-width: 0;
}
input:focus-visible, .seg input:focus-visible + span, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.row3 label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.row3 label.is-off { opacity: .45; }
select { appearance: none; -webkit-appearance: none; padding-right: 8px; cursor: pointer; }
.hint.warn { color: var(--warn-ink, #8a4b00); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; text-align: center; padding: 7px 4px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.week > div, .week .sess { min-width: 0; }
.tupdate { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin: 12px 0 0; padding: 14px 18px; border: 1px dashed var(--line); border-radius: 12px; }
.tupdate .hint { display: block; max-width: 46ch; }
.tupdate-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tupdate-row input { width: 90px; }
.week li { overflow-wrap: anywhere; }
.seg.seg2 { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.seg.seg2 span { font-size: 13px; }
.nextstep { margin: 24px 0 8px; padding: 18px 20px; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--ph-ab); border-radius: 12px; }
.nextstep h3 { margin: 0 0 6px; }
.nextstep p { margin: 0 0 12px; color: var(--ink-2); }
.nextstep .btn { width: auto; }
.seg label.is-off span { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.btn { font: inherit; font-weight: 700; font-size: 15px; border: 0; border-radius: 10px; padding: 12px 16px; background: var(--accent); color: var(--accent-ink); cursor: pointer; width: 100%; }
.btn:hover { filter: brightness(1.06); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-note { font-size: 12.5px; color: var(--ink-2); margin: -8px 0 0; min-height: 1em; }

/* resultaat */
.result { display: grid; gap: 28px; min-width: 0; }
.verdict h2 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 800; font-stretch: 68%; line-height: 1; }
.verdict p { margin: 8px 0 0; color: var(--ink-2); }
.notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 12px 14px; font-size: 14px; display: grid; gap: 4px; }
.error { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 16px; font-weight: 600; }

/* parcoursprofiel */
.profile { display: grid; gap: 10px; }
.profile svg { width: 100%; height: 150px; display: block; }
.months { position: relative; height: 18px; font-size: 12px; color: var(--ink-2); }
.months span { position: absolute; top: 0; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 4px 0 0; list-style: none; }
.legend li { display: grid; grid-template-columns: 12px auto; column-gap: 8px; align-items: baseline; font-size: 13.5px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: block; transform: translateY(1px); }
.legend b { font-weight: 650; }
.legend small { grid-column: 2; color: var(--ink-2); font-size: 12.5px; }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0; }
.facts div { padding: 14px 16px 14px 0; }
.facts div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.facts dt { font-size: 12.5px; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.facts dd small { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-2); }
@media (max-width: 720px) { .facts { grid-template-columns: 1fr 1fr; } .facts div:nth-child(3) { border-left: 0; padding-left: 0; } .facts div:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* weekschema */
.phase { display: grid; gap: 0; }
.phase-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 0 0 10px; border-bottom: 2px solid var(--pc); }
.phase-head h3 { font-size: 24px; font-weight: 780; font-stretch: var(--narrow); }
.phase-head span { color: var(--ink-2); font-size: 13.5px; }
.colhead { display: grid; grid-template-columns: 112px repeat(3, minmax(0, 1fr)); gap: 18px; font-size: 12px; color: var(--ink-2); padding: 10px 0 4px; }
.week { display: grid; grid-template-columns: 112px repeat(3, minmax(0, 1fr)); gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.week.is-recup { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
.week .when b { display: block; font-size: 15px; font-weight: 700; }
.week .when span { font-size: 12.5px; color: var(--ink-2); display: block; }
.sess h4 { margin: 0; font-size: 14.5px; font-weight: 680; }
.sess .dur { font-size: 12.5px; color: var(--ink-2); }
.sess ul { margin: 4px 0 0; padding: 0; list-style: none; font-size: 13.5px; display: grid; gap: 2px; }
.sess .none { color: var(--ink-2); font-size: 13.5px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 1px 8px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); margin: 4px 4px 0 0; }
.tag.test { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tag.rec { border-color: var(--accent); color: var(--accent); }
.mlabel { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 2px; }
.week .when { grid-row: span 2; }
@media (max-width: 720px) {
  .colhead { display: none; }
  .week { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .week .when { display: flex; gap: 10px; align-items: baseline; grid-row: auto; }
  .colhead.r4 { display: none; }
  .week.r4 { grid-template-columns: minmax(0, 1fr); }
}
.sess li.wu { color: var(--ink-2); font-size: 12.5px; }
.btn-ghost { font: inherit; font-weight: 650; font-size: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 8px 12px; cursor: pointer; white-space: nowrap; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.exp-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.exports .btn-note { margin: 0; }
.btn-ghost[disabled] { opacity: .5; cursor: default; }
.loadbox { border-top: 1px solid var(--line); padding-top: 16px; }
.coderow { display: flex; gap: 8px; }
.coderow input { flex: 1; font-variant-numeric: tabular-nums; }
.codebox { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; }
.codebox > div { display: grid; gap: 2px; min-width: 0; }
.codebox .lbl { font-size: 12.5px; color: var(--ink-2); }
.codebox code { font-family: var(--font); font-size: 18px; font-weight: 700; color: var(--accent); overflow-wrap: anywhere; }
.codebox .hint { font-size: 12.5px; color: var(--ink-2); }
.ftpnote { margin: -14px 0 0; font-size: 13px; color: var(--ink-2); }
fieldset.disc { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0 0; display: grid; gap: 16px; min-width: 0; }
fieldset.disc legend { font-size: 17px; font-weight: 780; font-stretch: var(--narrow); padding: 0 8px 0 0; }
fieldset.disc[hidden] { display: none; }
.testcalc { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.testcalc select { font-size: 13px; }
.masthead h1 span { display: block; font-size: .32em; font-stretch: 80%; font-weight: 650; letter-spacing: .02em; color: var(--ink-2); margin-top: 6px; }
.week .sess.run .mlabel { color: var(--run); }
.week .sess .mlabel b { font-weight: 700; }
.week .row-run { grid-column: 2 / -1; display: contents; }
.brick { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--paper); border-left: 3px solid var(--run); }
.brick h5 { margin: 0; font-size: 13px; font-weight: 680; }
.brick ul { margin-top: 2px; }
.colhead.r4, .week.r4 { grid-template-columns: 112px repeat(4, minmax(0, 1fr)); }
.week.r4 .when { grid-row: auto; }
.easy + .easy { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.seg label.is-rec span::after { content: "aangeraden"; display: block; font-size: 10.5px; font-weight: 600; color: var(--accent); }
.daypick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.daypick label { position: relative; }
.daypick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.daypick span { display: block; text-align: center; padding: 8px 0; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); font-weight: 650; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.daypick input:checked + span { background: var(--run); border-color: var(--run); color: #fff; }
.daypick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.levelbox { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; display: grid; gap: 2px; }
.sitenav { display: flex; gap: 6px; flex-wrap: wrap; }
.sitenav a { font-size: 13px; font-weight: 650; color: var(--ink-2); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.sitenav a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.panel > .hint { font-size: 12.5px; color: var(--ink-2); margin-top: -8px; }
.footnote { font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 14px; }
@media (prefers-reduced-motion: no-preference) { .profile rect.bar { transition: height .25s ease, y .25s ease; } }
