/* Patch Nexus brand: navy #011D4B, Nexus blue #0756DE, light blue #40ACD7. Red is only for problems. */
:root {
    --bg: #f3f5f9;
    --surface: #ffffff;
    --surface-2: #f8f9fc;
    --border: #dde3ed;
    --border-strong: #c3ccdb;
    --text: #0d1b33;
    --muted: #56627a;
    --faint: #8a94a8;
    --accent: #0756de;
    --accent-hover: #0546b8;
    --accent-weak: #e7effd;
    --brand: #0756de;
    --ok: #0a7a4b;
    --ok-weak: #e3f4eb;
    --warn: #a14b06;
    --orange: #f08c00;      /* overview: "need patches" fills (ring, dot, icon) */
    --orange-text: #e8590c; /* overview: large orange numbers on a light background */
    --warn-weak: #fdf1e2;
    --danger: #9f1239;
    --danger-weak: #fbe7ed;
    --info: #1b7fb0;
    --info-weak: #e4f3fa;
    --neutral-weak: #edf0f5;
    --side: #011d4b;
    --side-text: #c3cfe4;
    --side-active: #0b2c63;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(1, 29, 75, .07);
    --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
    color-scheme: light;
}

/* Dark colours: when Settings -> Theme is "Dark", or "System" and the device is in dark mode. "Light" always wins. */
:root[data-theme="dark"] {
        --bg: #060c17;
        --surface: #0d1525;
        --surface-2: #111a2c;
        --border: #1d283d;
        --border-strong: #2b3850;
        --text: #e8edf6;
        --muted: #9ba7bd;
        --faint: #6c7890;
        --accent: #3b82f6;
        --accent-hover: #5c97f7;
        --accent-weak: #0f2347;
        --brand: #40acd7;
        --ok: #4cc58a;
        --ok-weak: #13301f;
        --warn: #f0a24b;
        --orange: #f0a24b;
        --orange-text: #f0a24b;
        --warn-weak: #35260f;
        --danger: #fb7195;
        --danger-weak: #3b1520;
        --info: #5cc0e6;
        --info-weak: #0e2a38;
        --neutral-weak: #172034;
        --side: #030913;
        --side-active: #0f1e38;
        --side-text: #b4c0d6;
        color-scheme: dark;
    }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #060c17;
        --surface: #0d1525;
        --surface-2: #111a2c;
        --border: #1d283d;
        --border-strong: #2b3850;
        --text: #e8edf6;
        --muted: #9ba7bd;
        --faint: #6c7890;
        --accent: #3b82f6;
        --accent-hover: #5c97f7;
        --accent-weak: #0f2347;
        --brand: #40acd7;
        --ok: #4cc58a;
        --ok-weak: #13301f;
        --warn: #f0a24b;
        --orange: #f0a24b;
        --orange-text: #f0a24b;
        --warn-weak: #35260f;
        --danger: #fb7195;
        --danger-weak: #3b1520;
        --info: #5cc0e6;
        --info-weak: #0e2a38;
        --neutral-weak: #172034;
        --side: #030913;
        --side-active: #0f1e38;
        --side-text: #b4c0d6;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 650; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
    background: var(--side); color: var(--side-text); padding: 18px 12px;
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh;
    overflow-y: auto; /* short windows: the menu scrolls instead of cutting off the last items */
}
.brand { display: block; padding: 2px 6px 18px; }
.brand-logo { display: block; width: 100%; max-width: 200px; height: auto; }
.side { border-top: 3px solid var(--brand); }
.side a.nav {
    display: flex; align-items: center; gap: 10px; color: var(--side-text); padding: 8px 10px;
    border-radius: 6px; font-weight: 500;
}
.side a.nav:hover { background: var(--side-active); color: #fff; text-decoration: none; }
.side a.nav.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
/* Settings sub-pages: tabs at the top of the page. */
.settings-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 14px; border-bottom: 1px solid var(--border); }
.settings-tabs a { padding: 8px 12px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.settings-tabs a.active { color: var(--text, inherit); border-bottom-color: var(--accent); font-weight: 600; }
.settings-tabs a:hover { text-decoration: none; color: var(--accent); }
.side .nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7f8eaa; padding: 16px 10px 6px; }
.side .side-foot { margin-top: auto; padding: 10px; font-size: 12px; color: #77777e; }
.nav-icon { width: 16px; height: 16px; flex: none; opacity: .85; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 10px 28px;
    border-bottom: 1px solid var(--border); background: var(--surface); font-size: 13px;
}
.topbar form { margin: 0; }
.content { padding: 24px 28px 48px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi.ok .value { color: var(--ok); }
.kpi.warn .value { color: var(--warn); }
.kpi.danger .value { color: var(--danger); }

.dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
/* A table with its own vertical scroll bar and headers that stay visible (height set to N rows by ui.js, data-max-rows). */
.table-scroll { overflow: auto; max-height: 640px; overscroll-behavior: contain; }
.table-scroll thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--border); }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th {
    text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
    padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: none; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr.group td { background: var(--neutral-weak); font-weight: 650; padding-top: 7px; padding-bottom: 7px; }
table.t tr.subgroup td { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
table.t tr.detail td { background: var(--surface-2); }
table.t .chk { width: 32px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

/* ---------- badges / dots ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12px;
    font-weight: 600; white-space: nowrap; background: var(--neutral-weak); color: var(--muted);
}
.badge.ok { background: var(--ok-weak); color: var(--ok); }
.badge.warn { background: var(--warn-weak); color: var(--warn); }
.badge.danger { background: var(--danger-weak); color: var(--danger); }
.badge.info { background: var(--info-weak); color: var(--info); }
.badge.accent { background: var(--accent-weak); color: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-weak); }
.dot.off { background: var(--faint); }
.count-link { font-variant-numeric: tabular-nums; }
.zero { color: var(--faint); }

/* ---------- forms ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: 6px;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550;
    cursor: pointer; white-space: nowrap; line-height: 1.3;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn.danger:hover { background: var(--danger-weak); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.sm { padding: 3px 10px; font-size: 12.5px; }
.btn.link { border: none; background: none; color: var(--accent); padding: 0; font-weight: 500; }
.btn.link:hover { text-decoration: underline; background: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

label.f { display: block; font-weight: 550; font-size: 13px; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], input[type=date], input[type=search], select, textarea {
    width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface);
    color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; border-color: var(--accent); }
input.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: .3em; text-align: center; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { margin: 0; min-width: 160px; }
.filters .field.wide { min-width: 240px; flex: 1; max-width: 360px; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-weight: 450; cursor: pointer; }
.check input { margin: 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px 6px; margin: 0 0 16px; }
legend { font-weight: 650; padding: 0 6px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
.seg label { padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--border-strong); font-weight: 500; }
.seg label:last-child { border-right: none; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--accent-weak); color: var(--accent); }

/* ---------- alerts / panels ---------- */
.alert { padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); margin-bottom: 14px; }
.alert.ok { background: var(--ok-weak); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.alert.warn { background: var(--warn-weak); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.alert.danger { background: var(--danger-weak); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert.info { background: var(--info-weak); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }
.secret {
    font-family: var(--mono); font-size: 13px; background: var(--surface-2); border: 1px dashed var(--border-strong);
    border-radius: 6px; padding: 10px 12px; word-break: break-all; user-select: all;
}
pre.cmd {
    font-family: var(--mono); font-size: 12.5px; background: var(--side); color: #d7e0ea; border-radius: 6px;
    padding: 12px 14px; white-space: pre-wrap; word-break: break-all; margin: 0;
}
.panel { border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface); padding: 16px 18px; margin-bottom: 16px; box-shadow: 0 4px 16px rgba(16,24,40,.08); }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--accent-weak); flex-wrap: wrap; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
    radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent),
    var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card.wide { max-width: 520px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-brand picture, .auth-brand > img { display: block; width: 280px; max-width: 80%; height: auto; }
.auth-brand picture img { display: block; width: 100%; height: auto; }
.auth-card .card { padding: 26px 28px; }
.auth-card h1 { font-size: 19px; margin-bottom: 6px; }
.auth-card .btn.primary { width: 100%; padding: 9px; }
.qr { width: 200px; height: 200px; margin: 6px auto 12px; background: #fff; border-radius: 8px; padding: 4px; }
.qr svg { width: 100%; height: 100%; display: block; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-family: var(--mono); font-size: 15px; margin: 12px 0 16px; }

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: 10px 20px;
    background: var(--danger); color: #fff;
}
#blazor-error-ui .reload { color: #fff; text-decoration: underline; margin-left: 10px; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }
.components-reconnect-show, .components-reconnect-failed, .components-reconnect-rejected { }

/* sortable headers */
table.t th.sortable { padding: 0; }
table.t th .sort-btn {
    all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%;
    padding: 9px 12px; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit;
}
table.t th .sort-btn:hover { color: var(--text); }
table.t th .sort-btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -2px; }
table.t th .sort-ind { font-size: 10px; opacity: .45; }
table.t th.sorted .sort-btn { color: var(--accent); }
table.t th.sorted .sort-ind { opacity: 1; }

/* 1.7: device notes and ignored updates */
.note-line { color: var(--warn); font-style: italic; white-space: normal; max-width: 280px; }
.notes-box textarea { width: 100%; min-height: 72px; resize: vertical; font: inherit; }
table.t tr.ignored td { opacity: .65; }

/* device alias: neutral silver chip (red is reserved for brand accents and problems) */
.alias-chip { font: inherit; font-size: 15px; font-weight: 600; padding: 3px 12px; border-radius: 999px; cursor: pointer;
    background: var(--neutral-weak); color: var(--text); border: 1px solid var(--border-strong); }
.alias-chip:hover { border-color: var(--accent); }
.alias-chip.sm { font-size: 11.5px; font-weight: 600; padding: 1px 8px; cursor: default; margin-left: 2px; color: var(--muted); }
.alias-chip.sm:hover { border-color: var(--border-strong); }
.alias-add { font: inherit; font-size: 13px; font-weight: 500; padding: 3px 12px; border-radius: 999px; cursor: pointer;
    background: transparent; color: var(--muted); border: 1px dashed var(--border-strong); }
.alias-add:hover { color: var(--accent); border-color: var(--accent); }
.alias-input { font-size: 15px; width: 240px; }

/* links inside tables read as names, not alerts: neutral text, brand red on hover */
table.t a { color: var(--text); }
table.t a:hover { color: var(--accent); text-decoration: none; }

/* ---------- phones and tablets ---------- */
.nav-toggle, .nav-burger, .nav-backdrop, .topbar-logo { display: none; }
.topbar-spacer { flex: 1; }

@media screen and (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .side {
        position: fixed; left: 0; top: 0; bottom: 0; width: 272px; max-width: 85vw; z-index: 60;
        transform: translateX(-102%); transition: transform .2s ease; overflow-y: auto;
        box-shadow: 4px 0 24px rgba(0, 0, 0, .35);
    }
    .nav-toggle:checked ~ .side { transform: none; }
    .nav-toggle:checked ~ .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .45); }
    .side a.nav { padding: 11px 12px; }

    .topbar { position: sticky; top: 0; z-index: 40; justify-content: flex-start; gap: 10px; padding: 8px 12px; }
    .nav-burger { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; color: var(--text); }
    .nav-burger:active { background: var(--neutral-weak); }
    .topbar-logo { display: block; }
    .topbar-logo img { display: block; width: 30px; height: 30px; }
    .topbar-user { display: none; }

    .content { padding: 16px 14px 48px; }
    .page-head { align-items: flex-start; }
    .page-head .actions { width: 100%; }
    h1 { font-size: 20px; }
    .card-pad { padding: 14px 14px; }
    .card-head { padding: 12px 14px; flex-wrap: wrap; }
    .panel { padding: 14px; }

    /* 16px inputs stop iOS from zooming in; bigger touch targets */
    input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], input[type=date], input[type=search], select, textarea { font-size: 16px; }
    .btn { min-height: 38px; }
    .btn.sm { min-height: 32px; }

    .filters .field, .filters .field.wide { flex: 1 1 calc(50% - 10px); min-width: 0; max-width: none; }
    .filters .field.wide { flex-basis: 100%; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .alias-input { width: 100%; }
}

