/* /admin: the shell (sidebar, top bar, pickers, text size, Overview boxes) is copied from e-Rawat's admin.css
   (2026/11/16, 7 website\admin shell.md: copy, do not redraw); the page parts in the middle are the starter's own. */
:root { --danger-line: #d9534f; }   /* --danger lives in style.css with the theme tokens (buttons use it too) */
.admin { display: grid; min-height: 100svh; }
@media (min-width: 900px) { .admin { grid-template-columns: var(--side-w, 240px) minmax(0, 1fr); } }

/* ---- Menu: one block (2026/11/12, drop-down sections; replaces the two-row top menu and the uppercase group heads) ----
   Side menu: brand, Overview, then one drop-down per section (Clinic, Finance, Medicine, HR, Staff & access, Website,
   Settings & rules), then the bottom block (My account, move the menu, Log out, version). Section buttons and Overview are
   the important words: bigger, 600, ink (Desmond 2026/11/12 "make it bigger and bold it"); the pages under them are 400.
   The open page in accent with a bar on its left. A closed section shows the sum of its counts. */
/* One left gutter (Desmond 2026/11/15 "margin need to fix"): the logo, Overview, the section names, My account and the version
   all start 16px from the menu's edge (6px side padding + 3px bar + 7px), the pages under a section one 16px step more (32px);
   counts and chevrons end 16px from the right edge (6px + 10px). */
.side { min-width: 0; padding: 20px 6px; overflow-x: hidden; overflow-x: clip; border-right: 1px solid var(--line); background: var(--bg-alt); font-size: var(--fs-ui); }
.side .brand { display: flex; align-items: center; gap: 10px; margin: 0 10px 16px; overflow-wrap: anywhere; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.side .brand .brand-text { display: flex; flex-direction: column; min-width: 0; }
.side .brand .brand-tag { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.nav-group, .nav-items { display: grid; gap: 2px; }
.nav-items[hidden] { display: none; }
.nav-group form { margin: 0; }
.nav-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.side nav a, .side nav button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 10px 0 7px; margin: 0; border: 0; border-left: 3px solid transparent;
    border-radius: 0 8px 8px 0; font: inherit; font-weight: 400; color: var(--text); background: none; text-align: left; cursor: pointer; }
/* long words wrap inside the column, never a sideways scroll; the count keeps its place on the right */
.side nav a, .side nav button { min-width: 0; overflow-wrap: anywhere; }
.nav-label, .nav-sec-name { min-width: 0; padding-block: 6px; line-height: 1.35; }
.side nav .count { flex: none; margin-left: auto; }
.side nav .nav-home, .side nav .nav-sec-btn, .side nav .nav-dd-btn { font-size: calc(var(--fs-ui) + 2px); font-weight: 600; color: var(--ink); }
.nav-sec-name { flex: 1; }
.nav-sec .nav-items a { padding-left: 23px; }   /* the pages sit one 16px step in from their section */
.nav-sec-btn[aria-expanded="true"] .nav-sum { display: none; }
.side nav .count + .chev { margin-left: 0; }
.chev { flex: none; margin-left: auto; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[aria-expanded="true"] > .chev { transform: rotate(180deg); }
.side nav a[aria-current] { color: var(--accent); background: var(--surface); border-left-color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .side nav a:hover, .side nav button:hover { color: var(--ink); background: var(--surface); text-decoration: none; } }
/* Version and What's new at the end of the bottom block */
.side-ver { margin: 4px 10px 0; font-size: 13px; color: var(--muted); }
/* Width: a drag handle on the right edge (shell.js), saved in the side_w cookie and set by PHP as one of these classes */
.side-handle { display: none; }
@media (min-width: 900px) {
    .admin:not(.nav-top) .side-handle { display: block; position: fixed; top: 0; bottom: 0; left: calc(var(--side-w, 240px) - 6px); z-index: 12; width: 12px;
        cursor: col-resize; touch-action: none; }
    .side-handle::after { content: ""; position: absolute; top: 50%; left: 4px; width: 4px; height: 44px; margin-top: -22px; border-radius: 2px; background: transparent; }
    .side-handle:hover::after, .side-handle:focus-visible::after, .side-handle.is-dragging::after { background: var(--line-strong); }
    .side-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
    .side-handle.is-dragging::after { background: var(--accent); }
}
.side-w-200 { --side-w: 200px; } .side-w-208 { --side-w: 208px; } .side-w-216 { --side-w: 216px; } .side-w-224 { --side-w: 224px; }
.side-w-232 { --side-w: 232px; } .side-w-240 { --side-w: 240px; } .side-w-248 { --side-w: 248px; } .side-w-256 { --side-w: 256px; }
.side-w-264 { --side-w: 264px; } .side-w-272 { --side-w: 272px; } .side-w-280 { --side-w: 280px; } .side-w-288 { --side-w: 288px; }
.side-w-296 { --side-w: 296px; } .side-w-304 { --side-w: 304px; } .side-w-312 { --side-w: 312px; } .side-w-320 { --side-w: 320px; }
.side-w-328 { --side-w: 328px; } .side-w-336 { --side-w: 336px; } .side-w-344 { --side-w: 344px; } .side-w-352 { --side-w: 352px; }
.side-w-360 { --side-w: 360px; }
@media (min-width: 900px) {
    /* the sidebar stays in view; the bottom block sits at the foot of the screen */
    /* the side column is as tall as the page (no grey gap); the menu inside stays in view, and a menu taller than the
       screen scrolls with the page until its end shows (shell.js sets --side-top), so every item can be reached */
    .admin:not(.nav-top) .side-in { position: sticky; top: var(--side-top, 0px); min-height: 100svh; display: flex; flex-direction: column; }
    .admin:not(.nav-top) .side { padding-top: 0; padding-bottom: 0; }
    .admin:not(.nav-top) .side-in { padding: 20px 0; }
    .admin:not(.nav-top) .side nav { flex: 1; }
    .admin:not(.nav-top) .nav-foot { margin-top: auto; }
}
/* Phone: the sidebar is a drawer under the top bar, opened by the Menu button, so every page starts with its own content */
@media (max-width: 899px) {
    .side { display: none; border-right: 0; border-bottom: 1px solid var(--line); }
    .side.is-open { display: block; position: fixed; inset: 56px 0 0; z-index: 9; overflow-y: auto; }
}
/* Menu across the top (2026/11/12 "drop down section by section"): one row. Overview, a drop-down button per section (the
   admin's three in one Admin drop-down), the Account drop-down at the right. A panel opens below its button (shell.js adds
   .nav-js: click, Esc, click outside); without JS a panel shows while its button has focus. The open page's section is underlined. */
.nav-dd-panel { display: none; }
.nav-bar.nav-js .nav-dd-btn[aria-expanded="true"] + .nav-dd-panel, .nav-bar:not(.nav-js) .nav-dd:focus-within > .nav-dd-panel { display: grid; gap: 2px; }
.nav-sub { margin: 10px 10px 2px; font-size: var(--fs-ui); font-weight: 600; color: var(--ink); }
.nav-sub:first-child { margin-top: 4px; }
.nav-dd-panel .side-ver { margin: 6px 10px 2px; }
@media (max-width: 899px) {
    /* in the phone drawer the panels open in place under their button (all of them without JS) */
    .nav-bar:not(.nav-js) .nav-dd-panel { display: grid; gap: 2px; }
    .nav-dd-panel { padding-left: 12px; }
}
@media (min-width: 900px) {
    .nav-top.admin { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-content: start; }
    .nav-top .side { position: relative; z-index: 15; display: flex; align-items: center; gap: 16px; padding: 0 clamp(16px, 3vw, 40px);
        overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
    .nav-top .side-in { display: contents; }
    .nav-top .side .brand { margin: 0; font-size: 16px; white-space: nowrap; gap: 8px; }
    .nav-top .side .brand .brand-tag { display: none; }
    /* one row; at the biggest text size with long BM words at 900px it wraps instead of scrolling the page sideways */
    .nav-top .nav-bar { flex: 1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 4px; min-width: 0; }
    .nav-top .nav-bar > a, .nav-top .nav-bar .nav-dd-btn { width: auto; min-height: 48px; padding: 0 10px; border-left: 0; border-bottom: 2px solid transparent;
        border-radius: 0; white-space: nowrap; overflow-wrap: normal; }
    .nav-top .nav-bar > a[aria-current], .nav-top .nav-dd[data-current] > .nav-dd-btn { color: var(--accent); background: none; border-bottom-color: var(--accent); }
    .nav-dd { position: relative; }
    .nav-acct { margin-left: auto; }
    .nav-dd-panel { position: absolute; top: 100%; left: 0; z-index: 20; width: max-content; min-width: 220px; max-width: 320px;
        max-height: calc(100svh - 64px); overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
    .nav-acct .nav-dd-panel, .nav-dd-panel.nav-dd-end { left: auto; right: 0; }   /* nav-dd-end: shell.js, near the right edge */
    .nav-top .nav-dd-panel a[aria-current] { background: var(--bg-alt); }
}
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
    .nav-top .nav-dd-panel a:hover, .nav-top .nav-dd-panel button:hover { background: var(--bg-alt); }
    .nav-top .nav-bar > a:hover, .nav-top .nav-bar .nav-dd-btn:hover { background: none; border-bottom-color: var(--line-strong); }
    .nav-top .nav-bar > a[aria-current]:hover, .nav-top .nav-dd[data-current] > .nav-dd-btn:hover { border-bottom-color: var(--accent); }
}

/* Top bar, one 56px row, 8px gaps: Menu (phones) · search (grows) · notifications · language · theme · name and role */
.admin-body { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 clamp(12px, 3vw, 40px);
    border-bottom: 1px solid var(--line); background: var(--bg); font-size: var(--fs-ui); }
.menu-btn { display: none; flex: none; }
.topbar-tools { display: flex; flex: none; align-items: center; gap: 8px; margin-left: auto; }
.topbar-user { flex: none; max-width: 240px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.topbar-user b { color: var(--ink); font-weight: 600; }
.lang-pick { display: flex; align-items: center; gap: 8px; margin: 0; }
.lang-pick select { min-height: 44px; padding: 0 6px 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink);
    font: 600 var(--fs-ui)/1.2 var(--sans); cursor: pointer; }
.topbar .theme, .login-tools .theme { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--surface); }
@media (hover: hover) and (pointer: fine) { .topbar .theme:hover { background: var(--bg-alt); text-decoration: none; } }
/* Phone: Menu button in, the user's name out (it is in My account) */
@media (max-width: 899px) {
    .menu-btn { display: inline-flex; }
    .topbar-user { display: none; }
}
/* Login and 2FA tools row (2026/11/15): the brand, then language and theme, all 44px high; the two controls never shrink and
   wrap together to the right on a narrow box instead of squeezing the theme name */
.login-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; }
.login-box .login-tools .brand { flex: 1 1 0; min-width: 140px; min-height: 44px; margin: 0; white-space: normal; line-height: 1.3; }
.login-pick { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; max-width: 100%; margin-left: auto; }   /* may wrap: at 122% on a 320 px phone the row was 30 px too wide */
.login-tools .lang-pick select, .login-tools .theme { height: 44px; min-height: 44px; }
.login-tools .lang-pick select { padding: 0 8px 0 12px; }
.login-tools .theme { flex: none; gap: 8px; min-width: 44px; padding: 0 14px 0 12px; font-weight: 600; }
@media (pointer: coarse) { .filters a { min-height: 44px; } }

/* ---- Page parts (tables, pills, filters, forms) ---- */
.admin-main { min-width: 0; padding: 24px clamp(16px, 3vw, 40px) 64px; }
.admin-main > * + * { margin-top: 16px; }
.admin-main h2 { font-size: 16px; margin-bottom: 10px; }
.sub { margin-top: 32px; }

.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.tile-num { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: var(--fs-ui); color: var(--muted); }
.tile-num b { font-size: 26px; font-weight: 600; color: var(--ink); }
.tile-num.alert { border-color: var(--accent); }
.cols { display: grid; gap: 16px; }
@media (min-width: 1100px) { .cols { grid-template-columns: 1fr 1fr; } }
.panel { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.panel.narrow { max-width: 520px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-ui); }
.message p { margin-block: 10px; white-space: normal; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); }
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; font-weight: 600; color: var(--muted); background: var(--surface); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.panel table th { background: none; }

.pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 13px; color: var(--text); background: none; cursor: pointer; }
.pill.ok { border-color: var(--accent); color: var(--ink); }
.pill.bad { border-color: var(--danger-line); color: var(--danger); }
.inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline select, .inline input, .search input { min-height: 44px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
.search { display: flex; gap: 8px; max-width: 420px; }
.search input { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; color: var(--text); font-size: var(--fs-ui); }
.filters a[aria-current] { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.notice.error { border-color: var(--danger-line); }
code { font-size: 12px; }

.admin-login { display: grid; place-items: center; min-height: 100svh; padding: 16px; }
.login-box { width: min(100%, 380px); }
.login-box .brand { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-ui); margin-bottom: 8px; }
.login-box h1 { margin-bottom: 20px; }
.login-box .form { margin-top: 16px; }
.login-box .form > .btn { justify-self: stretch; }   /* one main action: full width */
.login-box .small { margin-top: 16px; }


/* ---- From e-Rawat again: page head, counts, Overview, spacing, text size, phone top bar ---- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 { font-size: 26px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 99px; font-size: 12px; font-weight: 600; line-height: 22px; text-align: center; color: var(--on-accent); background: var(--accent); }
/* Overview as Up Album (Desmond 2026/11/11): 5 numbers on top, boxes in columns, staff online, notification status */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
@media (max-width: 639px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: grid; gap: 4px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
a.kpi:hover { text-decoration: none; border-color: var(--line-strong); }
.kpi__label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.kpi__value { font-size: 30px; font-weight: 600; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi.is-hot { border-color: var(--accent); }
.kpi.is-hot .kpi__value { color: var(--accent); }
.dash { columns: 3 320px; column-gap: 16px; margin-top: 16px; }
.admin-main .dash > .panel { display: block; break-inside: avoid; margin: 0 0 16px; }
.box-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.box-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.box-head h2 .count { margin-left: 0; }
.box-head a { flex: none; font-size: 13px; white-space: nowrap; }
.empty-state { margin: 0; padding: 16px 8px; text-align: center; font-size: var(--fs-ui); color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); }
.box-foot { margin-top: 10px; }
.need-list { display: grid; margin: 0; padding: 0; list-style: none; }
.need-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-ui); color: var(--ink); }
.need-list li:last-child { border-bottom: 0; }
.need-list small { color: var(--muted); }
.home-numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 8px; }
.home-numbers div { padding: 10px 12px; border-radius: 8px; background: var(--bg-alt); }
.home-numbers dt { font-size: 12px; color: var(--muted); }
.home-numbers dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.home-numbers .is-late dd { color: var(--warn); }
.home-numbers dd .st { font-size: 12px; font-weight: 400; margin-left: 6px; }
/* Content spacing (Sonnet audit): one rhythm for .admin-main, steps of 8/12/16/24; cards 12px radius, 16px padding */
.admin-main h2 { margin-bottom: 12px; }
.page-head > h1, .page-head > h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; }   /* title and actions share one baseline; no stray h2 margin */
.page-head + .filters, .page-head + .list-bar { margin-top: 16px; }
.sub { margin-top: 24px; }
.sub > * + * { margin-top: 12px; }                      /* inside a section: head, table, hint, form at an even 12px */
.row { padding: 8px 0; overflow-wrap: anywhere; }
.panel > .row:last-child, .panel > p.row:last-child { border-bottom: 0; }
.panel .table-wrap { border: 0; border-radius: 0; }    /* no box inside a box */
.empty { padding: 16px 0; }
.box-head { margin-bottom: 12px; }
.home-numbers { gap: 12px; }
.kpi, .note { padding: 16px; }
.notice, .vline { border-radius: 12px; }
.notice { padding: 12px 16px; }
@media (max-width: 639px) {
    .admin-main { padding-bottom: 48px; }
    .page-head > .actions-row, .page-head > .filters { width: 100%; }
    .search, .pform, .vform, .form.wide { max-width: 100%; }
    .panel.narrow, .care-void .form, .notify-desktop { max-width: 100%; }
}

