/*
 * Companion design system. One token set for every screen, modelled on the
 * CloudPanel 2 control panel (white header, light sidebar, bordered cards,
 * outlined status labels, #0078d4 accent) so the two tools read as one product.
 * Colours are adjusted where CloudPanel's own values miss WCAG AA contrast.
 */
:root {
  color-scheme: light;
  --font: "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;

  --bg: #f9fafb;
  --bg-auth: #f3f3f3;
  --surface: #fff;
  --surface-muted: #fbfcfc;
  --sidebar: #f2f4f6;
  --hover: #ebebeb;

  --text: #212529;
  --heading: #2e2e2e;
  --text-strong: #333;
  --text-muted: #5f676f;
  --text-soft: #666;

  --border: #e2e2e2;
  --border-light: #eaeaea;
  --border-card: #dfdfdf;
  --border-input: #8a939b;

  --primary: #0078d4;
  --primary-hover: #0067b8;
  --primary-soft: #e8f2fb;
  --link: #0067b8;
  --focus: #0078d4;
  --focus-ring: 0 0 0 3px rgb(0 120 212 / 30%);

  --success: #2f7a16;
  --success-line: #73bf4c;
  --warning: #a84800;
  --warning-line: #ff7200;
  --danger: #b8321f;
  --danger-line: #d84531;
  --info: #0f69b4;
  --info-line: #137ad1;
  --neutral: #5c6670;
  --neutral-line: #c4cad0;
  --danger-solid: #dc3545;
  --danger-solid-hover: #bb2d3b;

  --alert-success-bg: #d1e7dd; --alert-success-line: #badbcc; --alert-success-text: #0f5132;
  --alert-info-bg: #cff4fc; --alert-info-line: #b6effb; --alert-info-text: #055160;
  --alert-warning-bg: #fff3cd; --alert-warning-line: #ffecb5; --alert-warning-text: #664d03;
  --alert-danger-bg: #f8d7da; --alert-danger-line: #f5c2c7; --alert-danger-text: #842029;

  --radius: 4px;
  --shadow-card: 0 2px 4px rgb(157 161 164 / 19%);
  --shadow-header: 0 2px 2px 0 hsl(0deg 0% 93% / 50%);
  --shadow-pop: 0 8px 24px rgb(33 37 41 / 16%);

  --header-height: 75px;
  --sidebar-width: 235px;
  --content-width: 1200px;
  --gutter: 30px;
  --card-pad: 25px;
  --control: 40px;
}
@media (pointer: coarse) { :root { --control: 44px } }