@media screen and (max-width: 560px) {
    .dl { grid-template-columns: 1fr; gap: 0; }
    .dl dt { margin-top: 10px; font-size: 12px; }
    .dl dd select { max-width: none !important; width: 100%; }
    .filters .field { flex-basis: 100%; }
    h1.actions { font-size: 19px; }
}

/* Lists that become cards on phones: one card per row, cells with their column name */
@media screen and (max-width: 760px) {
    table.t.cards thead { display: none; }
    table.t.cards, table.t.cards tbody { display: block; }
    table.t.cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 12px 14px; position: relative; border-bottom: 1px solid var(--border); }
    table.t.cards tr.group, table.t.cards tr.subgroup { display: block; padding: 0; }
    table.t.cards tr.group td, table.t.cards tr.subgroup td { display: block; padding: 10px 14px; }
    table.t.cards td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; text-align: left; }
    table.t.cards td.chk { position: absolute; top: 12px; right: 12px; }
    table.t.cards td.cell-main { grid-column: 1 / -1; padding-right: 32px; }
    table.t.cards td.cell-actions { grid-column: 1 / -1; }
    table.t.cards td[data-label]::before {
        content: attr(data-label); display: block; font-size: 11px; font-weight: 600; text-transform: uppercase;
        letter-spacing: .04em; color: var(--muted); margin-bottom: 2px;
    }
    table.t.cards td.chk input { width: 20px; height: 20px; }
}

