/*
 * App shell, ported from docs/focus-mode/prototype/css/shell.css (2026-10-02) without changes except where marked
 * "build:". Pages do not patch the shell; shell changes go here (docs/app-shell/PROPOSALS.md, MERGE.md).
 */


*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--c-base);
	color: var(--c-text-2);
	font: 400 var(--t-17)/var(--lh-17) var(--f-text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

button { font: inherit; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-act-text); }
h1, h2, h3, p { margin: 0; }

/* The player's "Groot" text setting (each app page's head script sets data-text). Type is in rem, so the ramp scales;
   hit targets, art and tab bar labels stay in px */
:root[data-text="large"] { font-size: 112.5%; }

:focus-visible { outline: 2px solid var(--c-act-text); outline-offset: 2px; }

.vp-sr {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.vp-skip {
	position: fixed; left: 16px; top: 8px; z-index: 50;
	padding: 10px 16px; border-radius: var(--r-control);
	background: var(--c-act); color: var(--c-act-on); text-decoration: none;
	font: 500 var(--t-15)/var(--lh-15) var(--f-ui);
	transform: translateY(-200%);
}
.vp-skip:focus { transform: none; }

.vp-i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.vp-i--16 { width: 16px; height: 16px; }
.vp-i--24 { width: 24px; height: 24px; }

/* Buttons: the player's set */
.vp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--s-8);
	min-height: var(--hit); min-width: var(--hit);
	padding: 0 20px;
	border: 1px solid transparent; border-radius: var(--r-control);
	font: 500 var(--t-15)/var(--lh-15) var(--f-ui);
	text-decoration: none; cursor: pointer; white-space: nowrap;
	transition: background-color var(--m-fast), color var(--m-fast), border-color var(--m-fast);
}
.vp-btn--primary { background: var(--c-act); color: var(--c-act-on); }
.vp-btn--primary:hover { background: var(--c-act-hover); }
.vp-btn--secondary { background: var(--c-raised); border-color: var(--c-edge); color: var(--c-text-2); }
.vp-btn--secondary:hover { background: var(--c-raised-hover); }
.vp-btn--ghost { background: none; color: var(--c-text-2); }
.vp-btn--ghost:hover { background: var(--c-raised); }
.vp-btn--icon { padding: 0; width: var(--hit); }

/* ------------------------------------------------------------------ rail (wide and regular) */

.as-rail {
	position: fixed; top: var(--banner-h); left: 0; bottom: 0; z-index: 20;
	width: var(--rail-w);
	display: flex; flex-direction: column; align-items: center; gap: var(--s-8);
	padding: var(--s-24) 0 var(--s-16);
	background: var(--c-base);
}