/* Base */
*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.6 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; color: var(--heading); font-weight: 600; line-height: 1.3 }
h1 { font-size: 30px; overflow-wrap: anywhere }
h2 { font-size: 18px; color: var(--text-strong) }
h3 { font-size: 15px; color: var(--text-strong) }
p { margin: 0 0 12px }
p:last-child { margin-bottom: 0 }
a { color: var(--link); text-decoration: none }
a:hover { text-decoration: underline }
strong, b { font-weight: 600 }
code, pre { font-family: var(--font-mono); font-size: 13px }
code { overflow-wrap: anywhere }
hr { border: 0; border-top: 1px solid var(--border-light); margin: 20px 0 }
ul, ol { margin: 0 0 12px; padding-left: 20px }
dl, dd { margin: 0 }
button, input, select, textarea { font: inherit; color: inherit }
button, a, input, summary, label { touch-action: manipulation }
[hidden] { display: none !important }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px }
details > summary { cursor: pointer; list-style: none }
/* In-page links (Overview items, section anchors) land below the sticky header. */
[id] { scroll-margin-top: calc(var(--header-height) + 16px) }
details > summary::-webkit-details-marker { display: none }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: 10px 18px; border-radius: var(--radius);
  background: var(--text-strong); color: #fff; transform: translateY(-200%);
}
.skip-link:focus { transform: none; text-decoration: none }
.text-muted { color: var(--text-muted) }
.footnote { margin: 0 0 24px; font-size: 13px; color: var(--text-muted) }
svg.icon {
  display: inline-block; flex: none; width: 18px; height: 18px; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.spin { animation: spin 1.4s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }

/* Application shell: CloudPanel's white header over a light sidebar. */
.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: stretch; height: var(--header-height);
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-header);
}
.brand {
  display: flex; align-items: center; gap: 10px; flex: none;
  width: var(--sidebar-width); padding: 0 20px;
  border-right: 1px solid var(--border-light);
  color: var(--heading); font-size: 20px; font-weight: 700; letter-spacing: -.2px;
}
.brand:hover { text-decoration: none; color: var(--heading) }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  background: var(--primary); color: #fff;
}
.brand-mark .icon { width: 20px; height: 20px; stroke-width: 2 }
.header-end { display: flex; align-items: stretch; margin-left: auto }
.header-end > * { border-left: 1px solid var(--border-light) }
.user-menu { position: relative; display: flex }
.user-menu > summary {
  display: flex; align-items: center; gap: 10px; padding: 0 25px;
  color: var(--text-soft); font-weight: 600;
}
.user-menu > summary:hover, .user-menu[open] > summary { color: var(--primary) }
.user-menu > summary .icon:last-child { width: 16px; height: 16px; transition: transform .15s }
.user-menu[open] > summary .icon:last-child { transform: rotate(180deg) }
.user-menu-panel {
  position: absolute; top: calc(100% - 8px); right: 12px; z-index: 40;
  min-width: 230px; padding: 6px 0;
  background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--radius); box-shadow: var(--shadow-pop);
}
.user-menu-panel p { margin: 0; padding: 8px 16px 10px; font-size: 13px; color: var(--text-muted); border-bottom: 1px solid var(--border-light) }
.user-menu-panel a, .user-menu-panel button {
  display: block; width: 100%; padding: 8px 16px; border: 0; background: none;
  text-align: left; color: var(--text); font-size: 14px; line-height: 1.5; cursor: pointer;
}
.user-menu-panel a:hover, .user-menu-panel button:hover { background: #e9ecef; text-decoration: none }
.user-menu-panel form { border-top: 1px solid var(--border-light); margin-top: 6px; padding-top: 6px }

.app-body { display: flex; align-items: stretch; min-height: calc(100vh - var(--header-height)) }
.sidebar {
  flex: 0 0 var(--sidebar-width); width: var(--sidebar-width);
  background: var(--sidebar); border-right: 1px solid #e5e5e5; padding: 15px 0;
}
.sidebar ul { position: sticky; top: calc(var(--header-height) + 15px); margin: 0; padding: 0; list-style: none }
.sidebar a {
  display: flex; align-items: center; gap: 12px; padding: 9px 20px 9px 17px;
  border-left: 3px solid transparent; color: var(--text-strong);
}
.sidebar a .icon { color: var(--text-muted) }
.sidebar a:hover, .sidebar a[aria-current=page] { background: var(--hover); border-left-color: var(--primary); text-decoration: none }
.sidebar a[aria-current=page] { font-weight: 600 }
.sidebar a[aria-current=page] .icon { color: var(--primary) }
.app-main { flex: 1; min-width: 0; padding: 0 var(--gutter) 80px }
.container { max-width: var(--content-width) }

/* Page header and tabs */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 22px 0 24px }
.page-header h1 { margin-top: 2px }
.page-subtitle { margin: 2px 0 0; color: var(--text-muted) }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px }
.tabs {
  display: flex; margin: 0 0 30px; padding: 0 20px; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.tabs a {
  flex: none; padding: 19px 15px 16px; border-bottom: 3px solid transparent;
  color: var(--text-soft); white-space: nowrap;
}
.tabs a:hover { color: var(--primary); text-decoration: none }
.tabs a[aria-current=page] { color: #000; border-bottom-color: var(--primary) }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--radius);
  box-shadow: var(--shadow-card); margin: 0 0 30px; min-width: 0;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px var(--card-pad); border-bottom: 1px solid var(--border-light);
}
.card-header p { margin: 3px 0 0; font-size: 14px; color: var(--text-muted) }
.card-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.card-body { padding: var(--card-pad) }
.card-body > :last-child { margin-bottom: 0 }
.card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px var(--card-pad); border-top: 1px solid var(--border-light); font-size: 14px; color: var(--text-muted);
}
.card-footer p { margin: 0 }
/* Allauth pages place their own heading first inside a plain card body. */
.card-body > .card-title:first-child {
  margin: calc(-1 * var(--card-pad)) calc(-1 * var(--card-pad)) var(--card-pad);
  padding: 20px var(--card-pad); border-bottom: 1px solid var(--border-light);
}
.grid { display: grid; gap: 30px; margin-bottom: 30px; align-items: start }
.grid > .card { margin: 0 }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.grid-stretch { align-items: stretch }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0 0 30px }
.stat { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--radius); box-shadow: var(--shadow-card); min-width: 0 }
.stat dt { font-size: 14px; color: var(--text-muted) }
/* Value with an optional trend line beside it, then its detail and usage bar underneath. */
.stat { display: flex; flex-direction: column }
.stat dd { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr; align-items: end; column-gap: 12px; margin: 4px 0 0 }
.stat-value { font-size: 26px; font-weight: 600; line-height: 1.25; color: var(--heading); font-variant-numeric: tabular-nums; overflow-wrap: anywhere }
.stat dd small { grid-column: 1 / -1; margin-top: 4px; font-size: 13px; color: var(--text-muted) }
.stat dd .meter { grid-column: 1 / -1; align-self: end; margin-top: 12px }
.stat-trend { width: 96px; height: 30px }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) }
.metric-grid > div { padding: 18px var(--card-pad); border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light) }
.metric-grid > div:nth-child(3n) { border-right: 0 }
.metric-grid > div:nth-last-child(-n+3) { border-bottom: 0 }
.metric-grid dt { font-size: 14px; color: var(--text-muted) }
.metric-grid dd { margin-top: 4px; font-size: 20px; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums }
.metric-grid dd small, .property-list dd small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--text-muted) }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--control); padding: 6px 20px; max-width: 100%;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; line-height: 1.5; text-align: center; white-space: nowrap;
  cursor: pointer; transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover { text-decoration: none }
