/* Shared component finish. Loaded after surface styles; colours live in colors_and_type.css. */
/* ---- Paginagrond met organische vlakken (richting A5) ----
   Vijf vormen uit het Figma-ontwerp, elk met eigen verloop. Elke vorm komt vanaf een
   paginarand het beeld in en verlaat dezelfde rand weer. Alleen voor documentpagina's;
   nooit achter of over de praatplaat in de docent- of deelnemersweergave. */
:root {
  --shape-r1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='590 0 850 890'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='.25' y2='1'%3E%3Cstop offset='0' stop-color='%23DDE5D3' stop-opacity='0.85'/%3E%3Cstop offset='1' stop-color='%23D4E5F6' stop-opacity='0.6'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M1440 0H930C880 70 720 110 650 250C580 400 610 590 750 690C870 776 1010 730 1140 790C1260 846 1360 880 1440 850Z'/%3E%3C/svg%3E");
  --shape-l1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 750 545 760'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='.25' y2='1'%3E%3Cstop offset='0' stop-color='%23E1D5F1' stop-opacity='0.6'/%3E%3Cstop offset='1' stop-color='%23D4E5F6' stop-opacity='0.45'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M0 790C120 750 250 784 330 876C400 956 520 960 540 1080C560 1200 450 1262 380 1352C310 1442 150 1424 0 1506Z'/%3E%3C/svg%3E");
  --shape-r2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='1080 1380 360 1180'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='.25' y2='1'%3E%3Cstop offset='0' stop-color='%23D4E5F6' stop-opacity='0.7'/%3E%3Cstop offset='1' stop-color='%23E1D5F1' stop-opacity='0.6'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M1440 1380C1340 1400 1290 1500 1250 1620C1200 1770 1090 1840 1120 2000C1150 2150 1280 2200 1270 2340C1262 2450 1360 2540 1440 2560Z'/%3E%3C/svg%3E");
  --shape-l2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 2796 605 750'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='.25' y2='1'%3E%3Cstop offset='0' stop-color='%23FBE3D6' stop-opacity='0.6'/%3E%3Cstop offset='1' stop-color='%23DDE5D3' stop-opacity='0.45'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M0 2846C140 2796 240 2868 360 2880C500 2894 600 2990 580 3120C562 3240 440 3272 380 3372C320 3472 140 3452 0 3544Z'/%3E%3C/svg%3E");
  --shape-r3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='1250 2960 190 560'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='.25' y2='1'%3E%3Cstop offset='0' stop-color='%23E1D5F1' stop-opacity='0.65'/%3E%3Cstop offset='1' stop-color='%23FBE3D6' stop-opacity='0.5'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M1440 2960C1360 2990 1300 3080 1310 3190C1320 3300 1250 3380 1330 3460C1370 3500 1410 3510 1440 3520Z'/%3E%3C/svg%3E");
}
body.bg-flow {
  background-color: var(--surface-ground);
  background-repeat: no-repeat;
  background-image: var(--shape-r1), var(--shape-l1), var(--shape-r3);
  background-position: right top, left clamp(560px, 62vw, 820px), right 86%;
  background-size: clamp(220px, 46vw, 660px) auto, clamp(170px, 38vw, 545px) auto, clamp(90px, 13vw, 190px) auto;
}
/* Lange pagina (homepage): alle vijf, verdeeld over de hoogte. */
body.bg-flow.bg-flow-long {
  background-image: var(--shape-r1), var(--shape-l1), var(--shape-r2), var(--shape-l2), var(--shape-r3);
  background-position: right top, left 24%, right 50%, left 88%, right 87%;
  background-size: clamp(240px, 59vw, 850px) auto, clamp(170px, 38vw, 545px) auto, clamp(110px, 25vw, 360px) auto, clamp(180px, 42vw, 605px) auto, clamp(90px, 13vw, 190px) auto;
}
/* Korte, smalle schermen (aanmelden): alleen de bovenste vorm. */
body.bg-flow.bg-flow-single { background-image: var(--shape-r1); background-position: right top; background-size: clamp(220px, 46vw, 660px) auto; }
@media print { body.bg-flow { background-image: none; } }