/* The learner's organisation logo (team logo today); a white disc when the group has none */
.as-rail__org { width: 40px; height: 40px; border-radius: 50%; background: #fff; flex: none; margin-bottom: var(--s-32); }

.as-rail__nav { display: flex; flex-direction: column; gap: var(--s-8); flex: 1; }

/* Dash: 48 px tile with a gradient, border, inset shadow and a white pill. Kept: the tile and its border. */
.as-rail__item {
	width: 48px; height: 48px;
	display: grid; place-items: center;
	border: 1px solid transparent; border-radius: var(--r-panel);
	color: var(--c-text-3);
	transition: background-color var(--m-fast), color var(--m-fast);
}
.as-rail__item:hover { color: var(--c-text); background: var(--c-raised); }
.as-rail__item[aria-current] { color: var(--c-text); background: var(--c-raised); border-color: var(--c-edge); }
/* Management is in the markup for everyone and shown to group leaders only; display: grid and flex would beat [hidden] */
.as-rail__item[hidden], .as-tab[hidden] { display: none; }

.as-rail__tool {
	width: 44px; height: 44px; display: grid; place-items: center;
	border: 0; border-radius: var(--r-control); background: none; cursor: pointer;
	color: var(--c-text-3); text-decoration: none;
	font: 600 var(--t-13)/1 var(--f-ui);
}
.as-rail__tool:hover { color: var(--c-text); background: var(--c-raised); }

/* ------------------------------------------------------------------ frame */

.as-frame {
	position: fixed;
	top: calc(var(--banner-h) + var(--frame-inset)); right: var(--frame-inset); bottom: var(--frame-inset);
	left: calc(var(--rail-w) + var(--frame-inset));
	background: var(--c-surface);
	border-radius: var(--r-frame);
	overflow: auto;
	overscroll-behavior: contain;
	scroll-padding-top: calc(var(--bar-h) + var(--s-16));
}
/* build: focus pages (a minigame) have no rail, so the frame takes the window */
.as-frame--focus { left: var(--frame-inset); }
/* build: a bare page (a certificate's public check) has no frame at all: the page on the window's dark background */
body:has(.as-bare) { background: var(--c-surface); }
.as-bare { display: block; min-height: 100dvh; background: var(--c-surface); }
/* build: bleed pages (the minigames library) start under the top bar, so their art reaches the frame's top edge. The
   bar keeps its controls and stays clear until content scrolls under it (HIG scroll edge appearance); the page reads
   --as-under to keep its own content below the bar */
.as-frame--bleed { --as-under: var(--bar-h); }
.as-frame--bleed > .as-bar { transition: border-color var(--m-fast), background-color var(--m-fast); }
.as-frame--bleed > .as-bar:not(.is-scrolled) { background-color: transparent; }
.as-frame--bleed > main { margin-top: calc(-1 * var(--bar-h)); }

/* ------------------------------------------------------------------ top bar */

.as-bar {
	position: sticky; top: 0; z-index: 5;
	display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); align-items: center; gap: var(--s-16);
	height: var(--bar-h);
	padding: 0 var(--s-12) 0 var(--s-8);
	background: var(--c-surface);
	border-bottom: 1px solid transparent;
	transition: border-color var(--m-fast);
}
/* The hairline shows only once content scrolls under the bar (HIG scroll edge) */
.as-bar.is-scrolled { border-bottom-color: var(--c-hairline); }

.as-bar__lead, .as-bar__trail { display: flex; align-items: center; gap: var(--s-8); min-width: 0; }
.as-bar__lead { grid-column: 1; }
.as-bar__trail { grid-column: 3; justify-content: flex-end; }

.as-back { padding: 0 var(--s-12) 0 var(--s-4); gap: var(--s-4); }

/* Large title collapses into the bar (iOS navigation bar): hidden while the H1 is on screen. Centred on the bar while
   it fits between the wider side twice; otherwise it moves toward the narrower side and then truncates, never under
   the lead or the trail (both side columns are at least their content). On top-level pages the lead is empty and the
   title names the place ("Dashboard"), which may differ from an H1 that is a sentence */
.as-bar__title {
	grid-column: 2;
	max-width: 40ch; min-width: 0;
	font: 500 var(--t-15)/var(--lh-15) var(--f-ui); color: var(--c-text);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	opacity: 0; transition: opacity var(--m-fast);
}
.as-bar.is-scrolled .as-bar__title { opacity: 1; }
/* build: a page whose bar title differs below 768 (title_phone: the settings page is "Profiel" there) prints both */
.as-bar__phone { display: none; }

.as-rank { display: inline-flex; align-items: center; gap: var(--s-8); padding: 0 var(--s-8); font: 500 var(--t-13)/var(--lh-13) var(--f-ui); color: var(--c-text-2); white-space: nowrap; text-decoration: none; }
.as-rank img { width: 20px; height: 20px; object-fit: contain; }

/* Top-bar buttons: 36 visible, 44 hit (4.1 hit target) */
.as-tbtn {
	position: relative;
	display: inline-flex; align-items: center; gap: var(--s-8);
	height: 36px; padding: 0 var(--s-12);
	border: 1px solid var(--c-edge); border-radius: var(--r-control);
	background: var(--c-raised); color: var(--c-text-2);
	font: 500 var(--t-15)/1 var(--f-ui); text-decoration: none; white-space: nowrap; cursor: pointer;
	transition: background-color var(--m-fast);
}
.as-tbtn::before { content: ""; position: absolute; inset: -4px; }
.as-tbtn:hover { background: var(--c-raised-hover); }
.as-tbtn .vp-i { width: 16px; height: 16px; color: var(--c-text-3); }

/* build: Points, option A "label and counter" (docs/prelaunch-2026-11-03/points-button, Primer CounterLabel). The
   bar-button body as Hulp, the total in a solid counter one step lighter than the plate (12.73:1). Neutral at rest.
   The clock (bonus round only) is the button's one glyph. The counter's transparent border shows its box in forced
   colours */
