/* Design tokens carried over from the client prototype (light + dark). */
:root {
  --bg:#F2F5F9; --surface:#FFFFFF; --sunk:#E8EDF3; --ink:#0E1B2C; --muted:#5A6A7E; --line:#D8E0E9;
  --accent:#1747C9; --accent-soft:#E3EAFB; --on-accent:#FFFFFF; --gold:#D99512; --cover:#16356F; --fold:rgba(14,27,44,.24);
  --ok:#1D8657; --ok-soft:#DDF2E7; --warn:#B86A00; --warn-soft:#FBEBD2; --crit:#BF342D; --crit-soft:#F8E0DE;
  --alert:#E95420; --alert-soft:#FCE3D9; /* Ubuntu orange: the warning dialog */
  --display:"Bricolage Grotesque","Segoe UI",system-ui,sans-serif;
  --body:"IBM Plex Sans","Segoe UI",system-ui,sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,Menlo,monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:#0A121E; --surface:#111B2A; --sunk:#0D1624; --ink:#E5ECF5; --muted:#93A3B8; --line:#22314A;
    --accent:#7097FF; --accent-soft:#1A2A4D; --on-accent:#0A121E; --gold:#F0B83A; --cover:#2A4A80; --fold:rgba(0,0,0,.6);
    --ok:#47C38D; --ok-soft:#143326; --warn:#F2A541; --warn-soft:#3A2A12; --crit:#F2736A; --crit-soft:#3D1A18;
    --alert:#E95420; --alert-soft:#3E2116;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display:none !important; }
body { margin:0; background:var(--bg); color:var(--ink); font:15px/1.5 var(--body); }
a { color:var(--accent); }
.wrap { max-width:1260px; margin:0 auto; padding:20px max(16px, env(safe-area-inset-left)) 48px; }

header.top { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:16px;
  padding-bottom:18px; border-bottom:2px solid var(--ink); }
.brand { color:inherit; text-decoration:none; }
.brand small { display:block; font:500 12px var(--mono); letter-spacing:.12em; text-transform:uppercase; color:var(--muted); }
.brand h1 { margin:2px 0 0; font:800 clamp(26px,4vw,38px)/1.05 var(--display); letter-spacing:-.01em; }
.brand h1 span { color:var(--accent); }
.hdr-right { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.who { display:flex; flex-direction:column; text-align:right; font-size:14px; }
.role { font:500 11px var(--mono); letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }

.tabs { display:flex; gap:4px; background:var(--sunk); padding:4px; border-radius:10px; flex-wrap:wrap; margin-top:16px; }
.tabs a { color:var(--muted); font:600 14px var(--body); padding:8px 13px; border-radius:7px; text-decoration:none; }
.tabs a[aria-current="page"] { background:var(--surface); color:var(--ink); box-shadow:0 1px 2px rgba(0,0,0,.12); }
.subnav { display:flex; gap:14px; align-items:baseline; flex-wrap:wrap; margin-top:18px; }
.subnav a { font-weight:600; text-decoration:none; color:var(--muted); }
.subnav a[aria-current="page"] { color:var(--ink); text-decoration:underline; text-underline-offset:4px; }

section { margin-top:26px; }
section.narrow { max-width:440px; }
h2 { font:600 22px var(--display); margin:0 0 4px; }
.sub { color:var(--muted); margin:0 0 14px; font-size:14px; max-width:80ch; }
.hint { color:var(--muted); font-size:13px; }
.err { color:var(--crit); font-size:14px; }
.notice { padding:10px 14px; border-radius:10px; font-weight:600; font-size:14px; background:var(--warn-soft); color:var(--warn); }
.notice.ok { background:var(--ok-soft); color:var(--ok); }

input, select, textarea { font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line);
  border-radius:8px; padding:8px 10px; min-width:0; min-height:42px; width:100%; }
input[type=checkbox], input[type=radio] { width:16px; height:16px; min-height:0; padding:0; flex:none; }
/* Payment choices: every row the height of the "Other amount" box, radio centred on its text */
.paychoice { min-height:44px; gap:10px; font-size:15px; }
.paychoice input[type=radio] { width:18px; height:18px; margin:0; accent-color:var(--accent); }
textarea { resize:vertical; }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

.stack { display:grid; gap:12px; }
.form { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:16px; }
.field { display:flex; flex-direction:column; gap:4px; min-width:0; }
.field.all { grid-column:1/-1; }
.field label { font-size:12.5px; font-weight:600; color:var(--muted); }
.check { display:flex; align-items:center; gap:8px; font-size:14px; flex-direction:row; }
/* The box never shrinks next to long text, and sits on the first line when the text wraps */
.check > input[type=checkbox] { flex:none; margin:0; }
.check:has(> span) { align-items:flex-start; }
.check:has(> span) > input[type=checkbox] { margin-top:2px; }
.optrow { margin:10px 0 14px; }
.actions { display:flex; justify-content:flex-end; gap:8px; }

.btn { font:600 14px var(--body); border-radius:8px; padding:8px 14px; min-height:40px; cursor:pointer;
  border:1px solid transparent; background:transparent; color:var(--ink); text-decoration:none; display:inline-block; white-space:nowrap; }
.btn.sm { font-size:13px; padding:5px 10px; min-height:34px; }
.btn.big { min-height:52px; font-size:16px; padding:12px 20px; }
.btn.primary { background:var(--accent); color:var(--on-accent); }
.btn.ok { background:var(--ok); color:var(--surface); }
.btn.ghost { border-color:var(--line); }
.btn.danger { color:var(--crit); border-color:var(--crit); }
.btn:disabled { opacity:.45; cursor:not-allowed; }
.row-acts { display:flex; gap:6px; flex-wrap:wrap; }

.board { background:var(--surface); border:1px solid var(--line); border-radius:12px; overflow-x:auto; }
.board.empty { padding:28px 16px; text-align:center; color:var(--muted); }
table { width:100%; border-collapse:collapse; min-width:720px; font-variant-numeric:tabular-nums; }
th { font:500 11px var(--mono); letter-spacing:.09em; text-transform:uppercase; color:var(--muted); text-align:left;
  padding:10px 12px; border-bottom:1px solid var(--line); background:var(--sunk); vertical-align:bottom; }
td { padding:10px 12px; border-bottom:1px solid var(--line); vertical-align:middle; }
tr:last-child td { border-bottom:0; }
td.empty { text-align:center; color:var(--muted); padding:24px; }
.date { font-weight:600; white-space:nowrap; }
.small { display:block; font-size:12.5px; color:var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition:none !important; animation:none !important; } }

