/* Veripass — shared design system.
   Night-apron board + paper boarding pass. Loaded by every page; lives under
   /assets/, which the closed-test gate leaves open so the public passport
   page can use it too. */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:wght@400;500;700&family=Barlow+Semi+Condensed:ital,wght@0,500;0,600;0,700;1,600;1,700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --apron: #0f1720;        /* page ground */
  --board: #17212d;        /* board panels, cells */
  --board-2: #1f2b39;      /* raised cell, hover */
  --rule: #2c3a4a;         /* cell separators */
  --ink: #e8edf2;          /* text on board */
  --ink-2: #a9b6c4;        /* secondary on board (≥4.5:1 on --board) */
  --ink-3: #8696a8;        /* tertiary, large/meta only */
  --flap: #f2c230;         /* active state, the one primary action */
  --flap-ink: #1a1404;
  --go: #3fa36b;           /* ONLINE */
  --go-text: #5cc489;
  --stop: #e5484d;         /* WYCOFANY / errors */
  --stop-text: #ff7a7e;
  --draft: #f2c230;
  --paper: #e8edf2;        /* the boarding pass */
  --paper-2: #d6dde5;
  --paper-ink: #0f1720;
  --paper-ink-2: #3c4a5a;

  --f-board: 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;
  --f-text: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --f-id: 'JetBrains Mono', ui-monospace, monospace;

  --gap: 3px;              /* board cell gap */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r: 4px;                /* board cells are nearly square */
  --r-pass: 14px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* Always reserve the scrollbar track: short tabs (Zespół) and long ones (Rejestr) keep the same width, so switching never shifts the page sideways. */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0; background: var(--apron); color: var(--ink);
  font: 400 16px/1.5 var(--f-text);
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--flap); color: var(--flap-ink); }
:focus-visible { outline: 3px solid var(--flap); outline-offset: 2px; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--flap); }
* { scrollbar-color: var(--rule) transparent; scrollbar-width: thin; }
input, select, textarea, button { font: inherit; color: inherit; caret-color: var(--flap); }
h1, h2, h3 { font-family: var(--f-board); font-weight: 600; letter-spacing: .01em; line-height: 1.1; margin: 0; text-wrap: balance; }
.id { font-family: var(--f-id); font-size: .92em; letter-spacing: 0; }
.muted { color: var(--ink-2); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.ol-top {
  display: flex; align-items: center; gap: var(--s5);
  padding: var(--s3) var(--s5); border-bottom: 1px solid var(--rule);
  background: var(--apron); position: sticky; top: 0; z-index: 20;
  min-height: 69px; /* bar height reserved even before the first paint of its contents */
  view-transition-name: ol-top; /* stays put while the page below it changes */
}
/* Page-to-page navigation inside the portal: the bar holds still, the content
   cross-fades quickly instead of flashing white→empty→filled. */
/* Opt-in (@view-transition) is inline in each signed-in page's <head>, see portal.html. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 140ms; }
::view-transition-group(ol-top) { animation: none; }
::view-transition-old(ol-top) { display: none; }
::view-transition-new(ol-top) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
.ol-brand { display: flex; align-items: center; gap: var(--s2); text-decoration: none; font: 700 22px/1 var(--f-board); letter-spacing: .02em; }
.ol-brand svg { width: 30px; height: 30px; flex: none; }
.ol-word { white-space: nowrap; }
.ol-word em { font-style: italic; color: var(--flap); padding-right: .04em; }
.ol-top nav { display: flex; gap: var(--s1); flex: 1; flex-wrap: wrap; }
.ol-top nav a {
  text-decoration: none; padding: var(--s2) var(--s3); border-radius: var(--r);
  font: 600 15px/1 var(--f-board); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
.ol-top nav a[aria-current="page"] { background: var(--board); color: var(--flap); }
.ol-top nav a:hover { color: var(--ink); background: var(--board); }
.ol-main { padding: var(--s5); max-width: 1680px; margin: 0 auto; }

/* Interface language switch (PL | EN), just left of the organisation menu */
.ol-lang { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--rule); border-radius: var(--r); margin-left: auto; flex: none; }
.ol-lang button {
  min-width: 40px; min-height: 38px; padding: 0 var(--s2); border: 0; border-radius: calc(var(--r) - 2px); background: none; cursor: pointer;
  font: 600 14px/1 var(--f-board); letter-spacing: .08em; color: var(--ink-2);
}
.ol-lang button:hover { color: var(--ink); background: var(--board); }
.ol-lang button[aria-pressed="true"] { background: var(--board); color: var(--flap); cursor: default; }
.ol-lang button:focus-visible { outline: 2px solid var(--flap); outline-offset: 1px; }
.ol-lang + .ol-org { margin-left: 0; }

