@layer ui-sdk;

/* CertiPass 2027, the new app shell (docs/redesign-2027/12-fundatia.md).
   The approved prototype's styles (prototypes/redesign-2027/a2-cancelarie/app.css) over ui-sdk's web.css,
   both served from this app: assets/app/vendor/ui-sdk/0.1.0-beta.5/ (Apache-2.0).
   Shared file: change it only with a message first (docs/redesign-2027/11-impartire-constructie.md).
   No Bootstrap here. Screen-specific styles (documents, galleries, editors) belong to each part. */

/* Interface fonts, served from this app (assets/app/fonts/, SIL OFL 1.1, OFL.txt). Variable files: one per subset. */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 200 800; font-display: swap; src: url("../assets/app/fonts/bricolage-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 200 800; font-display: swap; src: url("../assets/app/fonts/bricolage-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-weight: 100 900; font-display: swap; src: url("../assets/app/fonts/geist-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-weight: 100 900; font-display: swap; src: url("../assets/app/fonts/geist-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-weight: 100 900; font-display: swap; src: url("../assets/app/fonts/geist-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-weight: 100 900; font-display: swap; src: url("../assets/app/fonts/geist-mono-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Cerneală: ultramarine rail, saffron for the one main action, a grey-blue page with white cards (V-050, owner 26 Nov: the
   events prototype's --bg #f5f6fa and --border #e4e7ee, events-ux-prototype.html; replaces V-045's live grey #f5f5f4). */
:root {
  color-scheme: light;
  --paper: #f5f6fa;
  --paper-2: #eef0f5;
  --sunken: #e8ebf1;
  --surface: #fff;
  --line: #e4e7ee;
  --line-2: #d5dae4; /* the prototype's --border-2 */
  --edge: oklch(0.6 0.02 265); /* 3.7:1 on the page, 3.5:1 on --paper-2, 3.3:1 on --sunken */
  --ink: oklch(0.24 0.015 70);
  --ink-2: oklch(0.4 0.013 70);
  --ink-3: oklch(0.5 0.012 70);
  --accent: oklch(0.4 0.17 264);
  --accent-2: oklch(0.33 0.15 264);
  --accent-soft: oklch(0.935 0.035 264);
  --ok: oklch(0.46 0.1 155);
  --ok-mid: oklch(0.66 0.09 155);
  --ok-soft: oklch(0.95 0.035 155);
  --warn: oklch(0.5 0.1 70);
  --warn-soft: oklch(0.95 0.05 88);
  --bad: oklch(0.5 0.17 28);
  --bad-soft: oklch(0.955 0.028 28);
  --cta: oklch(0.83 0.15 86);
  --cta-ink: oklch(0.25 0.05 70);
  --cta-hover: oklch(0.78 0.16 80);
  --cta-edge: oklch(0.56 0.13 75);
  --rail-bg: oklch(0.33 0.14 264);
  --rail-ink: oklch(0.975 0.008 85);
  --rail-ink-2: oklch(0.87 0.04 264);
  --rail-hover: oklch(0.4 0.14 264);
  --rail-line: oklch(0.47 0.12 264);
  --doc-paper: oklch(0.995 0.004 90);
  --doc-ink: oklch(0.36 0.12 264);
  --doc-text: oklch(0.25 0.02 264);
  --doc-gold: oklch(0.62 0.11 85);
  --doc-gold-text: oklch(0.28 0.03 85);
  --on-ink-2: oklch(0.85 0.01 85);
  --ink-hover: oklch(0.32 0.015 70);
  --shade: oklch(0.24 0.015 70 / 0.2);
  --on-ink-ok: oklch(0.8 0.1 155);
  --on-ink-bad: oklch(0.82 0.09 28);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-base: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.3125rem;
  --t-xl: 1.75rem;
  --t-2xl: 2.375rem;
  --r: 8px;
  --control-h: 38px; /* one height for a field and the buttons beside it: inputs, the select trigger, .btn (44 px on phones) */
  --r-lg: 12px;
  --rail: 256px;
  --page: 1552px;
  --fab-gutter: 76px;
  --shadow-s: 0 1px 2px oklch(0.24 0.015 70 / 0.14);
  --shadow: 0 1px 2px oklch(0.24 0.015 70 / 0.06), 0 10px 28px -10px oklch(0.24 0.015 70 / 0.22);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --z-foot: 5;
  --z-bar: 10;
  --z-nav: 20;
  --z-toast: 40;
  --z-skip: 60;

  --ui-background: var(--surface);
  --ui-foreground: var(--ink);
  --ui-muted: var(--sunken);
  --ui-muted-foreground: var(--ink-3);
  --ui-border: var(--line);
  --ui-input: var(--edge);
  --ui-primary: var(--accent);
  --ui-primary-foreground: var(--paper);
  --ui-destructive: var(--bad);
  --ui-ring: var(--accent);
  --ui-ring-border: var(--accent);
  --ui-overlay: oklch(0.24 0.015 70 / 0.38);
  --ui-shadow: var(--shadow);
  --ui-radius: var(--r);
  --ui-font-size: var(--t-base);
  --ui-font-sans: var(--font);
  --ui-font-mono: var(--mono);
}
/* Administrare is another room: the same rail, in ink. */
[data-mode="admin"] { --rail-bg: var(--ink); --rail-ink: var(--paper); --rail-ink-2: var(--on-ink-2); --rail-hover: var(--ink-hover); --rail-line: var(--ink); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--t-base)/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
b, strong { font-weight: 600; }
button, input, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num, time, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); letter-spacing: 0.01em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }
/* Before ui-sdk defines its elements, they take the same boxes as after, so the page does not jump while it loads. */
ui-menu-content:not(:defined), ui-select-content:not(:defined), ui-dialog-content:not(:defined), ui-dialog-backdrop:not(:defined), ui-field-error:not(:defined) { display: none; }
:is(ui-button, ui-input, ui-textarea, ui-select, ui-select-trigger, ui-tabs-tab, ui-menu-trigger, ui-dialog-trigger, ui-file-input-trigger):not(:defined) { display: contents; }
:is(ui-field-label, ui-field-description, ui-tabs-panel, ui-menu):not(:defined) { display: block; }
ui-segmented-control:not(:defined) { display: flex; gap: 2px; width: fit-content; }
ui-segmented-control-item:not(:defined) { display: flex; align-items: center; }
ui-switch:not(:defined) { display: flex; width: 32px; height: 18px; }
:is(ui-radio, ui-checkbox):not(:defined) { display: flex; width: 16px; height: 16px; }

.skip { position: fixed; left: 12px; top: 12px; z-index: var(--z-skip); padding: 8px 14px; border-radius: var(--r); background: var(--ink); color: var(--paper); transform: translateY(-72px); transition: transform 0.15s var(--ease); }
.skip:focus { transform: none; }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.i-s { width: 15px; height: 15px; }
.rot-u { rotate: -90deg; }
.rot-d { rotate: 90deg; }
.rot-l { rotate: 180deg; }
.on-narrow { display: none; }
.end { margin-left: auto; }
.mt-s { margin-top: 12px; }
.mt-m { margin-top: 20px; }
.mt-l { margin-top: 32px; }
.mb-m { margin-bottom: 24px; }

/* ---------- Shell: the rail is the menu, the top bar says where you are ---------- */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100dvh; }
.col { min-width: 0; display: flex; flex-direction: column; }
/* Scrollbars (owner, 18 Nov 2026, O-073): thin, in the app's greys, no track; on the page and on every inner box that
   scrolls (menus, the search, tables, the list editor, the editor's panels). Still visible wherever something scrolls;
   the boxes that hide theirs on purpose (tab rows) say so themselves. The rail's is in the rail's colour. */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.rail, .rail * { scrollbar-color: var(--rail-line) transparent; }
@supports not (scrollbar-width: thin) { /* Safari before 18.2 */
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 8px; background: var(--line-2); background-clip: content-box; }
  ::-webkit-scrollbar-thumb:hover { background-color: var(--ink-3); }
}

/* The width rule (owner, 18 Nov 2026, O-058): the page fills its column up to --page (centred beyond); lists, tables and
   galleries take all of it; a form stays readable (.form, 640 px at most) and on a desktop has something useful beside
   it (.beside: form + preview, summary or example); a heading's rule runs no further than its content. */
main { padding: 36px clamp(20px, 4.2vw, 56px) 96px; width: 100%; max-width: var(--page); margin-inline: auto; min-width: 0; }
.beside { display: grid; grid-template-columns: minmax(0, 640px) minmax(300px, 1fr); gap: 32px clamp(32px, 4vw, 72px); align-items: start; }
.beside > * { min-width: 0; }
.beside > div > .sec:first-child { margin-top: 0; }
.beside > .form { max-width: none; }
@media (max-width: 1180px) { .beside { grid-template-columns: minmax(0, 1fr); } }
/* long German words break at a syllable, not mid-letter: only in short prose (headings, labels, buttons, badges, tabs) */
:is(h1, h2, h3, .label, ui-field-label, .btn, .pill, ui-tabs-tab > button, ui-segmented-control-item) { hyphens: auto; }
/* never in data: an address, a code, a number, a file name or anything typed; a long one wraps without an inserted hyphen */
:is(.mono, code, td, th, input, textarea, a[href^="mailto:"]) { hyphens: manual; }