.btn .icon { width: 16px; height: 16px }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff }
.btn-secondary { background: var(--surface); border-color: #c4c4c4; color: var(--text-soft) }
.btn-secondary:hover { background: #e4e5e6; color: var(--text-strong) }
.btn-danger { background: var(--danger-solid); border-color: var(--danger-solid); color: #fff }
.btn-danger:hover { background: var(--danger-solid-hover); border-color: var(--danger-solid-hover); color: #fff }
.btn-link { background: transparent; color: var(--link); padding-left: 8px; padding-right: 8px }
.btn-link:hover { text-decoration: underline }
.btn-sm { min-height: 34px; padding: 4px 14px; font-size: 13px }
.btn-lg { min-height: 48px; padding: 8px 30px; font-size: 16px }
.btn:disabled, fieldset:disabled .btn, .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; pointer-events: none }
.button-group { display: flex; flex-wrap: wrap; gap: 10px }
.segmented { display: inline-flex; border: 1px solid #c4c4c4; border-radius: var(--radius); overflow: hidden; background: var(--surface) }
.segmented > a, .segmented > button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 14px;
  border: 0; border-left: 1px solid #c4c4c4; background: transparent; color: var(--text-soft);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.segmented > :first-child { border-left: 0 }
.segmented > :hover { background: #e4e5e6; color: var(--text-strong); text-decoration: none }
.segmented > [aria-current], .segmented > [aria-pressed=true] { background: var(--primary-soft); color: var(--primary-hover); font-weight: 600 }

/* Status labels: CloudPanel's outlined labels, with AA-contrast text. */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px;
  border: 1px solid var(--neutral-line); border-radius: 3px;
  font-size: 13px; font-weight: 500; line-height: 1.6; white-space: nowrap; color: var(--neutral); background: var(--surface);
}
.pill-success { color: var(--success); border-color: var(--success-line) }
.pill-warning { color: var(--warning); border-color: var(--warning-line) }
.pill-danger { color: var(--danger); border-color: var(--danger-line) }
.pill-info { color: var(--info); border-color: var(--info-line) }
.pill .icon { width: 13px; height: 13px; stroke-width: 2.25 }
#access-badge[data-access=protected] .icon:not(.access-protected),
#access-badge[data-access=public] .icon:not(.access-public),
#access-badge[data-access=unknown] .icon:not(.access-unknown) { display: none }

/* Alerts */
.alert {
  display: flex; align-items: flex-start; gap: 12px; margin: 0 0 24px; padding: 14px 18px;
  border: 1px solid; border-radius: var(--radius); font-size: 15px;
}
.alert > .icon { margin-top: 2px }
.alert-content { flex: 1; min-width: 0 }
.alert-content p { margin: 2px 0 0 }
.alert-content ul { margin: 6px 0 0 }
.alert a:not(.btn) { color: inherit; font-weight: 600; text-decoration: underline }
.alert-actions { display: flex; align-items: center; gap: 10px; flex: none; align-self: center }
.alert-success { background: var(--alert-success-bg); border-color: var(--alert-success-line); color: var(--alert-success-text) }
.alert-info { background: var(--alert-info-bg); border-color: var(--alert-info-line); color: var(--alert-info-text) }
.alert-warning { background: var(--alert-warning-bg); border-color: var(--alert-warning-line); color: var(--alert-warning-text) }
.alert-danger { background: var(--alert-danger-bg); border-color: var(--alert-danger-line); color: var(--alert-danger-text) }
.alert .errorlist { margin: 0; padding: 0; list-style: none; color: inherit }
.card-body > .alert:last-child, .card > .alert { margin-bottom: 0 }
.inline-error { margin: 10px 0 0; color: var(--danger); font-size: 14px }

/* Forms */
label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--text-strong) }
input:where(:not([type=checkbox], [type=radio], [type=hidden])), select, textarea {
  display: block; width: 100%; min-height: var(--control); padding: 7px 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-input); border-radius: var(--radius);
  font-size: 15px; line-height: 1.5; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring) }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none }
input::placeholder, textarea::placeholder { color: #6c757d; opacity: 1 }
input:disabled, textarea:disabled, input[readonly], textarea[readonly] { background: #e9ecef; color: var(--text-muted) }
textarea { min-height: 110px; resize: vertical; font: 14px/1.6 var(--font-mono) }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--primary) }
.field { margin: 0 0 18px }
.field-help { margin: 6px 0 0; font-size: 13px; color: var(--text-muted) }
.field-help ul { margin: 4px 0 0 }
.errorlist { margin: 6px 0 0; padding: 0; list-style: none; color: var(--danger); font-size: 14px }
.has-error input, .has-error textarea { border-color: var(--danger-line) }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; font-weight: 400; color: var(--text); cursor: pointer }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0 }
legend { padding: 0 }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0; font-weight: 600; cursor: pointer }
.switch input {
  appearance: none; position: relative; flex: none; width: 36px; height: 22px; margin: 0;
  border-radius: 22px; background: var(--border-input); cursor: pointer; transition: background .15s;
}
.switch input::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .15s;
}
.switch input:checked { background: var(--primary) }
.switch input:checked::before { transform: translateX(14px) }
.switch input:disabled, fieldset:disabled .switch input { opacity: .5; cursor: not-allowed }
.submission-state { margin-left: 12px; font-size: 14px; color: var(--text-muted) }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto }
.table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; text-align: left }
.table th {
  padding: 14px var(--card-pad); background: var(--surface-muted); border-bottom: 1px solid var(--border-light);
  color: #5f7080; font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
}
.table td { padding: 14px var(--card-pad); border-bottom: 1px solid var(--border-light); vertical-align: middle; overflow-wrap: anywhere }
.table tbody tr:last-child td { border-bottom: 0 }
.table td small { display: block; margin-top: 2px; font-size: 13px; color: var(--text-muted) }
.table code { font-size: 13px }
.table form { margin: 0 }
.table .btn-link { min-height: 0; padding: 0 }
.table-empty { color: var(--text-muted) }
.table .numeric { text-align: right }
.table .nowrap { white-space: nowrap }
.card > .table-wrap:last-child .table { border-radius: 0 0 var(--radius) var(--radius) }