/* Organisation menu (company pages + sign out), right end of the top bar */
.ol-org { position: relative; margin-left: auto; }
/* Pre-login pages (login/register): explicit way back to the landing page. */
.ol-home-link { margin-left: auto; }
.ol-org-btn {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; max-width: 280px;
  padding: 8px var(--s3); border: 1px solid var(--rule); border-radius: var(--r); background: transparent;
  color: var(--ink-2); cursor: pointer; font: 600 15px/1 var(--f-board); letter-spacing: .04em;
}
.ol-org-btn:hover, .ol-org-btn[aria-expanded="true"] { color: var(--ink); background: var(--board); border-color: var(--ink-3); }
.ol-org-btn[data-current="true"] { color: var(--flap); border-color: rgba(242,194,48,.5); }
.ol-org-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-org-btn .icon:last-child { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.ol-org-btn[aria-expanded="true"] .icon:last-child { transform: rotate(180deg); }
.ol-org-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; z-index: 30;
  background: var(--board); border: 1px solid var(--rule); border-radius: var(--r);
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.3); padding: var(--s2);
  transform-origin: top right; animation: menu-in .18s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .ol-org-menu { animation: none; } }
.ol-org-who { display: grid; gap: 2px; padding: var(--s2) var(--s3) var(--s3); border-bottom: 1px solid var(--rule); margin-bottom: var(--s1); }
.ol-org-who strong { font: 600 17px/1.2 var(--f-board); }
.ol-org-who span { font-size: 13px; color: var(--ink-2); word-break: break-all; }
.ol-org-menu ul { list-style: none; margin: 0; padding: 0; }
.ol-org-menu a, .ol-org-out {
  display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 42px; padding: 0 var(--s3);
  border-radius: var(--r); text-decoration: none; color: var(--ink); font-size: 15px;
  background: none; border: 0; cursor: pointer; text-align: left;
}
.ol-org-menu a:hover, .ol-org-menu a:focus-visible, .ol-org-out:hover, .ol-org-out:focus-visible { background: var(--board-2); color: var(--ink); }
.ol-org-menu .icon { color: var(--ink-2); }
.ol-org-menu .ol-org-home { border-top: 1px solid var(--rule); margin-top: var(--s1); }
.ol-org-menu .ol-org-home + .ol-org-out { margin-top: 0; }
.ol-org-out { border-top: 1px solid var(--rule); border-radius: 0 0 var(--r) var(--r); margin-top: var(--s1); padding-top: 2px; }

/* Page head shared by hub-level pages (Opakowania, Firma) */
.page-head { display: grid; gap: var(--s3); margin-bottom: var(--s5); }
.page-head h1 { font-size: clamp(32px, 3.4vw, 52px); }
.page-head p { margin: 0; max-width: 75ch; color: var(--ink-2); }
.page-tabs { margin-bottom: var(--s5); }
.page-tabs .icon { width: 16px; height: 16px; align-self: center; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s4); }
.sec-head h2 { font-size: clamp(26px, 2.4vw, 34px); }
.sec-head p { margin: var(--s2) 0 0; color: var(--ink-2); max-width: 75ch; }
.stack { display: grid; gap: var(--s5); }

