/* unagikuma UI. Logical properties keep the layout correct in RTL.
   The console offers Classic plus four optional layouts. Colour comes
   from five shared palettes (Calm, Perfume, Country, Industrial, Passion),
   cycled by clicking the logo. Public status pages still use the paper
   and ink palettes (also called light and dark). Status colours are Nagios-style: solid blocks that read
   at a glance, tuned per tone so they stay calm on white and bright on black. */
:root, :root[data-theme="paper"], :root[data-theme="light"] {
  --bg: #f6f7f9; --side: #eceff3; --panel: #ffffff; --panel-2: #f8fafb; --border: #e3e7ec; --border-strong: #c9d1da;
  --text: #17202b; --muted: #5f6b7a; --faint: #67717d;
  --accent: #1f7a4d; --accent-soft: #e4f2ea; --accent-text: #ffffff; --link: #1d6b44;
  --ok: #17804a; --ok-soft: #e1f5e8; --degraded: #c98a12; --degraded-soft: #fdf2d6;
  --critical: #c42f2f; --critical-soft: #fde4e4; --unknown: #7246d8; --unknown-soft: #efe8fe;
  --pending: #6b7787; --pending-soft: #e6eaef; --maint: #2766c8; --maint-soft: #e0ebfd;
  --on-status: #ffffff; --on-degraded: #2a1c00;
  --empty: #e6e9ed; --stripe: rgba(23, 32, 43, .025);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --radius: 8px; --bg-image: none;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans Arabic", sans-serif;
  color-scheme: light;
}
:root[data-theme="ink"], :root[data-theme="dark"] {
  --bg: #050608; --side: #0e1115; --panel: #0b0d10; --panel-2: #111418; --border: #1b1f25; --border-strong: #2a3038;
  --text: #e9edf1; --muted: #8a94a1; --faint: #79818b;
  --accent: #2dd4bf; --accent-soft: #0e2a27; --accent-text: #04221d; --link: #5eead4;
  --ok: #2fe3a0; --ok-soft: #0c271d; --degraded: #ffb547; --degraded-soft: #2e230e; --critical: #ff4f6e; --critical-soft: #34131c;
  --unknown: #a98bff; --unknown-soft: #201a38; --pending: #8a94a1; --pending-soft: #15191e; --maint: #5fa8ff; --maint-soft: #102037;
  --on-status: #050608; --on-degraded: #1d1600;
  --empty: #171b21; --stripe: rgba(255, 255, 255, .018);
  --shadow: none; color-scheme: dark;
  --bg-image: radial-gradient(1200px 600px at 75% -10%, rgba(94,234,212,.05), transparent 60%);
}
/* The five shared colour palettes. Status colours keep their meaning in every
   one; a palette's accent is never the colour of a failure. --side-* colour
   the sidebar where it is a surface of its own. */
:root[data-theme="perfume"] {
  /* Perfume: powder rose and pearl, a rose accent, serif headings. */
  --bg: #fbf7f8; --side: #f1e4ea; --panel: #ffffff; --panel-2: #faf3f5; --border: #eddfe4; --border-strong: #d7bfc8;
  --text: #3a2a33; --muted: #6f5a65; --faint: #75606b;
  --accent: #a8566b; --accent-soft: #f6e2e8; --accent-text: #ffffff; --link: #8f4459;
  --ok: #3d7a5a; --ok-soft: #dcefe4; --degraded: #c98a2c; --degraded-soft: #f7ead2;
  --critical: #b8322f; --critical-soft: #f7dcdb; --unknown: #6f5aa8; --unknown-soft: #ebe6f4;
  --pending: #7d6b75; --pending-soft: #efe5ea; --maint: #4a78a6; --maint-soft: #dde7f1;
  --on-status: #ffffff; --on-degraded: #2a1c00;
  --empty: #f0e6ea; --stripe: rgba(58, 42, 51, .025);
  --shadow: 0 1px 3px rgba(120, 70, 90, .07), 0 6px 18px rgba(120, 70, 90, .05); --radius: 12px; --bg-image: none;
  --side-text: #4a3442; --side-muted: #6e5563; --side-hover: rgba(168, 86, 107, .07); --side-on: #ffffff; --side-on-text: #8f4459; --side-mark: #a8566b;
  color-scheme: light;
}
:root[data-theme="country"] {
  /* Country: linen, a timber sidebar, wheat for actions. */
  --bg: #faf6ec; --side: #47392b; --panel: #fffdf7; --panel-2: #f6efe0; --border: #e8dfca; --border-strong: #cdbb98;
  --text: #33281d; --muted: #6e5f4b; --faint: #74654f;
  --accent: #e0a526; --accent-soft: #f8ebc9; --accent-text: #3a2a12; --link: #8a5a12;
  --ok: #3b7a30; --ok-soft: #e3efd9; --degraded: #c2680f; --degraded-soft: #f9e3cc;
  --critical: #b3261e; --critical-soft: #f6dcd8; --unknown: #7a4fa0; --unknown-soft: #ece2f3;
  --pending: #7d6e5a; --pending-soft: #ece4d4; --maint: #2f6f9e; --maint-soft: #dce9f2;
  --on-status: #ffffff; --on-degraded: #1f1200;
  --empty: #ebe2cf; --stripe: rgba(51, 40, 29, .03);
  --shadow: 0 1px 2px rgba(74, 52, 38, .08), 0 4px 14px rgba(74, 52, 38, .05); --radius: 10px; --bg-image: none;
  --side-text: #f0e3cc; --side-muted: #cdbb9c; --side-hover: rgba(255, 255, 255, .07); --side-on: #5f4b3a; --side-on-text: #fff3dc; --side-mark: #e0a526;
  color-scheme: light;
}
:root[data-theme="industrial"] {
  /* Industrial: concrete and steel, safety orange, square edges. */
  --bg: #1f2428; --side: #15181b; --panel: #2a2f34; --panel-2: #30363c; --border: #3a4148; --border-strong: #4d565f;
  --text: #e8eaec; --muted: #a3acb4; --faint: #949da5;
  --accent: #f28c28; --accent-soft: #3d2c1a; --accent-text: #16191c; --link: #f6a85c;
  --ok: #4cc47a; --ok-soft: #1f3428; --degraded: #f2c94c; --degraded-soft: #3a3320;
  --critical: #ff6b5e; --critical-soft: #45272a; --unknown: #b39cff; --unknown-soft: #34304a;
  --pending: #98a1a9; --pending-soft: #343a40; --maint: #6aa8f0; --maint-soft: #23344a;
  --on-status: #16191c; --on-degraded: #16191c;
  --empty: #353b41; --stripe: rgba(255, 255, 255, .025);
  --shadow: none; --radius: 2px; --bg-image: none;
  --side-text: #c4cbd1; --side-muted: #8d969e; --side-hover: rgba(255, 255, 255, .05); --side-on: #23282d; --side-on-text: #f28c28; --side-mark: #f28c28;
  color-scheme: dark;
}
:root[data-theme="calm"] {
  /* Calm: bright sky and white, an ocean-blue accent, soft round shapes. */
  --bg: #f6faff; --side: #d7e9fc; --panel: #ffffff; --panel-2: #eef5fd; --border: #cfe0f3; --border-strong: #93b9e3;
  --text: #14284a; --muted: #4b6283; --faint: #566d8c;
  --accent: #0b64d8; --accent-soft: #d6e7fc; --accent-text: #ffffff; --link: #0a55b8;
  --ok: #2a8049; --ok-soft: #dcf2e4; --degraded: #e0a020; --degraded-soft: #fbeccb;
  --critical: #d63a2a; --critical-soft: #fde1de; --unknown: #7f6aa8; --unknown-soft: #ece7f5;
  --pending: #6f8ba8; --pending-soft: #e1ebf6; --maint: #3f86c8; --maint-soft: #d9e9f7;
  --on-status: #ffffff; --on-degraded: #2a1c00;
  --empty: #e1ebf6; --stripe: rgba(20, 40, 74, .025);
  --shadow: 0 1px 4px rgba(20, 60, 120, .09); --radius: 14px; --bg-image: none;
  --side-text: #1f3a5f; --side-muted: #3f5878; --side-hover: rgba(11, 100, 216, .09); --side-on: #ffffff; --side-on-text: #0a3f8f; --side-mark: #0b64d8;
  color-scheme: light;
}
:root[data-theme="passion"] {
  /* Passion: violet-black and plum, magenta for actions; failures are an
     orange red so they never read as the accent. */
  --bg: #130716; --side: #2b0b24; --panel: #1e0d22; --panel-2: #25112a; --border: #3a1b3a; --border-strong: #55284f;
  --text: #f8ecf4; --muted: #c3a6b9; --faint: #b597ab;
  --accent: #e0246f; --accent-soft: #3d1029; --accent-text: #ffffff; --link: #ff7ab4;
  --ok: #2fbf71; --ok-soft: #12301f; --degraded: #f5b301; --degraded-soft: #3a2a08;
  --critical: #ff5c3a; --critical-soft: #431a14; --unknown: #b48cff; --unknown-soft: #2e1f45;
  --pending: #b99ab0; --pending-soft: #2c1830; --maint: #5fa8ff; --maint-soft: #172742;
  --on-status: #1a0610; --on-degraded: #2b0b24;
  --empty: #2c1530; --stripe: rgba(255, 255, 255, .02);
  --shadow: none; --radius: 4px;
  --bg-image: radial-gradient(1000px 500px at 85% -10%, rgba(224, 36, 111, .10), transparent 60%);
  --side-text: #ecc9e0; --side-muted: #b98fac; --side-hover: rgba(255, 255, 255, .05); --side-on: #4a1440; --side-on-text: #ff7ab4; --side-mark: #e0246f;
  color-scheme: dark;
}
/* "System" follows the device: paper by day, ink at night. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #050608; --side: #0e1115; --panel: #0b0d10; --panel-2: #111418; --border: #1b1f25; --border-strong: #2a3038;
    --text: #e9edf1; --muted: #8a94a1; --faint: #79818b;
    --accent: #2dd4bf; --accent-soft: #0e2a27; --accent-text: #04221d; --link: #5eead4;
    --ok: #2fe3a0; --ok-soft: #0c271d; --degraded: #ffb547; --degraded-soft: #2e230e; --critical: #ff4f6e; --critical-soft: #34131c;
    --unknown: #a98bff; --unknown-soft: #201a38; --pending: #8a94a1; --pending-soft: #15191e; --maint: #5fa8ff; --maint-soft: #102037;
    --on-status: #050608; --on-degraded: #1d1600;
    --empty: #171b21; --stripe: rgba(255, 255, 255, .018);
    --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Always reserve the window scrollbar's gutter. List pages lock the
   window scroll (their card scrolls instead) and short pages need no
   scrollbar, so without this the shell's 1fr column — and with it the
   right edge of every card and of the top bar — changes width by the
   scrollbar's width whenever navigation crosses between page families.
   The gutter is empty space when no scrollbar is shown; no fake
   scrollbar is drawn. */
