/* The workshop (/workshop/): editor on the left, checks, rules, table, play and simulation on the right.
   Uses site.css, and track.css and table.css shared with the player. */
:root {
  --surface-2: #f5f7f6; --loop: #93acd4; --signal-soft: #fcebc4; --signal-ink: #3a2a00;
  --keuze: #1f4f95; --kans: #7b4cb9; --auto: #5a6763; --venster: #0e7a6e; --trigger: #b9450f;
  --good: #1c7a46; --bad: #b42318; --good-soft: #dff1e6; --bad-soft: #f8e1de; --r: 8px;
  --cm-key: #1f4f95; --cm-str: #2f7a32; --cm-num: #a5590b; --cm-comment: #7b8783; --cm-meta: #7b4cb9;
  --cm-sel: #cfdcf3; --cm-active: rgb(31 79 149 / .05);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --surface-2: #1b2524; --loop: #3e5a86; --signal-soft: #3d3215; --signal-ink: #fff3d6;
  --keuze: #8db0f2; --kans: #c3a0ee; --auto: #94a39f; --venster: #4cc3b4; --trigger: #f28c5e;
  --good: #5cc58b; --bad: #f27c6e; --good-soft: #17301f; --bad-soft: #3a1c19;
  --cm-key: #8fc1ff; --cm-str: #b5e08c; --cm-num: #f5b732; --cm-comment: #7f908b; --cm-meta: #c3a0ee;
  --cm-sel: #2a4166; --cm-active: rgb(255 255 255 / .04);
} }