/* ---- Phase 1: tours, booking wizard, bookings (classes from the prototype) ---- */
.chips { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.chip { border:1px solid var(--line); background:var(--surface); color:var(--ink); font:500 13.5px var(--body);
  padding:5px 12px; border-radius:999px; cursor:pointer; text-decoration:none; }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background:var(--ink); color:var(--bg); border-color:var(--ink); }
.chip b { font-weight:600; margin-left:4px; }
.filters { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:14px; align-items:center; }
.filters input, .filters select { width:auto; }
.filters input[type=search] { flex:1 1 220px; }
.dur, .kid { display:block; color:var(--muted); font-size:13px; }
.kid { font-size:12.5px; white-space:nowrap; }
.pkg, .price, .slotnum { font-weight:600; }
.code { display:block; font:500 12px var(--mono); color:var(--muted); white-space:nowrap; }
td.code, td.small { display:table-cell; } /* a code or note in its own cell stays in line with the row */
th.num { white-space:normal; }             /* long number headers wrap instead of widening the table */
td.pkg, .nowrap { white-space:nowrap; }    /* booking refs and short links never break mid-word */
.num { text-align:right; white-space:nowrap; }
.slots { min-width:110px; }
.bar { height:6px; background:var(--sunk); border-radius:3px; overflow:hidden; margin-top:6px; }
.bar i { display:block; height:100%; background:var(--accent); }
.bar i.low { background:var(--warn); } .bar i.full { background:var(--crit); }
.new { font:500 10.5px var(--mono); letter-spacing:.08em; background:var(--gold); color:var(--surface);
  padding:1px 6px; border-radius:3px; margin-left:6px; vertical-align:2px; }
