/* Ticketsystem – shared design system for booking flow and back office.
   Operators override --brand / --accent / --font via their theme (EM-02). */

:root {
  --brand: #1d5c4b;
  --brand-ink: #ffffff;
  --accent: #b7791f;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-2: #f8f9f8;
  --ink: #1c2126;
  --ink-2: #4a525b;
  --muted: #6b737c;
  --line: #e1e4e3;
  --line-strong: #c9cecc;
  --focus: #2563eb;

  --ok: #1f7a4d;   --ok-bg: #e6f4ec;
  --warn: #8a5a00; --warn-bg: #fdf3dc;
  --bad: #b42318;  --bad-bg: #fdecea;
  --info: #1d4ed8; --info-bg: #e8effd;
  --neutral-bg: #eef0ef;

  --seat-free: #ffffff;
  --seat-free-line: #9aa59f;
  --seat-mine: var(--brand);
  --seat-held: #f2c94c;
  --seat-occupied: #c3c8c6;
  --seat-blocked: #6b737c;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 2px 8px rgba(16, 24, 20, .05);
  --shadow-lg: 0 10px 30px rgba(16, 24, 20, .14);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font); font-feature-settings: "tnum" 1;
}
img, svg { max-width: 100%; }
/* Staging and other non-live installations (settings.ENVIRONMENT): a calm pill with a dot and "Testsystem" in the back office's bottom
   panel, on other pages in the bottom right corner; the full text is the tooltip */
.env-badge { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px; border-radius: 999px;
  font-size: .8rem; font-weight: 500; line-height: 1.4; color: #633806; background: #faeeda; border: 1px solid #ef9f27;
  white-space: nowrap; cursor: help; }
.env-badge-dot { width: 7px; height: 7px; border-radius: 50%; background: #ba7517; flex: none;
  animation: env-pulse 2s ease-in-out infinite; }
@keyframes env-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .env-badge-dot { animation: none; } }
.env-badge-corner { position: fixed; right: 12px; bottom: 12px; z-index: 2000; box-shadow: var(--shadow); }
@media (max-width: 600px) {  /* phones: the dot alone, bottom left – the buttons ("Choose", "Next") are on the right */
  .env-badge-corner { right: auto; left: 12px; padding: 7px; }
  .env-badge-corner .env-badge-text { display: none; }
}
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
small, .small { font-size: .86rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.icon { vertical-align: -3px; flex: none; }

/* ---------- Layout helpers ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 auto; }
/* an amount with its unit beside it, e.g. the cancellation fee: [ 100 ] [ % of the amount ▾ ] */
.fee-input { display: flex; gap: 6px; align-items: center; }
.fee-input > span { flex: 1 1 64px; min-width: 0; }
.fee-input > span[hidden] { display: none; }
.fee-input select { flex: 0 1 auto; width: auto; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }
/* The next action stays in reach: where the summary moves below the form, the button (and the total) sit in a bar
   at the bottom of the screen. On wide screens the summary column sticks instead and the bar is just the button. */
.pay-bar-total { display: none; }
@media (max-width: 900px) {
  body:has(.pay-bar) { padding-bottom: 88px; }
  .pay-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
    margin: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface);
    border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(16, 24, 20, .12); }
  .pay-bar .btn { flex: 1; width: auto; }
  .pay-bar-total { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; font-size: 1.05rem; }
  .pay-bar-total small { color: var(--muted); font-size: .75rem; }
  .pay-bar-note { display: none; }
  body:has(.pay-bar) .env-badge-corner { bottom: 90px; }  /* the test badge above the bar */
  /* one column: the summary no longer sticks – a sticky column is a layer of its own that would keep the bar
     (fixed) below other layers such as the back office's bottom bar */
  .sticky:has(.pay-bar) { position: static; }
  /* box office: the bar sits on the back office's bottom bar (name, notifications, feedback) instead of over it */
  .bo .pay-bar { bottom: var(--bo-bar-h, 45px); }
  .bo:has(.pay-bar) .bo-content { padding-bottom: 110px; }
}

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 20px; }
.card-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.sticky { position: sticky; top: 16px; }
/* Settings → Ticket: settings on the left, live preview on the right (below each other on small screens) */
.ticket-designer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .ticket-designer { grid-template-columns: minmax(0, 1fr); } }
.ticket-preview .card-head select { width: auto; }
.ticket-preview-frame { position: relative; background: var(--surface-2); border-radius: 8px; padding: 10px; min-height: 160px; transition: opacity .15s; }
/* the block hovered in the list, outlined on the preview */
.preview-mark { position: absolute; border: 2px solid var(--accent, #b7791f); background: rgba(183, 121, 31, .14);
  border-radius: 4px; pointer-events: none; box-shadow: 0 0 0 3px rgba(183, 121, 31, .18); transition: all .12s ease-out; }
.ticket-blocks tbody tr:hover > td { background: var(--surface-2); }
.ticket-preview-frame.is-loading { opacity: .55; }
.ticket-preview-frame img { display: block; max-width: 100%; max-height: 72vh; margin: 0 auto; background: #fff;
  box-shadow: 0 1px 4px rgba(16, 24, 20, .18); }
.ticket-blocks td, .ticket-blocks th { vertical-align: middle; }
.ticket-blocks select { min-width: 120px; }
/* Column headings can be dragged to another place (backoffice.js) */
th.col-draggable { cursor: grab; }
th.col-dragging { opacity: .4; }
th.col-drop-before { box-shadow: inset 3px 0 0 var(--brand, #1d5c4b); }
th.col-drop-after { box-shadow: inset -3px 0 0 var(--brand, #1d5c4b); }
/* Right-click menu of the lists (columns.js) */
.ctx-menu { position: fixed; z-index: 1000; min-width: 190px; padding: 4px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0, 0, 0, .16); }
.ctx-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 0; border-radius: 6px; background: none;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: var(--surface-2); outline: none; }
.ctx-menu button svg { flex: none; color: var(--ink-2); }
/* Train types: the icon picker (backoffice-routes.js) */
.icon-choice { display: flex; align-items: center; gap: 10px; }
.icon-choice .icon-upload { white-space: nowrap; }
.icon-picker-btn { display: inline-flex; align-items: center; gap: 12px; min-width: 110px; min-height: 42px; padding: 6px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-picker-btn::after { content: ""; margin-left: auto; border: 5px solid transparent; border-top-color: var(--ink-2); border-bottom: 0; }
.icon-picker-btn:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.icon-picker-value { display: inline-flex; align-items: center; min-height: 28px; }
.icon-picker-value img, .icon-picker-menu img { height: 23px; width: auto; }
.icon-picker-menu { position: fixed; z-index: 1000; display: flex; gap: 4px; padding: 6px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0, 0, 0, .16); }
.icon-picker-menu[hidden] { display: none; }
.icon-picker-menu button { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; min-height: 48px; padding: 6px 8px;
  border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; }
.icon-picker-menu button:hover, .icon-picker-menu button:focus-visible { background: var(--surface-2); outline: none; }
.icon-picker-menu button[aria-selected="true"] { border-color: var(--brand); }
.icon-upload { position: relative; }
.icon-upload input[type=file] { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.icon-upload:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
/* Configure columns: the columns as a list */
.col-config-list { list-style: none; margin: 12px 0 16px; padding: 0; display: grid; gap: 6px; }
.col-config-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); cursor: grab; }
.col-config-item label { flex: 1; cursor: pointer; }
.col-config-item input[type="checkbox"] { width: 18px; height: 18px; }
.col-config-item.is-hidden label { color: var(--ink-2); text-decoration: line-through; }
.col-config-item.col-dragging { opacity: .4; }
.col-config-item .drag-handle { color: var(--ink-2); }
tr[data-row-href] { cursor: pointer; }
/* hovered rows: the organisation's accent colour at 10 % (grey where color-mix is unknown) */
tr[data-row-href]:hover > td { background: #ebefed; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.bo .sticky { top: calc(var(--bo-top-h, 0px) + 16px); }  /* below the back office's sticky page header */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 600 .95rem/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.btn-saved, .btn.btn-saved:hover { background: var(--ok); border-color: var(--ok); color: #fff; transition: background .2s, border-color .2s; }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--brand); }
.btn-danger { color: var(--bad); border-color: #e6b4ae; }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--neutral-bg); border-color: transparent; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: .86rem; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--brand-ink) transparent var(--brand-ink) transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Forms ---------- */
label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .help { color: var(--muted); font-size: .84rem; margin-top: 4px; font-weight: 400; }
.field .errorlist, .errorlist { color: var(--bad); font-size: .86rem; margin: 4px 0 0; padding: 0; list-style: none; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel],
input[type=url], input[type=date], input[type=datetime-local], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input[type=color] { width: 56px; height: 42px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--brand); vertical-align: -3px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 2px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
/* Fields beside each other share their rows (label / input / help), so the inputs line up even when one label
   wraps onto two lines; the label sits directly above its input. */
/* One text in two languages: DE/EN switch above the field (backoffice/_i18n_field.html) */
.i18n-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.i18n-head label { margin-bottom: 4px; }
.i18n-switch { display: inline-flex; gap: 2px; padding: 2px; margin-bottom: 4px; background: var(--neutral-bg);
  border: 1px solid var(--line); border-radius: 8px; flex: 0 0 auto; }
.i18n-switch button { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 0; border-radius: 6px;
  background: none; font: inherit; font-size: .75rem; font-weight: 600; color: var(--muted); cursor: pointer; position: relative; }
.i18n-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
table[data-i18n-field] th:has(.i18n-switch) { min-width: 220px; text-transform: none; }
.i18n-switch .flag { border-radius: 2px; box-shadow: 0 0 0 1px rgb(0 0 0 / .12); }
.i18n-switch button[data-filled]::after { content: ""; position: absolute; top: 2px; right: 2px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--ok); }
.surcharge-row { margin-bottom: 6px; }
.surcharge-label { min-width: 120px; font-weight: 500; }
/* a field that does not apply right now (e.g. capacity while the wagons give a seat map) */
input.is-locked, input:disabled { background: var(--neutral-bg); color: var(--muted); cursor: not-allowed; }
/* German date fields with a calendar (static/js/datetime.js) */
.dt-input { position: relative; display: flex; align-items: center; gap: 4px; }
.dt-input input { flex: 1 1 auto; min-width: 0; }
.report-date-field { width: 150px; max-width: 100%; }
.report-date-control { display: flex; align-items: flex-start; gap: 8px; max-width: 100%; }
.toolbar[data-report-dates] { align-items: flex-start; }
.toolbar[data-report-dates] > label, .report-date-control > label { padding-top: 10px; }
.report-date-field input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-bg); }
.report-date-field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgb(180 35 24 / .18); }
.dt-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 292px; padding: 12px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgb(0 0 0 / .14);
  max-width: calc(100vw - 24px); }