/* Disclosure */
.disclosure > summary { display: flex; align-items: center; gap: 8px; color: var(--link); font-weight: 500 }
.disclosure > summary:hover { text-decoration: underline }
.disclosure > summary .icon { width: 16px; height: 16px; transition: transform .15s }
.disclosure[open] > summary .icon { transform: rotate(180deg) }
.disclosure-body { margin-top: 12px }

/* Empty state */
.empty-state { padding: 48px var(--card-pad); text-align: center }
.empty-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 50%; background: var(--primary-soft); color: var(--primary) }
.empty-icon .icon { width: 24px; height: 24px }
.empty-inline { margin: 0; color: var(--text-muted) }
.empty-inline .icon, .table-empty .icon { width: 16px; height: 16px; margin: -2px 8px 0 0; color: var(--text-muted) }
.empty-state h2, .empty-state h3 { margin-bottom: 6px; font-size: 18px }
.empty-state p { max-width: 56ch; margin: 0 auto 16px; color: var(--text-muted) }
.empty-state p:last-child { margin-bottom: 0 }

/* Lists and properties */
.property-list > div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-light) }
.property-list > div:first-child { padding-top: 0 }
.property-list > div:last-child { border-bottom: 0; padding-bottom: 0 }
.property-list dt { color: var(--text-muted) }
.property-list dd { font-weight: 600; text-align: right }
.ranked-list, .event-list { margin: 0; padding: 0; list-style: none }
.ranked-list li { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--border-light) }
.ranked-list li:first-child { padding-top: 0 }
.ranked-list strong { font-variant-numeric: tabular-nums }
.event-list li { display: flex; gap: 18px; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 14px }
.event-list li:last-child { border-bottom: 0 }
.event-list time { color: var(--text-muted); white-space: nowrap }
.route { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); gap: 14px; align-items: center }
.route > div { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface-muted); border: 1px solid var(--border-light); border-radius: var(--radius); overflow-wrap: anywhere }
.route > div > .icon { width: 22px; height: 22px; color: var(--primary) }
.route > div > span { min-width: 0 }
.route small { display: block; font-size: 13px; color: var(--text-muted) }
.route strong { font-size: 16px }
.route > .icon { color: var(--text-muted); margin: auto }

/* Monitoring */
.toolbar-note { margin: -12px 0 24px; font-size: 14px; color: var(--text-muted) }
.chart-header { align-items: baseline; gap: 12px }
.chart-value { font-size: 22px; font-weight: 600; color: var(--heading); white-space: nowrap; font-variant-numeric: tabular-nums }
.chart-value small { margin-left: 3px; font-size: 14px; font-weight: 400; color: var(--text-muted) }
.history-chart { display: block; width: 100%; overflow: visible }
.history-chart text { font: 11px var(--font); fill: var(--text-muted) }
.chart-gridlines { fill: none; stroke: #e6e6e6; stroke-width: 1 }
.chart-area { fill: var(--primary); fill-opacity: .1; stroke: none }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke }
.chart-marker { fill: var(--surface); stroke: var(--primary); stroke-width: 2 }
.chart-time { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--text-muted) }
.chart-empty .icon { width: 16px; height: 16px; margin: -2px 8px 0 0 }
.chart-empty { display: grid; place-items: center; min-height: 170px; padding: 20px; text-align: center; color: var(--text-muted); background: var(--surface-muted); border: 1px dashed var(--border); border-radius: var(--radius) }