/* Data tables (libraries, team, registrations) */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0 var(--gap); font-size: 15px; }
.tbl th { text-align: left; font: 600 13px/1 var(--f-board); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: var(--s2) var(--s3); white-space: nowrap; }
.tbl td { background: var(--board); padding: var(--s3); vertical-align: middle; }
.tbl td:first-child { border-radius: var(--r) 0 0 var(--r); }
.tbl td:last-child { border-radius: 0 var(--r) var(--r) 0; }
.tbl tr:hover td { background: var(--board-2); }
.tbl .strong { font: 600 18px/1.2 var(--f-board); letter-spacing: .02em; }
.tbl .actions { white-space: nowrap; text-align: right; }
.tbl .actions .btn { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.tbl .empty-row td { text-align: center; color: var(--ink-2); padding: var(--s5); }
.panel .tbl td { background: var(--apron); }
.panel .tbl tr:hover td { background: #131d28; }
.tbl select { background: #0b1219; border: 1px solid var(--rule); border-radius: var(--r); padding: 6px 8px; min-height: 36px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4) var(--s5); align-items: end; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.panel > h3 { font-size: 22px; margin-bottom: var(--s4); }
.panel > h3 + .help, .panel > h3 + p { margin: calc(var(--s3) * -1) 0 var(--s4); color: var(--ink-2); font-size: 14px; }

/* Feature above the current plan */
.locked { display: flex; gap: var(--s4); align-items: flex-start; padding: var(--s5); border: 1px dashed var(--rule); border-radius: var(--r); color: var(--ink-2); }
.locked > .icon { width: 24px; height: 24px; color: var(--flap); margin-top: 2px; }
.locked strong { color: var(--ink); font: 600 20px/1.2 var(--f-board); }
.locked p { margin: var(--s1) 0 var(--s3); }

/* Metric readouts (PEF, PPWR) */
.readouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--gap); }
.readout { background: var(--apron); border-radius: var(--r); padding: var(--s3) var(--s4); display: grid; gap: 4px; }
.readout small { font: 600 12px/1.3 var(--f-board); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.readout strong { font: 600 24px/1.1 var(--f-id); }
.readout strong.ok { color: var(--go-text); } .readout strong.bad { color: var(--stop-text); }
.class-badge { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r); font: 700 24px/1 var(--f-board); background: var(--paper); color: var(--paper-ink); }
.class-badge.A, .class-badge.B { background: var(--go); color: #06150c; }
.class-badge.C { background: var(--flap); color: var(--flap-ink); }
.class-badge.D, .class-badge.E { background: var(--stop); color: #fff; }

/* ── Board ─────────────────────────────────────────────────────────────── */
.board { display: grid; gap: var(--gap); }
.board-head, .board-row {
  display: grid; gap: var(--gap);
  grid-template-columns: var(--cols, minmax(0, 3fr) minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.1fr));
}
.board-head > * {
  font: 600 13px/1 var(--f-board); letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); padding: var(--s2) var(--s3);
}
.board-row > * {
  background: var(--board); padding: var(--s3) var(--s3); min-height: 56px;
  display: flex; flex-direction: column; justify-content: center; min-width: 0;
}
.board-row > :first-child { border-radius: var(--r) 0 0 var(--r); }
.board-row > :last-child { border-radius: 0 var(--r) var(--r) 0; }
.board-row { cursor: pointer; text-align: left; border: 0; padding: 0; background: none; width: 100%; color: inherit; }
.board-row:hover > * { background: var(--board-2); }
.board-row[aria-selected="true"] > * { background: var(--board-2); box-shadow: inset 0 2px 0 var(--flap), inset 0 -2px 0 var(--flap); }
.board-row[aria-selected="true"] > :first-child { box-shadow: inset 0 2px 0 var(--flap), inset 0 -2px 0 var(--flap), inset 2px 0 0 var(--flap); }
.board-row[aria-selected="true"] > :last-child { box-shadow: inset 0 2px 0 var(--flap), inset 0 -2px 0 var(--flap), inset -2px 0 0 var(--flap); }
.cell-main { font: 600 20px/1.15 var(--f-board); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub.id { font-size: 12px; }

/* Split-flap text: each character sits in its own leaf. */
.flap { display: inline-flex; gap: 2px; font: 600 16px/1 var(--f-id); text-transform: uppercase; }
.flap > span {
  display: inline-grid; place-items: center; min-width: 1em; height: 1.6em; padding: 0 1px;
  background: #0b1219; border-radius: 2px; position: relative; color: var(--c, var(--ink));
}
.flap > span::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0,0,0,.55); }
.flap.go { --c: var(--go-text); }
.flap.draft { --c: var(--flap); }
.flap.stop { --c: var(--stop-text); }
.flap.anim > span { animation: flip .42s var(--ease) both; animation-delay: calc(var(--i) * 28ms); transform-origin: 50% 50%; }
@keyframes flip { 0% { transform: rotateX(90deg); opacity: .2; } 60% { transform: rotateX(-12deg); opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .flap.anim > span { animation: none; } }

/* Gate tabs (sector switcher) */
.gates { display: flex; gap: var(--gap); flex-wrap: wrap; }
.gate-tab {
  border: 0; background: var(--board); color: var(--ink-2); cursor: pointer; border-radius: var(--r);
  padding: var(--s2) var(--s4); font: 600 15px/1.2 var(--f-board); letter-spacing: .08em; text-transform: uppercase;
  display: inline-flex; gap: var(--s2); align-items: baseline; text-decoration: none;
}
.gate-tab b { font: 600 13px/1 var(--f-id); color: var(--ink-3); }
.gate-tab:hover { color: var(--ink); background: var(--board-2); }
.gate-tab[aria-pressed="true"], .gate-tab[aria-current="page"] { background: var(--flap); color: var(--flap-ink); }
.gate-tab[aria-pressed="true"] b, .gate-tab[aria-current="page"] b { color: var(--flap-ink); }

/* ── Status tags ───────────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r);
  padding: 3px 8px; font: 600 12px/1.2 var(--f-board); letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid currentColor; white-space: nowrap;
}
.tag.draft { color: var(--flap); }
.tag.binding { color: var(--go-text); }
.tag.stop { color: var(--stop-text); }
.tag.quiet { color: var(--ink-2); border-color: var(--rule); }

/* ── Boarding pass ─────────────────────────────────────────────────────── */
.pass {
  background: var(--paper); color: var(--paper-ink); border-radius: var(--r-pass);
  box-shadow: 0 24px 48px -16px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.3);
  display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; position: relative;
}
.pass a { color: var(--paper-ink); }
.pass ::selection { background: var(--paper-ink); color: var(--paper); }
.pass-band {
  background: var(--paper-ink); color: var(--paper); padding: var(--s3) var(--s5);
  display: flex; justify-content: space-between; gap: var(--s3); align-items: center;
  font: 600 13px/1.2 var(--f-board); letter-spacing: .14em; text-transform: uppercase;
}
.pass-body { padding: var(--s5); display: grid; gap: var(--s5); align-content: start; }
.pass-title { font: 700 clamp(28px, 2.6vw, 40px)/1.05 var(--f-board); }
.pass-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s4) var(--s5); }
.pf small { display: block; font: 600 11px/1.3 var(--f-board); letter-spacing: .14em; text-transform: uppercase; color: var(--paper-ink-2); margin-bottom: 2px; }
.pf strong { font: 600 20px/1.2 var(--f-board); word-break: break-word; }
.pf strong.id { font: 600 15px/1.3 var(--f-id); }
.pass-stub {
  position: relative; padding: var(--s5); display: grid; grid-template-columns: auto 1fr; gap: var(--s5); align-items: center;
  background: var(--paper-2);
  border-top: 2px dashed rgba(15,23,32,.45);
}
.pass-stub::before, .pass-stub::after {
  content: ''; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--apron);
}
.pass-stub::before { left: -12px; } .pass-stub::after { right: -12px; }
.qr { width: 132px; height: 132px; background: #fff; border-radius: 6px; padding: 6px; display: grid; place-items: center; color: var(--paper-ink-2); font-size: 12px; text-align: center; }
.qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.pass-meter { display: flex; gap: 4px; }
.pass-meter span { flex: 1; height: 10px; border-radius: 2px; background: rgba(15,23,32,.14); }
.pass-meter span.on { background: var(--paper-ink); }
.pass .basis { font-size: 13px; color: var(--paper-ink-2); }

/* ── Controls ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  border: 1px solid var(--rule); background: var(--board); color: var(--ink); cursor: pointer;
  border-radius: var(--r); padding: 10px var(--s4); min-height: 44px;
  font: 600 15px/1 var(--f-board); letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--board-2); border-color: var(--ink-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--flap); border-color: var(--flap); color: var(--flap-ink); }
.btn.primary:hover { background: #ffd34d; border-color: #ffd34d; color: var(--flap-ink); }
.btn.on-paper { background: var(--paper-ink); border-color: var(--paper-ink); color: var(--paper); }
.btn.on-paper:hover { background: #24313f; color: var(--paper); }
/* Secondary (outline) button on the light boarding-pass surface. */
.btn.ghost.paper { color: var(--paper-ink); border-color: rgba(15, 23, 32, .35); }
.btn.ghost.paper:hover { border-color: var(--paper-ink); background: rgba(15, 23, 32, .06); }
.btn.paper.danger { color: #a61b22; border-color: rgba(166, 27, 34, .55); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--stop-text); border-color: rgba(229,72,77,.5); background: transparent; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }
.btn[aria-busy="true"]::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 6px; align-content: start; }
.field > label, .field > .label { font: 600 13px/1.3 var(--f-board); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.field .req { color: var(--flap); }
.field .help { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.field .err { font-size: 13px; color: var(--stop-text); }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; background: #0b1219; border: 1px solid var(--rule); border-radius: var(--r);
  padding: 10px 12px; min-height: 44px; color: var(--ink);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-3); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--flap); box-shadow: 0 0 0 1px var(--flap); }
