:root {
  color-scheme: light;
  --ink: #192723;
  --quiet: #52645c;
  --canvas: #f2f5f1;
  --paper: #fff;
  --line: #cdd8d1;
  --pine: #18302b;
  --green: #176344;
  --red: #963329;
  --amber: #75490b;
  font: 100%/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #227553; outline-offset: 3px; }
::selection { background: #b8e8ce; color: #142b24; }
.wrap { width: min(100% - 40px, 870px); margin-inline: auto; }
.top { background: var(--pine); color: #f1faf5; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: .91rem; font-weight: 680; }
.brand img { margin-right: 3px; flex: 0 0 auto; }
.brand span { color: #9bc9b6; }
.exit { min-height: 44px; border: 0; border-radius: 5px; background: transparent; color: #e3f6ed; padding: 0 8px; }
.exit:hover { background: #294b41; }
.exit:focus-visible { outline-color: #c2ecd8; }
.dashboard { padding-block: clamp(20px, 4vw, 40px) 32px; }
.heading-line { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
h1 { margin: 0; font-size: clamp(2.1rem, 6vw, 3.1rem); line-height: 1.05; letter-spacing: -.035em; }
.map-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--quiet); font-size: .875rem; }
.map-picker select { max-width: 100%; min-height: 44px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; font-weight: 650; }
.map-picker select:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.fresh-line { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.fresh-line p { margin: 0; font-size: .88rem; color: var(--quiet); }
.signal { width: 8px; height: 8px; border-radius: 50%; background: #7b887f; flex: 0 0 auto; }
.signal.ready { background: var(--green); }
.signal.late { background: var(--amber); }
.refresh { display: grid; place-items: center; min-width: 44px; min-height: 44px; background: none; color: var(--green); border: 0; border-radius: 7px; }
.refresh:hover { background: #e1ebe4; }
.refresh-feedback { margin: 0 0 8px; color: var(--quiet); font-size: .875rem; }
.notice { padding: 11px 14px; margin: 0 0 14px; border: 1px solid #dbc69e; border-radius: 9px; font-size: .91rem; }
.notice-warn { color: #5f3a07; background: #fcf2db; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 13px; }
.metrics button { display: flex; flex-direction: column; align-items: start; gap: 4px; padding: 8px clamp(4px, 2vw, 16px); min-height: 64px; min-width: 0; border: 0; color: var(--ink); background: var(--paper); text-align: left; position: relative; }
.metrics button:first-child { border-radius: 12px 0 0 12px; }
.metrics button:last-child { border-radius: 0 12px 12px 0; }
.metrics button:focus-visible { z-index: 1; outline-offset: 0; }
.metrics button[aria-pressed="true"] { background: #e0ede5; box-shadow: inset 0 -3px var(--green); }
.metrics button:hover { background: #eaf2ec; }
.metrics span { font-size: clamp(.69rem, 2.9vw, .88rem); font-weight: 650; }
.metrics strong { font-size: clamp(1.35rem, 5vw, 1.85rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.metrics [data-filter="down"] strong { color: var(--red); }
.metrics [data-filter="up"] strong { color: var(--green); }
.search-box { position: relative; display: flex; align-items: center; margin-top: 16px; }
.search-box svg { position: absolute; left: 13px; pointer-events: none; color: var(--quiet); }
.search-box input { width: 100%; min-height: 44px; padding: 8px 12px 8px 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
input::placeholder { color: var(--quiet); opacity: 1; }
.result-count { margin: 12px 0 4px; color: var(--quiet); font-size: .84rem; }
.section-title { font-size: .98rem; margin: 16px 0 8px; }
.device-list { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.device + .device { border-top: 1px solid var(--line); }
.device summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) max-content 12px; align-items: center; gap: 8px; min-height: 64px; padding: 8px 12px; cursor: pointer; }
.device summary::-webkit-details-marker { display: none; }
.device summary:focus-visible { outline-offset: -3px; }
.device summary:hover { background: #f6f9f6; }
.device[open] summary { background: #f6f9f6; }
.identity { min-width: 0; overflow-wrap: anywhere; }
.identity strong, .identity small { display: block; }
.identity strong { font-size: .96rem; line-height: 1.26; }
.identity small, .when { color: var(--quiet); font-size: .77rem; font-variant-numeric: tabular-nums; }
.status-side { display: grid; justify-items: end; gap: 2px; }
.status-label { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 650; color: var(--quiet); white-space: nowrap; }
.status-label::before { content: ""; flex: 0 0 7px; height: 7px; background: currentColor; border-radius: 50%; }
.status-label.down { color: var(--red); }
.status-label.up { color: var(--green); }
.status-label.checking { color: var(--amber); }
.device-arrow { width: 7px; height: 7px; border-right: 1.6px solid var(--quiet); border-bottom: 1.6px solid var(--quiet); transform: rotate(-45deg); }
.device[open] .device-arrow { transform: rotate(45deg); }
.device-body { padding: 4px 12px 12px; color: var(--quiet); font-size: .88rem; }
.device-body p, .device-body ul { margin: 8px 0 0; }
.device-body ul { padding-left: 18px; }
.show-on-map { min-height: 44px; margin-top: 12px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--green); font-weight: 600; }
.show-on-map:hover { background: #eaf0ec; }
.help { font-size: .86rem; color: var(--quiet); margin: 18px 0 0; max-width: 65ch; }
.empty { padding: 17px 14px; border: 1px dashed var(--line); border-radius: 9px; color: var(--quiet); }
.login-layout { padding-block: clamp(28px, 10vh, 96px) 30px; }
.login-panel { width: min(100%, 490px); margin-inline: auto; background: var(--paper); border-radius: 15px; padding: clamp(19px, 5vw, 34px); border: 1px solid var(--line); }
.login-panel h1 { font-size: clamp(1.78rem, 6vw, 2.55rem); }
.intro { color: var(--quiet); margin: 13px 0 21px; }
.login-form { display: grid; gap: 6px; }
.login-form label { font-weight: 660; }
.login-form input { width: 100%; border-radius: 8px; border: 1px solid #a6b5ac; padding: 8px 11px; min-height: 48px; margin-bottom: 8px; color: var(--ink); background: var(--paper); }
.primary { min-height: 48px; margin-top: 3px; border: 0; border-radius: 8px; color: #fff; background: #1c6047; font-weight: 720; }
.primary:hover { background: #154a37; }
.login-form .help { margin-top: 7px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.dashboard.map-view { width: min(100% - 40px, 1660px); }
.dashboard.map-view .metrics, .dashboard.map-view .search-box { max-width: 870px; }
.view-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0; }
.view-picker, .map-controls { display: flex; align-items: center; gap: 4px; }
.view-picker button, .map-controls button { min-height: 44px; min-width: 44px; padding: 0 8px; border: 0; color: var(--quiet); background: transparent; font-size: .875rem; font-weight: 600; white-space: nowrap; }
.view-picker button { border-bottom: 2px solid transparent; }
.view-picker button[aria-pressed="true"] { color: var(--green); border-bottom-color: var(--green); }
.view-picker button:hover, .map-controls button:hover { color: var(--green); background: #eaf0ec; }
.map-controls button { border-radius: 8px; }
.map-controls output { min-width: 36px; text-align: center; color: var(--quiet); font-size: .875rem; font-variant-numeric: tabular-nums; }
.map-scroll { position: relative; overflow: auto; max-height: min(75vh, 950px); min-height: 220px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.map-scroll:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
#map-size { position: relative; overflow: hidden; }
#map-stage { position: absolute; inset: 0 auto auto 0; width: 0; height: 0; transform-origin: top left; color: #111; }
.map-node, .map-heading { position: absolute; width: max-content; transform: translate(-50%, -50%); }
.map-heading { margin: 0; font: 400 36px/1.1 system-ui, sans-serif; white-space: nowrap; }
.map-network { padding: 4px 8px; border: 1px solid #859a91; border-radius: 4px; background: #e5ede9; font: 600 12px/1.3 system-ui, sans-serif; }
.map-link { position: absolute; height: 1px; background: #7c8a85; transform-origin: left center; pointer-events: none; }
.map-node { display: grid; justify-items: center; gap: 1px; min-height: 47px; min-width: 40px; max-width: 200px; padding: 4px 6px 5px; border: 0; border-radius: 5px; color: #111; text-align: center; font: 11px/1.15 Verdana, system-ui, sans-serif; background: linear-gradient(#fafafa, #bdbdbd); }
.map-node.up { background: linear-gradient(#f9fffa, #02d102); }
.map-node.down { background: linear-gradient(#fffafa, #ff0708); }
.map-node.checking { background: linear-gradient(#fffdf5, #ffd668); }
.map-node.dimmed { opacity: .16; }
.map-stale .map-node { filter: saturate(.45); }
.map-node:hover, .map-node[aria-pressed="true"] { z-index: 1; outline: 2px solid #18302b; outline-offset: -2px; }
.map-node:focus-visible { z-index: 2; }
.map-node img { width: 25px; height: 25px; object-fit: contain; }
.map-icon { position: relative; width: 20px; height: 16px; margin: 4px 0 5px; border: 2px solid #666; border-radius: 2px; background: #f0f2f1; }
.map-icon.computer::after { content: ""; position: absolute; width: 11px; height: 3px; left: 3px; bottom: -5px; background: #666; }
.map-icon.server { width: 15px; height: 21px; margin: 1px 0 3px; border-color: #383d3b; background: #656a68; box-shadow: 3px 1px #a6aaa8; }
.map-icon.server::after { content: ""; position: absolute; left: 2px; right: 2px; top: 4px; height: 2px; background: #d6dfd9; box-shadow: 0 5px #d6dfd9; }
#map-selection { margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
#map-selection summary { border-radius: 7px; }
#map-selection .device[open] summary { border-radius: 7px 7px 0 0; }
@media (max-width: 400px) {
  .wrap, .dashboard.map-view { width: calc(100% - 24px); }
}