/* Staging */
.setting-header { display: flex; align-items: center; justify-content: space-between; gap: 16px }
.setting-header h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.setting-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary) }
.inline-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 500 }
.inline-link .icon { width: 16px; height: 16px }
.control-description { margin: 10px 0 0; color: var(--text-muted) }
.control-feedback { min-height: 22px; margin: 8px 0 0; font-size: 14px; color: var(--text-muted) }
.dependent-fields { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-light) }
.dependent-fields textarea { max-width: 780px }
.dependent-fields input[type=password] { max-width: 420px }
.card.unsaved { border-color: var(--warning-line); box-shadow: inset 3px 0 var(--warning-line), var(--shadow-card) }
.save-bar {
  position: sticky; bottom: 16px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 0 30px; padding: 14px var(--card-pad);
  background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--radius); box-shadow: var(--shadow-pop);
}
.settings-stack > .card { margin-bottom: 20px }
.mail-layout { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 30px; align-items: start }
.mail-layout > .card { margin: 0 }
.mail-list { margin: 0; padding: 0; list-style: none }
.mail-list a { display: flex; align-items: flex-start; gap: 12px; padding: 14px var(--card-pad); border-bottom: 1px solid var(--border-light); color: var(--text) }
.mail-list a > .icon { margin-top: 3px; color: var(--text-muted) }
.mail-list a > span { min-width: 0 }
.mail-list li:last-child a { border-bottom: 0 }
.mail-list a:hover { background: var(--surface-muted); text-decoration: none }
.mail-list a[aria-current=true] { background: var(--primary-soft); box-shadow: inset 3px 0 var(--primary) }
.mail-list strong { display: block; overflow-wrap: anywhere }
.mail-list small { display: block; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere }
.mail-body {
  margin: 0; max-height: 65vh; overflow: auto; padding: 18px; white-space: pre-wrap; overflow-wrap: anywhere;
  font: 14px/1.7 var(--font-mono); background: var(--surface-muted); border: 1px solid var(--border-light); border-radius: var(--radius);
}

/* Releases */
.finder-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px var(--card-pad); background: var(--surface-muted); border-bottom: 1px solid var(--border-light);
}
.search-field { position: relative; flex: 1; max-width: 340px }
.search-field .icon { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; color: var(--text-muted); transform: translateY(-50%) }
.search-field input[type=search] { padding-left: 36px }
.scan-summary { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px var(--card-pad); border-bottom: 1px solid var(--border-light); font-size: 14px; color: var(--text-muted) }
.scan-progress { align-items: center; gap: 14px; margin: var(--card-pad) }
.folder-list { padding: 0 var(--card-pad) }
.folder-row { border-bottom: 1px solid var(--border-light) }
.folder-row:last-child { border-bottom: 0 }
.folder-header { display: flex; align-items: center; gap: 12px; min-height: 64px }
.folder-selection { display: flex; align-items: center; justify-content: center; width: 28px; min-height: 40px; margin: 0; flex: none }
.folder-toggle {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 44px; padding: 8px 0;
  border: 0; background: none; color: var(--text); text-align: left; cursor: pointer;
}
.folder-toggle > .icon { color: var(--text-muted) }
.folder-toggle .chevron { width: 16px; height: 16px; transition: transform .15s }
.folder-toggle[aria-expanded=true] .chevron { transform: rotate(90deg) }
.folder-title { flex: 1; min-width: 0 }
.folder-title strong { display: block; overflow-wrap: anywhere }
.folder-title small { display: block; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere }
.folder-counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px }
.folder-content { padding: 0 0 16px 40px }
.file-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border-light); font-size: 14px }
.file-row label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; margin: 0; font-weight: 400 }
.file-row label .icon { width: 16px; height: 16px; color: var(--text-muted) }
.file-row small { color: var(--text-muted) }
.file-note { margin: 0 0 10px; font-size: 14px; color: var(--text-muted) }
.load-more { margin-top: 10px }
.folder-content .disclosure { margin-top: 12px }
.selection-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 16px var(--card-pad); background: var(--surface-muted); border-top: 1px solid var(--border-light);
}
.selection-bar p { margin: 0; font-weight: 600 }
.selection-bar small { display: block; font-size: 13px; color: var(--text-muted) }
.review-files { max-height: 420px; overflow: auto; border: 1px solid var(--border-light); border-radius: var(--radius); margin: 20px 0 }
.review-files th { position: sticky; top: 0 }
.history-action > summary { font-size: 14px }
.history-action form { max-width: 280px; padding-top: 10px }

/* Monitoring and Overview: grouped table rows, usage bars, trend lines, chart summaries. */
.table.grouped .group-row th {
  padding: 10px var(--card-pad); background: var(--sidebar); border-bottom: 1px solid var(--border-light);
  color: var(--text-strong); font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.table.grouped .group-row .icon { width: 16px; height: 16px; margin: -2px 10px 0 0; color: var(--text-muted) }
.table.grouped .group-row small { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--text-muted) }
.table.grouped tbody + tbody .group-row th { border-top: 1px solid var(--border-light) }
.table-wrap + .table-wrap { border-top: 1px solid var(--border-light) }
.meter { display: block; width: 100%; height: 6px; border-radius: 3px }
.meter-track { fill: var(--border-light) }
.meter-fill { fill: var(--primary) }
.meter-warning .meter-fill { fill: var(--warning-line) }
.meter-danger .meter-fill { fill: var(--danger-line) }
.share { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums }
.share .meter { width: 64px }
.sparkline { display: block; width: 100%; height: 100% }
.sparkline-line { fill: none; stroke: var(--primary); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke }
.sparkline-area { fill: var(--primary); fill-opacity: .1 }
.stat-trend-danger .sparkline-line { stroke: var(--danger-line) }
.stat-trend-danger .sparkline-area { fill: var(--danger-line) }
.trend-figure { margin: 0 0 18px }
.trend-figure .sparkline { height: 56px; border-bottom: 1px solid var(--border) }
.trend-caption { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0 0; font-size: 13px; color: var(--text-muted) }
.text-danger { color: var(--danger); font-weight: 600 }
.text-warning { color: var(--warning); font-weight: 600 }
.card-body-ruled { border-top: 1px solid var(--border-light) }