.as-points { padding: 0 5px 0 var(--s-12); font-variant-numeric: tabular-nums; }
.as-points .vp-i { margin-right: -4px; color: var(--c-warn); }
.as-points__c {
	display: inline-grid; place-items: center;
	min-width: 24px; height: 24px; padding: 0 var(--s-8);
	border: 1px solid transparent; border-radius: var(--r-media);
	background: color-mix(in srgb, var(--c-text) 10%, var(--c-raised));
	color: var(--c-text);
	font: 500 var(--t-13)/1 var(--f-ui); font-variant-numeric: tabular-nums;
	transition: background-color var(--m-panel) var(--ease-out);
}
.as-points[aria-current] { background: var(--c-raised-hover); }
.as-points[aria-current] .as-tbtn__label { color: var(--c-text); }
.as-points:hover .as-points__c, .as-points[aria-current] .as-points__c { background: color-mix(in srgb, var(--c-text) 10%, var(--c-raised-hover)); }
/* The moment (assets/js/points.js): two layers in one cell, the total and "+N", so the swap never changes the width;
   green only while points arrive, as a solid counter (warn-on on done, 11.94:1) */
.as-points__slot { display: inline-grid; justify-items: center; }
.as-points__slot > * { grid-area: 1 / 1; transition: opacity var(--m-panel) var(--ease-out); }
.as-points__g { opacity: 0; }
.as-points.is-gain .as-points__now { opacity: 0; }
.as-points.is-gain .as-points__g { opacity: 1; color: var(--c-warn-on); }
.as-points.is-gain .as-points__c { background: var(--c-done); }
/* Points earned since the last page: the server prints a neutral first frame, the old total, with the real total in
   the hidden layer (data-to); the module takes it over and removes data-to. Without the module the layers swap by
   themselves after 1.8 s and the real total shows */
.as-points[data-to] .as-points__now { animation: as-points-now 1ms 1.8s forwards; }
.as-points[data-to] .as-points__g { animation: as-points-g 1ms 1.8s forwards; }
@keyframes as-points-now { to { opacity: 0; } }
@keyframes as-points-g { to { opacity: 1; } }

/* ------------------------------------------------------------------ tab bar (compact only) */

.as-tabs { display: none; }

/* ================================================================== regular */

@media (max-width: 1199px) {
	.as-rank { display: none; }
}

/* ================================================================== compact */

