/* AegisRelay — design system (docs/design-system.md). One stylesheet for the console and the portal.
   Served locally; no inline styles, no scripts (strict CSP). Themes: light (default), dark, auto. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/Inter-Bold.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/JetBrainsMono-Medium.woff2") format("woff2"); }

/* ================================================================== tokens */
:root {
  /* neutral base (slate) */
  --bg: #F5F6F8; --surface: #FFFFFF; --surface-2: #F9FAFB; --surface-3: #F0F2F5;
  --border: #E4E7EC; --border-2: #EEF0F3; --input-border: #868F9D; --input-bg: #FFFFFF;
  --text: #101828; --text-2: #475467; --text-3: #5F6B7C;
  /* one accent */
  --accent: #2B59C3; --accent-hover: #234AA3; --accent-text: #FFFFFF; --accent-soft: #EEF3FC; --focus: #2B59C3;
  --link: #2B59C3; --link-hover: #1D3F8C;
  /* state (only for state) */
  --ok: #17663A; --ok-bg: #ECF6F0; --ok-dot: #2E8B57;
  --warn: #8A4B00; --warn-bg: #FDF4E5; --warn-dot: #C98500;
  --bad: #B42318; --bad-bg: #FDEEEC; --bad-dot: #D92D20; --bad-border: #F1B5AE;
  --info: #2B59C3; --info-bg: #EEF3FC; --info-dot: #2B59C3;
  --muted: #475467; --muted-bg: #F0F2F5; --muted-dot: #98A2B3;
  /* side menu (same in both portals) */
  --side: #0F1520; --side-line: rgba(255,255,255,.06); --side-text: #D0D6DF; --side-muted: #8D98A8; --side-title: #7F8B9C;
  --side-hover: rgba(255,255,255,.05); --side-active: #1D2736; --side-accent: #7FA3F5;
  /* charts: validated categorical order (blue, orange, aqua, yellow) */
  --s1: #2A78D6; --s2: #EB6834; --s3: #1BAF7A; --s4: #EDA100; --s5: #B8388A; --grid: #EEF0F3; --axis: #C9CED6; --hover-band: rgba(43,89,195,.06);
  --meter-track: #E9ECF0; --meter-fill: #5B7DC9; --spark: #2B59C3; --spark-area: rgba(43,89,195,.10);
  --shadow: 0 1px 2px rgba(16,24,40,.05); --shadow-pop: 0 8px 24px rgba(16,24,40,.14);
  --radius: 10px; --radius-sm: 6px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B0F15; --surface: #121821; --surface-2: #161D27; --surface-3: #1C2430;
  --border: #232C38; --border-2: #1C2430; --input-border: #606C7E; --input-bg: #0F151D;
  --text: #E6E9EE; --text-2: #AAB3C0; --text-3: #8E98A6;
  --accent: #7FA3F5; --accent-hover: #A2BDF8; --accent-text: #0B0F15; --accent-soft: #16213A; --focus: #7FA3F5;
  --link: #8FB0F7; --link-hover: #B4CBFA;
  --ok: #7CCB9A; --ok-bg: #13261B; --ok-dot: #4FAE76;
  --warn: #E9B566; --warn-bg: #2A2112; --warn-dot: #D69A3A;
  --bad: #F2A39B; --bad-bg: #2E1816; --bad-dot: #E26A5E; --bad-border: #6E2A22;
  --info: #93B2F7; --info-bg: #16213A; --info-dot: #7FA3F5;
  --muted: #AAB3C0; --muted-bg: #1C2430; --muted-dot: #6B7789;
  --side: #0A0E14; --side-active: #1A2230;
  --s1: #3987E5; --s2: #D95926; --s3: #199E70; --s4: #C98500; --s5: #B038A0; --grid: #1C2430; --axis: #344050; --hover-band: rgba(127,163,245,.08);
  --meter-track: #232C38; --meter-fill: #6F93E6; --spark: #7FA3F5; --spark-area: rgba(127,163,245,.16);
  --shadow: none; --shadow-pop: 0 8px 24px rgba(0,0,0,.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0B0F15; --surface: #121821; --surface-2: #161D27; --surface-3: #1C2430;
    --border: #232C38; --border-2: #1C2430; --input-border: #606C7E; --input-bg: #0F151D;
    --text: #E6E9EE; --text-2: #AAB3C0; --text-3: #8E98A6;
    --accent: #7FA3F5; --accent-hover: #A2BDF8; --accent-text: #0B0F15; --accent-soft: #16213A; --focus: #7FA3F5;
    --link: #8FB0F7; --link-hover: #B4CBFA;
    --ok: #7CCB9A; --ok-bg: #13261B; --ok-dot: #4FAE76;
    --warn: #E9B566; --warn-bg: #2A2112; --warn-dot: #D69A3A;
    --bad: #F2A39B; --bad-bg: #2E1816; --bad-dot: #E26A5E; --bad-border: #6E2A22;
    --info: #93B2F7; --info-bg: #16213A; --info-dot: #7FA3F5;
    --muted: #AAB3C0; --muted-bg: #1C2430; --muted-dot: #6B7789;
    --side: #0A0E14; --side-active: #1A2230;
    --s1: #3987E5; --s2: #D95926; --s3: #199E70; --s4: #C98500; --s5: #B038A0; --grid: #1C2430; --axis: #344050; --hover-band: rgba(127,163,245,.08);
    --meter-track: #232C38; --meter-fill: #6F93E6; --spark: #7FA3F5; --spark-area: rgba(127,163,245,.16);
    --shadow: none; --shadow-pop: 0 8px 24px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

/* ================================================================== base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); font-feature-settings: "cv11", "ss01"; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
code, pre, .mono { font-family: var(--mono); font-size: .93em; }
h1 { margin: 0; font-size: 22px; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; }
h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; line-height: 1.35; }
h3 { margin: 14px 0 6px; font-size: 14px; font-weight: 600; }
p { margin: 0 0 8px; }
ul, ol { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }

/* ================================================================== shell: side menu */
.shell { display: flex; min-height: 100vh; }
.side { flex: 0 0 248px; width: 248px; background: var(--side); color: var(--side-text); padding: 16px 10px 20px; display: flex; flex-direction: column; gap: 10px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2A3442 transparent; }
.side-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 6px 12px; border-bottom: 1px solid var(--side-line); }
.brand { display: flex; align-items: center; gap: 10px; color: #FFFFFF; text-decoration: none; min-width: 0; }
.brand:hover { color: #FFFFFF; }
.brand-name { display: block; font-weight: 650; font-size: 15px; color: #FFFFFF; }
.brand-sub { display: block; font-size: 11.5px; color: var(--side-muted); }
.brand-logo { max-height: 30px; max-width: 132px; width: auto; height: auto; display: block; }
.menu-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.side .menu-button { display: none; }
.menu-sections { display: flex; flex-direction: column; gap: 2px; }
.menu-section > .menu-title { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 7px 8px; min-height: 32px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--side-title); cursor: pointer; border-radius: var(--radius-sm); user-select: none; }
.menu-section > .menu-title::-webkit-details-marker { display: none; }
.menu-section > .menu-title:hover { color: #FFFFFF; background: var(--side-hover); }
.menu-title .icon { width: 14px; height: 14px; transition: transform .15s; }
.menu-section:not([open]) > .menu-title .icon { transform: rotate(-90deg); }
.menu-section.current > .menu-title { color: #E4E9F0; }
.menu-items { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 8px; }
.menu-item { position: relative; display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 13.5px; font-weight: 500; padding: 0 8px 0 10px; min-height: 34px;
  border-radius: var(--radius-sm); color: var(--side-text); }
.menu-item .icon { flex: 0 0 17px; width: 17px; height: 17px; color: var(--side-muted); }
.menu-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item:hover { background: var(--side-hover); color: #FFFFFF; }
.menu-item:hover .icon { color: #FFFFFF; }
.menu-item.soon { color: var(--side-muted); }
.menu-item.active { background: var(--side-active); color: #FFFFFF; font-weight: 600; }
.menu-item.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--side-accent); }
.menu-item.active .icon { color: var(--side-accent); }
.side :focus-visible { outline-color: var(--side-accent); }
/* "coming soon": discreet text tag, no colour block */
.soon-badge { font-size: 10px; font-weight: 500; letter-spacing: .02em; padding: 0 6px; line-height: 16px; border-radius: 4px; border: 1px solid rgba(141,152,168,.35); color: var(--side-muted); white-space: nowrap; }
.menu-note { margin: 6px 0 0; padding: 10px 8px 0; font-size: 11.5px; line-height: 1.45; color: var(--side-muted); border-top: 1px solid var(--side-line); }

/* ================================================================== shell: top bar */
.main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 28px; min-height: 58px;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-left, .topbar-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.topbar label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.top-search label { position: relative; }
.top-search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; width: 16px; height: 16px; }
.topbar input[type=search] { width: 320px; max-width: 70vw; padding-left: 34px; background: var(--surface-2); }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 5px 10px; border-radius: 999px; font-weight: 500; text-decoration: none; border: 1px solid var(--border); color: var(--text-2); background: var(--surface); }
.pill:hover { color: var(--text); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-dot); }
.pill.ok .dot { background: var(--ok-dot); } .pill.warn .dot { background: var(--warn-dot); } .pill.bad .dot { background: var(--bad-dot); }
.pill.warn { color: var(--warn); border-color: var(--warn-bg); background: var(--warn-bg); }
.pill.bad { color: var(--bad); border-color: var(--bad-bg); background: var(--bad-bg); }
.seg { display: inline-flex; border: 1px solid var(--input-border); border-radius: var(--radius-sm); overflow: hidden; margin: 0; }
.seg button { font: inherit; font-size: 12.5px; font-weight: 600; padding: 0 10px; min-height: 34px; border: 0; border-radius: 0; cursor: pointer; background: var(--surface); color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-2); padding: 0; min-height: 36px; }
.icon-button:hover { color: var(--text); border-color: var(--input-border); }
.user { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.avatar { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; text-transform: uppercase; }
.user .role { font-size: 12px; color: var(--text-3); font-weight: 400; }
button.logout { padding: 0 10px; color: var(--text-2); min-height: 34px; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; flex-wrap: wrap; }

/* ================================================================== content & page header */
.content { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 16px; max-width: 1320px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; justify-content: space-between; }
.page-head > div:first-child { min-width: 0; }
.page-head .sub, .page-desc { margin: 4px 0 0; font-size: 13.5px; color: var(--text-2); max-width: 760px; }
.page-head .refresh { margin-top: 2px; font-size: 12.5px; }
.card > .page-head, section > .page-head { margin-bottom: 10px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumbs { font-size: 13px; color: var(--text-2); display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: -6px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.section-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; margin: 8px 0 -4px; }
.section-head h2 { margin: 0; font-size: 15px; }

/* ================================================================== cards */
.card, section.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card.soft { background: var(--surface-2); box-shadow: none; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head .sub { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); min-width: 0; }
.kpi .label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.kpi .value { font-size: 24px; font-weight: 650; font-family: var(--mono); letter-spacing: -.02em; line-height: 1.2; }
.kpi .sub { font-size: 12px; color: var(--text-3); }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.col-3 { flex: 3 1 460px; min-width: 0; } .col-2 { flex: 2 1 300px; min-width: 0; } .col-1 { flex: 1 1 300px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-tight { display: flex; flex-direction: column; gap: 2px; }

/* ================================================================== status badges (chip) */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 1px 8px; line-height: 20px; border-radius: 999px; white-space: nowrap;
  background: var(--muted-bg); color: var(--muted); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-dot); flex: 0 0 6px; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.ok::before { background: var(--ok-dot); }
.chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.warn::before { background: var(--warn-dot); }
.chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.bad::before { background: var(--bad-dot); }
.chip.info { background: var(--info-bg); color: var(--info); } .chip.info::before { background: var(--info-dot); }
.chip.muted::before { background: var(--muted-dot); }
.chip.plain::before, .chip.soon::before, .chip.tag::before { display: none; }
.chip.tag { background: var(--surface-3); color: var(--text-2); border-radius: 4px; font-family: var(--mono); font-size: 11.5px; }
.chip.soon { background: transparent; color: var(--text-3); border: 1px solid var(--border); border-radius: 4px; font-size: 11px; line-height: 18px; }
/* legacy inline state spans */
span.ok:not(.chip), span.bad:not(.chip), span.note:not(.chip) { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 999px; }
span.ok { background: var(--ok-bg); color: var(--ok); } span.bad { background: var(--bad-bg); color: var(--bad); } span.note { background: var(--warn-bg); color: var(--warn); }

/* ================================================================== alerts & empty state */
.alert { border-radius: var(--radius-sm); padding: 10px 14px; border: 1px solid transparent; font-size: 13.5px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn, .note { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 14px; }
.alert.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-border); }
.alert.info { background: var(--info-bg); color: var(--text); border-color: transparent; }
.alert a { color: inherit; font-weight: 600; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 32px 16px; color: var(--text-2); }
.empty .icon { width: 28px; height: 28px; color: var(--text-3); margin-bottom: 4px; }
.empty b { color: var(--text); font-weight: 600; font-size: 14px; }
.empty p { margin: 0; max-width: 460px; font-size: 13px; }
.empty .button { margin-top: 8px; }
.muted { color: var(--text-2); }
.ok { color: var(--ok); } .bad { color: var(--bad); }
p.ok, p.bad { margin: 0; }
.small { font-size: 12px; margin: 0; }
.help, .hint { font-size: 12px; font-weight: 400; color: var(--text-3); line-height: 1.45; }

/* ================================================================== buttons */
button, .button { font: inherit; font-size: 13.5px; font-weight: 500; padding: 0 14px; min-height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--input-border);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
button:hover, .button:hover { background: var(--surface-3); color: var(--text); }
button.primary, .button.primary, form.edit > button, form.edit .form-foot > button:first-child { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:hover, .button.primary:hover, form.edit .form-foot > button:first-child:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
button.danger, .button.danger, form.edit .form-foot > button.danger:first-child { background: var(--surface); color: var(--bad); border-color: var(--bad-border); }
button.danger:hover, .button.danger:hover, form.edit .form-foot > button.danger:first-child:hover { background: var(--bad-bg); color: var(--bad); }
button.danger-solid, .button.danger-solid { background: var(--bad); border-color: var(--bad); color: #FFFFFF; }
:root[data-theme="dark"] button.danger-solid { color: #1A0B09; }
button.ghost, .button.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
button.ghost:hover, .button.ghost:hover { background: var(--surface-3); color: var(--text); }
button.sm, .button.sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
button:disabled { opacity: .55; cursor: not-allowed; }
.button-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--link); font-weight: 500; cursor: pointer; }
.button-link:hover { background: none; color: var(--link-hover); text-decoration: underline; }

/* ================================================================== forms */
label { font-size: 13px; font-weight: 500; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]), select, textarea {
  font: inherit; font-size: 13.5px; font-weight: 400; color: var(--text); background: var(--input-bg); padding: 7px 10px;
  border: 1px solid var(--input-border); border-radius: var(--radius-sm); min-height: 36px; max-width: 100%; }
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }
input[readonly] { background: var(--surface-2); color: var(--text-2); }
input[type=file] { font: inherit; font-size: 13px; color: var(--text-2); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-size: 13px; padding: 6px 12px; margin-right: 10px; border-radius: var(--radius-sm); border: 1px solid var(--input-border); background: var(--surface); color: var(--text); cursor: pointer; }
select { padding-right: 28px; }
textarea { min-height: 92px; font-family: var(--mono); font-size: 12.5px; width: 100%; line-height: 1.5; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--accent); vertical-align: middle; margin: 0; flex: 0 0 auto; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 6px; }
/* form card: sections with label, field (+ unit), short help */
form.edit, .form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
form.edit h2, .form-card h2 { margin: 0; }
form.edit > h2 + p, .form-card > h2 + p { margin-top: -8px; }
form.edit label, .field { display: flex; flex-direction: column; gap: 5px; }
form.edit label > input:not([type=checkbox]):not([type=radio]), form.edit label > select, form.edit label > textarea, .field > input, .field > select, .field > textarea { width: 100%; }
.form-section { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border-2); }
.form-section:first-of-type { padding-top: 0; border-top: 0; }
.form-section > header h3, .form-section > h3 { margin: 0; font-size: 14px; }
.form-section > header p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); }
.fields, .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px 16px; }
@media (min-width: 1100px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.input-unit { display: flex; align-items: stretch; }
.input-unit > input { flex: 1 1 auto; min-width: 0; border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-unit > .unit { display: inline-flex; align-items: center; padding: 0 10px; font-size: 12.5px; color: var(--text-2); background: var(--surface-3); border: 1px solid var(--input-border); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; white-space: nowrap; }
label.check, .check { display: flex; flex-direction: row !important; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 13.5px; }
label.check input { margin-top: 2px; }
.form-foot, .form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-top: 1px solid var(--border-2); padding-top: 14px; }
.form-foot .help { margin-left: 4px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; align-items: end; }
.filters label { display: flex; flex-direction: column; gap: 5px; }
.filters input, .filters select { width: 100%; }
label.perm { justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border-2); }
.perm-label { font-size: 13.5px; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ================================================================== list toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.toolbar .search { position: relative; flex: 1 1 260px; max-width: 420px; }
.toolbar .search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.toolbar .search input { width: 100%; padding-left: 34px; }
.toolbar select { width: auto; }
.toolbar .spacer { flex: 1 1 auto; }
.toolbar-note { font-size: 12px; color: var(--text-3); margin: 6px 0 0; }
.quick { display: inline-flex; border: 1px solid var(--input-border); border-radius: var(--radius-sm); overflow: hidden; }
.quick a { font-size: 12.5px; font-weight: 500; padding: 0 11px; min-height: 34px; display: inline-flex; align-items: center; text-decoration: none; color: var(--text-2); background: var(--surface); }
.quick a + a { border-left: 1px solid var(--border); }
.quick a:hover { background: var(--surface-3); color: var(--text); }
.quick a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ================================================================== data table */
.table-wrap { min-width: 0; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th { text-align: left; color: var(--text-2); font-size: 12px; font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--border-2); vertical-align: middle; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table.data tr:hover td { background: var(--surface-2); }
.card > .table-wrap, .card > table, .card.flush > table { margin: 0 -18px; width: calc(100% + 36px); }
.card > .table-wrap:first-child, .card > table:first-child { margin-top: -16px; }
.card > .table-wrap:last-child, .card > table:last-child { margin-bottom: -16px; }
.card > .table-wrap:first-child th:first-child { border-top-left-radius: var(--radius); }
.card > .table-wrap:first-child th:last-child { border-top-right-radius: var(--radius); }
.card .table-wrap th, .card table th { position: sticky; top: 58px; z-index: 2; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; text-align: right; width: 1%; }
td.actions a { margin-left: 8px; }
td code, td.mono { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
table.kv th { width: 34%; background: transparent; font-weight: 500; color: var(--text-2); white-space: normal; position: static; }
@media (max-width: 900px) { .opt { display: none; } }

/* row action menu "…" (details/summary, no script) */
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; width: 30px; height: 30px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); font-weight: 700; letter-spacing: .05em; border: 1px solid transparent; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary:hover, .row-menu[open] > summary { background: var(--surface-3); color: var(--text); border-color: var(--border); }
.row-menu .menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); padding: 4px; display: flex; flex-direction: column; text-align: left; white-space: normal; }
.menu-pop a, .menu-pop button { display: flex; width: 100%; justify-content: flex-start; align-items: center; gap: 8px; min-height: 32px; padding: 0 10px; border: 0; border-radius: 4px;
  background: transparent; color: var(--text); text-decoration: none; font-size: 13px; font-weight: 400; margin: 0; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-3); color: var(--text); }
