/* BHS Companion – direction C "Bento": warm neutral ground, white/black rounded tiles, one accent (the logo red). */

:root {
    --bg: #ECEAE4;
    --surface: #FFFFFF;
    --ink: #161616;
    --muted: #5E5B55;
    --line: #E3E0D8;
    --accent: #D40323;      /* the red of the logo */
    --on-accent: #FFFFFF;
    --accent-soft: #F6C4CC;
    --selected: #FBE4E7;
    --late: #C8261B;
    --dark-2: #2A2A2A;
    --on-dark-muted: #B5B1A8;
    --late-on-dark: #FF7A6E;

    --r-xl: 28px;
    --r-l: 20px;
    --r-m: 14px;

    --font: 'Space Grotesk', system-ui, sans-serif;
    --font-mono: 'Space Mono', ui-monospace, monospace;

    --gutter: 28px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

h1, h2, h3, p { margin: 0; }
h1:focus { outline: none; }
.delay { margin-left: 4px; }

.mono { font-family: var(--font-mono); }
.strong { font-weight: 700; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.muted-on-dark { color: var(--on-dark-muted); }
.late { color: var(--late); }
.late-on-dark { color: var(--late-on-dark); }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.push { margin-left: auto; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Shell ---------- */

.app { max-width: 1400px; margin: 0 auto; padding: 20px var(--gutter) 40px; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; text-decoration: none; margin-right: 12px; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.pill-nav { display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--surface); }
.pill {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 18px;
    border-radius: 99px; text-decoration: none; font-weight: 600; cursor: pointer;
}
.pill.active, .pill[aria-current="page"] { background: var(--ink); color: var(--surface); }
.pill-white { background: var(--surface); min-height: 44px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; min-width: 240px;
    margin: 0; padding: 6px; list-style: none; background: var(--surface);
    border-radius: var(--r-l); box-shadow: 0 12px 32px rgba(22, 22, 22, .15);
    display: flex; flex-direction: column;
}
.menu-list a, .menu-button {
    display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r-m); text-decoration: none;
}
.menu-list a:hover, .menu-list a[aria-current="true"], .menu-button:hover { background: var(--bg); }
.menu-button { all: unset; box-sizing: border-box; width: 100%; display: flex; padding: 12px 14px; border-radius: var(--r-m); cursor: pointer; }
.menu-user { display: flex; flex-direction: column; padding: 12px 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

.avatar {
    width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--surface);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none;
}
.avatar.sm { width: 32px; height: 32px; font-size: 11px; background: var(--bg); color: var(--ink); }

.page-title { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }

/* ---------- Tiles & panels ---------- */

.tile { border-radius: var(--r-xl); background: var(--surface); padding: 20px 22px; }
.tile.dark { background: var(--ink); color: var(--surface); }
.tile.accent { background: var(--accent); color: var(--on-accent); }
.panel { border-radius: var(--r-xl); background: var(--surface); padding: 20px 22px; }
.panel-title { font-size: 16px; font-weight: 600; }

.tiles { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.stat { flex: 1 1 160px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.stat-num { font-size: 44px; font-weight: 700; line-height: .9; letter-spacing: -0.04em; }

.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 20px; }
.site-tile { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 190px; text-decoration: none; }
.site-tile.dark .muted { color: var(--on-dark-muted); }
.site-code { font-size: 64px; font-weight: 700; line-height: .9; letter-spacing: -0.04em; }
.site-tile.dark .site-code { color: var(--accent); }
.site-tile-text { display: flex; flex-direction: column; gap: 2px; }

/* ---------- Flights page ---------- */

.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head .page-title { margin-right: 8px; }

.pill-group { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 99px; background: var(--surface); }
.icon-btn {
    width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none;
}
.icon-btn:hover { background: var(--bg); }

.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--surface); }
.seg a {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 99px;
    text-decoration: none; font-weight: 600;
}
.seg a.active { background: var(--ink); color: var(--surface); }
.seg .count { font-size: 12px; opacity: .75; }

.search {
    display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border-radius: 99px;
    background: var(--surface); flex: 0 1 300px; color: var(--muted);
}
.search input { all: unset; flex: 1; min-width: 0; font-size: 14px; color: var(--ink); }

.split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.table-panel { flex: 999 1 640px; min-width: 0; padding: 8px 8px 12px; }
.detail-panel { flex: 1 1 360px; min-width: 0; position: sticky; top: 16px; }
.table-scroll { overflow-x: auto; }
.empty { padding: 16px; }
.placeholder { padding: 40px 24px; text-align: center; }

table.flights { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 860px; font-size: 14px; }
table.flights th {
    text-align: left; padding: 14px 10px; font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted);
}
table.flights td { padding: 11px 10px; border-top: 1px solid #F0EEE9; vertical-align: middle; }
table.flights tr.selected td { background: var(--selected); }
table.flights tr.selected td:first-child { border-radius: 16px 0 0 16px; }
table.flights tr.selected td:last-child { border-radius: 0 16px 16px 0; }
table.flights tr.now-row td { border-top: 0; padding: 4px 10px; }

.flight-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.flight-link:hover .mono { text-decoration: underline; }

.type-icon {
    width: 30px; height: 30px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
}
.type-icon.dep { background: var(--ink); color: var(--surface); }
.type-icon.arr { background: var(--bg); color: var(--ink); }
.type-icon.sm { width: 28px; height: 28px; border-radius: 9px; }

.chip {
    display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px;
    border: 1.5px solid transparent; white-space: nowrap;
}
.chip-notopen { background: var(--surface); color: var(--muted); border-color: var(--on-dark-muted); }
.chip-open { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip-reopened { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }
.chip-closed { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip.on-dark.chip-closed { border-color: var(--surface); }
.chip-cancelled { background: var(--surface); color: var(--late); border-color: var(--late); text-decoration: line-through; }
table.flights tr.cancelled td:not(:last-child), .card-row.cancelled .card-main, .card-row.cancelled .card-times { opacity: .55; }
.chip-fixed { width: 78px; text-align: center; padding: 4px 0; font-size: 11px; }

.now-marker {
    display: flex; align-items: center; gap: 8px; color: var(--late); font-size: 12px; font-weight: 700; padding: 2px 4px;
}
.now-marker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--late); }
.now-marker::after { content: ""; flex: 1; height: 1.5px; background: var(--late); }

/* Mobile list */
.cards { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.card-row {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-l);
    background: var(--surface); text-decoration: none; min-height: 64px;
}
.card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-place { font-weight: 700; font-size: 22px; line-height: 1.1; }
.card-times { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; }
.show-earlier {
    text-align: center; padding: 10px; border-radius: 16px; border: 1.5px dashed var(--on-dark-muted);
    color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none;
}

/* ---------- Flight detail ---------- */

.detail { display: flex; flex-direction: column; gap: 12px; }
.detail-hero { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.detail-code { font-size: 42px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--on-dark-muted); }
.route-chip { font-weight: 700; padding: 6px 10px; border-radius: 12px; background: var(--dark-2); color: var(--surface); }
.route-chip.here { background: var(--surface); color: var(--ink); }
.time-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.time-box { padding: 12px 14px; border-radius: 18px; background: var(--dark-2); }
.time-big { font-size: 26px; font-weight: 700; }
.time-delay { font-size: 15px; }

.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.kv-grid > div { display: flex; flex-direction: column; gap: 2px; }

.chute-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chute { font-weight: 700; font-size: 18px; padding: 6px 14px; border-radius: var(--r-m); background: var(--bg); }

.history-row { display: flex; align-items: center; gap: 10px; }
.history-n {
    width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 700;
}
.history-n.is-open { background: var(--accent); color: var(--on-accent); }

.detail-page { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.back { align-self: flex-start; padding-left: 10px; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
    :root { --gutter: 14px; }

    .desktop-only { display: none !important; }
    .page-title { font-size: 30px; }
    .topbar { gap: 8px; }
    .brand { font-size: 15px; margin-right: 0; }
    .pill { padding: 0 14px; }
    .page-head .seg { margin-left: 0; width: 100%; }
    .page-head .seg a { flex: 1; justify-content: center; padding: 0 8px; }
    .seg .count { display: none; }
    .search { flex: 1 1 100%; }
}

@media (min-width: 861px) {
    .mobile-only { display: none !important; }
}

/* ---------- Blazor error UI ---------- */

#blazor-error-ui {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; padding: 12px 20px;
    background: var(--ink); color: var(--surface);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }

/* ---------- Buttons & forms ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
    border-radius: 99px; border: 1.5px solid transparent; font: inherit; font-weight: 600; text-decoration: none;
    cursor: pointer; background: none; color: inherit;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn-dark { background: var(--ink); color: var(--surface); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-ghost { border-color: var(--ink); }
.btn-danger { border-color: var(--late); color: var(--late); }
.btn-block { width: 100%; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.icon-btn.plain { text-decoration: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input {
    height: 48px; padding: 0 16px; border-radius: var(--r-m); border: 1.5px solid transparent; background: var(--bg);
    font: inherit; color: var(--ink); width: 100%; min-width: 0;
}
.input:focus { outline: none; border-color: var(--ink); }
.input:disabled { color: var(--muted); }
.input-num { width: 96px; font-weight: 700; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline-form .input:not(.input-num) { flex: 1 1 200px; }
.field-error, .validation-message { color: var(--late); font-size: 13px; }
.form-error { padding: 12px 16px; border-radius: var(--r-m); background: #FBE3E0; color: #8A1A12; font-weight: 600; }
.form-success { padding: 12px 16px; border-radius: var(--r-m); background: #DDF0E2; color: #155E2C; font-weight: 600; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); margin: 2px 0 0; flex: none; }
.checks { display: flex; flex-direction: column; gap: 10px; }

.toggles { display: flex; flex-wrap: wrap; gap: 10px; }
.switch {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 18px;
    border: 1.5px solid var(--line); cursor: pointer; font-weight: 600;
}
.switch input {
    appearance: none; width: 48px; height: 28px; border-radius: 99px; background: #CFCBC2; position: relative;
    cursor: pointer; margin: 0; flex: none; transition: background .15s;
}
.switch input::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
    background: var(--surface); transition: transform .15s;
}
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(20px); }
.switch:has(input:checked) { border-color: var(--ink); }
.switch input:disabled { opacity: .6; cursor: default; }
.switch-sm { padding: 6px 10px; gap: 8px; border: 0; font-size: 14px; }
.switch-sm input { width: 40px; height: 24px; }
.switch-sm input::after { width: 18px; height: 18px; }
.switch-sm input:checked::after { transform: translateX(16px); }

/* Alerts page: one row per site, with an email and a push switch. */
.alert-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; }
.alert-choice {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 8px 8px 8px 16px;
    border: 1.5px solid var(--line); border-radius: 18px;
}
.alert-choice:has(input:checked:not(:disabled)) { border-color: var(--ink); }
.alert-choice-name { flex: 1 1 140px; min-width: 0; }
@media (max-width: 520px) {
    .alert-choice { padding: 10px 8px 6px 14px; }
    .alert-choice-name { flex-basis: 100%; }
}
.push-device-on { flex-wrap: wrap; gap: 10px; }
.push-help { background: var(--bg); border-radius: 16px; padding: 14px 16px; }
.device-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 6px 10px 14px; border-radius: 14px; background: var(--bg); }

