/* Work screen in the HTM style. Tokens and the dark environment bar are copied from the HTM demo
   (site/htm/index.html and tool.css, release 2a34cf9); status colours from its app.css (verschil, klopt). */
@font-face { font-family: Bricolage; src: url("bricolage.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: Source; src: url("source-sans.woff2") format("woff2"); font-display: swap; }
:root {
  --ink: #1e1c22; --muted: #625d65; --line: #d2ccc1; --paper: #f6f1e6; --card: #ffffff; --grid: #c9c2b433;
  --head: #fbf8f1; --soft: #ece6d8; --focus: #2563eb; --error: #a3321f;
  --signal: #c2410c; --signal-soft: #fdf0e8; --goed: #2f7d4f; --goed-soft: #eef6f1;
  --s1: #db2777; --s2: #2563eb; --s3: #0d9488; --env: 38px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 27px 27px; color: var(--ink); font: 16px/1.5 Source, system-ui, sans-serif; display: flex; flex-direction: column; overflow: hidden; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { font-family: Bricolage, sans-serif; letter-spacing: -.3px; margin: 0; }
h1 { font-size: 24px; line-height: 1.15; } h2 { font-size: 21px; line-height: 1.2; } h3 { font-size: 17px; line-height: 1.25; }
p { margin: 0; }
.mut { color: var(--muted); }
.eyebrow { font: 500 12px/16px ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Environment bar (HTM tool.css). */
.env-bar { height: var(--env); flex: none; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--ink); color: var(--paper); font-size: 14px; }
.env-bar a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.env-bar img { width: 20px; height: 20px; filter: invert(1); }
.env-bar b { font: 700 15px Bricolage, sans-serif; }
.env-home span { color: #bfb8aa; }
.env-fict { margin-left: auto; color: #e9e3d6; }
.env-fict b { font: 600 14px Source, sans-serif; }
.env-stamp { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #bfb8aa; }

/* Controls. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; font: 600 17px Source, sans-serif; padding: 10px 18px; border: 0; border-radius: 4px; background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; }
.btn:disabled { background: #8d8790; cursor: not-allowed; }
.btn-s { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; font: 600 15px Source, sans-serif; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn-s:hover { background: var(--soft); }
.linkbtn { border: 0; background: none; padding: 10px 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
input, select, textarea { font: 16px Source, sans-serif; color: var(--ink); background: var(--card); border: 1.5px solid var(--ink); border-radius: 4px; padding: 8px 10px; min-height: 44px; width: 100%; min-width: 0; }
textarea { resize: vertical; }
label, legend { display: block; font-weight: 600; font-size: 15px; margin: 12px 0 4px; padding: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.hint { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* Work layout: input | card | choice; each pane scrolls inside, the page never scrolls. */
.werk { flex: 1; min-height: 0; display: grid; grid-template-columns: 380px minmax(0, 1fr) 340px; }
.tabs { display: none; }
.paneel { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 20px; }
.invoer { background: var(--head); border-right: 1.5px solid var(--ink); }
.kaart { padding: 20px 28px; }
.keuze { background: var(--card); border-left: 1.5px solid var(--ink); }
.keuze-toggle { display: none; }
.tegels { display: grid; gap: 6px; }
.tegel { text-align: left; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 4px; background: var(--card); font: 15px Source, sans-serif; color: var(--ink); cursor: pointer; }
.tegel[aria-pressed="true"] { border-color: var(--ink); background: var(--soft); font-weight: 600; }
.twee { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.psk-kop, .psk-rij, .meet { display: grid; grid-template-columns: minmax(0, 1fr) 64px 64px; gap: 6px; }
.psk-rij + .psk-rij { margin-top: 6px; }
.psk-kop { font-size: 13px; color: var(--muted); }
.anon { font-size: 15px; margin: 10px 0; padding: 8px 10px; border-radius: 4px; }
.anon.ok { background: var(--goed-soft); }
.anon.bad { background: #fbe9e5; color: var(--error); border: 1.5px solid var(--error); }
#leg-voor { width: 100%; }

/* The card. */
.leeg { max-width: 60ch; padding: 24px; border: 1.5px dashed var(--line); border-radius: 4px; background: var(--card); }
.blok { background: var(--card); border: 1.5px solid var(--ink); border-radius: 4px; padding: 18px 20px; margin-bottom: 16px; }
.stand { border-left: 6px solid var(--signal); }
.stand.ok { border-left-color: var(--goed); }
.status { display: inline-block; font: 600 12px/16px ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; background: var(--signal-soft); color: var(--signal); margin-bottom: 6px; }
.stand.ok .status { background: var(--goed-soft); color: var(--goed); }
.uitleg { margin-top: 4px; }
.veranderd { background: var(--head); border: 1.5px solid var(--ink); border-radius: 4px; padding: 12px 16px; margin-bottom: 16px; }
.veranderd ul { margin: 6px 0 0; padding-left: 1.2em; }
.graf { margin: 12px 0 0; }
.graf { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 4px 20px; align-items: center; }
.graf figcaption { grid-column: 1 / -1; }
.legenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.legenda span { display: inline-block; width: 14px; height: 4px; vertical-align: middle; margin-right: 8px; border-radius: 2px; }
.graf svg { width: 100%; max-width: 420px; height: auto; display: block; font-family: Source, sans-serif; }
.graf .gl { stroke: var(--line); } .graf .ax { font-size: 13px; fill: var(--muted); }
.graf .doel { stroke-dasharray: 5 5; stroke-width: 1.5; opacity: .6; } .graf .lijn { stroke-width: 3; } .graf .lbl { font-size: 15px; font-weight: 600; }
.graf figcaption { font-size: 14px; color: var(--muted); }
.meter { margin-top: 10px; font-size: 15px; }
.opties { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; counter-reset: o; }
.optie { counter-increment: o; background: var(--card); border: 1.5px solid var(--ink); border-radius: 4px; padding: 14px 16px; }
.o-kop { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; justify-content: space-between; }
.o-kop b { font: 650 17px/1.3 Bricolage, sans-serif; }
.o-kop b::before { content: counter(o) ". "; }
.optie p { margin-top: 6px; }
.k { font: 500 12px ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
blockquote { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--ink); background: var(--head); font-size: 15px; }
.bronchip { display: inline-block; min-height: 36px; padding: 8px 10px; line-height: 1.35; font: 500 13px ui-monospace, monospace; letter-spacing: .04em; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--card); color: var(--ink); cursor: pointer; max-width: 100%; text-align: left; }
.bronchip::before { content: "Bron · "; color: var(--muted); }
.bronchip:hover { background: var(--soft); }
.kies { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 600; font-size: 15px; min-height: 44px; cursor: pointer; }
.kies input { width: 22px; height: 22px; min-height: 0; accent-color: var(--ink); margin: 0; }
.sectie { margin-top: 20px; }
.sectie > h2 + p { margin-top: 2px; }
.suggesties { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vraagrij { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }
.weiger { border: 1.5px solid var(--ink); border-left: 6px solid var(--muted); background: var(--card); border-radius: 4px; padding: 12px 16px; margin-top: 10px; }
.hit { margin-top: 10px; }
details.hoe { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 6px; }
details.hoe summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
details.hoe li { margin: 4px 0; }
.nok { color: var(--error); }

/* Choice panel. */
.keuze h2 { margin-bottom: 8px; }
.keuze ul { padding-left: 1.2em; margin: 6px 0; }
.keuze .sectie { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.denk { list-style: none; padding: 0 !important; display: grid; gap: 12px; }
.denk-acties { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.acties { display: grid; gap: 8px; margin-top: 12px; }
pre.plak { white-space: pre-wrap; font: 13px/1.5 ui-monospace, monospace; background: var(--head); border: 1.5px solid var(--ink); border-radius: 4px; padding: 12px 14px; margin: 8px 0 0; }

/* Full screens: dagjournaal, cliëntversie, bronnen. */
.scherm { flex: 1; min-height: 0; overflow: auto; padding: 24px 16px 40px; }
.scherm > * { max-width: 900px; margin-inline: auto; }
.scherm h1 { margin: 6px 0 12px; }
.scherm .blok h2 { margin-bottom: 4px; }
.kb-bron details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
/* ?deck=1: demo labels and demo-only buttons are hidden; deck-only text replaces a label where needed. */
.deck .demo, .deck-only { display: none !important; }
.deck .deck-only { display: inline !important; }
.radar { background: var(--signal-soft); border: 1.5px solid var(--signal); border-radius: 4px; padding: 12px 16px; margin: 10px 0; }

/* Passage: on a wide screen it takes the place of the input column, so it hides no text of the card;
   on a phone it is a sheet from below. */
.bron { position: fixed; z-index: 20; top: var(--env); left: 0; bottom: 0; width: 380px; background: var(--card); border-right: 1.5px solid var(--ink); box-shadow: 12px 0 32px #0002; overflow: auto; padding: 16px 20px 24px; }
.bron-kop { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bron h2 { margin: 4px 0 8px; }
.bron blockquote { font-size: 16px; }
.bron mark { background: #fde7a8; }
.bron dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; margin: 12px 0; }
.bron dt { color: var(--muted); }
.bron dd { margin: 0; }

@media (max-width: 1199px) {
  .werk { grid-template-columns: 360px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; position: relative; }
  .invoer { grid-row: 1; } .kaart { grid-row: 1; }
  .bron { width: 360px; }
  .keuze { grid-column: 1 / -1; grid-row: 2; border-left: 0; border-top: 1.5px solid var(--ink); padding: 0; overflow: visible; }
  .keuze-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; padding: 8px 16px; border: 0; background: var(--card); font: 600 16px Source, sans-serif; color: var(--ink); cursor: pointer; }
  .keuze-toggle::after { content: "▲"; font-size: 12px; }
  .keuze-toggle[aria-expanded="true"]::after { content: "▼"; }
  .keuze-body { display: none; }
  .keuze.open .keuze-body { display: block; position: absolute; left: 0; right: 0; bottom: 52px; max-height: calc(100% - 52px); overflow: auto; overscroll-behavior: contain; background: var(--card); border-top: 1.5px solid var(--ink); box-shadow: 0 -8px 24px #0002; padding: 16px; }
  .keuze-body > h2 { display: none; }
  .env-fict { display: none; }
}
@media (max-width: 899px) {
  .werk { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .tabs { display: flex; gap: 0; border-bottom: 1.5px solid var(--ink); background: var(--head); }
  .tabs button { flex: 1; min-height: 46px; border: 0; border-bottom: 3px solid transparent; background: none; font: 600 16px Source, sans-serif; color: var(--muted); cursor: pointer; }
  .tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
  .invoer, .kaart { grid-row: 2; grid-column: 1; border-right: 0; padding: 16px; }
  .keuze { grid-row: 3; }
  .werk[data-tab="invoer"] .kaart, .werk[data-tab="kaart"] .invoer { display: none; }
  .env-stamp { display: none; }
  .env-fict { display: inline; margin-left: auto; font-size: 13px; } .env-fict b { font-size: 13px; }
  .env-home span { display: none; }
  .bron { top: auto; left: 0; width: 100%; max-height: 82%; border-right: 0; border-top: 1.5px solid var(--ink); box-shadow: 0 -12px 32px #0003; padding: 12px 16px 20px; }
  .blok { padding: 14px; }
  .graf { grid-template-columns: minmax(0, 1fr); }
  .kaart { padding-bottom: 40px; }
  .bronchip { min-height: 44px; }
}