html { scrollbar-gutter: stable; }
body { background-color: var(--bg); background-image: var(--bg-image); background-attachment: fixed; color: var(--text); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 20px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--faint); font-weight: 600; letter-spacing: .1em; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; transition: grid-template-columns .15s; }
.shell.mini { grid-template-columns: 64px 1fr; }
.side { background: var(--panel); border-inline-end: 1px solid var(--border); padding: 14px 10px; position: sticky; top: 0; height: calc(100vh / var(--zoom, 1)); overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 8px 16px; font-weight: 750; font-size: 18px; letter-spacing: .2px; color: var(--text); text-align: center; }
.brand img { width: 84px; height: 84px; object-fit: contain; }

.brand a { color: inherit; text-decoration: none; }
.logo-cycle { display: inline-flex; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; border-radius: 8px; }
.logo-cycle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand .edition { font-weight: 500; font-size: 13px; letter-spacing: 0; margin-top: 2px; }
.side .foot .host { font-size: 12px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--panel-2); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--link); font-weight: 600; }
.nav .count { margin-inline-start: auto; background: var(--critical); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12.5px; font-weight: 700; min-width: 20px; text-align: center; }
.nav .ico { width: 18px; text-align: center; opacity: .8; }
.side .foot { margin-top: auto; padding: 8px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.side .foot select { width: 100%; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 22px; border-bottom: 1px solid var(--border); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.top .crumbs { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .crumbs a { color: var(--muted); }
/* On a phone the page's name is in the menu; the bar keeps room for search and the verdict. */
@media (max-width: 640px) { .top .crumbs { display: none; } }
.top .spacer { flex: 1; }
.live { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.live.on i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.page { padding: 18px 22px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 1500px; width: 100%; }
.shell.mini .side { padding-inline: 8px; }
.shell.mini .brand > div, .shell.mini .nav .lbl, .shell.mini .side .foot { display: none; }
.shell.mini .brand { justify-content: center; padding-inline: 0; }
.shell.mini .brand img { width: 36px; height: 36px; }
.shell.mini .nav a { justify-content: center; padding-inline: 0; position: relative; }
.shell.mini .nav .count { position: absolute; inset-block-start: 0; inset-inline-end: 2px; margin: 0; font-size: 11.5px; padding: 0 5px; min-width: 0; }
.side, .top { background: color-mix(in srgb, var(--panel) 82%, transparent); backdrop-filter: blur(14px); }
.verdict { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; font-weight: 650; font-size: 13px; white-space: nowrap; background: var(--ok-soft); color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.verdict:hover { text-decoration: none; }
.verdict i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
/* Status colours are mixed toward the text colour where they are text, so
   they keep 4.5:1 on their soft backgrounds in light and dark tones alike. */
.verdict.critical { background: var(--critical-soft); color: color-mix(in srgb, var(--critical) 70%, var(--text)); } .verdict.warn { background: var(--degraded-soft); color: color-mix(in srgb, var(--degraded) 40%, var(--text)); }
.verdict.held { background: var(--maint-soft); color: color-mix(in srgb, var(--maint) 70%, var(--text)); }
.verdict.unknown { background: color-mix(in srgb, var(--faint) 18%, transparent); color: var(--text); }
.rdot.setup { background: var(--degraded); }
.top-sub { color: var(--muted); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { display: flex; align-items: center; gap: 8px; width: 460px; max-width: 40vw; flex: 0 1 460px; padding: 5px 10px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--panel-2); color: var(--muted); }
.search input { border: 0 !important; outline: 0 !important; background: none !important; padding: 0 !important; color: var(--text); }
.search button.kbd { border: 0; background: none; padding: 0; cursor: pointer; }
.search kbd { font: 11px var(--mono); padding: 0 6px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--muted); white-space: nowrap; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 240px; z-index: 20; transform: translateX(-100%); transition: transform .15s; box-shadow: var(--shadow); }
  [dir="rtl"] .side { transform: translateX(100%); }
  .side.open { transform: none !important; }
  .shell.mini { grid-template-columns: 1fr; }
  .shell.mini .brand > div, .shell.mini .nav .lbl, .shell.mini .side .foot { display: revert; }
  .top-sub, .search select.sort, .search button.kbd { display: none; }
  .search { width: auto; max-width: none; flex: 1 1 120px; }
  .top .verdict + .top-sub + .spacer { display: none; }
  .page { padding: 14px 12px 40px; }
  .top { padding: 10px 12px; }
  .hide-sm { display: none !important; }
}

/* ---- panels, grids ---- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
/* A head too narrow for its title and buttons wraps them under it rather than cutting a button off at the card edge. */
.card > .hd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card > .hd .spacer { flex: 1; }
.card > .hd select { width: auto; flex: none; max-width: 50%; }
.card > .hd h2 { white-space: nowrap; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card > .bd { padding: 14px 16px; }
.card > .bd.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-side, .g3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .g2, .g4 { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.right { text-align: end; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err-text { color: color-mix(in srgb, var(--critical) 75%, var(--text)); }
.ok-text { color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.warn-text { color: color-mix(in srgb, var(--degraded) 45%, var(--text)); }
.crit-text { color: color-mix(in srgb, var(--critical) 75%, var(--text)); }
pre.report { margin: 0; white-space: pre-wrap; word-break: break-word; font: 13px/1.55 var(--mono); }

/* ---- tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; color: var(--text); box-shadow: var(--shadow); border-inline-start: 4px solid var(--border-strong); }
.tile:hover { text-decoration: none; border-color: var(--border-strong); }
.tile b { font-size: 26px; font-weight: 700; line-height: 1.1; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.ok { border-inline-start-color: var(--ok); } .tile.critical { border-inline-start-color: var(--critical); }
.tile.degraded { border-inline-start-color: var(--degraded); } .tile.unknown { border-inline-start-color: var(--unknown); }
.tile.pending, .tile.paused { border-inline-start-color: var(--pending); } .tile.maintenance { border-inline-start-color: var(--maint); }

/* ---- status ---- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; background: var(--pending-soft); color: var(--pending); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.degraded { background: var(--degraded-soft); color: var(--degraded); }
.pill.critical { background: var(--critical-soft); color: var(--critical); }
.pill.unknown { background: var(--unknown-soft); color: var(--unknown); }
.pill.maintenance { background: var(--maint-soft); color: var(--maint); }
.pill.unreachable { background: var(--pending-soft); color: var(--muted); }
.pill.soft { border: 1px dashed currentColor; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--pending); }
.dot.ok { background: var(--ok); } .dot.degraded { background: var(--degraded); } .dot.critical { background: var(--critical); }
.dot.unknown { background: var(--unknown); } .dot.maintenance { background: var(--maint); } .dot.paused { background: var(--faint); } .dot.unreachable { background: var(--muted); }
.dot.critical.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); } 70% { box-shadow: 0 0 0 7px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 12.5px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.tag.warn { color: color-mix(in srgb, var(--degraded) 55%, var(--text)); border-color: var(--degraded); }
.tag.weak { color: color-mix(in srgb, var(--unknown) 70%, var(--text)); border-color: var(--unknown); }
.tag.err { color: color-mix(in srgb, var(--critical) 75%, var(--text)); border-color: var(--critical); }

/* ---- heartbeat bar ---- */
.beats { display: flex; gap: 2px; align-items: stretch; height: 22px; min-width: 120px; }
.beats i { flex: 1; border-radius: 2px; background: var(--empty); min-width: 2px; }
.beats i.ok { background: var(--ok); } .beats i.degraded { background: var(--degraded); } .beats i.critical { background: var(--critical); }
.beats i.unknown { background: var(--unknown); } .beats i.maintenance { background: var(--maint); }
.beats i.partial { background: linear-gradient(var(--critical) 0 50%, var(--ok) 50% 100%); }
.beats.big { height: 34px; gap: 3px; }

/* ---- tables ---- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--panel-2); white-space: nowrap; }
.tbl th.sort { cursor: pointer; user-select: none; }
.tbl.dense td { padding: 5px 10px; vertical-align: top; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--panel-2); }
.tbl tr.click:hover td.act { background: linear-gradient(var(--panel-2), var(--panel-2)), var(--panel); }
.tbl tr.critical td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
[dir="rtl"] .tbl tr.critical td:first-child { box-shadow: inset -3px 0 0 var(--critical); }
.tbl .name { font-weight: 600; color: var(--text); }
.name, h1, .tile b { unicode-bidi: plaintext; }
.tbl .sub { color: var(--muted); font-size: 13px; }
.tbl-wrap { overflow-x: auto; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.card > .bd > .kv:first-child { margin-top: 0; }
.field > label.req::after { content: " *"; color: var(--critical); }
.kv dt { color: var(--muted); }
.kvtable { border-collapse: collapse; }
.kvtable th { text-align: start; color: var(--muted); font-weight: 500; padding: 4px 16px 4px 0; white-space: nowrap; vertical-align: top; }
.kvtable td { padding: 4px 0; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---- forms ---- */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=email], input[type=search], input[type=date], input[type=datetime-local], select, textarea {
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 9px; min-width: 0; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
textarea { resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 13px; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.form { display: grid; gap: 14px; }
.form .two { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form .two { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 13px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--panel); cursor: pointer; font-weight: 550; white-space: nowrap; color: var(--text); }
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: color-mix(in srgb, var(--critical) 75%, var(--text)); border-color: var(--critical); }
.btn.danger.solid { background: var(--critical); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 3px 9px; font-size: 13px; }
select.btn { width: auto; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--panel); padding: 5px 11px; cursor: pointer; border-inline-end: 1px solid var(--border); font-weight: 550; }
.seg button:last-child { border-inline-end: 0; }
.seg button.on { background: var(--accent); color: var(--accent-text); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border-strong); background: var(--panel); border-radius: 14px; padding: 3px 11px; cursor: pointer; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: color-mix(in srgb, var(--link) 75%, var(--text)); font-weight: 600; }
.chip b { font-weight: 700; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs a, .tabs button { padding: 8px 14px; border: 0; background: none; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on, .tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

/* ---- notices ---- */
.banner { border-radius: var(--radius); padding: 10px 14px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.banner.error { background: var(--critical-soft); border-color: var(--critical); color: var(--text); }
.banner.warning { background: var(--degraded-soft); border-color: var(--degraded); color: var(--text); }
.banner.info { background: var(--maint-soft); border-color: var(--maint); color: var(--text); }
/* On a phone a banner's text takes a line of its own and its buttons wrap below it, instead of being squeezed into a narrow column with the buttons pushed off the screen. */
@media (max-width: 640px) { .banner { flex-wrap: wrap; } .banner > .spacer { flex: 1 1 100%; min-width: 0; } }
/* Import source choice. */
.src-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.src-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: start; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--panel); cursor: pointer; }
.src-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
/* This product's own files (monitors.conf) are not an import from another tool: last, and in the accent colour. */
.src-card.own { background: var(--accent); border-color: var(--accent); color: var(--accent-text); border-radius: 999px; padding-inline: 26px; }
.src-card.own b, .src-card.own span { color: var(--accent-text); }
.src-card.own.on { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--accent); }
/* monitors.conf, read-only. */
.editor.readonly .file { margin: 0; padding: 8px 10px; font: 12.5px/1.55 var(--mono); white-space: pre; overflow-x: auto; tab-size: 8; min-height: 40vh; }
/* Red dot: a channel or policy whose recipients need checking. */
.rdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--critical); vertical-align: middle; flex: none; margin-top: 0.45em; }
td .rdot, h3 .rdot { margin-top: 0; }
.banner.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--text); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.toasts { position: fixed; inset-block-end: 16px; inset-inline-end: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); font-weight: 500; }
.toast.error { background: var(--critical); color: #fff; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- modal ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: var(--panel); border-radius: 10px; width: min(640px, 100%); max-height: calc(100vh / var(--zoom, 1) - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal.wide { width: min(980px, 100%); }
.modal .hd { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); gap: 10px; }
.modal .bd { padding: 16px 18px; }
.modal .ft { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }

/* ---- code / editor ---- */
.code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; overflow: auto; white-space: pre; font-family: var(--mono); font-size: 13px; margin: 0; direction: ltr; text-align: left; }
.editor { display: grid; grid-template-columns: auto 1fr; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; background: var(--panel); direction: ltr; }
.editor .gutter { background: var(--panel-2); color: var(--faint); text-align: right; padding: 8px 8px 8px 10px; font: 12.5px/1.55 var(--mono); user-select: none; white-space: pre; border-right: 1px solid var(--border); overflow: hidden; }
.editor .gutter .bad { color: var(--critical); font-weight: 700; }
.editor .gutter .warn { color: var(--degraded); font-weight: 700; }
.editor textarea { border: 0; border-radius: 0; font: 12.5px/1.55 var(--mono); padding: 8px 10px; min-height: 60vh; white-space: pre; overflow-wrap: normal; overflow-x: auto; tab-size: 8; resize: none; outline: none; }
.diff { font: 12.5px/1.5 var(--mono); white-space: pre; overflow: auto; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 0; direction: ltr; text-align: left; max-height: 50vh; }
.diff div { padding: 0 12px; }
.diff .add { background: var(--ok-soft); color: var(--ok); }
.diff .del { background: var(--critical-soft); color: var(--critical); }
.diff .hunk { color: var(--maint); }
.diff.split { padding: 0; }
.diff.split table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.diff.split td { padding: 0 8px; vertical-align: top; white-space: pre-wrap; word-break: break-all; }
.diff.split td.no { width: 3.5em; color: var(--faint); text-align: right; user-select: none; border-inline-end: 1px solid var(--border); }
.diff.split td.del { background: var(--critical-soft); color: var(--critical); }
.diff.split td.add { background: var(--ok-soft); color: var(--ok); }
.diff.split tr.gap td { color: var(--faint); text-align: center; background: var(--panel); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---- charts ---- */
.chart { width: 100%; min-height: 220px; }
.uplot { font-family: var(--sans); }
.u-legend { font-size: 13px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 60px; }
.bars i { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .8; }

/* ---- auth ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: min(420px, 100%); }
.auth .logo { display: flex; flex-direction: column; align-items: center; gap: 8px; justify-content: center; margin-bottom: 18px; font-size: 22px; font-weight: 750; }
.auth .logo img { width: 96px; height: 96px; object-fit: contain; }

/* ---- health card ---- */
.health { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.hitem { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border); }
.hitem .dot { margin-top: 5px; }
.hitem b { display: block; font-size: 13px; }
.hitem span { color: var(--muted); font-size: 13px; }
.path { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 0; }
.path-hop { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border); min-width: 0; }
.path-hop .dot { margin-top: 5px; }
.path-hop b { display: block; font-size: 13px; }
.path-hop span { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.path-link { flex: 1 0 24px; max-width: 80px; height: 2px; background: var(--ok); }
.path-link.critical { background: var(--critical); }
.path-link.pending { background: var(--border); }
@media (max-width: 640px) { .path { flex-direction: column; align-items: stretch; } .path-link { flex: 0 0 12px; width: 2px; height: 12px; max-width: none; margin-inline-start: 18px; } }

/* ---- public status page ---- */
body.public { background: var(--bg); }
.pub { max-width: 860px; margin: 0 auto; padding: 28px 16px 60px; display: flex; flex-direction: column; gap: 18px; }
.pub .head { display: flex; align-items: center; gap: 14px; }
.pub .head img { max-height: 44px; }
.pub .overall { padding: 16px 18px; border-radius: var(--radius); font-weight: 650; font-size: 16px; color: var(--on-status); display: flex; align-items: center; gap: 10px; }
.pub .overall { background: var(--muted); } .pub .overall.ok { background: var(--ok); } .pub .overall.degraded { background: var(--degraded); color: var(--on-degraded); } .pub .overall.critical { background: var(--critical); }
.pub .mon { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.pub .mon:last-child { border-bottom: 0; }
.pub .beats { height: 28px; }
.pub footer { text-align: center; color: var(--muted); font-size: 13px; }
/* Links inside running text are underlined, not told apart by colour alone. */
p a:not(.btn), .pub footer a { text-decoration: underline; text-underline-offset: 2px; }
.pub .pre { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.pub .past { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 8px; }
.pub .sub { gap: 8px; flex-wrap: wrap; }
.pub .sub input { min-width: 220px; flex: 1; }
.pub .subs { align-items: center; gap: 12px; }

/* ---- overview: where it breaks ---- */
.fp-scroll { overflow-x: auto; padding: 4px 8px 0; }
.fp-scroll svg { width: 100%; min-width: 760px; height: auto; display: block; }
.fp-line { fill: none; stroke-width: 2.2; }
.fp-line.ok { stroke: color-mix(in srgb, var(--ok) 60%, transparent); stroke-dasharray: 3 9; animation: fp-flow 1.6s linear infinite; }
.fp-line.bad { stroke: var(--critical); stroke-width: 2.6; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--critical) 70%, transparent)); }
.fp-line.warn { stroke: var(--degraded); stroke-dasharray: 4 6; }
.fp-line.dead { stroke: var(--border); stroke-dasharray: 2 8; }
.fp-line.unk { stroke: var(--faint); stroke-dasharray: 2 8; }
@keyframes fp-flow { to { stroke-dashoffset: -24; } }
@media (prefers-reduced-motion: reduce) { .fp-line.ok, .fp-break, .hex.critical { animation: none !important; } }
.fp-lbl { fill: var(--text); font: 600 14px var(--sans); }
.fp-sub { fill: var(--muted); font: 12.5px var(--sans); font-variant-numeric: tabular-nums; }
.fp-col { fill: var(--muted); font: 600 13px var(--sans); letter-spacing: .02em; }
.fp-break { animation: fp-blink 1.1s ease-in-out infinite; }
@keyframes fp-blink { 50% { opacity: .35; } }
.story { display: flex; align-items: center; gap: 16px; margin: 6px 16px 16px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); }
.story .icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; background: var(--ok-soft); color: color-mix(in srgb, var(--ok) 75%, var(--text)); }
/* The glyph is text on the soft tint: mixed toward the text colour so it
   reads at 4.5:1 in every palette, as the status pills do. */