.field [aria-invalid="true"] { border-color: var(--stop); }
.check { display: flex; gap: var(--s3); align-items: flex-start; cursor: pointer; padding: var(--s2) 0; }
.check input { width: 20px; height: 20px; accent-color: var(--flap); margin: 2px 0 0; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 8px 12px; border-radius: var(--r); background: #0b1219; border: 1px solid var(--rule); font-size: 14px; }
.chip input:checked + span { background: var(--flap); color: var(--flap-ink); border-color: var(--flap); }
.chip input:focus-visible + span { outline: 3px solid var(--flap); outline-offset: 2px; }

/* Panels & groups (editor) */
.panel { background: var(--board); border-radius: var(--r); padding: var(--s5); }
.group { display: grid; gap: var(--s4); padding: var(--s5) 0; border-top: 1px solid var(--rule); }
.group:first-child { border-top: 0; padding-top: 0; }
.group-head { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; flex-wrap: wrap; }
.group-head h3 { font-size: 22px; }
.group-basis { font-size: 13px; color: var(--ink-2); }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4) var(--s5); }
.grid-fields .wide { grid-column: 1 / -1; }

.notice { border: 1px solid var(--rule); border-radius: var(--r); padding: var(--s3) var(--s4); display: flex; gap: var(--s3); align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.notice.draft { border-color: rgba(242,194,48,.45); }
.notice.stop { border-color: rgba(229,72,77,.5); color: var(--stop-text); }
.notice strong { color: var(--ink); }

.toast { position: fixed; bottom: var(--s5); left: 50%; transform: translate(-50%, 20px); opacity: 0; background: var(--paper); color: var(--paper-ink); padding: var(--s3) var(--s5); border-radius: var(--r); font-weight: 500; transition: .3s var(--ease); z-index: 100; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--stop); color: #fff; }

.empty { padding: var(--s7) var(--s5); text-align: center; color: var(--ink-2); display: grid; gap: var(--s3); justify-items: center; }
.empty h3 { color: var(--ink); font-size: 24px; }

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

@media (max-width: 720px) {
  .ol-top { padding: var(--s2) var(--s4); gap: var(--s2) var(--s3); flex-wrap: wrap; min-height: 105px; }
  .ol-top nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--s4) * -1); padding: 0 var(--s4) var(--s1); scrollbar-width: none; }
  .ol-top nav a { white-space: nowrap; }
  /* Edge fade tells the nav scrolls sideways instead of silently clipping a tab. */
  .ol-top nav { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .ol-org-btn { min-height: 40px; max-width: 46vw; }
  .ol-org-menu { position: fixed; left: var(--s4); right: var(--s4); top: 60px; min-width: 0; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl thead { display: none; }
  .tbl tr { margin-bottom: var(--gap); }
  .tbl td { border-radius: 0 !important; padding: var(--s1) var(--s3); }
  .tbl td:first-child { padding-top: var(--s3); border-radius: var(--r) var(--r) 0 0 !important; }
  .tbl td:last-child { padding-bottom: var(--s3); border-radius: 0 0 var(--r) var(--r) !important; }
  .tbl td[data-l]::before { content: attr(data-l); display: block; font: 600 11px/1.4 var(--f-board); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
  .tbl .actions { text-align: left; white-space: normal; }
  .gates { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--s4) * -1); padding: 0 var(--s4); }
  .gate-tab { white-space: nowrap; }
  .gates.page-tabs { margin-bottom: var(--s4); }
  .ol-lang button { min-width: 36px; min-height: 36px; }
  .ol-main { padding: var(--s4); }
  .board-head { display: none; }
  .board-row { grid-template-columns: minmax(0, 1fr) auto; }
  .board-row > :nth-child(2), .board-row > :nth-child(3) { display: none; }
  .pass-stub { grid-template-columns: 1fr; justify-items: start; }
}
/* Phones: brand, language and organisation menu share the first row; the org
   name moves into the opened menu (still the button's accessible name). */
