/* Small alignment tweaks on top of the old stylesheets (owner, 19 Nov 2026: "feel free to make minor symetrical tweaks like, making things line up better").
   The postbox and the nodes table share one block as wide as the table, so their right edges line up.
   The table keeps the old stylesheet's fixed 1232px (#icmp_table in 112/Styles.css), so its columns are sized exactly as today's;
   the block takes that width, and the postbox and the key's paragraphs under the table add nothing to it (width 0) and fill it (min-width 100%).
   (Build 4d, 21 Nov 2026: letting the table take its natural width made it 1609px, wider than a 1440px screen, with every column wider than today's.) */
.live-block {
    width: max-content;
}
.live-block .events-bar,
.live-block #icmp_table > p {
    box-sizing: border-box;
    width: 0;
    min-width: 100%;
}
/* The green buttons on Members and the server admin page sit level with the boxes beside them (build 5c). */
.greenButton.beside-boxes {
    height: auto;
    margin: 0 0 0 2px;
}

/* Long history tables (owner, 30 Nov 2026): the header row stays on screen while scrolling, and a back-to-top button replaces Jump Top and Jump Bottom. */
tr.sticky-head > th,
tr.sticky-head > td {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-2);
    box-shadow: inset 0 -2px 0 var(--border-strong);
}
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1500;
    padding: 8px 14px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.back-to-top[hidden] { display: none; }
.history-nav { line-height: 1.9; }
.history-nav .label { font-weight: bold; margin-right: 6px; }
body.fail-loud tr.sticky-head > th,
body.fail-loud tr.sticky-head > td { top: 50px; }
/* The postbox and the nodes table read as one stack (owner, 30 Nov 2026: "they don't fit next to one another cleanly"):
   both square, both framed by the same line, with one even gap; the key under the table takes the table's full width. */
.events-bar {
    background: var(--surface);
    border-color: var(--border);
}
.live-block .events-bar {
    border-radius: 0;
    margin-top: 0;
    margin-bottom: 8px;
    /* The postbox is a feed, the table is the monitor (owner, 30 Nov 2026: they "mentally collide"): the postbox
       is a panel with the secondary colour down its edge, the table keeps its own grid and frame. */
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 5px solid var(--secondary);
}
.live-block #icmp_table > table {
    outline: 1px solid var(--border-strong);
}
/* Long node names (pinescore.com, 3 Dec 2026: Virtue's average 45 characters pushed the table to 1349px, past the
   1232px frame). The table holds the frame's width; every other column keeps its natural width (width 1px) and the
   name column takes what is left, ending a long name with "..." (the owner chose this over wrapping or a wider frame).
   The full name is the cell's tooltip. */
#icmp_table > table { width: 100%; }
#icmp_table > table > :is(thead, tbody) > tr > td { width: 1px; }
#icmp_table > table > :is(thead, tbody) > tr > td:nth-child(2) { width: auto; }
#icmp_table td.node-name { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-block #icmp_table table.key {
    width: 100%;
}
.live-block #icmp_table .key-legend {
    width: 100%;
}
/* The key's notes sit in the key itself, as rows, not loose under it. */
table.key tr.key-note td {
    white-space: normal;
}

/* The frame (owner, 1 Dec 2026): logo left and menu right in one header as wide as the table, the status strip
   under it, and a footer strip of the same width, all on the colour tokens. The logo is concept D (partials/brand). */
