/* Hub sections (Typing, Random tools): the parts of page types `sectietool` / `sectiegids` (src/components/Sectie*.astro) and the bridge from the platform tokens to the section tools' own css.
   A page-own sheet (stijl_na), loaded by the 48 section pages only; tokens: --tx --mu --pn --ln --bd --acc --bad --r-ctl --r-card --sp-* --fh. */
/* tool area: same card look as section.stage, but one column (fd2.css makes section.stage a 5fr/7fr grid) */
.sectietool{min-width:0;margin:0 0 var(--sp-24);padding:1.125rem;background:var(--pn);border-radius:var(--r-card)}
.sectietool [data-tt-tool]{min-width:0}
@media(max-width:760px){.sectietool{padding:var(--sp-12)}}
/* the tools read --text --surface --muted --accent --danger; the platform's own light/dark switch drives them, so the tool's Theme setting is hidden */
.sectietool{--text:var(--tx);--surface:var(--pn2);--muted:var(--mu);--accent:var(--acc);--danger:var(--bad);--tt-dim-c:var(--mu)}
:root[data-tt-contrast=high] .sectietool{--text:CanvasText;--surface:Canvas;--muted:CanvasText;--accent:LinkText;--tt-dim-c:CanvasText}
.sectietool .tt-settings .tt-set-group:first-child{display:none}
.sectietool .tt-btn{color:var(--tx)}
/* class clash: the header's theme toggle is a button.tt (44 px round); the typing box is a div.tt. Reset the toggle's rules inside the tool. */
.sectietool .tt{display:block;place-items:normal;width:auto;height:auto;border:1px solid var(--ln);border-radius:var(--r-ctl);background:var(--pn2);padding:.5rem 1rem;cursor:auto;margin:0;flex:initial}
.sectietool .tt .tt-text{background:none}
.sectietool .tt:has(.tt-input:focus-visible){outline:3px solid var(--acc);outline-offset:2px}
.sectietool .tt-input:focus-visible~.tt-text{outline:0}
/* section navigation, breadcrumb, related pages (below the tool: the top of the page is only the bar and the title) */
.sectienav{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin:0 0 var(--sp-24);padding:0 0 12px;border-bottom:var(--bd) solid var(--ln)}
.sectienav .sn{font:800 16px var(--fh);text-decoration:none;color:var(--tx)}
.sectienav ul{display:flex;flex-wrap:wrap;gap:8px;list-style:none;margin:0;padding:0}
.sectienav li a,.rel2 a{display:inline-flex;align-items:center;min-height:44px;padding:0 12px;border:var(--bd) solid var(--ln);border-radius:var(--r-ctl);text-decoration:none;font-size:14px;color:var(--mu)}
.sectienav li a[aria-current]{color:var(--tx);border-color:var(--acc)}
.rel2{margin:var(--sp-24) 0}
.rel2 h2{font-size:21px;margin:0 0 10px}
.rel2 ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.rel2 a{color:var(--tx)}
.crumbs{font-size:14px;color:var(--mu);margin:var(--sp-24) 0 0}
.crumbs a{color:var(--mu)}
/* text blocks of the section pages: long words and tables must not widen the page */
.cmain .card a{overflow-wrap:anywhere}
.cmain .card table{display:block;max-width:100%;overflow-x:auto}
.cmain .card .lead{margin:0 0 var(--sp-12)}
/* the certificate prints alone: everything but the certificate sheet is hidden */
@media print{
 body.cert-page .col>*:not(.cm),body.cert-page .cm>*:not(.cmain),body.cert-page .cmain>*:not(.sectietool),body.cert-page .sectietool>*:not([data-tt-tool]),body.cert-page [data-tt-tool]>*:not(#cert-root){display:none!important}
 body.cert-page .sectietool{border:0;padding:0;margin:0;background:none}
}

/* ---- the tools' controls in the platform's look (round 4b). This sheet loads LAST on the section pages (after typing-tool.css / random-tool.css), so these rules win by order.
   Buttons = the shared `.btn` (src/styles, same --btn-* tokens): primary action and pressed choice = filled `.btn`, every other button = `.btn.ghost`. Fields = the platform's control tokens (--bg --ctl --tx --r-ctl).
   Nothing here touches an id, a class or a data attribute the tool scripts bind to. */
.sectietool :is(button, a.tt-btn):not(.kb-key){display:inline-flex;align-items:center;justify-content:center;min-height:3rem;padding:0 1.25rem;box-sizing:border-box;background:none;color:var(--lk,var(--acc));font:var(--btn-fw) var(--btn-fs) var(--btn-ff);text-transform:var(--btn-case);letter-spacing:var(--btn-ls);border:var(--btn-ghost-bd) solid var(--btn-ghost-bdc);border-radius:var(--btn-r);box-shadow:none;filter:none;text-decoration:none;cursor:pointer;line-height:normal;transition:box-shadow .12s,transform .12s}
.sectietool :is(.wv-spin,.tm-start,.dv-roll,.cv-flip,.lt-go,.tt-actions>button.tt-btn:first-child,button[aria-pressed=true]):not(.kb-key){background:var(--acc);color:var(--on);border:var(--btn-bd) solid var(--btn-bdc);box-shadow:var(--btn-shadow);outline:0;font-weight:var(--btn-fw)}
.sectietool :is(button, a.tt-btn):not(.kb-key):hover{transform:translate(var(--btn-hover-move));box-shadow:var(--btn-shadow-hover);filter:none}
.sectietool :is(button, a.tt-btn):not(.kb-key,.wv-spin,.tm-start,.dv-roll,.cv-flip,.lt-go,[aria-pressed=true]):not(.tt-actions>button.tt-btn:first-child):hover{border-color:var(--btn-ghost-hover-bdc);box-shadow:none}
.sectietool :is(button, a.tt-btn):focus-visible{outline:3px solid var(--acc);outline-offset:2px}
.sectietool :is(button,a.tt-btn)[hidden]{display:none}
.sectietool button:disabled{opacity:.5;cursor:default}
.sectietool .tt-btn-quiet{text-decoration:underline}
@media (prefers-reduced-motion:reduce){.sectietool :is(button,a.tt-btn):hover{transform:none;transition:none}}
.sectietool :is(textarea,select,input:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=hidden],.tt-input)){box-sizing:border-box;min-height:2.75rem;padding:0 .75rem;font:inherit;font-size:var(--fs-15,.9375rem);color:var(--tx);background:var(--pn2);border:1px solid var(--ln);border-radius:var(--r-ctl);box-shadow:none}
.sectietool textarea{padding:.625rem .75rem;resize:vertical;width:100%}
.sectietool :is(textarea,select,input):focus-visible{outline:3px solid var(--acc);outline-offset:2px}
.sectietool :is(input[type=checkbox],input[type=radio],input[type=range]){accent-color:var(--acc)}
/* the list tools drew their own white sheet and fixed ink colours; they now sit on the card like the other tools */
.sectietool .lt{background:none;color:var(--tx)}
.sectietool .lt :is(.lt-hint,.lt-history,.lt-tag){color:var(--mu)}
.sectietool .lt .lt-notes{color:var(--mu)}
.sectietool .lt .lt-error{color:var(--bad)}
.sectietool .lt-team{background:var(--pn2);border-color:var(--ln);color:var(--tx)}
.sectietool .wv-notes,.sectietool .tm-note,.sectietool .dv-note,.sectietool .cv-note{color:var(--mu)}
/* the wheel and its spin button fit a 1440 x 900 screen: wide screens put the entries (or the controls of a preset wheel) next to the wheel instead of above it */
@media (min-width:1100px){
 .sectietool .wv-root:has(>textarea:not([hidden])){display:grid;grid-template-columns:minmax(14rem,24rem) minmax(0,1fr);grid-template-rows:auto 1fr auto auto auto auto auto;column-gap:1.5rem;align-items:start}
 .sectietool .wv-root:has(>textarea:not([hidden]))>label:first-of-type{grid-column:1;grid-row:1}
 .sectietool .wv-root:has(>textarea:not([hidden]))>textarea{grid-column:1;grid-row:2;align-self:stretch;min-height:12rem}
 .sectietool .wv-root:has(>textarea:not([hidden]))>.wv-notes{grid-column:1;grid-row:3}
 .sectietool .wv-root:has(>textarea:not([hidden]))>.wv-settings{grid-column:1;grid-row:4/8;align-self:start;display:grid;grid-template-columns:1.5rem minmax(0,1fr);gap:.5rem .5rem;align-items:center;margin:0}
 .sectietool .wv-root:has(>textarea:not([hidden]))>.wv-settings>:is(label:first-child,input[type=number],label[for$=pal],select){grid-column:1/-1;justify-self:start}
 .sectietool .wv-root:has(>textarea:not([hidden]))>.wv-results{grid-column:2;grid-row:7;align-self:start;justify-self:center}
 .sectietool .wv-root:has(>textarea:not([hidden]))>.wv-stage{grid-column:2;grid-row:1/4;margin-top:20px}
 .sectietool .wv-root:has(>textarea:not([hidden]))>.wv-spin{grid-column:2;grid-row:4;justify-self:center}
 .sectietool .wv-root:has(>textarea:not([hidden]))>.wv-live{grid-column:2;grid-row:5;justify-self:center;text-align:center}
 .sectietool .wv-root:has(>textarea:not([hidden]))>.wv-panel{grid-column:2;grid-row:6;justify-self:center}
 .sectietool .wv-root:has(>textarea:not([hidden]))>.wp-exit{grid-column:1;grid-row:7}
 [data-tt-tool=wheel]:has(>.wv-root>textarea[hidden]){display:grid;grid-template-columns:minmax(14rem,24rem) minmax(0,1fr);grid-template-rows:auto auto auto auto 1fr;column-gap:1.5rem;align-items:start}
 [data-tt-tool=wheel]:has(>.wv-root>textarea[hidden])>#bar{grid-column:1/-1;grid-row:1}
 [data-tt-tool=wheel]:has(>.wv-root>textarea[hidden])>#controls{grid-column:1;grid-row:2}
 [data-tt-tool=wheel]:has(>.wv-root>textarea[hidden])>#present{grid-column:1;grid-row:3}
 [data-tt-tool=wheel]:has(>.wv-root>textarea[hidden])>#share{grid-column:1;grid-row:4}
 [data-tt-tool=wheel]:has(>.wv-root>textarea[hidden])>.wv-root{grid-column:2;grid-row:2/-1;justify-self:center;width:100%}
 [data-tt-tool=wheel]:has(>.wv-root>textarea[hidden])>details{grid-column:1/-1}
 [data-tt-tool=wheel]:has(>.wv-root>textarea[hidden]) .wv-stage{margin-top:20px}
 [data-tt-tool=wheel] .wv-root:not(:has(>textarea:not([hidden]))) :is(.wv-spin,.wv-live,.wv-panel){margin-left:auto;margin-right:auto;display:flex}
 [data-tt-tool=wheel] .wv-root:not(:has(>textarea:not([hidden]))) .wv-live{justify-content:center}
}
/* Reserved tool height, so the text below the tool does not jump when the tool mounts (CLS). One block for both tool families (round 9, measured 15-11 on the restyled tools at 390 / 1000 / 1440 px
   with the reserves switched off: the SMALLEST of the three heights, minus 10 px, so a reserve is never taller than the tool). Only when scripts run: without JS the tool never mounts. */