/* ---------- reports ---------- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); grid-auto-rows: 1fr; gap: 14px; }
.report-grid > .card { margin-top: 0; }  /* the grid gap spaces them, not ".card + .card" */
.report-card { display: block; color: var(--text); transition: border-color .15s; }
.report-card:hover { text-decoration: none; border-color: var(--accent); }
.report-card h2 { margin-bottom: 6px; }
.report-section { margin-bottom: 16px; }
.report .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.failed-line { margin-top: 4px; }
.print-only { display: none; }

@page { size: A4 portrait; margin: 12mm 10mm; }
@page wide { size: A4 landscape; margin: 10mm; }

@media print {
    :root {
        --bg: #ffffff; --surface: #ffffff; --surface-2: #f6f6f7; --border: #d4d4d8; --border-strong: #b8b8bf;
        --text: #111113; --muted: #55555c; --faint: #85858c; --accent: #0756de; --accent-weak: #e7effd;
        --ok: #0a7a4b; --ok-weak: #e3f4eb; --warn: #a14b06; --warn-weak: #fdf1e2; --danger: #9f1239; --danger-weak: #fbe7ed;
        --info: #1d5bbf; --info-weak: #e8effc; --neutral-weak: #eeeef0; color-scheme: light;
    }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body { background: #fff; color: var(--text); font-size: 11px; }
    .side, .topbar, .nav-backdrop, .nav-toggle, .no-print, #blazor-error-ui { display: none !important; }
    .shell { display: block; }
    .content { padding: 0; max-width: none; }
    body:has(.report.wide) { page: wide; }
    .print-only { display: block; }
    .print-head { display: flex; align-items: center; gap: 18px; border-bottom: 2px solid #0756de; padding-bottom: 10px; margin-bottom: 14px; }
    .print-head img { width: 170px; height: auto; }
    .print-title { font-size: 18px; font-weight: 700; }
    .print-meta { font-size: 11px; color: var(--muted); }
    .card { box-shadow: none; border-color: var(--border); }
    .card-head { padding: 8px 10px; }
    .card-head h2 { font-size: 13px; }
    .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 8px; margin-bottom: 12px; }
    .kpi { padding: 8px 10px; box-shadow: none; }
    .kpi .value { font-size: 18px; }
    .table-wrap { overflow: visible; }
    .table-scroll { max-height: none !important; }
    table.t { font-size: 10px; }
    table.t th, table.t td { padding: 4px 6px; }
    table.t th { font-size: 9px; }
    thead { display: table-header-group; }
    tr, .kpi { break-inside: avoid; }
    .keep-together { break-inside: avoid-page; }
    .report-section { margin-bottom: 10px; }
    a { color: inherit !important; text-decoration: none !important; }
    .badge { border: 1px solid transparent; }
}

/* ---------- devices list: fixed column widths (long user lists on terminal servers must not widen the table) ---------- */
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-list { max-height: 180px; overflow-y: auto; }
@media screen and (min-width: 761px) {
    table.devices-t { table-layout: fixed; }
    table.devices-t td { overflow: hidden; text-overflow: ellipsis; }
    table.devices-t td.cell-main .actions { flex-wrap: nowrap; min-width: 0; }
    table.devices-t td.cell-main a strong { white-space: nowrap; }
    table.devices-t .c-chk { width: 42px; }
    table.devices-t .c-host { width: 25%; }
    table.devices-t .c-os { width: 17%; }
    table.devices-t .c-seen { width: 9%; }
    table.devices-t .c-missing { width: 15%; }
    table.devices-t .c-install { width: 11%; }
    table.devices-t .c-reboot { width: 8%; }
    table.devices-t .c-agent { width: 10%; }
    table.devices-t .note-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: none; }
}