.menu-pop .danger, .menu-pop a.danger { color: var(--bad); }
.menu-pop .sep { height: 1px; background: var(--border); margin: 4px 2px; }
.menu-pop form { margin: 0; }
.menu-pop form.inline { display: flex; padding: 4px 6px; gap: 6px; }
.menu-pop form.inline select { flex: 1 1 auto; min-height: 30px; padding: 3px 6px; font-size: 12.5px; }
.menu-pop form.inline button { width: auto; min-height: 30px; border: 1px solid var(--input-border); }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); }
.tabs a { font-size: 13.5px; padding: 9px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--text-2); font-weight: 500; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.tab-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 11px; text-align: center; line-height: 18px; font-family: var(--mono); }
.tabs a[aria-current="page"] .tab-count { background: var(--accent-soft); color: var(--accent); }

/* pagination */
.pager { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.pager-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pager-links .button { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.pager-size { display: inline-flex; gap: 6px; align-items: center; }
.pager-size a, .pager-size .current { min-width: 30px; text-align: center; padding: 2px 6px; border-radius: 4px; text-decoration: none; font-family: var(--mono); font-size: 12px; }
.pager-size .current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.card.flush > .pager, .card > .pager { margin: 12px -18px -16px; }
.card.flush > .pager { margin: 0; }

/* code blocks */
pre.copy { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; white-space: pre-wrap; word-break: break-word; font-size: 12.5px; margin: 4px 0 8px; }
details summary { cursor: pointer; }
ul.plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; line-height: 1.5; }
.kv { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--border-2); }
.kv .k { font-size: 12px; color: var(--text-3); }
.kv .v { font-size: 13.5px; font-weight: 500; }
.kv-grid { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px 20px; }
.kv-grid div { min-width: 0; }
.kv-grid dt { font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.kv-grid dd { margin: 0; font-size: 13.5px; }
.kv-grid .kv-full { grid-column: 1 / -1; }
details.more { margin-top: 10px; }
details.more > summary, details.advanced > summary { font-size: 13px; color: var(--link); padding: 6px 0; }
details.advanced { border-top: 1px solid var(--border); padding-top: 8px; }

/* confirmation page */
.confirm { max-width: 640px; }
.confirm .card { border-color: var(--bad-border); }
.confirm .card.neutral { border-color: var(--border); }
.confirm dl { margin: 6px 0 12px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13.5px; }
.confirm dt { color: var(--text-3); }
.confirm dd { margin: 0; font-family: var(--mono); overflow-wrap: anywhere; }

/* ================================================================== charts (server-side SVG) */
.chart-card { display: flex; flex-direction: column; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz .grid { stroke: var(--grid); stroke-width: 1; }
.viz .baseline { stroke: var(--axis); stroke-width: 1; }
.viz .tick { fill: var(--text-3); font: 10.5px var(--mono); }
.viz .rlabel { fill: var(--text); font: 12px var(--mono); }
.viz .rvalue { fill: var(--text-2); font: 600 11.5px var(--mono); }
.viz .seg { stroke: var(--surface); stroke-width: 1; }
.viz .hit { fill: transparent; pointer-events: all; }
.viz .col:hover .hit { fill: var(--hover-band); }
.viz .col:hover .seg { opacity: .85; }
.viz .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.viz .line.s1 { stroke: var(--s1); } .viz .line.s2 { stroke: var(--s2); } .viz .line.s3 { stroke: var(--s3); } .viz .line.s4 { stroke: var(--s4); } .viz .line.s5 { stroke: var(--s5); }
.s1 { fill: var(--s1); background: var(--s1); } .s2 { fill: var(--s2); background: var(--s2); } .s3 { fill: var(--s3); background: var(--s3); } .s4 { fill: var(--s4); background: var(--s4); } .s5 { fill: var(--s5); background: var(--s5); }
.viz .line.s1, .viz .line.s2, .viz .line.s3, .viz .line.s4, .viz .line.s5 { fill: none; background: none; }
.legend { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--text); font-weight: 600; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
table.num-table th.num, table.num-table td.num { text-align: right; white-space: nowrap; }
/* meters & sparklines: neutral accent fill, state colour only beyond thresholds */
.meter { width: 100%; height: 6px; display: block; }
.meter-track { fill: var(--meter-track); }
.meter-fill.ok { fill: var(--meter-fill); } .meter-fill.warn { fill: var(--warn-dot); } .meter-fill.bad { fill: var(--bad-dot); }
.spark { width: 120px; height: 26px; flex: 0 0 auto; display: block; }
.spark-line { fill: none; stroke: var(--spark); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-area { fill: var(--spark-area); stroke: none; }

/* dashboard: compact node rows */
.node-rows { display: flex; flex-direction: column; }
.node-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) repeat(3, minmax(110px, 1fr)) 128px 28px; gap: 16px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--border-2); text-decoration: none; color: var(--text); }
.node-row:last-child { border-bottom: 0; }
.node-row:hover { background: var(--surface-2); color: var(--text); }
.node-row.head { font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--border); padding-top: 8px; padding-bottom: 8px; }
.node-row.head:hover { background: var(--surface-2); }
.node-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.node-name b { font-family: var(--mono); font-weight: 500; font-size: 13.5px; }
.mini-meter { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); min-width: 0; }
.mini-meter .mono { color: var(--text); }
.node-row .go { color: var(--text-3); justify-self: end; }
@media (max-width: 900px) { .node-row { grid-template-columns: 1fr 1fr 1fr; gap: 10px; } .node-row.head { display: none; } .node-row .node-name { grid-column: 1 / -1; } .node-row .spark-cell, .node-row .go { display: none; } }