/* Text size 1 to 5 per staff member (Desmond 2026/11/11): the whole clinic screen scales; 3 = normal */
html[data-text="1"] body.admin, html[data-text="1"] body.admin-login { zoom: 0.88; }   /* the login page too (this PC's ui_text cookie) */
html[data-text="2"] body.admin, html[data-text="2"] body.admin-login { zoom: 0.94; }
html[data-text="4"] body.admin, html[data-text="4"] body.admin-login { zoom: 1.1; }
html[data-text="5"] body.admin, html[data-text="5"] body.admin-login { zoom: 1.22; }
/* Full height at every text size (Desmond 2026/11/16 "text 1 to 5 also able to show until footer"): the zoom above also
   zooms 100svh, so size 1-2 left a gap under the menu and size 4-5 pushed My account / Log out below the screen.
   --tz is the same zoom; dividing by it gives exactly one screen height again. */
html[data-text="1"] { --tz: 0.88; } html[data-text="2"] { --tz: 0.94; } html[data-text="4"] { --tz: 1.1; } html[data-text="5"] { --tz: 1.22; }
.admin, .admin-login { min-height: calc(100svh / var(--tz, 1)); }
@media (min-width: 900px) { .admin:not(.nav-top) .side-in { min-height: calc(100svh / var(--tz, 1)); } }
/* S7: the small "New" after a menu name (config site.new) */
sup.new { margin-left: 4px; font-size: 11px; font-weight: 600; line-height: 0; vertical-align: super; color: var(--accent); }
.text-pick { display: inline-flex; gap: 4px; }
.text-pick button { min-width: 44px; min-height: 44px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.text-pick button:disabled { opacity: .45; cursor: default; }
.text-pick .text-now { align-self: center; min-width: 44px; text-align: center; font-size: var(--fs-ui); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }   /* the size now, 88% to 122% (100% = normal) */

/* Phone top bar (2026/11/11 check at 375 px: 6 controls were 32 px too wide): the tools may wrap onto a second row,
   the search takes its own full row, and the patient banner stops sticking so it never sits under a taller bar */
@media (max-width: 639px) {
    .topbar { flex-wrap: wrap; height: auto; min-height: 56px; padding-block: 6px; row-gap: 6px; }
    .topbar-tools { flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
    .topbar .lang-pick select { padding: 0 4px; }
}

/* Login check boxes: Show password, Keep me logged in (44px rows) */
.form .check-row, .check-row { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; min-height: 44px; font-size: var(--fs-ui); color: var(--text); cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.check-row .hint { display: block; }

/* Phone top bar and warning colour (builder PHONE 2026/11/15).
   --warn: the warning text colour (waiting long, late, amber chips and flags), 4.5:1 or better on every theme:
   #8a5a00 on Light and Silver, #f0c36d on Dark. Use var(--warn) for any new warning text. */
:root, :root[data-theme="light"], :root[data-theme="silver"] { --warn: #8a5a00; }
:root[data-theme="dark"] { --warn: #f0c36d; }
/* No data-theme (a page before the theme is set): the light value from :root, or dark when the device is dark. That is
   enough; the review (2026/11/16, B14) left it as it is. */
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --warn: #f0c36d; } }
/* A field moved into view never hides under the sticky bar: shell.js measures the bar (--topbar-h on screen, --topbar-in
   inside the text-size zoom); 56px without JavaScript */
html { scroll-padding-top: calc(var(--topbar-h, 56px) + 8px); }
@media (max-width: 899px) { .side.is-open { top: var(--topbar-in, 56px); } }
/* Text size, language and theme: in the top bar on wider screens, in the Menu drawer on phones */
.side-picks { display: none; }
@media (max-width: 639px) {
    /* one row: Menu, search (takes what is left), help, bell */
    .topbar { flex-wrap: nowrap; height: auto; min-height: 56px; padding-block: 6px; }
    .topbar-tools { flex-wrap: nowrap; gap: 6px; }
    .topbar-picks { display: none; }
    .side-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; padding: 12px 16px; border-top: 1px solid var(--line); }
    .side-picks .theme { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--surface); }
    .side-picks .theme .theme-name { display: inline; }
    /* a long button word wraps instead of pushing the page wider than the phone (text size 5 made it 385 px) */
    .btn { max-width: 100%; white-space: normal; }
}
@media (min-width: 640px) { .topbar-picks { display: contents; } }

/* Profile and blog forms: wide, two columns (BM | EN) from 900px */
.form.wide { max-width: 1100px; }
.form.wide .panel { display: grid; gap: 14px; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.form textarea { resize: vertical; line-height: 1.5; }
.thumb { width: 120px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumb.wide-thumb { width: 240px; aspect-ratio: 16 / 9; }

.step-n { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; margin-right: 8px; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 12px; font-weight: 600; }
.step-box { scroll-margin-top: 72px; }
.step-box h2 { display: flex; align-items: center; }
.qa { display: grid; gap: 4px; }
.qa-q { color: var(--ink); font-weight: 600; }
.qa-why { color: var(--muted); font-size: 13px; }
.save-bar { position: sticky; bottom: 0; padding: 12px 0; background: var(--bg); border-top: 1px solid var(--line); }
.checks { display: grid; gap: 6px; margin-bottom: 12px; }
.checks li { color: var(--muted); }
.checks li.is-ok { color: var(--ink); }
.checks li span[aria-hidden] { display: inline-block; width: 1.4em; color: var(--accent); }
.alert-line { border-color: var(--accent); }
.switch-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch-row input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.switch-row small { display: block; }