@media (max-width: 767px) {
	.as-rail { display: none; }
	body { background: var(--c-surface); }

	.as-frame { position: static; border-radius: 0; overflow: visible; min-height: 100dvh; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
	/* build: no tab bar on focus pages */
	.as-frame--focus { padding-bottom: env(safe-area-inset-bottom); }
	/* The window scrolls: the sticky bar clears the fixed demo bar (the admin bar scrolls away below 600 px) */
	body.vdm-has-bar { padding-top: var(--demo-h, 0px); }
	.as-bar { top: var(--demo-h, 0px); }

	/* The window scrolls on phones, not the frame: focus and jumps clear the sticky bar and the fixed tab bar (WCAG 2.4.11) */
	html { scroll-padding: calc(var(--bar-h) + var(--s-16)) 0 calc(var(--tab-h) + env(safe-area-inset-bottom) + var(--s-16)); }

	.as-bar {
		column-gap: var(--s-12);
		padding: 0 max(var(--s-4), env(safe-area-inset-right)) 0 max(var(--s-4), env(safe-area-inset-left));
	}
	.as-back .as-back__label { display: none; }
	.as-back { width: var(--hit); padding: 0; }
	.as-bar__title { max-width: none; }
	.as-tbtn__label { display: none; }
	.as-tbtn { width: 36px; padding: 0; justify-content: center; }
	.as-points { width: auto; padding: 0 var(--s-8); }
	/* build: no Hulp, points or Meldingen in the phone bar (Nol, 2026-11-03: "not relevant"), game pages included. Hulp
	   and points are rows on the Profiel tab's page; the markup stays for 768 and up and for the games' point painters
	   (vallem-minigames cypher.js, linkjager/host.js) */
	.as-bar [data-t="help"], .as-bar .as-points, .as-bar [data-t="notes"] { display: none; }
	.as-bar__wide { display: none; }
	.as-bar__phone { display: inline; }

	/* build: a root page (render.php .as-frame--root: a tab's page or a Profiel page) starts under the top bar, as a
	   bleed page does: the bar rests clear and lets taps through until the H1 scrolls under it, then takes its ground,
	   hairline and title (shell.js). The page starts 24 from the top (its own 16 plus 8). A back link or a page action
	   in the bar, from the server or from Manage's setBar(), makes it a sub page's bar again */
	.as-frame--root:not(:has(> .as-bar .as-back, > .as-bar [data-t="action"])) > .as-bar { transition: border-color var(--m-fast), background-color var(--m-fast); }
	.as-frame--root:not(:has(> .as-bar .as-back, > .as-bar [data-t="action"])) > .as-bar:not(.is-scrolled) { background-color: transparent; pointer-events: none; }
	.as-frame--root:not(:has(> .as-bar .as-back, > .as-bar [data-t="action"])) > main { margin-top: calc(var(--s-8) - var(--bar-h)); }

	/* The rail's destinations become a tab bar (HIG Tab bars), replacing the hamburger overlay. One equal column per
	   visible tab: four, five for group leaders (hidden tabs are display: none, so they take no column).
	   build: on the rail's ground (base) with a real edge, 60 high (theme.json custom.size.tab); the current tab is the
	   filled glyph and a 600 label (docs/prelaunch-2026-11-03/mobile-shell/PLAN.md C6) */
	.as-tabs {
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
		display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
		padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
		background: var(--c-base);
		border-top: 1px solid var(--c-edge);
	}
	.as-tab {
		display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-4);
		min-height: var(--tab-h);
		color: var(--c-text-3); text-decoration: none;
		font: 500 var(--t-tab)/1 var(--f-ui);
	}
	.as-tab[aria-current] { color: var(--c-text); font-weight: 600; }
	/* A tab prints its outline glyph; the current tab adds the filled -on form and marks the outline vp-i--off
	   (render.php, inc/shell.php), so it shows the filled one. Fill is class f, cut lines are class cut, cut in the
	   bar's ground */
	.as-tab > .vp-i--off { display: none; }
	.vp-i--on .f { fill: currentColor; }
	.vp-i--on .cut { fill: var(--c-base); stroke: var(--c-base); }
	/* Group leaders and Vallem admins get a fifth tab (HIG Tab bars: up to five); labels 11, 10 below 360 (tokens.css).
	   Counted over the visible tabs: a hidden tab before the fifth must not stop the rule (review-design #1) */
	.as-tabs:has(> .as-tab:nth-child(5 of :not([hidden]))) .as-tab { font-size: var(--t-tab-5); }
	/* HIG allows five tabs. A Vallem admin who also leads an organisation keeps Management in the tab bar and reaches the
	   Vallem page from the rail at R and W (open for Nol: one "Beheer" tab; MERGE.md §9). build: render.php leaves the
	   Vallem tab out when Beheer is there, so the rule above counts the tabs that show */
}

/* build: forced colours drop the fill: the current tab keeps its outline glyph, its 600 label and aria-current */
@media (max-width: 767px) and (forced-colors: active) {
	.as-tab > .vp-i--on { display: none; }
	.as-tab > .vp-i--off { display: block; }
}

/* ================================================================== settings: the way in, and the shared controls
   The settings page is blocks/settings (route `settings`, docs/build/settings.md); its rows live there. The controls
   below are shared: the settings page, the Vallem pages (reminders-schedule, reminders-mails) and the agenda use them.
   They are the player's switch and segmented control and Manage's radio row (player.css, MANSPEC 5.10). */

/* build: the rail's Instellingen tool is a link; on the settings page it is the current place, as a rail item is.
   Phones reach the page through the Profiel tab (render.php) */
.as-rail__tool[aria-current] { color: var(--c-text); background: var(--c-raised); box-shadow: inset 0 0 0 1px var(--c-edge); }

.as-seg { display: flex; padding: 2px; border-radius: var(--r-control); background: var(--c-base); border: 1px solid var(--c-edge); }
.as-seg label { position: relative; }
.as-seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.as-seg span { display: grid; place-items: center; min-height: 40px; padding: 0 var(--s-12); border-radius: 6px; font: 500 var(--t-13)/var(--lh-13) var(--f-ui); color: var(--c-text-3); cursor: pointer; white-space: nowrap; }
.as-seg input:checked + span { background: var(--c-raised-hover); color: var(--c-text); }
.as-seg input:focus-visible + span { outline: 2px solid var(--c-act-text); outline-offset: 2px; }