.dt-pop-right { left: auto; right: 0; }
.dt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dt-title { text-transform: capitalize; }
.dt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dt-wd { font-size: .75rem; color: var(--muted); padding: 2px 0 4px; }
.dt-day { border: 0; background: none; border-radius: 6px; padding: 6px 0; font: inherit; cursor: pointer; color: var(--ink); }
.dt-day:hover, .dt-day:focus-visible { background: var(--neutral-bg); }
.dt-day.today { box-shadow: inset 0 0 0 1px var(--line-strong); }
.dt-day.selected { background: var(--brand); color: #fff; font-weight: 700; }
.dt-time { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dt-time select { width: auto; }
.dt-time .small { margin-right: auto; }
.dt-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.dt-foot .btn:first-child { margin-right: auto; }
.form-aligned > .field { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0;
  grid-template-columns: minmax(0, 1fr); min-width: 0; }  /* stays in its column, e.g. the logo with a long file name */
.form-aligned > .field > label { align-self: end; }
.form-aligned > .field > .check { align-self: center; }
/* A switch beside a field's label (backoffice/_form.html, form.label_switches): off greys out and locks the field */
.label-switch { display: flex; align-items: center; gap: 10px; align-self: end; margin-bottom: 6px; }
.label-switch > label:first-child { margin: 0; }
.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch input[type=checkbox] { appearance: none; width: 36px; height: 20px; margin: 0; border-radius: 999px;
  background: var(--line-strong); cursor: pointer; transition: background .15s; vertical-align: 0; }
.switch input[type=checkbox]:checked { background: var(--brand); }
.switch input[type=checkbox]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / .25); pointer-events: none; transition: transform .15s; }
.switch input:checked + .switch-knob { transform: translateX(16px); }
.field-control.is-off { opacity: .5; }
/* An on/off setting drawn as a switch (CheckboxInput(attrs={"role": "switch"})): the knob is part of the background */
input[type=checkbox][role=switch] { appearance: none; flex: none; width: 36px; height: 20px; margin: 0; border-radius: 999px;
  background: radial-gradient(circle at 10px 50%, #fff 7px, transparent 8px) var(--line-strong); cursor: pointer;
  transition: background-position .15s, background-color .15s; vertical-align: -5px; }
input[type=checkbox][role=switch]:checked { background-color: var(--brand); background-position: 16px 0; }
input[type=checkbox][role=switch]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Settings → Payment methods: the switches online and at the box office, side by side */
.method-switches { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 16px; }
.method-switches fieldset { display: grid; align-content: start; gap: 12px; padding-bottom: 14px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px 4px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; }
.choice { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; cursor: pointer; font-weight: 500; background: var(--surface); }
.choice select { min-width: 0; max-width: 60%; }
.route-table select[name="coach_layout"] { min-width: 220px; }
.choice:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: color-mix(in srgb, var(--brand) 5%, white); }
.choice-disabled { cursor: not-allowed; color: var(--muted); background: var(--surface-2); }
.field-attached { margin-top: 12px; }
.drag-handle { cursor: grab; font-size: 1.1rem; color: var(--muted); }
[data-sort-row].row-inactive input[type=text] { color: var(--muted); background: var(--surface-2); }
[data-sort-row].dragging { opacity: .45; background: var(--neutral-bg); }
.route-table input[type=number] { max-width: 120px; }
/* Strecke → Preise: show the columns of the chosen price model */
.fare-table input[inputmode=decimal] { min-width: 84px; text-align: right; }
.fare-table[data-model=""] .col-amount, .fare-table[data-model=""] .col-section,
.fare-table[data-model="flat"] .col-section, .fare-table[data-model="per_section"] .col-section,
.fare-table[data-model="sections"] .col-amount { display: none; }
/* Reduction on the return trip: one column per kind, only the chosen kind is shown (and only with route prices) */
.fare-table[data-model=""] .col-ret-percent, .fare-table[data-model=""] .col-ret-amount,
.fare-table[data-return=""] .col-ret-percent, .fare-table[data-return=""] .col-ret-amount,
.fare-table[data-return="percent"] .col-ret-amount, .fare-table[data-return="amount"] .col-ret-percent { display: none; }
.fare-table .label-per { display: none; }
.fare-table[data-model="per_section"] .label-per { display: inline; }
.fare-table[data-model="per_section"] .label-flat { display: none; }
.file-current { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 6px 6px 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.file-thumb { height: 40px; max-width: 120px; object-fit: contain; border-radius: 4px; background: #fff; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.file-delete { color: var(--bad); }
.file-delete:hover { background: var(--bad-bg); }
.input-group { display: flex; gap: 8px; }
.input-group > input { flex: 1; }

/* Quantity stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: var(--surface); }
.stepper button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.25rem; cursor: pointer; color: var(--brand); }
.stepper button:hover { background: var(--neutral-bg); }
.stepper button:disabled { color: var(--line-strong); cursor: default; background: transparent; }
.stepper input { width: 46px; min-height: 40px; border: 0; text-align: center; font-weight: 700; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper input:focus { box-shadow: none; }

/* ---------- Alerts, badges ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.alert-row { align-items: center; }
.alert-row form { margin: 0; }
.alert-ok { background: var(--ok-bg); border-color: #b7dfc7; color: #144d31; }
.alert-warn { background: var(--warn-bg); border-color: #f0d79c; color: #5e3e00; }
.alert-bad { background: var(--bad-bg); border-color: #f2b8b2; color: #7a1a12; }
.alert-info { background: var(--info-bg); border-color: #c3d4f8; color: #183a8c; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--neutral-bg); color: var(--ink-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; background: var(--surface-2); vertical-align: bottom; position: sticky; top: 0; }
table.data thead th { z-index: 2; }  /* moved down over the rows while the page scrolls (backoffice.js) */
.bo .table-wrap.table-fits { overflow-x: visible; }  /* fits its width: the header sticks to the page, smoothly */
.bo .table-wrap.table-fits > table.data thead th { top: var(--bo-top-h, 0px); }
table.data.head-stuck thead th { box-shadow: 0 2px 4px rgba(16, 24, 20, .08); }
table.data th a { color: inherit; text-decoration: none; }
table.data th a:hover { color: var(--ink); }
/* sortable headings keep room for the arrow, so sorting does not move the table */
table.data th.sortable { padding-right: 22px; }
table.data th .sort-mark { position: absolute; right: 6px; bottom: 11px; line-height: 0; color: var(--ink); }
/* every second record slightly darker (backoffice.js sets is-stripe; expanded sub-rows share their parent's shade);
   the hover stays stronger than the stripe */
table.data tr.is-stripe > td { background: #f3f5f4; }
table.data tbody tr:hover > td { background: #ebefed; background: color-mix(in srgb, var(--accent) 10%, transparent); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.is-past > td { opacity: .6; }  /* already departed: greyed out, still clickable */
table.data tr.sub td { font-size: .88rem; }
table.data tr.sub td:first-child { padding-left: 28px; }
table.data tfoot td { font-weight: 700; border-top: 2px solid var(--line-strong); }
table.kv { border-collapse: collapse; width: 100%; }
table.kv th, table.kv td { padding: 6px 0; vertical-align: top; text-align: left; }
table.kv th { color: var(--muted); font-weight: 500; width: 40%; padding-right: 12px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

/* ---------- Progress / meter ---------- */
.meter { height: 8px; background: var(--neutral-bg); border-radius: 999px; overflow: hidden; min-width: 80px; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.meter.warn > span { background: var(--accent); }
.meter.full > span { background: var(--bad); }

/* ---------- KPI tiles ---------- */
.kpi { padding: 16px 18px; }
/* Overview: widgets in a 4-column grid, in reading order, gaps filled (backoffice/dashboard_widgets.py) */
.dash-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row dense; grid-auto-rows: minmax(96px, auto); gap: 18px; }
.dash-w { position: relative; min-width: 0; display: flex; flex-direction: column; }
.dash-w > .card { flex: 1; margin: 0; min-width: 0; }
.dash-w-1 { grid-column: span 1; } .dash-w-2 { grid-column: span 2; } .dash-w-3 { grid-column: span 3; } .dash-w-4 { grid-column: span 4; }
.dash-h-2 { grid-row: span 2; } .dash-h-3 { grid-row: span 3; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-w-3, .dash-w-4 { grid-column: span 2; } }
@media (max-width: 640px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } .dash-w { grid-column: span 1; grid-row: auto; } }
.dash-w .summary-line { flex-wrap: wrap; column-gap: 12px; }  /* a narrow widget: the amount and badge go below */
.dash-w .summary-line > span { min-width: 0; overflow-wrap: anywhere; }
/* tooltips at a widget's right edge open leftwards, so they do not widen the page */
.dash-w .card-head .tip::after, .dash-bars span:nth-last-child(-n+8)::after { left: auto; right: 0; transform: none; }
.dash-bars span:nth-child(-n+8)::after { left: 0; transform: none; }
.dash-bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; }
.dash-bars span { flex: 1; min-height: 2px; background: color-mix(in srgb, var(--brand) 70%, white); border-radius: 2px 2px 0 0; }
/* edit mode: the widgets are shown but not used; a bar with handle and size buttons on top */
.dash-grid.is-editing .dash-w { outline: 1.5px dashed var(--line-strong); outline-offset: 3px; border-radius: var(--radius); }
.dash-grid.is-editing .dash-w > :not(.dash-tools) { pointer-events: none; user-select: none; }
.dash-tools { display: flex; align-items: center; gap: 6px; padding: 4px 6px; margin-bottom: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-size: .82rem; cursor: grab; }
.dash-handle { color: var(--muted); }
.dash-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-buttons { display: flex; gap: 2px; flex: none; }
.dash-buttons button { border: 0; background: none; padding: 2px 6px; border-radius: 5px; cursor: pointer; color: var(--ink-2); font: inherit; line-height: 1.2; display: inline-flex; align-items: center; }
.dash-buttons button:hover { background: var(--line); }
.dash-buttons button:focus-visible { outline: 2px solid var(--focus); }
.dash-w.is-dragging { opacity: .4; }
.dash-add { grid-column: span 1; min-height: 96px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.dash-add:hover { color: var(--brand); border-color: var(--brand); }
.kpi .label { color: var(--muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 1.6rem; font-weight: 750; margin-top: 4px; letter-spacing: -.02em; }
.kpi .sub { color: var(--muted); font-size: .85rem; }
a.kpi-link { display: block; color: inherit; text-decoration: none; transition: border-color .12s, box-shadow .12s; }
a.kpi-link:hover { border-color: var(--brand); box-shadow: var(--shadow-lg); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"], .tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.voucher-events.is-off { opacity: .5; }
/* segmented control: one of a few options, e.g. the kind of voucher */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.segmented button { border: 1px solid transparent; background: none; border-radius: 8px; padding: 7px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-checked="true"] { background: var(--surface); border-color: var(--line-strong); color: var(--brand); }
.segmented button:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
/* the same as links that switch between views of a page (audit log: System | Bookings) */
.segmented a { border: 1px solid transparent; border-radius: 8px; padding: 7px 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.segmented a:hover { color: var(--ink); }
.segmented a[aria-current="page"] { background: var(--surface); border-color: var(--line-strong); color: var(--brand); }
.segmented a:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.tabs button { padding: 10px 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--ink-2); font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }

/* =====================================================================
   Public booking flow
   ===================================================================== */
.flow-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.flow-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.flow-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.05rem; }
.flow-brand img { max-height: 40px; width: auto; }
.lang-switch { display: flex; gap: 2px; font-size: .85rem; }
.lang-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 8px; border-radius: 6px; text-decoration: none; color: var(--muted); font-weight: 600; }
.lang-switch a:hover { background: var(--neutral-bg); color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--neutral-bg); color: var(--ink); }
.flow-main { padding: 22px 0 40px; }
.embedded .flow-main { padding: 12px 0 16px; }
.flow-footer { padding: 24px 0 40px; color: var(--muted); font-size: .85rem; }
.flow-footer .container { display: flex; flex-wrap: wrap; gap: 0 6px; }
.flow-footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; margin-left: -8px; margin-right: 8px; color: var(--muted); }

.steps { display: flex; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; counter-reset: step; overflow-x: auto; }
.steps li { flex: 1 1 0; min-width: 0; font-size: .8rem; color: var(--muted); font-weight: 600; padding-top: 8px; border-top: 3px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps li.done { border-top-color: color-mix(in srgb, var(--brand) 45%, white); color: var(--ink-2); }
.steps li.current { border-top-color: var(--brand); color: var(--brand); }
.steps li form { display: contents; }
.steps .step-link { display: block; width: 100%; margin: -8px 0 0; padding: 8px 0 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; text-decoration: none; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps li.done:has(.step-link):hover { border-top-color: var(--brand); }
.steps .step-link:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) {
  /* phones: other steps show only their number (name kept for screen readers), links stay big enough to tap */
  .steps li:not(.current) { flex: 0 0 44px; text-align: center; }
  .steps li:not(.current) .step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .steps li.current { flex: 1 1 auto; }
  .steps .step-link { min-height: 44px; text-align: center; }
}

.event-hero h1 { font-size: 1.9rem; }
/* "From … to …" journey choice on the booking start page */
.journey { margin: 18px 0 10px; }
.journey-title { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; margin: 0; }
.journey-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: center; }
.journey-arrow { color: var(--muted); }
.station-list { margin: 0; padding: 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); max-height: 320px; overflow-y: auto; }
.station-list legend { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 6px; }
.station { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; font-weight: 500; cursor: pointer; margin: 0; }
.station:hover { background: var(--neutral-bg); }
.station-emblem { width: 22px; height: 26px; object-fit: contain; flex: none; }
.station.is-disabled .station-emblem { opacity: .35; }
/* names line up when only some stations have a coat of arms */
.station-list:has(.station-emblem) .station:not(:has(.station-emblem)) > span { margin-left: 32px; }
.station.is-disabled { color: var(--line-strong); cursor: not-allowed; }
.station.is-disabled:hover { background: none; }
.station:has(input:checked) { background: color-mix(in srgb, var(--brand) 10%, white); color: var(--ink); font-weight: 650; }
.journey-summary { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--ink-2); }
@media (max-width: 560px) { .journey-grid { grid-template-columns: 1fr; } .journey-arrow { transform: rotate(90deg); justify-self: center; } }

