/*-----------------------------------------------------------------------------
 * Project : Mentor - Interactive Courses for Schools
 * File    : public/css/shell.css
 * Stylesheet : the frame — header and pills, the three zones and their handles, the course path, the phone bar, the page foot, the sign-in card
 * Author  : Johann Sievering
 * AI Support : Claude Code
 * Date    : 2026-10-25 The first slice: frontend shell
 * Rev     : forked from ergane v0.69.1 public/css/shell.css (Ergane's tabs menu, team head, loop, day banner, text-size chooser and history lists removed; the course path and the phone bar added)
 * Rev     : 2026-10-25 The owner's request: the complement pane's handle resizes the pane (resize cursor, no panning under a finger, no transition while dragging)
 * Rev     : 2026-10-25 0.3.0, the owner's notes: the working zone and the pane scroll each on their own; the pane's handle shows a grip [||]; the pane's title strip; the pastel pages of the pane
 * Rev     : 2026-10-26 0.9.0: each zone that scrolls is the containing block of its visually hidden texts (no second scrollbar)
 * Rev     : 2026-10-26 0.11.0: the chapters of the path open and close, « Tout ouvrir » and « Tout fermer » (D-31); a chapter not reached (D-30)
 * Rev     : 2026-10-27 0.14.0, the owner's notes on 0.13.0: the text size menu « A » of the header (pattern of Ergane's
 *           shell.css); the path no longer starts a header's height below its column
 * Rev     : 2026-11-01 0.21.0: « Mettre à jour PythonVoltaire » in the account menu — the hint under its label, the dot of a newer release
 * Rev     : 2026-11-01 0.21.1: the account corner after SamGest's design — the avatar, the name, the menu card with its icons and the
 *           language pills inside (pattern of SamGest v0.3.3 public/assets/css/layout.css, the dropdown and the avatar)
 * Rev     : 2026-11-01 0.22.0: a chapter's status badge and its sequences' marks in the menu, « Mon parcours » first (brief §8, §9)
 * Rev     : 2026-11-03 0.29.0: a chapter's « Défis bonus » in the path — a ★ and the « facultatif » badge (D-63); 2026-11-10 0.45.0: the course menu's view button and « Continuer ici » (the owner's report, §2); 0.47.0: a course's title in the menu; 2026-11-13 0.53.0: the mark of the header holds one letter, « M »: its size (D-166); 2026-11-14 0.57.0: the wide card of the guests' public pages (D-193)
 * Version : 0.57.0
 *-----------------------------------------------------------------------------
 * Brief chapter 16 and docs/analysis/04 §3. Laptop first (1366 × 768): a
 * solid header in the primary colour; below it three vertical zones — the
 * course path, the working zone, the complement pane — the first and the
 * last collapsible with a short transition (a collapsed zone also leaves
 * the tab order: visibility hidden once the transition ends). From 768 px
 * up the frame fills the window and each zone scrolls on its own (three
 * scrollbars, the owner's note 6). Between 768
 * and 1024 px the side columns narrow. Under 768 px one zone at a time,
 * chosen with the fixed bottom bar « Parcours · Travail · Aide ». No
 * horizontal page scroll at any width; every target is at least 44 px.
 *---------------------------------------------------------------------------*/

:root {
    --nav-width: 16rem;
    --aside-width: 21rem;
    --nav-bg: var(--primary-dark);
    --nav-text: #DCE6F0;
    --shell-transition: 220ms ease;
    --zone-bar-height: 3.5rem;
}

/* ── Header bar ── */
.app-header {
    position: sticky; top: 0; z-index: var(--z-header);
    display: flex; align-items: center; gap: var(--space-3);
    min-height: var(--header-height); padding: 0 var(--space-4);
    background: var(--header-bg); color: var(--header-text);
    box-shadow: var(--shadow-sm);
}
.app-header :focus-visible { outline-color: #FFFFFF; }
.app-header__brand {
    display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target);
    color: var(--header-text); text-decoration: none; font-weight: 700; font-size: 1.15rem; white-space: nowrap;
}
.app-header__brand:hover { color: var(--header-text); }
.app-header__spacer { flex: 1; }

