/* pcarmour console (styles shared with PCArmour Server Shield). Fonts are self-hosted from /assets/fonts (SIL OFL licences alongside); no font CDN. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
}

:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #17202b;
  --muted: #5c6878;
  --border: #d9dee6;
  --brand: #1673d4;
  --brand-strong: #0f5bb0;
  --brand-ink: #ffffff;
  --ok: #1f8a4c;
  --ok-bg: #e3f4ea;
  --warn: #a35f00;
  --warn-bg: #fff1d6;
  --bad: #c22d2d;
  --bad-bg: #fde6e6;
  --info-bg: #e5f0fc;
  --teal: #0f9c94;
  --teal-bg: #dcf5f2;
  --steel: #2a3340;
  --series-0: #1673d4;
  --series-1: #e07b00;
  --series-2: #2a9d8f;
  --series-3: #8e5cd9;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141a;
    --surface: #171e27;
    --surface-2: #1f2833;
    --text: #e6ebf1;
    --muted: #9aa6b5;
    --border: #2c3744;
    --brand: #4c9cf0;
    --brand-strong: #78b4f4;
    --brand-ink: #08121e;
    --ok: #4cc382;
    --ok-bg: #133524;
    --warn: #f0b04c;
    --warn-bg: #3a2a0d;
    --bad: #f07171;
    --bad-bg: #3d1717;
    --info-bg: #142739;
  --teal: #3fd0c6;
  --teal-bg: #0f3330;
    --teal: #3fd0c6;
    --teal-bg: #0f3330;
    --steel: #0b0f14;
    --series-0: #4c9cf0;
    --series-1: #f0a04c;
    --series-2: #4cc9b0;
    --series-3: #b48cf0;
    --shadow: none;
    color-scheme: dark;
  }
}
/* The same dark colours when someone chooses Dark (Your account, or the switch at the top right). */
:root[data-theme="dark"] {
  --bg: #0f141a;
  --surface: #171e27;
  --surface-2: #1f2833;
  --text: #e6ebf1;
  --muted: #9aa6b5;
  --border: #2c3744;
  --brand: #4c9cf0;
  --brand-strong: #78b4f4;
  --brand-ink: #08121e;
  --ok: #4cc382;
  --ok-bg: #133524;
  --warn: #f0b04c;
  --warn-bg: #3a2a0d;
  --bad: #f07171;
  --bad-bg: #3d1717;
  --info-bg: #142739;
  --steel: #0b0f14;
  --series-0: #4c9cf0;
  --series-1: #f0a04c;
  --series-2: #4cc9b0;
  --series-3: #b48cf0;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
code, .mono { font-family: var(--mono); font-size: .9em; }
code { overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.right, .table th.right, .table td.right { text-align: right; }
.nowrap { white-space: nowrap; }
.wrap { overflow-wrap: anywhere; min-width: 16rem; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 1rem; padding: .5rem 1.25rem; background: var(--steel); color: #fff; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .5rem; color: #fff; font-size: 1rem; }
.brand:hover { text-decoration: none; }
.brand strong { font-weight: 700; }
.mainnav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.mainnav a { color: #cfd8e3; padding: .4rem .65rem; border-radius: 6px; }
.mainnav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.mainnav a.active { background: rgba(255, 255, 255, .14); color: #fff; }
.navmenu { position: relative; }
.navmenu > summary { list-style: none; cursor: pointer; color: #cfd8e3; padding: .4rem .65rem; border-radius: 6px; }
.navmenu > summary::-webkit-details-marker { display: none; }
.navmenu > summary::after { content: " ▾"; font-size: .8em; }
.navmenu > summary:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.navmenu > summary.active { background: rgba(255, 255, 255, .14); color: #fff; }
.navmenu-items { position: absolute; left: 0; top: calc(100% + .3rem); z-index: 30; min-width: 12rem; display: flex; flex-direction: column; gap: .1rem;
  padding: .35rem; background: var(--steel); border: 1px solid rgba(255, 255, 255, .15); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.usermenu { display: flex; gap: .75rem; align-items: center; }
.usermenu a, .usermenu .linklike { color: #cfd8e3; }
.usermenu form { margin: 0; }
.nav-toggle { display: none; }
.linklike { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--brand); }

.banner { padding: .55rem 1.25rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: .9rem; }
.banner form { margin: 0; }
.banner-view { background: var(--warn-bg); color: var(--text); border-bottom: 1px solid var(--border); }
.banner-global { background: var(--info-bg); border-bottom: 1px solid var(--border); }
.banner-warn { background: var(--bad-bg); border-bottom: 1px solid var(--border); }

.container { max-width: 1280px; margin: 0 auto; padding: 1.25rem; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head p { margin: .25rem 0 0; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); min-width: 0; }
.panel.narrow { max-width: 560px; margin: 2rem auto; }
.panel-highlight { border-color: var(--brand); }
.panel-danger { border-color: var(--bad); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.panel-head h2 { margin: 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 0 1.25rem; }
/* A grid column may shrink below its longest word (folder paths), so it never pushes the page sideways. */
.cols > * { min-width: 0; }
main { overflow-wrap: break-word; } /* a word too long for its line breaks instead of pushing the page sideways */
[hidden] { display: none !important; }
.add-box { margin-top: 1rem; }
.add-box > summary { list-style: none; display: inline-block; }
.add-box > summary::-webkit-details-marker { display: none; }
.add-box[open] > summary { margin-bottom: .25rem; }
.inline-label { flex-wrap: nowrap; align-items: center; gap: .4rem; font-weight: 400; }
select.auto-width { width: auto; }
.wrap-any { overflow-wrap: anywhere; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .75rem; }
.empty { text-align: center; padding: 2rem 1rem; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; display: flex; flex-direction: column; color: var(--text); box-shadow: var(--shadow); }
a.tile:hover { text-decoration: none; border-color: var(--brand); }
.tile-num { font-size: 1.6rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile-label { color: var(--muted); font-size: .85rem; }
.tile-num-sm { font-size: 1.2rem; white-space: nowrap; }
.tile-ok .tile-num { color: var(--ok); }
.tile-warn { border-color: var(--warn); }
.tile-warn .tile-num { color: var(--warn); }
.tile-bad { border-color: var(--bad); }
.tile-bad .tile-num { color: var(--bad); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; padding: .5rem .6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.disabled td { opacity: .55; }
.table-form td { vertical-align: middle; }
meter { width: 70px; height: .7rem; vertical-align: middle; }

/* Pills, badges, dots */
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; vertical-align: middle; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-info { background: var(--info-bg); color: var(--brand); }
.pill-neutral { background: var(--surface-2); color: var(--muted); }
.badge { display: inline-block; min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; font-size: .75rem; font-weight: 700; text-align: center; text-transform: capitalize; }
.badge.sev-critical { background: var(--bad); color: #fff; }
.badge.sev-warning { background: var(--warn); color: #fff; }
.sev-text-critical { color: var(--bad); }
.sev-text-warning { color: var(--warn); }
.sev-text-ok { color: var(--ok); }
.page-head .actions { margin-bottom: 0; }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .45rem; vertical-align: middle; }
.dot-ok { background: var(--ok); }
.dot-bad { background: var(--bad); }
.dot-muted { background: var(--muted); }
.dot-warn { background: var(--warn); }
.dot-info { background: var(--muted); }

.alert-list, .svc-list, .event-list, .plain { list-style: none; margin: 0; padding: 0; }
.alert-list li, .event-list li, .svc-list li, .plain li { padding: .4rem 0; border-bottom: 1px solid var(--border); }
.alert-list li:last-child, .event-list li:last-child, .svc-list li:last-child, .plain li:last-child { border-bottom: 0; }
.svc-list { columns: 2; }
.svc-list li { break-inside: avoid; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* Forms and buttons */
/* A label's text and any hint ("(optional)") share a line; its field takes the next one. */
label { display: flex; flex-flow: row wrap; align-items: baseline; gap: .3rem .35rem; font-weight: 500; font-size: .9rem; }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { flex: 1 0 100%; }
label > input.num:not([type=checkbox]):not([type=radio]) { flex: 0 0 6.5rem; margin-right: calc(100% - 6.5rem); } /* short, but still on a line of its own */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=url], select {
  font: inherit; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); width: 100%;
}
input:focus, select:focus, button:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
input:disabled { background: var(--surface-2); color: var(--muted); }
input.num { width: 6.5rem; display: inline-block; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem 1rem; align-items: end; margin-top: 1rem; }
.form-actions { display: flex; gap: .5rem; align-items: end; }
.inline-form { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; margin: .75rem 0; }
.inline-form label { flex-wrap: nowrap; align-items: center; gap: .4rem; }
.inline-form label > input:not([type=checkbox]):not([type=radio]), .inline-form label > select, .inline-label > input:not([type=checkbox]):not([type=radio]), .inline-label > select { flex: 0 1 auto; }
.inline-form input[type=text], .inline-form input[type=search], .inline-form select { width: auto; max-width: 100%; }
.panel-head .inline-form, .page-head .inline-form { margin: 0; align-items: center; }
.inline-form input[type=search] { min-width: 16rem; }
form.inline { display: inline; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.actions form { margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font: inherit; font-weight: 600; font-size: .9rem; padding: .5rem .9rem; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); }
.btn-warn { color: var(--warn); }
.btn-small { padding: .25rem .6rem; font-size: .8rem; }

.inline-details { display: inline-block; position: relative; }
.inline-details summary { list-style: none; }
.inline-details summary::-webkit-details-marker { display: none; }
/* Inside a scrolling table a pop-over would be clipped to the table's height: there it opens in place. */
.table-wrap .details-body { position: static; min-width: 0; box-shadow: none; margin-top: .4rem; }
.details-body { position: absolute; right: 0; z-index: 10; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem 1rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); min-width: 420px; text-align: left; }

textarea { font: inherit; font-family: var(--mono); font-size: .85rem; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); width: 100%; resize: vertical; }
label.check { flex-wrap: nowrap; align-items: center; gap: .5rem; font-weight: 400; margin: .3rem 0; }
label.check input { width: auto; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 1rem; margin: .25rem 0 .75rem; }
fieldset.plain-fieldset, fieldset.dest-fields { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem 1rem 1rem; margin: .75rem 0; min-width: 0; }
fieldset legend { font-weight: 600; padding: 0 .35rem; }
.app-setup { border-left: 3px solid var(--brand); padding: .25rem 0 .25rem .75rem; margin: .5rem 0 .75rem; }
.app-setup p { margin: .35rem 0; }
.kit { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1rem; white-space: pre-wrap; word-break: break-all; font-size: .85rem; max-height: 420px; overflow: auto; }
.seg-links { flex-wrap: wrap; }
.seg-links a { font-size: .85rem; padding: .35rem .8rem; color: var(--muted); border-right: 1px solid var(--border); }
.seg-links a:last-child { border-right: 0; }
.seg-links a.active { background: var(--brand); color: var(--brand-ink); text-decoration: none; }
details summary { cursor: pointer; }

.finding-list { list-style: none; margin: 0; padding: 0; }
.finding { padding: .7rem 0 .7rem .75rem; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.finding-critical { border-left-color: var(--bad); }
.finding-warning { border-left-color: var(--warn); }
.finding-meta { margin: .15rem 0 .25rem !important; }
.finding-detail { color: var(--text); }
.finding-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-start; }
.ignore-box > summary { list-style: none; }
.ignore-box > summary::-webkit-details-marker { display: none; }
.ignore-box[open] > summary { margin-bottom: .4rem; }
.finding-group { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .9rem; margin-bottom: .75rem; }
.finding-group > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .25rem 0; }
.finding-group > summary a { margin-left: auto; }
.finding-sub { margin: .4rem 0 .2rem; }
.finding-sub > summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: .3rem 0; }
.finding-section > summary { cursor: pointer; list-style: none; }
.finding-section > summary::-webkit-details-marker { display: none; }
.finding-section > summary h2, .finding-section > summary h3 { display: inline-flex; gap: .4rem; align-items: baseline; margin: 0; }
.finding-section > summary h2::before, .finding-section > summary h3::before { content: "▸"; color: var(--muted); font-size: .85em; }
.finding-section[open] > summary h2::before, .finding-section[open] > summary h3::before { content: "▾"; }
.finding-section[open] > summary { margin-bottom: .5rem; }
details.finding-section:not(.panel) { margin: 1rem 0 .5rem; }
a.tile { color: inherit; }
a.tile:hover { text-decoration: none; border-color: var(--brand); }
.finding:last-child { border-bottom: 0; }
.finding-head { display: flex; gap: .5rem; align-items: baseline; }
.finding p { margin: .3rem 0; }
.finding .actions { margin-top: .4rem; }
.finding .inline-form { margin: 0; }
.badge.sev-ok { background: var(--ok); color: #fff; }
.finding-head .badge { flex: none; }
.log-lines.tall { max-height: 32rem; }
.diff-add { color: var(--ok); }
.diff-del { color: var(--bad); }
.diff span { display: block; }
.config-tabs { margin-bottom: 1rem; flex-wrap: wrap; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-item { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .4rem 1rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.alert-item:last-child { border-bottom: 0; }
.alert-main { flex: 1 1 22rem; min-width: 0; }
.alert-main p { margin: .3rem 0 0; }
.alert-main .wrap { min-width: 0; }
.alert-action { margin: 0; flex: none; }
.backup-progress progress { display: block; width: 100%; height: .7rem; margin: .35rem 0 .5rem; accent-color: var(--brand); }
.backup-progress p { margin: .2rem 0; }
.table-compact td, .table-compact th { padding-top: .3rem; padding-bottom: .3rem; }
.log-lines { margin: .5rem 0 0; padding: .6rem .75rem; background: var(--surface-2); border-radius: 6px; font-size: .78rem; line-height: 1.45; white-space: pre-wrap; word-break: break-all; max-height: 16rem; overflow: auto; }
.finding-files { margin: .3rem 0; }
.finding-files summary { cursor: pointer; color: var(--muted); }
.finding-files ul { margin: .3rem 0 0; padding-left: 1.2rem; max-height: 14rem; overflow-y: auto; font-family: ui-monospace, Consolas, monospace; }
.badge.sev-info { background: var(--surface-2); color: var(--muted); }

/* Flash messages */
.flash { padding: .65rem .9rem; border-radius: 6px; margin-bottom: 1rem; border: 1px solid transparent; }
.flash-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.flash-info { background: var(--info-bg); border-color: var(--border); }
.flash-warning { background: var(--warn-bg); border-color: var(--warn); }
.weekday-picks { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: .25rem 0 .5rem; }
.seg-radio { display: flex; gap: 1.25rem; }

/* Code boxes */
.codebox { display: flex; gap: .5rem; align-items: center; background: var(--steel); color: #e8eef5; border-radius: 6px; padding: .6rem .75rem; margin: .5rem 0; }
.codebox code { flex: 1; overflow-x: auto; white-space: nowrap; color: inherit; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem 1rem; list-style: none; padding: 0; }
.codes code { font-size: 1rem; }
.secret { letter-spacing: .05em; word-break: break-all; }

/* Segmented control */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { font: inherit; font-size: .8rem; padding: .3rem .65rem; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button.active { background: var(--brand); color: var(--brand-ink); }

/* Charts */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.chart { margin: 0; min-width: 0; }
.chart figcaption { font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.chart-svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart-svg .grid { stroke: var(--border); stroke-width: 1; }
.chart-svg .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-svg .line { fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.chart-svg .line.s0 { stroke: var(--series-0); }
.chart-svg .line.s1 { stroke: var(--series-1); }
.chart-svg .line.s2 { stroke: var(--series-2); }
.chart-svg .line.s3 { stroke: var(--series-3); }
.chart-svg .dot.s0 { fill: var(--series-0); } .chart-svg .dot.s1 { fill: var(--series-1); }
.chart-svg .dot.s2 { fill: var(--series-2); } .chart-svg .dot.s3 { fill: var(--series-3); }
.chart-svg .cursor { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .8rem; color: var(--muted); }
.chart-legend .key { white-space: nowrap; }
.chart-legend .key::before { content: ""; display: inline-block; width: .8rem; height: .2rem; margin-right: .35rem; vertical-align: middle; border-radius: 2px; }
.chart-legend .key.s0::before { background: var(--series-0); }
.chart-legend .key.s1::before { background: var(--series-1); }
.chart-legend .key.s2::before { background: var(--series-2); }
.chart-legend .key.s3::before { background: var(--series-3); }
.chart-tip { font-size: .8rem; color: var(--text); margin-top: .2rem; font-variant-numeric: tabular-nums; }

/* Sign-in pages */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.75rem; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.auth-brand strong { display: block; font-size: 1.15rem; }
.auth-brand span { color: var(--muted); font-size: .9rem; }
.auth-card h1 { font-size: 1.3rem; margin-bottom: .75rem; }
.steps { padding-left: 1.2rem; }
.next-step { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; background: var(--info-bg); border: 1px solid var(--brand); border-radius: var(--radius); padding: .75rem 1rem; margin: .5rem 0 1rem; }
.next-text { flex: 1 1 320px; min-width: 0; }
.next-text > * { display: block; }
.next-text strong { font-size: 1.05rem; margin: .1rem 0 .2rem; }
.next-action { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.edit-row > td { background: var(--surface-2); padding: 1rem 1.25rem; }
.edit-row .form-grid { margin-top: 0; margin-bottom: .9rem; }
.edit-tests { margin-top: .9rem; align-items: center; }
.theme-switch { display: inline-flex; align-items: center; }
.sort-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .25rem; }
.sort-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
/* The arrows are decoration (the heading's aria-sort says the order), so they're kept out of the button's name. */
.sort-btn::after { content: "↕"; content: "↕" / ""; opacity: .35; font-size: .85em; }
th[aria-sort="ascending"] .sort-btn::after { content: "↑"; content: "↑" / ""; opacity: 1; }
th[aria-sort="descending"] .sort-btn::after { content: "↓"; content: "↓" / ""; opacity: 1; }
.health-icons { display: flex; gap: .3rem; flex-wrap: wrap; }
.health { display: inline-flex; padding: 4px; border-radius: 50%; line-height: 0; }
a.health:hover { text-decoration: none; filter: brightness(1.1); }
.health-ok { color: var(--ok); background: var(--ok-bg); }
.health-busy { color: var(--brand); background: var(--info-bg); }
.health-failed { color: var(--bad); background: var(--bad-bg); }
.health-waiting { color: var(--warn); background: var(--warn-bg); }
.health-recovering { color: var(--teal); background: var(--teal-bg); }
.health-watch { color: var(--muted); background: var(--surface-2); }
.scroll-list { max-height: 20rem; overflow-y: auto; }
.attack-chart { width: 100%; height: auto; display: block; }
.attack-axis { stroke: var(--border); }
.attack-label { fill: var(--muted); font-size: 13px; }
.attack-hit { fill: transparent; }
.attack-hit:hover { fill: var(--text); fill-opacity: .06; }
.attack-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .5rem 0 0; }
.attack-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; }
.ak-ssh { fill: #1673d4; background: #1673d4; }
.ak-sip { fill: #7a4fd1; background: #7a4fd1; }
.ak-pbxadmin { fill: #b07be8; background: #b07be8; }
.ak-mail { fill: #0f9c94; background: #0f9c94; }
.ak-webmail { fill: #5cc8bf; background: #5cc8bf; }
.ak-panel { fill: #e07b00; background: #e07b00; }
.ak-wp { fill: #c22d2d; background: #c22d2d; }
.ak-fw_list, .ak-fw_list_watch { fill: #2a3340; background: #2a3340; }
.ak-fw_country, .ak-fw_country_watch { fill: #8a96a6; background: #8a96a6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ak-fw_list, :root:not([data-theme="light"]) .ak-fw_list_watch { fill: #c8d1dc; background: #c8d1dc; } }
:root[data-theme="dark"] .ak-fw_list, :root[data-theme="dark"] .ak-fw_list_watch { fill: #c8d1dc; background: #c8d1dc; }
.health-legend .health { padding: 2px; vertical-align: -5px; }
.health-key { padding: 0 .35rem; border-radius: 4px; font-weight: 600; }
.health-list { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .25rem; }
.health-list .health { vertical-align: -6px; }
.act-icons { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.act-icon { display: inline-flex; color: var(--brand); vertical-align: -3px; }
.act-icon.waiting { color: var(--muted); }
.act-recent li { padding: .15rem 0; }
@keyframes act-pulse { 50% { opacity: .4; } }
@media (prefers-reduced-motion: no-preference) { .act-icon.running { animation: act-pulse 2.4s ease-in-out infinite; } }
.choose-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; padding: .3rem 0; }
.qr { width: 220px; height: 220px; margin: .75rem auto; }
.qr svg { width: 100%; height: 100%; border-radius: 6px; }

/* Narrow screens */
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; margin-left: auto; background: none; border: 1px solid rgba(255, 255, 255, .3); color: #fff; border-radius: 6px; padding: .3rem .7rem; font: inherit; }
  .mainnav, .usermenu { display: none; width: 100%; }
  .nav-open .mainnav { display: flex; flex-direction: column; }
  .navmenu-items { position: static; box-shadow: none; border: 0; padding: 0 0 0 .75rem; min-width: 0; }
  .nav-open .usermenu { display: flex; justify-content: space-between; padding: .5rem .65rem; }
  .cols { grid-template-columns: 1fr; }
  .container { padding: 1rem; }
  .details-body { min-width: 280px; }
  .svc-list { columns: 1; }
}

/* Website recheck */
.recheck { border: 1px solid var(--border); border-radius: 8px; padding: .75rem .9rem; margin-bottom: 1rem; background: var(--surface-2); }
.recheck-buttons { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0; }
.recheck > p { margin: .5rem 0 0; }
.recheck-status { margin-top: .6rem; }
.recheck-status > p { margin: 0 0 .3rem; }
.recheck-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.recheck-steps li { display: flex; flex-wrap: wrap; gap: .35rem; align-items: baseline; }

/* Scheduled tasks */
.cron-table td { vertical-align: top; }
.cron-table .cron-when { width: 15rem; }
.cron-table td:last-child { width: 12rem; }
.cron-table details { margin-top: .25rem; }
.cron-table details code { display: block; margin-top: .2rem; white-space: pre-wrap; word-break: break-all; }
.cron-table .cron-when .mono { white-space: nowrap; }
.finding .actions { align-items: center; }
@media (max-width: 700px) {
  /* One card per task on phones: when, what, then where the output goes. */
  .cron-table, .cron-table tbody { display: block; width: 100%; }
  .cron-table thead { display: none; }
  .cron-table tr { display: block; padding: .6rem 0; border-bottom: 1px solid var(--border); }
  .cron-table td { display: block; width: auto !important; padding: .1rem 0; border: 0; overflow-wrap: anywhere; }
  .cron-table td:last-child::before { content: "Output: "; color: var(--muted); }
}

/* Backup plan pages */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.tiles-compact { margin-bottom: .75rem; }
.tiles-compact .tile { padding: .6rem .75rem; }
.add-backup { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.add-backup li { display: grid; grid-template-columns: 13rem 1fr; gap: .75rem; align-items: baseline; }
.add-backup li .btn, .add-backup li form .btn { width: 100%; }
@media (max-width: 700px) { .add-backup li { grid-template-columns: 1fr; gap: .25rem; } }
@media (max-width: 700px) { .facts { grid-template-columns: 1fr; gap: 0 1rem; } .facts dd { margin-bottom: .4rem; } }

.plain-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .2rem; }
.inline-details { display: inline-block; margin-left: .4rem; }

/* Backup schedule timeline (SVG) and AI plans */
.timeline { width: 100%; height: auto; display: block; margin: .25rem 0 .5rem; }
.timeline .tl-grid { stroke: var(--border); stroke-width: 1; }
.timeline .tl-hour { fill: var(--muted); font-size: 11px; }
.timeline .tl-label { fill: var(--text); font-size: 12px; }
.timeline .tl-wg { fill: var(--muted); }
.timeline .tl-run { fill: var(--brand); }
.timeline .tl-long { fill: var(--brand); opacity: .28; }
.timeline .tl-unknown { fill: var(--muted); opacity: .6; }
.timeline .tl-now { stroke: var(--bad, #c0392b); stroke-width: 1.5; stroke-dasharray: 3 3; }
.ai-plan { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: .75rem; }
.ai-plan h3 { margin-top: 0; }
tr.row-changed td { background: var(--surface-2); }
.ai-check-findings { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .5rem; }
.ai-check-findings li { border-left: 3px solid var(--border); padding: .2rem 0 .2rem .7rem; }
.ai-check-findings li.aif-ok { border-left-color: var(--ok, #2e7d32); }
.ai-check-findings li.aif-warning { border-left-color: var(--warn, #b26a00); }
.ai-check-findings li.aif-critical { border-left-color: var(--bad, #c0392b); }

.tiles .tile-num { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.country-list { max-height: 22rem; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: .5rem .75rem; }
.server-only { margin: .5rem 0 .9rem; }
.server-only h4 { margin: .75rem 0 .35rem; }

/* ---------- server pages: shared header, tabs, waiting banner, status cards ---------- */
.server-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.server-title h1 { margin: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.server-title h1 a { color: inherit; }
.server-title p { margin: .25rem 0 0; }
.server-shortcuts { margin: 0; }
.server-tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 1rem; scrollbar-width: thin; }
.server-tabs a { padding: .55rem .85rem; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; }
.server-tabs a:hover { color: var(--text); text-decoration: none; }
.server-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-badge { font-size: .72rem; font-weight: 700; padding: .05rem .4rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tab-badge-bad { background: var(--bad-bg); color: var(--bad); }
.tab-badge-warn { background: var(--warn-bg); color: var(--warn); }
.tab-badge-ok { background: var(--ok-bg); color: var(--ok); }
.page-sub { margin: 0 0 .75rem; }
.page-sub-head h2 { margin: 0; }
.waiting-banner { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem; margin-bottom: 1rem; border-radius: var(--radius);
  background: var(--info-bg); border: 2px solid var(--brand); }
.waiting-banner .small { margin-top: .2rem; color: var(--muted); }
.spinner { flex: none; width: 1.1rem; height: 1.1rem; margin-top: .15rem; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--brand); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: var(--brand); } }
.big-banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.1rem; margin-bottom: 1rem; border-radius: var(--radius); border: 2px solid; }
.big-banner-warn { background: var(--warn-bg); border-color: var(--warn); }
.btn-big { padding: .7rem 1.2rem; font-size: 1rem; }
.status-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.status-card { background: var(--surface); border: 1px solid var(--border); border-left-width: 6px; border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); color: var(--text); display: flex; flex-direction: column; gap: .35rem; }
.status-card h2 { margin: 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.status-card p { margin: 0; }
.status-card .actions { margin: .35rem 0 0; }
.status-big { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.status-ok { border-left-color: var(--ok); } .status-ok .status-big { color: var(--ok); }
.status-warn { border-left-color: var(--warn); } .status-warn .status-big { color: var(--warn); }
.status-wait { border-left-color: var(--brand); background: var(--info-bg); } .status-wait .status-big { color: var(--brand); }
.status-neutral { border-left-color: var(--warn); }
.status-off { border-left-color: var(--border); } .status-off .status-big { color: var(--muted); }
.status-bad { border-left-color: var(--bad); } .status-bad .status-big { color: var(--bad); }
.status-info { border-left-color: var(--brand); }
.status-cards-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.status-card .actions { margin-top: auto; padding-top: .35rem; }
a.status-link:hover { text-decoration: none; border-color: var(--brand); }
.status-link .link { color: var(--brand); font-weight: 600; }
.live-note { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; background: var(--surface); border: 2px solid var(--brand); border-radius: var(--radius); padding: .6rem .8rem; box-shadow: var(--shadow); }
.explain li { margin-bottom: .4rem; }
@media (max-width: 700px) {
  .server-shortcuts { width: 100%; }
  .status-big { font-size: 1.25rem; }
}
.plan-use { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; margin: .75rem 0; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2, var(--surface)); }
.plan-use fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.plan-use legend { font-weight: 600; margin-bottom: .3rem; }
.plan-use .check .muted { display: block; margin-left: 1.6rem; }
.plan-banner { border-left: 6px solid var(--brand); }
/* AI health report and explainer */
.ai-cols { align-items: stretch; }
.ai-box { display: flex; flex-direction: column; }
.ai-box .actions { margin-top: auto; padding-top: .5rem; }
.ai-working { display: flex; gap: .6rem; align-items: center; background: var(--info-bg); padding: .5rem .75rem; border-radius: var(--radius); }
.prio-list { margin: .25rem 0 .5rem; padding-left: 1.4rem; }
.prio-list li { margin-bottom: .25rem; }
.parts-list { margin: .25rem 0; padding-left: 1.1rem; }
.parts-list li { margin-bottom: .3rem; }
.prio-cards { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.prio-cards li { border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .8rem; }
.prio-cards p { margin: .3rem 0 0; }
.report-head .report-headline { font-size: 1.25rem; }
.report-areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .75rem; }
.report-areas h3 { margin: 0; font-size: 1rem; }
.mark-bad { fill: var(--bad); }
.ak-imunify_waf { fill: #7b4fc9; background: #7b4fc9; }
.ak-imunify_ids { fill: #2a9d8f; background: #2a9d8f; }
.waf-leave { margin-top: .3rem; }
.ak-fw_local { fill: #c2570c; background: #c2570c; }

/* Run commands (signed scripts) */
.run-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; }
.run-template { display: flex; flex-direction: column; gap: .25rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 8px; color: inherit; text-decoration: none; background: var(--surface); }
.run-template:hover, .run-template.active { border-color: var(--accent, #2f6fed); }
.run-template .pill { align-self: flex-start; }
.run-script-label { display: block; margin-top: 1rem; }
.run-script { min-height: 16rem; tab-size: 2; white-space: pre; overflow: auto; }
.run-servers { border: 1px solid var(--border); border-radius: 8px; margin: .5rem 0; padding: .4rem .8rem .6rem; display: grid; gap: .35rem; }
.run-servers legend { font-weight: 600; padding: 0 .3rem; }
.run-output { font-family: var(--mono); font-size: .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .6rem .75rem; overflow: auto; max-height: 28rem; white-space: pre-wrap; word-break: break-word; }
.run-answer { margin: .5rem 0; }
.run-answer summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ak-recon { fill: #c2762b; background: #c2762b; }

/* Server overview: the attention summary, section labels, and disk bars */
.attention { border: 1px solid var(--border); border-left-width: 5px; border-radius: 8px; padding: .75rem 1rem; margin: 1rem 0; background: var(--surface); }
.attention.status-ok { border-left-color: var(--ok); }
.attention.status-info { border-left-color: var(--muted); }
.attention.status-warn { border-left-color: var(--warn); }
.attention.status-bad { border-left-color: var(--bad); }
.attention-head { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; font-size: 1.05rem; }
.attention-list { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .3rem; }
.section-label { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1.25rem 0 .5rem; }
.diskbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.diskbar-head { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
.diskbar-pct { margin-left: auto; font-weight: 600; }
.diskbar { height: .9rem; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: .3rem 0; }
.diskbar-fill { display: block; height: 100%; border-radius: 999px; }
.diskbar-fill.diskbar-ok { background: var(--ok); } .diskbar-fill.diskbar-warn { background: var(--warn); } .diskbar-fill.diskbar-bad { background: var(--bad); }
.diskbar-pct.diskbar-ok { color: var(--ok); } .diskbar-pct.diskbar-warn { color: var(--warn); } .diskbar-pct.diskbar-bad { color: var(--bad); }
.badge.sev-info { background: var(--surface-2); color: var(--muted); }
.w-0 { width: 0%; }
.w-1 { width: 1%; }
.w-2 { width: 2%; }
.w-3 { width: 3%; }
.w-4 { width: 4%; }
.w-5 { width: 5%; }
.w-6 { width: 6%; }
.w-7 { width: 7%; }
.w-8 { width: 8%; }
.w-9 { width: 9%; }
.w-10 { width: 10%; }
.w-11 { width: 11%; }
.w-12 { width: 12%; }
.w-13 { width: 13%; }
.w-14 { width: 14%; }
.w-15 { width: 15%; }
.w-16 { width: 16%; }
.w-17 { width: 17%; }
.w-18 { width: 18%; }
.w-19 { width: 19%; }
.w-20 { width: 20%; }
.w-21 { width: 21%; }
.w-22 { width: 22%; }
.w-23 { width: 23%; }
.w-24 { width: 24%; }
.w-25 { width: 25%; }
.w-26 { width: 26%; }
.w-27 { width: 27%; }
.w-28 { width: 28%; }
.w-29 { width: 29%; }
.w-30 { width: 30%; }
.w-31 { width: 31%; }
.w-32 { width: 32%; }
.w-33 { width: 33%; }
.w-34 { width: 34%; }
.w-35 { width: 35%; }
.w-36 { width: 36%; }
.w-37 { width: 37%; }
.w-38 { width: 38%; }
.w-39 { width: 39%; }
.w-40 { width: 40%; }
.w-41 { width: 41%; }
.w-42 { width: 42%; }
.w-43 { width: 43%; }
.w-44 { width: 44%; }
.w-45 { width: 45%; }
.w-46 { width: 46%; }
.w-47 { width: 47%; }
.w-48 { width: 48%; }
.w-49 { width: 49%; }
.w-50 { width: 50%; }
.w-51 { width: 51%; }
.w-52 { width: 52%; }
.w-53 { width: 53%; }
.w-54 { width: 54%; }
.w-55 { width: 55%; }
.w-56 { width: 56%; }
.w-57 { width: 57%; }
.w-58 { width: 58%; }
.w-59 { width: 59%; }
.w-60 { width: 60%; }
.w-61 { width: 61%; }
.w-62 { width: 62%; }
.w-63 { width: 63%; }
.w-64 { width: 64%; }
.w-65 { width: 65%; }
.w-66 { width: 66%; }
.w-67 { width: 67%; }
.w-68 { width: 68%; }
.w-69 { width: 69%; }
.w-70 { width: 70%; }
.w-71 { width: 71%; }
.w-72 { width: 72%; }
.w-73 { width: 73%; }
.w-74 { width: 74%; }
.w-75 { width: 75%; }
.w-76 { width: 76%; }
.w-77 { width: 77%; }
.w-78 { width: 78%; }
.w-79 { width: 79%; }
.w-80 { width: 80%; }
.w-81 { width: 81%; }
.w-82 { width: 82%; }
.w-83 { width: 83%; }
.w-84 { width: 84%; }
.w-85 { width: 85%; }
.w-86 { width: 86%; }
.w-87 { width: 87%; }
.w-88 { width: 88%; }
.w-89 { width: 89%; }
.w-90 { width: 90%; }
.w-91 { width: 91%; }
.w-92 { width: 92%; }
.w-93 { width: 93%; }
.w-94 { width: 94%; }
.w-95 { width: 95%; }
.w-96 { width: 96%; }
.w-97 { width: 97%; }
.w-98 { width: 98%; }
.w-99 { width: 99%; }
.w-100 { width: 100%; }

/* Website owners: the site picker on the invite form and a client's own page */
fieldset.site-pick { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem 1rem 1rem; margin: .5rem 0; min-width: 0; grid-column: 1 / -1; }
.site-pick-group { margin: .5rem 0; }
.site-pick-group label.check { display: flex; }
details.client-sites { margin-top: .25rem; }
details.client-sites form { margin-top: .4rem; }

/* Users: search box in the page head, a row of action buttons, headings inside the Manage panel */
.page-head input.search { width: 18rem; max-width: 100%; margin-left: auto; }
.action-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0; }
.action-row form { margin: 0; }
.edit-row h3 { margin: 1.1rem 0 .4rem; font-size: 1rem; }
.edit-row h3:first-child { margin-top: 0; }

/* "Which graph shows what?" under the Overview charts */
details.help { margin-top: .75rem; }
details.help > summary { cursor: pointer; font-weight: 600; }
details.help ul { margin: .5rem 0 0 1rem; }
details.help li { margin: .35rem 0; }

/* Top processes: three lists side by side must never push the panel wider than the page */
.cols.cols-narrow { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.panel .table-compact td.wrap { overflow-wrap: anywhere; }

.finding-line { border-top: 1px solid var(--border); padding-top: .5rem; margin-top: .5rem; }
.finding-line p { margin: .15rem 0; }

/* Billing: credit packs, and a button that is waiting for something to finish */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin: .75rem 0 1rem; }
.pack { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; padding: .8rem 1rem; text-align: left; height: auto; line-height: 1.3; }
.pack strong { font-size: 1.3rem; }
.btn.is-waiting { opacity: .75; cursor: progress; }
.fn-list { grid-template-columns: 1fr; gap: .45rem; }
.fn-list .check > span > .muted { display: block; }

/* A backup set page waiting for the server to look again: the lists are dimmed and cannot be changed until the fresh ones arrive */
.is-looking .table-wrap, .is-looking textarea { opacity: .45; pointer-events: none; }

/* Health charts on a PC's page */
.spark { vertical-align: middle; max-width: 100%; height: auto; }
.spark-line { fill: none; stroke: var(--brand); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spark-mid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.badge.sev-info, .badge.sev-ok { background: var(--surface-2); color: var(--muted); }
.badge.sev-error { background: var(--bad); color: #fff; }

/* Deep diagnostics and AI reports on a PC's page */
.diag-run { margin-bottom: 1rem; padding: .75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.ai-report { border-left: 3px solid var(--brand); padding: .25rem 0 .25rem 1rem; margin: .75rem 0; }
.ai-report h4, .ai-report h5, .ai-report h6 { margin: 1rem 0 .4rem; }
.ai-report pre { background: var(--surface-2); padding: .6rem; border-radius: 6px; overflow-x: auto; }
.ai-report code { font-size: .9em; }

/* Remote access on a PC's page */
.remote-open { padding: .5rem 0; }
.remote-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.remote-actions form { margin: 0; }
.shot-run h3, .pc-settings-module { font-size: 1rem; margin: 1rem 0 .5rem; }
.pc-settings td:nth-child(2) { white-space: nowrap; }
.terminal { background: #0b0f14; color: #d8e0e8; border-radius: 6px; padding: .75rem 1rem; max-height: 32rem; overflow: auto; font: 13px/1.45 ui-monospace, Consolas, monospace; }
.terminal pre { margin: 0 0 .5rem; white-space: pre-wrap; word-break: break-word; font: inherit; color: inherit; background: none; }
.terminal .t-line { color: #7fd1ff; margin-top: .25rem; }
.terminal .t-note { color: #8a97a6; }
.terminal .t-err { color: #ff8f8f; margin-bottom: .5rem; }
.terminal a { color: #7fd1ff; }
.shell-line { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .75rem 0 .5rem; }
.shell-line input[type="text"] { flex: 1 1 18rem; font-family: ui-monospace, Consolas, monospace; }
.narrow-number { width: 4.5rem; }
.inline-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.summary-line { margin: 0 0 1rem; color: var(--muted); }
.nav-count { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 999px; background: var(--bad); color: #fff; font-size: .75rem; line-height: 1.4; text-align: center; }
.page-nav { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin: -.25rem 0 1rem; font-size: .9rem; }
.page-nav a { color: var(--brand); text-decoration: none; }
.page-nav a:hover { text-decoration: underline; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 1.5rem; }
.files td { vertical-align: middle; }
.files-actions { text-align: right; white-space: nowrap; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; text-align: left; }
.linkish:hover { text-decoration: underline; }
.inline-details { display: inline-block; }
.inline-details > summary { list-style: none; display: inline-block; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] form { display: inline-flex; gap: .25rem; margin-left: .25rem; }
.fetched { padding-left: 1.2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pc-settings td:last-child { text-align: right; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.shots figure { margin: 0; }
.shots img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 6px; }
.shots figcaption { margin-top: .25rem; }
.remote-open code, details pre code { word-break: break-all; white-space: pre-wrap; }

/* ---------- The console frame (2026-11, look A, as Shield): a dark top row with the sections, a light second row with
   the current section's pages, and the page in a centred column of the same width, so it sits well on any screen
   from a phone to 4K. On a phone the second row scrolls sideways and a tab bar at the bottom holds the main
   sections. The super admin's platform pages mark the top row; viewing a customer adds an amber bar. ---------- */
:root { --frame-w: 1440px; --amber: #e8a33a; --amber-ink: #2b1a00; --amber-bg: #fff4e0; }
.frame-row { max-width: var(--frame-w); margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; gap: .5rem 1.25rem; }
.container.page { max-width: var(--frame-w); padding: 1.5rem 1.5rem 3rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.block { display: block; }

.masthead { background: var(--steel); color: #e6ebf1; position: sticky; top: 0; z-index: 25; }
.masthead .frame-row { min-height: 56px; }
.masthead .brand { color: #fff; flex: none; }
.masthead .brand:hover { text-decoration: none; }
.platform-tag { flex: none; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--amber-ink); background: var(--amber); border-radius: 999px; padding: .1rem .55rem; }
.topnav { display: flex; flex-wrap: wrap; gap: .15rem; flex: 1; min-width: 0; padding: .3rem 0; } /* wraps rather than hiding items off the edge */
.topnav a { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .8rem; border-radius: 8px; color: #cfd8e3; font-weight: 500; white-space: nowrap; }
.topnav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.topnav a[aria-current="page"] { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.topnav-tools { display: flex; align-items: center; gap: .75rem; flex: none; }
.topnav-tools form { margin: 0; }
.topnav-user { color: #cfd8e3; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topnav-signout .linklike { color: #cfd8e3; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .2); background: none; color: #cfd8e3; cursor: pointer; }
.icon-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .45); }
.client-switcher { margin: 0; }
.client-switcher select { width: auto; max-width: 15rem; min-height: 34px; padding: .25rem .5rem; background: #1f2833; color: #e6ebf1; border-color: rgba(255, 255, 255, .2); }

.subnav { background: var(--surface); border-bottom: 1px solid var(--border); }
.subnav .frame-row { gap: .25rem; overflow-x: auto; scrollbar-width: thin; }
.subnav a { display: inline-flex; align-items: center; gap: .35rem; padding: .7rem .85rem; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; white-space: nowrap; }
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }
.subnav-context { color: var(--text); font-weight: 700; padding-right: .75rem; margin-right: .5rem; border-right: 1px solid var(--border); white-space: nowrap; }
.subnav-count { font-size: .75rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.subnav-warn .subnav-count { background: var(--warn-bg); color: var(--warn); }

.viewing-bar { background: var(--amber); color: var(--amber-ink); font-size: .9rem; }
.viewing-bar .frame-row { flex-wrap: wrap; padding-top: .45rem; padding-bottom: .45rem; }
.viewing-bar form { margin-left: auto; }
.viewing-bar .btn { background: var(--amber-bg); color: var(--amber-ink); border-color: transparent; }

.page-title { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-title h1 { margin: 0; }
.h1-sub { font-size: 1rem; font-weight: 500; }
.tabbar { display: none; }

/* The PC list: search over a table grouped by folder; each row a card on a phone. */
.list-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .75rem; }
.list-tools .search-box { flex: 1 1 18rem; }
.list-tools .search-box input { width: 100%; }
.list-tools .inline-label { white-space: nowrap; }
.list-note { margin: 0 0 .75rem; }
.pc-list { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.pc-list .table td, .pc-list .table th { padding-left: 1rem; }
.group-row th { background: var(--surface-2); color: var(--text); text-transform: none; letter-spacing: 0; font-size: .92rem; padding-top: .6rem; padding-bottom: .6rem; }
.group-row th .muted { font-weight: 500; margin-left: .35rem; }
.row-attention td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.list-foot { margin-top: 1rem; }
.menu-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 1.25rem; }
.menu-list a { padding: .9rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 600; }
.menu-list a.menu-sub { font-weight: 400; padding-left: 2rem; }
.menu-list a:last-child { border-bottom: 0; }
.menu-foot { display: flex; flex-direction: column; gap: .75rem; max-width: 22rem; }
.theme-switch { display: flex; flex-direction: column; gap: .2rem; margin: 0; }
.theme-switch label { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }

/* The PC page's older sections, made to fit a phone until it is rebuilt (phase 2). */
.page table.kv { display: table; max-width: 100%; border-collapse: collapse; }
.page table.kv td { overflow-wrap: anywhere; }
.page table.kv th { text-align: left; vertical-align: top; padding-right: 1rem; }
.page svg { max-width: 100%; }

@media (max-width: 640px) { /* a phone: the bottom bar and More; wider, the top menu wraps onto a second line */
  .frame-row { padding: 0 1rem; }
  .topnav, .topnav-user, .topnav-signout { display: none; }
  .topnav-tools { margin-left: auto; }
  .client-switcher select { max-width: 10rem; }
  .container.page { padding: 1rem 1rem 6rem; }
  .viewing-bar .viewing-more { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--border); padding: .25rem 0 calc(.25rem + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; align-items: center; justify-content: center; gap: .3rem; min-height: 52px; color: var(--muted); font-size: .85rem; font-weight: 500; }
  .tabbar a[aria-current="page"] { color: var(--brand); font-weight: 700; }
  .tabbar a:hover { text-decoration: none; }
}
@media (max-width: 700px) {
  .pc-list { background: none; border: 0; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td, .table-cards th { display: block; width: 100%; }
  .table-cards thead { display: none; }
  .table-cards tr:not(.group-row) { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .75rem .9rem; margin-bottom: .6rem; display: flex; flex-wrap: wrap; gap: .35rem .9rem; align-items: center; }
  .table-cards td { border: 0; padding: 0 !important; width: auto; }
  .table-cards td.card-title { flex: 1 0 100%; }
  .table-cards td.card-title a { font-weight: 600; font-size: 1.02rem; }
  .table-cards td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: .78rem; margin-right: .2rem; }
  .table-cards .group-row th { background: none; border: 0; padding: .9rem 0 .4rem !important; font-size: .85rem; }
  .row-attention td:first-child { box-shadow: none; }
  .table-cards tr.row-attention { border-color: var(--warn); }
  .pc-settings, .pc-settings tbody, .pc-settings tr, .pc-settings td { display: block; width: 100%; }
  .pc-settings tr { padding: .6rem 0; border-bottom: 1px solid var(--border); }
  .pc-settings td { border: 0; padding: .15rem 0; }
  .page .table:not(.table-cards):not(.pc-settings) { display: block; overflow-x: auto; }
  .list-tools .btn { min-height: 44px; }
}

/* ---------- A PC's page (phase 2): a header with the main actions, then the Overview or one tab (the tabs are the
   menu's second row). The Overview is what needs attention, a card per module and the latest activity. ---------- */
.subnav-back { color: var(--text) !important; font-weight: 700 !important; padding-right: .75rem !important; margin-right: .25rem; border-right: 1px solid var(--border); border-bottom-color: transparent !important; }
.subnav-grouped .frame-row { flex-wrap: wrap; overflow-x: visible; }
.subnav-sub { background: var(--surface-2); }
.subnav-sub .frame-row { flex-wrap: wrap; overflow-x: visible; gap: .1rem; }
.subnav-sub a { padding: .45rem .7rem; font-size: .9rem; font-weight: 500; }
.tab-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; }
.tab-dot-warn { background: var(--warn); }
.tab-dot-bad { background: var(--bad); }
.pc-head { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1.4rem; margin-bottom: 1.25rem; }
.pc-head-main { min-width: 0; }
.pc-head-title { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
.pc-head-title h1 { margin: 0; overflow-wrap: anywhere; }
.pc-head-facts { margin: .3rem 0 0; color: var(--muted); font-size: .9rem; }
.pc-head-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.pc-head-actions form { margin: 0; }
.section-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; justify-content: space-between; }
.section-head h2 { margin-bottom: .5rem; }
.attention { background: var(--warn-bg); border: 1px solid var(--warn); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.attention h2 { margin: 0 0 .5rem; font-size: 1rem; }
.attention ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.attention-item { display: flex; gap: .6rem; align-items: baseline; color: var(--text); padding: .15rem 0; }
a.attention-item:hover { text-decoration: none; }
a.attention-item:hover .attention-text { text-decoration: underline; }
.attention-item .pill { flex: none; }
.attention-text { flex: 1; min-width: 0; }
.attention-go { color: var(--brand); font-weight: 700; }
.attention-inline { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-direction: column; gap: .35rem; }
.all-clear { margin: 0 0 1.25rem; display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.module-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.module-card { display: flex; flex-direction: column; gap: .4rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; color: var(--text); min-width: 0; }
.module-card:hover { border-color: var(--brand); text-decoration: none; }
.module-card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.module-card-text { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.module-card-facts { display: flex; flex-wrap: wrap; gap: .2rem 1rem; font-size: .85rem; }
.module-card-at { margin-top: auto; }
.recent, .module-summary { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.timeline { list-style: none; margin: 0 0 .5rem; padding: 0; }
.timeline li { display: flex; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline-when { flex: none; width: 8.5rem; color: var(--muted); font-size: .85rem; }
.module-about { margin-top: .75rem; }
.module-about summary { cursor: pointer; color: var(--brand); }
.action-forms { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: end; margin-bottom: 1.25rem; }
.action-form { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: end; }
.action-form label { flex: 0 1 auto; }
.btn-danger { color: var(--bad); }
@media (max-width: 700px) {
  .pc-head { padding: .9rem 1rem; }
  .pc-head-actions { width: 100%; }
  .pc-head-actions .btn { min-height: 44px; }
  .timeline li { flex-direction: column; gap: .1rem; }
  .timeline-when { width: auto; }
  .attention-item { min-height: 44px; align-items: center; }
}

/* ---------- Templates (phase 3): an overview of every module by area, one section per page saving on its own, and a
   preview of what one PC gets with where each value comes from. ---------- */
.tpl-area { margin: 1.5rem 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tpl-list { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tpl-row { display: flex; align-items: center; gap: .75rem 1rem; padding: .8rem 1.1rem; color: var(--text); border-bottom: 1px solid var(--border); }
.tpl-list .tpl-row:last-child { border-bottom: 0; }
.tpl-row:hover { background: var(--surface-2); text-decoration: none; }
.tpl-row-general { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin: 1rem 0 .5rem; }
.tpl-row-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.tpl-row-go { color: var(--brand); font-weight: 700; }
.tpl-form { display: flex; flex-direction: column; gap: 1rem; max-width: 46rem; }
.tpl-form fieldset { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1.2rem 1.1rem; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.tpl-form legend { font-weight: 700; padding: 0 .35rem; }
.tpl-field p { margin: .2rem 0 0; }
.preview-module { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1.2rem; margin-bottom: 1rem; }
.preview-module h2 { font-size: 1.05rem; display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
@media (max-width: 700px) {
  .tpl-row { padding: .8rem .9rem; min-height: 44px; }
}

/* ---------- The dashboard and alerts (phase 4). ---------- */
.dash-tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.dash-tiles .tile { border-radius: 12px; padding: 1rem 1.1rem; }
.tile-of { font-size: 1rem; font-weight: 500; color: var(--muted); }
.dash-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.dash-panel .table-wrap { margin: 0 -1.25rem; }
.dash-attention { list-style: none; margin: 0; padding: 0; }
.dash-attention li { border-bottom: 1px solid var(--border); }
.dash-attention li:last-child { border-bottom: 0; }
.dash-attention .attention-item { padding: .55rem 0; }
.alert-rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.alert-row { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; padding: .8rem 1.1rem; border-bottom: 1px solid var(--border); }
.alert-row:last-child { border-bottom: 0; }
.alert-row-main { display: flex; gap: .7rem; align-items: baseline; flex: 1 1 24rem; min-width: 0; }
.alert-row-main .pill { flex: none; }
.alert-row-text { min-width: 0; overflow-wrap: anywhere; }
.alert-row-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.snooze-form { display: inline-flex; gap: .3rem; align-items: center; }
.snooze-form select { width: auto; min-height: 30px; padding: .15rem .4rem; }
@media (max-width: 700px) {
  .alert-row-actions .btn, .snooze-form select { min-height: 40px; }
  .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .dash-tiles .tile { padding: .75rem .85rem; }
  .dash-panel .table-wrap { margin: 0; }
}

/* ---------- Settings (phase 5): the account, users, billing, folders and the audit log. ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.settings-grid .dash-panel { margin-bottom: 0; }
.settings-links { display: flex; flex-direction: column; padding: .25rem 0; }
.settings-links a { display: flex; flex-direction: column; padding: .65rem 1.25rem; color: var(--text); border-bottom: 1px solid var(--border); }
.settings-links a:last-child { border-bottom: 0; }
.settings-links a:hover { background: var(--surface-2); text-decoration: none; }
.secret-box code.secret { display: block; margin-top: .5rem; padding: .5rem .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow-wrap: anywhere; user-select: all; }
.user-edit, .folder-edit { position: relative; }
.user-edit > summary, .folder-edit > summary { list-style: none; cursor: pointer; }
.user-edit > summary::-webkit-details-marker, .folder-edit > summary::-webkit-details-marker { display: none; }
.user-edit-body, .folder-edit-body { margin-top: .5rem; padding: .9rem 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; gap: .75rem; min-width: min(28rem, 80vw); }
.table tr.disabled td { opacity: .6; }
.buy-form { display: flex; flex-direction: column; gap: .9rem; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.pack { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 400; flex-wrap: nowrap; }
.pack:has(input:checked) { border-color: var(--brand); background: var(--info-bg); }
.pack input { margin-top: .2rem; }
.folder-tree { list-style: none; margin: 0 0 1.25rem; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.folder-row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding: .7rem 1.1rem; border-bottom: 1px solid var(--border); }
.folder-row:last-child { border-bottom: 0; }
.folder-row.depth-1 { padding-left: 2.4rem; }
.folder-row.depth-2 { padding-left: 3.7rem; }
.folder-row.depth-3 { padding-left: 5rem; }
.folder-name { display: flex; flex-direction: column; }
.audit-table code { font-size: .82rem; }
@media (max-width: 860px) {
  .masthead form.topnav-signout { display: none; } /* on a phone, Sign out is on the More page */
}

/* ---------- Platform pages (super admin). ---------- */
.price-form { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.price-form input.num { width: 5.5rem; }
.module-prices td { vertical-align: middle; }
.request-about { margin: .4rem 0 0; white-space: pre-line; }
.log-tail { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; font-size: .8rem; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 36px; padding: 0 .85rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .88rem; }
.chip span { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--brand); text-decoration: none; }
.chip[aria-current="true"] { border-color: var(--brand); background: var(--info-bg); color: var(--brand-strong); font-weight: 600; }
.chip-warn span { color: var(--warn); font-weight: 700; }

/* ---------- Monthly reports (phase 7): a page that prints well on A4. ---------- */
.report-tools { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.report { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.75rem 2rem; max-width: 60rem; margin: 0 auto; }
.report-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 2px solid var(--brand); padding-bottom: 1rem; margin-bottom: 1.25rem; }
.report-header h1 { margin: .1rem 0; }
.report-kicker { margin: 0; color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
.report section { margin-top: 1.5rem; }
.report-findings, .report-list { margin: .5rem 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.report-list li::before { content: "• "; color: var(--brand); }
.report-footer { margin-top: 2rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.report-cost { background: var(--surface-2); border-radius: 10px; padding: .75rem 1rem; }
.month-links { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 700px) { .report { padding: 1rem; } }
@media print {
  :root { color-scheme: light; }
  html, body { background: #fff !important; color: #000; }
  .report-footer { margin-top: 1rem; }
  .masthead, .subnav, .viewing-bar, .tabbar, .no-print, .flash { display: none !important; }
  .container.page { max-width: none; padding: 0; }
  .report { border: 0; padding: 0; max-width: none; }
  .report a { color: inherit; text-decoration: none; }
  .tile, .report-table tr { break-inside: avoid; }
  .report-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .report-table, .report-table tbody, .report-table tr, .report-table td, .report-table th { display: revert !important; width: auto !important; }
}
@media print {
  :root, :root:not([data-theme="none"]) { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f3f5f8; --text: #111; --muted: #555; --border: #ccc; --brand: #1673d4; --brand-strong: #0f5bb0;
    --ok: #1f8a4c; --ok-bg: #e3f4ea; --warn: #a35f00; --warn-bg: #fff1d6; --bad: #c22d2d; --bad-bg: #fde6e6; --info-bg: #e5f0fc; }
}

/* ---------- Bulk actions on the PC list. ---------- */
.pc-list th.sel, .pc-list td.sel { width: 2.2rem; padding-right: 0; }
.pc-list input[type=checkbox] { width: 1.1rem; height: 1.1rem; vertical-align: middle; }
.group-row th input[type=checkbox] { margin-right: .35rem; }
.bulk-bar { position: sticky; bottom: 0; z-index: 15; display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; margin-top: .75rem; padding: .75rem 1rem;
  background: var(--surface); border: 1px solid var(--brand); border-radius: 12px; box-shadow: 0 -4px 16px rgba(16, 24, 40, .12); }
.bulk-bar select { width: auto; max-width: 100%; }
.bulk-count { font-weight: 700; }
.bulk-note { flex-basis: 100%; }
@media (max-width: 860px) { .bulk-bar { bottom: 64px; } }
@media (max-width: 700px) {
  .table-cards td.sel { order: -1; flex: none; }
  .table-cards td.sel + td.card-title { flex: 1 0 calc(100% - 2.5rem); }
  .bulk-bar select, .bulk-bar .btn { min-height: 44px; flex: 1 1 100%; }
}
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Notifications (email and Pushover). ---------- */
.pushover-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr) minmax(0, 1fr); gap: .4rem .6rem; align-items: center; }
.pushover-grid select { width: 100%; }
.add-channels { margin-top: 1.5rem; align-items: start; }
.add-channels .tpl-form { max-width: none; }
@media (max-width: 700px) { .pushover-grid { grid-template-columns: minmax(0, 1fr); } .pushover-grid > strong, .pushover-grid > span:first-child { display: none; } .pushover-grid > span.small { font-weight: 700; margin-top: .4rem; } }
.report-send { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1rem; align-items: start; }
.report-send .flash { grid-column: 1 / -1; margin: 0; }
.report-send .tpl-form { max-width: none; }
.report-email { margin-bottom: 1.25rem; }
.report-email > summary { list-style: none; display: inline-flex; }
.report-email > summary::-webkit-details-marker { display: none; }
.report-email[open] > summary { margin-bottom: .75rem; }
.top-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: .75rem; }
.top-table td.num, .top-table th.num { text-align: right; white-space: nowrap; }
.tpl-group { border-top: 1px solid var(--border, rgba(127, 127, 127, .25)); }
.tpl-group > summary { cursor: pointer; padding: .7rem .2rem; font-weight: 600; }
.tpl-group[open] > summary { margin-bottom: .25rem; }
.pc-settings .group-row th { padding-top: 1rem; text-align: left; font-size: .85rem; color: var(--muted, #5c6878); }
.chat-log { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .5rem; max-height: 60vh; overflow-y: auto; }
.chat-log li { max-width: 80%; padding: .5rem .75rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border, rgba(127, 127, 127, .25)); }
.chat-log li.chat-mine { align-self: flex-end; border-color: var(--brand); }
.chat-log li.chat-notice { align-self: center; background: transparent; border-style: dashed; font-size: .9rem; }
.chat-form { display: flex; gap: .5rem; align-items: flex-end; margin-bottom: .5rem; }
.chat-form textarea { flex: 1; }
.link-button { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* The health page: three panels side by side on a wide screen, bars for how full things are, the checks list. */
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin: 1rem 0; }
.health-grid .panel { margin-bottom: 0; }
.health-grid h3 { margin-top: 0; }
.meter { vertical-align: middle; margin-right: .35rem; }
.meter .meter-track { fill: var(--surface-2); }
.meter .meter-fill { fill: var(--ok); }
.meter-warn .meter-fill { fill: var(--warn); }
.meter-bad .meter-fill { fill: var(--bad); }
.check-table th { width: 14rem; font-weight: 600; color: var(--text); text-transform: none; letter-spacing: 0; font-size: .92rem; border-bottom: 1px solid var(--border); }
.spark { max-width: 320px; }

/* Companies and groups: cards, the PC picker, network diagrams (SVG drawn by Networks::diagram) and the inventory. */
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; margin: 1rem 0; }
.company-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow); color: var(--text); display: block; }
a.company-card:hover { text-decoration: none; border-color: var(--brand); }
.company-card h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.company-card .company-counts { color: var(--muted); font-size: .88rem; }
.pc-picker { max-height: 18rem; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; background: var(--surface); }
.pc-picker label { display: block; margin: .15rem 0; font-weight: normal; }
.netmap-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: .5rem; margin: .5rem 0 1rem; }
.netmap { width: 100%; min-width: 640px; height: auto; display: block; font-family: var(--font); }
.netmap .nm-title { font-size: 13px; font-weight: 600; fill: var(--text); }
.netmap .nm-sub { font-size: 11px; fill: var(--muted); }
.netmap .nm-link, .netmap .nm-drop { stroke: var(--border); stroke-width: 2; }
.netmap .nm-bus { stroke: var(--muted); stroke-width: 3; }
.netmap .nm-cloud { fill: var(--info-bg); stroke: var(--brand); stroke-width: 1.5; }
.netmap .nm-box { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.netmap .nm-router, .netmap .nm-network { fill: var(--teal-bg); stroke: var(--teal); }
.netmap .nm-managed { fill: var(--ok-bg); stroke: var(--ok); }
.netmap .nm-printer, .netmap .nm-nas, .netmap .nm-server { fill: var(--info-bg); stroke: var(--brand); }
.netmap .nm-camera, .netmap .nm-voip { fill: var(--warn-bg); stroke: var(--warn); }
.netmap .nm-stale { opacity: .45; }
.netmap a:hover .nm-box { stroke: var(--brand); stroke-width: 2.5; }
.netmap-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .85rem; color: var(--muted); margin: 0 0 .4rem; padding: 0; list-style: none; }
.netmap-legend .swatch { display: inline-block; width: .9rem; height: .9rem; border-radius: 3px; vertical-align: -2px; margin-right: .3rem; border: 1px solid var(--border); }
.swatch-managed { background: var(--ok-bg); border-color: var(--ok) !important; }
.swatch-router { background: var(--teal-bg); border-color: var(--teal) !important; }
.swatch-infra { background: var(--info-bg); border-color: var(--brand) !important; }
.swatch-watch { background: var(--warn-bg); border-color: var(--warn) !important; }
.inventory-table td { vertical-align: top; }
.inventory-table .ai-note { color: var(--muted); font-size: .82rem; }
.inventory-retired td { opacity: .55; }
.kb-toc { columns: 2 16rem; margin: .5rem 0 1.5rem; }
.kb-section { margin: 2rem 0; }
.kb-section h2 { border-bottom: 1px solid var(--border); padding-bottom: .3rem; }
.kb-module { border-left: 3px solid var(--border); padding: .2rem 0 .2rem .9rem; margin: .9rem 0; }
.kb-module h4 { margin: 0 0 .2rem; }
.kb-meta { color: var(--muted); font-size: .85rem; }
.netmap .nm-mac { font-size: 10px; fill: var(--muted); font-family: var(--mono); }
.netmap .nm-group { font-size: 12px; font-weight: 700; fill: var(--muted); letter-spacing: .02em; text-transform: uppercase; }
.input-short { width: 9rem; display: inline-block; }
.steps > li { margin: 0 0 1rem; }
.steps > li .table-wrap { margin-top: .5rem; }

/* Repairs: a run's output */
.repair-output { background: var(--surface-2); padding: .6rem; border-radius: 6px; white-space: pre-wrap; word-break: break-word; font-size: .82rem; max-height: 22rem; overflow-y: auto; }

/* A PC's notes (its scratch pad, on the Overview), and a row of fields side by side (the job log's start and end). */
.scratchpad { margin: 0 0 1.5rem; }
.scratchpad textarea { font-family: inherit; font-size: .95rem; }
.scratchpad .form-actions { margin-top: .4rem; }
.field-row { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; }
.field-row > label { flex: 1 1 14rem; }

/* A PC's "in progress" strip under its header: the commands waiting for it or running on it. */
.in-flight { border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 8px; background: var(--surface); padding: .6rem .9rem; margin: 0 0 1rem; }
.in-flight ul { list-style: none; margin: .35rem 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.in-flight li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.in-flight p { margin: .2rem 0 0; }

/* Follow-up questions on an AI report: the engineer's question, then Claude's answer, as a conversation. */
.ai-conversation { margin-top: 1.25rem; display: flex; flex-direction: column; gap: .6rem; }
.ai-turn { border-radius: 10px; padding: .55rem .85rem; }
.ai-turn p { margin: .2rem 0; }
.ai-question { background: var(--surface); border: 1px solid var(--border); align-self: flex-end; max-width: min(46rem, 100%); }
.ai-answer { border-left: 3px solid var(--brand); }

/* Files: the folder list takes files dropped on it (sent to that folder). */
.files-view { border: 2px dashed transparent; border-radius: 10px; }
.files-view.dropping { border-color: var(--brand); background: var(--surface); }
.files-drop-hint { margin: .5rem; font-weight: 700; color: var(--brand); text-align: center; }

/* Shell steps an AI answer suggests: the command, what happened, its output. */
.ai-steps { border: 1px solid var(--border); border-radius: 8px; padding: .5rem .8rem; margin: .5rem 0; }
.ai-steps ol { margin: .3rem 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .6rem; }
.ai-step-line, .ai-step-output { white-space: pre-wrap; word-break: break-word; font-size: .82rem; margin: .2rem 0; padding: .45rem .6rem; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); }
.ai-step-output { max-height: 18rem; overflow: auto; }