/* node detail cards (Cluster → Nodes) */
.grid-sys { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.node-card { display: flex; flex-direction: column; gap: 12px; }
.node-card .card-head { margin-bottom: 0; }
.node-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12.5px; }
.gauges { display: flex; flex-direction: column; gap: 12px; }
.gauge { display: flex; flex-direction: column; gap: 5px; }
.gauge-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; }
.gauge-label { font-weight: 600; }
.gauge-value { margin-left: auto; font-size: 12px; color: var(--text-2); }
.spark-wrap { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.fact { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; padding-top: 8px; border-top: 1px solid var(--border-2); }
.fact .mono { margin-left: auto; }
.alert-line { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; padding: 6px 0; border-bottom: 1px solid var(--border-2); }
.alert-line:last-child { border-bottom: 0; }

/* metrics page */
.metric-groups { display: flex; flex-direction: column; gap: 16px; }
.metric-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.metric-card { border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); }
.metric-card .label { font-size: 12.5px; color: var(--text-2); }
.metric-card .value { font: 600 20px var(--mono); }
.metric-card .sub { font-size: 11.5px; color: var(--text-3); }

/* ================================================================== message list (rows open in place) */
.filter-bar { display: flex; flex-direction: column; gap: 10px; }
.filter-bar .help { margin: 0; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.filter-chip:hover { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.custom-dates { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.custom-dates label { display: flex; flex-direction: column; gap: 5px; }
.msg-card { padding: 0; overflow: visible; }
.msg-list { display: flex; flex-direction: column; }
.msg-head, .msg-row > summary { display: grid; grid-template-columns: 10rem minmax(0, 1fr) minmax(0, 1fr) 7.5rem minmax(0, 1.25fr); gap: 12px; align-items: center; padding: 9px 18px; }
.msg-head { font-size: 12px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 58px; z-index: 2; border-radius: var(--radius) var(--radius) 0 0; }
.msg-row { border-bottom: 1px solid var(--border-2); }
.msg-row > summary { list-style: none; cursor: pointer; font-size: 13.5px; min-height: 40px; }
.msg-row > summary::-webkit-details-marker { display: none; }
.msg-row > summary:hover { background: var(--surface-2); }
.msg-row[open] > summary { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.msg-row > summary > span, .q-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-time { font-size: 12px; color: var(--text-2); font-family: var(--mono); }
.c-why { color: var(--text-2); font-size: 13px; }
.msg-detail { padding: 14px 18px 16px; background: var(--surface-2); border-top: 1px solid var(--border-2); display: flex; flex-direction: column; gap: 12px; }
.msg-detail p { margin: 0; }
.why-box h3 { margin: 0 0 4px; font-size: 13.5px; }
.why-box ul.plain { font-size: 13.5px; gap: 3px; }
.msg-empty { margin: 0; }
.msg-card > .small { padding: 0 18px 12px; }
.batch-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--border); background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; }
.batch-bar label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.q-grid { display: grid; grid-template-columns: 1.6rem 7.5rem 6.5rem 6rem minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; align-items: center; padding: 9px 18px; }
.q-grid.q-ro { grid-template-columns: 7.5rem 6.5rem 6rem minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); }
.q-row { border-bottom: 1px solid var(--border-2); font-size: 13.5px; min-height: 40px; }
.q-row:hover { background: var(--surface-2); }
.q-row:has(input:checked) { background: var(--accent-soft); }
.c-cb { display: flex; align-items: center; }
.c-age { font-size: 12px; }
.small-list { font-size: 12.5px; max-height: 260px; overflow-y: auto; }
@media (max-width: 760px) {
  .msg-head, .msg-head.q-grid { display: none; }
  .msg-row > summary { grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 10px 14px; }
  .c-time { grid-column: 1; } .msg-row .c-st { grid-column: 2; grid-row: 1; }
  .msg-row .c-from, .msg-row .c-to, .msg-row .c-why { grid-column: 1 / -1; }
  .q-row.q-grid { grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: 3px 10px; padding: 10px 14px; }
  .q-row.q-ro { grid-template-columns: minmax(0, 1fr) auto; }
  .q-row .c-cb { grid-row: 1 / span 4; align-self: start; }
  .q-row .c-from, .q-row .c-to, .q-row .c-why, .q-row .c-age { grid-column: -3 / -1; }
  .q-row.q-ro .c-from, .q-row.q-ro .c-to, .q-row.q-ro .c-why, .q-row.q-ro .c-age { grid-column: 1 / -1; }
  .msg-detail, .pager, .batch-bar { padding-left: 14px; padding-right: 14px; }
}

/* ================================================================== tutorial */
.tut { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1100px) { .tut { grid-template-columns: 240px minmax(0, 1fr); } .tut-toc { position: sticky; top: 76px; } }
.tut-toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.tut-toc ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.tut-body { display: flex; flex-direction: column; gap: 14px; max-width: 860px; }
.tut-sec { scroll-margin-top: 76px; }
.tut-sec h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.tut-n { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.tut-sec p { font-size: 14px; line-height: 1.6; color: var(--text); margin: 0 0 8px; }
.tut-steps { margin: 4px 0 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.55; }
.tut-steps li::marker { color: var(--accent); font-weight: 700; }
.tut-tip { margin: 6px 0 4px; }
.tut-top { font-size: 12.5px; margin: 6px 0 0 !important; }

/* ================================================================== login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 26px 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.login-card .brand { color: var(--text); }
.login-card .brand-name { color: var(--text); }
.login-card .brand-sub { color: var(--text-2); }
.login-card h1 { font-size: 19px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; }
.login-card input { width: 100%; }
.login-card button { min-height: 40px; }
.login-foot { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }

/* ================================================================== misc helpers */
.narrow-body { max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.lead { font-size: 15px; line-height: 1.55; color: var(--text-2); margin: 0; }
.inline-gap { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.w-auto { width: auto !important; }
.w-9em { width: 9em; }
.w-8em { width: 8em; }
.right { margin-left: auto; }
.mt { margin-top: 10px; }
.brand-logo-preview { max-height: 64px; max-width: 240px; background: #FFFFFF; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; }
.qr { width: 196px; height: 196px; background: #FFFFFF; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.powered { font-size: 12px; text-align: right; margin: 6px 0 0; }
.pre-line { white-space: pre-line; }
.secret { font-size: 15px; letter-spacing: .05em; }
.portal .content { gap: 18px; }

/* ================================================================== narrow screens */
@media (max-width: 960px) {
  .shell { flex-direction: column; }
  .side { position: static; width: auto; height: auto; flex: 0 0 auto; padding: 8px 12px; gap: 0; overflow: visible; }
  .side-head { padding: 0; border-bottom: 0; }
  .side .menu-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600;
    color: var(--side-text); border: 1px solid #2A3442; cursor: pointer; }
  .side .menu-button:hover { background: var(--side-hover); color: #FFFFFF; }
  .menu-toggle:focus-visible ~ .side-head .menu-button { outline: 2px solid var(--side-accent); outline-offset: 2px; }
  .menu-toggle:checked ~ .side-head .menu-button { background: var(--side-hover); color: #FFFFFF; }
  .menu-sections { display: none; }
  .menu-toggle:checked ~ .menu-sections { display: flex; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--side-line); }
  .menu-item { min-height: 42px; }
  .menu-item.active::before { left: -6px; }
  .content { padding: 16px 14px 32px; gap: 14px; }
  .card .table-wrap th, .card table th, .msg-head { top: 0; }
  h1 { font-size: 20px; }
}
@media (max-width: 560px) {
  .card, section.card { padding: 14px; }
  .card > .table-wrap, .card > table { margin-left: -14px; margin-right: -14px; width: calc(100% + 28px); }
  .card > .table-wrap:first-child { margin-top: -14px; }
  .card > .table-wrap:last-child { margin-bottom: -14px; }
  th:first-child, td:first-child { padding-left: 14px; } th:last-child, td:last-child { padding-right: 14px; }
  form.edit, .form-card { padding: 14px; }
  .page-head .actions-row { width: 100%; }
  .toolbar .search { max-width: none; }
}
.card.flush > .card-head { padding: 14px 18px 0; margin-bottom: 12px; }
.danger-zone { border-color: var(--bad-border); }
.danger-zone .card-head { margin-bottom: 0; }
.q-grid { grid-template-columns: 1.6rem 7.5rem 6.5rem 6rem minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr) 2rem; }
.q-grid.q-ro { grid-template-columns: 7.5rem 6.5rem 6rem minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); }
.q-row > span.c-act { overflow: visible; }
@media (max-width: 760px) { .q-row.q-grid { grid-template-columns: 1.6rem minmax(0, 1fr) auto 2rem; } .q-row .c-act { grid-column: 4; grid-row: 1; } }

/* ================================================================== H0: finishing (operator review) */
/* search fields: the magnifier never covers the text (the generic input rule is more specific) */
.toolbar .search input, .top-search input[type=search] { padding-left: 36px !important; }
.top-search input[type=search] { padding-right: 62px !important; }
.kbd-hint { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 500 11px/18px var(--mono); color: var(--text-3); border: 1px solid var(--border);
  border-radius: 4px; padding: 0 6px; background: var(--surface); pointer-events: none; }
.top-search input:focus ~ .kbd-hint, .top-search input:not(:placeholder-shown) ~ .kbd-hint { display: none; }

/* row menus "…": a click anywhere outside closes them (transparent overlay inside the summary, no script),
   always above the page, opening upwards on the last rows so they are never cut */
.row-menu[open] > summary { position: relative; z-index: 41; }
.row-menu[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: -1; cursor: default; }
.row-menu .menu-pop { z-index: 42; }
.card.flush { overflow: visible; }
tbody tr:nth-last-child(-n+2):not(:nth-child(-n+3)) .row-menu .menu-pop,
.msg-list > .q-row:nth-last-child(-n+2):not(:nth-child(-n+4)) .row-menu .menu-pop { top: auto; bottom: calc(100% + 4px); }

/* one filter bar for every list: search, selects, period, dates and ONE "Filter" button on a line */
.toolbar { gap: 8px; row-gap: 8px; }
.toolbar label:not(.search) > select, .toolbar label:not(.search) > input { width: auto; min-width: 0; }
.toolbar-actions { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; }
.custom-dates { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.custom-dates label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.custom-dates input[type=date] { width: 150px; }
.toolbar-note { margin: -8px 0 0; font-size: 12px; color: var(--text-3); }
.filter-bar .toolbar-note { margin: 0; }
.filter-bar { gap: 8px; }
@media (max-width: 640px) {
  .toolbar > .search, .toolbar > label, .toolbar > .quick, .toolbar > .custom-dates { flex: 1 1 100%; max-width: none; }
  .toolbar > label > select, .toolbar > label > input { width: 100%; }
  .toolbar .quick a { flex: 1 1 auto; justify-content: center; padding: 0 6px; }
  .toolbar-actions { margin-left: 0; width: 100%; } .toolbar-actions > * { flex: 1 1 0; }
  .custom-dates label { flex: 1 1 140px; } .custom-dates input[type=date] { width: 100%; }
}

/* domains table (H1) */
th.sortable a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
th.sortable a:hover { color: var(--text); }
.sort-ind { font-size: 10px; color: var(--text-3); }
th[aria-sort] .sort-ind { color: var(--accent); }
.one-line { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
table.domains td { overflow-wrap: normal; }
table.domains .c-name { max-width: 260px; }
table.domains .c-name > a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.domains .c-owner { max-width: 180px; }
table.domains .c-route { max-width: 260px; }
.c-route .one-line + .one-line { margin-top: 3px; }
.row-warn { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.row-warn .chip { font-size: 11px; line-height: 17px; }
.dns-tags { display: inline-flex; gap: 3px; flex-wrap: nowrap; }
.tagmini { font: 600 10.5px/18px var(--mono); padding: 0 5px; border-radius: 3px; background: var(--muted-bg); color: var(--muted); }
.tagmini.ok { background: var(--ok-bg); color: var(--ok); } .tagmini.warn { background: var(--warn-bg); color: var(--warn); } .tagmini.bad { background: var(--bad-bg); color: var(--bad); }
.chip.tag.warnish { background: var(--warn-bg); color: var(--warn); }
@media (max-width: 640px) { table.domains .c-name, table.domains .c-route { max-width: 160px; } }

/* forms (H2): left-aligned choices, "learn more" for long help, action bar pinned to the card bottom */
.choice { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.choice-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px 24px; }
.choice-row .choice-label { flex: 0 0 auto; min-width: 7rem; font-size: 13px; font-weight: 600; color: var(--text-2); }
.form-section > label.check, .choice > label.check, .choice-row > label.check { align-self: flex-start; justify-content: flex-start; text-align: left; }
fieldset > label.check { justify-content: flex-start; }
details.learn { font-size: 12.5px; color: var(--text-2); max-width: 760px; }
details.learn > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; color: var(--link); font-weight: 500; cursor: pointer; }
details.learn > summary::-webkit-details-marker { display: none; }
details.learn > summary::before { content: "+"; font-family: var(--mono); width: 12px; }
details.learn[open] > summary::before { content: "−"; }
details.learn .learn-body { margin-top: 6px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); line-height: 1.55; }
.form-section > header details.learn { margin-top: 4px; }
.form-card > .form-actions, form.edit > .form-foot { position: sticky; bottom: 0; z-index: 5; background: var(--surface); margin: 0 -20px -18px; padding: 12px 20px;
  border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
@media (max-width: 560px) { .form-card > .form-actions, form.edit > .form-foot { margin: 0 -14px -14px; padding: 10px 14px; } .choice-row .choice-label { min-width: 0; flex-basis: 100%; } }

.js .nojs-only { display: none; }

/* H4: phone width (375 px) — no horizontal scroll */
@media (max-width: 640px) {
  th, td { padding: 8px; }
  td.nowrap, .nowrap { white-space: normal; }
  table.domains thead { display: none; }
  table.domains, table.domains tbody { display: block; }
  table.domains tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 8px; padding: 10px 14px; border-bottom: 1px solid var(--border-2); }
  table.domains td { display: block; padding: 0; border: 0; max-width: none !important; }
  table.domains td.opt { display: none; }
  table.domains .c-name { grid-column: 1; grid-row: 1; }
  table.domains .c-status { grid-column: 2; grid-row: 1; }
  table.domains td.actions { grid-column: 3; grid-row: 1; width: auto; }
  table.domains .c-route, table.domains .c-dns { grid-column: 1 / -1; }
  table.domains tr:hover td { background: transparent; }
  .page-head h1 { font-size: 19px; }
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 20px; }
}

/* V: visual check with Chromium (375 px and 1440 px, light and dark) */
/* domain names in titles keep the title size */
h1.mono { font-size: 21px; overflow-wrap: anywhere; }
@media (max-width: 640px) { h1.mono { font-size: 18px; } }
/* links inside tables: no underline until hover (mono names read better) */
td a.mono, td a.chip { text-decoration: none; }
td a.mono:hover, td a.chip:hover { text-decoration: underline; }
.chip.owner { background: var(--surface-3); color: var(--text-2); border-radius: 4px; font-size: 12px; text-decoration: none; }
.chip.owner::before { display: none; }
/* domains: the least used columns only on very wide screens */
@media (max-width: 1599px) { .opt-xl { display: none; } }
@media (max-width: 560px) { .opt-sm { display: none; } }
td.c-dom { max-width: 0; width: 45%; }
/* the danger zone and help cards after a form are as wide as the form */
/* "coming soon" items: the label may wrap instead of being cut */
.menu-item.soon .menu-label { white-space: normal; line-height: 1.25; padding: 6px 0; }
/* metrics: two groups per row on wide screens so the charts keep a readable scale */
@media (min-width: 1200px) { .metric-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
/* filter bars: text and number fields have a fixed width, the search takes the rest */
@media (min-width: 641px) { .toolbar label:not(.search) > input:not([type=date]):not([type=checkbox]) { width: 11rem; } }
section.card.msg-card { padding: 0; }
/* phone: tables without row menus scroll sideways instead of breaking names letter by letter
   (tables with "…" menus keep wrapping so the menu is never clipped) */
@media (max-width: 640px) {
  .table-wrap:not(:has(.row-menu)) { overflow-x: auto; }
  .table-wrap:not(:has(.row-menu)) td { overflow-wrap: break-word; }
  .table-wrap:not(:has(.row-menu)) td.mono, .table-wrap:not(:has(.row-menu)) td > .mono:only-child { white-space: nowrap; }
}
@media (max-width: 640px) { .table-wrap:has(.row-menu) td:first-child { min-width: 7.5rem; } }
/* phone: charts keep a readable scale (min. 520 units wide) and scroll sideways instead of shrinking the text */
@media (max-width: 640px) { .chart { overflow-x: auto; } .chart svg.viz { min-width: 520px; } }
@media (max-width: 640px) { .toolbar > select, .toolbar > input:not([type=hidden]) { flex: 1 1 100%; width: 100%; } }
@media (max-width: 640px) {
  .toolbar > label:not(.search) > select, .toolbar > label:not(.search) > input { width: 100%; }
  .metric-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
td pre.copy, td code { overflow-wrap: anywhere; word-break: break-all; }
label.perm > .stack-tight { flex: 1 1 auto; min-width: 0; } label.perm > input[type=checkbox] { flex: 0 0 auto; margin-left: auto; }
@media (max-width: 640px) { td .chip:not(.tag) { white-space: normal; align-items: baseline; } }
@media (max-width: 640px) { th { white-space: normal; } td .chip { overflow-wrap: normal; word-break: normal; } }
@media (max-width: 1599px) { table.domains .c-name { max-width: 220px; } table.domains .c-owner { max-width: 150px; } table.domains .c-route { max-width: 220px; } }
.card.msg-card > .pager { margin: 0; }
@media (min-width: 641px) { .toolbar > .search { flex: 1 1 200px; max-width: 360px; } }
.only-sm { display: none; }
@media (max-width: 560px) {
  .only-sm { display: inline-flex; margin-top: 4px; }
}
textarea.text { font-family: var(--sans); font-size: 13.5px; }

/* ================================================================== V2: compact top bar and density (operator review 2026-11-12)
   Every top-bar control is 32 px high; the bar stays on one line from 1024 px to 1920 px. */
:root { --ctl: 32px; --topbar-h: 52px; }
.topbar { flex-wrap: nowrap; gap: 12px; padding: 0 24px; min-height: var(--topbar-h); height: var(--topbar-h); }
.topbar-left, .topbar-right { flex-wrap: nowrap; gap: 8px; min-width: 0; }
.topbar-left { flex: 1 1 auto; }
.topbar-right { flex: 0 0 auto; margin-left: auto; }
.topbar label { gap: 0; }
.topbar select, .topbar input[type=search], .topbar button, .topbar .icon-button, .topbar .seg, .topbar .rev, .avatar-button {
  height: var(--ctl); min-height: var(--ctl); font-size: 13px; }
.topbar .seg button { height: calc(var(--ctl) - 2px); min-height: 0; padding: 0 9px; font-size: 12px; }
.topbar .icon-button { width: var(--ctl); }
.topbar .icon-button .icon { width: 16px; height: 16px; }
/* reseller / server filters: the name of the filter is inside the control ("Reseller: Direct") */
.top-filters { display: flex; flex-wrap: nowrap; gap: 8px; min-width: 0; }
.top-filters label { display: block; min-width: 0; }
.top-filters select { padding: 0 26px 0 10px; field-sizing: content; min-width: 8rem; max-width: 13rem; width: auto; background-color: var(--surface); }
/* search: short, full placeholder, Ctrl K hint inside */
.top-search { flex: 0 1 15rem; min-width: 9rem; }
.top-search label { position: relative; display: block; width: 100%; }
.topbar input[type=search] { width: 100%; max-width: none; padding: 0 56px 0 32px !important; background: var(--surface-2); }
.top-search .icon { left: 9px; width: 15px; height: 15px; }
.kbd-hint { right: 6px; font-size: 10.5px; line-height: 18px; padding: 0 5px; }
.search-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.search-open { display: none !important; }
.search-toggle:focus-visible + .search-open { outline: 2px solid var(--focus); outline-offset: 2px; }
/* revision: small indicator, full text in the title; warning colour while nodes are still applying */
.rev { display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  font-size: 12.5px; font-weight: 500; color: var(--text-2); text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rev:hover { color: var(--text); border-color: var(--input-border); }
.rev .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok-dot); flex: 0 0 7px; }
.rev.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; } .rev.warn .dot { background: var(--warn-dot); }
.rev.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-border); } .rev.bad .dot { background: var(--bad-dot); }
.rev-short { display: none; }
/* user: only the avatar; name, role and "Log out" in its menu */
.top-menu { position: relative; }
.top-menu > summary { list-style: none; cursor: pointer; }
.top-menu > summary::-webkit-details-marker { display: none; }
.avatar-button { width: var(--ctl); display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.avatar-button .avatar { width: var(--ctl); height: var(--ctl); flex-basis: var(--ctl); font-size: 12px; }
.avatar-button:hover .avatar, .top-menu[open] .avatar { box-shadow: 0 0 0 2px var(--accent); }
.top-menu[open] > summary { position: relative; z-index: 41; }
.top-menu[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: -1; cursor: default; }
.top-menu .menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 42; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); padding: 4px; display: flex; flex-direction: column; }
.menu-who { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 6px; font-size: 13px; overflow-wrap: anywhere; }
.menu-who .role { font-size: 12px; color: var(--text-3); }
.top-menu .menu-pop button.logout { color: var(--text); padding: 0 10px; min-height: 32px; height: auto; }
.top-menu .menu-pop .icon { width: 16px; height: 16px; color: var(--text-3); }
.sticky-top, .card .table-wrap th, .card table th, .msg-head { top: var(--topbar-h); }

/* 1024–1279 px: shorter labels so the bar stays on one line */
@media (max-width: 1279px) {
  .topbar { padding: 0 16px; gap: 8px; }
  .top-filters select { max-width: 10rem; }
  .top-search { flex-basis: 12rem; }
  .rev-long { display: none; } .rev-short { display: inline; }
}
/* below 1024 px (side menu on top from 960 px): search becomes the magnifier, which opens it on its own line */
@media (max-width: 1023px) {
  .kbd-hint { display: none; }
  .topbar input[type=search] { padding-right: 10px !important; }
}
@media (max-width: 960px) {
  .topbar { position: static; height: auto; flex-wrap: wrap; padding: 8px 14px; row-gap: 8px; }
  .topbar-left { flex: 1 1 auto; flex-wrap: wrap; }
  .search-open { display: inline-flex !important; }
  .top-search { display: none; flex: 1 1 100%; order: 10; }
  .search-toggle:checked ~ .top-search { display: block; }
  .search-toggle:checked + .search-open { background: var(--surface-3); color: var(--text); }
  .card .table-wrap th, .card table th, .msg-head { top: 0; }
}
@media (max-width: 560px) {
  .top-filters { flex: 1 1 0; }
  .top-filters label { flex: 1 1 0; }
  .top-filters select { min-width: 0; max-width: none; width: 100%; field-sizing: fixed; }
  .topbar .seg button { padding: 0 7px; }
}

/* V2 density: one control height (32 px), tighter tables, tabs and headers — closer to operator consoles */
body { font-size: 13.5px; }
button, .button { min-height: var(--ctl); padding: 0 12px; font-size: 13px; }
button.sm, .button.sm { min-height: 28px; padding: 0 9px; font-size: 12.5px; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]), select { min-height: var(--ctl); padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
textarea { font-size: 12.5px; }
.quick a { min-height: calc(var(--ctl) - 2px); padding: 0 10px; font-size: 12.5px; }
.content { padding: 20px 24px 40px; gap: 14px; max-width: 1480px; }
h1 { font-size: 20px; }
h1.mono { font-size: 19px; }
.page-head { align-items: center; gap: 10px 16px; }
.page-head .sub, .page-desc { font-size: 13px; margin-top: 2px; }
.page-head .actions-row { gap: 6px; }
.page-head .button, .page-head button, .page-head .actions-row .button { min-height: var(--ctl); padding: 0 12px; font-size: 13px; }
.page-head:has(.sub) { align-items: flex-start; }
.page-head:has(.sub) > .actions-row, .page-head:has(.sub) > div + form, .page-head:has(.sub) > div + a { margin-top: 0; }
.crumbs { font-size: 12.5px; }
.tabs a { padding: 7px 12px; font-size: 13px; }
table { font-size: 13px; }
th { padding: 7px 12px; font-size: 11.5px; }
td { padding: 8px 12px; }
.row-menu > summary { width: 28px; height: 28px; }
.card, section.card { padding: 14px 18px; }
.card > .table-wrap:first-child, .card > table:first-child { margin-top: -14px; }
.card > .table-wrap:last-child, .card > table:last-child { margin-bottom: -14px; }
.card.flush > .pager, .card > .pager { margin: 12px -18px -14px; }
.card.flush > .card-head { padding: 12px 18px 0; margin-bottom: 10px; }
.card-head { margin-bottom: 10px; }
.kpi { padding: 12px 14px; }
.kpi .value { font-size: 22px; }
.side { flex-basis: 232px; width: 232px; }
.menu-item { min-height: 32px; font-size: 13px; }
.menu-section > .menu-title { min-height: 30px; padding: 6px 8px; }
form.edit, .form-card { gap: 12px; padding: 14px 18px; }
.form-card > .form-actions, form.edit > .form-foot { margin: 0 -18px -14px; padding: 10px 18px; }
.alert, .alert.warn, .note { padding: 8px 12px; font-size: 13px; }
.empty { padding: 24px 16px; }
.pager { padding: 8px 18px; }
@media (max-width: 960px) {
  .side { width: auto; }
  .menu-item { min-height: 40px; }
  .content { padding: 14px 12px 28px; gap: 12px; }
}
@media (max-width: 560px) {
  .card, section.card { padding: 12px 14px; }
  .card > .table-wrap:first-child { margin-top: -12px; }
  .card > .table-wrap:last-child { margin-bottom: -12px; }
  .page-head h1 { font-size: 18px; }
}
form.top-filters { display: flex; flex-wrap: nowrap; gap: 8px; min-width: 0; }
@media (max-width: 1279px) { .top-filters select { max-width: 12rem; } }
@media (max-width: 560px) { form.top-filters { flex: 1 1 0; } }
form.top-filters { flex: 0 0 auto; } @media (max-width: 560px) { form.top-filters { flex: 1 1 0; } }
.content { max-width: 1600px; }
/* six KPI tiles: one row on wide screens, two rows of three below, three rows of two on the phone (never 5 + 1) */
.grid-kpi:has(> :nth-child(6):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1199px) { .grid-kpi:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-kpi:has(> :nth-child(6):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .side { flex: 0 0 auto; width: auto; }
  form.top-search { display: none; }
  .search-toggle:checked ~ form.top-search { display: block; }
}
/* phone: filters on their own row (half each), then magnifier, revision, language, theme and avatar on one row */
@media (max-width: 560px) {
  .topbar { gap: 8px; }
  .topbar-left, .topbar-right { display: contents; }
  form.top-filters { order: 0; flex: 1 1 100%; }
  .top-filters label { flex: 1 1 0; }
  .top-filters select { font-size: 12.5px; padding: 0 22px 0 8px; }
  .search-open { order: 1; }
  .topbar .rev { order: 2; }
  .topbar .seg { order: 3; margin-left: auto; }
  .topbar-right > form.inline { order: 4; }
  .user-menu { order: 5; }
  form.top-search { order: 10; flex: 1 1 100%; }
  .portal .topbar form.top-filters { flex: 1 1 100%; }
}
/* domains below 1440 px: the server goes under the reseller instead of its own column */
.only-lg { display: none; }
@media (max-width: 1439px) { .opt-lg { display: none; } .only-lg { display: block; margin-top: 3px; } }
table.domains th, table.domains td { padding-left: 10px; padding-right: 10px; }
table.domains th:first-child, table.domains td:first-child { padding-left: 18px; }
table.domains .dns-tags { gap: 2px; }
@media (min-width: 641px) { .toolbar input.w-auto { width: 11rem !important; } .toolbar input.w-9em { width: 8.5rem !important; } }
@media (max-width: 640px) { .toolbar input.w-auto, .toolbar input.w-9em { width: 100% !important; } }
@media (max-width: 560px) { .topbar form.top-filters label > select { width: 100%; max-width: none; } }
td.mono > a { text-decoration: none; } td.mono > a:hover { text-decoration: underline; }
td > .button, td > button, td.actions .button, td form.inline > button { min-height: 28px; padding: 0 9px; font-size: 12.5px; }

/* ================================================================== accessibility (operator review 2026-11-12, §7) */
/* skip link: first focusable element of every page, visible only when focused */
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-text);
  font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; color: var(--accent-text); }
main:focus { outline: none; }
/* the phone-only toggles (menu, search) are not focus stops on wide screens, where they do nothing */
@media (min-width: 961px) { .menu-toggle, .search-toggle { display: none; } }

/* admin users (2026-11-12): permissions by area in three columns (area, view, change) */
.perm-table { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.perm-head, .perm-row { display: grid; grid-template-columns: minmax(0, 1fr) 7rem 7rem; align-items: center; gap: 8px; padding: 6px 14px; }
.perm-head { background: var(--surface-2); font-size: 11.5px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); }
.perm-head > span + span, .perm-row > span + span { text-align: center; justify-self: center; }
.perm-row { border-bottom: 1px solid var(--border-2); font-size: 13px; }
.perm-row label.check { justify-content: center; }
.perm-group { padding: 8px 14px 4px; background: var(--surface); }
.perm-group-name { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.perm-only-super { grid-column: 2 / 4; }
@media (max-width: 560px) { .perm-head, .perm-row { grid-template-columns: minmax(0, 1fr) 4.5rem 4.5rem; padding: 6px 10px; } }
/* TOTP banner and set-up card */
.totp-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.totp-card { max-width: 440px; }
.qr-wrap { display: flex; justify-content: center; }
.qr-wrap .qr, .qr-wrap .qr svg { width: 196px; height: 196px; display: block; }
.qr-wrap .qr svg { width: 100%; height: 100%; }
td.c-ips { white-space: nowrap; }
@media (max-width: 640px) { td .chip:not(.tag) { border-radius: 10px; } }

/* ---- Provider → Servers → Domains (operator decision 2026-11-12) ---- */
.srv-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.srv-sub > span { display: inline-flex; align-items: center; gap: 6px; }
.field.derived .label { font-size: 13px; font-weight: 500; }
.field.derived .value { min-height: var(--ctl); display: flex; align-items: center; }
.by-server .srv-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.by-server .chart { max-width: 760px; }
.srv-line { display: none; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
@media (max-width: 900px) { .srv-line { display: block; margin-top: 2px; } }
@media (min-width: 641px) { td.c-host a, td.c-owner-src { white-space: nowrap; } }
@media (max-width: 640px) { td.c-host a { overflow-wrap: anywhere; } }
/* Customers (Settings → Customers): on a phone the owner and the servers go under the customer's name */
.cu-line { display: none; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
@media (max-width: 640px) { table.customers .cu-wide { display: none; } table.customers .cu-line { display: block; } }
/* Painel, "Devoluções enviadas (24 h)": the hostname takes the row; the "limit reached" chip goes on its own line below */
#bounces td.bn-host { width: 100%; }
#bounces tr.bn-has-lim td { border-bottom: 0; padding-bottom: 2px; }
#bounces tr.bn-lim td { padding-top: 0; }
/* cPanel page, bounces: the HELO name and the record found stay on one line on a wide screen */
@media (min-width: 900px) { table.helo-spf td:first-child, table.helo-spf td.mono { white-space: nowrap; } }
/* Message log: a bounce (DSN) shows its server under the "Devolução (DSN)" chip instead of a cut-off name beside it */
.msg-row > summary > .c-from > .chip + .mono { display: block; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; font-size: 12px; }
/* Sending limits, "Por servidor" (3 columns): on a phone the hostname wraps so the limit column stays on screen */
@media (max-width: 640px) { #per-server td:first-child > .mono { white-space: normal; overflow-wrap: anywhere; } #per-server td, #per-server th { padding-left: 10px; padding-right: 10px; } }
@media (max-width: 640px) { table.helo-spf td.mono { white-space: normal; } }

/* Domain-centred organisation (2026-11-12): products of a domain (Incoming, Outgoing, Archiving) — colour AND text */
.prod { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; color: var(--text-2); }
.prod-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted-dot); }
.prod.st-ok { color: var(--ok); } .prod.st-ok .prod-dot, .prod-pill.st-ok .prod-dot { background: var(--ok-dot); }
.prod.st-warn { color: var(--warn); } .prod.st-warn .prod-dot, .prod-pill.st-warn .prod-dot { background: var(--warn-dot); }
.prod.st-off { color: var(--muted); } .prod.st-off .prod-dot, .prod-pill.st-off .prod-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted-dot); }
.prod.st-bad { color: var(--bad); } .prod.st-bad .prod-dot, .prod-pill.st-bad .prod-dot { background: var(--bad-dot); }
.prod.st-unchecked { color: var(--text-2); font-weight: 400; } .prod.st-unchecked .prod-dot, .prod-pill.st-unchecked .prod-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted-dot); }
.prod-pill.st-bad { border-color: var(--bad-border); background: var(--bad-bg); } .prod-pill.st-bad .prod-st { color: var(--bad); }
.prod-card.st-bad { border-color: var(--bad-border); }
.prod.st-soon { color: var(--text-3); font-weight: 400; } .prod.st-soon .prod-dot, .prod-pill.st-soon .prod-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border); }
table.domains th.c-prod, table.domains td.c-prod { width: 1%; white-space: nowrap; }
.only-ph { display: none; }
@media (max-width: 640px) {
  table.domains tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; }
  table.domains .c-name { grid-column: 1 / 3; }
  table.domains .c-status { grid-column: 3; }
  table.domains td.actions { grid-column: 4; }
  table.domains .c-in { grid-column: 1 / 3; grid-row: 2; }
  table.domains .c-out { grid-column: 3 / -1; grid-row: 2; }
  table.domains td.c-prod { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: auto; }
  table.domains td.c-prod.opt { display: none; }
  table.domains .only-ph { display: block; font-size: 11px; color: var(--text-3); }
}
.dl-toolbar select { max-width: 220px; }

