:root {
  color-scheme: dark;
  --bg: #0b1010; --panel: #121b1a; --edge: #2b3936; --text: #edf5f1; --muted: #adbfba;
  --mint: #84ecb0; --up: #54ca88; --mixed: #f1bf62; --down: #f17c80; --unknown: #65726e;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: Inter, "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 85% 0%, #12231f 0, transparent 48%); }
button, select, a { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
[hidden] { display: none !important; }
.status-shell { width: min(1152px, calc(100% - clamp(32px, 10vw, 144px))); margin: auto; padding-bottom: 25px; }
.status-header { height: 78px; display: flex; align-items: center; gap: 15px; }
.status-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.status-brand img { border-radius: 7px; object-fit: contain; }
.status-brand strong { font-size: 21px; letter-spacing: -.04em; }
.brand-divider { width: 1px; height: 18px; background: #40504b; }
.brand-context { color: var(--muted); font-size: 14px; }
#refreshStatus { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 8px 15px; color: #d9e6df; background: #141e1c; border: 1px solid #3b4c45; border-radius: 8px; font-size: 13px; font-weight: 650; }
#refreshStatus:hover:not(:disabled), .hour-picker select:hover { background: #20352b; border-color: var(--up); }
#refreshStatus:disabled { cursor: wait; }
#refreshStatus svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.overview { position: relative; isolation: isolate; overflow: hidden; border: 1px solid #355245; border-radius: 18px; background: linear-gradient(110deg,#172a21,#10201c 62%,#173328); padding: clamp(20px,3vw,34px); }
.overview::before { content: ""; position: absolute; inset: 0 0 0 36%; z-index: -1; pointer-events: none; opacity: .28; background-image: linear-gradient(to right,#6e9c802b 1px,transparent 1px),linear-gradient(to bottom,#6e9c802b 1px,transparent 1px); background-size: 30px 30px; mask-image: linear-gradient(80deg,transparent,#000 75%); }
.overview-heading, .history-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.eyebrow { margin: 0 0 5px; color: var(--mint); font: 650 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .15em; }
h1, h2, h3, h4, p, dl, dd, ul { margin: 0; }
h1 { font-size: clamp(28px,3.4vw,42px); font-weight: 730; line-height: 1.3; letter-spacing: -.035em; }
.update-time { display: grid; justify-items: end; gap: 5px; font-size: 12px; color: #d1e2d7; }
.update-time > span { display: inline-flex; gap: 7px; align-items: center; font-weight: 640; }
.update-time > span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.update-time time { color: var(--muted); font: 12px/1.5 var(--mono); }
.summary-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-top: 1px solid #405647; padding-top: 19px; margin-top: 23px; }
.summary-grid > div:not(:first-child) { border-left: 1px solid #405647; padding-left: clamp(15px,3vw,40px); }
.metric-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; color: #d0ded5; font-size: 13px; }
.metric-label small { font-size: 11px; color: #a3baaa; }
.metric-value, .state-value { display: block; margin-top: 6px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: clamp(20px,2.4vw,30px); line-height: 1.35; }
.metric-value { font-family: var(--mono); }
.state-value { display: flex; gap: 10px; align-items: center; }
#statusIndicator { flex: none; width: 10px; height: 10px; border-radius: 50%; background: currentColor; color: #9aa6a0; }
#statusIndicator.operational { color: var(--up); box-shadow: 0 0 0 4px #70dc9820; }
#statusIndicator.degraded { color: var(--mixed); }
#statusIndicator.unavailable { color: var(--down); }
.update-note { color: #f7cd85; margin-top: 16px; font-size: 13px; }
.status-list { margin-top: clamp(28px,4vw,44px); }
h2 { font-size: clamp(23px,2.5vw,29px); font-weight: 720; line-height: 1.35; letter-spacing: -.025em; }
.range-badge { color: #c9dbd2; border: 1px solid #394c43; background: #18241e; border-radius: 7px; white-space: nowrap; padding: 5px 10px; font-size: 12px; }
.history-key { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; margin: 11px 0 16px; }
.history-key p, .legend { font-size: 12px; line-height: 1.7; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 3px 15px; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.status-servers { display: grid; gap: 11px; }
.server-card { min-width: 0; padding: 17px 21px 16px; background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; }
.server-heading { display: flex; gap: 12px 28px; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.server-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.server-name { --ui-overflow-wrap: anywhere; font-size: 18px; font-weight: 680; line-height: 1.5; }
.server-state { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--muted); background: #21302b; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 650; }
.server-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.server-state.up { color: #8deab0; background: #19392a; }
.server-state.down { color: #ffa2a4; background: #3b2428; }
.server-state.maintenance { color: #f8d089; background: #392f20; }
.server-metrics { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; }
.server-metrics > div { display: flex; align-items: baseline; gap: 7px; }
.server-metrics dt { font-size: 11px; color: var(--muted); }
.server-metrics dd { font: 600 13px/1.5 var(--mono); white-space: nowrap; }
.history-days { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.history-day { display: grid; gap: 8px; width: 100%; min-width: 0; text-align: left; color: #bfcec7; background: #101815; border: 1px solid #2c3c33; border-radius: 7px; padding: 9px 10px; }
.history-day:hover, .history-day[aria-expanded="true"] { border-color: #75a48b; color: var(--text); background: #1a2921; }
.day-caption { display: flex; align-items: center; justify-content: space-between; gap: 5px; font: 12px/1.4 var(--mono); }
.day-caption::after { content: ""; flex: none; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1px 1px 0; transform: translateY(-2px) rotate(45deg); }
[aria-expanded="true"] > .day-caption::after { transform: translateY(1px) rotate(225deg); }
.history-bars { display: grid; grid-template-columns: repeat(24,minmax(0,1fr)); gap: 2px; height: 15px; }
.history-cell { display: block; min-width: 0; border-radius: 2px; }
.swatch.up,.history-cell.up { background: var(--up); }
.swatch.mixed,.history-cell.mixed { background: var(--mixed); }
.swatch.down,.history-cell.down { background: var(--down); }
.swatch.unknown,.history-cell.unknown { background: repeating-linear-gradient(135deg,#64746c 0 2px,#26342d 2px 5px); }
.history-cell.gaps { background-image: repeating-linear-gradient(135deg,transparent 0 4px,#14241edb 4px 6px); }
.history-detail { margin-top: 12px; border-top: 1px solid var(--edge); padding-top: 12px; }
.detail-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
h4 { font-size: 14px; }
.hour-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.hour-picker select { max-width: 100%; border: 1px solid #43594c; border-radius: 6px; padding: 7px; color: var(--text); background: #15251e; font-size: 13px; }
.history-samples { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 4px; list-style: none; padding: 0; margin-top: 9px; }
.history-samples li { display: grid; text-align: center; gap: 2px; background: #0d1511; border-radius: 4px; padding: 7px 2px; font-size: 11px; color: var(--muted); }
.history-samples time { color: var(--text); font: 12px/1.5 var(--mono); }
.history-samples .up span { color: var(--mint); }
.history-samples .down span { color: #ffa2a4; }
.history-empty,.empty-status { color: var(--muted); padding: 12px 0 0; font-size: 13px; }
.empty-status { border: 1px dashed var(--edge); border-radius: 9px; padding: 24px; }
footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--edge); margin-top: 24px; padding-top: 16px; color: var(--muted); font-size: 12px; }
footer a { text-decoration: none; } footer a:hover { text-decoration: underline; } footer time { margin-left: 5px; font-family: var(--mono); }
@media (max-width: 840px) {
  .day-caption { font-size: 11px; } .history-day { padding: 8px; }
  .server-metrics > div { display: grid; gap: 0; } .history-bars { gap: 1px; }
  .history-samples { grid-template-columns: repeat(6,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .status-shell { width: calc(100% - 28px); }
  .status-header { height: 61px; } .overview { padding: 18px; border-radius: 13px; }
  .summary-grid { margin-top: 15px; padding-top: 15px; } .metric-label { display: grid; gap: 1px; }
  .server-card { padding: 15px; } .history-days { grid-template-columns: 1fr; gap: 5px; }
  .history-day { grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); align-items: center; gap: 9px; padding: 7px 8px; min-height: 36px; }
  .day-caption { font-size: 12px; } .history-bars { height: 13px; gap: 2px; }
}
@media (max-width: 500px) {
  .overview-heading { align-items: start; } .update-time { font-size: 11px; } .update-time time { max-width: 14ch; text-align: end; font-size: 10px; }
  .summary-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .summary-grid > div:not(:first-child) { padding-left: 10px; } .state-value { gap: 6px; } #statusIndicator { width: 7px; height: 7px; }
  .metric-label { font-size: 12px; } .metric-label small { font-size: 10px; }
  .state-value,.metric-value { font-size: clamp(16px,4vw,20px); }
  .server-heading { align-items: start; flex-direction: column; gap: 6px; margin-bottom: 10px; }
  .server-metrics > div { display: flex; gap: 5px; }
  .history-day { grid-template-columns: 1fr; gap: 4px; min-height: 44px; } .history-bars { height: 11px; }
  .legend { gap: 3px 11px; } .history-key p { font-size: 12px; }
}

.server-metrics > div:nth-child(2) dd { color: var(--mint); }
.server-metrics > div:last-child dd { color: var(--muted); font-weight: 500; }
@media (max-width: 580px) {
  .server-heading { align-items: start; flex-direction: column; gap: 8px; }
  .server-metrics { gap: 5px 14px; max-width: 100%; }
  .server-metrics > div { display: grid; gap: 0; }
}
@media (max-width: 445px) {
  .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 0; }
  .summary-grid .summary-state { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
  .summary-state .metric-label { display: flex; align-items: baseline; gap: 5px; }
  .summary-state .state-value { font-size: 19px; margin-top: 0; }
  .summary-grid > div:nth-child(2) { border-left: none; padding-left: 0; }
  .metric-value { font-size: 21px; } .metric-label small { font-size: 11px; }
}