.cats { display:flex; gap:4px; flex-wrap:wrap; margin-top:4px; }
.cats span { font-size:11.5px; color:var(--muted); border:1px solid var(--line); border-radius:4px; padding:0 6px; }
.btn.wait { background:var(--warn-soft); color:var(--warn); border-color:var(--warn); }
.pill { display:inline-block; font-size:12px; font-weight:600; padding:2px 9px; border-radius:999px; white-space:nowrap; }
.p-ok { background:var(--ok-soft); color:var(--ok); } .p-warn { background:var(--warn-soft); color:var(--warn); }
.p-crit { background:var(--crit-soft); color:var(--crit); } .p-mute { background:var(--sunk); color:var(--muted); }
.p-acc { background:var(--accent-soft); color:var(--accent); }
.flag { color:var(--crit); font-size:12px; display:block; }
.links { display:flex; gap:10px; margin-top:6px; font-size:13px; flex-wrap:wrap; }

.kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(165px,1fr)); gap:12px; }
.kpi { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:14px 16px; }
.kpi b { display:block; font:800 26px/1.15 var(--display); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.kpi span { font-size:13px; color:var(--muted); }

.sheet { background:var(--surface); border-radius:14px; width:100%; max-width:820px; padding:22px; border:1px solid var(--line); margin-top:20px; }
.sheet.narrow { max-width:640px; }
.sheet h3 { font:600 21px var(--display); margin:0; }
.sheet h4, .panel h4 { font:500 11.5px var(--mono); letter-spacing:.1em; text-transform:uppercase; color:var(--muted); margin:20px 0 8px; }
.sum { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; margin-top:14px; padding:12px;
  background:var(--sunk); border-radius:10px; font-variant-numeric:tabular-nums; }
.sum div span { display:block; font-size:12px; color:var(--muted); }
.sum div b { font-size:16px; }
.terms { font-size:13px; color:var(--muted); background:var(--sunk); border-radius:10px; padding:10px 12px; margin-top:10px; white-space:pre-line; }
.tcbox { max-height:260px; overflow-y:auto; white-space:normal; }
.tcbox p { margin:0 0 6px; } .tcbox .h1 { font-weight:700; color:var(--ink); margin-top:10px; } .tcbox .h2 { font-weight:600; color:var(--ink); }
.list { margin:0; padding-left:0; list-style:none; } .list li { padding:3px 0; font-size:14px; }
.days { display:grid; gap:8px; } .days div { border-left:3px solid var(--accent); padding:4px 0 4px 10px; font-size:14px; } .days b { display:block; }
.climate { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:10px; margin-top:6px; }
.climate div { border:1px solid var(--line); border-radius:10px; padding:10px 12px; font-size:14px; }
.climate b { display:block; font:500 11px var(--mono); letter-spacing:.09em; text-transform:uppercase; color:var(--muted); margin-bottom:4px; }
.inner { overflow-x:auto; border:1px solid var(--line); border-radius:10px; }
.inner table { min-width:0; }
.inner td { padding:7px 10px; }
.inner input, .inner select { padding:6px 8px; font-size:13.5px; min-height:36px; }

.wsteps { list-style:none; display:flex; gap:6px; padding:0; margin:14px 0 10px; counter-reset:w; }
.wsteps li { flex:1; counter-increment:w; font-size:13px; color:var(--muted); border-top:4px solid var(--line); padding-top:6px; }
.wsteps li::before { content:counter(w) ". "; font-weight:700; }
.wsteps li.now { color:var(--ink); font-weight:600; border-top-color:var(--accent); }
.wsteps li.done { color:var(--ink); border-top-color:var(--ok); }
.stepper { display:grid; grid-template-columns:minmax(0,1fr) 48px 56px 48px; gap:8px; align-items:center; padding:10px 0; border-bottom:1px solid var(--line); }
.stepper b { display:block; font-size:17px; } .stepper.sep { margin-top:6px; }
.stepper input { text-align:center; font-size:20px; font-weight:700; padding:6px; min-height:52px; -moz-appearance:textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.pm { min-height:52px; border-radius:12px; border:1px solid var(--line); background:var(--sunk); color:var(--ink); font-size:26px; font-weight:700; cursor:pointer; }
.wtotal { margin-top:14px; padding:14px; border-radius:12px; background:var(--sunk); display:grid; gap:2px; }
.wtotal b { font:800 26px var(--display); }
.review { display:grid; gap:8px; margin-top:6px; }
.review div { border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.review b { display:block; } .review span { color:var(--muted); font-size:14px; }
.linkbtn { background:none; border:0; color:var(--accent); text-decoration:underline; font:inherit; cursor:pointer; padding:4px 0; }
.xdet { margin-top:14px; border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.xdet summary { cursor:pointer; font-weight:600; }
.xgrid { display:grid; gap:8px; margin-top:10px; }
.xrow { display:flex; gap:10px; align-items:center; flex-wrap:wrap; border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.xrow .grow { flex:1 1 200px; min-width:0; } .xrow .grow b { display:block; }
.xrow input[type=number] { width:72px; } .xrow select { max-width:220px; width:auto; }
.xsub { min-width:96px; text-align:right; font-weight:600; font-variant-numeric:tabular-nums; margin-left:auto; }
.bigcheck { margin-top:14px; font-size:15px; align-items:flex-start; }
.bigcheck input { width:22px; height:22px; margin-top:2px; flex:none; }
.wnav { position:sticky; bottom:0; background:var(--surface); padding-top:10px; margin-top:16px; flex-wrap:wrap; }
.paxgrid { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:8px; margin-top:6px; }
.readbox { border:1px dashed var(--accent); border-radius:10px; padding:12px; background:var(--accent-soft); margin-top:12px; }
.readbox > b { display:block; }

.helpfab { position:fixed; right:calc(16px + env(safe-area-inset-right, 0px)); bottom:calc(16px + env(safe-area-inset-bottom, 0px));
  z-index:15; background:var(--accent); color:var(--on-accent); border:0; border-radius:999px; padding:14px 20px;
  font:600 16px var(--body); box-shadow:0 4px 14px rgba(0,0,0,.2); cursor:pointer; }
dialog.sheet { margin:auto; max-width:520px; color:var(--ink); }
dialog::backdrop { background:rgba(5,10,20,.55); }
.helpgrid { display:grid; gap:8px; margin-top:10px; }
.helpgrid > div { border:1px solid var(--line); border-radius:10px; padding:12px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.helpgrid .grow { flex:1 1 180px; } .helpgrid b { display:block; font-size:16px; }

.steps { display:flex; flex-wrap:wrap; margin:14px 0 4px; }
.steps div { flex:1 1 120px; padding:8px 10px 8px 0; font-size:13px; color:var(--muted); border-top:3px solid var(--line); }
.steps div.done { color:var(--ink); border-top-color:var(--ok); }
.steps div.now { color:var(--ink); font-weight:600; border-top-color:var(--accent); }
.timeline { list-style:none; margin:0; padding:0; font-size:13.5px; display:grid; gap:6px; }
.timeline time { font:500 11.5px var(--mono); color:var(--muted); margin-right:8px; }
.clickrow { cursor:pointer; } .clickrow:hover td { background:var(--sunk); }

/* Tours board becomes cards on phones */
.cards { display:none; gap:12px; }
.tcard { background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:16px; display:grid; gap:8px; }
.tcard h3 { font:600 19px var(--display); margin:0; } .tcard .pr { font:800 24px var(--display); }
.tcard .row-acts .btn { flex:1 1 auto; text-align:center; }
@media (max-width:760px) { #tours-board { display:none; } .cards { display:grid; } }
@media (max-width:560px) { .stepper { grid-template-columns:minmax(0,1fr) 44px 52px 44px; } }
.chip { position:relative; }
.chip input[type=radio] { position:absolute; opacity:0; width:1px; height:1px; min-height:0; }
.chip:has(input:checked) { background:var(--ink); color:var(--bg); border-color:var(--ink); }
.chip:has(input:focus-visible) { outline:2px solid var(--accent); outline-offset:2px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; min-height:0; }
.steps div small { display:block; font-size:11.5px; color:var(--muted); font-weight:400; }
.field.wide { grid-column:span 2; }
@media (max-width:560px) { .field.wide { grid-column:auto; } }
.field.actions { flex-direction:row; justify-content:flex-end; }

/* ---- Menu layout preview: top tabs (default design) or a side menu ---- */
.main-col { min-width:0; }
.if-side { display:none; }
.nav-side .if-side { display:inline; } .nav-side .if-top { display:none; }
@media (max-width:760px) { [data-navtoggle] { display:none; } }  /* phones keep the top tabs */
.nav-caption, .nav-ico { display:none; }
.nav-inner { display:contents; }  /* top tabs: the links sit straight in the tab bar */
@media (min-width:761px) {
  .nav-side .wrap { max-width:1480px; padding-bottom:0; }
  .nav-side .shell { display:grid; grid-template-columns:232px minmax(0,1fr); align-items:stretch; }
  /* The sidebar: its own panel, divided from the page by a border on the right */
  .nav-side .tabs { flex-direction:column; flex-wrap:nowrap; gap:4px; margin:0; padding:20px 16px 24px 0;
    background:transparent; border-radius:0; border-right:1px solid var(--line); }
  .nav-side .nav-inner { display:flex; flex-direction:column; gap:4px; position:sticky; top:16px; }
  .nav-side .nav-caption { display:block; font:500 11px var(--mono); letter-spacing:.12em; text-transform:uppercase;
    color:var(--muted); padding:0 12px 8px; }
  .nav-side .tabs a { display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:10px;
    font-size:14.5px; color:var(--muted); position:relative; }
  .nav-side .nav-ico { display:block; flex:none; }
  .nav-side .tabs a:hover { background:var(--sunk); color:var(--ink); }
  .nav-side .tabs a[aria-current="page"] { background:var(--accent-soft); color:var(--accent); box-shadow:none; }
  .nav-side .tabs a[aria-current="page"]::before { content:""; position:absolute; left:-4px; top:9px; bottom:9px;
    width:3px; border-radius:2px; background:var(--accent); }
  .nav-side .main-col { padding:4px 0 48px 32px; }
}

/* ---- Frozen frame: header and menus stay, only the main column scrolls (tablet and up) ---- */
@media (min-width:761px) {
  .appshell { height:100vh; height:100dvh; box-sizing:border-box; display:flex; flex-direction:column;
    padding-bottom:0; }
  .appshell > header.top { flex:none; }
  .appshell > .shell { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; }
  .appshell > .shell > .tabs { flex:none; }
  .appshell .main-col { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain;
    scrollbar-gutter:stable; }
  .appshell .main-col, .nav-side .appshell .main-col { padding-bottom:0; }
  .appshell .main-col > main { padding-bottom:48px; }  /* inside, so sticky bars reach the bottom */
  .nav-side .appshell > .shell { display:grid; grid-template-columns:232px minmax(0,1fr); }
  .nav-side .appshell > .shell > .tabs { overflow-y:auto; }
  .nav-side .appshell .nav-inner { position:static; }
  /* Sub-navigation (Back office: Departures, Team, Settings) stays at the top of the column */
  .appshell .main-col .subnav { position:sticky; top:0; z-index:5; background:var(--bg);
    margin-top:0; padding:14px 0 10px; border-bottom:1px solid var(--line); }
  .appshell .main-col:has(.subnav) { scroll-padding-top:64px; }  /* anchors land below it */
}

/* ---- Phase 2: payments, accounting, notifications (prototype classes) ---- */
.paybox{border:2px solid var(--accent);border-radius:14px;padding:14px;margin-top:12px;display:grid;gap:12px}
.paystep{display:grid;gap:8px}.paystep>b{font-size:16px}
.copyrow{display:flex;gap:10px;align-items:center;flex-wrap:wrap;border:1px solid var(--line);border-radius:10px;padding:10px 12px}
.copyrow span{flex:1 1 160px;color:var(--muted);font-size:14px}.copyrow b{font-size:17px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.checkpills{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
.emailopt{display:inline-flex;font-size:13.5px;color:var(--muted)}
.endorse{border:1px solid var(--accent);border-radius:12px;padding:12px 14px;margin-top:14px;background:var(--accent-soft)}
.bell{position:relative;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:10px;padding:6px 12px;font:600 14px var(--body);text-decoration:none;display:inline-flex;align-items:center;min-height:34px}
.bell .n b{position:absolute;top:-7px;right:-7px;background:var(--crit);color:#fff;border-radius:999px;font-size:11px;min-width:19px;height:19px;display:grid;place-items:center;padding:0 5px}
.inbox{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.inbox li{padding:10px 12px;border-radius:8px;font-size:14px}
.inbox li.unread{background:var(--accent-soft)}
.inbox li a{color:inherit;text-decoration:none;display:block}
.inbox time{display:block;font-family:var(--mono);font-size:11.5px;color:var(--muted)}
.rejectbox summary{list-style:none}.rejectbox summary::-webkit-details-marker{display:none}
.rejectbox[open]{flex-basis:100%}
.rejectbox form{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}.rejectbox input{flex:1 1 200px}
.upload-status{font-size:13px;color:var(--muted)}

/* Phase 3: documents and the Specialist desk (prototype classes) */
.docs{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px}
.doc{display:flex;flex-direction:column;gap:4px;border:1px solid var(--line);border-radius:10px;padding:10px 12px;min-width:0;background:var(--surface)}
.doc b{font-size:13.5px}.doc.off{opacity:.6}
.doc>.row-acts{margin-top:auto;padding-top:4px;align-items:center} /* buttons line up across a row of cards */
.doc .row-acts>form{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.doc label.btn{cursor:pointer;position:relative}
label.btn:focus-within{outline:2px solid var(--accent);outline-offset:2px}
/* Approve · Decline (the reason is asked in a dialog) */
.doc>.row-acts.docreview{margin-top:6px;padding-top:0}
select.sm{min-height:34px;padding:5px 8px;font-size:13px}
.paxform{margin-top:12px}.paxform .actions{margin-top:10px}
/* visually hidden but still reachable by keyboard (file inputs inside a label.btn) */
.vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;opacity:0}
.docpill{display:flex;flex-direction:column;gap:3px;align-items:flex-start}
.endorse>div>div>b{display:block}
.checklist{list-style:none;padding:0;margin:10px 0 0;display:grid;gap:4px;font-size:13.5px}
.checklist li{display:grid;grid-template-columns:22px 210px minmax(0,1fr);gap:6px;align-items:start}
.checklist li::before{content:"✓";color:var(--ok);font-weight:700}.checklist li.bad::before{content:"!";color:var(--warn)}
.checklist li span{color:var(--muted)}
@media (max-width:560px){.checklist li{grid-template-columns:22px minmax(0,1fr)}.checklist li span{grid-column:2}}
.depcard{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:16px;margin-top:14px}
.depcard header{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:start}
.ready{font-family:var(--display);font-weight:800;font-size:22px;display:block}
.notice.bad{background:var(--crit-soft);color:var(--crit)}
.travdocs{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;margin-top:10px}
.travdocs .doc{min-width:0}
.travdocs select{max-width:100%}
.seatin{width:76px}
.row-acts.tight{flex-wrap:nowrap}
.cellstack{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
/* Verify above Reject, same width, so every queue row lines up */
.slipacts{flex-direction:column;align-items:stretch;min-width:84px}.slipacts .btn{width:100%;text-align:center}

/* Sign-in page: an open notebook. A cover shows around two equal paper pages, with stacked
   page edges on the outer sides, shading at the fold and rings down the spine. */
.login-page { min-height:100vh; min-height:100dvh; display:grid; place-items:center;
  padding:max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)); }
.login-book { width:min(920px,100%); display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
  padding:8px 14px 14px; background:var(--cover); border-radius:16px;
  box-shadow:0 24px 50px -22px rgba(14,27,44,.55); }
.login-cover, .login-form { position:relative; padding:44px clamp(24px,4vw,48px); }
.login-cover { display:flex; flex-direction:column; justify-content:center; gap:16px;
  border-radius:10px 0 0 10px;
  background:linear-gradient(to left, var(--fold), 14px, transparent 64px), var(--surface);
  box-shadow:-2px 2px 0 var(--line), -3px 3px 0 var(--surface), -5px 5px 0 var(--line), -6px 6px 0 var(--surface); }
.login-cover p { margin:0; color:var(--muted); line-height:1.5; }
.login-form { border-radius:0 10px 10px 0;
  background:linear-gradient(to right, var(--fold), 14px, transparent 64px), var(--surface);
  box-shadow:2px 2px 0 var(--line), 3px 3px 0 var(--surface), 5px 5px 0 var(--line), 6px 6px 0 var(--surface); }
/* Carries the stacked page edges across the fold, where the two pages' edges stop short. */
.login-cover::after { content:""; position:absolute; right:-6px; bottom:-6px; width:12px; height:6px;
  background:linear-gradient(to bottom, var(--line) 2px, var(--surface) 2px 3px, var(--line) 3px 5px, var(--surface) 5px); }
/* Rings: one tile repeated along the fold, each ring passing through a hole on both pages. */
.login-form::before { content:""; position:absolute; top:14px; bottom:14px; left:-16px; width:32px; pointer-events:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='40'%3E%3Ccircle cx='5' cy='20' r='2.5' fill='%230E1B2C' fill-opacity='.45'/%3E%3Ccircle cx='27' cy='20' r='2.5' fill='%230E1B2C' fill-opacity='.45'/%3E%3Crect x='3' y='17.5' width='26' height='5' rx='2.5' fill='%238A96A8' stroke='%235A6A7E' stroke-width='.75'/%3E%3C/svg%3E") center top / 32px 40px repeat-y; }
.login-form h2 { margin:0 0 4px; font:600 30px/1.15 var(--display); letter-spacing:-.01em; }
.login-form .sub { margin-bottom:22px; }
.login-form .btn { width:100%; margin-top:4px; }
.login-error { margin:0 0 16px; padding:10px 14px; border-radius:10px; font-size:14px; font-weight:600;
  background:var(--crit-soft); color:var(--crit); }
.login-foot { margin:18px 0 0; }
/* Phones: no notebook, just one plain card with the logo above the form. */
@media (max-width:720px) {
  .login-book { grid-template-columns:minmax(0,1fr); max-width:440px; padding:0; background:var(--surface);
    border:1px solid var(--line); border-radius:16px; box-shadow:0 18px 44px -24px rgba(14,27,44,.3); }
  .login-cover, .login-form { border-radius:0; background:none; box-shadow:none; }
  .login-cover { padding:24px 20px 20px; gap:10px; }
  .login-form { padding:20px 20px 28px; border-top:1px solid var(--line); }
  .login-cover::after, .login-form::before { display:none; }
}

/* Sign-in pages: "Forgot password?" beside the label, and notices above the form. */
.label-row { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.label-row a { font-size:12.5px; font-weight:600; }
.login-form .notice { margin:0 0 16px; }
.reset-link { font-family:var(--mono); font-size:13px; }

/* Warning dialog (base.html, app.js data-confirm): replaces the browser's confirm() popup */
dialog.confirm { max-width:440px; padding:22px 22px 18px; border-top:4px solid var(--alert); }
dialog.confirm.danger { border-top-color:var(--crit); }
.confirm-head { display:flex; align-items:center; gap:12px; }
.confirm-icon { flex:none; width:34px; height:34px; border-radius:999px; display:grid; place-items:center;
  font:800 18px/1 var(--display); background:var(--alert-soft); color:var(--alert); }
dialog.confirm.danger .confirm-icon { background:var(--crit-soft); color:var(--crit); }
#cf-text, .confirm-text { margin:12px 0 18px; color:var(--muted); line-height:1.5; overflow-wrap:anywhere; }
dialog.confirm .actions { flex-wrap:wrap-reverse; }
dialog.confirm .field { margin:0 0 18px; }
dialog.confirm .actions .btn { flex:1 1 140px; text-align:center; }
.btn.crit { background:var(--crit); color:var(--surface); border-color:var(--crit); }
@media (prefers-reduced-motion: no-preference) {
  dialog.confirm[open] { animation:cf-in .14s ease-out; }
  @keyframes cf-in { from { opacity:0; transform:translateY(6px) scale(.98); } to { opacity:1; transform:none; } }
}

/* Settings (Back office): grouped panels; label, input and hint line up across each row */
.settings { display:grid; gap:14px; }
.setgroup { padding-bottom:4px; }
.setgroup header h3 { font:600 17px var(--display); margin:0; }
.setgroup header .hint { margin:3px 0 0; max-width:70ch; }
.setgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); column-gap:18px; row-gap:0; margin-top:14px; }
.setfield { display:flex; flex-direction:column; gap:6px; min-width:0; padding-bottom:16px; }
@supports (grid-template-rows:subgrid) {
  .setfield { display:grid; grid-row:span 3; grid-template-rows:subgrid; row-gap:6px; }
}
.setfield.all, .setcheck { grid-column:1/-1; }
.setfield > label { font-size:12.5px; font-weight:600; color:var(--muted); align-self:end; }
.setfield .hint:empty { display:none; }
.setfield > .hint { font-size:12.5px; }
.inunit { display:flex; align-items:stretch; }
.inunit input { flex:1 1 auto; }
.inunit:has(.unit) input { border-top-right-radius:0; border-bottom-right-radius:0; }
.inunit .unit { display:flex; align-items:center; padding:0 12px; border:1px solid var(--line); border-left:0;
  border-radius:0 8px 8px 0; background:var(--sunk); color:var(--muted); font-size:13px; white-space:nowrap; }
.setcheck { display:flex; align-items:flex-start; gap:12px; padding:12px 14px; margin-bottom:12px;
  border:1px solid var(--line); border-radius:10px; cursor:pointer; }
.setcheck:hover { border-color:var(--accent); }
.setcheck input { margin-top:2px; width:18px; height:18px; flex:none; }
.setcheck b { display:block; font-size:14.5px; font-weight:600; }
.setcheck .hint { display:block; margin-top:2px; }
.setsave { position:sticky; bottom:0; display:flex; justify-content:flex-end; padding:12px 0;
  background:linear-gradient(to top, var(--bg) 70%, transparent); }