/* The logo placeholder: a text mark in the accent colour (no image file until the owner chooses a logo). */
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 2.25rem; height: 2.25rem; margin: 0;
    font-family: var(--font-mono); font-weight: 800; font-size: 1.4rem; letter-spacing: 0; line-height: 1;
    color: #FFFFFF; background: var(--accent); border-radius: var(--radius);
}
.brand-mark--large { display: flex; width: 4rem; height: 4rem; margin: 0 auto var(--space-3); font-size: 2.5rem; border-radius: var(--radius-lg); }

/* The areas the role may use (absent otherwise, never greyed). */
.app-tabs { display: flex; align-items: center; gap: var(--space-1); margin-left: var(--space-3); }
.app-tabs:empty { display: none; }
.app-tab {
    display: inline-flex; align-items: center; min-height: var(--target); padding: 0 var(--space-3);
    border-radius: var(--radius); color: var(--header-text); text-decoration: none;
    font-weight: 500; font-size: var(--font-size-sm); white-space: nowrap;
}
.app-tab:hover { color: var(--header-text); background: rgba(255, 255, 255, 0.15); }
.app-tab[aria-current="page"] { background: rgba(255, 255, 255, 0.22); font-weight: 700; }

/* The account corner (0.21.1, after SamGest's design): a round avatar with the initials and, on a laptop, the name and
   the main role; the menu is a card under it. */
.app-header__user { position: relative; display: flex; align-items: center; gap: var(--space-2); }
.app-header__user-btn {
    display: inline-flex; align-items: center; gap: var(--space-2);
    min-height: var(--target); padding: var(--space-1) var(--space-2);
    font: inherit; font-size: var(--font-size-sm); color: var(--header-text);
    background: transparent; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
}
.app-header__user-btn:hover, .app-header__user-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.15); }
.avatar {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 34px; height: 34px;
    border-radius: 50%; background: var(--accent); color: #FFFFFF; font-weight: 700; font-size: var(--font-size-sm); position: relative;
}
.app-header__user-name { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; line-height: 1.15; text-align: left; }
.app-header__user-name strong { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-header__user-btn .chip { color: var(--header-text); background: rgba(255, 255, 255, 0.2); }
.app-header__menu {
    position: absolute; right: 0; top: calc(100% + var(--space-1));
    min-width: 18rem; max-width: min(92vw, 24rem); padding: var(--space-2); margin: 0; list-style: none;
    background: var(--bg-card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); z-index: var(--z-menu);
}
.app-header__menu[hidden] { display: none; }
.account-menu__head { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); border-bottom: 1px solid var(--border); }
.account-menu__role { font-size: var(--font-size-sm); color: var(--text-light); }
.account-menu__item {
    display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: var(--target); padding: var(--space-2) var(--space-3);
    font: inherit; color: var(--text); background: none; border: 0; border-radius: var(--radius); text-align: left; text-decoration: none; cursor: pointer;
}
.account-menu__item:hover { background: var(--gray-50); }
.account-menu__item .icon { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; color: var(--text-light); }
.app-header__menu :focus-visible { outline-color: var(--focus); }
.account-menu__langs { display: flex; align-items: center; gap: var(--space-1); padding: var(--space-2) var(--space-3); }
.account-menu__langs-label { margin-right: var(--space-1); font-size: var(--font-size-sm); color: var(--text-light); }
/* « Mettre à jour PythonVoltaire »: the rotate icon, then the label and under it the release and what the entry does
   (components/AppUpdate.js). */
.app-header__update-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.app-header__update-hint { font-size: var(--font-size-xs); color: var(--text-light); font-weight: 400; }
/* A newer release runs on the server: a dot on the avatar, the entry in the primary colour. */
.has-app-update .avatar::after { content: ''; position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--header-text); border: 2px solid var(--header-bg); }
.has-app-update .app-header__update { color: var(--primary); font-weight: 700; }
.app-header .btn--sm { min-height: var(--target); color: var(--header-text); border-color: rgba(255, 255, 255, 0.6); background: transparent; }
.app-header .btn--sm:hover { background: rgba(255, 255, 255, 0.15); }

/* The text size menu « A », between the account and the languages: five « A » of growing sizes, the one in force
   outlined (the owner's note on 0.13.0, as in Ergane). */