.story.critical .icon { background: var(--critical-soft); color: color-mix(in srgb, var(--critical) 75%, var(--text)); } .story.held .icon { background: var(--maint-soft); color: color-mix(in srgb, var(--maint) 70%, var(--text)); }
.story.warn .icon { background: var(--degraded-soft); color: color-mix(in srgb, var(--degraded) 55%, var(--text)); }
.story b { display: block; font-size: 15px; margin-bottom: 2px; }
.story .saved { margin-inline-start: auto; text-align: end; flex: none; }
.story .saved strong { display: block; font: 700 26px/1 var(--mono); color: var(--link); }
.story .saved span { font-size: 12.5px; color: var(--muted); }

/* ---- overview: honeycomb and votes ---- */
.hive { padding: 4px 16px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px 26px; }
.hive h4 { margin: 10px 0 4px; font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.hive h4 small { color: var(--muted); font: 11px var(--mono); }
.hive svg { max-width: 100%; height: auto; }
.hex { cursor: pointer; transition: transform .18s; transform-box: fill-box; transform-origin: center; }
.hex:hover { transform: scale(1.18); }
.hex .body { stroke-width: 1.2; }
.hex.ok .body { fill: color-mix(in srgb, var(--ok) 20%, transparent); stroke: color-mix(in srgb, var(--ok) 55%, transparent); }
.hex.degraded .body { fill: color-mix(in srgb, var(--degraded) 24%, transparent); stroke: color-mix(in srgb, var(--degraded) 70%, transparent); }
.hex.critical .body { fill: color-mix(in srgb, var(--critical) 55%, transparent); stroke: var(--critical); }
.hex.critical { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--critical) 85%, transparent)); animation: hexpulse 1.4s ease-in-out infinite; }
@keyframes hexpulse { 50% { filter: drop-shadow(0 0 1px color-mix(in srgb, var(--critical) 30%, transparent)); } }
.hex.acked .body { fill: color-mix(in srgb, var(--critical) 22%, transparent); stroke: color-mix(in srgb, var(--critical) 60%, transparent); }
.hex.acked { animation: none; filter: none; }
.hex.held .body { fill: color-mix(in srgb, var(--maint) 16%, transparent); stroke: color-mix(in srgb, var(--maint) 55%, transparent); stroke-dasharray: 3 2; }
.hex.unknown .body { fill: color-mix(in srgb, var(--unknown) 18%, transparent); stroke: color-mix(in srgb, var(--unknown) 60%, transparent); }
.hex.maintenance .body { fill: color-mix(in srgb, var(--maint) 22%, transparent); stroke: var(--maint); }
.hex.idle .body { fill: transparent; stroke: var(--faint); stroke-dasharray: 2 2; }
.hex.weak .body { stroke-dasharray: 2.5 2; }
.hex .slice { fill: var(--degraded); opacity: .95; }
.hex text { font: 700 9px var(--mono); fill: var(--text); pointer-events: none; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); display: inline-block; }
.hextip { position: fixed; z-index: 35; pointer-events: none; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border-strong); font-size: 13px; max-width: 320px; box-shadow: 0 14px 30px rgba(0,0,0,.4); }
.vote { display: inline-flex; align-items: center; gap: 6px; font: 12px var(--mono); white-space: nowrap; }
.vote i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; background: var(--faint); }
.vote.ok i { background: var(--ok); } .vote.fail { color: var(--critical); } .vote.fail i { background: var(--critical); }
.vote.abstain { color: var(--maint); } .vote.abstain i { background: transparent; border: 1.5px dashed var(--maint); }