/* ---------- company: Windows automatic updates ---------- */
.au-options { display: grid; gap: 8px; }
.au-option { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin: 0; }
.au-option input { margin-top: 4px; flex: 0 0 auto; }
.au-option > span { display: flex; flex-direction: column; gap: 2px; }
.au-option:has(input:checked) { border-color: var(--accent); background: var(--accent-weak); }

/* ---------- passkeys ---------- */
.auth-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn.passkey-btn { width: 100%; justify-content: center; gap: 8px; padding: 9px; }
.passkey-list { list-style: none; margin: 0 0 14px; padding: 0; }
.passkey-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.passkey-list li:last-child { border-bottom: 0; }
.passkey-list .pk-main { flex: 1; min-width: 0; }
.passkey-add { display: flex; gap: 8px; flex-wrap: wrap; }
.passkey-add input { flex: 1; min-width: 160px; }
[hidden] { display: none !important; }
.au-days { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }
.au-days input { width: 70px; padding: 4px 8px; }

/* ---------- overview: clickable tiles; minor (Defender / driver) updates in gray ---------- */
.overview-kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 1400px) { .overview-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
a.kpi.link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
a.kpi.link:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.kpi.minor .value { color: var(--faint); }
.kpi.offline .value { color: var(--muted); }
.badge.minor { background: var(--neutral-weak, #eeeef0); color: var(--faint); font-weight: 500; }
tr.minor-update td { color: var(--muted); }
@media screen and (max-width: 900px) { .overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- devices: select a whole company / folder ---------- */
table.t tr.group td.chk, table.t tr.subgroup td.chk { width: 42px; }
@media screen and (max-width: 760px) {
    table.t.cards tr.group, table.t.cards tr.subgroup { display: flex; align-items: center; }
    table.t.cards tr.group td.chk, table.t.cards tr.subgroup td.chk { display: block; width: auto; padding-right: 0; }
}
.missing-kinds { font-size: 11.5px; color: var(--muted); margin-left: 4px; white-space: nowrap; }

/* ---------- global settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 1100px; }
.settings-grid > .card { margin-top: 0; }
@media screen and (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-preview { margin-top: 6px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.alias-tag { display: inline-block; margin-left: 6px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 11.5px; color: var(--muted); }
.settings-grid .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Overview tiles: total + workstations / servers split (each a link) */
div.kpi.link { display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
div.kpi.link:hover { border-color: var(--accent); transform: translateY(-1px); }
.kpi .kpi-main { display: block; color: inherit; text-decoration: none; flex: 1; }
.kpi .kpi-main:hover { text-decoration: none; }
.kpi-split { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 6px; font-size: 12px; }
.kpi-split a, .kpi-split span { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-split a:hover { color: var(--text); text-decoration: underline; }
.kpi-split a.zero { color: var(--faint); }
.kpi-split .nav-icon { width: 13px; height: 13px; flex: none; }

/* Workstation / server icon next to device names */
.type-icon { display: inline-flex; align-items: center; color: var(--muted); margin-right: 5px; vertical-align: -2px; }
.type-icon .nav-icon { width: 14px; height: 14px; opacity: .9; }
h1 .type-icon .nav-icon { width: 20px; height: 20px; }

/* Windows automatic updates: workstations | servers side by side */
.au-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.au-grid h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 14px; }
.au-options.compact .au-option { padding: 8px 10px; }
@media (max-width: 900px) { .au-grid { grid-template-columns: 1fr; } }

/* Date / time fields in the format chosen in Settings */
.picker-wrap { position: relative; display: flex; align-items: stretch; gap: 6px; }
.picker-wrap .picker-text { flex: 1; min-width: 0; }
.picker-wrap .icon-btn { padding: 0 10px; display: inline-flex; align-items: center; }
.picker-wrap .native-picker { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* BitLocker recovery keys (device page) */
.bitlocker-keys { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2, transparent); }
.bitlocker-pw { font-size: 14px; letter-spacing: .02em; margin: 2px 0 8px; user-select: all; overflow-wrap: anywhere; }

/* Result codes: meaning + "More info" */
.error-info { display: inline; }
.error-more { display: inline-block; margin-left: 6px; vertical-align: top; }
.error-more > summary { cursor: pointer; color: var(--accent); font-size: 12px; list-style: none; display: inline; }
.error-more > summary::-webkit-details-marker { display: none; }
.error-more[open] { display: block; margin: 6px 0 0; }
.error-panel { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; line-height: 1.5; display: grid; gap: 4px; max-width: 760px; }
.error-log { margin: 2px 0 0; padding: 8px; max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11.5px; background: var(--surface-2, rgba(127,127,127,.08)); border-radius: 6px; }
@media print { .error-more:not([open]) { display: none; } }

/* Floating selection status (Devices page): stays visible while scrolling */
.selection-float {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60;
    display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px;
    background: var(--surface); border: 1px solid var(--accent); border-radius: 999px;
    box-shadow: 0 8px 28px rgba(0,0,0,.35); white-space: nowrap; max-width: calc(100vw - 24px);
}
.selection-float strong { font-size: 14px; }
.selection-float .icon-only { padding: 4px 10px; }
.selection-float-spacer { height: 72px; }
#selection-actions { scroll-margin-top: 80px; }
@media (max-width: 520px) {
    .selection-float { bottom: 12px; gap: 6px; padding: 6px 6px 6px 12px; }
    .selection-float strong { font-size: 13px; }
}
@media print { .selection-float, .selection-float-spacer { display: none; } }
.kpi .kpi-pct { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.kpi .kpi-note { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); text-decoration: none; }
.kpi .kpi-note:hover { color: var(--text); text-decoration: underline; }

/* ---------------------------------------------------------------- dialog ("Confirm it's you") */
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(10, 10, 12, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: 100%; max-width: 420px; padding: 22px 24px; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.modal h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.modal .or-line { text-align: center; margin: 12px 0 4px; }
.modal .stepup-code { margin-top: 8px; }
h1:focus { outline: none; } /* focused after navigation (screen readers), no visible ring */
.task-sent { margin-bottom: 10px; }
.sent-list { margin: 4px 0 0 18px; padding: 0; font-size: 13px; }
.sent-list li { margin: 2px 0; }

/* ---------------------------------------------------------------- Overview dashboard */
.ov { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 18px; }
.ov > * { min-width: 0; }
.ov-top { display: grid; grid-template-columns: 1.35fr 1fr 1.55fr; gap: 14px; }
.ov-alerts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ov-alerts.ov-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ov-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.ov-card a { color: inherit; text-decoration: none; }
.ov-card h2, .ov-title { font-size: 15px; font-weight: 650; margin: 0; display: block; }
.ov-sub { font-size: 13px; color: var(--muted); display: block; }
.ov-big { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; display: block; }
.ov .pct { font-size: 14px; color: var(--muted); font-weight: 550; font-variant-numeric: tabular-nums; }
.ov .pct.ok, .ov .ok { color: var(--ok); }
.ov-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none;
           background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.ov-icon .nav-icon { width: 22px; height: 22px; }
.ov-head { display: flex; gap: 14px; align-items: flex-start; }
.ov-lines { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ov-line { display: grid; grid-template-columns: 18px 44px 1fr; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ov-line strong { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.ov-line .nav-icon { width: 16px; height: 16px; }
.ov-line:hover span { color: var(--text); text-decoration: underline; }
.ov-line.zero, .ov-line.zero strong { color: var(--faint); }
i.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--faint); flex: none; }
i.dot.big { width: 16px; height: 16px; }
i.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
i.dot.warn { background: var(--orange); }
i.dot.off { background: var(--faint); box-shadow: 0 0 0 4px color-mix(in srgb, var(--faint) 18%, transparent); }

/* compliance ring */
.ov-compliance { display: flex; gap: 22px; align-items: center; }
.ov-ring { position: relative; width: 150px; height: 150px; flex: none; }
.ov-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ov-ring circle { fill: none; stroke-width: 12; }
.ring-track { stroke: var(--border); }
.ring-needs { stroke: var(--orange); }
.ring-ok { stroke: var(--ok); stroke-linecap: round; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ok) 45%, transparent)); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label strong { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.ring-label span { font-size: 12px; color: var(--muted); }
.ov-compliance-body { flex: 1; min-width: 0; }
.ov-compliance-body .ov-sub { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.ov-legend { display: grid; grid-template-columns: 14px 48px 56px 1fr; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; color: var(--muted); }
.ov-legend strong { font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }
.ov-legend:hover span:last-child { color: var(--text); text-decoration: underline; }

/* connectivity */
.ov-conn-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 12px; }
.ov-conn-cols > div { padding: 0 16px; }
.ov-conn-cols > div:first-child { padding-left: 0; border-right: 1px solid var(--border); }
.ov-conn-main { display: grid; grid-template-columns: 20px auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
.ov-conn-main .ov-big { grid-column: 2; }
.ov-conn-main .pct { grid-column: 3; }
.ov-conn-label { grid-column: 2 / span 2; font-size: 13px; font-weight: 600; color: var(--muted); }

/* status cards */
.ov-alert { --tone: var(--muted); padding: 0; display: flex; flex-direction: column;
            border-color: color-mix(in srgb, var(--tone) 45%, var(--border));
            background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 12%, var(--surface)), var(--surface) 70%); transition: border-color .15s, transform .15s; }
.ov-alert:hover { border-color: var(--tone); transform: translateY(-1px); }
.ov-alert.warn { --tone: var(--orange); }
.ov-alert.warn .ov-alert-num strong { color: var(--orange-text); }
.ov-alert.danger { --tone: var(--danger); }
.ov-alert.amber { --tone: #c9a227; }
.ov-alert.info { --tone: var(--info); }
.ov-alert.apps { --tone: #1b9bc9; }
.ov-alert.neutral { --tone: var(--faint); }
.ov-alert.is-zero { background: var(--surface); border-color: var(--border); }
.ov-alert-main { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 18px 8px; }
.ov-alert-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--tone);
                 background: color-mix(in srgb, var(--tone) 16%, transparent); }
.ov-alert-icon .nav-icon { width: 24px; height: 24px; }
.ov-alert-num { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.ov-alert-num strong { font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--tone); font-variant-numeric: tabular-nums; }
.ov-alert.is-zero .ov-alert-num strong { color: var(--muted); }
.ov-chevron { color: var(--muted); }
.ov-chevron .nav-icon { width: 18px; height: 18px; }
.ov-alert-split { display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 0 18px 14px 72px; }
.ov-alert-split .ov-line { grid-template-columns: 16px auto auto; }

.ov-legend span:last-child { white-space: nowrap; }
/* Laptop widths (sidebar open): give the compliance card more room and a smaller ring so the legend fits on one line. */
@media (min-width: 1251px) and (max-width: 1560px) {
    .ov-top { grid-template-columns: 1.55fr .85fr 1.45fr; }
}
@media (min-width: 901px) and (max-width: 1250px) {
    .ov-top { grid-template-columns: 1.35fr 1fr !important; }
}
@media (min-width: 901px) and (max-width: 1560px) {
    .ov-compliance { gap: 14px; }
    .ov-ring { width: 118px; height: 118px; }
    .ring-label strong { font-size: 21px; }
    .ov-legend { grid-template-columns: 12px 40px 50px 1fr; gap: 6px; }
}
@media (max-width: 1250px) {
    .ov-top { grid-template-columns: 1fr 1fr; }
    .ov-conn { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    .ov-top, .ov-alerts, .ov-alerts.ov-two { grid-template-columns: 1fr; }
    .ov-compliance { flex-direction: column; align-items: stretch; }
    .ov-ring { align-self: center; }
    .ov-alert-split { padding-left: 18px; }
}
.btn .nav-icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }

/* ---------- update health (install success per update) ---------- */
.uh {
    display: inline-flex; align-items: center; padding: 0 7px; margin-left: 6px; border-radius: 999px; font-size: 11.5px;
    font-weight: 650; font-family: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; text-decoration: none;
    vertical-align: 1px; border: 1px solid transparent;
}
.uh:hover { text-decoration: none; filter: brightness(.97); border-color: currentColor; }
.uh-ok { background: var(--ok-weak); color: var(--ok); }
.uh-warn { background: var(--warn-weak); color: var(--orange-text); }
.uh-danger { background: var(--danger-weak); color: var(--danger); }
.uh-few { background: var(--neutral-weak); color: var(--faint); font-weight: 550; }
.uh-big { font-size: 13px; padding: 1px 9px; margin-left: 0; }
.uh-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; color: var(--muted); }
.uh-legend .uh { margin-left: 0; margin-right: 4px; }
.uh-global { margin-left: 0; gap: 5px; cursor: help; }
.uh-global .uh-n { font-weight: 500; opacity: .75; }
.ov-note {
    display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 14px; border-radius: 10px;
    border: 1px solid var(--danger-weak); background: var(--surface); color: var(--text); text-decoration: none; font-size: 13.5px;
}
.ov-note:hover { text-decoration: none; border-color: var(--danger); }
.ov-note .ov-note-icon { color: var(--danger); display: inline-flex; }
.ov-note .ov-note-go { margin-left: auto; color: var(--muted); white-space: nowrap; }
.chain-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -4px 0 12px; }
.os-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 4px; }
.os-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--neutral-weak); color: var(--muted); font-size: 13px; }
.os-chip strong { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.os-chip.ok strong { color: var(--ok); } .os-chip.warn strong { color: var(--orange-text); } .os-chip.danger strong { color: var(--danger); }
/* ---------- device tags ---------- */
.tag-line { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 1px; }
.tag-chip { display: inline-flex; align-items: center; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; line-height: 18px;
    background: var(--accent-weak); color: var(--accent); border: 1px solid transparent; text-decoration: none; white-space: nowrap; }
a.tag-chip:hover, .tag-chip.as-btn:hover { text-decoration: none; border-color: currentColor; }
.tag-chip.as-btn { cursor: pointer; font-family: inherit; margin: 0 2px; }
.tag-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-size: 13px; line-height: 1; opacity: .7; }
.tag-x:hover { opacity: 1; }
.tag-input { width: 150px; height: 26px; padding: 2px 8px; font-size: 12.5px; }