.app-header__text-size { position: relative; display: flex; }
.text-size-btn {
    position: relative; min-width: var(--target); min-height: var(--target); padding: 0 var(--space-2);
    font: inherit; font-weight: 700; font-size: var(--font-size-md); color: var(--header-text);
    background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.6); border-radius: var(--radius); cursor: pointer;
}
.text-size-btn:hover, .text-size-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.25); }
.text-size-menu {
    position: absolute; right: 0; top: calc(100% + var(--space-1)); z-index: var(--z-menu);
    display: grid; gap: 2px; min-width: 6rem; margin: 0; padding: var(--space-2); list-style: none;
    background: var(--bg-card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.text-size-menu[hidden] { display: none; }
.text-size-menu__item {
    display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--target); padding: var(--space-1) var(--space-3);
    font: inherit; font-weight: 700; color: var(--text); background: none; border: 2px solid transparent; border-radius: var(--radius); cursor: pointer;
}
.text-size-menu__item:hover { background: var(--gray-50); }
.text-size-menu__item[aria-checked="true"] { border-color: var(--primary); }
.text-size-menu__a { line-height: 1; }

/* The FR | EN pills: in the header on the sign-in page (white on the primary colour), in the account menu's « Langue »
   row once signed in (the card's colours, the active one filled). */
.app-header__langs { display: flex; gap: var(--space-1); }
.lang-pill {
    min-width: var(--target); min-height: var(--target); padding: 0 var(--space-2);
    font: inherit; font-weight: 700; font-size: var(--font-size-xs);
    color: var(--header-text); background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.6); border-radius: var(--radius-pill); cursor: pointer;
}
.lang-pill:hover { background: rgba(255, 255, 255, 0.15); }
.lang-pill[aria-pressed="true"] { color: var(--primary-dark); background: var(--header-text); border-color: var(--header-text); }
.account-menu__langs .lang-pill { min-height: 36px; color: var(--text); background: var(--bg-card); border-color: var(--border); }
.account-menu__langs .lang-pill:hover { background: var(--gray-50); }
.account-menu__langs .lang-pill[aria-pressed="true"] { color: #FFFFFF; background: var(--primary); border-color: var(--primary); }

/* ── The three zones: [path] [handle] [working zone] [handle] [complement pane] ── */
.shell {
    display: grid; grid-template-columns: var(--nav-width) auto minmax(0, 1fr) auto var(--aside-width);
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    transition: grid-template-columns var(--shell-transition);
    /* clip, not hidden: a hidden overflow would make the shell a scroll container and break the sticky elements inside it */
    overflow-x: hidden; overflow-x: clip;
}
.shell--path-collapsed { grid-template-columns: 0 auto minmax(0, 1fr) auto var(--aside-width); }
.shell--aside-collapsed, .shell--aside-empty { grid-template-columns: var(--nav-width) auto minmax(0, 1fr) auto 0; }
.shell--path-collapsed.shell--aside-collapsed, .shell--path-collapsed.shell--aside-empty { grid-template-columns: 0 auto minmax(0, 1fr) auto 0; }
.shell--anonymous { grid-template-columns: 0 0 minmax(0, 1fr) 0 0; }
/* Each zone keeps its column even when a handle is hidden (a hidden element leaves the grid flow). */
.shell__nav { grid-column: 1; grid-row: 1; }
.shell__toggle--nav { grid-column: 2; grid-row: 1; }
.shell__main { grid-column: 3; grid-row: 1; min-width: 0; }
.shell__toggle--aside { grid-column: 4; grid-row: 1; }
.shell__aside { grid-column: 5; grid-row: 1; }

/* A folded zone fades, then leaves the tab order and the accessibility tree (visibility, delayed to the end of the fade). */
.shell__nav, .shell__aside { transition: opacity var(--shell-transition), visibility 0s linear 0s; }
.shell--path-collapsed .shell__nav, .shell--anonymous .shell__nav,
.shell--aside-collapsed .shell__aside, .shell--aside-empty .shell__aside, .shell--anonymous .shell__aside {
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity var(--shell-transition), visibility 0s linear 220ms;
}

/* ── The course path (sidebar) ── */
.shell__nav {
    /* clip, not hidden: a hidden overflow would make the column a scroll container and break the sticky inner column */
    overflow: hidden; overflow: clip;
    background: var(--nav-bg); color: var(--nav-text);
}
.shell__nav-inner {
    position: sticky; top: var(--header-height);
    display: flex; flex-direction: column; gap: var(--space-3);
    max-height: calc(100vh - var(--header-height) - var(--footer-height)); padding: var(--space-4) var(--space-3);
    overflow-y: auto; overscroll-behavior: contain;
}
.shell__label { margin: 0; font-size: var(--font-size-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #E8F0F8; }
.path__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.path__list[hidden] { display: none; }
.path__list--sequences { margin: 2px 0 var(--space-2) var(--space-3); padding-left: var(--space-2); border-left: 1px solid rgba(255, 255, 255, 0.22); }
.path__link, .path__title {
    display: flex; align-items: center; min-height: var(--target); padding: var(--space-1) var(--space-3);
    border-radius: var(--radius); color: var(--nav-text); text-decoration: none; font-weight: 500; line-height: 1.3;
}
.path__item--chapter > .path__link, .path__item--chapter > .path__title { font-weight: 700; color: #FFFFFF; }
.path__link:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.1); }
.path__link[aria-current="page"] { background: var(--accent); color: #FFFFFF; font-weight: 700; }
/* A finished sequence or chapter quiz: a ✓ at the end of its line (light green on the dark path: 7:1). */
.path__text { flex: 1 1 auto; min-width: 0; }
.path__done { flex: 0 0 auto; margin-left: var(--space-2); font-weight: 700; color: #9FE3B8; }
.path__link[aria-current="page"] .path__done { color: #FFFFFF; }
/* A locked entry (the final quiz of an unfinished chapter): in sight, dashed and quiet, not a link. */
.path__link--locked { color: #B9C7D6; border: 1px dashed rgba(255, 255, 255, 0.3); cursor: default; }
.path__lock { flex: 0 0 auto; margin-left: var(--space-2); font-size: 0.9em; }
/* The statuses of a pupil's own path (the owner's brief of 2026-11-01, §8): the badge of a chapter in words, the mark of a
   sequence — ✓ done, ◐ in progress, ○ to do — never a colour alone. */
.path__mark { flex: 0 0 auto; margin-left: var(--space-2); font-weight: 700; }
.path__doing { color: #FFD6A8; }
.path__todo { color: #B9C7D6; }
.path__status { flex: 0 0 auto; margin-left: var(--space-2); padding: 0 var(--space-2); font-size: var(--font-size-xs); font-weight: 700; line-height: 1.5; border-radius: var(--radius-pill); white-space: nowrap; }
.path__status--todo { color: #E6EDF4; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.35); }
.path__status--doing { color: #3B2411; background: #FFD6A8; }
.path__status--done { color: #0B3B22; background: #9FE3B8; }
/* A chapter's « Défis bonus » (D-63): after the final quiz, a gold ★ (8:1 on the dark path) and « facultatif » in words. */
.path__item--bonus { margin-top: var(--space-1); }
.path__star { flex: 0 0 auto; margin-right: var(--space-2); color: #FFD66B; }
.path__badge { display: inline-block; padding: 0 var(--space-1); font-size: var(--font-size-xs); font-weight: 600; line-height: 1.5; color: #E6EDF4; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: var(--radius-pill); white-space: nowrap; }
.path__link[aria-current="page"] .path__badge { color: #FFFFFF; border-color: rgba(255, 255, 255, 0.7); }
/* « Mon parcours », the map of the course, first in the menu (§9). */
.path__item--mine { margin-bottom: var(--space-2); padding-bottom: var(--space-2); border-bottom: 1px solid rgba(255, 255, 255, 0.22); }
.path__link--mine { font-weight: 700; color: #FFFFFF; }
/* Several courses (0.47.0): the title of a course above its first chapter, quiet, never a link. */
.path__course { margin: var(--space-3) 0 var(--space-1); padding: 0 var(--space-2); font-size: var(--font-size-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); list-style: none; }
/* A chapter's title keeps its words whole: the badge and the ✓ move to a second line when the column is narrow. */
.path__toggle { flex-wrap: wrap; }
.path__toggle .path__text { flex: 1 1 9rem; }
.path__toggle .path__status { margin-left: auto; }
.path__item.is-open > .path__title { background: rgba(255, 255, 255, 0.08); }
/* A chapter of the path opens and closes (the owner's decision D-31): its title is a button with ▸ or ▾; two small
   buttons above the path open or close every chapter. */
.path__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.path__tools { display: flex; gap: var(--space-1); }
.path__tools[hidden] { display: none; }
.path__tool {
    min-height: 2rem; padding: 0 var(--space-2); border: 1px solid rgba(255, 255, 255, 0.35); border-radius: var(--radius);
    background: transparent; color: #E8F0F8; font: inherit; font-size: var(--font-size-xs); cursor: pointer;
}
.path__tool:hover { background: rgba(255, 255, 255, 0.1); color: #FFFFFF; }
/* The course menu's view (0.45.0): « Afficher tous les chapitres » / « Afficher le chapitre en cours », the first and
   widest of the tools, on a line of its own when the column is narrow. */
.path__tools { flex-wrap: wrap; }
.path__tool--view { font-weight: 700; border-color: rgba(255, 255, 255, 0.6); }
.path__tool[hidden] { display: none; }
/* Where the pupil goes on: « Continuer ici » in words, in the warm colour of « En cours » (the owner's report of
   2026-11-10, §2), and a bar in front of the entry. */
.path__item--resume > .path__link { box-shadow: inset 4px 0 0 #FFD6A8; background: rgba(255, 214, 168, 0.12); flex-wrap: wrap; }
/* The title keeps its words whole: « Continuer ici » goes to a line of its own when the column is narrow. */
.path__item--resume > .path__link > .path__text { flex: 1 1 7rem; }
.path__resume { flex: 0 0 auto; margin-left: auto; padding: 0 var(--space-1); font-size: var(--font-size-xs); font-weight: 700; line-height: 1.5; color: #3B2411; background: #FFD6A8; border-radius: var(--radius-pill); white-space: nowrap; }
.path__toggle {
    display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: var(--target); padding: var(--space-1) var(--space-3);
    border: 0; border-radius: var(--radius); background: transparent; color: #FFFFFF; font: inherit; font-weight: 700; line-height: 1.3;
    text-align: left; cursor: pointer;
}
.path__toggle:hover { background: rgba(255, 255, 255, 0.1); }
.path__chevron { flex: 0 0 auto; width: 0.8em; }
.path__chevron::before { content: '▸'; }
.path__toggle[aria-expanded="true"] .path__chevron::before { content: '▾'; }
.path__item.is-open > .path__toggle { background: rgba(255, 255, 255, 0.08); }
/* A chapter not reached yet (D-30): its title muted, its sequences in sight, neither a link nor a lock each. */
.path__item--locked > .path__toggle { color: #B9C7D6; }
.path__link--quiet { border: 0; color: #9DAEC0; }
@media (max-width: 47.99rem) {
    .path__tool { min-height: var(--target); }
}
.shell__nav :focus-visible { outline-color: #FFFFFF; }
.path__empty { margin: 0; font-size: var(--font-size-sm); color: var(--nav-text); }
.path__empty[hidden] { display: none; }

/* ── The handles between the zones (a 44 px hit area around a slim visible tab) ── */
.shell__toggle {
    align-self: start; position: sticky; top: calc(var(--header-height) + var(--space-3));
    width: 1.5rem; height: var(--target); margin: var(--space-3) 0 0; padding: 0;
    font: inherit; font-size: 1.1rem; font-weight: 700; line-height: 1; color: var(--primary); background: var(--primary-soft);
    border: 1px solid var(--primary); cursor: pointer;
}
.shell__toggle::after { content: ''; position: absolute; top: 0; bottom: 0; left: -0.625rem; right: -0.625rem; }
.shell__toggle > span { display: inline-block; transition: transform var(--shell-transition); }
.shell__toggle--nav { border-radius: 0 var(--radius) var(--radius) 0; border-left: 0; }
.shell__toggle--aside { border-radius: var(--radius) 0 0 var(--radius); border-right: 0; }
.shell__toggle:hover { color: #FFFFFF; background: var(--primary); }
.shell--path-collapsed .shell__toggle--nav > span { transform: scaleX(-1); }
/* The complement pane's handle is a grip [||] (the owner's note 8): it is pressed and dragged, it points no way. */
.shell__grip { display: inline-block; width: 0.55rem; height: 1.1rem; border-left: 2px solid currentColor; border-right: 2px solid currentColor; vertical-align: middle; }
.shell__toggle[hidden], .shell--anonymous .shell__toggle { display: none; }
/* The complement pane's handle also resizes the pane (AppShell wireAsideResize): the horizontal-resize cursor says
   so on a pointer screen, and touch-action none keeps the browser from panning under a finger, so the drag reaches the script. */
.shell__toggle--aside { cursor: ew-resize; touch-action: none; }
/* While the pane follows the pointer: no transition (it would lag behind), no text selection, one cursor everywhere. */
.shell--resizing, .shell--resizing .shell__nav, .shell--resizing .shell__aside { transition: none; }
.shell--resizing { user-select: none; -webkit-user-select: none; }
.shell--resizing, .shell--resizing * { cursor: ew-resize; }

/* ── The complement pane ── */
.shell__aside { min-width: 0; padding: var(--space-4) var(--space-4) var(--space-5) var(--space-2); overflow: hidden; transition: opacity var(--shell-transition), visibility 0s linear 0s, background-color var(--shell-transition); }
.shell__aside .panel { margin-bottom: var(--space-4); padding: var(--space-4); }
.shell__aside h2 { font-size: var(--font-size-md); }
/* A concept page or the memento over the pane's own content: the whole pane takes its pastel (the owner's note 2). */
.shell__aside.is-concept { background: var(--concept-bg); }
.shell__aside.is-memento { background: var(--memento-bg); }

/* The title strip of every page of the pane (the owner's note 3): large, on a band of colour, and in sight
   while the pane scrolls. Its colour says what the page is: theory, quiz, recap, concept, memento. */
.pane-head {
    /* The pane's own top padding counts in the sticky offset: minus that padding, the strip sticks to the very top. */
    position: sticky; top: calc(-1 * var(--space-4)); z-index: 1;
    margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4);
    color: #FFFFFF; background: var(--primary); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.pane-head__kicker { margin: 0; font-size: var(--font-size-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.92; }
.shell__aside .pane-head__title, .pane-head__title { margin: 0; font-size: var(--font-size-xl); font-weight: 700; line-height: 1.25; color: inherit; }
.pane-head__title:focus { outline: none; }
.pane-head__sub { margin: var(--space-1) 0 0; font-size: var(--font-size-sm); opacity: 0.95; }
.pane-head--quiz { background: var(--accent); }
.pane-head--recap { background: var(--success); }
.pane-head--concept { background: var(--concept-strong); }
.pane-head--memento { background: var(--memento-strong); }
/* The big way back of a page laid over the pane's content (« Reprendre », the owner's note 2). */
.pane-resume { width: 100%; min-height: 3.25rem; margin: 0 0 var(--space-4); font-size: var(--font-size-lg); white-space: normal; }
.pane-resume--end { margin: var(--space-5) 0 0; }

/* ── Page frame ── */
.page { max-width: var(--page-max); margin: 0 auto; padding: var(--space-5) var(--space-5) var(--space-8); }
.page--narrow { max-width: 40rem; }
.page--wide { max-width: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-5); }
.page-head h1 { margin: 0; }
.page-head p { margin: var(--space-1) 0 0; color: var(--text-light); }
.page-head__text { flex: 1 1 20rem; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

/* The page foot stays at the bottom of the window on a laptop; the body keeps room for it. */
body { padding-bottom: var(--footer-height); }
.page-foot {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: calc(var(--z-header) - 1);
    min-height: var(--footer-height); padding: var(--space-2) var(--space-5);
    font-size: var(--font-size-sm); color: var(--text-light); text-align: center;
    background: var(--bg-card); border-top: 1px solid var(--border);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2);
}
.page-foot strong { color: var(--text); font-weight: 600; }

/* ── The phone bar (hidden on wider screens) ── */
.zone-bar { display: none; }

/* ── Sign-in card ── */
.login-card {
    max-width: 28rem; margin: var(--space-6) auto; padding: var(--space-6);
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.login-card h1 { text-align: center; font-size: var(--font-size-xl); }
.login-card__subtitle { text-align: center; color: var(--text-light); }
/* The guests' pages (0.57.0): the same card; a wider one for the privacy notice, and the line under a form. */
.login-card--wide { max-width: 44rem; }
.login-card--wide h2 { margin: var(--space-4) 0 var(--space-1); font-size: var(--font-size-md); }
.login-card .chip { display: inline-block; margin: 0 0 var(--space-3); }
.guest-card__foot { margin-top: var(--space-4); text-align: center; }
.guest-card__foot.actions { justify-content: center; }

/* ── From 768 px: the frame fills the window, each zone scrolls on its own (the owner's note 6) ──
   The body is a column (header, then the frame) as tall as the window less the page foot; the frame's one row is
   exactly that tall, so the path, the working zone and the pane each get their own vertical scrollbar. */
@media (min-width: 48rem) {
    body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; }
    body > * { flex: 0 0 auto; }
    body > .shell { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
    /* relative, not static: a visually hidden text (absolute) stays in the zone that scrolls it; placed against the
       page instead, a text below the fold of a long path would lengthen the page and give it a second scrollbar. */
    .shell__main, .shell__aside { position: relative; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
    .shell__main { scrollbar-gutter: stable; }
    /* top: 0 — the sticky rule's offset (the header's height) would otherwise move a relative column down by as much:
       an empty band above the menu and its last 56 px cut off (the owner's note on 0.13.0). */
    .shell__nav-inner { position: relative; top: 0; height: 100%; max-height: none; }
}

/* ── Tablets: the side columns narrow so the working zone keeps its room ── */
@media (max-width: 64rem) {
    :root { --nav-width: 13.5rem; --aside-width: 17rem; }
    .page { padding: var(--space-4) var(--space-4) var(--space-6); }
}

/* ── Phones (under 768 px): one zone at a time, chosen with the bottom bar ── */
@media (max-width: 47.99rem) {
    .shell, .shell--path-collapsed, .shell--aside-collapsed, .shell--aside-empty,
    .shell--path-collapsed.shell--aside-collapsed, .shell--path-collapsed.shell--aside-empty, .shell--anonymous {
        grid-template-columns: minmax(0, 1fr); transition: none;
    }
    .shell > * { grid-column: 1; grid-row: 1; }
    .shell__toggle { display: none; }
    /* The handles' folded state does not apply here: the bar decides which zone is shown. */
    .shell > .shell__nav, .shell > .shell__main, .shell > .shell__aside { display: none; opacity: 1; visibility: visible; pointer-events: auto; transition: none; }
    .shell[data-zone="path"] > .shell__nav, .shell[data-zone="main"] > .shell__main, .shell[data-zone="aside"] > .shell__aside { display: block; }
    .shell--aside-empty > .shell__aside, .shell--anonymous > .shell__nav, .shell--anonymous > .shell__aside { display: none; }
    .shell--anonymous > .shell__main { display: block; }
    .shell__nav { min-height: calc(100vh - var(--header-height) - var(--zone-bar-height)); }
    .shell__nav-inner { position: static; max-height: none; overflow: visible; }
    .shell__aside { padding: var(--space-4) var(--space-3); }
    /* The window scrolls on a phone, under a header of variable height: the strip stays in the flow. */
    .pane-head { position: static; }

    .zone-bar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-header);
        display: flex; gap: 1px; min-height: var(--zone-bar-height);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--border); border-top: 1px solid var(--border);
    }
    .zone-bar__btn {
        flex: 1 1 0; min-height: var(--zone-bar-height); padding: var(--space-1) var(--space-2);
        font: inherit; font-weight: 600; font-size: var(--font-size-sm); color: var(--text);
        background: var(--bg-card); border: 0; border-top: 3px solid transparent; cursor: pointer;
    }
    .zone-bar__btn[hidden] { display: none; }
    .zone-bar__btn[aria-pressed="true"] { color: var(--accent-dark); border-top-color: var(--accent); background: var(--accent-soft); }
    body.has-zone-bar { padding-bottom: calc(var(--zone-bar-height) + env(safe-area-inset-bottom, 0px)); }
    body { padding-bottom: 0; }
    .page-foot { position: static; padding: var(--space-2) var(--space-3); }

    .app-header { flex-wrap: wrap; gap: var(--space-2); padding: var(--space-1) var(--space-3); }
    /* The areas wrap onto their own line: a tab must stay in sight, never off the edge. */
    .app-tabs { order: 5; flex-basis: 100%; flex-wrap: wrap; margin-left: 0; }
    /* On a phone the avatar stands alone; the name and the role wait in the card. */
    .app-header__user-name { display: none; }
    .page { padding: var(--space-4) var(--space-3) var(--space-6); }
    .page-head__actions { width: 100%; }
    .page-head__actions .btn { flex: 1 1 auto; }
    .login-card { margin: var(--space-4) auto; padding: var(--space-5) var(--space-4); }
}

/* A very narrow phone (320 px reflow, WCAG 1.4.10): the brand keeps its mark, the name gives way. */
@media (max-width: 22rem) {
    .app-header .brand-name { display: none; }
}