[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ws { max-width: 1800px; margin: 0 auto; padding: 0 20px 12px; }
.ws-body header.top { padding: 12px 0; }

/* Bar: project, new, import · saved, share, package, more */
.ws-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 4px 0 10px; }
.ws-proj, .ws-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ws-lbl { font-weight: 700; font-size: .85rem; color: var(--muted); }
.ws-proj select { font: inherit; font-weight: 700; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); max-width: 260px; }
.ws-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; font-size: .9rem; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.2; }
.ws-btn:hover { border-color: var(--track); }
.ws-btn.vol { background: var(--track); border-color: var(--track); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ws-btn.vol { color: #0e1413; } }
.ws-btn.gevaar, .ws-menu .gevaar { color: var(--bad); }
.ws-btn.klein { padding: 4px 8px; font-size: .8rem; }
.ws-btn[disabled] { opacity: .45; cursor: not-allowed; }
.ws-saved { font-size: .82rem; color: var(--muted); }
.ws-saved::before { content: "●"; color: var(--good); margin-right: 5px; font-size: .7em; vertical-align: 1px; }
.ws-saved.bezig::before { color: var(--signal); }
.ws-more { position: relative; }
.ws-more summary { list-style: none; }
.ws-more summary::-webkit-details-marker { display: none; }
.ws-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: grid; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgb(0 0 0 / .18); padding: 6px; }
.ws-menu button { font: inherit; font-size: .92rem; text-align: left; padding: 8px 10px; border: 0; background: none; color: var(--ink); border-radius: 6px; cursor: pointer; }
.ws-menu button:hover { background: var(--surface-2); }

/* Status chips */
.ws-status { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; padding-bottom: 8px; transition: opacity .2s; }
.ws-status.bezig { opacity: .55; }
.ws-chip { font: 700 .8rem var(--f-sans); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.ws-chip.goed { background: var(--good-soft); color: var(--good); border-color: transparent; }
.ws-chip.slecht { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

/* The two halves */
.ws-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; height: calc(100dvh - 150px); min-height: 560px; }
.ws-left, .ws-right { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ws-tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); background: var(--surface-2); overflow-x: auto; scrollbar-width: none; flex: none; }
.ws-tabs button { font: inherit; font-weight: 700; font-size: .88rem; padding: 7px 12px 8px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.ws-tabs button:hover { color: var(--ink); }
.ws-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); }
.ws-n:not(:empty) { font: 700 .72rem var(--f-mono); background: var(--line); border-radius: 999px; padding: 0 6px; margin-left: 2px; }
.ws-editor { flex: 1; min-height: 0; }
.ws-editor .cm-editor { height: 100%; }
.ws-media { flex: 1; min-height: 0; overflow: auto; padding: 14px; display: grid; gap: 12px; align-content: start; }
.ws-hint { flex: none; margin: 0; padding: 6px 12px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); }
.ws-pane { flex: 1; min-height: 0; overflow: auto; padding: 14px; display: grid; gap: 12px; align-content: start; }
.ws-pane-play { padding: 0; display: flex; flex-direction: column; gap: 0; }
.ws-pane-play .ws-tbar { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ws-pane-play iframe { flex: 1; width: 100%; border: 0; min-height: 0; background: var(--bg); }
.ws-privacy { font-size: .82rem; color: var(--muted); margin: 10px 0 0; }

@media (max-width: 640px) {
  .ws-bar { gap: 6px; }
  .ws-btn { padding: 6px 10px; font-size: .86rem; }
  .ws-saved { font-size: 0; }
  .ws-saved::before { font-size: .8rem; margin: 0; }
  .ws-proj select { max-width: 170px; }
}
@media (max-width: 960px) {
  .ws-grid { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .ws-left { height: 64vh; min-height: 380px; }
  .ws-right { height: 80vh; min-height: 460px; }
  .ws { padding: 0 12px 12px; }
}

/* Blocks in the panes */
.ws-blok { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.ws-blok.goed { border-left-color: var(--good); }
.ws-blok.slecht { border-left-color: var(--bad); }
.ws-blok h3 { font-size: 1rem; margin: 0 0 6px; }
.ws-blok h4 { font-size: .9rem; margin: 12px 0 4px; }
.ws-blok ul { margin: 4px 0 0; padding-left: 1.2em; font-size: .87rem; }
.ws-blok li { margin: 3px 0; overflow-wrap: anywhere; }
.ws-blok li[data-line], .ws-blok pre[data-line] { cursor: pointer; }
.ws-blok li[data-line]:hover { color: var(--track); }
.ws-blok pre { font: .78rem/1.5 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; color: var(--ink); }
.ws-blok summary { cursor: pointer; font-weight: 700; font-size: .92rem; }
.ws-ln { font: 600 .74rem var(--f-mono); color: var(--muted); }
.ws-uitleg { color: var(--muted); font-size: .86rem; margin: 0; }
.ws-klein { font-size: .8rem; color: var(--muted); }
.ws-klein code, .ws-blok code { font: .8em var(--f-mono); background: var(--surface-2); border-radius: 4px; padding: 0 4px; }
.ws-leeg { color: var(--muted); margin: 8px 2px; }
.ws-meter { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0 10px; }
.ws-meter i { display: block; height: 100%; background: var(--track); }
.ws-feiten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 8px; }
.ws-feiten div { background: var(--bg); border-radius: 8px; padding: 6px 10px; }
.ws-feiten dt { font-weight: 700; font-size: .76rem; color: var(--muted); }
.ws-feiten dd { margin: 0; font-weight: 800; }
.ws-fouten li::marker { color: var(--bad); }
.ws-waarsch li::marker { color: var(--signal); }
.ws-waarsch-p { color: var(--ink); font-size: .87rem; }
@media (max-width: 560px) { .ws-feiten { grid-template-columns: repeat(2, 1fr); } }

/* Rules */
.ws-spoor { font-size: .92rem; }
.ws-spoor .rij { cursor: pointer; }

/* Table */
.ws-tbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.ws-scrub { display: flex; align-items: center; gap: 6px; flex: 1 1 220px; min-width: 0; }
.ws-scrub input { flex: 1; min-width: 80px; accent-color: var(--track); }
.ws-pos { font: 600 .78rem var(--f-mono); color: var(--muted); white-space: nowrap; }
.ws-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ws-seg button { font: inherit; font-size: .82rem; font-weight: 600; padding: 5px 10px; border: 0; background: var(--surface); color: var(--ink); cursor: pointer; }
.ws-seg button + button { border-left: 1px solid var(--line); }
.ws-seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.ws-veld { display: grid; gap: 12px; background-color: var(--felt); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; min-width: 0; transition: opacity .2s; }
.ws-veld.bezig { opacity: .6; }
.ws-3d { height: min(70vh, 640px); min-height: 360px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--felt); }
.ws-detail { position: sticky; bottom: 0; z-index: 4; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; box-shadow: 0 6px 20px rgb(0 0 0 / .18); display: grid; gap: 6px; }

/* Simulate */
.ws-simform, .ws-seats { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.ws-field { display: grid; gap: 4px; font-weight: 700; font-size: .85rem; color: var(--muted); }
.ws-field input, .ws-field select { font: inherit; font-weight: 400; color: var(--ink); padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.ws-field.klein input { width: 8em; }
.ws-setup { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 12px; margin: 0; }
.ws-setup legend { font-weight: 800; font-size: .88rem; padding: 0 4px; }
.ws-check { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
progress { accent-color: var(--track); width: 160px; }
.ws-tabel { overflow-x: auto; }
.ws-tabel table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.ws-tabel th, .ws-tabel td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ws-tabel td { font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ws-tabel th small { display: block; font-weight: 400; color: var(--muted); }
.ws-ci { color: var(--muted); }
.ws-uitkomst { columns: 2 220px; }
.ws-uitkomst b { font-family: var(--f-mono); }

/* Media */
.ws-drop { border: 2px dashed var(--card-edge); border-radius: 12px; padding: 16px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.ws-drop p { margin: 0; }
body.ws-slepen .ws-drop, body.ws-slepen .ws-left { border-color: var(--track); }
body.ws-slepen::after { content: ""; position: fixed; inset: 0; background: rgb(31 79 149 / .08); pointer-events: none; }
.ws-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ws-files li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 6px; }
.ws-thumb { width: 64px; height: 64px; border-radius: 6px; background-color: var(--bg); display: grid; place-items: center; font: 700 .7rem var(--f-mono); color: var(--muted); }
.ws-fi { display: grid; gap: 2px; min-width: 0; }
.ws-fi code { font: 600 .85rem var(--f-mono); overflow-wrap: anywhere; }
.ws-fk { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.ws-snip { white-space: pre; overflow-x: auto; font: .8rem/1.5 var(--f-mono); background: var(--surface-2); padding: 10px; border-radius: 8px; }

/* Dialog and toast */
.ws-dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink); width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
.ws-dialog::backdrop { background: rgb(10 15 14 / .45); }
.ws-dlg { display: grid; gap: 12px; padding: 18px 20px; }
.ws-dlg h2 { font-size: 1.15rem; margin: 0; }
.ws-dlg p { margin: 0; }
.ws-dlg-k { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.ws-radio { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.ws-radio legend { font-weight: 700; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.ws-radio label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; align-items: center; }
.ws-radio label select { grid-column: 2; justify-self: start; max-width: 100%; }
.ws-radio select { font: inherit; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.ws-link { font: .8rem var(--f-mono); padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); width: 100%; }
.ws-uitleg-l { margin: 0; padding-left: 1.2em; color: var(--muted); font-size: .86rem; }
.ws-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: .9rem; box-shadow: 0 8px 24px rgb(0 0 0 / .25); max-width: min(560px, calc(100vw - 32px)); }

/* Cards tab: content as tables */
.ws-cards-tab { flex: 1; min-height: 0; overflow: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.ws-cards-kop { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .9rem; }
.ws-cards-kop select { font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.ws-cards-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); flex: 1; min-height: 0; }
table.ws-cards { border-collapse: collapse; font-size: .85rem; min-width: 100%; }
table.ws-cards th, table.ws-cards td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; text-align: left; white-space: nowrap; }
table.ws-cards thead th { position: sticky; top: 0; background: var(--bg); padding: 6px 8px; font-weight: 700; z-index: 1; }
table.ws-cards tbody th { padding: 4px 8px; color: var(--muted); font-weight: 600; background: var(--bg); position: sticky; left: 0; }
table.ws-cards input { font: inherit; border: 0; background: transparent; padding: 5px 8px; min-width: 7em; width: 100%; color: var(--ink); }
table.ws-cards td.lang input { min-width: 24em; }
table.ws-cards input:focus { outline: 2px solid var(--track); outline-offset: -2px; background: var(--surface); }
.ws-cards-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 2px 8px; }
.ws-cards-x:hover { color: #c0392b; }
.ws-cards-err { color: #c0392b; }

/* Layout tab: the rows of the view as chips */
.ws-layout-tab { flex: 1; min-height: 0; overflow: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; }
.ws-area h3 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ws-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; min-height: 38px; padding: 5px 6px; border: 1px dashed var(--line); border-radius: 8px; margin-bottom: 6px; }
.ws-row.doel { border-color: var(--track); background: color-mix(in srgb, var(--track) 10%, transparent); }
.ws-row-n { font-size: .75rem; color: var(--muted); width: 1.2em; line-height: 28px; text-align: center; }
.ws-row-tail { flex: 1; min-width: 20px; min-height: 28px; }
.ws-row-new { border-style: dotted; opacity: .75; }
.ws-row-hint { font-size: .8rem; color: var(--muted); line-height: 28px; margin: 0; }
.ws-chip { position: relative; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: grab; font-size: .88rem; line-height: 20px; user-select: none; }
.ws-chip:hover { border-color: var(--track); }
.ws-chip.sleept { opacity: .4; }
.ws-chip[aria-expanded="true"] { border-radius: 12px; border-color: var(--track); }
.ws-chip-icon { opacity: .75; }
.ws-chip-flags { font-size: .72rem; color: var(--muted); }
.ws-chip-pal { background: var(--bg); }
.ws-palette { padding: 6px; border: 1px dashed var(--line); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.ws-palette h3 { width: 100%; }
.ws-palette.doel { border-color: var(--bad); }
.ws-chip-menu { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 6px 0 2px; cursor: default; font-size: .82rem; }
.ws-chip-menu input[type=text], .ws-chip-menu select, .ws-chip-menu input[type=number] { font: inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.ws-chip-moves { display: flex; flex-wrap: wrap; gap: 4px; }
.ws-layout-start { margin: 0; }

/* Simulation charts */
.ws-charts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.ws-chart { margin: 0; flex: 1 1 200px; max-width: 360px; }
.ws-chart.breed { flex-basis: 100%; max-width: 480px; margin-top: 8px; }
.ws-chart figcaption { font-size: .8rem; color: var(--muted); margin-bottom: 2px; }
.ws-chart svg { width: 100%; height: auto; display: block; }
.ws-chart rect { fill: var(--track); opacity: .85; }
.ws-chart text { font-size: 9px; fill: var(--muted); }
.ws-chart .grid { stroke: var(--line); stroke-width: 1; }
.ws-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.ws-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* Flow tab: the flow as an editable tree */
.ws-flow-tab { flex: 1; min-height: 0; overflow: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; }
.ws-flow-root h3 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ws-fnode { border-left: 2px solid var(--line); margin: 4px 0 4px 0; padding-left: 8px; }
.ws-fnode[aria-expanded="true"] > .ws-fhead { background: color-mix(in srgb, var(--track) 10%, transparent); border-color: var(--track); }
.ws-fhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: .88rem; }
.ws-fhead:hover { border-color: var(--track); }
.ws-ficon { width: 1.3em; text-align: center; opacity: .8; }
.ws-fk-loop > .ws-fhead .ws-ficon { color: #2f6fb3; } .ws-fk-branch > .ws-fhead .ws-ficon { color: #a53a2c; } .ws-fk-step > .ws-fhead .ws-ficon { color: #2e8b57; } .ws-fk-subflow > .ws-fhead .ws-ficon { color: #9a6224; }
.ws-flabel { font-weight: 700; }
.ws-fdo { font-family: var(--f-mono); font-size: .78rem; padding: 1px 6px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); }
.ws-fmeta { font-size: .78rem; color: var(--muted); }
.ws-fmoves { margin-left: auto; display: flex; gap: 2px; }
.ws-fbtn { font: inherit; font-size: .78rem; padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer; }
.ws-fbtn:hover { border-color: var(--track); }
.ws-fbtn.gevaar { color: var(--bad); }
.ws-fkids { margin-left: 10px; }
.ws-fadd { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0 2px 8px; opacity: .7; }
.ws-fadd:hover { opacity: 1; }
.ws-fcase { border-left: 2px dashed var(--line); margin: 4px 0; padding-left: 8px; }
.ws-fcasehead { font-size: .8rem; color: var(--muted); font-style: italic; padding: 2px 0; }
.ws-fform { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 8px 10px; margin: 4px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: .82rem; }
.ws-ffield { display: flex; flex-direction: column; gap: 2px; min-width: 9em; }
.ws-ffield.breed { flex-basis: 100%; }
.ws-ffield > span, .ws-ffield { color: var(--muted); }
.ws-ffield input[type=text], .ws-ffield select { font: inherit; color: var(--ink); padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.ws-ffield input.mono { font-family: var(--f-mono); }
.ws-fdos { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--ink); }
.ws-fchk { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-mono); font-size: .8rem; color: var(--ink); }
.ws-fchk input[type=text] { font: inherit; padding: 2px 6px; border: 1px dashed var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.ws-fmissing { color: var(--bad); }
.ws-fcaseform { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
.ws-fcaseform input { flex: 1; min-width: 8em; }

/* New game: tiles to start from (our games with their level, what they teach, a tour) */
.ws-dialog.ws-dialog-groot { width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.ws-start { display: grid; gap: 8px; max-height: min(62dvh, 640px); overflow: auto; padding: 2px 4px 4px 2px; margin: 0 -4px 0 -2px; }
.ws-start h3 { margin: 6px 0 0; font-size: .95rem; }
.ws-tegels { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ws-tegels.klein { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ws-tegel { position: relative; display: grid; gap: 4px; align-content: start; padding: 0 0 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; overflow: hidden; }
.ws-tegels.klein .ws-tegel { padding: 10px 12px; }
.ws-tegel:hover { border-color: var(--track); }
.ws-tegel:has(input:checked) { border-color: var(--signal); box-shadow: 0 0 0 2px var(--signal); }
.ws-tegel:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }
.ws-tegel input { position: absolute; opacity: 0; pointer-events: none; }
.ws-tegel img, .ws-tegel-leeg { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--felt, #163028); }
.ws-tegel-leeg { display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: var(--muted); }
.ws-tegel-t, .ws-tegel-p { padding: 0 10px; }
.ws-tegels.klein .ws-tegel-t, .ws-tegels.klein .ws-tegel-p { padding: 0; }
.ws-tegel-t b { font-size: .95rem; }
.ws-tegel-p { font-size: .82rem; line-height: 1.4; color: var(--muted); }
.ws-tegel-p:empty { display: none; }
.ws-niveau { display: inline-block; font-size: .68rem; font-weight: 700; border-radius: 99px; padding: 1px 7px; vertical-align: 1px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.ws-niveau.n1 { color: #2f7d4f; border-color: #9bd3b1; }
.ws-niveau.n2 { color: #2a5da8; border-color: #a8c2ea; }
.ws-niveau.n3 { color: #a2541a; border-color: #ebc39f; }
.ws-niveau.rond { color: var(--ink); border-color: var(--signal); background: var(--signal-soft, #fff3d6); }
.ws-check { display: flex; gap: 8px; align-items: center; font-size: .9rem; }

/* A tour: a card over the right side, one step at a time; the model text it is about is selected */
.ws-tour { position: fixed; right: 16px; bottom: 16px; z-index: 30; width: min(400px, calc(100vw - 24px)); max-height: min(70dvh, 560px); overflow: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--signal); border-radius: 12px; box-shadow: 0 18px 48px rgb(0 0 0 / .28); padding: 12px 16px 14px; display: grid; gap: 8px; }
.ws-tour:focus { outline: none; }
.ws-tour-kop { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); font-weight: 700; }
.ws-tour-x { border: 0; background: none; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; }
.ws-tour h3 { margin: 0; font-size: 1.05rem; }
.ws-tour-tekst { display: grid; gap: 8px; font-size: .9rem; line-height: 1.5; }
.ws-tour-tekst p { margin: 0; }
.ws-tour-tekst code { font-size: .82rem; background: var(--surface-2); border-radius: 4px; padding: 0 4px; }
.ws-tour-k { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; }
.ws-tour .ws-klein { font-size: .78rem; color: var(--muted); margin: 0; }
@media (max-width: 700px) { .ws-tour { right: 0; left: 0; bottom: 0; width: auto; border-radius: 14px 14px 0 0; border-left-width: 1px; border-top: 4px solid var(--signal); max-height: 55dvh; } }

/* the expression under the cursor, in words and with its value on the table */
.ws-expr { flex: none; max-height: 42%; overflow: auto; border-top: 1px solid var(--line); background: var(--surface-2); padding: 8px 12px 10px; font-size: .88rem; }
.xp-kop { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.xp-kop > code { font-family: var(--f-mono); font-weight: 700; color: var(--cm-key, var(--track)); font-size: .82rem; }
.xp-waar { color: var(--muted); font-size: .8rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-stap { display: inline-flex; gap: 2px; }
.xp-woorden { margin: 6px 0 4px; line-height: 1.6; font-size: .96rem; color: var(--ink); }
.xp-woorden q { quotes: "“" "”"; color: var(--cm-str, #8a4b0f); }
.xp-woorden code { font-family: var(--f-mono); font-size: .82em; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0 3px; }
.xp-woorden i { font-family: var(--f-mono); font-size: .85em; font-style: normal; color: var(--muted); }
.xw-n { font-family: var(--f-mono); font-size: .84em; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; white-space: nowrap; }
.xw-n[title] { cursor: help; border-bottom-width: 2px; }
.xw-z { border-color: color-mix(in srgb, var(--track) 45%, var(--line)); }
.xw-c { border-color: color-mix(in srgb, var(--signal) 55%, var(--line)); }
.xw-fn { border-color: color-mix(in srgb, var(--venster, #0e7a6e) 55%, var(--line)); }
.xw-f { background: transparent; border: 0; padding: 0; font-style: italic; }
.xw-l { border-style: dashed; }
.xw-v { color: var(--muted); font-size: .85em; }
.xp-nu { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin: 6px 0 3px; color: var(--muted); font-size: .84rem; }
.xp-ja { color: var(--good); } .xp-nee { color: var(--bad); }
.xp-waarde { color: var(--ink); font-family: var(--f-mono); font-weight: 600; font-size: .82rem; word-break: break-word; }
.xp-nodig, .xp-wacht { color: var(--muted); font-style: italic; font-size: .82rem; }
.xp-fout { color: var(--bad); font-size: .84rem; }
.xp-delen { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.xp-delen li { padding-left: calc(var(--d, 0) * 16px + 4px); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; border-left: 2px solid var(--line); }
.xp-delen li code { font-family: var(--f-mono); font-size: .78rem; color: var(--muted); }
.xp-open { font: inherit; font-size: .84rem; background: none; border: 0; color: var(--track); cursor: pointer; padding: 2px 0; font-weight: 600; }
.cm-tooltip-autocomplete { font-family: var(--f-mono); }
.cm-completionInfo { font-family: var(--f-sans); max-width: 22rem; }

/* the builder: a condition as rows */
.ws-expr.bouwt { max-height: 60%; }
.xb { display: grid; gap: 6px; margin: 4px 0 8px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.xb-kop { display: flex; gap: 8px; align-items: center; font-size: .84rem; color: var(--muted); }
.xb select, .xb input { font: inherit; font-size: .84rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 3px 6px; min-height: 30px; }
.xb input { font-family: var(--f-mono); font-size: .8rem; min-width: 0; flex: 1; }
.xb input.xb-fout { border-color: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 25%, transparent); }
.xb-rij { border-left: 3px solid var(--line); padding-left: 8px; }
.xb-velden { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.xb-kant { display: inline-flex; gap: 2px; align-items: center; flex: 1 1 11rem; min-width: 9rem; }
.xb-pick { width: 2.4rem; padding: 3px 2px !important; flex: none; }
.xb-woorden { margin: 3px 0 0; font-size: .86rem; color: var(--muted); line-height: 1.5; }
.xb > .ws-btn { justify-self: start; }
.ws-fwords { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; margin-top: 2px; line-height: 1.4; }