/* What needs attention: one icon per kind of problem, so the list scans by subject. */
.attention-list { margin: 8px 0 0; padding: 0; list-style: none }
.attention-list li { padding: 3px 0 }
.attention-list li, .attention-list a { display: flex; align-items: flex-start; gap: 8px }
.attention-list .icon { width: 16px; height: 16px; margin-top: 3px }
.notes { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: -12px 0 24px; font-size: 14px; color: var(--text-muted) }
.notes ul { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none }
.notes a { display: inline-flex; align-items: center; gap: 6px }
.notes .icon { width: 16px; height: 16px }
/* A service row: the product's mark or icon beside its name. */
.service-name { display: inline-flex; align-items: flex-start; gap: 10px }
.service-name > .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--text-muted) }
a.service-name { color: var(--text) }
a.service-name:hover { color: var(--link) }

/* Small bar charts: bars drawn in SVG, values and day labels as text underneath. */
.chart-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) }
.chart-pair > .bar-chart { padding: 20px var(--card-pad) }
.chart-pair > .bar-chart + .bar-chart { border-left: 1px solid var(--border-light) }
.bar-chart { margin: 0; min-width: 0 }
.bar-chart figcaption { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--text-strong) }
.bar-chart svg { display: block; width: 100%; height: 88px }
.bar-chart-base { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke }
.bar-chart-bar { fill: var(--primary) }
.bar-chart-danger .bar-chart-bar { fill: var(--danger-line) }
.bar-chart-labels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 6px 0 0; padding: 0; list-style: none; text-align: center; font-size: 12px; color: var(--text-muted) }
.bar-chart-labels strong { display: block; font-size: 13px; color: var(--text-strong); font-variant-numeric: tabular-nums }

/* Staging refresh progress: done, current and pending steps. */
.job-heading { display: flex; align-items: flex-start; gap: 12px }
.job-heading > .icon { margin-top: 3px; color: var(--primary) }
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; counter-reset: step }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 4px; text-align: center; font-size: 13px; color: var(--text-muted); counter-increment: step }
.steps li + li::before { content: ""; position: absolute; top: 13px; right: calc(50% + 18px); left: calc(-50% + 18px); height: 2px; background: var(--border) }
.steps li[data-state=done]::before, .steps li[data-state=current]::before { background: var(--primary) }
.step-marker { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--neutral-line); border-radius: 50%; background: var(--surface); font-weight: 600; color: var(--text-muted) }
.step-marker::before { content: counter(step) }
.step-marker .icon { display: none; width: 15px; height: 15px; stroke-width: 2.5 }
.steps [data-state=done] .step-marker { background: var(--primary); border-color: var(--primary); color: #fff }
.steps [data-state=done] .step-marker::before { content: none }
.steps [data-state=done] .step-marker .icon { display: block }
.steps [data-state=current] { color: var(--text-strong); font-weight: 600 }
.steps [data-state=current] .step-marker { border-color: var(--primary); color: var(--primary) }
.chart-summary { justify-content: flex-start; gap: 6px 28px; margin: 0 }
.chart-summary > div { display: flex; align-items: baseline; gap: 6px }
.chart-summary dd { font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums }
.chart-summary small { margin-left: 2px; font-weight: 400; color: var(--text-muted) }

/* Controls that need a recent access confirmation: the whole area recedes evenly
   under a soft veil, with one unlock pill centred over it or offered once per page. */
.lockable { position: relative }
.lockable.is-locked > .lockable-content { filter: blur(2px); opacity: .55; user-select: none }
.lockable.is-locked::after { content: ""; position: absolute; inset: 0; background: rgb(255 255 255 / 45%); pointer-events: none }
.lock-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border-card); border-radius: 999px; box-shadow: var(--shadow-card);
  color: var(--text-strong); font-size: 13px; font-weight: 600;
}
.lock-pill .icon { width: 15px; height: 15px; color: var(--text-muted) }
.lock-pill:hover { border-color: var(--primary); color: var(--primary); text-decoration: none }
.lockable > .lock-pill { position: absolute; top: 50%; left: 50%; z-index: 1; transform: translate(-50%, -50%) }
.lock-notice { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 16px; font-size: 14px; color: var(--text-muted) }
.lock-notice p { margin: 0 }
.save-bar > .lockable { flex: 1 }
.save-bar-content { display: flex; align-items: center; justify-content: space-between; gap: 16px }
.history-action .lockable { max-width: 280px }
@media (max-width: 640px) {
  .table.responsive.grouped tr.group-row { padding: 0 }
  .table.responsive.grouped .group-row th { display: block }
  .save-bar-content { flex-direction: column; align-items: stretch }
}