/* Domain page: header products, sub-tabs of "Route", summary */
.prod-head { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.prod-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); text-decoration: none; }
.prod-pill b { color: var(--text); font-weight: 600; }
.prod-pill:hover { background: var(--surface-3); text-decoration: none; }
.prod-pill.st-warn { border-color: var(--warn-dot); background: var(--warn-bg); } .prod-pill.st-warn .prod-st { color: var(--warn); }
.prod-pill.st-ok .prod-st { color: var(--ok); }
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.subtabs a { font-size: 13px; padding: 4px 12px; border-radius: 999px; color: var(--text-2); text-decoration: none; border: 1px solid var(--border); background: var(--surface); }
.subtabs a[aria-current="page"] { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.dom-find { display: flex; flex-direction: column; gap: 8px; }
.dom-find-label { font-weight: 600; font-size: 14px; }
.dom-find-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dom-find-row .search { position: relative; flex: 1 1 260px; max-width: 640px; }
.dom-find-row .search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }
.dom-find-row .search input { width: 100%; min-height: 42px; padding-left: 38px !important; font-size: 15px; }
.dom-find-row button { min-height: 42px; padding: 0 20px; }
.dom-find .hint { margin: 0; }
.kpi-link { color: inherit; text-decoration: none; } .kpi-link:hover { border-color: var(--accent); text-decoration: none; }
.kpi-link .value { color: var(--text); }
.kpi .value.ds-last { font-family: var(--sans); font-size: 18px; letter-spacing: 0; }
.ds-warn { margin-top: 4px; }
ul.prod-list { list-style: none; padding: 0; gap: 0; }
.prod-list li { display: grid; grid-template-columns: 110px auto minmax(0, 1fr); gap: 4px 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--border-2); }
.prod-list li:last-child { border-bottom: 0; }
.prod-name { font-weight: 600; }
@media (max-width: 640px) { .prod-list li { grid-template-columns: 1fr auto; } .prod-list .prod-why { grid-column: 1 / -1; } }
.prod-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-bottom: 12px; }
.prod-card { display: flex; flex-direction: column; gap: 10px; }
.prod-card .card-head { margin-bottom: 0; }
.prod-card p { margin: 0; }
.prod-card.st-warn { border-color: var(--warn-dot); }
.prod-card.st-soon { background: var(--surface-2, var(--surface)); }
.prod-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.dp-sub, .dm-lead { margin: 12px 0; }
/* cPanel instructions, step 0 pre-check: each check's note on its own comment line above the command */
#precheck pre.precheck { line-height: 1.55; }