/* ---------- Sign-in & account ---------- */

.account-shell { max-width: 1100px; margin: 0 auto; padding: 20px var(--gutter) 40px; display: flex; flex-direction: column; gap: 20px; }
.login { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.login-hero {
    position: relative; overflow: hidden; flex: 1 1 360px; min-height: 380px; display: flex; align-items: flex-end; padding: 28px;
}
.login-hero-mark { position: absolute; top: -8%; right: -6%; width: min(70%, 320px); height: auto; }
.login-hero-text { position: relative; }
.login-hero-text { font-size: clamp(40px, 6vw, 64px); font-weight: 700; line-height: .95; letter-spacing: -0.04em; }
.login-form {
    flex: 1 1 360px; background: var(--surface); border-radius: var(--r-xl); padding: 28px;
    display: flex; flex-direction: column; gap: 18px; justify-content: center;
}
.account-card { max-width: 520px; padding: 28px; }

/* ---------- Home ---------- */

.module-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.module-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px;
    background: var(--bg); color: var(--ink); font-size: 12px; font-weight: 600;
}
.module-chip .role { font-family: var(--font-mono); font-size: 11px; opacity: .7; }
.site-tile.dark .module-chip { background: var(--dark-2); color: var(--surface); }
.accent-text { color: var(--accent); }

/* ---------- Admin ---------- */

.panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 6px 6px 12px; }
.panel-head .panel-title { margin-right: auto; }
.search-sm { height: 40px; flex: 0 1 220px; background: var(--bg); }

