:root {
  --bg: #111416;
  --page: #1d1c19;
  --card: #181815;
  --card-soft: #1b1a16;
  --line: #3a382f;
  --text: #fff6cf;
  --muted: #918a78;
  --muted-2: #b1a989;
  --green: #79d47d;
  --green-2: #6fc374;
  --red: #e96f5d;
  --amber: #b9a882;
  --unknown: #5a5547;
  --shadow: 0 28px 70px rgba(0,0,0,.27);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg); }
body {
  background: linear-gradient(to bottom, var(--bg) 0, var(--bg) 155px, var(--page) 155px, var(--page) 100%);
  color: var(--text);
  font-family: Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.35;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; padding-bottom: 44px; }

.topbar {
  position: relative;
  min-height: 155px;
  padding: 30px 20px 51px;
  text-align: center;
}
.brand-link { display: inline-block; color: var(--text); }
.brand-link:hover { color: var(--text); text-decoration: none; }
.brand {
  margin: 0;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .01em;
}
.brand-line { width: 164px; height: 1px; margin: 14px auto 14px; background: #5d5848; opacity: .72; }
.subtitle { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.2; }
.update-box {
  position: absolute;
  top: 82px;
  right: calc(50vw - 450px + 126px);
  width: 160px;
  text-align: left;
  color: #858071;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.container { width: min(900px, calc(100vw - 40px)); margin: 0 auto; }
.status-card {
  width: min(900px, calc(100vw - 40px));
  margin: -24px auto 0;
  border-radius: 4px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.main-status {
  min-height: 94px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 33px;
}
.main-status-title {
  margin: 0;
  font-size: 27px;
  line-height: 1.1;
  font-weight: 700;
}
.main-status-title .status-word { color: var(--green); }
.main-status.down .status-word, .main-status.down .main-status-title { color: var(--red); }
.main-status.partial .status-word { color: #dbc15f; }
.main-status-dot { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none; }

.dot {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  color: var(--green);
  box-shadow: none;
  vertical-align: middle;
}
.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  animation: pulse 2.25s ease-out infinite;
  pointer-events: none;
}
.dot.big { width: 24px; height: 24px; }
.dot.large { width: 16px; height: 16px; flex: none; margin: 0 30px 0 24px; }
.status-down .dot, .dot.down, .status-pill.down .dot { background: var(--red); color: var(--red); }
.status-unknown .dot, .dot.unknown, .status-pill.unknown .dot { background: var(--unknown); color: var(--unknown); }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0; }
  8% { transform: scale(1); opacity: .34; }
  74% { transform: scale(2.65); opacity: 0; }
  100% { transform: scale(2.65); opacity: 0; }
}

.section-title {
  width: min(900px, calc(100vw - 40px));
  margin: 38px auto 17px;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}
.services-list {
  width: min(864px, calc(100vw - 72px));
  margin: 0 auto;
  padding: 0 0 12px;
  background: transparent;
  box-shadow: none;
}
.service-row {
  display: grid;
  grid-template-columns: 190px 82px minmax(448px, 1fr) 68px;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}
.service-row:last-child { border-bottom: 0; }
.service-row:hover .service-name { text-decoration: underline; }
.service-name {
  color: var(--text);
  font-size: 13px;
  line-height: 1.15;
  font-weight: 700;
  white-space: nowrap;
  overflow: visible;
}
.service-name .arrow { color: #bdb491; margin-left: 3px; }
.service-uptime { color: var(--green); font-size: 12px; font-weight: 700; text-align: right; white-space: nowrap; }
.uptime-bars { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: visible; }
.bar {
  position: relative;
  flex: 0 0 3px;
  width: 3px;
  height: 14px;
  border-radius: 3px;
  background: var(--green);
}
.bar.warn { background: var(--amber); }
.bar.down { background: var(--red); }
.bar.unknown { background: var(--unknown); opacity: .62; }
.bar:hover { transform: translateY(-1px); filter: brightness(1.18); }
.service-state { display: flex; justify-content: flex-end; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: 13px; font-weight: 400; }
.status-pill .dot { width: 9px; height: 9px; }
.status-pill.down { color: var(--red); }
.status-pill.unknown { color: var(--muted); }

.detail-page { width: min(900px, calc(100vw - 40px)); margin: -74px auto 0; }
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  margin: 0 0 18px 3px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  z-index: 10;
}
.back-button:hover { text-decoration: underline; }
.detail-hero {
  min-height: 95px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.detail-hero h1 { margin: 0; color: var(--green); font-size: 26px; line-height: 1.1; font-weight: 700; }
.detail-hero.down h1 { color: var(--red); }
.detail-hero p { margin: 2px 0 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.detail-section { margin-top: 38px; }
.detail-section h2 { margin: 0 0 25px; font-size: 20px; line-height: 1; font-weight: 700; }
.detail-section h2 small { color: var(--muted); font-size: 12px; font-weight: 700; }
.detail-bars-wrap { padding: 18px 40px 0; }
.detail-percent { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 700; }
.detail-bars { gap: 4px; }
.detail-bars .bar { flex-basis: 5px; width: 5px; height: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 16px; }
.stat { min-width: 0; padding: 0 38px; border-right: 1px solid #4b483a; }
.stat:first-child { padding-left: 40px; }
.stat:last-child { border-right: 0; }
.stat strong { display: block; color: var(--text); font-size: 16px; line-height: 1.1; font-weight: 700; }
.stat span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 700; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chart-card { min-height: 190px; border-radius: 6px; background: transparent; padding: 0 40px; }
.chart-card canvas { display: block; width: 100%; height: 190px; }
.empty-chart { min-height: 160px; display: grid; place-items: center; color: var(--muted); font-size: 13px; font-weight: 700; }
.response-grid { grid-template-columns: repeat(3, 1fr); margin-top: 18px; }
.events-list { margin-top: 18px; }
.event { position: relative; display: block; border-bottom: 1px solid var(--line); padding: 14px 10px 14px 30px; }
.event::before { content: ""; position: absolute; left: 8px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.event.bad::before { background: var(--red); }
.event strong { color: var(--green); font-size: 13px; font-weight: 700; }
.event.bad strong { color: var(--red); }
.event p { margin: 3px 0 2px; color: var(--text); font-size: 12px; font-weight: 700; }
.event small { color: var(--muted); font-size: 11px; font-weight: 700; }
.no-events { color: var(--muted); font-size: 13px; font-weight: 700; }
.error-box { white-space: pre-wrap; color: var(--red); padding: 20px; margin: 0 10px 24px; background: #111; border-radius: 6px; }

@media (max-width: 960px) {
  .update-box { position: static; width: auto; text-align: center; margin-top: 14px; }
  .topbar { padding-bottom: 40px; }
  .status-card { width: calc(100vw - 24px); }
  .services-list { width: calc(100vw - 48px); }
  .service-row {
    grid-template-columns: minmax(0, 1fr) 70px 64px;
    grid-template-areas:
      "name uptime state"
      "bars bars bars";
    min-height: 60px;
    padding: 8px 0;
  }
  .service-name { grid-area: name; white-space: normal; }
  .service-uptime { grid-area: uptime; }
  .uptime-bars { grid-area: bars; }
  .service-state { grid-area: state; }
  .detail-page { margin-top: -46px; }
  .detail-hero h1 { font-size: 21px; }
  .stats-grid, .response-grid { grid-template-columns: 1fr 1fr; row-gap: 20px; }
  .stat, .stat:first-child { padding: 0 18px; }
  .stat:nth-child(2n) { border-right: 0; }
  .detail-bars-wrap, .chart-card { padding-left: 0; padding-right: 0; }
  .detail-bars { gap: 2px; }
  .detail-bars .bar { flex-basis: 3px; width: 3px; }
  .dot.large { margin-left: 16px; }
}

@media (max-width: 560px) {
  .brand { font-size: 24px; }
  .main-status { padding: 0 20px; gap: 16px; }
  .main-status-title { font-size: 22px; }
  .stats-grid, .response-grid { grid-template-columns: 1fr; }
  .stat { border-right: 0; }
}