/* Overview blocks ("Rearrange"): consecutive blocks of one kind share a row layout. */
.ov-block { position: relative; display: flex; flex-direction: column; min-width: 0; }
.ov-block > * { flex: 1 1 auto; }
.ov-bigs { display: flex; flex-wrap: wrap; gap: 14px; }
.ov-bigs > .ov-block { flex: 1 1 0; }
.ov-bigs > [data-arr-id="compliance"] { flex-grow: 1.35; }
.ov-bigs > [data-arr-id="devices"] { flex-grow: 1; }
.ov-bigs > [data-arr-id="connectivity"] { flex-grow: 1.55; }
@media (min-width: 1251px) and (max-width: 1560px) {
    .ov-bigs > [data-arr-id="compliance"] { flex-grow: 1.55; }
    .ov-bigs > [data-arr-id="devices"] { flex-grow: .85; }
    .ov-bigs > [data-arr-id="connectivity"] { flex-grow: 1.45; }
}
@media (max-width: 1250px) {
    .ov-bigs > .ov-block { flex-basis: calc(50% - 7px); }
    .ov-bigs > [data-arr-id="connectivity"] { flex-basis: 100%; }
}
@media (max-width: 900px) { .ov-bigs > .ov-block { flex-basis: 100%; } }
.ov-notes { display: grid; gap: 8px; }
.ov-notes .ov-note { margin-top: 0; }
.ov-wides > .ov-block > .card { margin: 0; }
.ov-halves { gap: 14px; }
.ov-halves:has(> .ov-block:only-child) { grid-template-columns: 1fr; }
.ov-halves > .ov-block > .card { margin: 0; }