/* ---- Glas: alleen voor wat boven inhoud of beeld zweeft; nooit glas op glas ---- */
.glass { background: var(--glass-fill); border: 1px solid var(--glass-border); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--shadow-glass); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: rgba(255,255,255,.94); } }
@media (prefers-reduced-transparency: reduce) { .glass,.btn-ghost,.site-nav,.site-foot { background: var(--surface-page) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; } }

/* Navigatiebalk: Bovenaan de pagina is de balk doorzichtig, zodat het vlak rechtsboven doorloopt tot de
   rand (zoals in het ontwerp). Pas bij scrollen wordt hij licht glas. Browsers zonder
   scroll-gestuurde animatie houden het glas altijd. */
@supports (animation-timeline: scroll()) {
  .site-nav,body>.nav { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; animation: site-nav-glass linear both; animation-timeline: scroll(root); animation-range: 0 96px; }
  .nav-is-open .site-nav { animation: none; }
}
@keyframes site-nav-glass { to { background: var(--glass-ground); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); } }

html { color-scheme: light; scrollbar-color: var(--border-control) var(--surface-soft); }
body { color: var(--text-primary); }
::selection { background: var(--selection); color: var(--text-primary); }
input,textarea { caret-color: var(--text-primary); }
input::placeholder,textarea::placeholder { color: var(--text-muted); opacity: 1; }
:focus-visible { outline: 3px solid var(--focus) !important; outline-offset: 3px; }
input:focus-visible,textarea:focus-visible,select:focus-visible { border-color: var(--focus) !important; box-shadow: none !important; }
a { text-underline-offset: .2em; }
:where(h1,h2,h3,h4) { text-wrap: balance; }
body :is(h1,h2,h3,h4) { font-family: var(--font-sans); font-weight: 700; }
button,input,select,textarea { font-family: var(--font-sans); }
button:disabled { cursor: not-allowed; }
button[aria-busy="true"] { cursor: progress; }
:where(button,.btn,.hbtn,.pt-btn):disabled { background: var(--surface-disabled); color: var(--text-disabled); box-shadow: none; }
.it,.serif-i,.ital,.h-italic,.pt-h1 .it { font-style: normal; color: var(--text-primary); }
.site-nav .nav-links a { display: inline-flex; align-items: center; min-height: 44px; }
.nav-drawer-link { font-size: 18px; font-weight: 600; }
/* Knoppen: pilvorm. Rolklassen zetten alleen de kleurvariabelen; toestanden staan één keer. */
.btn { min-height: 52px; border-radius: var(--r-pill); padding: 12px 26px; font-size: 17px; font-weight: 600; line-height: 1.3; justify-content: center; }
.btn-nav { min-height: 44px; padding: 8px 20px; font-size: 15px; }
.btn-teacher,.btn-primary[href*="setup"] { --action-primary: var(--action-teacher); --action-primary-hover: var(--action-teacher-hover); --action-primary-active: var(--action-teacher-active); --action-primary-rgb: 31,117,110; }
.btn-student { --action-primary: var(--action-student); --action-primary-hover: var(--action-student-hover); --action-primary-active: var(--action-student-active); --action-primary-rgb: 154,74,124; }
.btn-primary,.btn-teacher,.btn-student { background: var(--action-primary); color: var(--text-on-action); box-shadow: 0 6px 14px rgba(var(--action-primary-rgb),.20); }
:is(.btn-primary,.btn-teacher,.btn-student):hover { background: var(--action-primary-hover); box-shadow: 0 10px 22px rgba(var(--action-primary-rgb),.32); transform: none; }
:is(.btn-primary,.btn-teacher,.btn-student):active { background: var(--action-primary-active); box-shadow: inset 0 2px 5px rgba(0,0,0,.22); }
.btn-ghost { background: var(--glass-fill-strong); color: var(--text-primary); border: 1px solid var(--border-control); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.btn-ghost:hover { background: var(--surface-page); border-color: var(--text-primary); box-shadow: var(--shadow-soft); }
.btn-ghost:active { background: var(--surface-soft); box-shadow: inset 0 2px 5px rgba(var(--ink-rgb),.16); }
.btn:focus-visible { border-radius: var(--r-pill); }
.btn:disabled,.btn[aria-disabled="true"] { background: var(--surface-disabled); color: var(--text-disabled); border-color: transparent; box-shadow: none; cursor: not-allowed; }
.page-head .lead { max-width: 68ch; }
.setup .row-head .lbl { font-weight: 700; }
.seg { border-radius: var(--r-md); flex-wrap: wrap; }
.seg button { border-radius: calc(var(--r-md) - 4px); min-height: 44px; }
.seg button.sel { box-shadow: none; background: var(--action-primary); color: var(--text-on-action); outline: 0; }
.help-btn { width: 32px; height: 32px; }
.head .eyebrow,.page-head .eyebrow,.sect-head .eyebrow { display: none; }
.pt-h1 { font-weight: 700; font-size: clamp(28px,6vw,38px); line-height: 1.2; }
.pt-input { border-color: var(--border-control); border-radius: var(--r-md); }
.pt-input.code.is-ph { color: var(--text-muted); }
.pt-label { font-size: 14px; }
.pt-status.live .sdot,.live-badge .dot,.live-badge .live-dot,.deco-live .dl-dot { animation: none; box-shadow: none; }
.pt-btn { min-height: 48px; border-radius: var(--r-pill); }
.pt-btn.primary { background: var(--action-primary); color: var(--text-on-action); box-shadow: none; }
.pt-btn.primary:hover { background: var(--action-primary-hover); transform: none; }
.pt-btn.primary:disabled,.hbtn.primary:disabled { background: var(--surface-disabled); color: var(--text-disabled); border-color: var(--border-subtle); box-shadow: none; }
.stage { background: var(--surface-soft); }
.hwin,.lespaneel,.kl-card,.pp-search-card,.pp-memo-card,.pp-bril-card { background: var(--surface-page); box-shadow: var(--shadow-dialog); border-radius: var(--r-lg); }
.hwin-title,.lp-title,.kl-card-lead,.pp-sheet h2 { font-weight: 700; }
.hbtn,.hwin .hbtn,.tut-btn { border-radius: var(--r-pill); }
.hbtn.primary { background: var(--action-primary); color: var(--text-on-action); box-shadow: none; }
.hbtn.primary:hover { background: var(--action-primary-hover); transform: none; }
.hbtn:hover { transform: none; }
.hbtn.danger { color: var(--status-danger); }
.hbtn.danger:hover { background: var(--status-danger); color: var(--text-on-action); }
.kl-card-x,.lp-close,.pp-sheet-close,.pp-search-x,.pp-memo-x,.pp-bril-x,.lang-cur,.lang-item { min-height: 32px; min-width: 32px; }
.pp-top { background: var(--surface-page); }
.pt-eyebrow { color: var(--text-secondary); text-transform: none; letter-spacing: 0; font-size: 14px; }
.live-badge,.kv-badge,.toolbar,.tb { box-shadow: var(--shadow-soft); }
.tb-btn.start-live.ready-glow { animation: none; background: var(--surface-teacher); }
.live-badge .dot,.tb-btn.start-live .tb-lamp { animation: none !important; box-shadow: none !important; }
.sc-pill { min-height: 48px; }
.sc-pill .sc-v { white-space: nowrap; }
.tb { background: var(--surface-page); }
body:has(.lm-layer.open,.tconfirm-layer.open) .sc-pill { visibility: hidden; pointer-events: none; }
.lm-eyebrow { display: none; }
.lx-eyebrow { display: none; }
.tconfirm-eyebrow { display: none; }
.tconfirm-card { box-shadow: var(--shadow-dialog); }
.tconfirm-title { font-weight: 700; }
.tconfirm-acts .hbtn { min-height: 44px; }
.lm-card { border: none; box-shadow: var(--shadow-dialog); }
body .lm-card .lm-title { font-weight: 700; }
.lm-card .lm-btn { min-height: 48px; border-radius: var(--r-pill); }
.lm-btn.primary:hover { background: var(--action-primary-hover); transform: none; }
.lm-card .lm-link { font-family: var(--font-sans); border-radius: var(--r-sm); }
.lm-meta .dot { box-shadow: none; }
.backdrop,.hwin-backdrop,.pp-sheet-back,.pp-search-back,.pp-memo-back { background: rgba(var(--ink-rgb),.3); }
/* Aanraakdoelen: minimaal 44 x 44 px (DESIGN.md, Layout), ook met de muis op een
   digibord. De hostwerkbalk schaalt met --tb-scale (standaard 0,8): 55 px in de
   werkbalk is dus 44 px op het scherm. */
.tb-btn { width: calc(44px / var(--tb-scale, .8)); height: calc(44px / var(--tb-scale, .8)); }
.tb-btn.tb-people,.tb-btn.tb-glass,.tb-btn.tb-pushlive { width: auto; min-width: calc(44px / var(--tb-scale, .8)); }
.zc-btn,.fs-btn,.hwin-close,.lm-close,.werk-pin,.poll-opt-row .po-del,.pp-leave-mini,.pp-sheet-close { width: 44px; height: 44px; }

.hbtn,.werk-item,.tool-q,.tool-linkbtn { min-height: 44px; }
.werk-fbtn { height: 44px; }
.pt-leave { min-height: 44px; padding: 0 12px; }
/* Zoom- en volledig-schermknoppen liggen óp de tekening. Sinds 17 november zijn ze
   transparant met een donkere rand en een donker icoon (plaat.css); bij aanwijzen of
   focus krijgen ze een wit vlak. */
.zc-btn:hover,.fs-btn:hover { transform: none; }
/* live-balk: elk onderdeel 44 px hoog; "Beëindigen" staat apart en is als
   destructieve actie herkenbaar zonder hover. */
.live-badge { gap: 2px; padding: 3px 6px; }
.live-badge .lb-toggle { width: 32px; height: 44px; }
.live-badge .lb-text,.live-badge .code,.live-badge .end { min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; }
.live-badge .lb-lock,.live-badge .lb-collapse { width: 44px; height: 44px; }
.live-badge .end { margin-left: 6px; padding-left: 14px; border-left: 1px solid var(--border-subtle); border-radius: 0 var(--r-sm, 8px) var(--r-sm, 8px) 0; color: var(--status-danger); font-size: 13px; }
.live-badge .end:hover { background: var(--surface-danger); color: var(--status-danger-hover); }
.live-badge.is-waiting .end { display: none; }
.live-badge.collapsed { padding: 3px 6px; }
.live-badge.collapsed .lb-text,.live-badge.collapsed .code,.live-badge.collapsed .end { min-height: 0; padding-left: 0; padding-right: 0; margin: 0; border-left: 0; }
@media (pointer: coarse) {
  .kl-card-x,.lp-close,.pp-sheet-close,.pp-search-x,.pp-memo-x,.pp-bril-x,.lang-cur,.lang-item,.help-btn { min-height: 44px; min-width: 44px; }
}
@media (max-width: 640px) {
  .wrap-site { padding-left: 20px; padding-right: 20px; }
  .setup .row-head .lbl { white-space: normal; }
  .kl-card { min-width: 0; width: calc(100% - 32px); padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
  button,.btn,input,select,textarea { border: 1px solid ButtonText; }
  :focus-visible { outline-color: Highlight !important; }
}

/* The floating session code must not cover an open editor or menu. */
body:has(.flyout.show,.hwin-layer.open,#hostSettingsPanel:popover-open) .sc-pill { visibility:hidden; pointer-events:none; }
@media(max-width:640px) { .stage:has(.live-badge) .sc-pill { display:none; } }

/* Session controls: status, invitation code, access and settings in one row. */
.live-badge { gap:2px; padding:6px; border-radius:var(--r-md); }
.live-badge .lb-toggle { width:28px; }
.live-badge .code { margin:0 8px; padding:0 12px; border-radius:var(--r-xs); background:var(--surface-soft); font-variant-numeric:tabular-nums; letter-spacing:.02em; }
.live-badge .lb-lock,.live-badge .lb-settings { border-radius:var(--r-xs); }
.live-badge .lb-lock[aria-pressed="true"] { background:var(--surface-teacher); color:var(--action-teacher); }
.tb-btn.tb-assignment { display:inline-flex; align-items:center; justify-content:center; width:auto; min-width:calc(44px / var(--tb-scale, .8)); gap:8px; padding:0 12px; background:var(--surface-soft); }
.tb-btn.tb-assignment[hidden] { display:none; }
.sticky .sn-corner-tr { gap:4px; padding:4px; border-radius:10px; }
.sticky .sn-push,.sticky .sn-del { width:auto; min-width:44px; min-height:44px; padding:0 10px; gap:6px; font-size:13px; white-space:nowrap; }
.sticky .sn-push { background:var(--action-teacher); color:var(--text-on-action); }
.sticky .sn-push:hover { background:var(--action-teacher-hover); color:var(--text-on-action); }
.sticky .sn-min { min-width:44px; min-height:44px; }
body .lm-card.lm-invite { width:min(560px,calc(100vw - 32px)); box-sizing:border-box; padding:36px; text-align:left; max-height:calc(100dvh - 32px); overflow:auto; border-radius:var(--r-lg); }
body .lm-invite .lm-title { padding-right:32px; font-size:28px; line-height:1.25; margin:0 0 12px; }
body .lm-invite .lm-sub { margin:0 0 28px; font-size:16px; line-height:1.55; }
body .lm-invite .lm-link { display:block; border:0; padding:0; margin:0 0 28px; background:transparent; color:var(--action-primary); font:600 20px/1.5 var(--font-sans); text-decoration:underline; text-underline-offset:4px; overflow-wrap:anywhere; cursor:pointer; }
.lm-code-caption { margin:0 0 8px; font-size:14px; color:var(--text-secondary); }
body .lm-invite .lm-code { margin:0 0 24px; font-family:var(--font-mono,monospace); font-size:clamp(30px,6vw,48px); line-height:1.2; font-weight:700; letter-spacing:.08em; color:var(--text-primary); user-select:all; }
.lm-copy-actions { display:flex; flex-wrap:wrap; gap:8px; }
.lm-copy-actions .lm-btn { padding:10px 14px; font-size:14px; flex:1 1 auto; }
.lm-copy-status { min-height:20px; font-size:13px; color:var(--text-secondary); margin:10px 0 16px; }
body .lm-invite .lm-meta { justify-content:flex-start; margin:0; font-size:14px; }
body .lm-invite .lm-actions { margin-top:28px; padding-top:24px; border-top:1px solid var(--border-subtle); justify-content:flex-end; }
body .lm-invite .lm-actions .lm-btn { flex:0 1 auto; min-width:120px; }
@media(max-width:520px) {
 body .lm-card.lm-invite { padding:24px; }
 body .lm-invite .lm-title { font-size:24px; }
 .live-badge { gap:0; }
 .live-badge .code { margin:0 4px; padding:0 8px; }
 .sticky .sn-del span { display:none; }
}

.live-badge.collapsed.locked .lb-lock { max-width:44px; opacity:1; }
@media(max-width:700px) {
 .tconfirm-layer { position:fixed; z-index:600; padding:16px; }
}

.sticky .sn-push:disabled { background:var(--surface-disabled); color:var(--text-disabled); cursor:default; }
.live-badge .lb-lock svg,.live-badge .lb-settings svg { width:20px; height:20px; }

.tb:has(.tb-pushlive[data-kind="lenses"]) .tb-glass { display:none; }

/* ---- Taalkiezer (language-switcher.js): gesloten alleen de vlag, open alleen de andere taal ---- */
.lang-flag { display: inline-block; flex: 0 0 auto; width: 24px; height: 16px; border-radius: 2px; overflow: hidden; line-height: 0; box-shadow: 0 0 0 1px rgba(var(--ink-rgb),.22); }
.lang-flag svg { display: block; width: 100%; height: 100%; }
.lang-switch { position: relative; display: inline-flex; flex-shrink: 0; font-family: var(--font-sans); }
.lang-switch-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border-control); border-radius: var(--r-pill); background: var(--surface-page); cursor: pointer; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.lang-switch-btn:hover,.lang-switch-btn[aria-expanded="true"] { border-color: var(--text-primary); }
.lang-switch-menu { position: fixed; inset: auto; margin: 0; padding: 6px; width: max-content; max-width: calc(100vw - 16px); display: none; flex-direction: column; overflow: visible; border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: var(--surface-page); color: var(--text-primary); box-shadow: var(--shadow-soft); z-index: 400; }
.lang-switch-menu:popover-open,.lang-switch-menu.is-open { display: flex; }
.lang-switch-opt { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 16px 8px 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-primary); font: 600 .9375rem/1.2 var(--font-sans); text-align: left; white-space: nowrap; cursor: pointer; }
.lang-switch-opt:hover { background: var(--surface-soft); }

.settings-row .lang-switch { justify-self: end; }
@media (max-width: 380px) { .settings-row .lang-switch { justify-self: start; } }