/* ---- overview: side cards ---- */
.bignum { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bignum strong { font: 800 42px/1 var(--mono); color: var(--link); }
.sbars { display: grid; gap: 8px; margin-top: 14px; }
.sbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; }
.sbar .track { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--empty); overflow: hidden; }
.sbar .track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--link), var(--maint)); }

/* ---- compact incident list ---- */
.inc { display: flex; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.inc:last-child { border-bottom: 0; }
.inc .sev { width: 4px; border-radius: 4px; background: var(--critical); flex: none; align-self: stretch; }
.inc .sev.degraded { background: var(--degraded); } .inc .sev.unknown { background: var(--unknown); } .inc .sev.ok { background: var(--ok); } .inc .sev.sys { background: var(--maint); }
.inc .body { flex: 1 1 180px; min-width: 0; }
.inc p { margin: 2px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.inc p.faint { color: var(--faint); font-size: 13px; }
.inc .acts { display: flex; gap: 6px; align-items: flex-start; }

/* ---- where it breaks, narrow screens ---- */
.fp-list { display: none; padding: 4px 16px 0; gap: 10px; }
.fp-node { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); display: flex; flex-direction: column; gap: 6px; }
.fp-node .hops { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; }
.fp-node .hops i { color: var(--faint); font-style: normal; }
.fp-node .hop { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.fp-node .hop .dot { width: 8px; height: 8px; }
.fp-sums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fp-sum { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; }
.fp-sum b { flex-basis: 100%; }
@media (max-width: 700px) { .fp-scroll { display: none; } .fp-list { display: grid; } .story .saved { display: none; } }

/* ---- drawer ---- */
.scrim { position: fixed; inset: 0; background: rgba(3, 6, 10, .55); z-index: 30; }
.drawer { position: fixed; inset-block: 0; inset-inline-end: 0; width: 560px; max-width: 100vw; z-index: 31; background: var(--panel); border-inline-start: 1px solid var(--border-strong);
  overflow-y: auto; box-shadow: -30px 0 60px rgba(0, 0, 0, .45); animation: drawer-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
.drawer .hd { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.drawer h1 { margin: 8px 0 2px; font-size: 21px; }
.drawer .sec { padding: 16px 22px; border-bottom: 1px solid var(--border); }
.drawer .sec:last-child { border-bottom: 0; }
.drawer .sec h4 { margin: 0 0 10px; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.drawer .tbl td { padding-inline: 0; }
.decide { display: grid; gap: 6px; }
.drow { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 9px; background: var(--panel-2); }
.drow .vote { white-space: normal; }
.formula { margin-top: 6px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border-strong); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.formula .small { flex-basis: 100%; }

/* ---- console look for every page ---- */
/* On a wide screen the sidebar and the content stay together as one block
   of readable width in the middle of the window. */
.page { max-width: none; gap: 18px; }
.shell { max-width: 1880px; margin-inline: auto; background-color: var(--bg); box-shadow: 0 0 0 1px var(--border), 0 0 40px rgba(0, 0, 0, .06); }
/* The margins outside the block are a shade darker, so the block reads as one. */
body:has(.shell) { background-color: color-mix(in srgb, var(--bg) 92%, var(--text)); }
@media (max-width: 860px) { .shell { box-shadow: none; } body:has(.shell) { background-color: var(--bg); } }
.card { border-radius: 14px; overflow: hidden; }
.card > .hd { padding: 13px 18px; }
.card > .hd h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.card > .bd { padding: 14px 18px; }
.tile { border-radius: 12px; }
.tbl th { background: transparent; letter-spacing: .06em; }
.tbl tr.click:hover td { background: color-mix(in srgb, var(--link) 7%, transparent); }
.tbl tr.click:hover td.act { background: linear-gradient(color-mix(in srgb, var(--link) 7%, transparent), color-mix(in srgb, var(--link) 7%, transparent)), var(--panel); }
.btn { border-radius: 8px; }
.seg { border-radius: 10px; padding: 3px; gap: 2px; background: var(--panel-2); border: 1px solid var(--border); }
.seg button { border: 0; border-radius: 7px; background: none; color: var(--muted); padding: 4px 12px; font-weight: 600; }
.seg button.on { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); }
/* Page tabs are underlined; a view switch (.seg) is a button group, so the two never look alike. */
.tabs { gap: 6px; border-bottom: 1px solid var(--border); }
.tabs a, .tabs button { border-radius: 0; padding: 8px 4px; margin: 0 0 -1px; margin-inline-end: 10px; border-bottom: 2px solid transparent; }
.tabs a.on, .tabs button.on { background: none; color: var(--text); border-bottom-color: var(--accent); }
.chip { border-radius: 999px; }
.chip.on { background: color-mix(in srgb, var(--link) 14%, transparent); border-color: color-mix(in srgb, var(--link) 45%, transparent); }
.banner { border-radius: 12px; }
.modal { border-radius: 14px; }
.nav a { border-radius: 8px; }
.nav a.on { background: color-mix(in srgb, var(--link) 12%, transparent); }

/* ---- command palette ---- */
button.search { cursor: text; font: inherit; text-align: start; }
.pal { position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); width: 720px; max-width: calc(100vw - 24px); z-index: 41;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: 0 40px 80px rgba(0, 0, 0, .5); overflow: hidden; }
.pal input { width: 100%; padding: 16px 20px; font: 16px var(--mono); color: var(--text); background: transparent; border: 0 !important; border-bottom: 1px solid var(--border) !important; border-radius: 0; outline: none !important; }
.pal .res { max-height: 52vh; overflow-y: auto; padding: 8px; }
.pal .pal-note { padding: 4px 12px 8px; }
.pal .it { display: grid; grid-template-columns: 130px 60px 40px 1fr; gap: 10px; padding: 7px 12px; border-radius: 8px; font: 12.5px var(--mono); align-items: center; cursor: pointer; }
.pal .act { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; padding: 9px 12px; border-radius: 8px; align-items: center; cursor: pointer; }
.pal .act.static { cursor: default; }
.pal .act .ico { color: var(--link); text-align: center; }
.pal .it.on, .pal .act.on { background: color-mix(in srgb, var(--link) 10%, transparent); }
.pal .hint { padding: 9px 14px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); display: flex; gap: 16px; flex-wrap: wrap; }
.pal kbd { font: 11px var(--mono); padding: 0 6px; border-radius: 5px; border: 1px solid var(--border-strong); }

/* ---- first run ---- */
.ob { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .ob { grid-template-columns: 1fr; } }
.ob-step { display: flex; gap: 12px; padding: 14px; border-radius: 12px; border: 1.5px solid var(--degraded); background: var(--panel-2); }
.ob-step.done { border-color: var(--ok); }
.ob-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; background: var(--degraded-soft); color: var(--degraded); }
.ob-step.done .ob-n { background: var(--ok-soft); color: var(--ok); }
.ob-b { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ob-b p { margin: 0; }
.why { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.why li { padding: 7px 12px 7px 14px; border-radius: 9px; background: var(--panel-2); border-inline-start: 3px solid var(--faint); font-size: 13px; }
.why li.ok { border-inline-start-color: var(--ok); } .why li.warn { border-inline-start-color: var(--degraded); }
.why li.crit { border-inline-start-color: var(--critical); } .why li.maint { border-inline-start-color: var(--maint); }
@media (max-width: 640px) {
  .mon-head { flex-direction: column; align-items: stretch !important; }
  .mon-head > .row { flex-wrap: wrap; }
  .mon-head h1 { white-space: normal; }
  .mon-bulkrow > .mon-bulk { flex-wrap: nowrap; }
  .drawer .hd .row { flex-wrap: wrap; }
}
.nav .rdot + .count { margin-inline-start: 6px; }
.setup-issues .hd h3 { display: flex; align-items: center; gap: 8px; }
.setup-issue { padding: 10px 16px; border-top: 1px solid var(--border); }
.setup-issue:first-child { border-top: 0; }
.fp-link { cursor: pointer; }
.fp-link:hover { text-decoration: underline; }
.tbl th.sel, .tbl td.sel { width: 32px; padding-inline-end: 0; }
.tbl tr.picked td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tbl tr.picked td.act { background: linear-gradient(color-mix(in srgb, var(--accent) 8%, transparent), color-mix(in srgb, var(--accent) 8%, transparent)), var(--panel); }

/* Audit log: high-risk actions stand out. */
tr.risk-high td { background: color-mix(in srgb, var(--degraded) 9%, transparent); }
tr.risk-high td.act { background: linear-gradient(color-mix(in srgb, var(--degraded) 9%, transparent), color-mix(in srgb, var(--degraded) 9%, transparent)), var(--panel); }
tr.risk-high td:first-child { box-shadow: inset 3px 0 0 var(--degraded); }

/* Incident report */
.pm .pm-concl { font-size: 1.05rem; margin: 0; }
.pm .pm-list { margin: 0; padding-inline-start: 1.2rem; }
.pm .pm-list li { margin: .25rem 0; overflow-wrap: anywhere; }
.pm .pm-list time { margin-inline-end: .4rem; white-space: nowrap; }

/* ---- Nagios-style status: solid blocks, striped tables ----
   The state is the first thing an operator looks for, so it is a filled
   block rather than a tinted label; rows are striped and the header is a
   plain bar so long service lists stay easy to follow. */
.pill { border-radius: 4px; padding: 1px 8px; text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }
/* Solid blocks are shaded toward the text colour (darker on light tones,
   lighter on dark ones) so their label keeps 4.5:1. */
.pill.ok { background: color-mix(in srgb, var(--ok) 80%, var(--text)); color: var(--on-status); }
.pill.degraded { background: var(--degraded); color: var(--on-degraded); }
.pill.critical { background: color-mix(in srgb, var(--critical) 85%, var(--text)); color: var(--on-status); }
.pill.unknown { background: color-mix(in srgb, var(--unknown) 85%, var(--text)); color: var(--on-status); }
.pill.maintenance { background: color-mix(in srgb, var(--maint) 85%, var(--text)); color: var(--on-status); }
.pill.soft { background: transparent; }
/* Pending is a tint, not a block: its label is shaded toward the text. */
.pill.pending { color: color-mix(in srgb, var(--pending) 55%, var(--text)); }
/* Only two soft combinations can occur: the state machine marks every
   OK-availability or unknown verdict hard, and callers never ask for a
   soft ok pill — so soft exists only for critical and maintenance. */
.pill.soft.critical { color: color-mix(in srgb, var(--critical) 75%, var(--text)); }
.pill.soft.maintenance { color: color-mix(in srgb, var(--maint) 75%, var(--text)); }
.tbl th { background: var(--panel-2); border-bottom: 1px solid var(--border-strong); }
.tbl tbody tr:nth-child(even) td { background: var(--stripe); }
.tbl tbody tr:nth-child(even) td.act { background: linear-gradient(var(--stripe), var(--stripe)), var(--panel); }
.tbl tr.critical td { background: color-mix(in srgb, var(--critical) 6%, transparent); }
.tbl tr.critical td.act { background: linear-gradient(color-mix(in srgb, var(--critical) 6%, transparent), color-mix(in srgb, var(--critical) 6%, transparent)), var(--panel); }
.tbl tr.click:hover td { background: color-mix(in srgb, var(--link) 8%, transparent); }
.tbl tr.click:hover td.act { background: linear-gradient(color-mix(in srgb, var(--link) 8%, transparent), color-mix(in srgb, var(--link) 8%, transparent)), var(--panel); }

/* The sidebar is its own surface: a step darker than the page on light
   themes and a step apart on dark ones, so navigation and content read as
   two areas. Hover and the current page are tints of the text and accent,
   which work on any of those shades. */
.side { background: var(--side, var(--panel)); backdrop-filter: none; border-inline-end-color: var(--border); }
.nav a:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.nav a.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: color-mix(in srgb, var(--link) 75%, var(--text)); }
.side .foot select { background: var(--panel); }
.nav a.on { box-shadow: inset 3px 0 0 var(--accent); }
[dir="rtl"] .nav a.on { box-shadow: inset -3px 0 0 var(--accent); }

/* Settings › Appearance */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pack.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pack-logo { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; background: var(--panel-2); flex: none; }
.pack-logo.none { border: 1px dashed var(--border-strong); }
.swatches { display: flex; gap: 4px; }
.swatches span { width: 26px; height: 18px; border-radius: 4px; border: 1px solid var(--border); }
.swatches span.unset { background: repeating-linear-gradient(45deg, var(--panel-2) 0 3px, var(--panel) 3px 6px) !important; }

/* ---- Wall screen (/wall) ----
   Read from across a room. The console's status colours are tuned for
   small text and labels; filling a whole tile with them is loud (the ink
   theme's red turns pink), so the wall has its own palette: healthy tiles
   recede, problems are deep, saturated blocks with white type. */
body.wallpage {
  overflow: hidden;
  --w-bg: #07090c; --w-bar: #0f1318; --w-line: #1c232c; --w-text: #e8edf2; --w-muted: #7f8b99;
  --w-ok: #13241d; --w-ok-edge: #1f3a2e; --w-ok-text: #b9d8c8; --w-ok-num: #3ecf8e;
  --w-crit: #c62828; --w-crit-2: #8e1b1b; --w-crit-num: #f2645c;
  --w-warn: #d99a06; --w-warn-2: #b37400; --w-warn-text: #1f1500; --w-warn-num: #f2b632;
  --w-unk: #5b4bb7; --w-unk-2: #3f3290; --w-unk-num: #a594f9;
  --w-maint: #173252; --w-maint-text: #a9c8ef;
  --w-off: #14181d; --w-off-text: #66717e;
  background: radial-gradient(1400px 700px at 50% -20%, #131a22 0%, var(--w-bg) 60%) fixed, var(--w-bg);
  color: var(--w-text);
}
:root[data-theme="paper"] body.wallpage, :root[data-theme="calm"] body.wallpage {
  --w-bg: #eef1f4; --w-bar: #ffffff; --w-line: #d9dfe6; --w-text: #17202b; --w-muted: #5f6b7a;
  --w-ok: #e2efe8; --w-ok-edge: #cfe2d7; --w-ok-text: #24513b; --w-ok-num: #1f8a55;
  --w-crit-num: #c62828; --w-warn-num: #b37400; --w-unk-num: #5b4bb7;
  --w-maint: #dce8f6; --w-maint-text: #1f4f86; --w-off: #e3e7ec; --w-off-text: #7a8592;
  background: var(--w-bg);
}
.wall { display: flex; flex-direction: column; height: 100vh; padding: 1.4vh 1.6vw; gap: 1.4vh; }
.wall-top { display: flex; align-items: center; gap: 1.4vw; font-size: clamp(16px, 2.2vh, 30px); padding: 1vh 1.4vw; border-radius: 14px;
  background: var(--w-bar); border: 1px solid var(--w-line); }
.wall-top img { height: 5vh; width: 5vh; object-fit: contain; }
.wall-top .prod { font-weight: 700; letter-spacing: .01em; }
.wall-top .overall { font-weight: 750; padding: .45vh 1.1vw; border-radius: 999px; font-size: .9em; letter-spacing: .02em;
  background: color-mix(in srgb, var(--w-ok-num) 16%, transparent); color: var(--w-ok-num); border: 1px solid color-mix(in srgb, var(--w-ok-num) 40%, transparent); }
.wall-top.critical .overall { background: var(--w-crit); color: #fff; border-color: transparent; }
.wall-top.degraded .overall { background: var(--w-warn); color: var(--w-warn-text); border-color: transparent; }
.wall-top.unknown .overall { background: var(--w-unk); color: #fff; border-color: transparent; }
.wall-top .cnt { display: flex; flex-direction: column; align-items: center; font-weight: 750; font-size: 1.55em; line-height: 1; min-width: 3.4em;
  font-variant-numeric: tabular-nums; padding-inline: .4em; border-inline-start: 1px solid var(--w-line); }
.wall-top .cnt small { font-size: .34em; font-weight: 600; color: var(--w-muted); text-transform: uppercase; letter-spacing: .1em; margin-top: .45em; }
.wall-top .cnt.critical { color: var(--w-crit-num); } .wall-top .cnt.degraded { color: var(--w-warn-num); }
.wall-top .cnt.unknown { color: var(--w-unk-num); } .wall-top .cnt.ok { color: var(--w-ok-num); }
.wall-top .cnt.zero { color: var(--w-muted); opacity: .55; }
.wall-top .clock { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 1.35em; padding-inline-start: 1.2vw; border-inline-start: 1px solid var(--w-line); }
.wall-stale { background: var(--w-crit); color: #fff; font-weight: 750; text-align: center; padding: 1.1vh; border-radius: 12px; font-size: clamp(16px, 2.4vh, 32px); animation: wallblink 1.4s steps(2) infinite; }
.wall-hive { position: relative; flex: 1; min-height: 0; }
.wall-hex { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(180deg, var(--w-ok-edge), var(--w-ok)); color: var(--w-ok-text); line-height: 1.15; }
.wall-hex .name { width: 100%; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-word; }
.wall-hex .st { font-size: .58em; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; margin-top: .55em; opacity: .85; }
.wall-hex.critical { background: linear-gradient(180deg, var(--w-crit), var(--w-crit-2)); color: #fff; animation: wallpulse 2.4s ease-in-out infinite; }
.wall-hex.critical .name, .wall-hex.degraded .name, .wall-hex.unknown .name { font-weight: 700; }
.wall-hex.degraded { background: linear-gradient(180deg, var(--w-warn), var(--w-warn-2)); color: var(--w-warn-text); }
.wall-hex.unknown { background: linear-gradient(180deg, var(--w-unk), var(--w-unk-2)); color: #fff; }
.wall-hex.maintenance { background: var(--w-maint); color: var(--w-maint-text); }
.wall-hex.pending, .wall-hex.paused { background: var(--w-off); color: var(--w-off-text); }
.wall-hex.acked { animation: none; filter: saturate(.75); }
.wall-ticker { display: flex; gap: 2.4vw; flex-wrap: wrap; align-items: center; font-size: clamp(14px, 2vh, 26px); padding: .9vh 1.4vw; border-radius: 14px;
  background: var(--w-bar); border: 1px solid var(--w-line); color: var(--w-muted); }
.wall-ticker span { white-space: nowrap; display: inline-flex; align-items: center; gap: .5em; }
.wall-ticker span::before { content: ""; width: .6em; height: .6em; border-radius: 50%; background: var(--w-crit); }
.wall-ticker .degraded::before { background: var(--w-warn); }
.wall-ticker b { color: var(--w-text); font-weight: 650; }
.wall-msg { height: 100vh; display: grid; place-content: center; text-align: center; padding: 24px; color: var(--w-muted); }
.wall-msg h1 { font-size: clamp(22px, 4vh, 44px); color: var(--w-text); }
.wall-msg p { font-size: clamp(15px, 2.2vh, 26px); max-width: 40em; }
@keyframes wallpulse { 50% { filter: brightness(1.18); } }
@keyframes wallblink { 50% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .wall-hex.critical, .wall-stale { animation: none; } }

/* ---- Managers' summary (/summary) ----
   An editorial page rather than a console: one column of conclusions,
   large numbers, few colours, and it prints on one sheet. */
body.summarypage { background: var(--bg); }
.sum { max-width: 1160px; margin: 0 auto; padding: 28px 24px 48px; display: flex; flex-direction: column; gap: 18px; }
.sum-head { display: flex; align-items: center; gap: 14px; }
.sum-head img { width: 52px; height: 52px; object-fit: contain; }
.sum-head b { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.sum-head h1 { font-size: 26px; font-weight: 750; letter-spacing: -.01em; margin-top: 2px; }
.sum-head .seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.sum-head .seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.sum-head .seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.sum-now { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); }
.sum-now .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 18%, transparent); flex: none; }
.sum-now.bad { border-color: color-mix(in srgb, var(--critical) 45%, var(--border)); background: color-mix(in srgb, var(--critical) 5%, var(--panel)); }
.sum-now.bad .dot { background: var(--critical); box-shadow: 0 0 0 6px color-mix(in srgb, var(--critical) 18%, transparent); }
.sum-now h2 { font-size: 20px; font-weight: 700; }
.sum-now p { margin: 4px 0 0; color: var(--muted); }
.sum-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi .lbl { font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.kpi .big { font-size: 34px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .big.good { color: var(--ok); } .kpi .big.fair { color: var(--degraded); } .kpi .big.poor { color: var(--critical); }
.delta { font-size: 13px; font-weight: 600; } .delta .vs { font-weight: 500; color: var(--muted); }
.delta.good { color: var(--ok); } .delta.bad { color: var(--critical); } .delta.same, .delta.none { color: var(--muted); font-weight: 500; }
.sum-card { padding: 18px 20px; }
.sum-card h3 { margin-bottom: 12px; }
.trend { width: 100%; height: auto; display: block; }
.trend .grid { stroke: var(--border); stroke-dasharray: 3 4; }
.trend .axis { fill: var(--muted); font-size: 13px; }
.trend .bar.good { fill: color-mix(in srgb, var(--ok) 72%, var(--panel)); } .trend .bar.fair { fill: var(--degraded); } .trend .bar.poor { fill: var(--critical); }
.legend { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.legend .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-inline-start: 10px; }
.legend .sw.good { background: var(--ok); } .legend .sw.fair { background: var(--degraded); } .legend .sw.poor { background: var(--critical); }
.sum-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sum-tbl { width: 100%; border-collapse: collapse; }
.sum-tbl td { padding: 9px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sum-tbl tr:last-child td { border-bottom: 0; }
.sum-tbl .num { text-align: end; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; padding-inline-start: 12px; }
.sum-tbl .num.good { color: var(--ok); } .sum-tbl .num.fair { color: var(--degraded); } .sum-tbl .num.poor { color: var(--critical); }
.sum-tbl .meter { width: 30%; padding-inline-start: 14px; }
.sum-tbl .meter span { display: block; height: 6px; border-radius: 3px; max-width: 100%; }
.sum-tbl .meter .good { background: var(--ok); } .sum-tbl .meter .fair { background: var(--degraded); } .sum-tbl .meter .poor { background: var(--critical); }
.tag.bad { background: var(--critical-soft); color: var(--critical); }
.sum-msg { min-height: 100vh; display: grid; place-content: center; text-align: center; padding: 24px; color: var(--muted); }
.sum-msg h1 { font-size: 26px; color: var(--text); }
@media (max-width: 860px) { .sum-kpis { grid-template-columns: 1fr 1fr; } .sum-cols { grid-template-columns: 1fr; } .sum-head { flex-wrap: wrap; } }
@media print {
  body.summarypage { background: #fff; }
  .sum-head .seg, .sum-head .print { display: none; }
  .sum { padding: 0; max-width: none; }
  .kpi, .sum-card, .sum-now { break-inside: avoid; box-shadow: none; }
}
.links2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 860px) { .links2 { grid-template-columns: 1fr; } }

/* List pages (monitors, problems, events): on a wide screen the list
   scrolls inside its card, so the scrollbar starts at the first record
   and the top bar, tabs and toolbar stay in place. */
@media (min-width: 861px) {
  .main:has(> .page.list) { height: calc(100vh / var(--zoom, 1)); overflow: hidden; }
  .page.list { flex: 1 1 auto; min-height: 0; padding-bottom: 18px; }
  .page.list .col:has(.card.scroll) { flex: 1 1 auto; min-height: 0; }
  .page.list .card.scroll { flex: 1 1 auto; min-height: 160px; display: flex; flex-direction: column; overflow: hidden; }
  .page.list .card.scroll > .bd { flex: 1 1 auto; min-height: 0; overflow: auto; }
  .page.list .card.scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); }
}

/* Team, region and tag filters of the monitor list. */
.row.filters { gap: 8px; }
.row.filters select { width: auto; min-width: 9em; }

.quick-examples { margin-top: 4px; }
.quick-examples .tbl td { padding: 4px 8px; }

/* Channel form: message template preview and removable mention chips. */
.tpl-preview { padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border-strong); background: var(--panel-2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tpl-preview pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 13px; color: var(--muted); }
.tpl-preview.err { border-color: var(--critical); }
.linkbtn { border: 0; background: none; padding: 0 2px; cursor: pointer; color: inherit; font: inherit; line-height: 1; }
.linkbtn:hover { color: var(--critical); }

/* Channel form: the request a channel sends, in the service's own format. */
.req-preview { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--panel-2); min-width: 0; }
.req-preview summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.req-preview pre { margin: 8px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }

/* Bulk actions on the selected monitors, in one menu. */

/* Channel kind menu: search and sort above the list. */
.kind-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.kind-tools input[type=search] { flex: 1 1 140px; min-width: 0; }
.seg.sm button { padding: 3px 9px; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

/* ---- sidebars and shapes of the five themes ---- */
.side { color: var(--side-text, var(--text)); }
.side .brand, .side .nav a { color: var(--side-text, var(--text)); }
.side .brand .edition, .side .foot, .side .foot .host { color: var(--side-muted, var(--muted)); }
.side .nav a:hover { background: var(--side-hover, color-mix(in srgb, var(--text) 6%, transparent)); }
.side .nav a.on { background: var(--side-on, color-mix(in srgb, var(--accent) 16%, transparent)); color: var(--side-on-text, color-mix(in srgb, var(--link) 75%, var(--text)));
  box-shadow: inset 3px 0 0 var(--side-mark, var(--accent)); }
[dir="rtl"] .side .nav a.on { box-shadow: inset -3px 0 0 var(--side-mark, var(--accent)); }
.side .foot select, .side .foot .btn { color: var(--text); background: var(--panel); border-color: transparent; }
.card, .modal { border-radius: calc(var(--radius) + 2px); }
.btn, input, select, textarea, .chip, .search { border-radius: var(--radius); }

:root[data-theme="industrial"] .card > .hd h2, :root[data-theme="industrial"] .card > .hd h3, :root[data-theme="industrial"] .crumbs {
  text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
:root[data-theme="industrial"] .nav a { border-radius: 0; }
:root[data-theme="calm"] .btn, :root[data-theme="calm"] .chip { border-radius: 999px; }
:root[data-theme="calm"] .card > .bd:not(.flush) { padding: 18px 20px; }
:root[data-theme="perfume"] .crumbs, :root[data-theme="perfume"] .card > .hd h2, :root[data-theme="perfume"] h1, :root[data-theme="perfume"] .brand { font-family: Georgia, "Times New Roman", "Songti SC", "SimSun", serif; letter-spacing: .01em; }
:root[data-theme="passion"] .btn.primary { box-shadow: 0 4px 16px rgba(224, 36, 111, .35); }
:root[data-theme="passion"] .card { border-color: #45203f; }

/* Theme dots under the product name. */
.themes { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 2px 0 10px; }
.themes button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); padding: 0; cursor: pointer; background-clip: padding-box; }
.themes button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.themes button[aria-pressed="true"] { outline-color: var(--side-mark, var(--accent)); }
.shell.mini .themes { display: none; }

/* Monitor form: advanced options picked from a list. */
.adv-opts { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.adv-opts summary { cursor: pointer; font-weight: 600; }
.opt-row { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.notice-ed .notice-line { margin-top: 4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The signed-in name opens the account dialog. */
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; text-align: start; }
.linkish:hover { color: var(--side-on-text, var(--link)); }
/* Options that belong to the field above them sit indented under it. */
.subopts { margin-top: -6px; margin-inline-start: 12px; padding: 10px 14px; border-inline-start: 3px solid var(--border-strong); background: var(--panel-2); border-radius: 0 var(--radius) var(--radius) 0; display: flex; flex-direction: column; gap: 10px; }
[dir="rtl"] .subopts { border-radius: var(--radius) 0 0 var(--radius); }
.period-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.period-row input[type=time] { width: auto; }
.tbl td select { min-width: 6.5em; width: auto; }
/* Alerts not sent, per day: small columns under the total. */
.dbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 64px; align-items: end; margin-bottom: 12px; }
.dbar { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; height: 100%; gap: 3px; }
.dbar i { display: block; min-height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }
.dbar span { font-size: 11.5px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
button.sbar { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: start; width: 100%; cursor: pointer; }
button.sbar:disabled { cursor: default; }
button.sbar:not(:disabled):hover span { text-decoration: underline; }

/* A text field with common values to pick from beside it. */
.combo { display: flex; flex: 1; min-width: 0; }
.combo input { flex: 1; min-width: 0; border-start-end-radius: 0; border-end-end-radius: 0; }
.combo select { appearance: none; -webkit-appearance: none; width: 2.4em; flex: none; padding-inline: 0; text-align: center; text-align-last: center; border-inline-start: 0; border-start-start-radius: 0; border-end-start-radius: 0; background-image: none; cursor: pointer; color: var(--muted); }
.chart-note { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; }
.fail-key { display: inline-block; width: 6px; height: 12px; background: color-mix(in srgb, var(--critical) 45%, transparent); border-inline: 1px solid var(--critical); }
.side .foot .lang-zoom { gap: 6px; }
.side .foot .lang-zoom select:first-child { flex: 1; min-width: 0; }
.side .foot select.zoom { width: auto; flex: none; }
/* Sortable column headings. */
.tbl th .th-sort { all: unset; cursor: pointer; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; white-space: nowrap; }
.tbl th .th-sort:hover, .tbl th .th-sort.on { color: var(--text); }
.tbl th .th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.val-now { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 8px; }

/* A monitor named in a problem's text is a link: underlined, not told
   apart by colour alone. */
.inc .body a.name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* Settings › Styles and branding: the stored logo and icon. */
.brand-img img { height: 40px; max-width: 160px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; padding: 4px; background: var(--panel-2); }
.brand-img .brand-none { min-width: 6em; }
/* a site's name in a list row: long names are cut short */
.obs-site { display: inline-block; max-width: 11ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }


/* ---- layout polish: centered pages, dialogs, empty states ---- */
.page { max-width: 1280px; margin-inline: auto; width: 100%; }
.empty { text-align: center; margin-inline: auto; max-width: 36rem; }
.modal-wrap, .modal-host { display: grid; place-items: center; }
.search { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 280px; }
.search { position: relative; }
.md-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.md-preview { min-height: 12rem; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); }
.md-preview p { margin: 0 0 .6em; }
.md-preview h1, .md-preview h2, .md-preview h3 { margin: .4em 0 .4em; }
.md-preview ul { margin: .4em 0; padding-inline-start: 1.2em; }
.md-preview blockquote { margin: .4em 0; padding-inline-start: 12px; border-inline-start: 3px solid var(--accent); color: var(--muted); }
.notice-editor textarea[name="body"] { font-family: var(--mono); }
.themes.styles { gap: 6px; padding: 0; }
.themes.styles .style-swatch { width: auto; min-width: 22px; height: auto; overflow: visible; border-radius: 999px; padding: 4px 10px; font-size: 11px; line-height: 1.3; color: var(--accent-text); }
.themes.styles .style-swatch span { display: inline; }
.shell.mini .account-dock { display: flex; flex-direction: column; gap: 6px; }
.page-foot { display: flex; justify-content: center; padding: 8px 16px; }
/* Under a top menu, the node, run mode, language, zoom and the account sit
   in one quiet row. */
.page-foot .account-dock { display: flex; width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.page-foot .account-dock .row { flex-wrap: nowrap; gap: 8px; }
.page-foot .account-dock .row .spacer { display: none; }
.page-foot .account-dock select { width: auto; max-width: 8.5rem; padding: 2px 6px; font-size: 12.5px; }
.page-foot .account-dock .host { max-width: 14rem; }
.top-nav { display: flex; flex-wrap: nowrap; justify-content: center; gap: 4px; min-width: 0; max-width: 100%; overflow: hidden; }
.top-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.top-nav a.on { background: color-mix(in srgb, var(--link) 12%, transparent); font-weight: 600; }

/* Top-menu chrome: hide the sidebar rail (it still slides in on a phone). */
.shell.chrome-top { grid-template-columns: 1fr; }
.shell.chrome-top .side { display: none; }
.shell.chrome-top .side.open { display: flex; position: fixed; inset: 0 auto 0 0; z-index: 20; width: 240px; box-shadow: 18px 0 40px rgba(0,0,0,.25); }
.shell.chrome-top .top { flex-wrap: wrap; justify-content: center; }

.shell.chrome-side .top-nav, .shell.chrome-side .page-foot { display: none; }

/* Node name sits above run mode in the sidebar foot. */
.side .foot .host { order: 0; }
.side .foot .live { order: 1; }
.side .foot .account-dock { order: 2; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.top-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; margin-inline-end: 8px; }
.top-brand img { width: 36px; height: 36px; }
.top-brand .edition { font-size: 11px; }
.themes.styles { flex-wrap: wrap; justify-content: center; max-width: 100%; }
.themes.styles .style-swatch { white-space: nowrap; }

/* Chrome overrides must beat style sheets loaded after this file. */
:root[data-chrome="top"] .shell,
:root[data-chrome="top"] .shell.mini { grid-template-columns: 1fr !important; }
:root[data-chrome="top"] .side { display: none !important; }
:root[data-chrome="top"] .side.open { display: flex !important; position: fixed; inset: 0 auto 0 0; z-index: 40; width: 240px; box-shadow: 18px 0 40px rgba(0,0,0,.25); }
:root[data-chrome="top"] .main { margin-inline-start: 0; }
.shell.chrome-top .page-foot { margin-top: auto; position: static; background: var(--panel); border-top: 1px solid var(--border); }
@media (min-width: 861px) {
  .shell.chrome-top .top > .btn.sm:first-child { display: none; }
}

/* The colour wheel on the logo says that clicking it changes the colours. */
.logo-cycle { position: relative; }
.logo-cycle::after { content: ""; position: absolute; inset-inline-end: -2px; inset-block-end: -2px; width: 12px; height: 12px; border-radius: 50%;
  background: conic-gradient(#0b64d8, #a8566b, #e0a526, #f28c28, #e0246f, #1565c0); border: 2px solid var(--panel); }

.verdict-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }

/* Under a top menu the page is centred under it (the layouts with a
   sidebar keep the page at the menu's side). */
:root[data-chrome="top"] .page { margin-inline: auto; }
/* Classic monitor list density and toolbar styles */
.mon-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.mon-head .tabs { margin-bottom: 0; flex-wrap: nowrap; }
/* What is done to the picked monitors takes the place of the add buttons at the end of the top row, on one line: wider than the room, it scrolls and never wraps. */
.mon-bulk { display: flex; gap: 6px; flex-wrap: nowrap; white-space: nowrap; overflow-x: auto; min-width: 0; max-width: 100%; align-items: center; padding: 6px 10px; border-radius: var(--r, 8px); background: var(--panel-2, rgba(127, 127, 127, .08)); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.page.list .tbl th, .page.list .tbl td { padding: 7px 10px; }
.page.list .tbl th.sel, .page.list .tbl td.sel { padding-inline: 10px 4px; width: 28px; }
.mon-name { max-width: 360px; min-width: 160px; }
.mon-name .sub { line-height: 1.3; margin-top: 1px; }
.mon-beats { min-width: 112px; width: 128px; }
.page.list .tbl td.act { padding-inline: 6px 10px; }
@media (max-width: 1120px) {
  .mon-name { max-width: 240px; }
  .page.list .tbl th, .page.list .tbl td { padding: 6px 8px; }
}

/* ---- sidebar foot: one aligned block, every control 32px tall ---- */
.side .foot { gap: 0; padding: 10px 10px 12px; border-top: 1px solid var(--side-line, color-mix(in srgb, currentColor 14%, transparent)); }
.side .foot .host { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--side-text, var(--text)); }
.side .foot .live { display: flex; align-items: center; gap: 6px; margin: 2px 0 10px; font-size: 12.5px; line-height: 1.3; color: var(--side-muted, var(--muted)); text-decoration: none; }
.side .foot .account-dock { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side .foot .lang-zoom, .side .foot .acct-row { display: contents; }
.side .foot .account-dock > *, .side .foot .lang-zoom > *, .side .foot .acct-row > * { min-width: 0; width: 100%; height: 34px; margin: 0; box-sizing: border-box; font-size: 13px; }
.side .foot .lang-zoom select, .side .foot .lang-zoom select.zoom { padding: 0 8px; }
.side .foot .acct-user { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; background: var(--panel); border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); }
.side .foot .acct-user:hover { color: var(--link); }
.side .foot .acct-av { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 700; }
.side .foot .acct-out { padding: 0 8px; font-size: 13px; justify-content: center; }
.shell.mini .acct-user .ellipsis, .shell.mini .acct-out { display: none; }
.page-foot .account-dock .acct-row { display: flex; align-items: center; gap: 8px; }
.page-foot .acct-user { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; font: inherit; color: inherit; }
.page-foot .acct-av { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 700; }
.mon-bulkrow { display: flex; justify-content: flex-end; }
.mon-bulkrow > .mon-bulk { max-width: 100%; }

/* The sidebar stands apart from the page: its own tint, a clear edge, and a rule under the logo. */
[data-style="classic"] .shell.chrome-side > .side { border-inline-end: 1px solid var(--border-strong); box-shadow: 2px 0 10px rgba(20, 40, 74, .06); }
[data-style="classic"] .shell.chrome-side > .side .brand { padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid var(--border-strong); }
.search select.sort { width: auto; border: 0; background: none; padding: 0 2px; color: var(--muted); font-size: 13px; }


.search-hint { position: absolute; z-index: 30; inset-block-start: calc(100% + 6px); inset-inline: 0; margin: 0; padding: 6px; list-style: none; background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .14); }
.search-hint button { display: grid; grid-template-columns: 9.5rem 1fr; gap: 10px; align-items: baseline; width: 100%; padding: 6px 10px; border: 0; background: none; border-radius: 8px; text-align: start; cursor: pointer; font: inherit; font-size: 13px; color: var(--muted); }
.search-hint button:hover { background: var(--accent-soft); }
.search-hint code { font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; color: var(--link); }

/* Detail pass: the search box keeps its place whatever the title; row actions and file pickers get proper spacing. */
:root[data-style="classic"] .top .search { margin-inline-start: auto; }
td > .btn.sm + .btn.sm, td > .btn.sm + select.btn.sm { margin-inline-start: 6px; }
.kv { align-items: baseline; }
.kv dd.mono { line-height: inherit; }
input[type="file"] { max-width: 100%; font-size: 13px; color: var(--muted); }
input[type="file"]::file-selector-button { margin-inline-end: 10px; padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--accent-soft); }
@media (max-width: 860px) { td.right.nowrap { white-space: normal; } td > .btn.sm { margin-block: 2px; } }

/* A short screen: the sidebar fits. The logo sits beside the name, the foot is two rows of small controls. */
.icon-btn { display: inline-grid; place-items: center; width: 100%; height: 100%; padding: 0; border: 1px solid transparent; border-radius: var(--radius); background: var(--panel); color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--accent-soft); color: var(--link); }
.icon-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.side .foot .account-dock { grid-template-columns: minmax(0, 1fr) 34px; gap: 6px; }
.side .foot .account-dock > *, .side .foot .lang-zoom > *, .side .foot .acct-row > * { height: 30px; }
.side .foot .lang-zoom > * { grid-column: auto; }
.side .foot .lang-zoom select { font-size: 12.5px; }
.side .foot .acct-user { font-size: 12.5px; }
.side .foot .live { margin: 2px 0 8px; }
.page-foot .icon-btn { width: 28px; height: 28px; }
[data-style="classic"] .side .brand { flex-direction: row; align-items: center; gap: 10px; padding: 2px 6px 12px; margin-bottom: 6px; text-align: start; font-size: 16px; }
[data-style="classic"] .side .brand img { width: 40px; height: 40px; }
[data-style="classic"] .side .brand .edition { font-size: 12px; margin-top: 0; }
[data-style="classic"] .side .nav a { padding-block: 6px; }
@media (max-height: 720px) { [data-style="classic"] .side .nav a { padding-block: 4px; } .side .foot { padding-block: 6px 8px; } }
/* A long node name (a cloud host name) takes two lines in the sidebar
   instead of being cut after twenty letters; the whole name is the tooltip. */
.side .foot .host.ellipsis { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Monitor list on a phone: one card per monitor. The status, uptime and
   Edit share the first line, the name the second, and the site marks,
   type, group and target wrap below it instead of being cut off. */
@media (max-width: 640px) {
  .tbl.mon-table, .tbl.mon-table tbody { display: block; }
  .tbl.mon-table thead tr { display: flex; align-items: center; }
  .tbl.mon-table thead th:not(.sel):not(:nth-child(2)):not(:nth-child(3)) { display: none; }
  .tbl.mon-table tbody tr { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; align-items: center; column-gap: 8px; padding: 8px 10px 10px 0; border-bottom: 1px solid var(--border); }
  .tbl.mon-table tbody td, .tbl.mon-table tbody tr:nth-child(even) td { border: 0; padding: 0; background: transparent; }
  .tbl.mon-table tbody tr td.act, .tbl.mon-table tbody tr:nth-child(even) td.act, .tbl.mon-table tbody tr.critical td.act, .tbl.mon-table tbody tr.click:hover td.act { background: transparent; }
  .tbl.mon-table tbody tr:nth-child(even) { background: var(--stripe); }
  .tbl.mon-table td.sel { grid-row: 1 / span 2; grid-column: 1; align-self: start; padding: 2px 0 0 10px; }
  .tbl.mon-table td.mon-st { grid-row: 1; grid-column: 2; }
  .tbl.mon-table td.mon-up { grid-row: 1; grid-column: 3; }
  .tbl.mon-table td.act { grid-row: 1; grid-column: 4; }
  .tbl.mon-table td.mon-name, .tbl.mon-table tbody tr[class] td.mon-name { grid-row: 2; grid-column: 2 / 5; padding: 6px 0 0; min-width: 0; }
  .tbl.mon-table td.mon-name .sub { white-space: normal; overflow: visible; overflow-wrap: anywhere; line-height: 1.8; }
  .tbl.mon-table tbody tr.critical, .tbl.mon-table tbody tr.unknown { box-shadow: inset 3px 0 0 var(--critical); }
  .tbl.mon-table tbody tr.unknown { box-shadow: inset 3px 0 0 var(--unknown); }
}

/* The board lists the message under the title, clamped so a long notice does not take the page. */
.tbl .notice-body { margin-top: 4px; max-height: 4.5em; overflow: hidden; color: var(--muted); line-height: 1.45; }
.tbl .notice-body p, .tbl .notice-body ul, .tbl .notice-body blockquote { margin: 0 0 .25em; }
.tbl .notice-body p:last-child { margin: 0; }
.tbl .notice-body h1, .tbl .notice-body h2, .tbl .notice-body h3 { margin: 0 0 .2em; font-size: inherit; }

/* Top chrome: one row of menu entries; overflow goes into More. */
.shell, .main, .shell.chrome-top .top { min-width: 0; max-width: 100%; }
.shell.chrome-top .top { width: 100%; box-sizing: border-box; overflow: hidden; }
.top-nav { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 2px; min-width: 0; max-width: 100%; width: 100%; overflow: hidden; box-sizing: border-box; }
.top-nav > a, .top-nav-more-btn { flex: 0 0 auto; white-space: nowrap; }
.top-nav > a.is-overflow, .top-nav > .top-nav-more.is-overflow { display: none !important; }
.top-nav-more { position: relative; flex: none; }
.top-nav-more-btn { padding: 8px 12px; border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; border-radius: 3px; }
.top-nav-more.open .top-nav-more-btn, .top-nav-more.on .top-nav-more-btn { background: var(--side-on, var(--accent-soft)); color: var(--side-on-text, var(--text)); }
.top-nav-menu { position: absolute; inset-block-start: calc(100% + 4px); inset-inline-end: 0; z-index: 20; min-width: 12rem; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); display: flex; flex-direction: column; gap: 2px; }
.top-nav-menu a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 4px; text-decoration: none; color: var(--text); white-space: nowrap; }
.top-nav-menu a:hover, .top-nav-menu a.on { background: var(--side-on, var(--accent-soft)); color: var(--side-on-text, var(--text)); }

/* The action column (Edit, …) stays visible when the table is wider
   than the card: it sticks to the end and the wrap scrolls sideways. */
.tbl-wrap { overflow-x: auto; max-width: 100%; }
.page.list .card, .page.list .card .bd, .main { min-width: 0; }
.tbl td.act, .tbl th.act { position: sticky; inset-inline-end: 0; z-index: 2; background: var(--panel); white-space: nowrap; box-shadow: -8px 0 8px -8px rgba(0,0,0,.2); }
.tbl thead th.act { z-index: 3; background: var(--panel-2); }
.tbl td.mon-name, .tbl td.mon-name .name { max-width: 28rem; overflow: hidden; text-overflow: ellipsis; }
/* The bars keep their height when the list below them is long. */
.main > .top, .main > .page-foot { flex-shrink: 0; }

/* v3.2.13: one layout for the monitor list in every language. The columns
   that hold short data (status, latency, uptime, changed, Edit) take what
   their data needs, and a header wraps onto a second line instead of
   widening its column. The monitor column takes the rest and cuts its
   long second line with an ellipsis (the full text is the cell's title).
   The table then fits its card without a sideways scroll at any width
   where the columns are shown. Nothing here depends on the language. */
.tbl.mon-table th { white-space: nowrap; vertical-align: bottom; }
.tbl.mon-table th .th-sort { white-space: nowrap; text-align: inherit; }
.tbl.mon-table th.act { white-space: nowrap; }
.tbl.mon-table td.mon-name { width: 100%; max-width: 0; min-width: 160px; overflow: hidden; }
.tbl.mon-table td.mon-name .row { min-width: 0; }
.tbl.mon-table td.mon-name .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A search box and a brand line shorter than their text show an ellipsis, not a cut word. */
.search input, .search input::placeholder { text-overflow: ellipsis; }
.search input { min-width: 0; }
.search select.sort { min-width: 0; max-width: 11em; text-overflow: ellipsis; }
.brand > div:last-child { min-width: 0; }
.brand .edition { display: inline-flex; align-items: baseline; min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; }
.brand .edition-label { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 auto; }
.brand .edition-ver { flex: 0 0 auto; letter-spacing: 0.02em; }
/* Narrower than 1120px the list drops its "changed" column for every language alike
   (the time is the status cell's tooltip), the heartbeat bars get a little narrower and the monitor column may be too. */
@media (max-width: 1120px) {
  .tbl.mon-table .hide-md { display: none; }
  .tbl.mon-table td.mon-name { min-width: 80px; }
  .mon-beats { min-width: 72px; width: 80px; }
  .tbl.mon-table .beats { min-width: 72px; gap: 1px; }
  .tbl.mon-table .beats i { min-width: 1px; }
}