@media (scripting:enabled){
[data-tt-tool=timed]{min-height:200px}
[data-tt-tool=practice]{min-height:370px}
[data-tt-tool=lessons]{min-height:700px}
[data-tt-tool=lesson]{min-height:570px}
[data-tt-tool=tenkey]{min-height:260px}
[data-tt-tool=progress]{min-height:110px}
[data-tt-tool=picker]{min-height:310px}
[data-tt-tool=teams]{min-height:380px}
[data-tt-tool=coin]{min-height:470px}
[data-tt-tool=dice][data-preset="20"]{min-height:370px}
[data-tt-tool=timer][data-preset=countdown]{min-height:690px}
[data-tt-tool=timer][data-preset=classroom]{min-height:940px}
[data-tt-tool=pomodoro]{min-height:1040px}
[data-tt-tool=fairness]{min-height:490px}
[data-tt-tool=wheel][data-preset=free]{min-height:990px}
[data-tt-tool=wheel]:is([data-preset=yes-or-no],[data-preset=number],[data-preset=letter],[data-preset=color]){min-height:845px}
}
/* the result of a typing test sits under the text with air */
.sectietool .tt-results{margin-top:1rem}
/* round 9 (hub round 2, job 5): the typing tools use the card's content width, not the 70ch column the old sheet drew (prose blocks keep 70ch, left aligned) */
.sectietool :is(.tt,.tt-bar,.tk-lengths,.tt-storage-note,.pr-kinds,.pr-options,.pr-own,.pr-msg,.pr-skip,.tt-settings,.tt-results,.tt-progress,.cert,.ls-summary,.ls-list,.ls-run,.al-result,.al-best){max-width:none;margin-left:0;margin-right:0}
.sectietool :is(.ls-intro,.ls-drillres){margin-left:0;margin-right:0}
.sectietool .tt-bar{margin-top:var(--sp-12)}
.sectietool #present{margin-top:var(--sp-16)}
.sectietool #share{margin-top:var(--sp-8)}
