/* =====================================================================
   Back office
   ===================================================================== */
.bo { display: grid; grid-template-columns: 276px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(180deg, #fff calc(var(--bo-top-h, 0px) + 1cm), var(--page-to, #e9ebea) var(--page-full, 60%)) fixed, #fff; }  /* the full colour at 60 % of the way down (events: 70 %) */
.bo-side { background: #142420; color: #d7e2de; padding: 16px 8px; border-radius: 22px; position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
/* the name and organisation stay in place, what is below their line scrolls */
.side-scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.bo-side .side-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bo-side .brand { color: #fff; font-weight: 800; font-size: 1.02rem; padding: 6px 12px 2px; text-decoration: none; display: flex; align-items: center; gap: 8px; min-width: 0; }
.side-collapse { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: none; color: #9fb4ad; cursor: pointer; }
.side-collapse:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-collapse svg { transition: transform .2s; }
/* The side navigation floats beside the page; collapsed: icons only (desktop). Folding (backoffice.js): the names fade
   out, then the panel narrows – the page beside it, title bar, content and lower bar, slides along (laid out for the
   new width at the start, it only moves) – and each link with it, so that the white pill of the current page ends as
   the circle around its icon; opening the other way round. Links, icons and the group lines keep their places and
   heights in both states, so nothing jumps */
@media (min-width: 981px) {
  .bo-side { top: 12px; height: calc(100vh - 24px); margin: 12px 0 12px 12px; padding-inline: 14px; box-shadow: 0 6px 22px rgb(16 24 20 / .16); }
  .bo-side nav a { min-height: 40px; padding-left: 11px; }  /* collapsed: 40 px wide, a circle with the icon in its middle */
  .bo-side .nav-text, .bo-side .tenant, .bo-side .nav-label { transition: opacity .24s; }
  .bo.nav-quiet .bo-side .nav-text, .bo.nav-quiet .bo-side .tenant, .bo.nav-quiet .bo-side .nav-label { opacity: 0; }
  .bo.nav-jump .bo-side .nav-text, .bo.nav-jump .bo-side .tenant, .bo.nav-jump .bo-side .nav-label { transition: none; }
  .bo.nav-moving { overflow-x: clip; }  /* the page sliding in from the right adds no scroll bar */
  /* above the page and its title bar (z-index 10): the page slides on the graphics card, the panel is drawn by the
     page itself, and where the two are a frame apart the page goes under the panel instead of cutting into it */
  .bo.nav-moving .bo-side { z-index: 11; transition: width .48s cubic-bezier(.2, .7, .2, 1); }
  .bo.nav-moving .bo-main { transition: transform .48s cubic-bezier(.2, .7, .2, 1); }
  .bo.nav-moving .bo-side .nav-text, .bo.nav-moving .bo-side .tenant { white-space: nowrap; overflow: hidden; }
  .bo.nav-min { grid-template-columns: 80px minmax(0, 1fr); }
  .nav-min .side-scroll { overflow-x: hidden; scrollbar-width: none; }
  .nav-min .side-scroll::-webkit-scrollbar { display: none; }
  .nav-min .bo-side .side-head { flex-direction: column; gap: 8px; }
  .nav-min .bo-side .brand { padding: 6px 0 2px; }
  .nav-min .side-collapse svg { transform: rotate(180deg); }
  .nav-min .bo-side .nav-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-min .bo-side .tenant { font-size: 0; padding: 0; }  /* the head as high as when open: the links stay put */
  .nav-min .bo-side nav .nav-count { position: absolute; top: 2px; right: 4px; font-size: .62rem; padding: 0 5px; }
  /* a group's name becomes a line, in the same height */
  .nav-min .bo-side .nav-label { position: relative; color: transparent; }
  .nav-min .bo-side .nav-label::before { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; border-top: 1px solid rgba(255,255,255,.1); }
}
@media (min-width: 981px) and (prefers-reduced-motion: reduce) {
  .bo.nav-moving .bo-side, .bo.nav-moving .bo-main, .bo-side .nav-text, .bo-side .tenant, .bo-side .nav-label { transition: none; }
}
@media (max-width: 980px) { .side-collapse { display: none; } }
.bo-side .tenant { font-size: .82rem; color: #9fb4ad; padding: 0 12px 12px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 8px; }
.bo-side nav a { display: flex; align-items: center; gap: 6px; padding: 9px 0 9px 12px; border-radius: 999px; color: #d7e2de; text-decoration: none; font-weight: 550; font-size: .93rem; }
.bo-side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.bo-side nav a { position: relative; }
/* each section's icon has its colour; light enough for every role colour of the sidebar (at least 3:1, also when current) */
.bo-side nav a.nav-events svg { color: #a5d0f5; }
.bo-side nav a.nav-bookings svg { color: #7fe3c4; }
.bo-side nav a.nav-wagons svg { color: #fbcb6b; }
.bo-side nav a.nav-routes svg { color: #ffb9a0; }
.bo-side .nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7f978f; padding: 14px 12px 4px; font-weight: 700; }
/* a role's own colour (Staff → Roles): the greenish greys of the default become white, dimmed as there */
.bo-side.bo-side-tinted { background: var(--side-bg); color: rgba(255,255,255,.88); }
.bo-side-tinted nav a { color: rgba(255,255,255,.88); }
.bo-side-tinted nav a:hover { background: rgba(255,255,255,.1); }
.bo-side-tinted .tenant, .bo-side-tinted .side-collapse:not(:hover) { color: rgba(255,255,255,.72); }
.bo-side-tinted .nav-label { color: rgba(255,255,255,.62); }
/* the current page: a round white pill around its icon and name, on every sidebar colour (collapsed: a white circle
   around the icon); the icon in the organisation's colour, or, where it has its own (above), in a darker shade of that,
   as the light one is hard to see on white. Every name has the same padding, so that they all start in one line */
.bo-side nav a .nav-text { flex: 1; min-width: 0; margin-block: -5px; padding: 5px; }
.bo-side nav a[aria-current="page"] { background: #fff; color: var(--ink); font-weight: 650; }
.bo-side nav a[aria-current="page"] svg { color: var(--side-bg, #142420); }  /* the colour of the navigation, also when it is tinted */
.bo-side nav a.nav-events[aria-current="page"] svg { color: #2b7cc0; }
.bo-side nav a.nav-bookings[aria-current="page"] svg { color: #1a9470; }
.bo-side nav a.nav-wagons[aria-current="page"] svg { color: #b07a0f; }
.bo-side nav a.nav-routes[aria-current="page"] svg { color: #d4623c; }
/* Events → Calendar (backoffice/timeline.py): a bar per event over a few months, the earliest at the top; the darker part
   is how far it has run; ended ones grey. A short bar has its text beside it */
.view-toggle a { display: inline-flex; align-items: center; gap: 6px; }
.timeline { padding: 12px 16px 16px; }
.timeline-nav { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 8px; }
.timeline-body { position: relative; padding: 26px 0 22px; min-height: 120px; }
.timeline-month { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); pointer-events: none; }
.timeline-month span { position: absolute; top: 2px; left: 6px; white-space: nowrap; color: var(--muted); font-size: .8rem; font-weight: 600; }
.timeline-today { position: absolute; top: 22px; bottom: 18px; z-index: 2; border-left: 2px solid var(--bad); pointer-events: none; }
.timeline-today span { position: absolute; bottom: -18px; left: -1px; transform: translateX(-50%); color: var(--bad); font-size: .75rem; font-weight: 600; }  /* below, clear of the month names */
.timeline-row { position: relative; height: 74px; }
.timeline-bar { position: absolute; top: 4px; height: 66px; display: flex; align-items: center; overflow: hidden; border: 1px solid var(--brand); border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 16%, var(--surface)); color: var(--ink); text-decoration: none; }
.timeline-bar:hover { background: color-mix(in srgb, var(--brand) 24%, var(--surface)); }
.timeline-bar.is-ended { border-color: var(--line-strong); background: var(--neutral-bg); color: var(--ink-2); }
.timeline-bar.cut-before { border-left-style: dashed; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.timeline-bar.cut-after { border-right-style: dashed; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.timeline-run { position: absolute; top: 0; bottom: 0; left: 0; background: color-mix(in srgb, var(--ink) 14%, transparent); pointer-events: none; }
.timeline-text { position: relative; min-width: 0; padding: 0 10px; line-height: 1.25; }
.timeline-text strong, .timeline-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-text strong { font-size: .9rem; }
.timeline-text small { color: var(--ink-2); font-size: .78rem; }
.timeline-label { position: absolute; top: 4px; height: 66px; display: flex; align-items: center; color: var(--ink); text-decoration: none; }
.timeline-label .timeline-text { padding: 0 8px; }
.timeline-label.on-left { justify-content: flex-end; text-align: right; }
.timeline-bar:focus-visible, .timeline-label:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Events → Departures → Calendar (backoffice/departure_calendar.py): a row per day (week, month) or per stretch (day),
   the hours across; each departure a block from its start to its end, those at the same time below each other */
.dep-cal { padding: 12px 16px 14px; }
.dep-cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 10px; }
.dep-cal-title { font-size: 1.02rem; }
.dep-cal-modes { margin-left: auto; }
.dep-cal-grid { --label: 92px; --lane-h: 48px; display: flex; flex-direction: column; }
.dep-cal-day .dep-cal-grid { --label: 190px; --lane-h: 84px; }
.dep-cal-month .dep-cal-grid { --lane-h: 18px; }
.dep-cal-hours { position: relative; height: 20px; margin-left: var(--label); }
.dep-cal-hours span { position: absolute; top: 0; padding-left: 3px; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.dep-cal-row { display: flex; border-top: 1px solid var(--line); }
.dep-cal-row:last-child { border-bottom: 1px solid var(--line); }
.dep-cal-row.is-weekend { background: var(--surface-2); }
.dep-cal-label { flex: none; width: var(--label); padding: 6px 8px 6px 0; color: var(--ink-2); font-size: .82rem; font-weight: 600; }
.dep-cal-month .dep-cal-label { padding-block: 2px; font-size: .75rem; }
.dep-cal-row.is-today .dep-cal-label { color: var(--bad); }
.dep-cal-track { position: relative; flex: 1; min-width: 0; height: calc(var(--lanes) * (var(--lane-h) + 3px) + 6px);
  background: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px calc(100% / var(--hours))); }
.dep-cal-item { position: absolute; top: calc(3px + var(--lane) * (var(--lane-h) + 3px)); height: var(--lane-h); min-width: 6px;
  display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: 0 5px; border: 1px solid;
  border-radius: 6px; font-size: .8rem; line-height: 1.25; text-decoration: none; white-space: nowrap; }
.dep-cal-item strong { font-weight: 650; }
.dep-cal-item small { font-size: .75rem; opacity: .85; }
.dep-cal-item strong, .dep-cal-item small { overflow: hidden; text-overflow: ellipsis; }  /* a short block: cut with … (all in the tooltip) */
.dep-cal-month .dep-cal-item { font-size: .72rem; }
.dep-cal-month .dep-cal-item small { display: none; }  /* too short for the ID: it is in the tooltip */
.dep-cal-fill { position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; opacity: .55; pointer-events: none; }
.dep-cal-item.is-cancelled { border-style: dashed; text-decoration: line-through; }
.dep-cal-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; z-index: 1; }
.dep-cal-now { position: absolute; top: 0; bottom: 0; z-index: 2; border-left: 2px solid var(--bad); pointer-events: none; }
.dep-cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--ink-2); font-size: .8rem; }
.dep-cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dep-cal-legend i { width: 12px; height: 12px; border: 1px solid; border-radius: 3px; }
/* an event's colour in the calendar, in turn */
.ev-0 { background: #d4f1e6; border-color: #1d9e75; color: #0b4a37; }
.ev-1 { background: #fde7c2; border-color: #ba7517; color: #5a3505; }
.ev-2 { background: #e2e0fb; border-color: #7f77dd; color: #2d2775; }
.ev-3 { background: #fbe0e8; border-color: #c4507a; color: #6e1d3a; }
.ev-4 { background: #dcebfb; border-color: #3f85d6; color: #0d3d73; }
.ev-5 { background: #ecf3dc; border-color: #6c9a2a; color: #2f4810; }
.dep-cal-item.is-ended { background: var(--neutral-bg); border-color: var(--line-strong); color: var(--muted); }
.bo-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
/* a section's pages fade from white to the colour of its icon (above) at 25 % strength */
.bo:has(a.nav-events[aria-current="page"]) { --page-to: #a5d0f54d; --page-full: 70%; }  /* 30 % */
.bo:has(a.nav-bookings[aria-current="page"]) { --page-to: #7fe3c44d; }  /* 30 % (the others 25 %) */
.bo:has(a.nav-wagons[aria-current="page"]) { --page-to: #fbcb6b40; }
.bo:has(a.nav-routes[aria-current="page"]) { --page-to: #ffb9a040; }
.bo-main > .bo-content { flex: 1 0 auto; }
/* Glass: every card and tile of the back office – lists, forms, the overview's widgets – frosted over the section's
   colour of the page; not the box office's checkout after its start page (.bo-checkout), which looks like the online one.
   Tables let it show through; their heading stays solid, as it travels down over the rows while the page scrolls
   (backoffice.js; sticky to the page, the browser moves it without telling – so always). Stripes and hover paint over
   the row (:where keeps them as specific as in base.css). */
.bo:not(.bo-checkout) .card { background: rgb(255 255 255 / .42); border-color: rgb(255 255 255 / .75); border-radius: 16px;
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 1px 2px rgb(16 24 20 / .06), 0 5px 12px rgb(16 24 20 / .05), 0 14px 36px rgb(16 24 20 / .1); }  /* lifts it off the white top of a page */
/* a tile that is a link (overview): under the mouse its edge, a tint and its glow in the accent colour */
.bo:not(.bo-checkout) a.card.kpi-link { transition: border-color .12s, box-shadow .12s, background-color .12s; }
.bo:not(.bo-checkout) a.card.kpi-link:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, rgb(255 255 255 / .42));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 22%, transparent); }
.bo:not(.bo-checkout) .card:has(.icon-picker-menu) { -webkit-backdrop-filter: none; backdrop-filter: none; }  /* a blur would tie its position: fixed to the card */
.bo:not(.bo-checkout) .card-foot { background: rgb(255 255 255 / .35); border-radius: 0 0 16px 16px; }
.bo:not(.bo-checkout) .card > .table-wrap:first-child { border-radius: 16px 16px 0 0; }
.bo:not(.bo-checkout) .card > .table-wrap > table.data tfoot td { background: var(--surface); }
.bo:not(.bo-checkout) table.data th { background: var(--surface); border-bottom-color: rgb(16 24 20 / .16); }
.bo:not(.bo-checkout) table.data td { border-bottom-color: rgb(16 24 20 / .12); vertical-align: middle; }  /* dark hairlines: white ones vanish on the light page */
:where(.bo:not(.bo-checkout)) table.data tr.is-stripe > td { background: rgb(255 255 255 / .55); }
:where(.bo:not(.bo-checkout)) table.data tbody tr:hover > td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.bo:not(.bo-checkout) .card .ring-track { stroke: rgb(16 24 20 / .1); }
.bo:not(.bo-checkout) table.data td a:has(> strong) { text-decoration: none; }
.bo:not(.bo-checkout) table.data td a:has(> strong):hover { text-decoration: underline; }
.bo-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.below-top { scroll-margin-top: 92px; }  /* a jump to this anchor stops below the sticky bar */
.bo-top h1 { font-size: 1.133rem; margin: 0; }  /* 13.6 pt */
.bo-top .crumbs { font-size: .85rem; color: var(--muted); }
/* Section tabs next to the page title (e.g. Routes · Prices · Settings) */
.page-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-left: 16px; background: var(--neutral-bg); border: 1px solid var(--line); border-radius: 999px; min-width: 0; max-width: 100%; }
.page-tabs a, .page-tabs-more > button { display: inline-flex; flex: none; align-items: center; gap: 8px; padding: 8px 16px; border: 0; border-radius: 999px; background: none;
  color: var(--ink-2); font: inherit; font-weight: 500; white-space: nowrap; text-decoration: none; cursor: pointer; }
.page-tabs a:hover, .page-tabs-more > button:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.page-tabs a[aria-current="page"], .page-tabs-more.is-current > button { background: var(--surface); color: var(--brand); font-weight: 700; box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
/* Departure: the tabs in the page, with the actions to their right, and grey bars while a tab loads (departure-tabs.js) */
.dep-toolbar { justify-content: space-between; }
.page-tabs.dep-tabs { margin-left: 0; font-size: .92rem; }
.dep-tabs a, .dep-tabs .page-tabs-more > button { padding: 6px 12px; }
.dep-skeleton { display: grid; gap: 12px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.dep-skeleton i { display: block; height: 16px; border-radius: 4px; background: var(--neutral-bg); animation: dep-pulse 1s ease-in-out infinite; }
.dep-skeleton i:first-child { width: 40%; }
.dep-skeleton i:last-child { width: 70%; }
@keyframes dep-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .dep-skeleton i { animation: none; } }
/* A booking in a panel from the right above any list, also above a departure's panel (order-dialog.js): a modal dialog,
   with the place, movement, head and body of the panel below, and at least the width its tables of payments need */
dialog.order-dialog { --bo-top-h: 0px; --side-w: 276px; margin: 0 0 0 auto; width: min(100%, max(1120px, calc((100vw - var(--side-w)) * .76))); max-width: none; height: 100dvh; max-height: none; overflow: hidden; background: color-mix(in srgb, #7fe3c4 25%, var(--bg)); border-radius: 0; box-shadow: -8px 0 30px rgb(0 0 0 / .22); animation: dep-panel-in .22s ease-out; }
dialog.order-dialog::backdrop { animation: dep-layer-in .22s ease-out; }
dialog.order-dialog[open] { display: flex; flex-direction: column; }
dialog.order-dialog:focus { outline: none; }
dialog.order-dialog.is-leaving { pointer-events: none; animation: dep-panel-out .18s ease-in forwards; }
dialog.order-dialog.is-leaving::backdrop { animation: dep-layer-out .18s ease-in forwards; }
.nav-min dialog.order-dialog { --side-w: 80px; }
@media (prefers-reduced-motion: reduce) { dialog.order-dialog, dialog.order-dialog::backdrop, dialog.order-dialog.is-leaving, dialog.order-dialog.is-leaving::backdrop { animation: none; } }
/* Departures list: a departure in a panel from the right, the list beside it (departure-panel.js). The panel scrolls by
   itself, so what sticks below the page header sticks to its top. */
tr.is-open > td { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.dep-panel { --bo-top-h: 0px; --side-w: 276px; position: fixed; top: 0; right: 0; bottom: 0; z-index: 35; display: flex; flex-direction: column; width: max(920px, calc((100vw - var(--side-w)) * .76)); background: var(--bg); box-shadow: -8px 0 30px rgb(0 0 0 / .22); animation: dep-panel-in .22s ease-out; }
.dep-panel:focus { outline: none; }
/* an event or departure, a payment or a wagon: the colour of its section's icon, as that section's pages (a booking: its dialog above) */
.dep-panel[data-section="events"], .dep-panel[data-section="departures"] { background: color-mix(in srgb, #a5d0f5 25%, var(--bg)); }
.dep-panel[data-section="payments"] { background: color-mix(in srgb, #7fe3c4 25%, var(--bg)); }
.dep-panel[data-section="layouts"], .dep-panel[data-section="train-sets"] { background: color-mix(in srgb, #fbcb6b 25%, var(--bg)); }
.dep-panel[data-section="routes"] { background: color-mix(in srgb, #ffb9a0 25%, var(--bg)); }
/* Covers the rest of the page as a dialog's backdrop does: a click on it only closes the panel */
.dep-panel-layer { position: fixed; inset: 0; z-index: 34; background: rgba(16, 24, 20, .45); animation: dep-layer-in .22s ease-out; }
.dep-panel-layer.is-leaving { pointer-events: none; animation: dep-layer-out .18s ease-in forwards; }
@keyframes dep-layer-in { from { opacity: 0; } }
@keyframes dep-layer-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dep-panel-layer, .dep-panel-layer.is-leaving { animation: none; } }
@keyframes dep-panel-in { from { transform: translateX(100%); } }
@keyframes dep-panel-out { to { transform: translateX(100%); } }
.dep-panel.is-leaving { pointer-events: none; animation: dep-panel-out .18s ease-in forwards; }
@media (prefers-reduced-motion: reduce) { .dep-panel, .dep-panel.is-leaving { animation: none; } }
.nav-min .dep-panel { --side-w: 80px; }
@media (max-width: 980px) { .dep-panel { width: 100%; } }
.dep-panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dep-panel-title { flex: 1 1 200px; min-width: 0; font-size: 1.05rem; font-weight: 700; }
.title-icon-bookings svg, .title-icon-events svg { vertical-align: -3px; }
/* A train set's events: their IDs two to a line, so the column stays narrow */
.event-codes { display: grid; grid-template-columns: repeat(2, auto); justify-content: end; gap: 0 .8em; margin-top: 2px; }
.title-icon-bookings svg { color: #1a9470; }  /* as in the menu */
.title-icon-events svg { color: #2b7cc0; }
.dep-panel-tools { display: flex; gap: 4px; }
.dep-panel-body { flex: 1; min-height: 0; padding: 16px 20px 32px; overflow-y: auto; container-type: inline-size; }
@container (max-width: 860px) { .dep-panel-body .split { grid-template-columns: minmax(0, 1fr); } }
/* the title gives way (wraps onto a second line) so the section tabs stay next to it; if that is still not enough,
   the tabs that don't fit move into "More (n)", and only if even that is too wide the action buttons go to a line
   of their own (on the right) – backoffice.js tries the one-line header first (tabs-inline); on phones the tabs go
   below the title */
.bo-top { flex-wrap: wrap; }
.bo-top > .row:last-child { margin-left: auto; }
@media (min-width: 701px) {
  .bo-top.tabs-inline { flex-wrap: nowrap; }
  .bo-top.tabs-inline > .row:last-child { flex: none; }
}
.bo-title { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; }
.bo-title .page-tabs { flex: none; }
/* Keep the same title column on every section; hide it when the header still needs more room with the buttons as icons. */
.bo-title:has(.page-tabs) > div:has(> h1) { flex: none; }
@media (min-width: 701px) {
  .bo-title:has(.page-tabs) > div:has(> h1) { width: 9.3rem; }
  .bo-title:has(.page-tabs) h1 { overflow-wrap: anywhere; }
}
.bo-top.section-title-hidden .bo-title > div:has(> h1) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
/* "More (n)": the tabs that don't fit, as a menu below it */
.page-tabs-more { position: relative; display: flex; flex: none; }
.page-tabs-more[hidden] { display: none; }
.page-tabs-more .page-tabs-menu { position: absolute; top: calc(100% + 8px); right: 0; }
.page-tabs-more .page-tabs-menu.to-right { right: auto; left: 0; }
.page-tabs .page-tabs-menu a { display: flex; gap: 10px; padding: 8px 12px; border-radius: 6px; color: var(--ink); }
.page-tabs .page-tabs-menu a:hover, .page-tabs .page-tabs-menu a:focus-visible { background: var(--surface-2); outline: none; }
.page-tabs .page-tabs-menu a[aria-current="page"] { background: none; color: var(--brand); box-shadow: none; }
@media (max-width: 700px) { .bo-title { flex-wrap: wrap; } .page-tabs { margin-left: 0; } .page-tabs a, .page-tabs-more > button { padding: 6px 10px; } }
.bo-top.header-measuring .bo-title,
.bo-top.header-measuring .page-tabs,
.bo-top.header-measuring > .row:last-child,
.bo-top.header-measuring > .row:last-child .btn { flex: none; max-width: none; }
.bo-top.compact-create [data-compact-create] .create-button-label { display: none; }
.bo-top.compact-create [data-compact-create] { width: 42px; padding: 0; gap: 0; flex: none; }
.bo-top [data-compact-create] svg { flex: none; }
.bo-top .crumbs a { color: var(--muted); }
.bo-content { padding: 24px 28px 60px; }
/* A back-office page fades in (#main: not the platform admin). Opacity only: a transform would make the fixed elements inside (.pay-bar, .ctx-menu, …) follow it */
#main.bo-content { animation: bo-fade-in .5s ease-out; }
@keyframes bo-fade-in { from { opacity: 0; } }
/* Where the browser has page transitions (base.html) they do the job of this fade, and the sidebar and lower bar stay still */
@supports (view-transition-name: none) {
  #main.bo-content { animation: none; }
  .bo-side { view-transition-name: bo-side; }
  .bo-bar { view-transition-name: bo-bar; }
  /* one after the other: the page left fades out, then the new one fades in */
  ::view-transition-old(root) { animation: bo-fade-out .2s ease-in both; }
  ::view-transition-new(root) { animation: bo-fade-in .3s ease-out .2s both; }
}
@keyframes bo-fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #main.bo-content { animation: none; } }
.support-banner { background: #7a1a12; color: #fff; padding: 8px 28px; font-size: .9rem; display: flex; justify-content: space-between; gap: 12px; }
.support-banner a, .support-banner button { color: #fff; }
.menu-toggle { display: none; }
@media (max-width: 980px) {
  .bo { grid-template-columns: 1fr; }
  .bo-side { position: fixed; inset: 8px auto 8px 8px; width: 260px; height: auto; z-index: 40; transform: translateX(calc(-100% - 8px)); transition: transform .2s; }
  .bo-side.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-toggle { display: inline-flex; }
  .bo-top { padding: 12px 16px; }
  .bo-content { padding: 16px 16px 48px; }
}
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.list-reloading { opacity: .5; transition: opacity .15s .1s; }  /* the table below the filters while it comes (list-reload.js) */
.toolbar.list-loading { position: relative; }
.toolbar.list-loading::after { content: ""; position: absolute; left: 0; right: 0; bottom: -14px; z-index: 1; height: 3px; pointer-events: none;  /* along the top of the table; off the edge for the first 150 ms, a quick filter shows nothing */
  background: linear-gradient(var(--brand), var(--brand)) no-repeat; background-size: 35% 100%; background-position: -55% 0; animation: list-bar 1.1s .15s ease-in-out infinite; }
@keyframes list-bar { to { background-position: 155% 0; } }
.list-row-in { animation: list-row-in .25s calc(var(--row, 0) * 25ms) ease-out backwards; }  /* the new rows, one after another */
@keyframes list-row-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  .toolbar.list-loading::after { animation: none; background-position: 50% 0; }
  .list-row-in { animation: none; }
}
.toolbar form { display: contents; }
.toolbar input[type=search], .toolbar select { width: auto; min-width: 160px; }
.toolbar select { max-width: 190px; text-overflow: ellipsis; }  /* a long option does not widen the filter; its list stays wide */
/* A filter dropdown in use: yellow like the filter chips, an × in its own section at the left (backoffice.js) */
.filter-clearable { position: relative; display: inline-flex; max-width: 100%; }
.filter-clear { display: none; position: absolute; top: 1px; left: 1px; height: 40px; z-index: 1; width: 34px; align-items: center; justify-content: center;
  padding: 0; border: 0; border-right: 1px solid #f0d79c; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: none; color: #5e3e00; cursor: pointer; }
.filter-clear:hover { background: #fae9bf; }
.filter-clear:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.filter-clearable.is-set .filter-clear { display: inline-flex; }
.filter-clearable.is-set select, .filter-clearable.is-set .multi-filter summary { padding-left: 44px; border-color: #f0d79c; background-color: var(--warn-bg); color: #5e3e00; font-weight: 600; }
.filter-clearable.is-set .multi-filter summary .icon { color: inherit; }
.toolbar .grow { flex: 1 1 200px; }
/* Phones: the search stays, the other filters open with "Filters" (data-toolbar-toggle); chosen ones show as chips below */
.toolbar-fold-toggle { display: none; }
@media (max-width: 700px) {
  .toolbar-fold-toggle { display: inline-flex; }
  .toolbar-fold:not(.is-open) > :not(.search-field, .toolbar-fold-toggle) { display: none; }
  .toolbar-fold.is-open .toolbar-fold-toggle { color: var(--brand); border-color: var(--brand); }
}
/* Phones: each row of a list becomes a card – who and how much, what and its status, its number and people
   (classes on the cells, orders/list.html) */
@media (max-width: 700px) {
  table.data.phone-cards thead { display: none; }
  table.data.phone-cards, table.data.phone-cards tbody { display: block; }
  table.data.phone-cards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 12px 14px;
    grid-template-areas: "client price" "event status" "id people"; border-bottom: 1px solid var(--line); }
  table.data.phone-cards td { display: block; padding: 0; border: 0; min-width: 0; }
  table.data.phone-cards td.phone-hide, table.data.phone-cards td[hidden] { display: none; }
  table.data.phone-cards td[colspan] { grid-column: 1 / -1; }
  table.data.phone-cards .cell-client { grid-area: client; }
  table.data.phone-cards .cell-price { grid-area: price; }
  table.data.phone-cards .cell-event { grid-area: event; }
  table.data.phone-cards .cell-status { grid-area: status; text-align: right; }
  table.data.phone-cards .cell-id { grid-area: id; }
  table.data.phone-cards .cell-people { grid-area: people; }
  table.data.phone-cards tbody tr > td { background: none; }  /* stripes and hover on the whole card, not cell by cell */
  table.data.phone-cards tbody tr:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
}
/* A filter of several values (bo.filter_multi): looks like the selects beside it, ticks in its menu */
.multi-filter { position: relative; min-width: 160px; max-width: 190px; }
.multi-filter summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px;
  padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); cursor: pointer; list-style: none; max-width: 260px; }
.multi-filter summary::-webkit-details-marker { display: none; }
/* a booking's refund: a button that opens the form (orders/detail.html) */
.refund-fold > summary { list-style: none; }
.refund-fold > summary::-webkit-details-marker { display: none; }
.multi-filter summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-filter summary .icon { flex: none; color: var(--muted); }
.multi-filter[open] summary .icon { transform: rotate(180deg); }
.multi-filter summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.multi-filter-menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: min(320px, 80vw);
  padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16); }
.multi-filter-menu .check { display: flex; align-items: center; gap: 8px; padding: 5px 2px; margin: 0; cursor: pointer; }
.multi-filter-menu hr { margin: 4px 0; }
/* Lists: a departure's or an event's places, a bar with the numbers below it (bo.places_cell) */
.places-cell { min-width: 150px; }
.places-numbers { display: grid; line-height: 1.35; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Reports → Charts (reports/charts.py): one series per chart, so one hue (blue, 4.4:1 on the card); hairline grid */
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; }
.chart-value { fill: var(--ink); font-size: 12px; font-weight: 700; }
.chart-bar { fill: #2a78d6; }
.chart-hit { fill: transparent; }
.chart-mark { outline: none; cursor: default; }
.chart-mark:hover .chart-bar, .chart-mark:focus .chart-bar { fill: #1c5cab; }
.chart-mark:focus-visible .chart-hit { fill: rgba(42, 120, 214, .08); }
.share-bars { display: grid; gap: 8px; }
.share-row { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; align-items: center; gap: 10px; border-radius: 6px; }
.share-row:hover .share-bar, .share-row:focus .share-bar { background: #1c5cab; }
.share-row:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.share-label { overflow-wrap: anywhere; line-height: 1.25; }  /* long names (a box office with its place) wrap */
.share-track { height: 16px; }
.share-bar { display: block; height: 100%; min-width: 2px; background: #2a78d6; border-radius: 0 4px 4px 0; }
.share-value { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Platform → Security → Settings: a limit beside its time */
.form-grid.form-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .form-grid.form-pairs { grid-template-columns: minmax(0, 1fr); } }
/* Reports → Geography (reports/geography.py) */
.geo-map-grid { display: grid; grid-template-columns: minmax(0, 504px) minmax(260px, 1fr); gap: 20px; align-items: start; }  /* the map first; it shrinks once the list is down to its least */
@media (max-width: 760px) { .geo-map-grid { grid-template-columns: minmax(0, 1fr); } }
.geo-map-col { position: relative; width: 100%; max-width: 504px; min-width: 0; margin: 0 auto; }
.geo-map { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }  /* framed: the countries around end at its edge */
.geo-map-movable { cursor: grab; touch-action: none; user-select: none; }
.geo-map-movable.is-dragging, .geo-map-movable.is-dragging .geo-mark { cursor: grabbing; }
table.data tbody tr.is-marked > td { background: #dfe5e2; background: color-mix(in srgb, var(--accent) 22%, transparent); }  /* its circle on the map is pointed at */
.geo-zoom { position: absolute; top: 8px; right: 8px; z-index: 1; display: flex; flex-direction: column; gap: 4px; }
.geo-zoom[hidden] { display: none; }
.geo-zoom .btn { width: 34px; padding: 0; font-size: 1.1rem; }
.geo-level-off { display: none; }
.geo-note { margin: 8px 0 0; }
.geo-note:empty { display: none; }
.geo-land { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.geo-mark { outline: none; cursor: help; }
.geo-mark circle { fill: var(--brand); fill-opacity: .7; stroke: var(--brand); vector-effect: non-scaling-stroke; }
.geo-mark:hover circle, .geo-mark:focus circle, .geo-mark.is-marked circle { fill-opacity: .95; }
.geo-mark.is-marked circle { transform-box: fill-box; transform-origin: center; animation: geo-pulse 1.1s ease-in-out infinite; }
@keyframes geo-pulse { 50% { transform: scale(1.25); fill-opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .geo-mark.is-marked circle { animation: none; } }
.geo-mark:focus-visible circle { stroke: var(--focus); stroke-width: 2; }
.geo-count { fill: #fff; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.geo-center { fill: var(--accent); stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.geo-center-label { fill: var(--ink); font-weight: 700; paint-order: stroke; stroke: var(--surface); }
.geo-ring { fill: #3f7f6d; fill-opacity: .2; pointer-events: none; }  /* nested, so they darken towards the organisation */
.geo-beyond { fill: #8a5a14; fill-opacity: .14; pointer-events: none; }
.geo-ring-label { fill: var(--ink-2); text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: var(--surface); pointer-events: none; }
.geo-bands { display: flex; height: 28px; border-radius: 6px; overflow: hidden; }
.geo-bands span { display: flex; align-items: center; justify-content: center; min-width: 2px; color: #fff; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.geo-band-1 { background: #143f34; }
.geo-band-2 { background: #1d5c4b; }
.geo-band-3 { background: #3f7f6d; }
.geo-band-4 { background: #8a5a14; }
.geo-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 14px; padding: 0; list-style: none; font-size: .86rem; }
.geo-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; }
.geo-bar { background: var(--brand); }
/* Platform → Activities → Statistics: a count with its bar in a table cell */
.stat-col { width: 30%; }
.stat-bar { display: grid; grid-template-columns: 3.5em 1fr; align-items: center; gap: 8px; }
.stat-bar .share-value { text-align: right; }
.toolbar-line { flex: 0 0 100%; display: flex; flex-wrap: wrap; gap: 8px; }  /* always a line of its own */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.active-filters .btn-danger { margin-left: auto; }  /* "Reset filters": right, on the line of the chips */
.filter-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; max-width: min(182px, 100%); padding: 4px 10px;
  border: 1px solid #f0d79c; border-radius: 16px; background: var(--warn-bg); color: #5e3e00; font-size: .85rem;
  text-decoration: none; }
.filter-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip svg { flex: none; }
.filter-chip:hover { background: #fae9bf; color: #5e3e00; }
.filter-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Search field of the lists (_search_field.html): magnifier on the left, × on the right while there is text */
.search-field { display: flex; align-items: stretch; min-height: 42px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); overflow: hidden; }
/* A filter being used lights up in the organisation's main colour, an open dropdown with ticks as the others do */
.search-field:focus-within, .multi-filter[open] summary, .toolbar select:focus, .toolbar > input:focus, .toolbar .toolbar-date input:focus,
.toolbar .report-date-field input:not([aria-invalid="true"]):focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.search-field-go { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 42px; padding: 0; border: 0;
  border-right: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
.search-field-go:hover { background: var(--line); color: var(--ink); }
.search-field input[type=search], .toolbar .search-field input[type=search] { flex: 1; width: auto; min-width: 0; min-height: 0; border: 0;
  border-radius: 0; background: none; box-shadow: none; }
.search-field input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }  /* our × instead */
.search-field-clear { flex: none; align-self: center; display: inline-flex; align-items: center; justify-content: center; width: 30px;
  height: 30px; margin-right: 6px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.search-field-clear[hidden] { display: none; }
.search-field-clear:hover, .search-field-clear:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }
.toolbar-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.expander { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: none; border: 0; border-radius: 8px; cursor: pointer; padding: 0; color: var(--ink-2); }
.expander:hover { background: var(--neutral-bg); color: var(--ink); }
.expander svg { transition: transform .15s ease; }
.expander[aria-expanded="true"] svg { transform: rotate(90deg); }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages:empty { display: none; }
.wizard-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
/* the zigzag (templates/backoffice/events/_wizard.html): two lines, each step half a step on from the one before; the
   columns grow with the names, so steps never overlap. Too narrow for it: the row above, which wraps (backoffice.js). */
.wizard-steps[data-step-zigzag]:not(.is-wrapped) { display: grid; grid-auto-columns: auto; row-gap: 14px; column-gap: 0; position: relative; }
.wizard-steps[data-step-zigzag]:not(.is-wrapped) > a { justify-self: center; margin: 0 3px; white-space: nowrap; position: relative; z-index: 1; }
.wizard-steps[data-step-zigzag]:not(.is-wrapped) > a:nth-of-type(odd) { grid-row: 1; }
.wizard-steps[data-step-zigzag]:not(.is-wrapped) > a:nth-of-type(even) { grid-row: 2; }
.wizard-steps[data-step-zigzag] > a { grid-row: auto; }
.wizard-line { display: none; }
.wizard-steps[data-step-zigzag]:not(.is-wrapped) .wizard-line { display: block; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.wizard-line polyline { fill: none; stroke: color-mix(in srgb, var(--ok) 45%, transparent); stroke-width: 2; }
/* each step a button: a border in a darker shade of its own colour */
.wizard-steps a, .wizard-steps span { padding: 6px 11px; border: 1px solid color-mix(in srgb, currentColor 40%, transparent); border-radius: 999px; font-size: .85rem; font-weight: 650; text-decoration: none; background: var(--neutral-bg); color: var(--ink-2); }
.wizard-steps .done { background: var(--ok-bg); color: var(--ok); }
.wizard-steps [aria-current] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.code-block { font-family: var(--mono); font-size: .84rem; background: #10201b; color: #d9f2e8; padding: 12px 14px; border-radius: var(--radius-sm); overflow-x: auto; white-space: pre; }
.diff { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); word-break: break-word; }
dialog { border: 0; border-radius: var(--radius); padding: 0; box-shadow: var(--shadow-lg); max-width: min(560px, 94vw); width: 100%; }
dialog::backdrop { background: rgba(16, 24, 20, .45); }
/* in-page confirmation (static/js/confirm.js) */
dialog.confirm-dialog { max-width: min(440px, 92vw); padding: 22px 22px 16px; }
dialog.confirm-dialog p { margin: 0 0 18px; font-size: 1rem; line-height: 1.5; }
dialog.confirm-dialog .confirm-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
dialog.confirm-dialog .btn { min-height: 44px; }
/* "Resend status": the email as it will be sent, then cancel / send */
dialog.mail-preview-dialog { width: min(680px, 94vw); max-height: 90vh; padding: 22px 22px 16px; }
dialog.mail-preview-dialog h2 { margin: 0 0 14px; font-size: 1.15rem; }
/* Train set miniature (backoffice/miniature.py): wagons from above, coupled, each named below */
.wagon-minis { display: flex; align-items: flex-start; flex-wrap: wrap; row-gap: 8px; }
.wagon-mini { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.wagon-mini svg { display: block; }
.wagon-mini figcaption { max-width: max(var(--w), 110px); font-size: .74rem; line-height: 1.25; color: var(--ink-2); text-align: center; }
.wm-coupling { width: 7px; height: 8px; margin-top: 11px; border: 1px solid var(--muted); border-left: 0; border-right: 0; flex: none; }
.wm-body { fill: var(--surface-2); stroke: var(--muted); stroke-width: 1; }
.wm-seat { fill: #8a918d; }
.wm-first { fill: #e0a03a; }
.wm-acc { fill: #3a7fd5; }
.wm-area { fill: var(--line); }
.wm-door { fill: var(--surface); }
.wm-wc { fill: none; stroke: var(--muted); stroke-width: 1; }
dialog.rules-dialog .rules-list { margin: 0 0 14px; padding-left: 22px; line-height: 1.5; }
dialog.rules-dialog .rules-list li { margin-bottom: 8px; }
dialog.rules-dialog .rules-heading { font-size: 1rem; margin: 4px 0 8px; }
.checklist-dialog { width: min(520px, 94vw); }
.checklist-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.checklist-dialog .checklist-head h2 { margin: 0; }
.checklist-count { background: var(--ok-bg); color: var(--ok); font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.checklist li.is-done { color: var(--muted); }
.checklist li.is-done > span:last-child { text-decoration: line-through; }
.checklist li.is-open { padding: 10px 12px; margin: 4px 0; background: var(--surface-2); border-radius: 8px; }
.checklist li.is-open a { font-size: .9rem; font-weight: 600; white-space: nowrap; }
.checklist-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.is-done .checklist-mark { background: var(--ok); color: #fff; }
.is-open .checklist-mark { border: 2px solid var(--warn); }
.checklist-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
dialog.mail-preview-dialog .mail-preview { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px; overflow: hidden; }
dialog.mail-preview-dialog .mail-head { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0;
  padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .9rem; }
dialog.mail-preview-dialog .mail-head dt { color: var(--muted); }
dialog.mail-preview-dialog .mail-head dd { margin: 0; overflow-wrap: anywhere; }
dialog.mail-preview-dialog .mail-body { padding: 14px; max-height: 46vh; overflow: auto; font-size: .92rem; line-height: 1.55;
  overflow-wrap: anywhere; }
dialog.mail-preview-dialog .confirm-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
dialog.mail-preview-dialog .btn { min-height: 44px; }
.preview-thumb { max-width: 280px; }

/* Bottom bar: a floating pill, nearly opaque so the list below it does not disturb its text */
.bo-bar { position: sticky; bottom: 12px; z-index: 9; display: flex; align-items: center; gap: 10px; min-height: 46px; margin: 0 12px 12px; padding: 6px 8px; background: #142420; border-radius: 999px; box-shadow: 0 6px 22px rgb(16 24 20 / .16); }
/* what shows around the bar and below it (its margins, down to the bottom of the window) cannot be clicked by mistake:
   an invisible part of the bar covers it; the navigation beside it stays above and clickable */
.bo-bar::before { content: ""; position: absolute; inset: 0 -12px -12px; z-index: -1; }
.bo-bar.bo-bar-tinted { background: var(--side-bg); }  /* the colour of the navigation */
.bo-bar-user { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 650; font-size: .95rem; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-bar-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.bo-bar-who small { display: block; overflow: hidden; text-overflow: ellipsis; color: rgb(255 255 255 / .72); font-size: .78em; font-weight: 500; }
.bo-bar-user .avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: .88rem; font-weight: 700; box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .35); }  /* inside the circle: the name's link clips what lies outside */
.bo-bar-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.bo-bar-version { margin-right: 4px; color: rgb(255 255 255 / .72); font-size: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bo-bar .bar-btn { background: rgb(255 255 255 / .12); color: #fff; }
.bo-bar .bar-btn:hover, .bo-bar .bar-btn[aria-expanded="true"] { background: rgb(255 255 255 / .22); }
/* "Update available": solid and gently pulsing so it is noticed (.bar-btn below would reset the background) */
.bar-btn.bo-bar-update { background: var(--brand); color: var(--brand-ink); font-weight: 700; white-space: nowrap; animation: update-pulse 2s ease-out infinite; }
.bar-btn.bo-bar-update:hover { background: color-mix(in srgb, var(--brand) 85%, #000); color: var(--brand-ink); }
@keyframes update-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px transparent; }
}
@media (prefers-reduced-motion: reduce) { .bar-btn.bo-bar-update { animation: none; } }
.bo-bar .env-badge { flex: none; }
@media (max-width: 600px) { .bo-bar .env-badge-text { display: none; } }  /* the dot alone, beside name and tools */
.bar-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; border: 0; background: var(--neutral-bg); color: var(--ink); font: 600 .88rem/1 var(--font); padding: 0 14px; border-radius: 999px; cursor: pointer; }
.bar-btn:hover, .bar-btn[aria-expanded="true"] { background: var(--line); }
@media (max-width: 980px) { .bo-bar { bottom: 8px; margin: 0 8px 8px; } }

/* Notifications: clock button with unread badge, overlay as a panel on the right */
.nt-open { position: relative; justify-content: center; width: 34px; padding: 0; }
.bar-theme { display: flex; flex: none; }
/* A short confirmation above the lower bar, in its colour; it goes by itself */
.snackbar { position: absolute; left: 50%; bottom: calc(100% + 10px); z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 999px; background: #142420; color: #fff; font-size: .88rem; font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 22px rgb(16 24 20 / .25); transform: translateX(-50%); animation: snackbar 3.2s ease-out forwards; }
.bo-bar-tinted .snackbar { background: var(--side-bg); }
@keyframes snackbar { 0% { opacity: 0; transform: translate(-50%, 6px); } 6%, 90% { opacity: 1; transform: translateX(-50%); } 100% { opacity: 0; visibility: hidden; transform: translateX(-50%); } }
@keyframes snackbar-still { 0%, 99% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .snackbar { animation-name: snackbar-still; } }
.bar-round { justify-content: center; width: 34px; padding: 0; }
/* Unread notifications: the bell rings briefly (about 0.7 s) every 3 seconds (not with "reduce motion") */
.nt-open:has(.nt-badge:not([hidden])) > svg { transform-origin: 50% 8%; animation: bell-ring 3s ease-in-out 1.5s infinite; }
.nt-open:hover > svg, .nt-open:focus-visible > svg { animation-play-state: paused; }
@keyframes bell-ring {
  0%, 24%, 100% { transform: rotate(0); }
  2.7% { transform: rotate(16deg); }
  5.3% { transform: rotate(-14deg); }
  8% { transform: rotate(12deg); }
  10.7% { transform: rotate(-10deg); }
  13.3% { transform: rotate(7deg); }
  16% { transform: rotate(-5deg); }
  18.7% { transform: rotate(3deg); }
  21.3% { transform: rotate(-1deg); }
}
/* ... and the whole button flashes amber every 1.25 seconds, the same for every organisation, so it shows on every bar
   colour (with "reduce motion" it stays amber) */
.nt-open:has(.nt-badge:not([hidden])) { animation: bell-flash 1.25s ease-in-out infinite; }
.nt-open > svg { position: relative; }
.nt-open:hover, .nt-open:focus-visible { animation-play-state: paused; }
@keyframes bell-flash {
  0%, 100% { background: rgb(255 255 255 / .12); color: #fff; }
  50% { background: #e0a648; color: #2a1b00; }
}
@media (prefers-reduced-motion: reduce) {
  .nt-open > svg { animation: none !important; }
  .nt-open:has(.nt-badge:not([hidden])) { animation: none; background: #e0a648; color: #2a1b00; }
}
/* Feedback button: replies of the platform team; flashes amber like the bell (without its swing), its number beside
   the text */
.fb-open { position: relative; }
.fb-open:has(.nt-badge:not([hidden])) { animation: bell-flash 1.25s ease-in-out infinite; }
.fb-open:hover, .fb-open:focus-visible { animation-play-state: paused; }
/* ... and two sound waves travel out of the megaphone with each flash (the outer one shows only then) */
.fb-open .fb-wave-2 { opacity: 0; }
.fb-open:has(.nt-badge:not([hidden])) .fb-wave { animation: fb-wave 1.25s ease-out infinite; }
.fb-open:has(.nt-badge:not([hidden])) .fb-wave-2 { animation-delay: .3s; }
.fb-open:hover .fb-wave, .fb-open:focus-visible .fb-wave { animation-play-state: paused; }
@keyframes fb-wave {
  0% { opacity: 0; transform: translateX(-3px); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .fb-open:has(.nt-badge:not([hidden])) { animation: none; background: #e0a648; color: #2a1b00; }
  .fb-open .fb-wave { animation: none !important; }
}
.nt-badge { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: .68rem; font-weight: 700; line-height: 17px; text-align: center; }
.fb-open .nt-badge { position: relative; top: auto; right: auto; }
/* Phones: avatar and round buttons; name and "Feedback" stay for screen readers */
@media (max-width: 600px) {
  .bo-bar-user { font-size: 0; gap: 0; }
  .bo-bar-version { display: none; }
  .fb-open { justify-content: center; width: 34px; padding: 0; font-size: 0; }
  .fb-open .nt-badge { position: absolute; top: -4px; right: -4px; }
}
dialog.nt-dialog { margin: 0 0 0 auto; width: min(440px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 0; }
.nt-shell { display: flex; flex-direction: column; height: 100%; }
.nt-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.nt-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.15rem; }
.nt-tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); }
.nt-tabs button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 8px 10px; font: 600 .9rem/1 var(--font); color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.nt-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.nt-body { flex: 1; overflow-y: auto; }
.nt-pad { padding: 14px 18px; }
.nt-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 18px; border-bottom: 1px solid var(--line); min-height: 44px; }
.nt-list { list-style: none; margin: 0; padding: 0; }
.nt-item a { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.nt-item a:hover { background: var(--neutral-bg); }
.nt-item.is-unread a { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.nt-item.is-unread .nt-title { font-weight: 700; }
.nt-item.is-resolved .nt-title { color: var(--muted); }
.nt-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--neutral-bg); color: var(--ink-2); }
.nt-k-payment_failed .nt-icon, .nt-k-late_payment .nt-icon { background: var(--bad-bg); color: var(--bad); }
.nt-k-departure_cancelled .nt-icon { background: var(--warn-bg); color: var(--warn); }
.nt-k-new_booking .nt-icon, .nt-k-departure_sold_out .nt-icon { background: var(--ok-bg); color: var(--ok); }
.nt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nt-title { font-size: .92rem; font-weight: 550; overflow-wrap: anywhere; }
.nt-body-text { font-size: .85rem; color: var(--ink-2); overflow-wrap: anywhere; }
.nt-meta { font-size: .76rem; color: var(--muted); }
.nt-dot { flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--brand); }
.nt-prefs td, .nt-prefs th { padding: 6px 8px; }
.nt-prefs th { white-space: nowrap; }
.nt-prefs .nt-group td { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }

/* Feedback dialog */
dialog.fb-dialog { max-width: min(1080px, 96vw); max-height: min(860px, 94vh); }
.fb-shell { display: flex; flex-direction: column; max-height: min(860px, 94vh); }
.fb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.fb-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 1.25rem; }
.fb-head-icon { color: #e07a3f; display: inline-flex; }
.fb-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 0; flex: 1 1 auto; overflow: hidden; }
.fb-form { padding: 18px 22px; overflow-y: auto; }
.fb-mine { border-left: 1px solid var(--line); background: var(--surface-2); padding: 18px 16px; overflow-y: auto; }
.fb-mine-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.fb-mine-head h3 { margin: 0; font-size: 1rem; }
.fb-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px; border-top: 1px solid var(--line); }
.fb-group { border: 0; padding: 0; margin: 0 0 14px; }
.fb-group legend, .fb-label { font-weight: 600; font-size: .92rem; padding: 0; margin-bottom: 6px; display: block; }
.fb-kinds, .fb-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fb-kind input, .fb-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fb-kind span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 58px; padding: 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: .86rem; font-weight: 550; cursor: pointer; text-align: center; }
.fb-seg span { display: flex; align-items: center; justify-content: center; min-height: 40px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: .9rem; font-weight: 550; cursor: pointer; }
.fb-kind span:hover, .fb-seg span:hover { border-color: var(--ink-2); }
.fb-kind input:checked + span { background: #cf6d45; border-color: #cf6d45; color: #fff; }
.fb-kind input:checked + span .icon { color: #fff; }
.fb-seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.fb-kind input:focus-visible + span, .fb-seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.fb-k-bug .icon { color: #c2410c; }
.fb-k-wish .icon { color: #d4a017; }
.fb-k-improvement .icon { color: #6b737c; }
.fb-k-question .icon { color: #be123c; }
.fb-drop { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 550; cursor: pointer; background: var(--surface); margin: 0; }
.fb-drop:hover, .fb-drop.over { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
.fb-dialog.fb-dragging .fb-shell { outline: 3px dashed var(--brand); outline-offset: -6px; }
.fb-files { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.fb-files li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 8px; font-size: .86rem; background: var(--surface); }
.fb-files li.is-shot { background: var(--ok-bg); border-color: #b7dfc7; }
.fb-files img { width: 44px; height: 32px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.fb-files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-list { display: grid; gap: 8px; }
.fb-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fb-item summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "icon title x" "meta meta meta"; gap: 4px 8px; align-items: center; padding: 10px 12px; cursor: pointer; list-style: none; }
.fb-item summary::-webkit-details-marker { display: none; }
.fb-item-icon { grid-area: icon; display: inline-flex; }
.fb-item-title { grid-area: title; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; font-weight: 550; }
.fb-item-x { grid-area: x; border: 0; background: none; color: var(--muted); padding: 2px; border-radius: 4px; cursor: pointer; display: inline-flex; }
.fb-item-x:hover { color: var(--bad); background: var(--bad-bg); }
.fb-item-meta { grid-area: meta; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fb-item-body { padding: 0 12px 12px; border-top: 1px solid var(--line); padding-top: 10px; overflow-wrap: anywhere; }
.fb-item-body p { margin: 0 0 6px; }
.fb-item-files { list-style: none; padding: 0; margin: 0 0 6px; }
/* Platform → Activities: one session as a timeline */
.activity-timeline { list-style: none; margin: 0; padding: 6px 0; }
.activity-timeline li { display: grid; grid-template-columns: 82px 150px minmax(0, 1fr); gap: 10px; align-items: baseline;
  padding: 7px 16px; border-bottom: 1px solid var(--line); }
.activity-timeline li:last-child { border-bottom: 0; }
.activity-timeline .act-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.activity-timeline .act-kind { color: var(--muted); white-space: nowrap; font-size: .88rem; }
.activity-timeline .act-what { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.activity-timeline .act-action .act-kind, .activity-timeline .act-change .act-kind { color: var(--ink, #1f2328); font-weight: 600; }
.activity-timeline .act-login, .activity-timeline .act-logout { background: var(--surface-2); }
@media (max-width: 700px) { .activity-timeline li { grid-template-columns: 70px minmax(0, 1fr); }
  .activity-timeline .act-what { grid-column: 1 / -1; } }
/* Icon toggle filters (e.g. feedback types): on = solid, off = faded */
.icon-toggles { display: inline-flex; gap: 4px; }
.icon-toggle { padding: 6px 9px; min-height: 38px; }
.icon-toggle.is-on { border-color: var(--brand, #1d5c4b); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--brand, #1d5c4b); }
.icon-toggle.pay-toggle { padding: 4px 5px; }
/* Role of a staff member in the staff list: wide enough for its name */
.role-select { min-width: 190px; }
/* Download choice (e.g. Bookings → download): two square tiles */
.export-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 170px)); gap: 14px; justify-content: center;
  margin: 8px 0 18px; }
.export-tile { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; text-align: center; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); text-decoration: none; }
.export-tile svg { color: var(--brand, #1d5c4b); }
a.export-tile:hover, a.export-tile:focus-visible { border-color: var(--brand, #1d5c4b); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--brand, #1d5c4b); }
.export-tile.is-disabled { opacity: .45; cursor: not-allowed; }
.export-tile.is-disabled svg { color: var(--ink-2); }
/* Staff → Roles: permission matrix, one column per role */
.role-matrix th.role-col { text-align: center; vertical-align: top; min-width: 120px; text-transform: none; }
.role-matrix th.role-col.own { min-width: 170px; }
.role-matrix th.role-col input { width: 100%; font-weight: 600; }
.role-matrix th.role-col .row { justify-content: center; margin-top: 4px; }
.role-matrix td:first-child { min-width: 260px; }
.role-matrix td.text-center { vertical-align: middle; }
/* the column of the rights stays when the table scrolls sideways; the group headings scroll with the table */
.role-matrix th:first-child, .role-matrix td:first-child:not([colspan]) { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.role-matrix thead th:first-child { z-index: 4; background: var(--surface-2); }
.role-matrix tr.is-stripe > td:first-child:not([colspan]) { background: #f3f5f4; }
.role-matrix tbody tr:hover > td:first-child:not([colspan]) { background: #ebefed; }
.role-matrix .perm-yes { color: var(--brand, #1d5c4b); display: inline-flex; }
.role-matrix input[type="checkbox"] { width: 18px; height: 18px; }
/* Staff → Roles: the navigation colour of each role – a swatch next to its name that opens the 16 choices */
.role-head { display: flex; align-items: center; justify-content: center; gap: 8px; }
.role-color { position: relative; flex: none; }
.role-color > summary { list-style: none; }
.role-color > summary::-webkit-details-marker { display: none; }
.role-swatch { display: block; width: 20px; height: 20px; padding: 0; border-radius: 5px; border: 1px solid rgba(0,0,0,.2); background: var(--swatch); cursor: pointer; }
.role-swatch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.role-color-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; display: grid; grid-template-columns: repeat(4, 26px); gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); }
.role-col:last-child .role-color-pop { left: auto; right: 0; }
/* the header cells are sticky layers of equal height: the one with the open choice (or a tooltip) goes in front */
.role-matrix thead th:has(.role-color[open]), .role-matrix thead th:hover, .role-matrix thead th:focus-within { z-index: 6; }
.role-color[open] > summary::after { opacity: 0; }  /* its tooltip would cover the choice */
.role-color-pop .role-swatch { width: 26px; height: 26px; border-radius: 6px; }
.role-color-pop .role-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.icon-toggle .pay-icon { cursor: inherit; }
/* Feedback conversation: chat bubbles, own messages on the right */
.fb-thread { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 8px; }
.fb-msg { max-width: 86%; align-self: flex-start; background: var(--surface-2); border-radius: 12px 12px 12px 4px;
  padding: 8px 11px; overflow-wrap: anywhere; }
.fb-msg.team { background: var(--info-bg); }
.fb-msg.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px;
  background: color-mix(in srgb, var(--brand, #1d5c4b) 12%, var(--surface, #fff)); }
.fb-msg.note { background: var(--warn-bg); border: 1px dashed color-mix(in srgb, var(--warn) 45%, transparent); }
.fb-msg-meta { font-size: .76rem; color: var(--muted); margin-bottom: 2px; }
.fb-compose { display: grid; gap: 8px; }
.fb-compose textarea { width: 100%; resize: vertical; }
/* Feedback tags (platform team): badges, and chips that switch them on */
.fb-tags-line { display: flex; flex-wrap: wrap; gap: 4px; }
.card-body.fb-tags-line { padding-top: 0; }
.fb-tag-group { margin-bottom: 12px; }
.fb-tag-group-label { font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-bottom: 4px; display: block; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fb-chip { position: relative; cursor: pointer; }
.fb-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fb-chip input:not(:checked) + .badge { background: transparent; color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line); }
.fb-chip input:checked + .badge { box-shadow: inset 0 0 0 1px currentColor; }
.fb-chip input:focus-visible + .badge { outline: 2px solid var(--brand, #1d5c4b); outline-offset: 2px; }
.fb-tag-table .badge { white-space: nowrap; max-width: none; }
.fb-unread { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad, #c0392b);
  margin-right: 6px; vertical-align: middle; }
@media (max-width: 820px) {
  dialog.fb-dialog { max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .fb-shell { max-height: 100dvh; height: 100%; }
  .fb-body { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .fb-form, .fb-mine { overflow: visible; }
  .fb-mine { border-left: 0; border-top: 1px solid var(--line); }
  .fb-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fb-seg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Platform feedback inbox */
.fb-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.fb-thumbs a { display: block; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); text-decoration: none; color: var(--ink-2); font-size: .8rem; }
.fb-thumbs img { display: block; width: 100%; height: 110px; object-fit: cover; object-position: top; }
.fb-thumbs span { display: block; padding: 4px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { margin-left: auto; background: #e07a3f; color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 1px 7px; }

/* Settings → colours: the colour used in dark mode, beside its picker */
.color-with-dark { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.color-dark { display: inline-flex; align-items: center; gap: 6px; }
.color-dark i { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line-strong); }
/* Prices → price editor (stop to stop): every pair of stations, per fare, there and back and single (price-editor.js) */
dialog.price-editor { width: min(1500px, 96vw); max-width: 96vw; max-height: 92vh; padding: 0; border: 0; border-radius: 14px; }
dialog.price-editor[open] { display: flex; flex-direction: column; }
.price-editor-head, .price-editor-tools, .price-editor-foot { display: flex; align-items: center; gap: 12px; padding: 12px 18px; flex-wrap: wrap; }
.price-editor-head h2 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.price-editor-tools { background: var(--surface-2); border-block: 1px solid var(--line); }
.price-editor-tools .end-text { text-align: right; }
.price-editor-foot { border-top: 1px solid var(--line); }
.price-editor-scroll { overflow: auto; flex: 1 1 auto; min-height: 0; }
.price-editor-table { border-collapse: separate; border-spacing: 0; font-size: .86rem; }
.price-editor-table th { background: var(--surface); position: sticky; top: 0; z-index: 2; padding: 6px 6px; white-space: nowrap; font-weight: 700; }
.price-editor-table thead tr + tr th { top: 33px; }
.price-editor-table .pe-group { text-align: center; border-bottom: 1px solid var(--line); color: var(--brand); }
.price-editor-table .pe-group + .pe-group, .price-editor-table .pe-first { border-left: 2px solid var(--line-strong); }
.price-editor-table td { padding: 3px 4px; border-top: 1px solid var(--line); vertical-align: middle; }
.price-editor-table .pe-station { position: sticky; left: 0; z-index: 1; background: var(--surface); font-weight: 700; min-width: 130px; vertical-align: top; padding-top: 10px; }
.price-editor-table .pe-to { position: sticky; left: 130px; z-index: 1; background: var(--surface); font-weight: 600; min-width: 130px; white-space: nowrap; }
.price-editor-table thead .pe-station, .price-editor-table thead .pe-to { z-index: 3; vertical-align: bottom; }  /* the corner stays above both */
.price-editor-table tbody + tbody td { border-top: 2px solid var(--line-strong); }
.price-editor-table input { width: 82px; min-height: 32px; padding: 4px 7px; text-align: right; font-variant-numeric: tabular-nums; }
.price-editor-table input.is-missing { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, white); }
.price-editor-table .pe-vat { display: block; text-align: right; font-size: .72rem; color: var(--muted); margin-top: 1px; }