/* Signed-out pages: CloudPanel's centred sign-in card. */
.auth-page { min-height: 100vh; padding: clamp(32px, 14vh, 150px) 16px 48px; background: var(--bg-auth) }
.auth-page .brand { justify-content: center; width: auto; margin: 0 auto 18px; padding: 0; border: 0; font-size: 22px }
.auth-page .brand-mark { width: 40px; height: 40px }
.auth-page .brand-mark .icon { width: 24px; height: 24px }
.auth-card { width: 100%; max-width: 400px; margin: 0 auto }
.app-main .auth-card { max-width: 480px; margin: 30px 0 }
.auth-card h1 { margin: 0 0 8px; font-size: 26px; font-weight: 500 }
.auth-card h2 { margin: 0 0 12px; font-size: 16px }
.auth-card p { color: var(--text-muted) }
.auth-card input:where(:not([type=checkbox], [type=radio], [type=hidden])) { min-height: 48px; padding: 8px 16px; font-size: 16px }
.auth-card .form-actions { flex-direction: column; align-items: stretch }
.auth-card .form-actions .btn-primary, .auth-card .form-actions .btn-danger { min-height: 48px; font-size: 16px }
.auth-card form { margin-top: 18px }
.auth-card hr { margin: 24px 0 }
.auth-footer { max-width: 400px; margin: 12px auto 0; font-size: 14px; color: var(--text-muted) }
.app-main .auth-card .card-body > h1 { font-size: 22px }

/* Two-factor setup */
.qr-setup { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 30px; align-items: start }
.qr-setup img { display: block; width: 220px; height: 220px; padding: 10px; background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius) }
.qr-setup .disclosure { margin-top: 10px }
.qr-setup form { margin-top: 20px }
.totp-secret { display: block; margin-top: 8px; padding: 10px 12px; font: 14px/1.5 var(--font-mono); letter-spacing: .06em; background: var(--surface-muted); border: 1px solid var(--border-light); border-radius: var(--radius); overflow-wrap: anywhere }
.code-input { max-width: 220px; font: 18px/1.4 var(--font-mono); letter-spacing: .12em }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 8px 32px; margin: 0 0 20px; padding: 18px 22px; list-style: none; font: 15px/1.6 var(--font-mono); background: var(--surface-muted); border: 1px solid var(--border-light); border-radius: var(--radius) }

/* Responsive */
@media (max-width: 1100px) {
  :root { --gutter: 24px; --card-pad: 20px }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .grid { gap: 24px }
  .mail-layout { grid-template-columns: 1fr }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .metric-grid > div:nth-child(n) { border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light) }
  .metric-grid > div:nth-child(2n) { border-right: 0 }
  .metric-grid > div:nth-last-child(-n+2) { border-bottom: 0 }
}
@media (max-width: 900px) {
  :root { --header-height: 60px; --gutter: 16px }
  .brand { width: auto; padding: 0 16px; border-right: 0; font-size: 18px }
  .brand-mark { width: 30px; height: 30px }
  .user-menu > summary { padding: 0 16px }
  .app-body { display: block }
  /* The sidebar becomes a scrollable row under the header; no script needed. */
  .sidebar { position: sticky; top: var(--header-height); z-index: 20; width: auto; padding: 0; border-right: 0; border-bottom: 1px solid #e5e5e5 }
  .sidebar ul { position: static; display: flex; overflow-x: auto }
  .sidebar a { flex-direction: column; gap: 3px; padding: 8px 14px 6px; border-left: 0; border-bottom: 3px solid transparent; font-size: 13px; white-space: nowrap }
  .sidebar a:hover, .sidebar a[aria-current=page] { border-bottom-color: var(--primary) }
  .page-header { flex-wrap: wrap; align-items: flex-start; margin: 18px 0 20px }
  h1 { font-size: 26px }
  .grid-2 { grid-template-columns: 1fr }
  .tabs { padding: 0 6px; margin-bottom: 24px }
  .tabs a { padding: 15px 12px 12px }
  .qr-setup { grid-template-columns: 1fr }
  .card, .grid, .stats { margin-bottom: 24px }
}
@media (max-width: 640px) {
  :root { --card-pad: 16px }
  .user-menu-name { display: none }
  .page-actions { width: 100% }
  .page-actions > .btn { flex: 1 }
  .page-actions > .segmented { flex: 1 1 100% }
  .segmented > a, .segmented > button { flex: 1; justify-content: center; padding: 4px 8px }
  .stats { gap: 12px }
  .stat { padding: 14px 16px }
  .stat dd { font-size: 22px }
  .route { grid-template-columns: 1fr; gap: 6px }
  .route > .icon { transform: rotate(90deg) }
  .alert { flex-wrap: wrap }
  .alert-actions { width: 100%; padding-left: 30px }
  .save-bar { flex-direction: column; align-items: stretch }
  .selection-bar .button-group, .selection-bar .button-group .btn { flex: 1 }
  .folder-header { flex-wrap: wrap; gap: 6px }
  .folder-counts { width: 100%; justify-content: flex-start; padding: 0 0 12px 40px }
  .folder-content { padding-left: 0 }
  .search-field { max-width: none; flex-basis: 100% }
  input:where(:not([type=checkbox], [type=radio], [type=hidden])), textarea { font-size: 16px }
  .event-list li { flex-direction: column; gap: 2px }
  .stat-value { font-size: 22px }
  .stat-trend { width: 56px; height: 26px }
  .chart-pair { grid-template-columns: 1fr }
  .chart-pair > .bar-chart + .bar-chart { border-left: 0; border-top: 1px solid var(--border-light) }
  .steps { grid-auto-flow: row; gap: 10px }
  .steps li { flex-direction: row; padding: 0; text-align: left }
  .steps li + li::before { content: none }
  .recovery-codes { grid-template-columns: 1fr }
  /* Data tables become labelled rows instead of scrolling sideways. */
  .table.responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100% }
  .table.responsive tr { padding: 12px var(--card-pad); border-bottom: 1px solid var(--border-light) }
  .table.responsive tbody tr:last-child { border-bottom: 0 }
  .table.responsive td { display: flex; justify-content: flex-end; align-items: baseline; flex-wrap: wrap; column-gap: 6px; padding: 3px 0; border: 0; text-align: right }
  .table.responsive td::before { content: attr(data-label); flex: none; margin-right: auto; padding-right: 10px; color: var(--text-muted); font-size: 14px; text-align: left }
  .table.responsive td:first-child { display: block; padding-bottom: 6px; text-align: left; font-weight: 600 }
  .table.responsive td:first-child::before, .table.responsive td[colspan]::before { content: none }
  .table.responsive td[colspan] { display: block; text-align: left; font-weight: 400 }
  .table.responsive td small { display: inline; margin: 0 }
  .table.responsive td:first-child small { display: block; margin-top: 2px }
  .table:not(.responsive) { min-width: 520px }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important }
}

