/* schs.uk - Monitor design system.
   Custom components + a compatibility layer for the Bootstrap class names
   still used in handler markup, so every page renders in the Monitor theme
   without a CDN framework. */

:root {
    --bg: #f4f7f5;
    --surface: #ffffff;
    --dark: #0d1411;
    --dark-2: #15201a;
    --dark-line: #24352c;
    --ondark: #e8f1ec;
    --ondark-dim: #93a89d;
    --ink: #17221d;
    --muted: #5d6f66;
    --line: #dde6e0;
    /* Brand accent - swap for ltds (#1a73e8), cios (#7c3aed), fhrs (#d97706) */
    --accent: #12915b;
    --accent-bright: #2fd483;
    --accent-deep: #0d7247;
    --accent-wash: #e3f4ec;
    --add: #15803d;
    --add-bg: #e5f5ea;
    --mod: #b45309;
    --mod-bg: #fbf0dc;
    --rem: #b91c1c;
    --rem-bg: #fde9e9;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.55;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }
h5 { font-size: 0.9375rem; }
h6 { font-size: 0.875rem; }
p { margin: 0 0 1rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
code { font-family: var(--mono); font-size: 0.8125em; background: var(--accent-wash); border-radius: 3px; padding: 0.05rem 0.3rem; }

.container { max-width: 74rem; margin: 0 auto; padding: 0 1.25rem; width: 100%; }

/* ---------- Console header ---------- */

.site-console { background: var(--dark); color: var(--ondark); }
.site-console .bar { display: flex; align-items: center; gap: 1.75rem; padding: 0.8rem 1.25rem; max-width: 74rem; margin: 0 auto; }
.brand { font-family: var(--mono); font-size: 1.125rem; font-weight: 700; color: #fff !important; letter-spacing: -0.02em; display: flex; align-items: center; gap: 0.6rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.livedot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent-bright); box-shadow: 0 0 0 0 rgba(47, 212, 131, 0.55); animation: pulse 2.4s infinite; flex-shrink: 0; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(47, 212, 131, 0.55); }
    70% { box-shadow: 0 0 0 0.5rem rgba(47, 212, 131, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 212, 131, 0); }
}
.console-nav { display: flex; align-items: center; gap: 1.4rem; font-size: 0.8125rem; flex: 1; }
.console-nav > a { color: var(--ondark-dim); font-weight: 500; white-space: nowrap; }
.console-nav > a:hover { color: #fff; text-decoration: none; }
.family { display: flex; gap: 0.4rem; font-family: var(--mono); font-size: 0.6875rem; margin-left: auto; }
.family span, .family a { padding: 0.15rem 0.55rem; border: 1px solid var(--dark-line); border-radius: 99px; color: var(--ondark-dim); }
.family .this { border-color: var(--accent); color: var(--accent-bright); }
.family a:hover { color: #fff; text-decoration: none; }
.family .soon { opacity: 0.4; cursor: default; }
.console-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--dark-line); color: var(--ondark); border-radius: 6px; padding: 0.3rem 0.7rem; font: 600 0.8125rem var(--mono); cursor: pointer; }

/* user dropdown in the console */
.console-nav .dropdown { position: relative; }
.console-nav .dropdown-toggle { color: var(--ondark-dim); font-weight: 500; cursor: pointer; }
.console-nav .dropdown-toggle::after { content: " \25BE"; font-size: 0.6875rem; }
.console-nav .dropdown-menu { right: 0; left: auto; }

@media (max-width: 860px) {
    .console-toggle { display: block; }
    .console-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 100; flex-direction: column; align-items: flex-start; gap: 0; background: var(--dark-2); border-bottom: 2px solid var(--accent); padding: 0.5rem 1.25rem 1rem; }
    .console-nav.open { display: flex; }
    .console-nav > a, .console-nav .dropdown { padding: 0.45rem 0; }
    .site-console { position: relative; }
    .family { display: none; }
}

/* ---------- Footer ---------- */

.site-foot { margin-top: 3rem; background: var(--dark); color: var(--ondark-dim); font-size: 0.8125rem; border: 0; }
.site-foot .inner { max-width: 74rem; margin: 0 auto; padding: 1.6rem 1.25rem 2rem; }
.site-foot a { color: var(--ondark); text-decoration: underline; text-underline-offset: 3px; }
.site-foot p { margin: 0 0 0.4rem; }

/* ---------- Panels (.card compat) ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; }
.card-body { padding: 1.25rem 1.5rem; flex: 1; }
.card-header { padding: 0.85rem 1.5rem; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.card-title { font-size: 0.9375rem; font-weight: 750; letter-spacing: -0.01em; margin-bottom: 0.35rem; }
.card-text { color: var(--muted); font-size: 0.875rem; margin: 0; }
a.card { color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--accent); }
.border-success { border-color: var(--accent) !important; }

.paneltitle { font-family: var(--mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.1rem; display: flex; align-items: center; gap: 0.75rem; }
.paneltitle::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.paneltitle .cnt { color: var(--accent); }

/* ---------- Tables ---------- */

table { border-collapse: collapse; }
.table { width: 100%; font-size: 0.875rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.table th { text-align: left; font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0.6rem 0.85rem; border-bottom: 1.5px solid var(--ink); background: var(--surface); }
.table td { padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-striped tbody tr:nth-child(odd) td { background: #fafcfb; }
.table-hover tbody tr:hover td { background: var(--accent-wash); }
.table-sm th, .table-sm td { padding: 0.35rem 0.6rem; }
.table-responsive { overflow-x: auto; }
/* key/value profile tables: mono the value-ish th column */
.table-striped th { width: 220px; white-space: nowrap; }

/* ---------- Chips (.badge compat) ---------- */

.badge { display: inline-block; font-family: var(--mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; padding: 0.16rem 0.55rem; border-radius: 4px; line-height: 1.4; vertical-align: baseline; }
.badge.bg-success { background: var(--add-bg) !important; color: var(--add); }
.badge.bg-good { background: #f0f7e8 !important; color: #4d7c0f; }
.badge.bg-danger { background: var(--rem-bg) !important; color: var(--rem); }
.badge.bg-warning { background: var(--mod-bg) !important; color: var(--mod); }
.badge.bg-warning.text-dark { color: var(--mod) !important; }
.badge.bg-secondary { background: #eef2f0 !important; color: var(--muted); }
.badge.bg-light { background: #eef2f0 !important; color: var(--muted); }
.badge.bg-info { background: var(--accent-wash) !important; color: var(--accent-deep); }
.badge.bg-primary { background: var(--accent) !important; color: #fff; }
.badge.bg-dark { background: var(--dark) !important; color: var(--ondark); }
.rounded-pill { border-radius: 99px !important; }

/* ---------- Buttons ---------- */

.btn { display: inline-block; font: 600 0.875rem var(--sans); border-radius: 6px; padding: 0.5rem 1.1rem; border: 1.5px solid transparent; cursor: pointer; text-align: center; line-height: 1.4; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-sm { font-size: 0.78125rem; padding: 0.3rem 0.75rem; }
.btn-success, .btn-primary { background: var(--accent); color: #fff; }
.btn-success:hover, .btn-primary:hover { background: var(--accent-deep); color: #fff; }
.btn-secondary { background: #e7ece9; color: var(--ink); }
.btn-secondary:hover { background: var(--line); }
.btn-danger { background: var(--rem); color: #fff; }
.btn-danger:hover { background: #991414; }
.btn-outline-success { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-outline-success:hover { background: var(--accent-wash); }
.btn-outline-secondary { border-color: var(--line); color: var(--muted); background: var(--surface); }
.btn-outline-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-outline-danger { border-color: var(--rem); color: var(--rem); background: transparent; }
.btn-outline-danger:hover { background: var(--rem-bg); }
.btn-outline-primary { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-outline-primary:hover { background: var(--accent-wash); }
.btn-link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 600; }
.btn:disabled, .btn.disabled { opacity: 0.5; pointer-events: none; }
.btn-group { display: inline-flex; gap: 0.4rem; }
.btn-close { background: none; border: 0; font-size: 1rem; color: var(--muted); cursor: pointer; padding: 0.25rem 0.5rem; line-height: 1; }
.btn-close::before { content: "\2715"; }
.btn-close:hover { color: var(--ink); }

/* ---------- Forms ---------- */

.form-label { display: inline-block; font-family: var(--mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.form-control, .form-select {
    display: block; width: 100%;
    font: 0.9375rem var(--sans);
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 6px;
    padding: 0.55rem 0.8rem;
}
.form-control:focus, .form-select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.form-control-sm, .form-select-sm { font-size: 0.8125rem; padding: 0.3rem 0.6rem; }
.form-control-lg { font-size: 1.0625rem; padding: 0.8rem 1rem; }
.form-select { appearance: auto; }
.form-text { font-size: 0.78125rem; color: var(--muted); }
.form-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.form-check-input { accent-color: var(--accent); width: 1rem; height: 1rem; margin: 0; }
.form-check-label { font-size: 0.9375rem; }
.input-group { display: flex; width: 100%; }
.input-group > .form-control { flex: 1; border-radius: 6px 0 0 6px; min-width: 0; }
.input-group > .btn { border-radius: 0 6px 6px 0; }
.input-group-lg > .form-control { font-size: 1.0625rem; padding: 0.8rem 1rem; }
.input-group-sm > .form-control { font-size: 0.8125rem; padding: 0.3rem 0.6rem; }

/* ---------- Alerts ---------- */

.alert { border-radius: 8px; border: 1px solid var(--line); border-left: 4px solid var(--muted); background: var(--surface); padding: 0.85rem 1.1rem; margin-bottom: 1rem; font-size: 0.9375rem; }
.alert-danger { border-left-color: var(--rem); background: var(--rem-bg); color: var(--rem); }
.alert-warning { border-left-color: var(--mod); background: var(--mod-bg); color: var(--mod); }
.alert-success { border-left-color: var(--add); background: var(--add-bg); color: var(--add); }
.alert-info { border-left-color: var(--accent); background: var(--accent-wash); color: var(--accent-deep); }

/* ---------- Tabs / breadcrumb / pagination ---------- */

.nav { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0; margin: 0; list-style: none; }
.nav-tabs { border-bottom: 1.5px solid var(--line); gap: 1.4rem; }
.nav-tabs .nav-link { display: inline-block; font-family: var(--mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0.5rem 0.1rem; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1.5px; }
.nav-tabs .nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-tabs .nav-link.active { color: var(--ink); border-bottom-color: var(--accent); }
.nav-tabs .nav-link .badge { margin-left: 0.3rem; }
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active { display: block; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; padding: 0; margin: 0 0 1rem; font-family: var(--mono); font-size: 0.71875rem; color: var(--muted); }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; margin-right: 0.35rem; color: var(--line); }
.breadcrumb-item a { color: var(--muted); }
.breadcrumb-item.active { color: var(--ink); }

.pagination { display: flex; gap: 0.3rem; list-style: none; padding: 0; margin: 1rem 0; }
.page-link { display: inline-block; font-family: var(--mono); font-size: 0.78125rem; border: 1px solid var(--line); border-radius: 6px; padding: 0.3rem 0.7rem; color: var(--accent); background: var(--surface); }
.page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-item.disabled .page-link { color: var(--muted); opacity: 0.5; pointer-events: none; }
.page-link:hover { text-decoration: none; background: var(--accent-wash); }

/* ---------- List group (autocomplete) ---------- */

.list-group { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; box-shadow: 0 10px 30px rgba(13, 20, 17, 0.12); }
.list-group:empty { display: none; }
.list-group-item { display: block; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 0.875rem; }
.list-group-item:last-child { border-bottom: 0; }
.list-group-item-action { cursor: pointer; }
.list-group-item-action:hover { background: var(--accent-wash); text-decoration: none; }

/* ---------- Modal + dropdown (vanilla shim targets) ---------- */

.modal { display: none; position: fixed; inset: 0; z-index: 1060; background: rgba(13, 20, 17, 0.55); overflow-y: auto; }
.modal.show { display: block; }
.modal-dialog { max-width: 33rem; margin: 4rem auto; padding: 0 1rem; }
.modal-content { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal-title { font-family: var(--mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0; }
.modal-body { padding: 1.1rem 1.25rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.9rem 1.25rem; border-top: 1px solid var(--line); }

.dropdown { position: relative; display: inline-block; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; z-index: 1000; min-width: 11rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(13, 20, 17, 0.12); padding: 0.35rem 0; margin: 0.25rem 0 0; list-style: none; }
.dropdown-menu.show { display: block; }
.dropdown-menu-end { right: 0; left: auto; }
.dropdown-item { display: block; width: 100%; padding: 0.45rem 1rem; color: var(--ink); font-size: 0.875rem; background: none; border: 0; text-align: left; cursor: pointer; }
.dropdown-item:hover { background: var(--accent-wash); text-decoration: none; }
.dropdown-divider { border-top: 1px solid var(--line); margin: 0.35rem 0; }

/* ---------- Grid ---------- */

.row { display: flex; flex-wrap: wrap; gap: 1rem; }
.row.g-2 { gap: 0.5rem; }
.row.g-3 { gap: 1rem; }
[class*="col-"], .col, .col-auto { min-width: 0; }
.col { flex: 1 1 0; }
.col-auto { flex: 0 0 auto; }
.col-12 { flex: 0 0 100%; }
.col-md-4, .col-md-5, .col-md-6, .col-md-8, .col-sm-6, .col-lg-3 { flex: 0 0 100%; }
@media (min-width: 576px) {
    .col-sm-6 { flex: 0 0 calc(50% - 0.75rem); }
}
@media (min-width: 768px) {
    .col-md-4 { flex: 0 0 calc(33.333% - 0.75rem); }
    .col-md-5 { flex: 0 0 calc(41.666% - 0.75rem); }
    .col-md-6 { flex: 0 0 calc(50% - 0.75rem); }
    .col-md-8 { flex: 0 0 calc(66.666% - 0.75rem); }
}
@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 calc(25% - 0.75rem); }
}

/* ---------- Utilities (subset in use) ---------- */

.d-flex { display: flex !important; }
.d-none { display: none !important; }
@media (min-width: 768px) { .d-md-table-cell { display: table-cell !important; } }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-auto { margin-left: auto !important; }
.p-0 { padding: 0 !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-muted { color: var(--muted) !important; }
.text-success { color: var(--accent) !important; }
.text-danger { color: var(--rem) !important; }
.text-warning { color: var(--mod) !important; }
.text-primary { color: var(--accent) !important; }
.text-dark { color: var(--ink) !important; }
.text-white { color: #fff !important; }
.text-decoration-none { text-decoration: none !important; }
.small, small { font-size: 0.8125rem; }
.fw-bold { font-weight: 700 !important; }
.fs-2 { font-size: 1.6rem !important; }
.fs-5 { font-size: 1.0625rem !important; }
.lead { font-size: 1.125rem; color: var(--muted); }
.display-4 { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }

/* ---------- Icon-font stand-ins (bootstrap-icons CDN removed) ---------- */

.bi { display: inline-block; font-style: normal; }
.bi-search::before { content: "\2315"; }
.bi-plus-circle::before, .bi-person-plus::before { content: "+"; font-weight: 700; }
.bi-pencil::before { content: "\270E"; }
.bi-trash::before, .bi-x-lg::before { content: "\2715"; }
.bi-send::before { content: "\2192"; }
.bi-tag::before, .bi-tag-fill::before, .bi-tags::before { content: "#"; }
.bi-star-fill::before { content: "\2605"; }
.bi-chevron-right::before { content: "\203A"; }
.bi-play-circle::before { content: "\25B6"; }
.bi-pause-circle::before { content: "\25AE\25AE"; letter-spacing: -0.1em; }
.bi-binoculars::before { content: ""; }
.bi-check-lg::before { content: "\2713"; font-weight: 700; }
.bi-people::before { content: "\25C9"; }
.bi-gear::before { content: "\2699"; }
.bi-shield-lock::before { content: "\26E8"; }
.bi-key::before { content: "\26BF"; }
.bi-cloud-download::before { content: "\2913"; }
.bi-activity::before { content: "\223F"; }
.bi-envelope::before { content: "\2709"; }
.bi-building::before { content: "\25A4"; }
.bi-exclamation-triangle::before { content: "\26A0"; }
.bi-hourglass-split::before { content: "\29D6"; }
/* keep a small gap after an icon when it precedes a label */
.bi::before { margin-right: 0.3em; }
.bi:empty::before { margin-right: 0; }

/* ---------- Admin sub-navigation ---------- */

.adminnav { display: flex; align-items: center; gap: 1rem; margin: 0 0 1.6rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.adminnav-links { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ---------- Impersonation banner ---------- */

.impersonation-banner { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; background: var(--mod); color: #fff; padding: 0.5rem 1rem; font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.02em; }
.impersonation-banner .ib-text strong { font-weight: 700; }
.impersonation-banner .ib-stop { font: 600 0.75rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mod); background: #fff; border: 0; border-radius: 5px; padding: 0.2rem 0.7rem; cursor: pointer; }
.impersonation-banner .ib-stop:hover { background: var(--mod-bg); }
.adminnav-link { font-family: var(--mono); font-size: 0.8125rem; font-weight: 600; color: var(--muted); padding: 0.35rem 0.8rem; border-radius: 6px; letter-spacing: 0.02em; }
.adminnav-link:hover { color: var(--accent); background: var(--accent-wash); }
.adminnav-link.active { color: var(--accent-deep); background: var(--accent-wash); }
.adminnav-link .badge { margin-left: 0.3rem; }

/* ---------- Landing / Monitor components ---------- */

.herodark { background: linear-gradient(180deg, var(--dark) 0%, var(--dark-2) 100%); color: var(--ondark); padding: 3.25rem 0 3.75rem; border-bottom: 3px solid var(--accent); }
.herodark h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); font-weight: 750; letter-spacing: -0.025em; line-height: 1.12; color: #fff; max-width: 40rem; margin: 0; }
.herodark h1 em { font-style: normal; color: var(--accent-bright); }
.herodark p.sub { margin-top: 1rem; font-size: 1.0625rem; color: var(--ondark-dim); max-width: 42rem; }
.cmdbar { margin-top: 1.9rem; max-width: 44rem; display: flex; background: #fff; border-radius: 8px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); position: relative; }
.cmdbar .prompt { display: flex; align-items: center; padding: 0 0 0 1rem; color: var(--accent); font-family: var(--mono); font-weight: 700; }
.cmdbar input.form-control { flex: 1; border: 0; border-radius: 8px 0 0 8px; padding: 1rem 0.9rem; font-family: var(--mono); font-size: 0.9375rem; }
.cmdbar input.form-control:focus { outline: none; }
.cmdbar .btn { border-radius: 0 8px 8px 0; padding: 0 1.5rem; }
.cmdbar #autocomplete-results { position: absolute; top: 100%; left: 0; right: 0; margin-top: 0.4rem; z-index: 1000; text-align: left; }
.herodark .under { margin-top: 0.8rem; font-family: var(--mono); font-size: 0.6875rem; color: var(--ondark-dim); letter-spacing: 0.05em; }
.herodark .under a { color: var(--accent-bright); }

.statusstrip { background: var(--dark-2); border-top: 1px solid var(--dark-line); color: var(--ondark); }
.statusstrip .inner { max-width: 74rem; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 0 2.5rem; padding: 0.7rem 1.25rem; font-family: var(--mono); font-size: 0.75rem; }
.statusstrip .ok { color: var(--accent-bright); font-weight: 700; }
.statusstrip .k { color: var(--ondark-dim); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem 1.75rem 1.75rem; }
.panel + .panel, .panelband .panel { margin-top: 1.5rem; }
.bigstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.bigstats .n { font-family: var(--mono); font-size: 1.8rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.bigstats .l { font-size: 0.8125rem; color: var(--muted); margin-top: 0.15rem; }
@media (max-width: 900px) { .bigstats { grid-template-columns: repeat(2, 1fr); } }

table.feed { width: 100%; border: 0; border-collapse: collapse; font-size: 0.875rem; background: transparent; }
table.feed td { padding: 0.55rem 0.6rem 0.55rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.feed tr:last-child td { border-bottom: 0; }
table.feed td.d { font-family: var(--mono); font-size: 0.75rem; white-space: nowrap; width: 1%; padding-right: 1.25rem; color: var(--muted); }
table.feed td.viz { width: 26%; min-width: 7rem; }
table.feed .bar { height: 0.9rem; background: var(--accent); border-radius: 2px; min-width: 3px; }
table.feed td.tot { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; width: 1%; padding-right: 1.25rem; font-weight: 600; }
@media (max-width: 900px) { table.feed td.viz { display: none; } }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip { font-family: var(--mono); font-size: 0.6875rem; padding: 0.1rem 0.5rem; border-radius: 4px; white-space: nowrap; }
.chip.add { background: var(--add-bg); color: var(--add); }
.chip.mod { background: var(--mod-bg); color: var(--mod); }
.chip.rem { background: var(--rem-bg); color: var(--rem); }
.chip.neu { background: #eef2f0; color: var(--muted); }

.quicklinks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.quicklinks .domain { border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem; color: var(--ink); display: block; }
.quicklinks .domain:hover { text-decoration: none; border-color: var(--accent); }
.quicklinks .domain h3 { font-size: 0.9375rem; font-weight: 700; margin: 0; }
.quicklinks .domain p { margin: 0.3rem 0 0; font-size: 0.8125rem; color: var(--muted); }
@media (max-width: 900px) { .quicklinks { grid-template-columns: 1fr; } }

/* ---------- School record page ---------- */

.recordbar { background: var(--dark-2); border-bottom: 3px solid var(--accent); color: var(--ondark); margin: 0 0 1.5rem; }
.recordbar .inner { max-width: 74rem; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 0 2.5rem; padding: 0.6rem 1.25rem; font-family: var(--mono); font-size: 0.71875rem; }
.recordbar .k { color: var(--ondark-dim); }
.recordbar .ok { color: var(--accent-bright); font-weight: 700; }
.tagrow { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 1rem; }
.tag { font-family: var(--mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; padding: 0.2rem 0.6rem; border-radius: 4px; border: 1px solid var(--line); background: #fff; color: var(--muted); display: inline-block; }
.tag.green { background: var(--add-bg); color: var(--add); border-color: transparent; }
.tag.amber { background: var(--mod-bg); color: var(--mod); border-color: transparent; }
.tag.red { background: var(--rem-bg); color: var(--rem); border-color: transparent; }
.tag.grade { background: var(--accent); color: #fff; border-color: transparent; }

.st { font-family: var(--mono); font-size: 0.625rem; font-weight: 700; letter-spacing: 0.06em; padding: 0.12rem 0.45rem; border-radius: 4px; white-space: nowrap; display: inline-block; }
.st.on { background: var(--add-bg); color: var(--add); }
.st.soon { background: var(--mod-bg); color: var(--mod); }
.st.off { background: var(--rem-bg); color: var(--rem); }

/* diff view colouring */
.diff-old, del.diff { background: var(--rem-bg); color: var(--rem); text-decoration: line-through; border-radius: 3px; padding: 0 0.25rem; }
.diff-new, ins.diff { background: var(--add-bg); color: var(--add); text-decoration: none; border-radius: 3px; padding: 0 0.25rem; }

.mono, .urn { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- Autocomplete containers ---------- */

#autocomplete-results .list-group-item,
#add-results .list-group-item { cursor: pointer; font-size: 0.875rem; }

/* ---------- Watchlist table ---------- */

#watchlist-table { table-layout: fixed; }
#watchlist-table th:nth-child(1) { width: 40px; }
#watchlist-table th:nth-child(2) { width: 32px; }
#watchlist-table th:nth-child(3) { width: auto; }
#watchlist-table th:nth-child(4) { width: 150px; }
#watchlist-table th:nth-child(5) { width: 120px; }
#watchlist-table th:nth-child(6) { width: 100px; }
#watchlist-table th:nth-child(7) { width: 90px; }
#watchlist-table td { overflow: hidden; text-overflow: ellipsis; }
.drag-handle { cursor: grab; color: var(--muted); font-family: var(--mono); }
.drag-handle::before { content: "\2261"; }

/* ---------- Cookie banner ---------- */

.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--dark); color: var(--ondark-dim);
    border-top: 1px solid var(--dark-line);
    padding: 1rem 1.5rem;
    display: flex; align-items: center; justify-content: center; gap: 1.5rem;
    z-index: 1050;
    animation: cookieBannerSlideUp 0.3s ease;
}
@keyframes cookieBannerSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.cookie-banner.hiding { animation: cookieBannerSlideDown 0.3s ease forwards; }
@keyframes cookieBannerSlideDown { from { transform: translateY(0); } to { transform: translateY(100%); } }
.cookie-banner p { margin: 0; font-size: 0.875rem; color: var(--ondark-dim); }
.cookie-banner-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.cookie-btn-decline { padding: 0.375rem 1rem; border: 1px solid var(--dark-line); border-radius: 99px; background: transparent; color: var(--ondark-dim); font-size: 0.875rem; font-weight: 500; cursor: pointer; }
.cookie-btn-decline:hover { color: #fff; }
.cookie-btn-accept { padding: 0.375rem 1rem; border: none; border-radius: 99px; background: var(--accent); color: #fff; font-size: 0.875rem; font-weight: 500; cursor: pointer; }
.cookie-btn-accept:hover { background: var(--accent-deep); }
@media (max-width: 600px) { .cookie-banner { flex-direction: column; text-align: center; } }

/* ---------- School record layout (demo-faithful) ---------- */

.cols { display: grid; grid-template-columns: 1fr 21.5rem; gap: 1.5rem; align-items: start; }
.cols .maincol { min-width: 0; }
.cols .maincol .panel + .panel { margin-top: 1.5rem; }
aside.log { position: sticky; top: 1rem; }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; font-size: 0.875rem; }
.kv > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px dashed var(--line); }
.kv .k { color: var(--muted); }
.kv .v { font-family: var(--mono); font-size: 0.8125rem; text-align: right; }
.kv .v .warn { color: var(--mod); font-weight: 700; }

.grades { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; }
.gcell { border-radius: 6px; padding: 0.7rem 0.6rem 0.8rem; text-align: center; border: 1px solid var(--line); }
.gcell .g { font-family: var(--mono); font-size: 1.25rem; font-weight: 800; }
.gcell .gl { font-size: 0.65625rem; color: var(--muted); margin-top: 0.2rem; line-height: 1.3; }
.gcell.out { background: var(--add-bg); border-color: transparent; }
.gcell.out .g { color: var(--add); }
.gcell.good { background: #f0f7e8; border-color: transparent; }
.gcell.good .g { color: #4d7c0f; }
.gcell.ri { background: var(--mod-bg); border-color: transparent; }
.gcell.ri .g { color: var(--mod); }
.gcell.bad { background: var(--rem-bg); border-color: transparent; }
.gcell.bad .g { color: var(--rem); }
.gkey { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 0.7rem; font-size: 0.71875rem; color: var(--muted); }
.gkey-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.gk { font-family: var(--mono); font-size: 0.6875rem; font-weight: 800; padding: 0.05rem 0.3rem; border-radius: 4px; line-height: 1.4; }
.gk.out { background: var(--add-bg); color: var(--add); }
.gk.good { background: #f0f7e8; color: #4d7c0f; }
.gk.ri { background: var(--mod-bg); color: var(--mod); }
.gk.bad { background: var(--rem-bg); color: var(--rem); }
.ofsted-meta { margin-top: 1rem; font-family: var(--mono); font-size: 0.71875rem; color: var(--muted); }

.trustline { font-size: 0.9375rem; margin: 0; }
.trustline + .trustline { margin-top: 0.6rem; }
.xlink { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--mono); font-size: 0.75rem; background: var(--accent-wash); color: var(--accent); border-radius: 4px; padding: 0.15rem 0.5rem; }
.trustmeta { margin: 0.7rem 0 0; font-family: var(--mono); font-size: 0.71875rem; color: var(--muted); }

.tenure { display: flex; align-items: center; gap: 0.5rem; min-width: 6.5rem; }
.tenure .tb { height: 0.45rem; background: var(--accent); border-radius: 2px; opacity: 0.75; min-width: 3px; }
.tenure .ty { font-family: var(--mono); font-size: 0.6875rem; color: var(--muted); white-space: nowrap; }

.logpanel { background: var(--dark); color: var(--ondark); border-radius: 10px; padding: 1.4rem 1.4rem 1.5rem; }
.logpanel .paneltitle { color: var(--ondark-dim); }
.logpanel .paneltitle::after { border-color: var(--dark-line); }
.logpanel .paneltitle .live { color: var(--accent-bright); }
.logpanel a { color: var(--accent-bright); }
.startwatch { border: 1px dashed var(--dark-line); border-radius: 8px; padding: 0.8rem 0.9rem; margin-bottom: 1.2rem; font-size: 0.78125rem; color: var(--ondark-dim); }
.startwatch b { color: #fff; }
ol.timeline { list-style: none; border-left: 1px solid var(--dark-line); margin: 0 0 0 0.3rem; padding: 0; }
ol.timeline li { position: relative; padding: 0 0 1.2rem 1.1rem; }
ol.timeline li:last-child { padding-bottom: 0.2rem; }
ol.timeline li::before { content: ""; position: absolute; left: -0.28rem; top: 0.35rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent-bright); }
ol.timeline li.past::before { background: var(--dark-line); }
ol.timeline .d { font-family: var(--mono); font-size: 0.65625rem; color: var(--ondark-dim); letter-spacing: 0.06em; }
ol.timeline .t { font-size: 0.8125rem; margin-top: 0.15rem; }
ol.timeline .t b { color: #fff; }
.dchip { display: inline-block; font-family: var(--mono); font-size: 0.65625rem; border-radius: 4px; padding: 0.08rem 0.4rem; margin-top: 0.3rem; max-width: 100%; overflow-wrap: anywhere; }
.dchip.mod { background: rgba(212, 148, 30, 0.16); color: #ffc861; }
.dchip.add { background: rgba(47, 212, 131, 0.14); color: var(--accent-bright); }
.dchip.rem { background: rgba(220, 38, 38, 0.18); color: #ff9d9d; }
ol.timeline .snap { display: block; font-family: var(--mono); font-size: 0.625rem; color: var(--ondark-dim); margin-top: 0.3rem; }
ol.timeline .snap a { color: var(--ondark-dim); text-decoration: underline; text-underline-offset: 2px; }
.logpanel .chain { margin-top: 1.2rem; padding-top: 0.9rem; border-top: 1px solid var(--dark-line); font-family: var(--mono); font-size: 0.625rem; color: var(--ondark-dim); line-height: 1.8; }
.logpanel .chain .sid { color: var(--ondark); background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: 4px; padding: 0.05rem 0.35rem; }

@media (max-width: 980px) {
    .cols { grid-template-columns: 1fr; }
    aside.log { position: static; }
    .grades { grid-template-columns: repeat(3, 1fr); }
    .kv { grid-template-columns: 1fr; }
}