/* Widths (design-system.md §Larguras): every card, form and table of a page has the same width — the content area,
   up to .content's maximum. Inside a wide form, a field on its own line stops at 760 px; fields side by side
   (.form-grid) share the line, with the same height, aligned at the top. */
.form-section > .field, .form-section > label.field, form.edit > label, form.edit .fields { max-width: 760px; }
.form-grid { align-items: start; }
.form-grid > .field > textarea { min-height: 160px; }

/* File field (design system): without script the browser's own field; with script our button + the full file name */
.file-input { position: relative; display: inline-flex; max-width: 100%; vertical-align: middle; }
.file-ui { display: none; }
.js .file-input > input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.js .file-ui { display: inline-flex; align-items: stretch; min-height: 36px; max-width: 100%; border: 1px solid var(--input-border); border-radius: var(--radius-sm);
  background: var(--surface); overflow: hidden; }
.file-btn { display: flex; align-items: center; padding: 0 14px; background: var(--surface-3); border-right: 1px solid var(--input-border); font-size: 13.5px; font-weight: 500;
  color: var(--text); white-space: nowrap; }
.file-name { display: flex; align-items: center; padding: 6px 12px; font-size: 13px; color: var(--text-2); min-width: 0; overflow-wrap: anywhere; }
.js .file-input:hover .file-btn { background: var(--surface-2); }
.js .file-input:focus-within .file-ui { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Dashboard: Alerts and Bounces side by side at the top, same width and height */
.dash-top { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
@media (max-width: 900px) { .dash-top { grid-template-columns: minmax(0, 1fr); } }
.dash-top > .card { display: flex; flex-direction: column; min-width: 0; }
.dash-top > .card > .card-head { margin-bottom: 6px; }
.alert-go { white-space: nowrap; font-weight: 500; }
/* A product or the domain switched on: the box is shown checked, turning it off goes through a confirmation page */
.check-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.check-row .check input[disabled] + span { color: var(--text); }
/* Confirmation before turning off: the highlighted notice */
.turnoff .off-notice { border-left-width: 4px; }
.turnoff .off-notice ul.plain { margin-top: 6px; }
.turnoff .off-notice.bad { font-size: 14px; }
/* Fields side by side never push out of their column (inputs with a unit, long values) */
.form-grid > *, .fields > * { min-width: 0; }
.file-btn { font: 500 13px/1 var(--sans); }
.js .file-ui { min-height: var(--ctl); }
.file-name { font-size: 12.5px; padding-top: 4px; padding-bottom: 4px; }
@media (min-width: 1100px) { .form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Interactive charts (operator review 2026-11-13, web/static/charts.js): value on hover (crosshair band and a
   tooltip), a legend that shows or hides each series, the period choice. Without JavaScript the server SVG stays. */
.ichart { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ichart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.ichart-head .legend { margin: 0; }
.ilegend { display: flex; flex-wrap: wrap; gap: 4px; }
.lg-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font: 500 12.5px/1 var(--sans); cursor: pointer; }
.lg-btn:hover { border-color: var(--input-border); color: var(--text); }
.lg-btn b { color: var(--text); font-weight: 600; font-size: 12px; }
.lg-btn[aria-pressed="false"] { color: var(--text-3); background: var(--surface-2); border-style: dashed; }
.lg-btn[aria-pressed="false"] .swatch { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.lg-btn[aria-pressed="false"] b { color: var(--text-3); font-weight: 500; }
.lg-btn:disabled { cursor: default; }
.ichart-head .seg button { min-height: 28px; padding: 0 10px; }
.ichart-head .seg button:disabled { color: var(--text-3); cursor: not-allowed; background: var(--surface-2); }
.ichart-box { position: relative; min-width: 0; overflow: visible; }
.ichart.live .chart svg { width: 100%; height: auto; }
.ivz:focus { outline: none; }
.ivz:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.viz .ic-hit { fill: transparent; pointer-events: all; cursor: crosshair; }
.viz .ic-band { fill: var(--hover-band); opacity: 0; pointer-events: none; }
.viz .ic-band.on { opacity: 1; }
.viz .ic-area { stroke: none; opacity: .12; pointer-events: none; }
.viz .ic-dot { stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.viz polyline.line { pointer-events: none; }
.viz .ic-dot.s1 { fill: var(--s1); } .viz .ic-dot.s2 { fill: var(--s2); } .viz .ic-dot.s3 { fill: var(--s3); } .viz .ic-dot.s4 { fill: var(--s4); } .viz .ic-dot.s5 { fill: var(--s5); }
.ichart-tip { position: absolute; left: 0; top: 0; z-index: 5; min-width: 150px; max-width: 280px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-pop); font-size: 12.5px; color: var(--text-2); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .08s; }
.ichart-tip.on { opacity: 1; visibility: visible; }
.ichart-tip .tip-title { font-weight: 600; color: var(--text); margin-bottom: 4px; font-family: var(--mono); font-size: 12px; }
.ichart-tip .tip-row { display: flex; align-items: center; gap: 6px; line-height: 1.6; }
.ichart-tip .tip-label { flex: 1 1 auto; }
.ichart-tip .tip-row b { color: var(--text); font-weight: 600; }
.ichart-tip .tip-total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
@media (max-width: 640px) { .ichart.live .chart { overflow: visible; } .ichart.live .chart svg.viz { min-width: 0; } }

/* Dashboard (operator review 2026-11-13): alerts with severity icon, colour and word, and the link that resolves
   them; the bounces as a KPI whose detail by server opens below it. */
.js .nojs-only { display: none; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list .alert-line { display: grid; grid-template-columns: 18px auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.alert-line .sev-icon { display: inline-flex; }
.alert-line .sev-icon .icon { width: 18px; height: 18px; }
.alert-line.sev-bad .sev-icon { color: var(--bad-dot); }
.alert-line.sev-warn .sev-icon { color: var(--warn-dot); }
.alert-line.sev-info .sev-icon { color: var(--accent); }
.alert-line .alert-text { min-width: 0; }
.alert-go { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-weight: 500; }
.alert-go .icon { width: 15px; height: 15px; }
@media (max-width: 760px) { .alert-list .alert-line { grid-template-columns: 18px minmax(0, 1fr); } .alert-line .chip { justify-self: start; }
  .alert-line .alert-text, .alert-line .alert-go { grid-column: 2; } }
.grid-kpi.k7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 1399px) { .grid-kpi.k7 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid-kpi.k7 > :last-child { grid-column: span 2; } }
@media (max-width: 640px) { .grid-kpi.k7 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi-pop { position: relative; padding: 0; }
.kpi-pop > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; border-radius: var(--radius); }
.kpi-pop > summary::-webkit-details-marker { display: none; }
.kpi-pop > summary:hover { background: var(--surface-2); }
.kpi-pop > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kpi-pop .sub { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); }
.kpi-pop .sub .icon { width: 14px; height: 14px; transition: transform .12s; }
.kpi-pop[open] .sub .icon { transform: rotate(180deg); }
.kpi-pop .kpi-panel { position: absolute; z-index: 20; right: 0; top: calc(100% + 6px); width: min(420px, 92vw); padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.kpi-pop .kpi-panel table { width: 100%; }
.kpi-pop .kpi-panel .hint { margin: 0 0 8px; }
.kpi-pop .kpi-panel .one-line { white-space: normal; overflow-wrap: anywhere; max-width: none; }

/* Cluster → Nodes (operator review 2026-11-13): apply status per node, ring gauges, charts of 6/24/48 h. */
.apply-node { padding: 12px 0; border-top: 1px solid var(--border-2); }
.apply-node:first-of-type { border-top: 0; padding-top: 4px; }
.apply-node-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.apply-node-name { font-weight: 650; font-size: 14.5px; }
.apply-kv { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.err-more summary { cursor: pointer; }
.err-more pre { margin: 6px 0 0; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.node-now { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px 24px; align-items: start; }
@media (max-width: 900px) { .node-now { grid-template-columns: minmax(0, 1fr); } }
.rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.ring-gauge { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); min-width: 0; }
.ring { position: relative; width: 64px; height: 64px; flex: 0 0 64px; }
.ring-svg { width: 64px; height: 64px; display: block; }
.ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 650; color: var(--text); }
.ring-track { fill: none; stroke: var(--meter-track); stroke-width: 7; }
.ring-fill { fill: none; stroke-width: 7; stroke-linecap: round; }
.ring-fill.ok { stroke: var(--meter-fill); } .ring-fill.warn { stroke: var(--warn-dot); } .ring-fill.bad { stroke: var(--bad-dot); }
.ring-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ring-label { font-weight: 600; color: var(--text); font-size: 13px; }
.ring-detail { font-size: 11.5px; color: var(--text-3); overflow-wrap: anywhere; }
.ring-text .chip { align-self: flex-start; }
dl.facts { margin: 0; display: grid; gap: 0; }
dl.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border-2); font-size: 13px; }
dl.facts > div:last-child { border-bottom: 0; }
dl.facts dt { color: var(--text-2); }
dl.facts dd { margin: 0; text-align: right; }
.node-chart { min-width: 0; padding-top: 14px; border-top: 1px solid var(--border-2); }
.node-chart h3 { margin: 0 0 2px; font-size: 14px; }
.node-chart .hint { margin: 0 0 8px; }

/* Services of a domain (operator review 2026-11-13): one switch per service; turning one off opens the
   confirmation page, turning one on posts at once. Without JavaScript: a link or a small form. */
.svc-list { list-style: none; margin: 4px 0 0; padding: 0; }
.svc-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-2); }
.svc-row:last-child { border-bottom: 0; }
.svc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.svc-text .help { margin: 0; }
.switch-wrap { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.sw-form { display: inline-flex; margin: 0; }
.sw-state { font-size: 13px; font-weight: 600; color: var(--text-2); min-width: 72px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; min-height: 0; padding: 0; border-radius: 999px; border: 1px solid var(--input-border);
  background: var(--meter-track); cursor: pointer; flex: 0 0 auto; transition: background .12s, border-color .12s; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 2px rgba(16,24,40,.35); transition: left .12s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on .knob { left: 22px; }
.switch:hover { border-color: var(--accent); text-decoration: none; }
.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.switch[aria-disabled="true"]:hover { border-color: var(--input-border); }
.prod-card { display: flex; flex-direction: column; }
.prod-card .svc-switch { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-2); }

/* Messages: Queue ID and Message-ID columns (truncated, the full value on hover, a copy button). */
.msg-head, .msg-row > summary { grid-template-columns: 9.5rem minmax(0, 1fr) minmax(0, 1fr) 7rem minmax(0, 1.1fr) 6.5rem minmax(0, .9fr); }
.id-cell { display: flex; align-items: center; gap: 4px; min-width: 0; }
.id-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.copy-btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; min-height: 0; padding: 0; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-3); cursor: pointer; }
.copy-btn:hover { border-color: var(--border); color: var(--text); background: var(--surface); }
.copy-btn .icon { width: 14px; height: 14px; }
.copy-btn.copied { color: var(--ok, #12805C); border-color: currentColor; }
html:not(.js) .js-only { display: none; }
@media (max-width: 1399px) { .msg-head, .msg-row > summary { grid-template-columns: 9.5rem minmax(0, 1fr) minmax(0, 1fr) 7rem minmax(0, 1.1fr) 6.5rem; } .msg-head .c-mid, .msg-row > summary .c-mid { display: none; } }
@media (max-width: 760px) { .msg-row > summary { grid-template-columns: minmax(0, 1fr) auto; } .msg-row .c-qid { grid-column: 1 / -1; } .msg-row > summary .c-mid { display: none; } }

/* Aegis Console → addresses (operator review 2026-11-13): no menus; per address the current name in a field and
   "Change"; the transition days in a collapsed advanced option. */
.host-block { padding: 14px 0; border-top: 1px solid var(--border-2); }
.host-block:first-of-type { border-top: 0; padding-top: 4px; }
.host-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.host-head h3 { margin: 0; font-size: 14px; }
.host-form { display: flex; flex-direction: column; gap: 6px; max-width: 760px; }
.host-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.host-row .field { flex: 1 1 320px; margin: 0; }
.host-form .hint, .host-form details { margin: 0; }
.host-current { font-size: 14px; }
.host-arrow { color: var(--text-3); }
.host-notes { margin: 8px 0 0; font-size: 13px; color: var(--text-2); }
.host-notes .host-bad { color: var(--bad); }
.host-actions { margin-top: 10px; }
.host-actions form.inline { margin: 0; }
.logo-input { display: inline-flex; flex-direction: column; gap: 6px; min-width: 0; }
.logo-input .file-error:empty { display: none; }
.logo-input .file-error { color: var(--bad); font-size: 13px; font-weight: 500; }
.logo-input.bad .file-ui .file-btn { border-color: var(--bad); }
.login-support { margin: 10px 0 0; text-align: center; font-size: 13px; }
.alert .plain-ol { margin: 6px 0 0; padding-left: 20px; }
.alert .plain-ol li + li { margin-top: 2px; }
form.inline-field { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin: 0; }
form.inline-field .field { margin: 0; flex: 0 1 220px; }
.chip.soon { border-radius: 999px; font-size: 12px; line-height: 20px; padding: 0 8px; border-style: dashed; }
.rs-name { font-weight: 600; }
@media (max-width: 560px) { .table-wrap:has(.row-menu) th, .table-wrap:has(.row-menu) td { padding-left: 8px; padding-right: 8px; } }
td.actions > .muted { white-space: normal; display: inline-block; min-width: 7rem; max-width: 14rem; text-align: right; }

/* Resale as a product (portal, queue item 2): usage KPIs, service states, first steps, needs attention */
.rs-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .rs-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi .value small { font-size: 14px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.kpi .meter { margin: 4px 0 2px; }
a.kpi-link { color: inherit; text-decoration: none; transition: border-color .12s; }
a.kpi-link:hover { border-color: var(--accent); text-decoration: none; }
a.kpi-link .sub { color: var(--accent); }
.prod + .why { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: normal; max-width: 34ch; }
.rs-states td, .rs-domains td { vertical-align: top; }
.att-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 12px; }
.att-line .icon, .att-list .icon { width: 16px; height: 16px; flex: none; }
.att-list { display: grid; gap: 8px; margin-top: 12px; }
.att-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.empty.compact { padding: 16px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps > li { display: flex; align-items: flex-start; gap: 12px; }
.steps > li > div { flex: 1 1 auto; min-width: 0; }
.steps > li > .chip { flex: none; }
.steps p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.steps .n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12.5px; font-weight: 650;
  background: var(--surface-3); color: var(--text-2); }
.steps > li.done .n { background: var(--ok-bg); color: var(--ok); }
.steps .steps-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.steps.compact { gap: 6px; margin: 0 0 14px; font-size: 13px; color: var(--text-2); }
.steps.compact .n { width: 20px; height: 20px; font-size: 11.5px; }
.first-steps .help { margin: 14px 0 0; }
.csv-fill { display: flex; flex-direction: column; gap: 4px; }
.prod + .why { word-break: normal; overflow-wrap: normal; hyphens: auto; }
.att-line { flex-wrap: nowrap; align-items: flex-start; }
.att-line > span { flex: 0 1 auto; }
.att-line .icon { margin-top: 2px; }
@media (max-width: 640px) { .att-line { flex-wrap: wrap; } .att-line > span { flex: 1 1 calc(100% - 30px); } }
@media (max-width: 640px) { table.num-table th, table.num-table th.num { white-space: normal; } }

/* Quarantine prototype (example data, M4): section spacing, reason chips (identity, not status colours), bullets */
.qproto { margin-top: 28px; padding-top: 20px; border-top: 1px dashed var(--border); display: grid; gap: 16px; }
.qproto > .page-head { margin-bottom: 0; }
.qproto h2#qp-title { font-size: 20px; margin: 0; }
.qproto .alert { margin: 0; }
.chip.q-spam { background: var(--warn-bg); color: var(--warn); } .chip.q-spam::before { background: var(--warn-dot); }
.chip.q-spoof { background: var(--bad-bg); color: var(--bad); } .chip.q-spoof::before { background: var(--bad-dot); }
.chip.q-attach { background: var(--bad-bg); color: var(--bad); } .chip.q-attach::before { background: var(--bad-dot); }
.chip.q-policy { background: var(--surface-3); color: var(--text-2); } .chip.q-policy::before { background: var(--muted-dot); }
ul.bullets { list-style: disc; padding-left: 20px; display: grid; gap: 6px; }
ul.bullets li { padding: 0; }
.qtable td.break { word-break: break-all; }
.qp-how .check { margin-top: 8px; }
.qtable td.addr { max-width: 0; width: 34%; }
.qtable td.addr > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.qtable td.subj { width: 26%; }
@media (max-width: 640px) { .qtable td.addr { width: auto; max-width: 160px; } }
.qproto > * { min-width: 0; }
.qtable .q-when { display: none; }
@media (max-width: 560px) { .qtable .q-when { display: block; } .qtable td.addr { max-width: 150px; } }

/* Portal brand and support line (operator, 2026-11-13): the owner's monogram when there is no logo; the support
   address itself and the contact on one centred line */
.brand-mono { width: 30px; height: 30px; flex: none; border-radius: 8px; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--accent); color: var(--accent-text); text-transform: uppercase; letter-spacing: .02em; }
.login-support { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 8px; overflow-wrap: anywhere; }
.login-support .sep, .support-links .sep { color: var(--text-3); }
.support-card { flex-wrap: wrap; gap: 6px 16px; }
.support-links { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; overflow-wrap: anywhere; }
@media (max-width: 480px) { .login-support { flex-direction: column; gap: 4px; } .login-support .sep { display: none; } }

/* Quick wins (GR-1 to GR-3, example data): example note, delivery reasons, network tools */
.alert.ex-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dp-dest > span { display: block; }
.dp-dest .mono { white-space: nowrap; }
.dp-why { min-width: 0; max-width: 46ch; }
.dp-why b { display: block; font-weight: 600; }
.dp-why > .mono { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.nt-tool { display: flex; flex-direction: column; gap: 10px; }
.nt-tool h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.nt-tool h2 .icon { width: 18px; height: 18px; color: var(--text-2); }
.nt-tool .help { margin: 0; }
.nt-tool .form-actions { margin-top: auto; padding: 0; border: 0; background: none; }
.nt-out th { width: 30%; background: none; position: static; color: var(--text-2); font-weight: 500; white-space: normal; }
.nt-out td.mono { overflow-wrap: anywhere; }
.dp-why .dp-st-sm { display: none; }
@media (max-width: 560px) { .dp-why .mono { display: none; } .dp-why .dp-st-sm { display: inline-flex; margin-top: 4px; } .dp-why { max-width: none; } }
@media (max-width: 560px) { .dp-dest .mono { white-space: normal; overflow-wrap: anywhere; } .dp-table th, .dp-table td { padding-left: 6px; padding-right: 6px; } }
@media (max-width: 560px) {
  .nt-out, .nt-out tbody, .nt-out tr, .nt-out th, .nt-out td { display: block; width: auto; }
  .nt-out tr { padding: 8px 0; border-bottom: 1px solid var(--border-2); }
  .nt-out th, .nt-out td { border: 0; padding: 2px 14px; }
}
.auth-blocks td b { word-break: normal; overflow-wrap: normal; hyphens: manual; }

/* DMARC is recommended, not mandatory (operator, 2026-11-13): a quiet tag, never a warning colour */
.tagmini.rec { background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--border); }
.chip.rec { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
.chip.rec::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted-dot); }
@media (max-width: 560px) { .pdns-table td { overflow-wrap: anywhere; } .pdns-table th, .pdns-table td { padding-left: 8px; padding-right: 8px; } }
@media (max-width: 560px) {
  .pdns-table thead { display: none; }
  .pdns-table, .pdns-table tbody, .pdns-table tr, .pdns-table td { display: block; width: auto; }
  .pdns-table tr { padding: 10px 6px; border-bottom: 1px solid var(--border-2); }
  .pdns-table td { border: 0; padding: 2px 8px; }
  .pdns-table td:first-child { display: flex; align-items: center; gap: 8px; }
}