@media (max-width: 480px) {
  .ol-org-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Fields printed on the paper pass: light wells, navy ink. Selector mirrors
   the generic field rule's specificity so it wins on the pass. */
.pass .field input:not([type=checkbox]):not([type=radio]), .pass .field select, .pass .field textarea {
  background: #fff; color: var(--paper-ink); border-color: #b9c3ce;
}
.pass .field input:not([type=checkbox]):not([type=radio]):focus, .pass .field select:focus, .pass .field textarea:focus {
  border-color: var(--paper-ink); box-shadow: 0 0 0 1px var(--paper-ink);
}
.pass .field input::placeholder { color: #6b7886; }
.pass .field > label, .pass .field > .label { color: var(--paper-ink-2); }

/* ── Field hints: "?" next to a label + one floating bubble ─────────────── */
.hint {
  position: relative; display: inline-flex; align-items: center; justify-content: center; vertical-align: -3px;
  width: 20px; height: 20px; margin-left: 6px; padding: 0; border: 0; border-radius: 50%; background: none;
  color: var(--ink-3); cursor: help; flex: none;
}
.hint::after { content: ''; position: absolute; inset: -12px; } /* 44px touch target, no layout cost */
.hint .icon { width: 18px; height: 18px; }
.hint:hover, .hint[aria-expanded="true"] { color: var(--flap); }
.hint:focus-visible { outline: 2px solid var(--flap); outline-offset: 2px; }
.hint-tip {
  position: fixed; z-index: 80; max-width: min(360px, calc(100vw - 24px)); display: grid; gap: 8px;
  padding: var(--s3) var(--s4); background: var(--board-2); color: var(--ink); border: 1px solid var(--rule);
  border-radius: var(--r); box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  font: 400 14px/1.45 var(--f-text); letter-spacing: normal; text-transform: none; text-align: left;
  animation: hint-in .12s var(--ease);
}
.hint-tip .hint-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s2); align-items: baseline; }
.hint-tip b { font: 600 11px/1.4 var(--f-board); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.hint-tip .hint-row span { overflow-wrap: anywhere; }
@keyframes hint-in { from { opacity: 0; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .hint-tip { animation: none; } }

/* Account state strip under the top bar (OL.shell → accountBanner) */
.ol-account { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s2) var(--s5); background: var(--board); border-bottom: 1px solid rgba(242,194,48,.35); color: var(--ink); font-size: 14px; }
.ol-account.stop { border-bottom-color: rgba(229,72,77,.55); }
.ol-account svg { width: 18px; height: 18px; color: var(--flap); flex: none; }
.ol-account.stop svg { color: var(--stop-text); }
.ol-account > span:first-of-type { flex: 1 1 280px; }
.ol-account .btn { min-height: 36px; padding: 6px 14px; }
.ol-account-who { color: var(--ink-2); }