.arr-tray { display: grid; gap: 8px; padding: 12px 16px; margin-bottom: 14px; border: 1px dashed var(--accent); border-radius: 10px;
            background: var(--accent-weak); font-size: 13.5px; }
.arr-hidden { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ov.arranging { gap: 18px; }
.ov-block.arr { outline: 2px dashed color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 3px; border-radius: 12px; cursor: grab; padding-top: 40px; }
.ov-block.arr > :not(.arr-bar) { pointer-events: none; user-select: none; }
.ov-block.arr.dragging { opacity: .35; }
.ov-block.drop-before { box-shadow: -6px 0 0 -2px var(--accent); }
.ov-block.drop-after { box-shadow: 6px 0 0 -2px var(--accent); }
.ov-wides > .ov-block.drop-before, .ov-notes > .ov-block.drop-before { box-shadow: 0 -6px 0 -2px var(--accent); }
.ov-wides > .ov-block.drop-after, .ov-notes > .ov-block.drop-after { box-shadow: 0 6px 0 -2px var(--accent); }
.arr-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; gap: 4px; padding: 3px 4px;
           background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 4px 14px rgba(1, 29, 75, .15); }
.arr-bar .btn.sm { padding: 2px 8px; }
.arr-name { font-size: 12px; color: var(--muted); padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; flex: 1 1 auto; min-width: 0; }
.arr-placeholder { min-height: 96px; display: flex; flex-direction: column; justify-content: center; gap: 4px; border-style: dashed; }