/* A hint from third-party data (security review 2026-11-13): never styled as a verified fact */
.hint-unverified { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); font-style: italic; }
.hint-unverified .icon { width: 14px; height: 14px; flex: none; color: var(--text-3); }

/* Portal sign-in pages (operator, 2026-11-13): the brand's logo alone on top of the card, larger (up to 60 px high,
   never wider than the card, aspect kept), then the brand's name and "Customer portal" below it, all centred in the card; the title, fields, button, language and support line keep their alignment */
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.login-logo { display: flex; align-items: center; justify-content: center; max-width: 100%; min-height: 56px; }
.login-logo img { display: block; max-height: 60px; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.brand-mono.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 22px; }
.login-logo-default svg { width: 56px; height: 56px; }
.login-brand-text { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.login-brand-text .brand-name { font-size: 16px; font-weight: 650; color: var(--text); line-height: 1.3; }
.login-brand-text .brand-sub { font-size: 12.5px; color: var(--text-3); }

/* Favicon card (Brand pages): a browser-tab mock with the current favicon, the choice, the 32/16 px preview */
.fav-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.tab-mock { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; padding: 7px 12px; border-radius: 9px 9px 0 0; background: var(--surface-3);
  border: 1px solid var(--border); border-bottom: 0; font-size: 12.5px; color: var(--text); }
.tab-mock img { flex: none; display: block; }
.tab-mock .tab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-mock .tab-x { color: var(--text-3); margin-left: 6px; }
.fav-form { display: grid; gap: 10px; }
.fav-mode { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.fav-file { display: flex; flex-direction: column; gap: 4px; }
.fav-form.bad .file-error, .fav-file .file-error { color: var(--bad); font-size: 12.5px; }
.fav-new { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fav-new[hidden] { display: none; }
.fav-box { display: inline-grid; place-items: center; border: 1px dashed var(--border); border-radius: 6px; background: var(--surface-2); }
.fav-32 { width: 44px; height: 44px; } .fav-16 { width: 28px; height: 28px; }
.fav-box canvas, .fav-box svg { display: block; }
.fav-form .form-actions { padding: 0; margin: 0; border: 0; background: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ================================================================== one gap between cards (design system §2)
   Every container whose children are cards uses --gap-card, vertically and horizontally, on every page of the
   console and the portal (regression 2026-11-13: the dashboard's live area had no gap). tests/visual/check.js fails
   when two cards in the same column touch. */
:root { --gap-card: 16px; }
@media (max-width: 640px) { :root { --gap-card: 12px; } }
.content, .portal .content, .dash-live, .qproto, .narrow-body, .tut-body, .metric-groups { gap: var(--gap-card); }
.dash-live { display: flex; flex-direction: column; min-width: 0; }
.row, .grid-2, .grid-3, .grid-sys, .grid-kpi, .metric-cards, .tut { gap: var(--gap-card); }
.stack:has(> .card), .stack:has(> section.card), .stack:has(> .kpi) { gap: var(--gap-card); }

/* Dashboard (operator review 2026-11-13): domain indicators, domains with the most traffic (stacked bar per domain,
   pages of 10), the period selector */
.dom-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .dom-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi-link.warn .value { color: var(--warn); }
.top-doms .c-bar { width: 26%; min-width: 120px; }
.stack-bar { display: block; width: 100%; height: 10px; border-radius: 3px; overflow: hidden; }
.top-doms td.c-dom { max-width: 0; }
.top-doms td.c-dom:first-child { width: 22%; }
.inline-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-2); }
.inline-legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.seg-static { flex: none; }

/* Portal TOTP step (minimal page outside the menu): the sign-in card, a little wider, with numbered steps */
.login-card.totp-card { max-width: 440px; }
.totp-steps { gap: 18px; }
.totp-steps .qr-wrap { margin: 10px 0; justify-content: flex-start; }
.totp-steps .secret { overflow-wrap: anywhere; margin: 4px 0; }
.totp-steps .form-actions { padding: 0; margin: 0; border: 0; background: none; }
.totp-steps .field b { font-weight: 600; }

/* Dev session pages in the design system (2026-11-13): reseller MX, server monitoring, the console's server alerts */
.rmx-table { margin: 4px 0 0; }
.smon-facts { margin: 0; }
.smon-h { margin: 6px 0 0; font-size: 14px; font-weight: 650; }
.smon-form { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border-2); }
.smon-form .form-actions { padding: 0; margin: 0; border: 0; background: none; }
.slim-table td { vertical-align: top; }

/* Messages, Search tab (operator, 2026-11-13): the form first, results only after a search; direction and server */
.msg-search .form-grid { margin-bottom: 4px; }
.msg-search .form-actions { padding: 0; margin: 0; border: 0; background: none; }
.msg-search .msg-custom { margin-top: 0; }
.dir-chip { display: block; width: max-content; margin-top: 3px; font-family: var(--sans); font-size: 11.5px; font-weight: 600; padding: 0 6px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); }
.dir-chip.outgoing { background: var(--accent-soft); color: var(--accent); }
.msg-srv { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-bar .toolbar .search { flex: 1 1 200px; }

/* Portal log (P1, operator request 95): what happened in plain words first; the technical detail when the row opens */
.plog-filter .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.plog-period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.plog-period .label { font-size: 13px; font-weight: 600; color: var(--text); }
.plog-filter .form-actions, .plog-filter .toolbar-actions { padding: 0; margin: 0; border: 0; background: none; }
.msg-head.plog-grid, .plog-row > summary.plog-grid { grid-template-columns: 9.5rem minmax(0, 3fr) minmax(0, 1.4fr) 7.5rem 8rem minmax(0, 1fr); }
.plog-row > summary > .c-plain { white-space: normal; line-height: 1.45; }
.plog-row > summary > .c-plain .chip { margin-right: 6px; vertical-align: 1px; }
.plog-row > summary > .c-user .sub-line { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.plog-row .c-portal { font-size: 12px; color: var(--text-2); }
.plog-row .c-ip { font-size: 12.5px; }
.plog-see { font-size: 12.5px; color: var(--text-2); }
@media (max-width: 1199px) { .plog-filter .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .msg-head.plog-grid, .plog-row > summary.plog-grid { grid-template-columns: 9.5rem minmax(0, 2.4fr) minmax(0, 1.3fr) 8rem; }
  .plog-grid > :nth-child(4), .plog-grid > :nth-child(6) { display: none; } }
@media (max-width: 760px) { .plog-filter .form-grid { grid-template-columns: minmax(0, 1fr); }
  .plog-row > summary.plog-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .plog-row > summary.plog-grid > * { grid-column: 1; } }
.plog-period .quick a { white-space: nowrap; }
@media (max-width: 760px) { .plog-period .quick { display: flex; width: 100%; } .plog-period .quick a { flex: 1 1 auto; justify-content: center; padding: 0 6px; } }

/* Domain page, Summary (P7, operator request 100): From/To search, plain-language last delivery and route, every DNS
   check with its state and what it means, the services full width and two cards side by side with no empty space */
.dom-find-label { margin: 0; }
.dom-find-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 11rem auto; gap: 12px; align-items: end; }
.dom-find-grid button { min-height: var(--ctl); display: inline-flex; align-items: center; gap: 6px; }
.dom-find-grid button .icon { width: 16px; height: 16px; }
.ds-refused .value { color: inherit; text-decoration: none; }
.ds-refused .value:hover { text-decoration: underline; }
.ds-links { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ds-kpi .ds-last { font-size: 15px; line-height: 1.35; font-weight: 600; }
.ds-kpi .ds-last-deferred { color: var(--warn); }
.ds-kpi .ds-last-bounced { color: var(--bad); }
.ds-prod-grid, .ds-dns-grid { display: grid; gap: 12px; }
.ds-prod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ds-dns-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ds-prod, .ds-dns-item { border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ds-dns-item.st-bad { border-color: var(--bad-border, var(--border)); }
.ds-prod p, .ds-dns-item p { margin: 0; line-height: 1.45; }
.ds-prod-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ds-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap-card); align-items: start; }
.ds-pair > .card { margin: 0; }
.ds-panel-note { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.ds-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; }
.ds-confirm .hint { margin: 0; }
.ds-route { display: block; margin-top: 4px; font-size: 13px; color: var(--text-2); }
.ds-route .chip { margin-right: 4px; }
@media (max-width: 1099px) { .ds-dns-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dom-find-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 760px) { .ds-prod-grid, .ds-dns-grid, .ds-pair, .dom-find-grid { grid-template-columns: minmax(0, 1fr); } }
/* Domain page, DNS tab (P7): the found and expected values get room, and long names break at dots, not mid-word */
.dns-table th:nth-child(1) { width: 7rem; } .dns-table th:nth-child(2) { width: 9rem; } .dns-table th:nth-child(3) { width: 26%; } .dns-table th:nth-child(4) { width: 24%; }
.dns-table td.break { word-break: normal; overflow-wrap: anywhere; }

/* Backups (P3 design, operator request 96): the last result in one sentence, the copies as opening rows, the restore
   in two numbered steps with a strong warning; every field of the restore is disabled (design only) */
.link-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }
.hint.block { display: block; margin-top: 4px; }
.bkp-sentence { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.bkp-list-head { padding: 0 0 12px; }
.msg-head.bkp-grid, .bkp-row > summary.bkp-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) 6rem 8rem 7rem; }
.bkp-row .sub-line { display: block; font-size: 12px; white-space: normal; }
.bkp-row > summary > .c-by { white-space: normal; }
.bkp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bkp-parts { max-width: 640px; }
.bkp-warn ul { margin: 6px 0 0; }
.bkp-warn li + li { margin-top: 4px; }
.bkp-step { display: flex; flex-direction: column; gap: 14px; }
.bkp-step h3 { margin: 6px 0 0; font-size: 14px; }
.bkp-step-head { display: flex; gap: 12px; align-items: flex-start; }
.bkp-step-head h2 { margin: 0; }
.step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; background: var(--accent-soft); color: var(--accent); }
.bkp-danger .step-n { background: var(--bad-bg); color: var(--bad); }
.bkp-danger { border-color: var(--bad-border, var(--border)); }
.bkp-key-note { margin: 0; }
.bkp-steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.bkp-step .form-actions, .bkp-step .form-grid { margin: 0; }
@media (max-width: 900px) { .msg-head.bkp-grid, .bkp-row > summary.bkp-grid { grid-template-columns: minmax(0, 1fr) auto; } .bkp-grid > .c-by, .bkp-grid > .c-kept { grid-column: 1 / -1; } .bkp-grid > .c-size { display: none; } }
/* Tutorial sub-sections (P3: the backup section with what goes in, where, retention, what is left out and the restore) */
.tut-sub { font-size: 14.5px; margin: 14px 0 4px; }
.tut-list { margin: 4px 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.55; }