.rail { position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 18px 14px 14px; background: var(--rail-bg); color: var(--rail-ink); border-right: 1px solid var(--rail-line); }
.rail :focus-visible { outline-color: var(--rail-ink); }
.brand { display: inline-flex; align-items: center; gap: 9px; padding: 2px 6px; align-self: flex-start; text-decoration: none; font: 650 1.1875rem/1 var(--display); letter-spacing: -0.02em; }
.brand i { font-style: normal; font-weight: 500; opacity: 0.72; } /* „.app”: part of the name, a step quieter */
.brand .logo { width: 24px; height: 28px; } /* the product's logo (O-002); on the rail its front page is white, its lines the rail's colour */
.rail { --logo-front: var(--rail-ink); --logo-line: var(--rail-bg); }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: var(--r); text-decoration: none; color: var(--rail-ink-2); font-weight: 500; }
.nav a:hover { background: var(--rail-hover); color: var(--rail-ink); }
/* where you are: a soft tint and bolder white text, not a white block (owner, 18 Nov 2026, O-001) */
.nav a[aria-current="page"] { background: color-mix(in oklch, var(--rail-ink) 15%, transparent); color: var(--rail-ink); font-weight: 600; }
/* The menu's lines, one rule (owner, 18 Nov 2026, O-079 … O-081): the line under the logo runs the rail's whole width at
   the height of the top bar's bottom line, so the two read as one line across the page; every other line (between
   „Persoane” and „Șabloane”, before „Echipă”, above the language and the person) is a short divider inset to where
   the rows' text starts. The rows keep their 36 px; the menu starts a little lower. „Administrare” is not a row of the
   rail: it is in the person's menu, after the kit's own separator. */
.nav-gap { display: block; height: 1px; margin: 9px 10px; background: var(--rail-line); }
@media (min-width: 821px) {
  .rail-foot::before { content: ""; display: block; height: 1px; margin: 9px 10px; background: var(--rail-line); }
  .rail { padding-top: 0; }
  .rail .brand { align-self: stretch; box-sizing: border-box; height: 56px; margin: 0 -14px; padding: 0 20px; border-bottom: 1px solid var(--rail-line); }
  .rail .nav { gap: 4px; margin-top: 6px; }
  [data-mode="admin"] .rail .admin-tag { margin-top: 2px; margin-bottom: -8px; }
}
.count { display: inline-block; margin-left: auto; min-width: 20px; padding: 2px 6px; border-radius: 10px; background: var(--cta); color: var(--cta-ink); box-shadow: inset 0 0 0 1px var(--cta-edge); font: 600 var(--t-xs)/1.2 var(--mono); text-align: center; }
.count.bad { background: var(--bad); color: var(--paper); box-shadow: none; }
.admin-tag { padding: 0 8px; font: 500 var(--t-xs)/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--rail-ink-2); }
.back-app { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--r); font-size: var(--t-sm); color: var(--rail-ink-2); }
.back-app:hover { color: var(--rail-ink); }
/* „Nou”: a round floating button at the bottom right of a desktop page (owner, 18 Nov 2026, O-046); never over a
   flow's own bottom bar; a phone has the tab bar's „+” (the rule that hides it is in the phone block) */
/* It stands in a gutter of its own, never on the content: on the pages that show it, the page and the top bar keep
   --fab-gutter free on the right (14 px + the 48 px button + 14 px), so no text or control can be under it at any
   scroll position; the page's bottom padding (96 px) clears it at the end of the page. */
.fab { position: fixed; z-index: var(--z-nav); right: 14px; bottom: 24px; }
/* under an open window the button is already below the backdrop (kit: backdrop and content at z-index 50, in the top layer; this: --z-nav, 20),
   but a dark blue disc stays blue under a 38 % veil and read as a live button over an inert page: it is not drawn while a dialog or a drawer is open */
:root:has(:is(ui-dialog-backdrop, ui-drawer-backdrop):not([hidden]), dialog[open]) .fab { visibility: hidden; }
@media (min-width: 821px) {
  [data-mode="app"]:not([data-flow]) .top { padding-right: max(var(--fab-gutter), calc((100% - var(--page)) / 2 + var(--fab-gutter))); } /* its right end stays on the content's edge */
  [data-mode="app"]:not([data-flow]) main { padding-right: var(--fab-gutter); }
}
.fab-btn { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--paper); box-shadow: 0 6px 18px oklch(0.2 0.05 264 / 0.28); cursor: pointer; transition: translate 0.15s var(--ease), box-shadow 0.15s; }
.fab-btn .i { width: 24px; height: 24px; }
.fab-btn:hover, .fab-btn[aria-expanded="true"] { translate: 0 -2px; box-shadow: 0 10px 24px oklch(0.2 0.05 264 / 0.34); }
[data-flow] .fab { display: none; }