/* Security page: a panel picker with its recent counts, then sign-ins, failed attempts and visits, or the website's probes. */
.panel-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0 0 30px }
.panel-picker a {
  display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px 20px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.panel-picker a:hover { border-color: var(--primary); text-decoration: none }
.panel-picker a[aria-current=page] { border-color: var(--primary); box-shadow: inset 0 -3px 0 var(--primary), var(--shadow-card) }
.panel-picker-name { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center }
.panel-picker-name .icon { grid-row: span 2; width: 22px; height: 22px; color: var(--text-muted) }
.panel-picker a[aria-current=page] .panel-picker-name .icon { color: var(--primary) }
.panel-picker-name strong { color: var(--heading) }
.panel-picker-name small { grid-column: 2; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere }
.panel-picker-counts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; font-size: 14px; color: var(--text-muted) }
.panel-picker-counts strong { font-size: 20px; color: var(--heading); font-variant-numeric: tabular-nums }
.panel-picker-counts small { flex-basis: 100%; font-size: 12px }
.auth-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 50%; background: var(--primary-soft); color: var(--primary) }
.auth-icon .icon { width: 22px; height: 22px }
.address { font-size: 14px; color: var(--text-strong) }
.address-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none }
.address-list code { display: inline-block; padding: 2px 8px; background: var(--surface-muted); border: 1px solid var(--border-light); border-radius: 3px }
.security-subheading { margin: 22px 0 12px }
.security-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border-light) }
.security-columns > section { min-width: 0; padding: 20px var(--card-pad); border-right: 1px solid var(--border-light) }
.security-columns > section:last-child { border-right: 0 }
.security-columns h3 { margin: 0 0 12px }
.security-columns .ranked-list li:last-child { border-bottom: 0; padding-bottom: 0 }
.security-columns .ranked-list span { min-width: 0; overflow-wrap: anywhere }
.security-columns .ranked-list small { display: block; font-size: 13px; font-weight: 400; color: var(--text-muted) }
.security-columns .ranked-list strong { text-align: right; white-space: nowrap }
/* The three visit totals stay on one row at every width. */
.metric-grid.visit-totals { grid-template-columns: repeat(3, minmax(0, 1fr)) }
.metric-grid.visit-totals > div { border-bottom: 0; border-right: 1px solid var(--border-light) }
.metric-grid.visit-totals > div:last-child { border-right: 0 }
/* Edge-rule patterns: each condition with where it was seen beneath it, then the whole expression to copy. */
.pattern-list span { min-width: 0; overflow-wrap: anywhere }
.pattern-list small { display: block; font-size: 13px; color: var(--text-muted) }
.pattern-list strong { white-space: nowrap }
.pattern-expression { min-height: 0; overflow-wrap: anywhere }
@media (max-width: 1100px) {
  .panel-picker { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .metric-grid.visit-totals > div:nth-child(n) { border-bottom: 0; border-right: 1px solid var(--border-light) }
  .metric-grid.visit-totals > div:last-child { border-right: 0 }
  .security-columns { grid-template-columns: 1fr }
  .security-columns > section { border-right: 0; border-bottom: 1px solid var(--border-light) }
  .security-columns > section:last-child { border-bottom: 0 }
}
@media (max-width: 640px) {
  /* The panels become compact rows: name on the left, its counts on the right. */
  .panel-picker { grid-template-columns: 1fr; gap: 8px; margin-bottom: 24px }
  .panel-picker a { flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 16px }
  .panel-picker-name small { display: none }
  .panel-picker-counts { justify-content: flex-end; gap: 0 12px; text-align: right; font-size: 13px }
  .panel-picker-counts strong { font-size: 17px }
}