/* Settings → Relay protections (P2b) */
.prot-note .hint.block { margin-top: 4px; }
.prot-label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.prot-field .prot-range { font-variant-numeric: tabular-nums; }
.prot-form .form-actions { align-items: center; gap: 12px; }

/* Sending limits: switches and each server's limit (P2) */
.lsw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lsw-item { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border-2); }
.lsw-item:first-child { border-top: 0; padding-top: 0; }
.lsw-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.lsw-name { font-weight: 600; }
.lsw-off > summary, .lsw-change > summary { cursor: pointer; color: var(--bad); font-size: 13px; width: fit-content; }
.lsw-change > summary { color: var(--link); }
.lsw-off[open] > summary { margin-bottom: 8px; }
.lsw-form { display: flex; flex-direction: column; gap: 8px; max-width: 560px; margin-top: 8px; }
.lsw-on { align-self: flex-start; }
.lsw-brakes { margin: 12px 0 0; }
.lsw-pop { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.lsw-pop .lsw-form { margin-top: 0; }
.lsw-srv { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; }
.lsw-facts { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0; }
.lsw-facts dt { font-size: 12px; color: var(--text-2); }
.lsw-facts dd { margin: 0; }
.send-limit.chip { white-space: normal; }

/* Settings → Alerts: recipients, settings, history (P4); Dashboard: 24-hour alerts (P6) */
.alm-how .hint.block { margin-top: 4px; }
.alm-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.alm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.alm-actions form.inline { margin: 0; }
.alm-actions button .icon { width: 15px; height: 15px; }
.alm-test { font-size: 13px; }
.alm-test details.learn { margin-top: 4px; }
.alm-choices { display: grid; grid-template-columns: 1fr; gap: 10px; border: 0; margin: 0; padding: 0; }
.alm-choices.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.alm-sub { margin: 12px 0 0; font-size: 14px; }
.alm-failed { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--border-2); border-left: 3px solid var(--bad); border-radius: 8px; }
.alm-failed h3 { margin: 0 0 2px; font-size: 14px; }
.alm-subject { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.alert-line .alert-meta { display: block; margin-top: 2px; font-size: 12px; color: var(--text-2); }
.alert-line .alert-seen { margin: 4px 0 0; }
.alert-line .alert-seen button { padding: 2px 8px; font-size: 12px; }
.alm-tls .block { display: block; }

/* Nodes: Atualizar estado, manutenção (P5) */
.node-ops { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; margin-top: 12px; }
.node-ops form.inline { margin: 0; }
.node-ops .node-maint { flex: 1 1 320px; }
.node-ops .node-maint > summary { padding: 6px 0; }
.node-ops-help { flex-basis: 100%; margin: 0; }

/* «Ver detalhe» (P8, B4.28): the one component for the technical detail of a reason, the same everywhere (no JS) */
details.see-detail { font-size: 12.5px; color: var(--text-2); margin-top: 6px; min-width: 0; }
details.see-detail > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; color: var(--link); font-weight: 500; cursor: pointer; white-space: nowrap; }
details.see-detail > summary::-webkit-details-marker { display: none; }
details.see-detail > summary::before { content: "+"; font-family: var(--mono); width: 12px; }
details.see-detail[open] > summary::before { content: "−"; }
details.see-detail > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.see-detail-body { margin-top: 6px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); display: grid; gap: 4px; }
.see-detail-body p { margin: 0; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.why-box details.see-detail, .card details.see-detail { max-width: 100%; }
.q-row > span.c-why { white-space: normal; }
.q-row > span.c-why > .q-why-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-row > span.c-why details.see-detail { margin-top: 2px; }
.alert-line .alert-text details.see-detail { display: block; margin-top: 2px; }

/* Backups (P3, DATA 28) and the alerts sender's DNS (DATA 29) */
.bkp-now { margin: 0 0 16px; }
.alm-dns-records { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; }
.alm-dns-records > li > b { display: block; font-size: 14px; }
.alm-dns-records .hint { margin: 2px 0 6px; }
.alm-dns-records pre.copy { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.alm-dns-records .kv-grid { margin: 0; }
.alm-dns-h { margin: 18px 0 8px; font-size: 14px; }
/* P3 step 3 (DATA 31): "Verificar a cópia" running (an indeterminate bar: the worker reports no steps) */
.bkp-progress > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bkp-progress .bkp-steps-list { margin-top: 2px; }
.bkp-bar { display: block; position: relative; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; max-width: 420px; }
.bkp-bar > span { position: absolute; inset: 0 auto 0 0; width: 30%; border-radius: 2px; background: var(--accent); animation: bkp-bar 1.6s ease-in-out infinite; }
@keyframes bkp-bar { 0% { left: -30%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .bkp-bar > span { animation: none; width: 100%; opacity: .5; } }
.bkp-access { margin: 0; }
.bkp-verify-form { display: flex; flex-direction: column; gap: 14px; }
.bkp-verify-form .form-actions { align-items: center; flex-wrap: wrap; }
/* Filtro de e-mail → Listas negras (pedido 134): one line per list, the switch on the right (below on a phone) */
.bl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bl-item { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-top: 1px solid var(--border-2); }
.bl-item:first-child { border-top: 0; padding-top: 0; }
.bl-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bl-name { font-weight: 600; }
.bl-what { margin: 0; }
.bl-facts { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 6px 20px; margin: 0; }
.bl-facts dt { font-size: 12px; color: var(--text-2); margin-bottom: 2px; }
.bl-facts dd { margin: 0; font-size: 13px; }
.bl-facts .bl-zones { grid-column: 1 / -1; }
.bl-key { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; max-width: 640px; margin-top: 4px; }
.bl-key .field { flex: 1 1 18rem; }
.bl-key .form-actions { margin: 0; }
.bl-rules ul { margin: 0; }
@media (max-width: 700px) { .bl-facts { grid-template-columns: minmax(0, 1fr); } }
.bkp-diff .chip { white-space: normal; height: auto; line-height: 1.35; padding-top: 2px; padding-bottom: 2px; }
.qp-auth { margin: 12px 0 0; }
.qp-out .small { margin: 0; }
.bkp-diff .sub-line { display: block; font-size: 12px; font-family: inherit; }
/* Definições → Segurança (operator request 2026-11-20): the tabs of the security pages; a prepared tab says «em breve» */
.sec-tabs .sec-soon { margin-left: 3px; font-size: 11px; font-weight: 500; color: var(--text-3); }
.sec-tabs a[aria-current="page"] .sec-soon { color: var(--text-2); }
.sub-tabs { border-bottom-style: dashed; }
.sess-end { margin-top: 6px; }
/* Segurança → Certificados (operator request 2026-11-21): one line per certificate, the state on each node; the check
   of a certificate before applying, line by line in plain language */
.cert-nodes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.cert-table td .sub-line { display: block; margin-top: 4px; }
.cert-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cert-lines > li { display: flex; align-items: flex-start; gap: 10px; }
.cert-lines > li > .chip { flex: none; min-width: 82px; justify-content: center; }
.cert-pem { white-space: pre-wrap; word-break: break-all; margin: 0 0 8px; padding: 10px; background: var(--surface-2); border-radius: 6px; }
.cert-check.is-bad { border-color: var(--bad-dot); }
/* Envio → Política de envio and Ritmo por destino (operator requests 172 and 173) */
.viz .seg.over { fill: var(--bad-dot); }
.viz .limit { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.swatch.over { background: var(--bad-dot); }
.swatch.limit { height: 0; border-top: 2px dashed var(--text-2); border-radius: 0; }
.use-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.use-line .meter { width: 140px; flex: none; }
.pattern { font-weight: 600; }
/* the version in production at the foot of the console (request 167) and «Novidades» (request 168) */
.app-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-2); display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.snd-find { align-items: flex-end; }
.snd-find .field { flex: 1 1 320px; max-width: 420px; }
.snd-find .field input { width: 100%; }