.top { position: sticky; top: 0; z-index: var(--z-bar); display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 max(clamp(20px, 4.2vw, 56px), calc((100% - var(--page)) / 2 + 56px)); background: var(--paper); border-bottom: 1px solid var(--line); }
.top-brand { display: none; align-self: center; }
.top .admin-tag { color: var(--ink-2); }
.trail { display: flex; align-items: center; flex: 1; min-width: 0; margin-right: 8px; } /* a shortened last step ends as far from the search icon as that is from the space's name (21 px) */
.trail ol { display: flex; align-items: center; flex: 1; min-width: 0; margin: -6px 0 -6px -12px; padding: 6px 0 6px 12px; overflow: hidden; } /* the clip stands 12 px left of the content's edge and 6 px above and below: room for the focus ring of the first step, „Acasă”, which starts on that edge (O-116) */
.trail li { display: flex; align-items: center; flex: none; min-width: 0; color: var(--ink-3); white-space: nowrap; }
.trail li::before { content: "/"; margin: 0 10px; color: var(--line-2); }
[data-mode="app"] .trail li:first-child::before { display: none; }
.trail li.trail-home[aria-current] { flex: none; }
.trail li a { color: var(--ink-2); text-decoration: none; }
.trail li a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.trail li[aria-current] { flex: 1 1 0; overflow: hidden; color: var(--ink); font-weight: 600; }
.trail li[aria-current] span { overflow: hidden; text-overflow: ellipsis; }
.space { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 36px; padding: 0 8px; border: 0; border-radius: var(--r); background: none; text-align: left; cursor: pointer; }
.space:hover { background: var(--sunken); }
.space-mark { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--accent); outline: 1px solid var(--accent); outline-offset: 2px; color: var(--accent); font: 600 var(--t-sm)/1 var(--mono); }
.space-name { max-width: 300px; overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.iconbtn { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border: 0; border-radius: var(--r); background: none; color: var(--ink-2); cursor: pointer; }
.iconbtn:hover { background: var(--sunken); color: var(--ink); }
.credits { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 36px; padding: 0 10px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
a.credits:hover { background: var(--sunken); }
.credits b { font: 600 var(--t-base)/1 var(--mono); color: var(--ink); }
.credits .i { color: var(--ink-3); }
.credits[data-low] { background: var(--warn-soft); color: var(--warn); }
.credits[data-low] b, .credits[data-low] .i { color: var(--warn); }
/* the foot of the rail (O-004): the language and the person, drawn as menu rows */
.rail-foot { display: grid; gap: 2px; margin-top: auto; }
.rail-foot :is(.account, ui-select-trigger > button) { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; height: var(--control-h); min-height: 0; padding: 0 10px; border: 0; border-radius: var(--r); background: none; box-shadow: none; color: var(--rail-ink-2); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.rail-foot :is(.account, ui-select-trigger > button):hover, .rail-foot :is(.account, ui-select-trigger > button)[aria-expanded="true"] { background: var(--rail-hover); color: var(--rail-ink); }
.rail-foot :is(.account-name, ui-select-value) { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rail-foot .i-s { margin-left: auto; }
[data-slot="select-content"]:has([lang]) { max-height: min(420px, 70dvh); overflow-y: auto; } /* the 32 languages */
.tabbar { display: none; }

/* Mode and role switches: attributes on <html>, never ARIA roles */
[data-mode="app"] .admin-only, [data-mode="admin"] .app-only { display: none !important; }
[data-kind="personal"] .team-only { display: none !important; }
:not([data-role="owner"]) > body .owner-only { display: none !important; }
[data-role="owner"] .not-owner { display: none !important; }

/* ---------- Buttons, links, state tags ---------- */
/* width: ui-sdk sizes any labelled button whose only child element is an icon as icon-only, text or not. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; height: var(--control-h); padding: 0 14px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--surface); color: var(--ink); font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer; user-select: none; transition: transform 0.1s var(--ease); }
/* O-075 (owner, 18 Nov): two buttons side by side in a plain row sat on the text's baseline, and a button with an icon has its baseline 4 px higher than one without: every button stands on the row's middle instead */
.btn { vertical-align: middle; }
.btn:hover { background: var(--paper-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cta); border-color: var(--cta-edge); color: var(--cta-ink); }
.btn-primary:hover { background: var(--cta-hover); border-color: var(--cta-edge); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); border-color: transparent; color: var(--ink); }
/* danger: outline red = the trigger on the page; filled red = the final „do it” in a dialog (the confirmation's is data-danger) */
.btn-danger { border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); background: var(--bad-soft); }
:is(ui-dialog-content, [data-slot="dialog-content"]) .btn-danger[type=submit] { border-color: var(--bad); background: var(--bad); color: var(--paper); }
.btn-ghost.btn-danger { border-color: transparent; }
.btn-block { width: 100%; }
ui-button + ui-button > .btn-block { margin-top: 8px; }
.btn-lg { height: 44px; padding: 0 20px; }
.btn-icon { flex: none; width: var(--control-h); padding: 0; }
.btn[disabled], .btn[data-disabled], .btn[aria-disabled="true"] { background: var(--sunken); border-color: var(--line-2); color: var(--ink-3); cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { pointer-events: none; opacity: 0.7; }
.btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.link { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: var(--accent-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; background: var(--sunken); color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.live { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill .i { width: 14px; height: 14px; }
.pill, .pill + .hint { vertical-align: middle; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.8); } }

/* ---------- Page furniture ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; }
.page-head > :first-child { flex: 1 1 300px; min-width: 0; }
/* A page head's action(s) stand on the title's line (owner, 18 Nov 2026, O-082): their middle on the middle of the H1's
   first line, whatever the subtitle's length. --head-line = the H1's line height; a button is --control-h high. On a
   phone the actions go under the title, full width, as before. */
.page-head { --head-line: calc(var(--t-2xl) * 1.05); }
.page-head.rec { --head-line: calc(var(--t-xl) * 1.15); }
@media (min-width: 821px) {
  .page-head { align-items: flex-start; }
  .page-head > :not(:first-child) { margin-top: calc((var(--head-line) - var(--control-h)) / 2); }
}
.page-head.rec, .page-head.tight { margin-bottom: 20px; }
.page-head + .sec { margin-top: 0; }
.crumb { display: none; align-items: center; gap: 6px; margin-bottom: 10px; font-size: var(--t-sm); color: var(--ink-3); text-decoration: none; }
h1 { font: 700 var(--t-2xl)/1.05 var(--display); letter-spacing: -0.035em; text-wrap: balance; }
.page-head.rec h1 { font-size: var(--t-xl); line-height: 1.15; }
h2, .sec-head h3, .empty h1, .empty h2, .empty h3 { font: 700 var(--t-lg)/1.2 var(--display); letter-spacing: -0.02em; }
.lede { max-width: 50ch; margin-top: 6px; color: var(--ink-2); font-size: var(--t-md); }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; min-width: 0; }
.head-actions > * { max-width: 100%; min-width: 0; }
.sec { margin-top: 36px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
/* a disclosure (<details>) shows the app's chevron, not the browser's triangle */
main details > summary { list-style: none; cursor: pointer; }
main details > summary::-webkit-details-marker { display: none; }
main details > summary::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 4px; vertical-align: -2px; background: currentColor; mask: var(--ui-icon-chevron) center / contain no-repeat; transition: rotate 0.15s var(--ease); }
main details[open] > summary::after { rotate: 180deg; }
.sec-head .n { font: 500 var(--t-sm)/1 var(--mono); color: var(--ink-3); }
.sec-head .end { align-self: center; }
/* a section's heading and the link at its right share ONE row at every width (owner, 18 Nov 2026, O-087): the link never
   wraps under the heading; if a long heading and the link cannot both fit, the heading is cut with „…”, not the link */
.sec-head:has(> a.end) { flex-wrap: nowrap; }
.sec-head:has(> a.end) > :is(h2, h3) { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sec-head > a.end { flex: none; margin-left: auto; white-space: nowrap; }
.hint { font-size: var(--t-sm); color: var(--ink-3); }
p.hint, .note { max-width: 72ch; }
.label, ui-field-label { font: 500 var(--t-sm)/1.5 var(--font); letter-spacing: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 56px; align-items: start; }
.side-block h2 { margin-bottom: 10px; font: 500 var(--t-sm)/1.3 var(--font); letter-spacing: 0; color: var(--ink-3); }
.side-block .hint { margin: 10px 0 14px; }
.big-n { font: 600 2rem/1 var(--mono); letter-spacing: -0.03em; }
.big-n span { margin-left: 6px; font: 400 var(--t-base) var(--font); letter-spacing: 0; color: var(--ink-2); }
.empty { max-width: 46ch; padding: 40px 0; }
.empty.flush { padding-top: 0; }
.empty p { margin: 8px 0 18px; color: var(--ink-2); }
.note { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper-2); font-size: var(--t-sm); color: var(--ink-2); }
.note.private { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
/* a state that simply holds („Toate documentele au ajuns.”, O-067): a quiet line in the page's flow, never a box that comes and goes */
.ok-line { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.ok-line .i { color: var(--ok); }
.note.ok { background: var(--ok-soft); border-color: transparent; color: var(--ink); }
.note.bad { background: var(--bad-soft); border-color: transparent; color: var(--ink); }
.note.bad .i { color: var(--bad); }
.note .i { margin-top: 2px; }
/* „organizație verificată”: the team page (part B) and the public event pages (V-061: there the seal had no size and was drawn huge) */
.verified { display: inline-flex; align-items: center; gap: 6px; vertical-align: bottom; color: var(--accent); font-weight: 500; font-size: var(--t-sm); }
.lede .verified { font-size: inherit; }
.verified .seal { width: 18px; height: 18px; }
.err, ui-field-error { font-size: var(--t-sm); color: var(--bad); }

/* Rows: one pattern for every list, same on desktop and phone */
.rows > li { border-bottom: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 60px minmax(0, 2.4fr) minmax(200px, 1fr) 108px; gap: 4px 16px; align-items: center; padding: 16px 4px; }
.row.r2 { grid-template-columns: minmax(0, 1fr) auto; }
.row-title { font-weight: 600; font-size: var(--t-md); letter-spacing: -0.01em; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a.row-title:hover { text-decoration-color: currentColor; }
.row-meta { font-size: var(--t-sm); color: var(--ink-3); }
.row-state { font-size: var(--t-sm); color: var(--ink-2); }
.row-state > .pill { margin-bottom: 4px; }
.row-note { display: block; } /* the sentence under a row's state pill */
.row-act { display: flex; gap: 8px; justify-content: flex-end; min-width: 96px; }
/* The date tile: a white calendar leaf with a thin border; only the month's band is coloured, softly, by the document's
   group (data-g, from DocumentStyles::groupOf(); none = neutral, as on Evenimente). Owner, 18 Nov 2026, O-045, variant B.
   Hues kept away from the yellow of a main button, the blue of links and the green / red of a state. */
.date { --d: var(--sunken); --d-ink: var(--ink-2); display: grid; grid-template-rows: 18px 1fr; width: 50px; height: 54px; overflow: hidden; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); text-align: center; }
.date span { background: var(--d); color: var(--d-ink); font: 600 0.6875rem/18px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.date b { font: 600 var(--t-lg)/34px var(--mono); color: var(--ink); }
.date[data-g="certificat"] { --d: oklch(0.935 0.035 310); --d-ink: oklch(0.42 0.1 310); }
.date[data-g="adeverinta"] { --d: oklch(0.935 0.035 195); --d-ink: oklch(0.4 0.07 195); }
.date[data-g="altele"] { --d: oklch(0.935 0.035 350); --d-ink: oklch(0.44 0.1 350); }

ui-progress { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; min-width: 0; font-size: var(--t-sm); }
ui-progress.big { max-width: 520px; font-size: var(--t-md); }
ui-progress-track { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 3px; background: var(--sunken); }
ui-progress-indicator { height: 100%; border-radius: 3px; background: var(--accent); }
ui-progress-indicator[data-indeterminate] { width: 40%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* Tables */
.tbl th { padding: 10px 12px 10px 4px; border-bottom: 1px solid var(--line-2); text-align: left; font: 500 var(--t-sm)/1.2 var(--font); color: var(--ink-3); white-space: nowrap; }
.tbl td { padding: 11px 12px 11px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody th { padding: 11px 12px 11px 4px; border-bottom: 1px solid var(--line); font: 600 var(--t-base)/1.5 var(--font); color: var(--ink); white-space: normal; }
.tbl tbody th a, .tbl td a { text-underline-offset: 3px; }
.tbl td.r, .tbl th.r { padding-right: 4px; text-align: right; }
.tbl td.side { white-space: nowrap; }
.tbl .sub { display: block; font-size: var(--t-sm); font-weight: 400; color: var(--ink-3); overflow-wrap: break-word; } /* break-word: an address keeps its column wide enough for one line, and breaks only if it cannot fit */
/* position: the visually hidden column header must scroll with the table, not widen the page. */
.tbl-wrap { position: relative; overflow-x: auto; }
/* an e-mail address in a table (.addr) keeps one line at desktop width; on phones the stacked table lets it wrap */
@media (min-width: 821px) { .tbl .addr { white-space: nowrap; } }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 8px; }
.toolbar .search { flex: 0 1 280px; }

/* Tabs as underlined text, tied to the section rule */
ui-tabs-list { display: flex; gap: 24px; padding: 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--ink); border-radius: 0; background: none; }
ui-tabs-tab > button { height: 40px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: inset 0 -3px 0 transparent; color: var(--ink-3); font-weight: 500; white-space: nowrap; cursor: pointer; }
ui-tabs-tab > button:hover { background: none; color: var(--ink); }
ui-tabs-tab > button[data-selected] { box-shadow: inset 0 -3px 0 var(--ink); color: var(--ink); }
ui-tabs-tab > button .n { margin-left: 4px; font: 500 var(--t-xs)/1 var(--mono); color: var(--ink-3); }
/* tab counters: plain grey numbers everywhere (part A's way), never the yellow pill of the menu */
ui-tabs-tab > button .n, ui-tabs-tab > button .count { margin-left: 4px; min-width: 0; padding: 0; border-radius: 0; background: none; box-shadow: none; font: 500 var(--t-xs)/1 var(--font); color: var(--ink-3); }
ui-tabs-panel { padding-top: 24px; }
ui-tabs-panel > .sec:first-child { margin-top: 0; }

ui-segmented-control { max-width: 100%; padding: 3px; overflow-x: auto; scrollbar-width: none; border-radius: var(--r); background: var(--sunken); }
ui-segmented-control-item { height: calc(var(--control-h) - 6px); /* + the control's 3 px padding: a field's height */ padding: 0 12px; font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
ui-segmented-control-item[data-checked] { color: var(--ink); }
ui-segmented-control-indicator { border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-s); }

/* Forms: label above, hint, then error */
ui-field, .fld { display: grid; gap: 6px; align-content: start; }
.label, ui-field-label { display: block; min-height: calc(var(--t-sm) * 1.5); } /* one label line: labels side by side share a baseline */
/* .form-row: fields (and a button) side by side in a form. One grid whose fields share three lines (label, control,
   hint/error) through subgrid, so the controls share their top and bottom; a button sits on the control line, not the
   label's; the row's outer edges are the edges of the full-width fields above and below. Columns: equal, or --cols
   (.act: a field and its button). Stacked under 600 px. */
.form-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: var(--cols, none); grid-template-rows: auto auto auto; column-gap: 12px; row-gap: 6px; align-items: start; }
.form-row.act { --cols: minmax(0, 1fr) auto; }
.form-row > :is(ui-field, .fld) { grid-row: 1 / span 3; grid-template-rows: subgrid; }
.form-row > :is(ui-field, .fld) > :is(ui-field-label, .label, label) { grid-row: 1; }
.form-row > :is(ui-field, .fld) > :is(ui-input, ui-select, ui-textarea, input, select, textarea, ui-segmented-control, .seg-wrap) { grid-row: 2; }
.form-row > :is(ui-field, .fld) > :is(ui-field-description, ui-field-error, .hint, .err) { grid-row: 3; }
.form-row > :not(ui-field, .fld), .form-row > ui-button > * { grid-row: 2; align-self: start; } /* ui-button is display: contents */
@media (max-width: 600px) {
  .form-row { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 12px; }
  .form-row > *, .form-row > :not(ui-field, .fld), .form-row > ui-button > *, .form-row > :is(ui-field, .fld) { grid-row: auto; grid-template-rows: none; } /* as specific as the desktop rule: a button after the last field */
  .form-row > :is(ui-field, .fld) > * { grid-row: auto; }
}
ui-field-description { font-size: var(--t-sm); color: var(--ink-3); }
ui-input > input, ui-textarea > textarea { width: 100%; height: var(--control-h); padding: 0 12px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--surface); }
ui-textarea > textarea { height: auto; min-height: 128px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
ui-input > input:hover, ui-textarea > textarea:hover { border-color: var(--ink-3); }
ui-input > input:focus-visible, ui-textarea > textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
ui-select-trigger > button { width: 100%; height: var(--control-h); justify-content: space-between; background: var(--surface); }
:is(ui-input > input, ui-textarea > textarea, ui-select-trigger > button)[data-invalid] { border-color: var(--bad); }
/* a page that used a plain <input>, <select>, <textarea>, checkbox or radio instead of the component looks the same
   (no specificity: a part's own rule still wins, and the shared alignment check, dev/tests/app/lib/form-align.mjs, says so) */
:where(.app :is(input:not([type=checkbox], [type=radio], [type=file], [type=range], [type=color], [type=hidden], [type=submit], [type=button], [type=image]), select, textarea):not([data-slot], ui-input > *, ui-textarea > *)) {
  box-sizing: border-box; width: 100%; height: var(--control-h); padding: 0 12px; border: 1px solid var(--edge); border-radius: var(--r); background-color: var(--surface); color: var(--ink); font: inherit;
}
:where(.app textarea:not([data-slot], ui-textarea > *)) { height: auto; min-height: 128px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
:where(.app select:not([data-slot])) {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6a63' stroke-width='2' stroke-linecap='square'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; /* the ui-select trigger's chevron */
}
:where(.app :is(input, select, textarea):not([data-slot], ui-input > *, ui-textarea > *, [type=checkbox], [type=radio])):hover { border-color: var(--ink-3); }
:where(.app :is(input, select, textarea):not([data-slot], ui-input > *, ui-textarea > *, [type=checkbox], [type=radio])):focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
:where(.app input:is([type=checkbox], [type=radio]):not([data-slot])) {
  appearance: none; flex: none; width: 16px; height: 16px; margin: 0; border: 1px solid var(--edge); border-radius: 4px; background: var(--surface) center / 12px no-repeat; vertical-align: -3px; cursor: pointer;
}
:where(.app input[type=radio]:not([data-slot])) { border-radius: 50%; }
:where(.app input[type=checkbox]:not([data-slot]):checked) { border-color: var(--accent); background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='square'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
:where(.app input[type=radio]:not([data-slot]):checked) { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 4px, var(--surface) 4.5px); }
:where(.app input:is([type=checkbox], [type=radio]):not([data-slot]):disabled) { opacity: 0.5; cursor: not-allowed; }
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 520px; }
.form.wide { max-width: 640px; }
.form.full { max-width: none; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.search { position: relative; }
.search .i { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 34px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.switch-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); }
label.switch-row { cursor: pointer; }
.switch-row small { display: block; font-size: var(--t-sm); color: var(--ink-3); }
.switch-row.bare { padding: 4px 0; border: 0; }
.rows .switch-row { border: 0; }
.as { display: grid; gap: 8px; }
.as label, .packs label { display: grid; grid-template-columns: 20px 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--edge); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; }
.as.plain label { grid-template-columns: 20px minmax(0, 1fr); }
.packs label { grid-template-columns: 20px minmax(0, 1fr) auto; }
.as label:has([data-checked]), .packs label:has([data-checked]) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.as small { display: block; font-size: var(--t-sm); color: var(--ink-3); }
.packs { display: grid; gap: 8px; max-width: 520px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; }
.facts dt { color: var(--ink-3); }
.facts dd { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
/* .figs: a list's totals above it (Persoane, Credite, Trimiteri: the old pages' figures); .pager-links: a list's pages */
.figs { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 0 0 20px; }
.figs dt { font-size: var(--t-sm); color: var(--ink-3); }
.figs dd { font: 600 var(--t-lg)/1.3 var(--font); }
.sec-head + .figs { margin-top: 20px; } /* under a section's rule (Credite): the same room as under a page head */
.pager-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pager-links .end { margin-left: auto; }
.pager-links .at { font-size: var(--t-sm); color: var(--ink-2); }

/* Popups. O-115 (owner, 18 Nov), the rule: a list opened from a button (menu, select) is never narrower than that button, so under a
   wide trigger both edges line up with it (--anchor-width: the kit's positioner sets it on the list); under a small one („⋯", an
   icon) it keeps its own 220 px, lined up with the trigger's start or end edge, and the positioner keeps it inside the screen. */
[data-slot="menu-content"], [data-slot="select-content"] { min-width: max(220px, var(--anchor-width, 0px)); padding: 5px; border-radius: var(--r-lg); transform-origin: var(--transform-origin); transition: opacity 0.14s, scale 0.14s var(--ease); }
[data-slot="menu-content"][data-starting-style], [data-slot="menu-content"][data-ending-style], [data-slot="select-content"][data-starting-style], [data-slot="select-content"][data-ending-style] { opacity: 0; scale: 0.97; }
[data-slot="menu-item"], [data-slot="menu-radio-item"] { height: auto; min-height: 34px; padding-block: 7px; border-radius: 6px; text-decoration: none; }
[data-slot="menu-item"][data-destructive] { color: var(--bad); }
/* a menu item that is a form's button (H11: „Ieși din cont” posts a form): the row of a link, not a native button */
button[data-slot="menu-item"] { width: 100%; border: 0; font: inherit; color: inherit; text-align: start; }
button[data-slot="menu-item"]:not([data-highlighted]) { background: none; }
/* a ui-select's chosen option (owner, 18 Nov, O-009): its text on the left like the others, the tick on the right, the row in blue */
[data-slot="select-item"] > [data-slot="select-item-indicator"] { order: 1; }
[data-slot="select-item"][aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
/* the „⋯” of a row and the small chevrons (owner, 18 Nov, O-042, O-043): heavier and a little larger, the same everywhere.
   The drawings are the shell's symbols #i-dots and #i-down (their own stroke) and the kit's chevron (selects, expanders). */
:root { --ui-icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.btn:has(> .i > use[href="#i-dots"]) { color: var(--ink); }
.btn > .i:has(> use[href="#i-dots"]) { width: 22px; height: 22px; }
.i-s:has(> use[href="#i-down"]) { width: 17px; height: 17px; }
@media (max-width: 820px) { .btn-icon:has(> .i > use[href="#i-dots"]) { width: 44px; height: 44px; } }
/* a list's key figures as low cards, a pastel icon in each, as the old platform's (owner, 18 Nov, O-069: Trimiteri, then
   „la fel” on Persoane). One shape
   for all four: the icon, then the label over the number, both starting on the same edge; what the number counts is the
   card's title (the small sentence stays in the page for readers, not drawn: the four would not be equal with it). */
.figs.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 28px; }
.figs.cards + .sec { margin-top: 0; } /* 28 px above the cards (the page head's) and 28 px under them, measured */
.fig-card { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 9px 16px 9px 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.fig-card > div { display: grid; gap: 1px; min-width: 0; }
.fig-card dt { font: 500 var(--t-sm)/1.3 var(--font); color: var(--ink-2); }
.fig-card .num { font: 700 var(--t-lg)/1.15 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.fig-card .sub { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* O-101 (owner, 18 Nov): the square and the text read as one unit: the square is as tall as the two lines' ink, its top on
   the label's capitals and its bottom on the number's baseline (3 px and 5 px in from the text block: the label's and the
   number's own leading, measured), at every width and when the label takes two lines (it stretches with the block) */
.fig-ico { display: grid; place-items: center; flex: none; align-self: stretch; aspect-ratio: 1; margin: 3px 0 5px; border-radius: 9px; }
.fig-ico .i { width: 19px; height: 19px; stroke-width: 1.8; }
.fig-ico.warn { background: var(--warn-soft); color: var(--warn); }
.fig-ico.accent { background: var(--accent-soft); color: var(--accent); }
.fig-ico.ok { background: var(--ok-soft); color: var(--ok); }
.fig-ico.lilac { background: oklch(0.94 0.04 310); color: oklch(0.45 0.13 310); }
.fig-ico.quiet { background: var(--sunken); color: var(--ink-3); }
@media (max-width: 1080px) { .figs.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* a phone (owner, 18 Nov): one row, swiped left and right; each card as wide as its text, the next one showing at the edge */
@media (max-width: 820px) {
  .figs.cards { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; }
  .figs.cards::-webkit-scrollbar { display: none; }
  .fig-card { flex: none; gap: 10px; padding: 9px 14px 9px 10px; scroll-snap-align: start; }
  .fig-card dt { white-space: nowrap; }
  /* the square's width spelled out (W4, 24 Nov): a width taken from aspect-ratio and a stretched height is not counted in a
     card's own width (max-content), so the card was that much too narrow and cut its label; here the label is one line,
     so the block is one label line + 1 px + one number line, less the 3 + 5 px of O-101: the same square */
  .fig-ico { width: calc(var(--t-sm) * 1.3 + var(--t-lg) * 1.15 - 7px); }
}
/* a list's filters and its search on the line of its heading (owner, 18 Nov, O-070, O-071, O-074, O-077): inside .sec-head,
   after the title and its count, <div class="head-tools">: .head-filters with one .head-filter per state (a link when the
   choice is another address, a button when the page filters by itself; aria-current on the chosen one), an extra filter
   or two, then .head-search: the search icon that opens into its field (assets/app/app.js). The chosen word is bold and
   the heading's own thick rule is heavier under it: one line on the screen, no counts beside the words. Under 821 px the
   words scroll sideways with the icon beside them, and the open field covers the line. */
.sec-head:has(> .head-tools) { position: relative; padding-bottom: 0; }
.sec-head:has(> .head-tools) > :is(h2, h3, .n) { margin: 2px 0 8px; } /* with the words' 13 px: one baseline (O-084) */
.head-tools { display: flex; align-items: flex-end; align-self: flex-end; gap: 8px; min-width: 0; margin: 0 0 -2px auto; }
.head-filters { display: flex; gap: 0 16px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
/* O-084 (owner, 18 Nov): the title, its count and the words read as one line: the words stand on the title's text baseline
   (13 px under them down to the rule, measured: within 1 px of the h2's baseline), the search icon's middle on the middle
   of their small letters; the chosen word's heavier line still sits on the heading's rule */
.head-filter { padding: 0 0 13px; border: 0; border-bottom: 4px solid transparent; border-radius: 0; background: none; color: var(--ink-3); font: 500 var(--t-sm)/1.4 var(--font); white-space: nowrap; text-decoration: none; cursor: pointer; }
.head-filter:hover { color: var(--ink); }
.head-filter[aria-current] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 700; } /* the rule's own colour */
.head-search { display: flex; align-items: center; flex: none; margin: 0; padding-bottom: 7px; }
.head-search .search { width: 260px; }
.head-search:not([data-open]) .search, .head-search[data-open] > .iconbtn { display: none; }
@media (max-width: 820px) {
  .head-tools { flex: 1 1 100%; margin-left: 0; }
  .head-filter { padding-top: 7px; } /* RV-F-05 (row 29): 44 px tall on a phone, the words still on the rule */
  .head-filters { flex: 1 1 0; padding-right: 28px; mask-image: linear-gradient(90deg, var(--ink) calc(100% - 28px), transparent); } /* the words fade at the edge: more to the side (as the tabs do) */
  .head-search[data-open] { position: absolute; left: 0; right: 0; bottom: 0; background: var(--paper); }
  .head-search[data-open] .search { width: 100%; }
}
/* the „x” that empties a text field (owner, 18 Nov, O-055; assets/app/app.js): one button, laid over the right end of the
   focused field while it has a value; the field keeps its height */
.in-clear { position: absolute; z-index: 2; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.in-clear:hover { background: var(--sunken); color: var(--ink); }
.in-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.in-clear[hidden] { display: none; }
ui-input > input[data-clear] { padding-right: 38px; }
/* V-001 / V-002 (owner, 22 Nov): − and + inside a number field, at its right end (assets/app/app.js), no „x”; the field
   keeps its height, the value its left edge; 44 px wide buttons on a phone */
ui-input:not([hidden]):has(> input[type=number]) { --nb: 30px; position: relative; display: block; min-width: calc(2 * var(--nb) + 4ch); }
ui-input > input[type=number] { padding-right: calc(2 * var(--nb) + 6px); }
.num-b { position: absolute; top: 1px; bottom: 1px; z-index: 1; display: grid; place-items: center; width: var(--nb); padding: 0; border: 0; border-radius: 0; background: none; color: var(--ink-2); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.num-b.dec { right: calc(var(--nb) + 1px); }
.num-b.inc { right: 1px; border-left: 1px solid var(--line); border-radius: 0 calc(var(--r) - 1px) calc(var(--r) - 1px) 0; }
@media (hover: hover) { .num-b:hover { background: var(--sunken); color: var(--ink); } }
.num-b:active { background: var(--sunken); color: var(--ink); }
.num-step:has(> input:is(:disabled, [readonly])) .num-b { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 820px) { ui-input:not([hidden]):has(> input[type=number]) { --nb: 44px; } .num-b { top: 0; bottom: 0; } }
.space-opt { display: grid; }
.space-opt small { font-size: var(--t-xs); color: var(--ink-3); }
[data-slot="dialog-content"].palette { width: min(600px, calc(100vw - 24px)); margin-top: 12vh; padding: 0; overflow: hidden; border-radius: var(--r-lg); }
/* the search's results (O-072): groups of links, the first line the name, the second what it is */
.palette-out { max-height: min(60dvh, 520px); overflow-y: auto; padding: 6px; }
.palette-label { padding: 10px 10px 4px; font: 500 var(--t-xs)/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.palette-out a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 7px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.palette-out a:hover, .palette-out a:focus-visible { background: var(--sunken); outline: none; }
.palette-out a > span { display: grid; min-width: 0; }
.palette-out a b { overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.palette-out a small { overflow: hidden; font-size: var(--t-xs); color: var(--ink-3); white-space: nowrap; text-overflow: ellipsis; }
.palette-out .palette-more { color: var(--accent); font-size: var(--t-sm); }
.palette-none { padding: 18px 10px; color: var(--ink-2); }
.palette-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.palette-in:focus-within { box-shadow: inset 0 -2px 0 var(--accent); }
.palette-in input { flex: 1; min-width: 0; height: 52px; border: 0; outline: none; background: none; color: var(--ink); font-size: var(--t-md); }
[data-slot="command-list"] { max-height: min(52vh, 420px); padding: 6px; overflow-y: auto; }
[data-slot="command-group-label"] { padding: 10px 10px 4px; font-weight: 500; font-size: var(--t-sm); color: var(--ink-3); }
[data-slot="command-item"] { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 6px; color: inherit; text-decoration: none; cursor: pointer; }
[data-slot="command-item"][data-highlighted] { background: var(--ink); color: var(--paper); }
[data-slot="command-item"] small { margin-left: auto; font-size: var(--t-sm); color: var(--ink-3); }
[data-slot="command-item"][data-highlighted] small { color: var(--on-ink-2); }
/* the empty part stays in the page as a live region; it takes room only while nothing matches */
[data-slot="command-empty"][data-empty] { padding: 28px 16px; color: var(--ink-3); text-align: left; }
[data-slot="alert-dialog-content"] { max-width: min(460px, calc(100vw - 32px)); padding: 24px; border-radius: var(--r-lg); }
[data-slot="alert-dialog-content"]::backdrop { background: var(--ui-overlay); }
[data-slot="alert-dialog-title"] { font: 700 var(--t-lg)/1.25 var(--display); letter-spacing: -0.015em; }
[data-slot="alert-dialog-description"] { margin: 8px 0 20px; color: var(--ink-2); }
[data-slot="alert-dialog-content"] :has(> ui-alert-dialog-close) { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
[data-slot="alert-dialog-close"] { height: var(--control-h); padding: 0 16px; border-radius: var(--r); }
ui-alert-dialog-close[value="confirm"] > button { background: var(--cta); border-color: var(--cta-edge); color: var(--cta-ink); }
ui-alert-dialog-close[value="confirm"] > button:hover { background: var(--cta-hover); }
/* a deletion (CertiPass.confirm(..., { danger: true }), <form data-confirm data-danger>): the red button, not the yellow one */
ui-alert-dialog-close[value="confirm"][data-danger] > button, ui-alert-dialog-close[value="confirm"][data-danger] > button:hover { background: var(--bad); border-color: var(--bad); color: var(--paper); }
/* A dialog of your own (ui-dialog): the same card as a confirmation */
[data-slot="dialog-content"]:not(.palette) { width: min(480px, calc(100vw - 32px)); padding: 24px; border-radius: var(--r-lg); }
[data-slot="dialog-title"]:not(.vh) { font: 700 var(--t-lg)/1.25 var(--display); letter-spacing: -0.015em; }
[data-slot="dialog-description"] { margin: 8px 0 20px; color: var(--ink-2); }
.dlg-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 20px; }

[data-flow] .toasts { bottom: 96px; } /* above a sticky action bar, at every width */
.toasts { position: fixed; z-index: var(--z-toast); left: 50%; bottom: 20px; translate: -50% 0; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toasts > div { display: grid; gap: 8px; }
.toasts > div:empty { display: none; } /* an empty region takes no gap: a success and an error stand at the same height (O-096) */
/* O-095 (owner, 18 Nov): the icon, the first line of the text and the „x” share one line, in every toast: each is centred
   in a first row as high as the button (--row: 32 px, 44 px on a phone); a longer text runs on under that row. Before,
   the icon kept a fixed 7 px from the top (right only beside a 32 px button) while the text was centred in the toast. */
.toast { --row: 32px; display: flex; align-items: flex-start; gap: 10px; padding: 12px 8px 12px 14px; border-radius: var(--r); background: var(--ink); color: var(--paper); box-shadow: var(--shadow); font-size: var(--t-sm); pointer-events: auto; animation: rise 0.25s var(--ease); transition: opacity 0.15s; }
.toast.out { opacity: 0; }
.toast > span { flex: 1; min-width: 0; line-height: 20px; padding-block: calc((var(--row) - 20px) / 2); }
.toast > .i { margin-top: calc((var(--row) - 18px) / 2); color: var(--on-ink-ok); }
.toast.info > .i { color: var(--on-ink-2); }
.toast.bad > .i { color: var(--on-ink-bad); }
.toast button { display: grid; place-items: center; min-width: 32px; height: var(--row); padding: 0 8px; border: 0; border-radius: 6px; background: none; color: inherit; font-weight: 600; cursor: pointer; }
.toast button:hover { background: var(--ink-hover); }
.toast button:focus-visible { outline-color: var(--paper); }
.toast [data-undo] { text-decoration: underline; text-underline-offset: 3px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Flows: the step header of a wizard, its footer, a drop zone, a timeline ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 32px; border-bottom: 1px solid var(--ink); }
.steps button { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 0 10px; width: 100%; padding: 12px 4px 14px; border: 0; background: none; box-shadow: inset 0 -3px 0 transparent; color: var(--ink-3); text-align: left; cursor: pointer; }
.steps button[disabled] { cursor: default; }
.steps button:not([disabled]):hover { color: var(--ink); }
.step-n { grid-row: span 2; display: grid; place-items: center; width: 26px; height: 26px; border: 1.5px solid currentColor; border-radius: 50%; font: 600 var(--t-sm)/1 var(--mono); }
.step-t { font-weight: 600; }
.step-s { overflow: hidden; font-size: var(--t-sm); white-space: nowrap; text-overflow: ellipsis; }
.steps [aria-current="step"] { box-shadow: inset 0 -3px 0 var(--ink); color: var(--ink); }
.steps [aria-current="step"] .step-n { border-color: var(--ink); background: var(--cta); color: var(--cta-ink); }
.steps .is-done button { color: var(--ink-2); }
.steps .is-done .step-n { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.wiz-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.wiz-foot > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wiz-foot.bare { margin-top: 0; padding: 0; border: 0; }
.drop { display: grid; justify-items: start; gap: 10px; padding: 32px; border: 1.5px dashed var(--edge); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); text-align: left; }
.drop.fill { height: 100%; }
.drop[data-dragging] { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font-size: var(--t-md); }
.drop ui-progress { width: 100%; font-size: var(--t-base); }
ui-timeline { display: grid; max-width: 560px; }
ui-timeline-item { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 2px 14px; padding-bottom: 20px; }
ui-timeline-marker { width: 10px; height: 10px; margin: 6px 2px 0; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); }
ui-timeline-connector { position: absolute; left: 6px; top: 20px; bottom: 0; width: 1px; background: var(--line-2); }
ui-timeline-item:last-child ui-timeline-connector { display: none; }
ui-timeline-title { font-weight: 500; }
ui-timeline-time { font: 400 var(--t-sm)/1.6 var(--font); color: var(--ink-3); }
ui-timeline-description { grid-column: 2 / -1; font-size: var(--t-sm); color: var(--ink-3); }
[data-now] > ui-timeline-marker { border-color: var(--ink); background: var(--cta); }
[data-now] ui-timeline-title { font-weight: 600; }
[data-done] > ui-timeline-marker { background: var(--ink); }
[data-done] ui-timeline-title { color: var(--ink-3); }

/* Big choices and the phone menu page */
.choose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 860px; }
.choice { display: grid; gap: 6px; align-content: start; padding: 24px; border: 1.5px solid var(--edge); border-radius: var(--r-lg); background: var(--surface); text-decoration: none; }
.choice:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.choice b { font: 700 var(--t-lg)/1.2 var(--display); letter-spacing: -0.02em; }
.choice span { color: var(--ink-2); }
.choice .go { margin-top: 10px; color: var(--accent); font-weight: 600; }
/* The phone's menu rows (the drawer and the plain page), one design with the desktop's menu (owner, 18 Nov 2026, O-105):
   no line under every row; a short inset divider only between groups, with the same air above and below it; rows of
   48 px with their text on the row's middle; the person's name is a quiet label, not a ruled heading. */
.menu-page a, .menu-page button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 4px; border: 0; border-radius: var(--r); background: none; color: inherit; font-weight: 600; font-size: var(--t-md); text-align: left; text-decoration: none; cursor: pointer; }
.menu-page a:hover, .menu-page button:hover { background: var(--sunken); }
.menu-page a > span, .menu-page .lang-label { min-width: 0; overflow-wrap: anywhere; }
.menu-page .space-opt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.menu-page .end { margin-left: auto; color: var(--accent); }
.menu-page > li[data-gap]::before, .menu-sec + .menu-sec::before { content: ""; display: block; height: 1px; margin: 10px 4px; background: var(--line-2); }
.menu-sec.sec { margin-top: 0; }
.menu-sec .sec-head { padding: 6px 4px 2px; border: 0; }
.menu-sec .sec-head h2 { font: 500 var(--t-sm)/1.4 var(--font); letter-spacing: 0; color: var(--ink-2); }
/* the two things one can start („+”, both widths; owner, 18 Nov 2026, O-097): each option an icon, a title in ink and a
   quieter explanation, a short line between the two; on a touch screen no option looks chosen when the menu opens
   (the highlight shows for the keyboard and for a mouse's hover) */
.new-menu [data-slot="menu-item"] { align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 12px; }
.new-menu [data-slot="menu-item"] > .i { margin-top: 2px; color: var(--ink-2); }
.new-menu .space-opt { color: var(--ink); font-weight: 500; }
.new-menu .space-opt small { margin-top: 2px; color: var(--ink-2); font-size: var(--t-sm); font-weight: 400; }
.new-menu [data-slot="menu-separator"] { margin: 4px 12px; }
@media (hover: none) { .new-menu [data-slot="menu-item"][data-highlighted]:not(:focus-visible) { background: transparent; } }
/* the phone's menu as a drawer (O-094): three quarters of the screen, from the right (where „Meniu” is), its own scroll */
[data-slot="drawer-content"].menu-drawer { display: flex; flex-direction: column; box-sizing: border-box; width: 75vw; max-width: 75vw; height: 100dvh; padding: 0; border-radius: 0; background: var(--paper); }
.menu-drawer-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 6px 4px 20px; }
.menu-drawer-head [data-slot="drawer-title"], .menu-drawer-head ui-drawer-title { font: 700 var(--t-lg)/1.2 var(--display); letter-spacing: -0.02em; }
.menu-drawer-head .btn-icon { width: 44px; height: 44px; }
.menu-drawer-body { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); }
@media (prefers-reduced-motion: reduce) { [data-slot="drawer-content"], [data-slot="drawer-backdrop"] { transition: none !important; animation: none !important; } }
/* the language row of the phone's Meniu page (O-090): a row like its neighbours (icon, its words, the language at the right) */
.menu-page .menu-lang ui-select, .menu-page .menu-lang ui-select-trigger { display: block; }
.menu-page .menu-lang ui-select-trigger > button { justify-content: flex-start; height: auto; min-height: 48px; border: 0; border-radius: var(--r); background: none; box-shadow: none; line-height: inherit; }
.menu-page .menu-lang ui-select-value { flex: 0 1 auto; max-width: 50%; margin-left: auto; overflow: hidden; color: var(--ink-3); font-weight: 400; text-align: right; white-space: nowrap; text-overflow: ellipsis; } /* a long name is cut at its end; the row's words wrap */

/* ---------- Narrower windows ---------- */
@media (max-width: 1180px) {
  .tbl td.side { white-space: normal; }
}
@media (max-width: 1100px) {
  .space-name { max-width: 170px; }
  .trail li:not([aria-current], .trail-home) { display: none; } /* „Acasă”, then the page itself */
}
@media (max-width: 1080px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

/* a row's actions (every list): one visible verb + the „⋯” menu (ui-menu), on one line; a deletion in the menu is
   <ui-menu-item destructive> (red, [data-destructive] above) */
.row-acts { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 4px; }
/* chips: the list's columns to put into a text (step 2, the editor) */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--t-sm); color: var(--ink-3); }
.chip { height: 28px; padding: 0 8px; border: 1px solid var(--edge); border-radius: 6px; background: var(--surface); color: var(--accent); font: 500 var(--t-sm)/1 var(--mono); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
/* a dropdown's value on one line, cut with …, so the field keeps the control height */
@media (min-width: 821px) { ui-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } } /* on a phone a long value wraps instead: a nowrap value widened the whole form past the screen (German step 2) */
/* number fields keep type=number (keyboard, validation) without the browser's spinners */
input[type=number] { appearance: textfield; -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* numbers people read: Geist's plain digits (tabular), not Geist Mono's slashed zero; codes and addresses stay .mono */
:is(.count, .space-mark, .credits b, .sec-head .n, .big-n, .date b, .step-n, .num) { font-family: var(--font); font-variant-numeric: tabular-nums; }

/* ---------- Phone: bar at the bottom, 44 px targets, 16 px text ---------- */
@media (max-width: 820px) {
  :root { --t-base: 1rem; --t-sm: 0.875rem; --t-xs: 0.8125rem; --control-h: 44px; }
  html { scroll-padding-bottom: 150px; }
  .on-wide { display: none; }
  .on-narrow { display: inline; }
  .app { display: block; }
  main { padding: 22px 16px 120px; }
  h1, .page-head.rec h1 { font-size: 1.5rem; }
  .rail, .fab { display: none; }
  [data-mode="admin"] .rail { display: flex; position: sticky; z-index: var(--z-nav); height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; overflow: visible; border-right: 0; }
  .brand span { display: none; }
  [data-mode="admin"] .rail .nav { order: 9; display: flex; flex: 1 0 100%; padding-right: 28px; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(90deg, var(--ink) calc(100% - 28px), transparent); }
  [data-mode="admin"] .rail .nav a { min-height: 44px; white-space: nowrap; }
  .back-app { min-height: 44px; margin-left: auto; }
  [data-mode="admin"] .top { position: static; }
  [data-mode="admin"] .top-brand, [data-mode="admin"] .top .admin-tag { display: none; }
  [data-mode="admin"] .trail ol { display: flex; }
  [data-mode="admin"] .trail li:first-child::before { display: none; }

  .top { padding: 0 12px; }
  .top-brand { display: inline-flex; justify-content: center; width: 44px; height: 44px; padding: 0; }
  .trail { margin-right: 0; overflow: hidden; }
  .trail ol { display: none; }
  [data-mode="app"] .trail { display: none; } /* a phone's top bar: logo, the space, search, credits */
  .top-brand { order: -2; }
  #spaceMenu { order: -1; flex: 1; }
  #spaceMenu, #spaceMenu ui-menu-trigger { display: flex; min-width: 0; }
  .space { flex: 0 1 auto; min-width: 0; max-width: 100%; height: 44px; }
  .space-name { flex: 1 1 auto; min-width: 0; max-width: none; }
  .space .i { flex: none; }
  .iconbtn { width: 44px; height: 44px; }
  .credits { justify-content: center; gap: 4px; min-width: 44px; height: 44px; padding: 0 6px; }
  .credits span { display: none; }
  [data-mode="admin"] .rail-foot { display: contents; }
  [data-mode="admin"] .rail-foot .lang-form, [data-mode="admin"] .rail-foot :is(.account-name, .i-s) { display: none; }
  [data-mode="admin"] .rail-foot .account { justify-content: center; width: 44px; height: 44px; padding: 0; }
  [data-mode="admin"] .rail { column-gap: 2px; } /* logo, „Administrare”, the way back and the person on one row at 360 px */
  [data-mode="admin"] .rail .back-app { padding-inline: 6px; }
  .tabbar { position: fixed; z-index: var(--z-nav); left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); background: var(--paper); }
  /* the bar's own tabs only (direct children): the „+” menu's options live inside the bar and were drawn as tabs, centred
     and small, so a short option started further right than a long one (owner, 18 Nov 2026, O-093) */
  .tabbar > a { display: grid; justify-items: center; gap: 3px; min-height: 48px; padding: 6px 2px; border-radius: var(--r); color: var(--ink-2); font-size: 0.75rem; font-weight: 500; text-decoration: none; }
  /* where you are (owner, 18 Nov 2026, O-103, his choice A): the item's icon and word in the app's blue, the icon filled
     softly and drawn heavier, the word bolder: colour, shape and weight together. „Meniu” reads the same while its
     drawer is open. The round „+” in the middle is never „current”. */
  .tabbar > a:is([aria-current], [aria-expanded="true"]) { color: var(--accent); font-weight: 600; }
  .tabbar > a:is([aria-current], [aria-expanded="true"]) .i { fill: currentColor; fill-opacity: 0.22; stroke-width: 1.9; }
  .tabbar ui-menu { display: grid; place-items: center; }
  .tabbar .tab-new { display: grid; cursor: pointer; place-items: center; align-self: center; justify-self: center; width: 48px; height: 48px; min-height: 0; padding: 0; border: 1.5px solid var(--accent); border-radius: 50%; background: transparent; color: var(--accent); } /* an outline, as the rail's „+ Nou”: the page keeps its one yellow */
  .tabbar .tab-new .i { width: 22px; height: 22px; }
  [data-mode="admin"] .tabbar { display: none; }
  .toasts { bottom: 84px; }
  [data-flow] .toasts { bottom: 96px; }
  /* inside a flow (the wizard, the editor) the bottom bar goes: the flow's own bar and its back button (with its word) lead out */
  [data-flow] .tabbar { display: none; }
  .chip { height: 44px; padding: 0 12px; }
  [data-flow] .wiz-foot { bottom: env(safe-area-inset-bottom); }
  .sec-head .end .btn { height: auto; min-height: var(--control-h); padding-block: 8px; white-space: normal; text-align: left; } /* „Retrimite …” wraps, never runs off */
  .head-actions .btn { height: auto; min-height: var(--control-h); padding-block: 8px; white-space: normal; text-align: left; } /* may wrap, never run off */
  .toast { --row: 44px; }
  .toast button { min-width: 44px; }

  ui-input > input, ui-textarea > textarea, ui-select-trigger > button { font-size: 1rem; }
  [data-mode="admin"] .rail .brand { justify-content: center; min-width: 44px; min-height: 44px; }
  ui-tabs-list { gap: 18px; padding-right: 28px; mask-image: linear-gradient(90deg, var(--ink) calc(100% - 28px), transparent); }
  ui-tabs-tab > button { height: 48px; }
  ui-segmented-control-item { height: 44px; }
  [data-slot="menu-item"], [data-slot="menu-radio-item"], [data-slot="command-item"] { min-height: 44px; }
  [data-slot="alert-dialog-close"] { flex: 1; }
  .check { min-height: 44px; }
  .crumb, p > a.link:only-child, dd > a.link:only-child, button.link, td > a, th > a, .sub a, .row-title, .skip { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }

  .row { grid-template-columns: 36px minmax(0, 1fr); align-items: start; padding: 14px 0; }
  .row-state { grid-column: 2 / -1; }
  .row-act { grid-column: 2 / -1; justify-content: flex-start; min-width: 0; margin-top: 6px; }
  .row-act:empty { display: none; }
  /* a phone (owner, 18 Nov): the date tile smaller and clear of the text beside it (it was 50 px in a 40 px column); a
     row's action as wide as the row, with its „⋯” at the end; a page's own „new” button as wide as the page */
  .row { column-gap: 14px; }
  .date { grid-template-rows: 14px 1fr; width: 36px; height: 40px; border-radius: 7px; } /* O-099: 36 × 40 (was 40 × 44, before that 50 × 54) */
  .date span { font-size: 0.625rem; line-height: 14px; letter-spacing: 0.03em; } /* the month: 10 px, never smaller */
  .date b { font: 600 1rem/24px var(--font); } /* the day: 16 px, the row's anchor */
  .row > .row-act { grid-column: 1 / -1; gap: 8px; margin-top: 10px; }
  .row > .row-act > .btn:not(.btn-icon) { flex: 1; justify-content: center; }
  /* ... and the state pill at the right end of the name's line instead of a row of its own; the sentence that was under
     the pill (.row-note) goes under the details, which keep the whole width; the tile does not hold the name's line open */
  .row:has(> .date) { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .row:has(> .date) > :is(.row-state, div:nth-child(2)) { display: contents; }
  .row:has(> .date) > div:nth-child(2) > .row-title { grid-column: 2; grid-row: 1; justify-self: start; }
  .row:has(> .date) > div:nth-child(2) > :not(.row-title) { grid-column: 2 / -1; }
  .row:has(> .date) > .date { grid-row: 1 / span 2; margin-bottom: -24px; }
  .row:has(> .date) > .row-state > .pill { grid-column: 3; grid-row: 1; align-self: start; max-width: 42vw; margin: 0; white-space: normal; }
  .row:has(> .date) > .row-state > .pill ~ .pill { grid-column: 2 / -1; grid-row: auto; justify-self: start; max-width: 100%; }
  .row:has(> .date) > .row-state > :is(.row-note, ui-progress) { grid-column: 2 / -1; font-size: var(--t-sm); color: var(--ink-2); }
  /* the row's name starts level with the top of its date tile; its 44 px touch area hangs below the text, over the gap */
  .row > div > .row-title { align-items: flex-start; min-width: 0; min-height: 0; margin-top: -2px; padding-bottom: 22px; margin-bottom: -22px; }
  /* O-098: two lines at most, then „…”; a long word breaks instead of widening the row */
  .row > div > .row-title > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; min-width: 0; overflow: hidden; overflow-wrap: anywhere; }
  .page-head > .head-actions { width: 100%; }
  /* RV-F-04: a draft's head keeps its title and its „⋯” on one row (part-a.css, nowrap): the actions take only their own
     width, so the title is never squeezed into a column where every word breaks with a hyphen */
  .page-head.tight > .head-actions { width: auto; flex: none; }
  /* a button may sit inside the wrappers of what it opens (a menu, a dialog, a popover) or inside its own form: each wrapper
     passes the row's width and height on, so every button of the head has the same top and height as its neighbours */
  .page-head > .head-actions > :is(ui-menu, ui-dialog, ui-popover, form, .on-narrow),
  .page-head > .head-actions > :is(ui-menu, ui-dialog, ui-popover) > :is(ui-menu-trigger, ui-dialog-trigger, ui-popover-trigger) { display: flex; flex: 1; min-width: 0; }
  .page-head > .head-actions > :is(ui-menu, ui-dialog, ui-popover, form):has(.btn-icon) { flex: none; } /* a „⋯” keeps its own width */
  /* the two swiped rows never widen the page: their size does not depend on what is inside them */
  .figs.cards, .head-filters { contain: inline-size; max-width: 100%; }
  .page-head > .head-actions { align-items: stretch; }
  .page-head > .head-actions .btn:not(.btn-icon) { flex: 1; justify-content: center; text-align: center; }
  .page-head > .head-actions .btn-icon { height: auto; } /* beside a button whose label takes two lines, as high as it */
  .choose, .two { grid-template-columns: minmax(0, 1fr); }
  .steps .step-s { display: none; }
  .steps button { grid-template-columns: 1fr; justify-items: start; gap: 6px; }
  .drop { padding: 22px 18px; }
  .wiz-foot { position: sticky; z-index: var(--z-foot); bottom: calc(63px + env(safe-area-inset-bottom)); flex-wrap: nowrap; margin-inline: -16px; padding: 12px 16px; background: var(--paper); }
  .wiz-foot > div:last-child { flex: 1; min-width: 0; }
  .wiz-foot > div:last-child .btn, .wiz-foot > div:last-child ui-button { flex: 1; min-width: 0; }
  .wiz-foot.bare { position: static; margin-inline: 0; }

  .tbl.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tbl.stack tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .tbl.stack td, .tbl.stack tbody th { display: block; grid-column: 1 / 3; min-width: 0; padding: 0; border: 0; color: var(--ink-2); font-size: var(--t-sm); text-align: left; overflow-wrap: anywhere; }
  .tbl.stack tbody th.main { grid-row: 1; color: var(--ink); font-size: var(--t-base); }
  .tbl.stack td.side { grid-row: 1; grid-column: 3; justify-self: end; text-align: right; white-space: normal; }
  .tbl.stack td.side .hint { display: block; }
  .tbl.stack td[data-l]::before { content: attr(data-l) ": "; color: var(--ink-3); }
  .tbl.stack td.act { grid-row: 2 / span 2; grid-column: 3; align-self: center; justify-self: end; }
  .tbl.stack td:empty { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* The waiting piece (O-127, O-128; doc 38): class "skel" on a box that already has its final size (an aspect-ratio or a fixed
   height, from CSS), aria-busy="true" on it while its content is coming, taken off once the content is shown. Nothing is drawn
   for the first 200 ms (a placeholder shown at once only flickers); then a quiet surface with a soft light passing, BEHIND the
   box's content, so a page already shown stays in sight until the new one replaces it. Reduced motion: the surface, still. */
.skel { position: relative; isolation: isolate; } /* its own layer: the surface (z-index -1) stays under any content, in flow or placed */
.skel[aria-busy="true"]::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; border-radius: inherit;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.6) 50%, transparent 70%) 100% 0 / 250% 100% no-repeat, var(--sunken);
  animation: skel-in 0.15s 0.2s forwards, skel-pass 1.4s 0.2s ease-in-out infinite; }
@keyframes skel-in { to { opacity: 1; } }
@keyframes skel-pass { from { background-position: 100% 0, 0 0; } to { background-position: -150% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .skel[aria-busy="true"]::before { background: var(--sunken); } }

/* The app's date field (assets/app/date-pick.js; owner, 25 Nov 2026: V-016's document date): ui-sdk's
   date picker over the native field. The button reads like a select (one height with the fields beside it, the calendar
   icon at the end where a select has its chevron); the calendar opens under it and flips up without room */
.dpick { display: block; width: 100%; min-width: 0; }
.dpick-btn[data-slot] { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; height: var(--control-h); padding: 0 10px 0 12px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; text-align: left; }
.dpick-btn[data-slot]::before { order: 2; color: var(--ink-2); }
.dpick-btn[data-slot]:hover:not([data-disabled]) { border-color: var(--ink-3); background: var(--surface); color: var(--ink); }
.dpick-btn[data-slot]:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.dpick-v { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dpick-pop[data-slot] { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.dpick-pop > ui-calendar-grid { grid-column: 1 / -1; }
.dpick-pop [data-slot="calendar-day"] { border-radius: var(--r); cursor: pointer; }
.dpick-pop [data-slot="calendar-day"][data-selected] { background: var(--accent); color: var(--surface); font-weight: 600; }
.dpick-pop [data-slot="calendar-day"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 820px) {
  .dpick-pop :is([data-slot="calendar-day"], [data-slot="calendar-weekday"]) { width: 44px; height: 44px; } /* a finger's target */
  .dpick-pop :is([data-slot="calendar-previous"], [data-slot="calendar-next"]) { width: 44px; height: 44px; }
}
.form-row > :is(ui-field, .fld) > ui-date-picker { grid-row: 2; } /* the control line, where the native field was */
.i-date-row { display: grid; gap: 12px; min-width: 0; } /* templates/app/sends/_part-i.php: the date, then its format */
.i-date-row > * { min-width: 0; }
