:root {
  --bg: #050506;
  --surface: #0d0d10;
  --surface-2: #121215;
  --border: #27272d;
  --text: #f4f4f5;
  --muted: #81818a;
  --green: #39d98a;
  --yellow: #e8aa32;
  --red: #f05252;
  --blue: #4f8cff;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.uptime-nav {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1040px) / 2));
  border-bottom: 1px solid var(--border);
  background: rgba(5, 5, 6, .92);
}
.uptime-logo { font-size: 15px; font-weight: 850; letter-spacing: 1.2px; }
.uptime-back { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.uptime-back:hover { color: var(--text); }
.uptime-back svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.uptime-main { width: min(1040px, calc(100% - 48px)); margin: 0 auto; padding: 54px 0 72px; }
.uptime-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.uptime-kicker { display: block; margin-bottom: 8px; color: var(--blue); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.uptime-heading h1 { margin: 0 0 7px; font-size: 34px; line-height: 1.1; letter-spacing: 0; }
.uptime-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.updated { display: flex; align-items: center; gap: 7px; color: #6f6f78; font: 600 10px ui-monospace, monospace; white-space: nowrap; }
.updated i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.updated.is-stale i { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }

.overall {
  --tone: var(--green);
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 15px 17px;
  border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
  border-left: 3px solid var(--tone);
  border-radius: 8px;
  background: color-mix(in srgb, var(--tone) 6%, var(--surface));
}
.overall.is-degraded { --tone: var(--yellow); }
.overall.is-outage { --tone: var(--red); }
.overall.is-loading { --tone: #71717a; }
.overall-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--tone) 12%, transparent); color: var(--tone); font-size: 16px; font-weight: 800; }
.overall-copy strong { display: block; margin-bottom: 3px; font-size: 14px; }
.overall-copy small { display: block; color: color-mix(in srgb, var(--tone) 45%, var(--muted)); font-size: 11px; }
.range-tabs { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 7px; background: #080809; }
.range-tabs button { border: 0; border-radius: 4px; padding: 7px 10px; background: transparent; color: #707078; font-size: 10px; font-weight: 700; cursor: pointer; }
.range-tabs button.active { background: #29292f; color: #fff; }
.range-tabs button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.servers-section { margin-top: 40px; }
.incidents-section { margin-top: 46px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.section-head h2 { margin: 0; font-size: 18px; letter-spacing: 0; }
.section-head span { color: #686871; font-size: 10px; }
.server-columns, .server-row { display: grid; grid-template-columns: minmax(200px, 1fr) 130px 2fr 76px; gap: 16px; }
.server-columns { padding: 0 15px 10px; color: #5f5f68; font: 700 9px ui-monospace, monospace; text-transform: uppercase; }
.server-list { border-top: 1px solid #2a2a30; }
.server-row { min-height: 72px; align-items: center; padding: 13px 15px; border-bottom: 1px solid #242429; }
.server-name { display: flex; align-items: center; gap: 11px; min-width: 0; }
.server-flag { position: relative; width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border: 1px solid #303037; border-radius: 7px; background: #111114; font-size: 16px; }
.server-flag-fallback, .server-flag-image { grid-area: 1 / 1; }
.server-flag-image { width: 22px; height: 22px; display: block; object-fit: contain; opacity: 0; }
.server-flag.has-image .server-flag-image { opacity: 1; }
.server-flag.has-image .server-flag-fallback { visibility: hidden; }
.server-copy { min-width: 0; }
.server-copy strong { display: block; overflow: hidden; color: #eeeef1; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.server-copy small { display: block; margin-top: 3px; color: #64646d; font-size: 9px; }
.lte-badge { display: inline-block; margin-left: 6px; padding: 2px 5px; border: 1px solid #365b91; border-radius: 4px; color: #62a0ff; font: 750 8px ui-monospace, monospace; vertical-align: 1px; }
.server-status { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 6px; }
.server-state { --tone: var(--green); display: flex; align-items: center; gap: 7px; color: color-mix(in srgb, var(--tone) 65%, #fff); font-size: 10px; font-weight: 650; }
.server-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); }
.server-state.is-degraded, .server-state.is-checking { --tone: var(--yellow); }
.server-state.is-offline { --tone: var(--red); }
.server-ru-state { color: #71717a; font: 650 8px ui-monospace, monospace; white-space: nowrap; }
.server-ru-state.is-ok { color: #35b97a; }
.server-ru-state.is-warning { color: var(--yellow); }
.server-ru-state.is-danger { color: var(--red); }
.history { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: 20px; }
.history-point { min-width: 2px; border-radius: 2px; background: var(--green); opacity: .68; }
.history-point.is-degraded { background: var(--yellow); opacity: .9; }
.history-point.is-down { background: var(--red); opacity: .9; }
.history-point.is-unknown { background: #25252a; opacity: 1; }
.history-point:hover { opacity: 1; outline: 1px solid rgba(255, 255, 255, .55); outline-offset: 1px; }
.history-tooltip { position: fixed; z-index: 100; max-width: min(360px, calc(100vw - 20px)); transform: translateX(-50%); padding: 7px 9px; border: 1px solid #35353d; border-radius: 5px; background: #17171b; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); color: #e7e7eb; font: 600 10px/1.35 ui-monospace, monospace; white-space: normal; pointer-events: none; }
.history-tooltip[hidden] { display: none; }
.uptime-value { text-align: right; color: #d9d9de; font: 700 11px ui-monospace, monospace; }
.incident-list { border-top: 1px solid #28282e; }
.incident-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 18px; align-items: start; padding: 17px 15px; border-bottom: 1px solid #242429; }
.incident-row time { color: #707079; font: 600 10px ui-monospace, monospace; }
.incident-copy strong { display: block; margin-bottom: 4px; font-size: 12px; }
.incident-copy p { margin: 0; color: #797982; font-size: 10px; line-height: 1.5; }
.incident-status { color: var(--green); font-size: 10px; font-weight: 700; }
.incident-status.is-open { color: var(--red); }
.empty-state { padding: 30px 15px; border-bottom: 1px solid #242429; color: #74747d; font-size: 12px; text-align: center; }

.uptime-footer { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 max(24px, calc((100vw - 1040px) / 2)); border-top: 1px solid var(--border); color: #606068; font-size: 10px; }
.footer-brand { color: #cfcfd4; font-weight: 800; letter-spacing: 1px; }
.uptime-footer a:hover { color: #fff; }
.noscript { margin: 20px; color: var(--yellow); text-align: center; }

@media (max-width: 700px) {
  .uptime-nav { height: 58px; padding: 0 16px; }
  .uptime-main { width: calc(100% - 32px); padding: 34px 0 52px; }
  .uptime-heading { display: block; margin-bottom: 22px; }
  .uptime-heading h1 { font-size: 28px; }
  .updated { margin-top: 12px; }
  .overall { grid-template-columns: 32px minmax(0, 1fr); gap: 11px; padding: 13px; }
  .overall-icon { width: 31px; height: 31px; }
  .range-tabs { grid-column: 1 / -1; margin-top: 4px; }
  .range-tabs button { flex: 1; }
  .servers-section { margin-top: 34px; }
  .server-columns { display: none; }
  .server-row { grid-template-columns: minmax(0, 1fr) auto; gap: 11px; min-height: 82px; padding: 15px 4px; }
  .server-status { align-items: flex-end; justify-self: end; }
  .history { grid-column: 1 / -1; height: 17px; }
  .uptime-value { grid-column: 1 / -1; grid-row: 2; align-self: center; justify-self: end; z-index: 2; padding-left: 25px; background: linear-gradient(90deg, transparent, var(--bg) 34%); }
  .incident-row { grid-template-columns: 1fr auto; gap: 8px; padding-inline: 4px; }
  .incident-row time { grid-column: 1 / -1; }
  .uptime-footer { min-height: 82px; padding: 18px 16px; flex-wrap: wrap; }
  .uptime-footer > span:nth-child(2) { order: 3; width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .overall, .server-row, .incident-row { animation: reveal .28s ease both; }
  @keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
}