/* Multi-date picker (add several departures) */
.multi-date { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; }
.md-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.md-title { font-weight: 700; text-transform: capitalize; }
.md-nav { padding: 4px 8px; }
.md-weekdays, .md-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.md-weekdays span { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 2px 0; }
.md-day { aspect-ratio: 1; min-height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; font-size: .85rem; cursor: pointer; padding: 0; }
.md-day:hover:not(:disabled) { border-color: var(--brand); }
.md-day.is-today { font-weight: 800; box-shadow: inset 0 0 0 1px var(--ink-2); }
.md-day[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.md-day.is-added { background: var(--ok-bg); border-color: #b7dfc7; color: var(--ok); cursor: default; }
.md-day:disabled { color: #b9bfc4; background: none; cursor: not-allowed; }
.md-add { width: 100%; margin-top: 8px; justify-content: center; }
.md-add:disabled { opacity: .5; cursor: not-allowed; }
.md-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.md-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 4px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: .9rem; }
.md-empty { color: var(--muted); font-size: .85rem; padding: 2px 0; }
.md-remove { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.md-remove:hover { background: var(--bad-bg, #fbeaea); color: var(--bad, #b42318); }

/* Multi-time picker: list of times and the 24-hour clock dialog */
.tp-list { margin: 0 0 8px; }
.tp-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.clock-dialog { border: 0; border-radius: 14px; padding: 20px; width: min(320px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); background: var(--surface); color: var(--ink); }
.clock-dialog::backdrop { background: rgba(20, 36, 32, .45); }
.clock-title { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.clock-display, .clock-inputs { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 16px; }
.clock-display[hidden], .clock-inputs[hidden] { display: none; }
.clock-part { width: 96px; height: 72px; border: 0; border-radius: 10px; background: var(--neutral-bg); color: var(--ink); font: inherit; font-size: 2.6rem; font-variant-numeric: tabular-nums; cursor: pointer; }
.clock-part.is-active { background: color-mix(in srgb, var(--brand) 14%, #fff); color: var(--brand); }
.clock-colon { font-size: 2.2rem; font-weight: 700; color: var(--ink-2); }
.clock-inputs input { width: 96px; height: 72px; text-align: center; font-size: 2.2rem; font-variant-numeric: tabular-nums; }
.clock-face { display: block; width: 100%; max-width: 256px; margin: 0 auto 8px; touch-action: none; user-select: none; cursor: pointer; border-radius: 50%; }
.clock-face:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.clock-bg { fill: var(--neutral-bg); }
.clock-hand { stroke: var(--brand); stroke-width: 2; }
.clock-pin, .clock-knob { fill: var(--brand); }
.clock-dot { fill: #fff; }
.clock-num { font-size: 15px; fill: var(--ink); pointer-events: none; }
.clock-num.inner { font-size: 12px; fill: var(--muted); }
.clock-num.on { fill: #fff; font-weight: 700; }
.clock-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.clock-foot .grow { flex: 1; }

/* Payment method icons (tooltip = method · provider) */
.pay-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 28px; border-radius: 6px; background: var(--neutral-bg); color: var(--ink-2); cursor: help; vertical-align: middle; }
.pay-icon.pay-mark { background: none; }
.pay-icon.pay-mark svg { display: block; }
.pay-card { background: #efedfb; color: #5b4ccf; }
.pay-bank_transfer { background: #e6f2ee; color: #1d5c4b; }
.pay-invoice { background: #fdf3dc; color: #8a5a00; }
.pay-cash { background: #e6f4ec; color: #1f7a4d; }
.pay-pos_card { background: #eef0ef; color: #4a525b; }
.pay-voucher { background: #fcebf1; color: #b0306a; }

/* Calendar: capacity dot (share of places still free) */
.cap-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: 1px; margin-right: 2px; cursor: help; box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 0 0 3px rgba(0,0,0,.08); }
.cap-green { background: #22a45d; }
.cap-yellow { background: #f2c94c; }
.cap-orange { background: #f2994a; }
.cap-red { background: #d63a2f; }

/* Steam / diesel train icon with its name as tooltip on hover, focus or tap */
.traction { position: relative; display: inline-flex; align-items: center; vertical-align: middle; color: var(--ink-2); cursor: help; border-radius: 4px; }
.traction-steam { color: #3d3a36; }
.traction-diesel { color: #a1430f; }
.tip { position: relative; }
.btn-icon { padding: 0 7px; color: var(--ink-2); }
.btn-icon:hover { color: var(--brand); }
.traction::after, .tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .78rem; font-weight: 600; line-height: 1.2; padding: 4px 8px; border-radius: 5px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 20; }
.traction:hover::after, .traction:focus-visible::after, .traction:focus::after,
.tip:hover::after, .tip:focus-visible::after { opacity: 1; }
.tip::after { text-transform: none; letter-spacing: normal; }
.tip-below::after { bottom: auto; top: calc(100% + 6px); }
.tip-start::after { left: 0; transform: none; }  /* opens to the right, e.g. next to a heading */
.icon-link { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-left: 4px; border-radius: 6px; color: var(--muted); vertical-align: middle; }
.icon-link:hover, .icon-link:focus-visible { background: var(--neutral-bg); color: var(--brand); }
.tip-wrap::after { white-space: normal; width: max-content; max-width: min(360px, 90vw); text-align: left; }
.tip-wrap:focus-within::after { opacity: 1; }
.event-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-2); margin-bottom: 10px; }
.event-meta span { display: inline-flex; align-items: center; gap: 6px; }

.dep-list { list-style: none; margin: 0; padding: 0; }
.dep-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dep-item:last-child { border-bottom: 0; }
.dep-closed > :not(.dep-action) { opacity: .5; }
.dep-date { text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 0; background: var(--surface-2); }
.dep-date .dd { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.dep-date .mm { font-size: .72rem; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: .05em; }
.dep-date .wd { font-size: .72rem; color: var(--muted); }
@media (max-width: 560px) { .dep-item { grid-template-columns: 58px 1fr; } .dep-item .dep-action { grid-column: 1 / -1; } .dep-item .dep-action .btn { width: 100%; } }
/* Chained trips: the customer's own trips stand out between the trips they can add */
.dep-item.chain-trip { background: var(--ok-bg); box-shadow: inset 4px 0 0 var(--ok); }
.dep-item.chain-trip .dep-date { background: var(--surface); border-color: #b7dfc7; }
@media (max-width: 560px) { .dep-item.chain-trip { grid-template-columns: 58px 1fr auto; } .dep-item.chain-trip .dep-action { grid-column: auto; } .dep-item.chain-trip .dep-action .btn { width: auto; } }
.sticky-foot { position: sticky; bottom: 12px; z-index: 5; box-shadow: 0 6px 24px rgba(0,0,0,.12); }

.tt-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.tt-row:last-child { border-bottom: 0; }
.tt-name { font-weight: 650; }
.tt-price { font-weight: 700; white-space: nowrap; }
.tt-persons { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; font-size: .9rem; }
.tt-persons select { width: auto; min-height: 36px; }

.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.summary-total { display: flex; justify-content: space-between; padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--line); font-size: 1.15rem; font-weight: 800; }
.countdown { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-variant-numeric: tabular-nums; }
.countdown.low { color: var(--bad); }
.pay-countdown { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 1.15rem; margin: 0 0 8px; }
.pay-countdown .countdown { font-size: 1.6rem; color: var(--brand); }
.pay-countdown .countdown.low { color: var(--bad); }

.success-hero { text-align: center; padding: 26px 20px; }
/* Card payment on the booking page: Stripe's form (it sizes itself) or the simulator's page in a frame */
.card-inline { min-height: 120px; }
.card-inline-frame { display: block; width: 100%; height: 620px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.success-hero .tick { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; background: var(--ok-bg); color: var(--ok); }

/* ---------- Seat map ---------- */
.seatmap { display: flex; flex-direction: column; gap: 14px; }
.coach { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.coach-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.coach-head strong { font-size: .95rem; }
.coach-scroll { overflow-x: auto; padding: 10px; -webkit-overflow-scrolling: touch; }
.coach svg { display: block; }  /* width set by seatmap.js: fits the box, keeps its proportions */
.seat .seat-shape { fill: var(--seat-free); stroke: var(--seat-free-line); stroke-width: 1.4; transition: fill .1s; }
.seat text { font: 600 11px var(--font); fill: var(--ink-2); pointer-events: none; text-anchor: middle; dominant-baseline: central; }
.seat.free { cursor: pointer; }
.seat.free:hover .seat-shape { fill: color-mix(in srgb, var(--brand) 18%, white); stroke: var(--brand); }
.seat.mine .seat-shape { fill: var(--seat-mine); stroke: var(--seat-mine); }
.seat.mine text { fill: var(--brand-ink); }
.seat.held .seat-shape { fill: var(--seat-held); stroke: #d4a72c; }
.seat.occupied .seat-shape { fill: var(--seat-occupied); stroke: #b1b7b5; }
.seat.occupied text, .seat.blocked text { fill: #ffffff; }
.seat.blocked .seat-shape { fill: var(--seat-blocked); stroke: var(--seat-blocked); }
.seat.checked .seat-shape { stroke: var(--ok); stroke-width: 2.5; }
.seat.selected-admin .seat-shape { stroke: var(--focus); stroke-width: 3; }
.seatmap[data-pick-target] .seat:not(.free), .seatmap[data-pick-target] .seat:not(.free) .seat-shape { cursor: not-allowed; }
.seat.released .seat-shape { fill: var(--seat-free); stroke: var(--bad); stroke-dasharray: 4 3; }  /* given up on a seat change */
.seat.released text { fill: var(--ink); paint-order: stroke; stroke: var(--seat-free); stroke-width: 3px; }
.seat.picked .seat-shape { fill: var(--brand); stroke: var(--brand); }  /* changing all seats: the new ones */
.seat.picked text { fill: #fff; }
.pick-list { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: .92rem; }
.pick-list strong { display: block; }
.seat .released-cross { stroke: var(--bad); stroke-width: 1.6; stroke-linecap: round; opacity: .55; pointer-events: none; }
/* platform system status: a traffic light per part */
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; }
.status-grid > .card { min-width: 0; }
.status-grid > .status-wide { grid-column: 1 / -1; }
.status-grid table.kv td, .status-grid .mono { overflow-wrap: anywhere; }
.status-grid .card-head h2 { display: flex; align-items: center; gap: 10px; }
.status-light { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; }
.status-light-ok { background: var(--ok, #1f7a4d); }
.status-light-warn { background: #d4a72c; }
.status-light-bad { background: var(--bad, #b42318); }
.card.status-bad { box-shadow: inset 4px 0 0 var(--bad, #b42318); }
.card.status-warn { box-shadow: inset 4px 0 0 #d4a72c; }
/* data processing agreement: text and print view (contracts app) */
.contract-text { line-height: 1.6; max-width: 80ch; }
.contract-text p { margin: 0 0 .9em; }
body.contract-print { background: #fff; }
.contract-sheet { max-width: 820px; margin: 0 auto; padding: 32px 24px 48px; }
.contract-record { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line-strong); }
@media print { .contract-sheet { padding: 0; } .no-print { display: none !important; } }
/* banners from the platform team at the top of the back office (announcements app) */
.announcements { display: grid; gap: 8px; margin-bottom: 14px; }
.announcement { align-items: flex-start; margin: 0; }
.announcement form { margin: -4px -6px 0 0; }
.announcement .badge { vertical-align: 1px; margin-right: 2px; }
/* booking pages: button to the customer's upcoming bookings made on this device (booking/_my_bookings.html) */
.my-bookings { white-space: nowrap; }
.my-bookings-menu { position: relative; }
.my-bookings-menu > summary { list-style: none; cursor: pointer; }
.my-bookings-menu > summary::-webkit-details-marker { display: none; }
.my-bookings-menu ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 260px; margin: 0;
  padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0, 0, 0, .16); }
.my-bookings-menu li a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 6px;
  color: var(--ink); text-decoration: none; }
.my-bookings-menu li a:hover, .my-bookings-menu li a:focus-visible { background: var(--surface-2); }
/* picking free seats on a departure's seat map to book them (seatmap.js) */
.seat.picked .seat-shape { fill: color-mix(in srgb, var(--brand) 30%, white); stroke: var(--brand); stroke-width: 2.6; }
.seat.picked text { fill: var(--brand); }
.seat-box { position: fixed; z-index: 55; border: 1.5px dashed var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent);
  pointer-events: none; }
body.seat-shapeing, body.seat-shapeing * { user-select: none; }
/* booking from seats chosen on the seat map: persons / seats on the ticket step (flow.js) */
.seat-target { font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); }
.seat-target.is-over { background: var(--bad, #b42318); color: #fff; }
/* reseating: hold a booked seat and drag the person to a free one (seatmap.js) */
.seat.draggable { cursor: grab; touch-action: none; }
.seat.dragging .seat-shape { opacity: .45; }
.seat.drop-ok .seat-shape { fill: color-mix(in srgb, var(--brand) 25%, white); stroke: var(--brand); stroke-width: 3; }
.seat.moved .seat-shape { stroke: var(--brand); stroke-width: 2.6; stroke-dasharray: 4 3; }
body.seat-dragging, body.seat-dragging * { cursor: grabbing !important; user-select: none; }
.seat-ghost { position: fixed; z-index: 60; padding: 6px 10px; border-radius: 6px; background: var(--ink); color: #fff;
  font-size: .82rem; pointer-events: none; box-shadow: var(--shadow-lg); white-space: nowrap; }
/* the seats of the booking under the pointer (seatmap.js) */
.seat.same-booking .seat-shape { fill: color-mix(in srgb, var(--brand) 55%, #9aa3a0); stroke: var(--brand); stroke-width: 2.6; }.seat:focus { outline: none; }
.seat:focus-visible .seat-shape { stroke: var(--focus); stroke-width: 3; }
.seat .acc { fill: var(--info); }
.seat .win { stroke: #9db8d8; stroke-width: 2.5; stroke-linecap: round; pointer-events: none; }  /* window */
.seat .tbl { stroke: #b9a07a; stroke-width: 2.5; stroke-linecap: round; pointer-events: none; }  /* table (editor) */
.seat .back { stroke: var(--ink-2); stroke-width: 3.5; stroke-linecap: round; opacity: .45; pointer-events: none; }  /* backrest */
.layout-outline { fill: #fbfbfa; stroke: var(--line-strong); stroke-width: 1.5; }
.layout-el { fill: #eef0ef; stroke: #d5d9d7; }
.layout-line { stroke: #8a948f; stroke-width: 3; stroke-linecap: round; pointer-events: none; }
.layout-line.dotted { stroke-dasharray: 0 8; }  /* round caps of length 0: a row of dots */
.editor-canvas .line-hit { stroke: transparent; stroke-width: 16; cursor: grab; }
.editor-canvas .seat.sel .layout-line { stroke: var(--focus); }
.layout-el-text { font: 600 10px var(--font); fill: var(--muted); text-anchor: middle; dominant-baseline: central; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 16px; border-radius: 4px; border: 1.4px solid var(--seat-free-line); display: inline-block; }
.legend i.mine { background: var(--seat-mine); border-color: var(--seat-mine); }
.legend i.held { background: var(--seat-held); border-color: #d4a72c; }
.legend i.occupied { background: var(--seat-occupied); border-color: #b1b7b5; }
.legend i.blocked { background: var(--seat-blocked); border-color: var(--seat-blocked); }
.seat-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.seat-list label { display: flex; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-weight: 400; margin: 0; }

/* =====================================================================
   Back office
   ===================================================================== */
.bo { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.bo-side { background: #142420; color: #d7e2de; padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.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 10px 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; }
/* Collapsed side navigation: icons only (desktop) */
@media (min-width: 981px) {
  .bo { transition: grid-template-columns .2s; }
  .bo.nav-min { grid-template-columns: 68px minmax(0, 1fr); }
  .nav-min .bo-side { padding: 16px 10px; overflow-x: hidden; scrollbar-width: none; }
  .nav-min .bo-side::-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; padding: 10px 0; }
  .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; }
  .nav-min .bo-side .me-name { display: none; }
}
@media (max-width: 980px) { .side-collapse { display: none; } }
.bo-side .tenant { font-size: .82rem; color: #9fb4ad; padding: 0 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 8px; }
.bo-side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; color: #d7e2de; text-decoration: none; font-weight: 550; font-size: .93rem; }
.bo-side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
/* the current page: a lighter background and a bar at the sidebar's edge */
.bo-side nav a { position: relative; }
.bo-side nav a[aria-current="page"] { background: rgba(255,255,255,.16); color: #fff; }
.bo-side nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 4px;
  border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-min .bo-side nav a[aria-current="page"]::before { left: -10px; }
.bo-side .nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7f978f; padding: 14px 10px 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; }
.bo-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.bo-main > .bo-content { flex: 1 0 auto; }
.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; }
.bo-top h1 { font-size: 1.05rem; margin: 0; }  /* 12.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: 14px; 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: 10px; 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); }
/* 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 needs more room. */
.bo-title:has(.page-tabs) > div:has(> h1) { flex: none; }
@media (min-width: 701px) {
  .bo-title:has(.page-tabs) > div:has(> h1) { width: 8.6rem; }
  .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; }
.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: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); 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; }
.toolbar form { display: contents; }
.toolbar input[type=search], .toolbar select { width: auto; min-width: 160px; }
.toolbar .grow { flex: 1 1 200px; }
/* 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 → 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; gap: 8px; margin-bottom: 14px; }
.filter-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; max-width: 100%; padding: 4px 10px;
  border: 1px solid #cfe5d8; border-radius: 16px; background: #edf7f1; color: var(--ink-2); font-size: .85rem;
  text-decoration: none; }
.filter-chip span { min-width: 0; overflow-wrap: anywhere; }
.filter-chip svg { flex: none; }
.filter-chip:hover { background: var(--ok-bg); color: var(--ink); }
.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; }
.search-field:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.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; }
.list-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.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 .current { background: var(--brand); color: var(--brand-ink); }
.wizard-steps .done { background: var(--ok-bg); color: var(--ok); }
.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 { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); padding: 6px; max-width: 280px; }

/* Bottom bar */
.bo-bar { position: sticky; bottom: 0; z-index: 9; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 4px 20px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -1px 6px rgba(16, 24, 20, .04); }
.bo-bar-user { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 650; font-size: .9rem; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-bar-user .avatar { width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: .75rem; font-weight: 700; }
.bo-bar-tools { display: flex; align-items: center; gap: 2px; }
.bo-bar-version { margin-right: 8px; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* "Update available": yellow and pulsing so it is noticed (.bar-btn below would reset the background) */
.bar-btn.bo-bar-update { margin-right: 8px; background: #f8d567; color: #4a3500; animation: update-pulse 2s ease-out infinite; }
.bar-btn.bo-bar-update:hover { background: #f2c335; color: #2e2100; }
@keyframes update-pulse {
  0% { box-shadow: 0 0 0 0 rgba(242, 195, 53, .7); }
  70% { box-shadow: 0 0 0 10px rgba(242, 195, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 195, 53, 0); }
}
@media (prefers-reduced-motion: reduce) { .bar-btn.bo-bar-update { animation: none; } }
.bo-bar .env-badge { position: absolute; left: 50%; transform: translateX(-50%); }
@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; border: 0; background: none; color: var(--ink-2); font: 600 .88rem/1 var(--font); padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.bar-btn:hover, .bar-btn[aria-expanded="true"] { background: var(--neutral-bg); color: var(--ink); }
@media (max-width: 980px) { .bo-bar { padding: 4px 12px; } }

/* Notifications: clock button with unread badge, overlay as a panel on the right */
.nt-open { position: relative; padding: 8px; }
/* 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; } }
.nt-badge { position: absolute; top: 1px; right: 0; 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; }
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%, white); }
.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%, white); }
.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; opacity: .45; filter: grayscale(.7); }
.icon-toggle.is-on { opacity: 1; filter: none; border-color: var(--brand, #1d5c4b); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--brand, #1d5c4b); }
.icon-toggle[aria-disabled="true"] { cursor: default; }
.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; }
.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; }
.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; }

/* Seat editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .editor { grid-template-columns: 1fr; } }
.editor-canvas { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px; min-height: 260px; }
.editor-canvas svg { display: block; max-width: none; user-select: none; touch-action: none; }
.editor-canvas .grid-line { stroke: #eef0ef; stroke-width: 1; }
.editor-canvas .seat .seat-shape { fill: #ffffff; stroke: #9aa59f; }
.editor-canvas .seat .seat-shape.first { fill: #f3e7c8; }  /* 1st class */
.editor-canvas .seat.sel .seat-shape { stroke: var(--focus); stroke-width: 3; }
.editor-canvas .seat { cursor: grab; }
.editor-canvas .seat.dup .seat-shape, .editor-canvas .seat.overlap .seat-shape { fill: var(--bad-bg); stroke: var(--bad); stroke-width: 2.4; }
.editor-canvas .resize-handle { fill: #ffffff; stroke: var(--focus); stroke-width: 2.5; }
.editor-canvas .resize-handle:hover { fill: var(--focus); }
.editor-canvas .select-box { fill: color-mix(in srgb, var(--focus) 10%, transparent); stroke: var(--focus); stroke-dasharray: 4 3; }
.layout-sheet { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.layout-print-map { display: block; width: 100%; height: auto; margin: 12px 0; }
.layout-print-text { font: 600 11px var(--font); fill: #1f2523; text-anchor: middle; dominant-baseline: central; }
.layout-print-back { stroke: #7f8c86; stroke-width: 3.5; stroke-linecap: round; }
.layout-print-legend { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.layout-print-legend span { display: inline-flex; gap: 6px; align-items: center; }
@media print { .layout-sheet { padding: 0; max-width: none; } @page { size: landscape; margin: 12mm; } }
.route-map { display: block; max-width: none; height: auto; font-family: var(--font); color: var(--ink, #1f2523); }
.editor-bar { gap: 6px; }
.editor-bar-end { margin-left: auto; }
.editor-bar #ed-name { flex: 1 1 160px; min-width: 140px; max-width: 260px; }  /* gives way before the tools wrap */
.editor-sel-tools { display: inline-flex; gap: 2px; }
.editor-glyph { display: inline-block; width: 16px; font-size: 1.05rem; line-height: 16px; text-align: center; }
.btn-danger-ghost:not(:disabled) { color: var(--bad); }
.editor-size { display: inline-flex; align-items: center; gap: 6px; }
.editor-size input { width: 70px; }
.editor-canvas-wrap { position: relative; }
.editor-canvas-wrap .editor-canvas { padding-top: 48px; }  /* room for the zoom box above the map */
.group-row.is-set { background: var(--info-bg); border-radius: var(--radius-sm); padding-left: 8px; padding-right: 8px; }
tr.is-out-of-order > td { background: color-mix(in srgb, var(--bad-bg) 70%, transparent); }  /* route editor */
.minutes-hint { color: var(--bad); }
.editor-zoom { position: absolute; top: 8px; right: 8px; z-index: 2; display: inline-flex; gap: 2px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.editor-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.editor-help-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; max-width: 520px; }
.editor-zoom #zoom-level { min-width: 64px; font-variant-numeric: tabular-nums; }

/* Check-in */
.checkin { max-width: 560px; margin: 0 auto; }
.scan-box { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; }
.scan-box .frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; }
.scan-result { border-radius: var(--radius); padding: 18px; text-align: center; font-weight: 700; font-size: 1.15rem; }
.scan-result.ok { background: var(--ok-bg); color: var(--ok); border: 2px solid var(--ok); }
.scan-result.bad { background: var(--bad-bg); color: var(--bad); border: 2px solid var(--bad); }
.scan-result.warn { background: var(--warn-bg); color: var(--warn); border: 2px solid var(--accent); }
.scan-result .detail { font-weight: 500; font-size: .95rem; color: var(--ink); margin-top: 6px; }

/* Auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, #e9efec 0%, #f5f6f4 60%); }
.auth .card { width: 100%; max-width: 420px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; margin-bottom: 18px; color: var(--ink); }
.auth-brand .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; }

@media print {
  .bo-side, .bo-top, .toolbar, .no-print { display: none !important; }
  .bo { display: block; }
  body { background: #fff; }
}

/* =====================================================================
   Utilities (replace inline styles in templates); last in the file, so they win like the inline styles did
   ===================================================================== */
.m-0 { margin: 0 !important; }
.p-0 { padding: 0 !important; }
.mt-2 { margin-top: 2px !important; }
.mb-2 { margin-bottom: 2px !important; }
.mt-4 { margin-top: 4px !important; }
.mb-4 { margin-bottom: 4px !important; }
.my-4 { margin-top: 4px !important; margin-bottom: 4px !important; }
.pt-4 { padding-top: 4px !important; }
.pb-4 { padding-bottom: 4px !important; }
.gap-4 { gap: 4px !important; }
.mt-6 { margin-top: 6px !important; }
.mb-6 { margin-bottom: 6px !important; }
.my-6 { margin-top: 6px !important; margin-bottom: 6px !important; }
.pt-6 { padding-top: 6px !important; }
.gap-6 { gap: 6px !important; }
.mt-8 { margin-top: 8px !important; }
.mb-8 { margin-bottom: 8px !important; }
.my-8 { margin-top: 8px !important; margin-bottom: 8px !important; }
.pt-8 { padding-top: 8px !important; }
.mt-10 { margin-top: 10px !important; }
.mb-10 { margin-bottom: 10px !important; }
.mt-12 { margin-top: 12px !important; }
.mb-12 { margin-bottom: 12px !important; }
.pt-12 { padding-top: 12px !important; }
.mt-14 { margin-top: 14px !important; }
.mb-14 { margin-bottom: 14px !important; }
.mt-16 { margin-top: 16px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mb-18 { margin-bottom: 18px !important; }
.mt-20 { margin-top: 20px !important; }
.my-22 { margin-top: 22px !important; margin-bottom: 22px !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.ml-auto { margin-left: auto !important; }
.w-auto { width: auto !important; }
.basis-full { flex-basis: 100% !important; }
.fs-lg { font-size: 1.35rem !important; }
.fw-normal { font-weight: 400 !important; }
.text-side { color: #d7e2de !important; }
.text-bad { color: var(--bad) !important; }
.text-ok { color: var(--ok) !important; }
.pre-wrap { white-space: pre-wrap !important; }
.break-anywhere { overflow-wrap: anywhere !important; }
.d-block { display: block !important; }
.tone-info { background: var(--info-bg) !important; color: var(--info) !important; }
.tone-warn { background: var(--warn-bg) !important; color: var(--warn) !important; }
.tone-bad { background: var(--bad-bg) !important; color: var(--bad) !important; }
.tone-neutral { background: var(--neutral-bg) !important; color: var(--muted) !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }
.list-plain { list-style: none !important; }
.w-28 { width: 28px !important; }
.w-36 { width: 36px !important; }
.w-40 { width: 40px !important; }
.w-80 { width: 80px !important; }
.w-110 { width: 110px !important; }
.w-120 { width: 120px !important; }
.w-130 { width: 130px !important; }
.w-150 { width: 150px !important; }
.w-200 { width: 200px !important; }
.area-pick { display: grid; gap: 6px; }
.w-170 { width: 170px !important; }
.w-260 { width: 260px !important; }
.mw-140 { max-width: 140px !important; }
.mw-160 { max-width: 160px !important; }
.mw-220 { max-width: 220px !important; }
.mw-240 { max-width: 240px !important; }
.mw-260 { max-width: 260px !important; }
.mw-280 { max-width: 280px !important; }
.mw-420 { max-width: 420px !important; }
.mw-520 { max-width: 520px !important; }
.mw-640 { max-width: 640px !important; }
.mw-720 { max-width: 720px !important; }
.mw-760 { max-width: 760px !important; }
.mw-820 { max-width: 820px !important; }
.mw-860 { max-width: 860px !important; }
.mw-900 { max-width: 900px !important; }
.mw-1000 { max-width: 1000px !important; }
.mw-52ch { max-width: 52ch !important; }
.mw-70ch { max-width: 70ch !important; }
.mw-75ch { max-width: 75ch !important; }
.mw-80ch { max-width: 80ch !important; }
.minw-120 { min-width: 120px !important; }
.minw-140 { min-width: 140px !important; }
.minw-240 { min-width: 240px !important; }

/* Cookie consent of the landing page (templates/core/_cookie_consent.html) */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--line-strong); box-shadow: 0 -6px 24px rgba(16, 24, 20, .12); padding: 14px 0; }
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cookie-banner-inner p { margin: 0; flex: 1 1 420px; line-height: 1.5; }
.cookie-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  .cookie-banner-actions { width: 100%; }
  .cookie-banner-actions .btn { flex: 1 1 auto; }
}
.cookie-dialog form { padding: 22px 22px 16px; }
.cookie-dialog h2 { margin: 0 0 14px; font-size: 1.15rem; }
.cookie-category { align-items: flex-start; margin-bottom: 14px; }
.landing-footer { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 16px 90px; }
.landing-footer a { color: var(--muted); }
.legal-text { padding-top: 24px; }
.legal-text h2 { font-size: 1.1rem; margin: 22px 0 6px; }
.legal-text .card-body > h2:first-child { margin-top: 0; }

/* Timetable (booking/timetable.html, embed.js data-ticketsystem-timetable): a day box, its departures as cards */
.tt { display: grid; gap: 22px; }
body.embedded.tt-page { background: var(--surface); }  /* inside the website: white, not the booking pages' grey */
.tt-day { display: grid; grid-template-columns: minmax(120px, 300px) minmax(0, 1fr); gap: 30px; align-items: stretch; }
.tt-date { background: var(--brand); color: var(--brand-ink); border-radius: 12px; padding: 40px 16px; text-align: center; font-size: 1.6rem; line-height: 1.25; }
.tt-date strong { display: block; font-weight: 800; }
.tt-date span { font-weight: 400; }
.tt-trips { display: grid; gap: 10px; align-content: start; }
.tt-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px 30px; }
.tt-card summary { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; cursor: pointer; list-style: none; }
.tt-card summary::-webkit-details-marker { display: none; }
.tt-head { display: grid; justify-items: start; gap: 12px; }
.tt-title { font-size: 1.55rem; font-weight: 500; line-height: 1.25; }
.tt-tag { background: var(--line); border-radius: 999px; padding: 4px 18px; font-size: 1.05rem; }
.tt-chevron { color: var(--brand); transform: rotate(180deg); transition: transform .15s; margin-top: 10px; }
.tt-card:not([open]) .tt-chevron { transform: none; }
.tt-body { margin-top: 24px; display: grid; justify-items: start; gap: 16px; }
.tt-time { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.15rem; }
.tt-stops { border-collapse: collapse; min-width: min(500px, 100%); font-size: 1.15rem; }
.tt-stops td { background: var(--surface-2); padding: 16px 20px; border-bottom: 3px solid var(--line-strong); }
.tt-stops td + td { width: 1%; white-space: nowrap; padding-right: 120px; }
.tt-book { display: inline-flex; align-items: center; gap: 10px; background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 22px 32px; font-size: 1.1rem; font-weight: 500; text-decoration: none; }
.tt-book:hover { filter: brightness(1.08); }
.tt-note { margin: 0; font-weight: 600; color: var(--muted); }
.tt-more { text-align: center; }
.tt-more .btn { padding: 0 72px; }  /* twice the width of a normal button */
.tt-search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; }
.tt-search .field { flex: 1 1 200px; margin: 0; }
.tt-search .field input, .tt-search .field select { width: 100%; }
.tt-search-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tt-date-input { position: relative; }
.tt-date-input input { padding-right: 46px; }
.tt-date-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.tt-date-toggle:hover { background: var(--surface-2); color: var(--ink); }
/* date picker (flow.js, input[data-datepicker]) */
.dp { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: 340px; padding: 14px 12px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.dp-nav { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; }
.dp-nav:hover { background: var(--surface-2); }
.dp-nav:disabled { opacity: .3; cursor: default; background: none; }
.dp-title { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 1.1rem; }
.tt-search .dp-title select, .dp-title select { flex: none; width: auto; min-height: 0; padding: 4px 6px; border: 0; background-color: transparent; font: inherit; cursor: pointer; }
.dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.dp-wd { padding: 4px 0 6px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.dp-day { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid transparent; border-radius: 50%; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.dp-day:hover { background: var(--surface-2); }
.dp-day.is-other { color: var(--muted); }
.dp-day.is-today { border-color: var(--line-strong); }
.dp-day.is-selected { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.dp-day:disabled { color: var(--line-strong); background: none; cursor: default; }
.dp-narrow { padding: 12px 8px 8px; }
.dp-narrow .dp-nav { width: 28px; height: 28px; }
.dp-narrow .dp-title { gap: 2px; font-size: .95rem; }
.tt-search .dp-narrow .dp-title select, .dp-narrow .dp-title select { padding: 2px; }
@media (max-width: 720px) {
  .tt-day { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .tt-date { padding: 14px; font-size: 1.2rem; }
  .tt-date strong { display: inline; }
  .tt-date strong br { display: none; }
  .tt-card { padding: 18px; }
  .tt-title { font-size: 1.25rem; }
  .tt-stops td + td { padding-right: 20px; }
  .tt-more .btn { width: 100%; padding: 0 16px; white-space: normal; }  /* the wide button would not fit */
}