@font-face { font-family: "Lato"; font-weight: 400; font-display: swap; src: url("/fonts/lato-regular.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-display: swap; src: url("/fonts/lato-bold.woff2") format("woff2"); }
.site-header {
    width: 1232px;
    height: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 10px;
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { flex: none; }
.brand-text { display: flex; flex-direction: column; font-family: "Lato", Helvetica, Arial, sans-serif; }
.brand-word { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -0.01em; color: var(--text); }
.brand-word span { font-weight: 400; color: var(--text-muted); }
.brand-tag { font-size: 12.5px; line-height: 1.3; letter-spacing: 0.04em; color: var(--text-muted); margin-top: 3px; }
.site-menu { float: none; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-muted); }
.site-menu form { display: inline; }
.site-menu form[hidden] { display: none; }
.site-menu a { margin-left: 12px; text-decoration: none; }
.site-menu a:hover { text-decoration: underline; }
.site-user { color: var(--text-muted); }
body:not(.icmp-fullscreen) .content #globalStatusStrip { width: 1232px; margin: 6px 0 10px; }
/* Let the body grow with the table so the sticky bars can follow it. */
body.icmp-fullscreen { height: auto; min-height: 100%; }
/* Keep the strip in the layout so its actual height clears Latest events. */
body.icmp-fullscreen #globalStatusStrip {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-sizing: border-box;
    width: min(1232px, calc(100vw - 30px));
    margin: 0 0 10px;
    padding: 4px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
body.icmp-fullscreen.fail-loud #globalStatusStrip { position: static; }
#healthMetrics { font-size: 13px; }
.site-footer { background: none; color: var(--text-muted); text-align: left; }
.site-footer p { width: 1232px; margin: 24px 0 0; padding: 10px 0 14px; border-top: 1px solid var(--border); font-size: 12.5px; line-height: 1.6; }
.site-footer-time { float: right; }
/* Centred (owner, 1 Dec 2026): the whole frame is one 1232px column in the middle of wide screens. #wrap stays a
   table (the old sticky-footer technique) and grows past 1232px if a page is wider; narrower windows keep the 15px
   left margin and scroll as before. */
#wrap {
    width: 1232px;
    margin: 0 auto;
}

/* Type (owner, 1 Dec 2026: "the fonts don't even look unified"): one family and the four sizes from tokens.css. */
body, input, select, textarea, button, a.powerful, .events-time, .events-progress, .events-ip-address, code { font-family: var(--font); }
body { font-size: var(--text-body); }
a.powerful { font-size: var(--text-body); font-weight: 700; }
#pageTitleBanner h2, h2 { font-size: var(--text-heading); font-weight: 700; }
h3 { font-size: calc(var(--text-ui) + 2px); font-weight: 700; }
.site-menu, .greenButton, .redButton, input[type=submit], button { font-size: var(--text-ui); }
#healthMetrics, .site-footer p, .brand-tag { font-size: var(--text-small); }
.events-bar-title, .events-bar-filter, .events-bar-link, .events-control, .events-search, .events-load-more { font-size: var(--text-ui); }
.events-item, .events-time, .events-progress, .events-ip, .events-ip-address, .events-empty, .events-note { font-size: var(--text-body); }
.events-badge, .events-chip, .events-chip-group, .events-status-message { font-size: var(--text-small); }
.events-time, .events-progress, #icmp_table td { font-variant-numeric: tabular-nums; }

/* The key: one line of swatches, "more" opens the full key (partials live/key). */
.key-legend { margin-top: 10px; }
.key-legend > summary { list-style: none; cursor: pointer; line-height: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 10px; border: 1px solid var(--border); background: var(--surface); font-size: var(--text-small); color: var(--text-muted); }
.key-legend > summary::-webkit-details-marker { display: none; }
.key-label { font-weight: 700; color: var(--text); }
.key-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.swatch.yellow { background: yellow; }
.key-more { margin-left: auto; color: var(--link); display: inline-flex; align-items: center; gap: 6px; }
.key-more .when-open { display: none; }
.key-legend[open] .key-more .when-open { display: inline; }
.key-legend[open] .key-more .when-closed { display: none; }
/* The chevron is a drawn box, not a text arrow: a symbol missing from Lato came from a taller fallback font and made the bar grow when opened. */
.key-more::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.key-legend[open] .key-more::after { transform: translateY(2px) rotate(-135deg); }
.key-legend > table.key { margin-top: 6px; }

/* Keep the scrollbar's space reserved: when opening the key makes the page tall enough to scroll, a scrollbar appearing
   narrowed the window and shifted the centred page sideways (owner, 1 Dec 2026). */
html { scrollbar-gutter: stable; }

/* The postbox's header (owner, 1 Dec 2026): a band of its own over the entries, like the table's header row; the title
   is a title (bold text and a live dot), not a red button; every control is the same height and shape. */
.live-block .events-bar { padding: 0 0 10px; }
.events-bar-header {
    margin: 0 0 10px;
    padding: 8px 12px;
    min-height: 30px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.events-bar-items, .events-bar > .events-chip-group { margin-left: 12px; margin-right: 12px; }
.events-bar-heading { gap: 12px; }
.events-bar-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: none;
    color: var(--text);
    font-weight: 700;
    font-size: var(--text-ui);
    border-radius: 0;
}
.events-live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.events-bar-filter-group, .events-bar-link {
    box-sizing: border-box;
    height: 28px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface);
    overflow: hidden;
}
.events-bar-filter { height: 100%; padding: 0 11px; display: inline-flex; align-items: center; }
.events-bar-link {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    font-weight: 600;
    text-decoration: none;
    color: var(--link);
}
.events-bar-link:hover { background: var(--surface-3); text-decoration: none; }
.events-bar-filter { color: var(--accent); border-radius: 0; }
.events-bar-filter + .events-bar-filter { border-left: 1px solid var(--border-strong); }
.events-bar-filter-active { background: var(--primary); color: #fff; }

/* Status rows (owner, 1 Dec 2026: "contrast and clarity is key"; audited with every row colour and every kind of text,
   both themes, WCAG AA 4.5:1). Each status keeps its hue as one solid fill in both themes (the two score pinks were
   see-through and came out differently on each page colour); text and links on a fill are near-black (links underline only on hover, owner's call);
   red and green emphasis on a fill becomes a small solid badge with white text, since red text cannot read on a red row. */
:root { --status-text: #161616; --badge-up: #0b5a24; --badge-down: #8f1212; --row-up: #0a5c2c; --row-down: #a00000; }
html[data-theme="dark"] { --row-up: var(--success); --row-down: #ff9a92; }
tr.pink td, .swatch.pink { background-color: #e3a6d4; }
tr.darkerpink td, .swatch.darkerpink { background-color: #b3a7e6; }
:is(tr.red, tr.onedayred, tr.overonedayred, tr.orange, tr.green, tr.transition, tr.pink, tr.darkerpink, tr[style*="background-color: yellow"], tr[bgcolor]) td { color: var(--status-text); }
:is(tr.red, tr.onedayred, tr.overonedayred, tr.orange, tr.green, tr.transition, tr.pink, tr.darkerpink, tr[style*="background-color: yellow"], tr[bgcolor]) a { color: var(--status-text) !important; text-decoration: none; }
:is(tr.red, tr.onedayred, tr.overonedayred, tr.orange, tr.green, tr.transition, tr.pink, tr.darkerpink, tr[style*="background-color: yellow"], tr[bgcolor]) a:hover { text-decoration: underline; }
/* On ordinary rows the emphasis stays coloured text, in shades that read on the table's own grey. */
#icmp_table :is(font[color="red"], span[style*="color: red"], thead a[style*="color: red"]) { color: var(--row-down) !important; }
#icmp_table :is(font[color="green"], span[style*="color: green"], thead a[style*="color: green"], thead span[style*="color: green"]) { color: var(--row-up) !important; }
:is(#icmp_table, body) :is(tr.red, tr.onedayred, tr.overonedayred, tr.orange, tr.green, tr.transition, tr.pink, tr.darkerpink, tr[style*="background-color: yellow"], tr[bgcolor]) :is(font[color="red"], span[style*="color: red"]) { color: #fff !important; background: var(--badge-down); padding: 0 4px; border-radius: 3px; }
:is(#icmp_table, body) :is(tr.red, tr.onedayred, tr.overonedayred, tr.orange, tr.green, tr.transition, tr.pink, tr.darkerpink, tr[style*="background-color: yellow"], tr[bgcolor]) :is(font[color="green"], span[style*="color: green"]) { color: #fff !important; background: var(--badge-up); padding: 0 4px; border-radius: 3px; }
/* Light theme: plain red and green text anywhere else (report headers, the 3-year log, notes) in shades that read on
   white and on the table's grey (owner, 1 Dec 2026, whole-page audit). Status-row badges keep their own white text. */
html:not([data-theme="dark"]) :is(font[color="red"], [style*="color: red"]):not(.fail-loud-banner) { color: var(--row-down) !important; }
html:not([data-theme="dark"]) :is(font[color="green"], [style*="color: green"]) { color: var(--row-up) !important; }