.as-switch {
	appearance: none; flex: none; margin: 0;
	width: 51px; height: 31px; border-radius: 16px;
	background: var(--c-track); position: relative; cursor: pointer;
	transition: background-color var(--m-fast);
}
.as-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: transform var(--m-fast); }
.as-switch:checked { background: var(--c-act); }
.as-switch:checked::after { transform: translateX(20px); }

.as-radio { position: relative; display: flex; align-items: center; gap: var(--s-12); min-height: 56px; cursor: pointer; }
.as-radio + .as-radio { border-top: 1px solid var(--c-hairline); }
.as-radio input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.as-radio__dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--c-text-3); display: grid; place-items: center; }
.as-radio input:checked ~ .as-radio__dot { border-color: var(--c-act); background: var(--c-act); }
.as-radio input:checked ~ .as-radio__dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-act-on); }
.as-radio:has(input:focus-visible) .as-radio__dot { outline: 2px solid var(--c-act-text); outline-offset: 2px; }
.as-radio__t { display: grid; min-width: 0; }
.as-radio__n { font: 500 var(--t-15)/var(--lh-15) var(--f-ui); color: var(--c-text); }
.as-radio__s { font: 400 var(--t-13)/var(--lh-13) var(--f-text); color: var(--c-text-3); }

/* Forced colours drop backgrounds: the switch's track and knob, the chosen segment and the chosen radio would vanish.
   System colours instead: an outlined track with a CanvasText knob, Highlight when on (review-settings-design #2) */
@media (forced-colors: active) {
	.as-switch { forced-color-adjust: none; background: Canvas; border: 1px solid CanvasText; }
	.as-switch::after { top: 1px; left: 1px; background: CanvasText; }
	.as-switch:checked { background: Highlight; border-color: Highlight; }
	.as-switch:checked::after { background: HighlightText; }
	.as-switch:focus-visible { outline-color: CanvasText; }
	.as-seg input:checked + span { forced-color-adjust: none; background: Highlight; color: HighlightText; }
	.as-radio input:checked ~ .as-radio__dot { forced-color-adjust: none; background: Highlight; border-color: Highlight; }
	.as-radio input:checked ~ .as-radio__dot::after { background: HighlightText; }
}

.as-field {
	height: var(--hit); padding: 0 var(--s-12);
	background: var(--c-raised); border: 1px solid var(--c-edge); border-radius: var(--r-control);
	font: 400 var(--t-15)/var(--lh-15) var(--f-text); color: var(--c-text); color-scheme: dark;
}
.as-field:focus { outline: 2px solid var(--c-act-text); outline-offset: 2px; }

/* A save that failed or a day out of range: warn glyph plus words, under the control */
.as-err { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: var(--s-8); font: 400 var(--t-15)/var(--lh-15) var(--f-text); color: var(--c-text-2); }
.as-err .vp-i { color: var(--c-warn); margin-top: 2px; }

/* build: the organisation's logo inside the white disc (the group's featured image) */
.as-rail__org { display: grid; place-items: center; overflow: hidden; }
.as-rail__org img { width: 100%; height: 100%; object-fit: contain; }
/* build: the language tool is a link to the other language */
a.as-rail__tool { text-decoration: none; }
/* build: plain pages without a page block (page.html, 404.html): the measure, 16 under the bar as every app page */
.pg { padding: var(--s-16) var(--s-48) var(--s-64); }
.pg > * { max-width: var(--measure); }
.pg h1 { margin-bottom: var(--s-16); font: 600 var(--t-28)/var(--lh-28) var(--f-text); color: var(--c-text); letter-spacing: -0.021em; }
.pg p { margin: 0 0 var(--s-16); }
@media (max-width: 767px) {
	.pg { padding: var(--s-16) max(var(--s-16), env(safe-area-inset-right)) var(--s-32) max(var(--s-16), env(safe-area-inset-left)); }
}
/* build: block themes wrap the template in .wp-site-blocks, whose children get the block gap on top; the static phone
   frame would move down by it */
.wp-site-blocks > * { margin-block-start: 0; }