table.data { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 680px; font-size: 14px; }
table.data th { text-align: left; padding: 12px 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
table.data td { padding: 10px; border-top: 1px solid #F0EEE9; vertical-align: middle; }
table.data tr.selected td { background: var(--selected); }
table.data tr.selected td:first-child { border-radius: 16px 0 0 16px; }
table.data tr.selected td:last-child { border-radius: 0 16px 16px 0; }
.user-cell { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.user-cell:hover .strong { text-decoration: underline; }
.stack-tight { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.status { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.status.ok { background: #DDF0E2; color: #155E2C; }
.status.warn { background: #FCE9C8; color: #7A4B00; }
.status.off { background: var(--bg); color: var(--muted); }

.list-column { flex: 1 1 300px; display: flex; flex-direction: column; gap: 10px; }
.editor-column { flex: 999 1 560px; min-width: 0; }
.detail-panel.wide { flex: 1 1 540px; position: static; }
.list-card {
    display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--r-l);
    background: var(--surface); text-decoration: none; border: 2px solid transparent;
}
.list-card.selected { border-color: var(--ink); }
.list-card.dark { background: var(--ink); color: var(--surface); }
.site-card { flex-direction: row; align-items: center; gap: 14px; }
.site-card-code { font-weight: 700; font-size: 26px; width: 76px; flex: none; }
.list-card.dark .site-card-code { color: var(--accent); }

.grant-matrix { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 480px; font-size: 14px; }
.grant-matrix th { text-align: left; padding: 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.grant-matrix th[scope="row"] { font-size: 14px; color: var(--ink); font-weight: 400; }
.grant-matrix td, .grant-matrix th[scope="row"] { border-top: 1px solid #F0EEE9; }
.grant-matrix td { padding: 8px 10px; }
.role-select {
    height: 38px; padding: 0 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
    font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 120px; cursor: pointer;
}
.role-select.role-read { border-color: var(--ink); color: var(--ink); }
.role-select.role-edit { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.role-select:disabled { cursor: default; }
.na { color: var(--on-dark-muted); font-weight: 700; padding-left: 10px; }

.access-summary { display: flex; flex-direction: column; gap: 8px; }
.access-row { display: flex; align-items: flex-start; gap: 10px; }
.site-badge { font-weight: 700; padding: 3px 10px; border-radius: 8px; background: var(--ink); color: var(--surface); flex: none; }
.module-chip.light { background: var(--bg); }

.member-list { display: flex; flex-wrap: wrap; gap: 8px; }
.member { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--bg); text-decoration: none; font-size: 13px; font-weight: 600; }

.module-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.module-toggle {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px;
    border: 1.5px solid var(--line); cursor: pointer;
}
.module-toggle.on { border-color: var(--ink); }
.module-toggle .stack-tight { flex: 1; }
.module-toggle input { appearance: none; width: 48px; height: 28px; border-radius: 99px; background: #CFCBC2; position: relative; cursor: pointer; margin: 0; flex: none; }
.module-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.module-toggle input:checked { background: var(--ink); }
.module-toggle input:checked::after { transform: translateX(20px); }

/* ---------- Site settings ---------- */

.settings { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.settings-side { flex: 1 1 240px; display: flex; flex-direction: column; gap: 6px; }
.settings-side .site-code { font-size: 56px; margin-top: 8px; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; }
.settings-nav a { padding: 12px 16px; border-radius: 16px; text-decoration: none; font-weight: 500; }
.settings-nav a:hover { background: var(--surface); }
.settings-main { flex: 999 1 600px; min-width: 0; }
.settings-main .page-head { margin-bottom: 0; }
.fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.choice { display: flex; gap: 12px; padding: 16px; border-radius: var(--r-l); border: 2px solid var(--line); cursor: pointer; }
.choice.on { border-color: var(--ink); }
.choice input { width: 20px; height: 20px; accent-color: var(--ink); margin: 2px 0 0; flex: none; }
.choice-example { font-weight: 700; font-size: 22px; }

/* ---------- Baggage ---------- */

.reply {
    display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap;
}
.reply-ok { background: #DDF0E2; color: #155E2C; }
.reply-attention { background: #FBE3E0; color: #8A1A12; }
.bag-tag { letter-spacing: .02em; }
.exception-chip {
    display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
    background: #FCE9C8; color: #7A4B00; white-space: nowrap; vertical-align: middle;
}
.card-main .exception-chip { margin-left: 0; margin-top: 4px; }
.route-light { color: var(--muted); }
.route-light .route-chip { background: var(--bg); color: var(--ink); }
.route-light .route-chip.here { background: var(--ink); color: var(--surface); }
.leg-flight { font-size: 12px; font-weight: 700; padding: 0 2px; }
.leg-flight::before { content: "› "; } .leg-flight::after { content: " ›"; }
.issue-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--late); margin-left: 8px; vertical-align: middle; }
.card-tag { display: flex; align-items: center; font-size: 17px; }
.card-times .reply { margin-top: 4px; }
.list-note { margin-top: 10px; padding: 0 6px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.stat.stage { flex: 1 1 120px; }
.stat.stage .stat-num { font-size: 36px; }

.detail-page.wide { max-width: 760px; }
.kv-inline { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.kv-inline > span { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.on-dark-link { color: var(--surface); }

.timeline { list-style: none; margin: 14px 0 0; padding: 0; }
.timeline-item {
    display: grid; grid-template-columns: 92px 20px minmax(0, 1fr); gap: 0 10px; position: relative; padding-bottom: 16px;
}
.timeline-item::before {
    content: ""; position: absolute; left: 111px; top: 14px; bottom: 0; width: 2px; background: var(--line);
}
.timeline-item.last::before { display: none; }
.timeline-time { font-size: 13px; font-weight: 700; display: flex; flex-direction: column; padding-top: 2px; }
.timeline-gap { font-size: 11px; font-weight: 400; color: var(--muted); }
.timeline-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); margin-top: 4px; position: relative; z-index: 1; }
.timeline-item.attention .timeline-dot { background: var(--late); }
.timeline-item.last .timeline-dot { box-shadow: 0 0 0 4px var(--accent-soft); background: var(--accent); }
.timeline-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.scan-box {
    position: relative; border-radius: var(--r-xl); overflow: hidden; background: var(--ink); aspect-ratio: 4 / 3;
}
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame {
    position: absolute; left: 10%; right: 10%; top: 35%; height: 30%; border: 3px solid var(--accent); border-radius: 16px;
    box-shadow: 0 0 0 999px rgba(22, 22, 22, .35);
}
.scan-hint { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: var(--surface); font-weight: 600; font-size: 14px; }

.bottom-nav { display: none; }

/* ---------- Monitoring & charts ---------- */

.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.monitoring { display: flex; flex-direction: column; gap: 32px; transition: opacity .2s; }
.monitoring.refreshing { opacity: .55; }
.mon-section { display: flex; flex-direction: column; gap: 12px; }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.subsection-title { font-size: 16px; font-weight: 600; margin-top: 4px; }
.mon-section .tiles { margin-bottom: 0; }
.mon-section > .table-panel { flex: none; }
table.data th[scope="row"] { text-transform: none; letter-spacing: normal; font-size: 13px; color: var(--ink); font-weight: 600; }
.stat-tile { flex: 1 1 150px; display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-weight: 600; font-size: 14px; }
.stat-value { font-size: 40px; font-weight: 600; line-height: 1.05; letter-spacing: -0.03em; }
.stat-detail { font-size: 13px; color: var(--muted); }
.stat-tile.dark .stat-detail { color: var(--on-dark-muted); }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.chart-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chart { margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chart-head { display: flex; flex-direction: column; gap: 2px; }
.chart-title { font-weight: 600; font-size: 15px; }
.chart-sub { font-size: 12px; color: var(--muted); }
.chart-empty { font-size: 13px; color: var(--muted); padding: 8px 0; }

.barlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.barlist-row { display: grid; grid-template-columns: minmax(70px, 30%) minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13px; }
.barlist-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barlist-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.barlist-bar { height: 16px; border-radius: 0 4px 4px 0; background: #2a78d6; flex: none; }
.barlist-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

.plot { position: relative; margin-left: 44px; }
.grid-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid #ECEAE4; }
.grid-line .tick { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.columns { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; }
.col-hit {
    all: unset; flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; cursor: default;
    height: 100%; box-sizing: border-box;
}
.col-hit:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.col { width: 100%; max-width: 24px; background: #2a78d6; border-radius: 4px 4px 0 0; transition: filter .1s; }
.col-hit.hover .col { filter: brightness(1.2); }
.columns.hit-only .col-hit { cursor: crosshair; }
.lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.end-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; transform: translate(-50%, 50%); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.crosshair { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink); opacity: .35; pointer-events: none; }
.tooltip {
    position: absolute; top: -6px; transform: translate(-50%, -100%); z-index: 5; pointer-events: none;
    display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--ink); color: var(--surface);
    white-space: nowrap; box-shadow: 0 6px 18px rgba(22, 22, 22, .25);
}
.tooltip-row { display: flex; align-items: center; gap: 6px; }
.tooltip-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.tooltip-label { font-size: 12px; color: var(--on-dark-muted); }
.x-axis { display: flex; justify-content: space-between; margin-left: 44px; font-size: 11px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { display: inline-block; width: 14px; height: 2px; border-radius: 1px; }
.chart-table summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.chart-table .table-scroll { max-height: 220px; overflow: auto; margin-top: 6px; }
table.data.compact { min-width: 0; font-size: 13px; }
table.data.compact th, table.data.compact td { padding: 6px 8px; }
table.data .num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.method { font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--bg); }
.alert-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid #F0EEE9; }

/* ---------- Chute status heatmap ---------- */

.swatch {
    display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c, transparent);
    box-shadow: inset 0 0 0 1px rgba(22, 22, 22, .12);
}
.swatch.lg { width: 22px; height: 22px; border-radius: 7px; }
.hatched, .swatch.hatched, .run.hatched {
    background: repeating-linear-gradient(135deg, #5E5B55 0 1.5px, #E3E0D8 1.5px 5px);
    box-shadow: inset 0 0 0 1px #8C8A84;
}

.chute-now { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.chute-total { flex: 0 1 170px; padding: 16px 20px; }
.status-tile {
    flex: 1 1 130px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-l);
    background: var(--surface);
}
.status-tile.zero { opacity: .55; }
.status-count { font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.chute-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }

.chute-heat { display: flex; flex-direction: column; gap: 12px; transition: opacity .2s; }
.chute-heat.refreshing { opacity: .55; }
.chute-group { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.chute-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.chute-grid { --label-w: 104px; display: flex; flex-direction: column; gap: 4px; }
.chute-axis, .chute-row { display: flex; align-items: center; gap: 10px; }
.chute-label {
    flex: none; width: var(--label-w); display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700;
    white-space: nowrap;
}
.chute-track { position: relative; flex: 1 1 auto; min-width: 0; height: 16px; border-radius: 5px; background: var(--bg); }
.chute-track.axis { height: 16px; background: none; }
.axis-tick {
    position: absolute; bottom: 0; transform: translateX(-50%); font-family: var(--font-mono); font-size: 11px; color: var(--muted);
    white-space: nowrap;
}
.chute-rows { position: relative; display: flex; flex-direction: column; gap: 3px; }
.chute-lines { position: absolute; top: 0; bottom: 0; left: calc(var(--label-w) + 10px); right: 0; pointer-events: none; z-index: 1; }
.chute-lines span { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(22, 22, 22, .16); }
.chute-row:hover .chute-label { color: var(--accent); }
.run { position: absolute; top: 0; bottom: 0; background: var(--c); outline: none; }
.run:first-child { border-top-left-radius: 5px; border-bottom-left-radius: 5px; }
.run:last-child { border-top-right-radius: 5px; border-bottom-right-radius: 5px; }
.run:hover, .run:focus { z-index: 3; box-shadow: 0 0 0 2px var(--ink); }
.run-tip {
    display: none; position: absolute; bottom: calc(100% + 8px); z-index: 4; pointer-events: none;
    flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--ink); color: var(--surface);
    white-space: nowrap; box-shadow: 0 6px 18px rgba(22, 22, 22, .25); font-size: 13px;
}
.run.tip-l .run-tip { left: 0; }
.run.tip-r .run-tip { right: 0; }
.run:hover .run-tip, .run:focus .run-tip { display: flex; }
.run-tip .swatch { box-shadow: 0 0 0 1px rgba(255, 255, 255, .4); }

.link-button { all: unset; cursor: pointer; color: var(--muted); text-decoration: underline; }
.link-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 0; border-top: 1px solid #F0EEE9; }
.status-row:first-child { border-top: 0; }
.status-row.needs .status-name .strong { color: var(--late); }
.status-name { flex: 1 1 160px; }
.panel-head > .stack-tight { flex: 1 1 280px; }
.status-actions { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.color-input {
    width: 48px; height: 36px; padding: 2px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface);
    cursor: pointer;
}
.rank {
    flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg); font-size: 12px; font-weight: 700;
}
.alert-after { display: inline-flex; align-items: center; gap: 6px; }
.alert-after .input-num { width: 76px; height: 40px; padding: 0 10px; }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.add-chip { border: 1.5px dashed #B5B1A8; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; padding: 6px 12px; }
.add-chip .small { color: var(--muted); font-size: 11px; }

/* ---------- Site home ---------- */

.site-home { display: flex; flex-direction: column; gap: 14px; }
.site-hero { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; padding: 26px 28px; }
.site-hero .site-code { font-size: 72px; line-height: .85; }
.site-hero-name { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.module-tile {
    position: relative; display: flex; flex-direction: column; gap: 18px; min-height: 168px; padding: 22px;
    text-decoration: none; border: 2px solid transparent; transition: border-color .15s, transform .15s;
}
.module-tile:hover { border-color: var(--ink); }
.module-tile:active { transform: scale(.98); }
.module-tile-icon {
    width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--ink); color: var(--surface);
}
.module-tile:hover .module-tile-icon { background: var(--accent); color: var(--on-accent); }
.module-tile-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.module-tile-role { position: absolute; top: 18px; right: 18px; }

/* ---------- Day picker ---------- */

.day-choose { position: relative; display: inline-flex; }
.day-button {
    all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
    border-radius: 99px; white-space: nowrap;
}
.day-button:hover { background: var(--bg); }
.day-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Kept rendered (the browser anchors its calendar here) but invisible. */
.day-input { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }

/* ---------- Journal ---------- */

:root {
    --prio-high: #C8261B;
    --prio-medium: #FAB219;
    --prio-normal: #8C8A84;
    --prio-info: #2A78D6;
}
.chip.prio-high { background: var(--prio-high); border-color: var(--prio-high); color: #FFFFFF; }
.chip.prio-medium { background: var(--prio-medium); border-color: var(--prio-medium); color: var(--ink); }
.chip.prio-normal { background: var(--surface); border-color: var(--line); color: var(--ink); }
.chip.prio-info { background: #DCEBFA; border-color: #DCEBFA; color: #1B5DA8; }
.prio-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.prio-dot.prio-high { background: var(--prio-high); }
.prio-dot.prio-medium { background: var(--prio-medium); }
.prio-dot.prio-normal { background: var(--prio-normal); }
.prio-dot.prio-info { background: var(--prio-info); }

.journal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.journal-row {
    display: flex; gap: 16px; padding: 14px 18px 14px 14px; border-radius: var(--r-l); background: var(--surface);
    text-decoration: none; border-left: 6px solid var(--prio-normal);
}
.journal-row:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.journal-row.prio-high { border-left-color: var(--prio-high); }
.journal-row.prio-medium { border-left-color: var(--prio-medium); }
.journal-row.prio-info { border-left-color: var(--prio-info); }
.journal-when { flex: none; width: 76px; display: flex; flex-direction: column; gap: 2px; }
.journal-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.journal-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.journal-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journal-text { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.journal-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.source-icon { display: inline-flex; }

.journal-hero { display: flex; flex-direction: column; gap: 12px; border-left: 8px solid var(--prio-normal); }
.journal-hero.prio-high { border-left-color: var(--prio-high); }
.journal-hero.prio-medium { border-left-color: var(--prio-medium); }
.journal-hero.prio-info { border-left-color: var(--prio-info); }
.journal-hero-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.journal-hero-title { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.journal-description { white-space: pre-wrap; line-height: 1.5; overflow-wrap: anywhere; }
.journal-hero-time { font-size: 17px; font-weight: 700; }
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-m); background: var(--bg); text-decoration: none; min-width: 0; }
.doc-row:hover { box-shadow: inset 0 0 0 2px var(--ink); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.media-item { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.media-item img, .media-item video {
    display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-m); background: var(--bg);
}
.media-item figcaption { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.media-add { border-top: 1px solid #F0EEE9; padding-top: 14px; }

.media-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.media-pick { cursor: pointer; }
.media-pick.disabled { opacity: .5; cursor: default; }
.media-files { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; }
.media-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-m); background: var(--bg); }
.media-file.bad { background: #FBE3E0; }
.media-file.done { background: #DDF0E2; }
.media-file-kind { width: 28px; height: 28px; border-radius: 8px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.media-file-text { flex: 1 1 auto; min-width: 0; }
.media-bar { display: block; height: 4px; border-radius: 2px; background: var(--surface); overflow: hidden; }
.media-bar span { display: block; height: 100%; background: var(--accent); transition: width .2s; }

.field-legend { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; padding: 0; }
.prio-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.prio-choice {
    display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: var(--r-m); border: 2px solid var(--line);
    cursor: pointer; background: var(--surface);
}
.prio-choice input { position: absolute; opacity: 0; pointer-events: none; }
.prio-choice.on { border-color: var(--ink); }
.prio-choice.on.prio-high { border-color: var(--prio-high); background: #FBE3E0; }
.prio-choice.on.prio-medium { border-color: var(--prio-medium); background: #FEF2D6; }
.prio-choice.on.prio-info { border-color: var(--prio-info); background: #DCEBFA; }
.prio-choice:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.textarea { height: auto; padding: 12px 16px; resize: vertical; line-height: 1.45; }


.uploader-keys { border-top: 1px solid #F0EEE9; padding-top: 16px; }
.key-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.key-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid #F0EEE9; }
.key-row:first-child { border-top: 0; }
.key-row.revoked { opacity: .55; }
.key-secret { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: var(--r-m); background: var(--selected); }
.key-secret code { font-size: 13px; overflow-wrap: anywhere; padding: 8px 10px; border-radius: 10px; background: var(--surface); }

/* ---------- Admin: airports ---------- */

.airport-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.airport-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid #F0EEE9; }
.airport-row:first-child { border-top: 0; }
.airport-row .input { flex: 1 1 auto; height: 40px; }
.airport-code { width: 44px; flex: none; }
.airport-add .input-num { width: 90px; text-transform: uppercase; }

/* ---------- Maintenance & journal calendar ---------- */

:root { --maint: #6E4BC2; --maint-soft: #ECE6FA; }
.chip.maint-chip { background: var(--maint-soft); border-color: var(--maint-soft); color: #4B2E9E; }
.prio-dot.maint { background: var(--maint); }
.journal-row.maint { border-left-color: var(--maint); }
.journal-row.task-row.cancelled .journal-title { text-decoration: line-through; color: var(--muted); }
.chip.task-status.st-planned { background: var(--surface); border-color: var(--line); color: var(--ink); }
.chip.task-status.st-progress { background: #DCEBFA; border-color: #DCEBFA; color: #1B5DA8; }
.chip.task-status.st-done { background: #DDF0E2; border-color: #DDF0E2; color: #155E2C; }
.chip.task-status.st-cancelled { background: var(--surface); border-color: var(--line); color: var(--muted); text-decoration: line-through; }
.chip.my-chip { background: var(--selected); border-color: var(--accent-soft); color: var(--ink); font-size: 11px; }
.task-hero { border-left-color: var(--maint); }
.task-hero.st-done { border-left-color: #2E9E54; }
.task-hero.st-cancelled { border-left-color: var(--muted); }
.task-actions { margin: -2px 0; }
.select-sm { height: 40px; width: auto; min-width: 160px; padding: 0 12px; border-radius: 99px; background: var(--surface); }
.period-label { padding: 0 6px; white-space: nowrap; }

.people-search { max-width: 360px; margin-bottom: 8px; }
.people-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.person { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-m); border: 2px solid var(--line); cursor: pointer; }
.person.on { border-color: var(--ink); background: var(--bg); }
.person input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.person:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

.assignee-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.assignee { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip.assignee-status.as-assigned { background: var(--surface); border-color: var(--line); color: var(--muted); }
.chip.assignee-status.as-accepted { background: #DCEBFA; border-color: #DCEBFA; color: #1B5DA8; }
.chip.assignee-status.as-done { background: #DDF0E2; border-color: #DDF0E2; color: #155E2C; }

.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity-item { position: relative; display: flex; gap: 12px; padding: 0 0 16px 0; }
.activity-item::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.activity-item:last-child::before { display: none; }
.activity-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; margin-top: 3px; background: var(--line); box-shadow: 0 0 0 3px var(--surface); }
.activity-item.note .activity-dot { background: var(--ink); }
.activity-item.ev-accepted .activity-dot { background: var(--prio-info); }
.activity-item.ev-finished .activity-dot { background: #2E9E54; }
.activity-item.ev-cancelled .activity-dot { background: var(--muted); }
.activity-item.event .journal-description { color: var(--muted); }
.activity-body { min-width: 0; flex: 1 1 auto; }
.note-form { border-top: 1px solid #F0EEE9; padding-top: 14px; }

.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; }
.cal-panel { padding: 14px; }
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 0 2px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-day { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 108px; padding: 6px; border-radius: 12px; background: var(--bg); border: 2px solid transparent; }
.cal-week .cal-day { min-height: 340px; }
.cal-day.outside { opacity: .45; }
.cal-day.today .cal-date .strong { background: var(--accent); color: var(--on-accent); border-radius: 99px; padding: 0 7px; }
.cal-day.selected { border-color: var(--ink); background: var(--surface); }
.cal-date { display: flex; align-items: center; gap: 6px; text-decoration: none; padding: 2px; border-radius: 8px; }
.cal-date:hover { background: var(--surface); }
.cal-dow { display: none; font-size: 12px; color: var(--muted); }
.cal-count { margin-left: auto; font-size: 11px; color: var(--muted); }
.cal-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-item {
    display: flex; gap: 5px; align-items: baseline; min-width: 0; padding: 3px 6px; border-radius: 6px; font-size: 12px; text-decoration: none;
    background: var(--surface); border-left: 3px solid var(--prio-normal);
}
.cal-item:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cal-item.prio-high { border-left-color: var(--prio-high); }
.cal-item.prio-medium { border-left-color: var(--prio-medium); }
.cal-item.prio-info { border-left-color: var(--prio-info); }
.cal-item.maint { border-left-color: var(--maint); background: var(--maint-soft); }
.cal-item-time { flex: none; font-size: 11px; color: var(--muted); }
.cal-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cal-week .cal-item { flex-direction: column; gap: 0; }
.cal-week .cal-item-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cal-more { color: var(--muted); text-decoration: none; padding-left: 6px; }
.cal-detail .section-title { margin-bottom: 4px; }
.cal-detail .journal-row { flex-direction: column; gap: 6px; }
.cal-detail .journal-when { width: auto; flex-direction: row; gap: 8px; align-items: baseline; }

@media (max-width: 1100px) {
    .cal-layout { grid-template-columns: minmax(0, 1fr); }
}

/* Phone overrides for the sections above (kept last so they win). */
@media (min-width: 861px) and (max-width: 1200px) {
    .chart-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .brand-long { display: none; }
    .chart-grid, .chart-grid.four { grid-template-columns: minmax(0, 1fr); }
    .stat-value { font-size: 32px; }
    .topbar .pill-nav:has(+ .topbar-end) { display: none; }
    .bottom-nav {
        display: flex; position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
        z-index: 20; gap: 2px; padding: 6px; border-radius: 99px; background: var(--ink); box-shadow: 0 10px 28px rgba(22, 22, 22, .3);
    }
    .bottom-nav a {
        display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 62px; padding: 6px 8px; border-radius: 99px;
        color: var(--surface); text-decoration: none; font-size: 11px; font-weight: 600;
    }
    .bottom-nav a.active { background: var(--surface); color: var(--ink); }
    .app:has(.bottom-nav) .page { padding-bottom: 96px; }
    .timeline-item { grid-template-columns: 70px 18px minmax(0, 1fr); gap: 0 8px; }
    .timeline-item::before { left: 85px; }
    .topbar .pill { padding: 0 12px; font-size: 14px; }
    .topbar .avatar { width: 40px; height: 40px; }
    .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); }
    .form-grid .span-2 { grid-column: auto; }
    .login-hero { min-height: 180px; padding: 22px; }
    .login-form { padding: 22px; }
    .settings-side .site-code { font-size: 44px; }
    .chute-grid { --label-w: 70px; }
    .chute-label { gap: 5px; font-size: 11px; }
    .chute-label .swatch { width: 8px; height: 8px; }
    .chute-group { padding: 14px; }
    .chute-now { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .chute-total { padding: 10px 12px; border-radius: var(--r-l); gap: 0; }
    .chute-total .stat-value { font-size: 22px; }
    .chute-total .stat-label, .chute-total .stat-detail { font-size: 12px; }
    .status-tile { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; }
    .status-tile .swatch.lg { width: 14px; height: 14px; border-radius: 4px; }
    .status-tile .small { font-size: 12px; }
    .status-count { font-size: 22px; }
    .bottom-nav a { min-width: 50px; padding: 6px 5px; }
    .site-hero { padding: 22px; }
    .site-hero .site-code { font-size: 56px; }
    .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .module-tile { min-height: 0; gap: 12px; padding: 16px; }
    .module-tile-icon { width: 44px; height: 44px; border-radius: 14px; }
    .module-tile-name { font-size: 18px; }
    .module-tile .small { font-size: 12px; }
    .module-tile-role { top: 14px; right: 12px; }
    /* Long filter bars scroll sideways instead of widening the page. */
    .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
    .seg a { flex: none; }
    .journal-row { flex-direction: column; gap: 6px; padding: 12px 14px 12px 12px; }
    .journal-when { width: auto; flex-direction: row; gap: 8px; align-items: baseline; }
    .journal-hero-title { font-size: 24px; }
    .prio-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    /* Calendar on phones: month cells show the day and a count; the week becomes a list of days. */
    .cal-panel { padding: 8px; }
    .cal-month .cal-grid, .cal-month .cal-head { gap: 3px; }
    .cal-month .cal-day { min-height: 54px; padding: 4px; }
    .cal-month .cal-items { display: none; }
    .cal-month .cal-count { margin: 0; width: 100%; text-align: center; font-weight: 700; color: var(--maint); }
    .cal-month .cal-date { flex-direction: column; gap: 2px; }
    .cal-week .cal-head { display: none; }
    .cal-week .cal-grid { grid-template-columns: minmax(0, 1fr); }
    .cal-week .cal-day { min-height: 0; }
    .cal-week .cal-dow { display: inline; }
    .select-sm { min-width: 0; flex: 1 1 140px; }

}

/* ---------- Alarms ---------- */

:root {
    --sev-error: #C8261B;
    --sev-warning: #FAB219;
    --sev-info: #2A78D6;
    --sev-command: #5E5B55;
}
.chip.sev { min-width: 74px; text-align: center; }
.chip.sev-error { background: var(--sev-error); border-color: var(--sev-error); color: #FFFFFF; }
.chip.sev-warning { background: var(--sev-warning); border-color: var(--sev-warning); color: var(--ink); }
.chip.sev-info { background: #DCEBFA; border-color: #DCEBFA; color: #1B5DA8; }
.chip.sev-command { background: var(--bg); border-color: var(--line); color: var(--ink); }
.sev-mark { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sev-mark.lg { width: 22px; height: 22px; border-radius: 7px; }
.sev-mark.sev-error { background: var(--sev-error); }
.sev-mark.sev-warning { background: var(--sev-warning); }
.sev-mark.sev-info { background: var(--sev-info); }
.sev-mark.sev-command { background: var(--sev-command); }

.alarm-now { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.alarm-total { flex: 0 1 190px; padding: 16px 20px; }
.alarm-tile { text-decoration: none; }
.alarm-tile:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.alarm-filters { margin-bottom: 12px; }
.alarm-filters .select-sm { height: 48px; border-radius: 99px; padding: 0 16px; }
.active-filters { gap: 8px; margin-bottom: 12px; }
.filter-chip { background: var(--ink); color: var(--surface); text-decoration: none; font-size: 13px; padding: 6px 12px; }
.filter-chip:hover { background: var(--dark-2); }

.alarm-split { transition: opacity .2s; }
.alarm-split.refreshing { opacity: .55; }
.alarm-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.alarm-main .table-panel { flex: none; }
.alarm-count { padding-left: 6px; }
.alarm-side { flex: 1 1 260px; min-width: 0; position: sticky; top: 16px; }
table.data.alarms { min-width: 1040px; font-size: 13.5px; }
table.data.alarms tr.active-alarm td { background: #FFF7F4; }
.alarm-link { text-decoration: none; }
.alarm-link:hover { text-decoration: underline; }
.chip.alarm-active-chip { background: var(--surface); border-color: var(--late); color: var(--late); font-family: var(--font); font-size: 11px; padding: 2px 8px; }
.ack { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ack.yes { color: #155E2C; }
.ack.no { color: var(--late); }

.facet-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.facet {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 12px;
    text-decoration: none; font-size: 14px; min-height: 40px;
}
.facet:hover { background: var(--bg); }
.facet.on { background: var(--ink); color: var(--surface); }
.facet-count { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.facet.on .facet-count { color: var(--on-dark-muted); }

.alarm-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alarm-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--r-l); background: var(--surface); }
.alarm-card.active-alarm { box-shadow: inset 3px 0 0 var(--late); }
.alarm-card-text { font-weight: 600; }
.alarm-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }

@media (max-width: 860px) {
    .alarm-side { position: static; order: -1; flex-basis: 100%; }
    .alarm-filters .seg { overflow-x: auto; }
    .alarm-filters .select-sm { width: 100%; }
}
@media (max-width: 860px) {
    /* On phones the shortcuts sit above the list as compact chips. */
    .alarm-side { flex-direction: row; flex-wrap: wrap; gap: 8px; }
    .alarm-side > .panel { flex: 1 1 100%; padding: 14px 16px; }
    .alarm-side .facet-list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .alarm-side .facet { min-height: 36px; padding: 6px 10px; background: var(--bg); font-size: 13px; }
    .alarm-side .facet.on { background: var(--ink); }
}
@media (max-width: 860px) {
    .alarm-now { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
    .alarm-total { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 10px; padding: 12px 16px; }
    .alarm-total .stat-value { font-size: 28px; }
    .alarm-tile { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; }
    .alarm-tile .sev-mark.lg { width: 12px; height: 12px; border-radius: 4px; }
    .alarm-tile .status-count { font-size: 22px; }
    .alarm-tile .small { font-size: 11px; }
}

/* ---------- Dashboard ---------- */

.dashboard { display: flex; flex-direction: column; gap: 12px; transition: opacity .2s; }
.dashboard.refreshing { opacity: .55; }
.dash-tiles { margin-bottom: 0; }
.dash-tiles .stat-tile { flex: 1 1 200px; }
.dash-problems { text-decoration: none; }
.dash-problems.has-problems { box-shadow: inset 0 0 0 2px var(--sev-error); }
.dash-problems:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.dash-chart-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.induction-seg { max-width: 100%; overflow-x: auto; background: var(--bg); }
.induction-seg a { white-space: nowrap; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; }
.special-dest { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid #F0EEE9; display: flex; flex-direction: column; gap: 4px; }

.problem-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.problem-group { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--r-l); background: var(--bg); }
.problem-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.problem-count { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.problem-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.problem { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 10px; text-decoration: none; font-size: 13px; min-width: 0; }
a.problem[href]:hover { background: var(--surface); }
.problem .mono { white-space: nowrap; flex: none; }
.problem-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); min-width: 0; }

@media (max-width: 860px) {
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
    .dash-tiles .stat-tile { flex-basis: calc(50% - 6px); padding: 14px 16px; }
    .dash-tiles .stat-value { font-size: 30px; }
    .page-head .seg.push { margin-left: 0; }
}

/* ---------- Devices & manuals ---------- */

.scan-box.qr { aspect-ratio: 1 / 1; max-height: 60vh; }
.scan-box.qr .scan-frame { left: 18%; right: 18%; top: 18%; height: 64%; }
.product-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.product-row { border-radius: var(--r-m); background: var(--bg); }
.product-row > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none;
}
.product-row > summary::-webkit-details-marker { display: none; }
.product-row[open] > summary { border-bottom: 1px solid var(--line); }
.product-row .manual-list { padding: 10px; }
.product-row .doc-row { background: var(--surface); }
.chip.manual-count { background: var(--surface); border-color: var(--line); color: var(--ink); }
.manual-text { flex: 1; min-width: 0; }
.manual-item { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.manual-item .doc-row { flex: 1 1 260px; }
.keep-offline {
    flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; min-height: 44px; border-radius: var(--r-m);
    border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
}
.keep-offline:hover { border-color: var(--ink); }
.keep-offline.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
@media (max-width: 520px) { .keep-offline { margin-left: auto; min-height: 40px; } }
.manual-text .small { overflow-wrap: anywhere; }
.media-file-kind { font-size: 9px; font-weight: 700; }

.device-hero { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.chip.device-type { align-self: flex-start; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.device-code { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; overflow-wrap: anywhere; }
.device-full { overflow-wrap: anywhere; }
.device-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.device-action { display: flex; flex-direction: column; gap: 6px; text-decoration: none; min-height: 120px; padding: 18px; }
a.device-action:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.device-action.off { opacity: .55; }
.device-action .small { overflow-wrap: anywhere; }
.product-pick {
    all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 14px; border-radius: var(--r-m); background: var(--bg); cursor: pointer;
}
.product-pick:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.product-pick.on { background: var(--ink); color: var(--surface); }
.product-pick.on .muted { color: var(--on-dark-muted); }
.product-pick:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.manual-add { padding-top: 10px; border-top: 1px solid #F0EEE9; }

/* Ten module pills: tighter pills on mid-size screens so the account menu stays on the first row. */
@media (min-width: 861px) and (max-width: 1480px) {
    .topbar .pill-nav .pill { padding: 0 11px; font-size: 14px; }
    .brand { margin-right: 0; }
}
@media (min-width: 861px) and (max-width: 1180px) {
    .topbar .pill-nav { max-width: 100%; overflow-x: auto; }
}
/* A search box in a column (form, panel) must not take its row width (flex-basis) as its height. */
.search { max-height: 48px; }
.search-sm { max-height: 40px; }

/* ---------- Document viewer ---------- */

.viewer { max-width: 920px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.viewer-bar {
    position: sticky; top: 8px; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 6px;
    border-radius: 99px; background: var(--surface); box-shadow: 0 4px 16px rgba(22, 22, 22, .12);
}
.viewer-back { background: var(--ink); color: var(--surface); flex: none; }
.viewer-title { flex: 1; min-width: 0; }
.viewer-download { flex: none; }
.pdf-pages { display: flex; flex-direction: column; gap: 10px; }
.pdf-page { width: 100%; background: var(--surface); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 4px rgba(22, 22, 22, .12); }
.pdf-page canvas { display: block; width: 100%; height: auto; }
.viewer-image, .viewer-video { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: var(--r-m); background: var(--ink); }
.viewer-loading { padding: 12px; }

/* Account chip: the user's full name next to the initials. */
.account-chip { padding: 0 12px 0 5px; gap: 8px; }
.account-chip .avatar.sm { width: 34px; height: 34px; background: var(--ink); color: var(--surface); }
.account-name { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
@media (max-width: 860px) {
    .account-name { max-width: 110px; font-size: 14px; }
}
@media (max-width: 380px) {
    .account-name { display: none; }
}

/* Bag scope (which bags count for a flight) */
.scope-row { gap: 10px 16px; }
.scope-row .small { max-width: 640px; }
.scope-cell { display: inline-flex; align-items: center; gap: 8px; }
.chip.scope-chip { background: var(--bg); border-color: var(--line); color: var(--ink); font-weight: 600; }
.chip.scope-chip.hot { background: #FDE7D5; border-color: #F5B98B; color: #8A3B0C; }
.scope-card-note { display: flex; padding: 0 6px; margin-bottom: -4px; }

/* Flights: bags per departure and the "bags at risk" filter */
.bag-cell { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.bag-cell.risk .strong { color: var(--late); }
.attention-pill { background: var(--surface); }
.attention-pill.warn { color: var(--late); }
.attention-pill.on { background: var(--late); color: #FFFFFF; }
.attention-note { margin: -4px 0 14px; padding: 10px 14px; border-radius: var(--r-m); background: #FBE4E7; color: var(--ink); font-size: 14px; }

/* Banner notifications */
.notif-bell { position: relative; width: 44px; padding: 0; justify-content: center; }
.notif-bell.urgent { color: var(--accent); }
.notif-count {
    position: absolute; top: -4px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: 99px;
    background: var(--ink); color: var(--surface); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.notif-bell.urgent .notif-count { background: var(--accent); color: var(--on-accent); }
.notif-list { min-width: 320px; max-width: min(400px, calc(100vw - 28px)); }
.notif-item { align-items: flex-start; }
.notif-icon {
    flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--bg); display: inline-flex; align-items: center; justify-content: center;
}
.notif-item.urgent .notif-icon { background: var(--accent); color: var(--on-accent); }
.notif-text { min-width: 0; }
@media (max-width: 860px) {
    .notif-menu .menu-list { position: fixed; left: 14px; right: 14px; top: 72px; max-width: none; }
}

/* Site configuration › Chutes */
.chute-config-head { align-items: flex-start; }
.chute-config-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.file-button { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.file-button:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.import-preview { padding: 14px 16px; border-radius: var(--r-m); background: var(--selected); }
.import-errors { margin: 0; padding-left: 18px; }
.chute-table { min-width: 760px; }
.chute-table .input-sm { height: 36px; padding: 0 10px; font-size: 13px; width: 100%; box-sizing: border-box; border-radius: 10px; }
.chute-table select.input-sm { padding-right: 4px; }
.chute-table tr.inactive td { opacity: .55; }
.chute-table .check-input { width: 18px; height: 18px; accent-color: var(--ink); }

/* ---------- Export menu and printing ---------- */

.export-menu .menu-list a, .export-menu .menu-button { flex-direction: column; gap: 2px; }
.export-menu summary { gap: 6px; }

@media (max-width: 700px) {
    .export-menu .export-label { display: none; }
}

/* Print / Save as PDF: the page content only, black on white, tables not cut through rows. */
@media print {
    @page { margin: 12mm; }
    :root { --bg: #FFFFFF; }
    html, body { background: #FFFFFF !important; }
    .topbar, .bottom-nav, .no-print, .search, .notif-menu, button, .btn, .seg, .pill-group .icon-btn, .day-picker .icon-btn { display: none !important; }
    main, .page, .detail-page { padding: 0 !important; max-width: none !important; }
    .panel, .tile { box-shadow: none !important; border: 1px solid #D0CCC3; break-inside: avoid; }
    .tile.dark, .tile.accent { background: #FFFFFF !important; color: #161616 !important; }
    table { font-size: 11px; }
    tr, li { break-inside: avoid; }
    a { color: inherit; text-decoration: none; }
    .table-scroll { overflow: visible !important; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Reports ---------- */

.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.report-card { justify-content: space-between; }
.report-period { display: flex; flex-wrap: wrap; gap: 10px; }
.report-period .field { flex: 1 1 160px; margin: 0; }
.report-actions { flex-wrap: wrap; }
.report-schedule { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.report-schedule .switch-sm { padding-left: 0; }
.report-schedule .input-sm { width: auto; }
.report-files { white-space: nowrap; text-align: right; }
.report-files a + a { margin-left: 12px; }
.report-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
@media (max-width: 520px) {
    .report-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
    .report-kpi { padding: 12px; }
    .report-kpi-value { font-size: 24px; }
}
.report-table { min-width: 560px; }
.report-kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--r-l); background: var(--bg); }
.report-kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.report-kpi.alert .report-kpi-value { color: var(--accent); }
.report-table-title { margin: 6px 0 0; font-size: 16px; }
.report-table td.num, .report-table th.num, table.data th.num, table.data td.num { text-align: right; }

/* ---------- Data from the sites ---------- */

.site-data-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.site-data { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: var(--r-l); background: var(--surface); border: 1.5px solid var(--line); }
.mon-section .site-data { border-color: transparent; }
.site-data.silent { border-color: var(--late); }
.site-data-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.site-data-feeds th { font-weight: 600; text-align: left; }
.site-data-feeds td.when { white-space: nowrap; text-align: right; }
.data-chip { border: 0; }
.data-chip.ok { background: var(--bg); color: var(--ink); }
.data-chip.ok::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #0CA30C; margin-right: 6px; }
.data-chip.bad { background: var(--accent); color: var(--on-accent); }
.data-chip.none { background: var(--bg); color: var(--muted); }

/* ---------- Maintenance: checklist, parts, plans, device links ---------- */

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.checklist li { padding: 10px 12px; border-radius: var(--r-m); background: var(--bg); }
.checklist li.done > .check > .stack-tight > span:first-child { text-decoration: line-through; color: var(--muted); }
.part-form { flex-wrap: wrap; }
.part-form .input:first-of-type { flex: 2 1 220px; }
.part-form .input:last-of-type { flex: 1 1 160px; }
.task-device a { color: inherit; }
.device-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.device-history a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r-m); background: var(--bg); text-decoration: none; }
.plan-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.plan-card { display: flex; flex-direction: column; gap: 8px; }
.plan-card.inactive { opacity: .65; }
.plan-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* Language picker in the account menu. */
.menu-languages { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.menu-list .menu-languages a { padding: 6px 10px; border-radius: 99px; font-size: 14px; }
.menu-list .menu-languages a.on { background: var(--ink); color: var(--surface); }

/* ---------- Audit log and data retention ---------- */

.retention-desc { display: block; }
.retention-table td { vertical-align: top; }
.retention-table .input-num { width: 110px; }
.retention-table td:nth-child(2), table.data td.num { white-space: nowrap; }
.retention-runs { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.audit-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.audit-filters .input { width: auto; flex: 0 1 200px; }
.audit-filters .search { flex: 1 1 220px; }
.audit-details { min-width: 260px; overflow-wrap: anywhere; }

/* Language links on the sign-in page. */
.login-languages { display: flex; flex-wrap: wrap; gap: 4px; }
.login-languages a { padding: 6px 10px; border-radius: 99px; font-size: 14px; text-decoration: none; }
.login-languages a:hover { background: var(--bg); }
.login-languages a.on { background: var(--ink); color: var(--surface); }