@media print { .arr-tray, .arr-bar { display: none !important; } }
/* Phones: the two connectivity columns must fit next to each other. */
@media (max-width: 480px) {
    .ov-conn-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .ov-conn-cols > div { padding: 0 10px; min-width: 0; }
    .ov-conn-cols > div:last-child { padding-right: 0; }
    .ov-conn-main { column-gap: 6px; }
}

/* Patch Compliance report: summary band (navy, icons in the cover's light blue) and the offline / not scanned note. */
.rk-band { display: grid; grid-template-columns: 1fr 1.55fr repeat(4, 1fr); align-items: stretch; margin: 6px 0 12px; padding: 18px 8px;
           border-radius: 12px; background: linear-gradient(135deg, #011d4b 0%, #0a2c66 100%); color: #fff; break-inside: avoid; }
/* Block layout on purpose: flex columns inside this grid break in Chromium's PDF printing (band fills the page). */
.rk-cell { display: block; padding: 2px 18px; border-left: 1px solid rgba(255, 255, 255, .16); min-width: 0; }
.rk-cell:first-child { border-left: 0; }
.rk-cell .nav-icon { display: block; width: 34px; height: 34px; margin-bottom: 8px; color: #3899c9; stroke-width: 1.9; }
.rk-label { display: block; min-height: 2.6em; font-size: 14px; line-height: 1.3; color: #e6edf8; font-weight: 500; }
.rk-num { display: block; font-size: 36px; font-weight: 800; line-height: 1; margin-top: 6px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.rk-big { font-size: 46px; }
.rk-sub { display: block; font-size: 14px; color: #c8d6ee; margin-top: 4px; }
.rk-main .nav-icon { width: 40px; height: 40px; margin-bottom: 2px; }
.rk-main .rk-label { min-height: 1.3em; }
.rk-note { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); break-inside: avoid; }
.rk-note.attention { border-color: #f2b14c; background: #fff7e8; color: #1a1a1c; }
.rk-note-item { display: flex; align-items: center; gap: 16px; padding: 14px 26px; font-size: 15px; color: var(--muted); }
.rk-note.attention .rk-note-item { color: #1a1a1c; }
.rk-note-item + .rk-note-item { border-left: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.rk-note-item .nav-icon { width: 34px; height: 34px; color: #8a94a8; flex: none; }
.rk-note-item strong { font-size: 34px; font-weight: 800; line-height: 1; min-width: 28px; color: var(--text); }
.rk-note.attention .rk-note-item strong { color: #1a1a1c; }
.rk-note-item.warn .nav-icon, .rk-note-item.warn strong { color: #c2620a !important; }
@media screen and (max-width: 900px) {
    .rk-band { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
    .rk-cell:nth-child(odd) { border-left: 0; }
    .rk-note { grid-template-columns: 1fr; }
    .rk-note-item + .rk-note-item { border-left: 0; border-top: 1px solid var(--border); }
}
/* PDF / print: sizes of the approved design (A4) */
@media print {
    .rk-band { padding: 18px 6px 16px; }
    .rk-cell { padding: 2px 15px; }
    .rk-cell .nav-icon { width: 36px; height: 36px; margin-bottom: 9px; }
    .rk-main .nav-icon { width: 42px; height: 42px; }
    .rk-label { font-size: 13px; }
    .rk-num { font-size: 36px; margin-top: 8px; }
    .rk-big { font-size: 46px; }
    .rk-sub { font-size: 13px; }
    .rk-note-item { padding: 12px 24px; font-size: 14px; }
    .rk-note-item .nav-icon { width: 32px; height: 32px; }
    .rk-note-item strong { font-size: 34px; }
}

/* Silver license: Applications stays in the menu with a "Gold" mark; hovering it explains the Gold plan. */
.side a.nav.nav-gold { position: relative; }
.gold-badge { margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    padding: 1px 7px; border-radius: 999px; background: linear-gradient(135deg, #f6d365, #d4a017); color: #3d2c00; cursor: help; }
.gold-tip { display: none; position: absolute; left: 6px; right: 6px; top: calc(100% + 4px); z-index: 30; padding: 10px 12px;
    border-radius: 8px; background: #fff; color: #1a1a1c; font-size: 12.5px; font-weight: 400; line-height: 1.45;
    box-shadow: 0 8px 24px rgba(0,0,0,.28); border: 1px solid #e8d48a; }
.gold-tip strong { display: block; color: #8a6200; margin-bottom: 3px; }
.gold-badge:hover + .gold-tip, .gold-badge:focus + .gold-tip { display: block; }

/* Demo environment (DEMO_MODE=true): a pill in the top bar. */
.demo-pill { display: inline-block; margin-right: 12px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--info-weak); color: var(--info); text-decoration: none; white-space: nowrap; }
.demo-pill:hover { text-decoration: none; filter: brightness(0.97); }
