/* =====================================================================
   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)) fixed, #fff; }
.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) */
@media (min-width: 981px) {
  .bo-side { top: 12px; height: calc(100vh - 24px); margin: 12px 0 12px 12px; box-shadow: 0 6px 22px rgb(16 24 20 / .16); }
  .bo { transition: grid-template-columns .2s; }
  .bo.nav-min { grid-template-columns: 80px minmax(0, 1fr); }
  .nav-min .bo-side { padding: 16px 10px; }
  .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: 10px; }
  .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 0 8px; }
  .nav-min .bo-side nav a { position: relative; justify-content: center; width: 40px; height: 40px; padding: 0; margin-inline: auto; }
  .nav-min .bo-side nav .nav-count { position: absolute; top: 2px; right: 4px; font-size: .62rem; padding: 0 5px; }
  .nav-min .bo-side .nav-label { font-size: 0; padding: 0; margin: 10px 6px; border-top: 1px solid rgba(255,255,255,.1); }
  .nav-min .bo-side .me { padding: 10px 0; text-align: center; }
}
@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; }
.bo-side .spacer { flex: 1; }
.bo-side .me { font-size: .82rem; color: #9fb4ad; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.bo-side .me a { color: #d7e2de; }
/* 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, .bo-side-tinted .me 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 .me, .bo-side-tinted .side-collapse:not(:hover) { color: rgba(255,255,255,.72); }
.bo-side-tinted .nav-label { color: rgba(255,255,255,.62); }
.bo-side-tinted .text-side { color: rgba(255,255,255,.88) !important; }
/* the current page: a white shape behind its name, on every sidebar colour, cut straight on the left and round on the
   right; the icon stays on the sidebar, apart from it. Every name has its 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; border-radius: 0 999px 999px 0; }
.bo-side nav a[aria-current="page"] { background: none; font-weight: 650; }
.bo-side nav a[aria-current="page"] .nav-text { background: #fff; color: var(--ink); }
/* collapsed there is no name: a white circle around 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 */
@media (min-width: 981px) {
  .nav-min .bo-side nav a[aria-current="page"] { background: #fff; }
  .nav-min .bo-side nav a[aria-current="page"] svg { color: var(--brand); }
  .nav-min .bo-side nav a.nav-events[aria-current="page"] svg { color: #2b7cc0; }
  .nav-min .bo-side nav a.nav-bookings[aria-current="page"] svg { color: #1a9470; }
  .nav-min .bo-side nav a.nav-wagons[aria-current="page"] svg { color: #b07a0f; }
  .nav-min .bo-side nav a.nav-routes[aria-current="page"] svg { color: #d4623c; }
}
.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: #a5d0f540; }
.bo:has(a.nav-bookings[aria-current="page"]) { --page-to: #7fe3c440; }
.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; }
/* A list's rows are see-through, so the section's colour of the page shows: its card only keeps its frame, and what
   is around the rows stays solid. Stripes and hover paint over the row (:where keeps them as specific as in base.css) */
.bo .card:has(> .table-wrap > table.data) { background: transparent; }
.bo .card:has(> .table-wrap > table.data) > :not(.table-wrap, .card-foot) { background: var(--surface); }  /* heading, entries and pages, … */
.bo .card:has(> .table-wrap > table.data) > :not(.table-wrap):first-child { border-radius: var(--radius) var(--radius) 0 0; }
.bo .card:has(> .table-wrap > table.data) > :not(.table-wrap):last-child { border-radius: 0 0 var(--radius) var(--radius); }
.bo .card > .table-wrap > table.data tbody tr { background: rgb(255 255 255 / .7); }
.bo .card > .table-wrap > table.data tfoot td { background: var(--surface); }
:where(.bo) table.data tr.is-stripe > td { background: rgb(16 24 20 / .04); }
.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, 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"] { 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; }
.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; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
}
@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 */
.toolbar .grow { flex: 1 1 200px; }
/* 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; }
.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: flex; justify-content: space-between; gap: 12px; margin-top: 4px; 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; }
.wizard-steps a, .wizard-steps span { padding: 7px 12px; 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); 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); }
.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 a circle in the brand colour pulses behind it, so the bell is seen at a glance (with "reduce motion" it
   stays as a steady tint) */
.nt-open:has(.nt-badge:not([hidden]))::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--brand); opacity: .18; pointer-events: none; animation: bell-pulse 2s ease-in-out infinite; }
.nt-open > svg { position: relative; }
.nt-open:hover::before, .nt-open:focus-visible::before { animation-play-state: paused; }
@keyframes bell-pulse {
  0%, 100% { opacity: .14; transform: scale(.82); }
  50% { opacity: .38; transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { .nt-open > svg, .nt-open::before { animation: none !important; } }
/* Feedback button: replies of the platform team; pulses like the bell, its number beside the text */
.fb-open { position: relative; }
.fb-open:has(.nt-badge:not([hidden]))::before { content: ""; position: absolute; inset: 0; border-radius: 999px;
  background: var(--brand); opacity: .18; pointer-events: none; animation: fb-pulse 2s ease-in-out infinite; }
.fb-open > * { position: relative; }
.fb-open:hover::before, .fb-open:focus-visible::before { animation-play-state: paused; }
@keyframes fb-pulse {
  0%, 100% { opacity: .1; }
  50% { opacity: .32; }
}
@media (prefers-reduced-motion: reduce) { .fb-open::before { 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); }
