:root {
  --ink: #1c1c1c;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --panel: #ffffff;
  --page: #f4f5f7;
  --brand: rgb(239, 137, 51);
  --brand-deep: rgb(214, 118, 36);
  --up: #1f8f4e;
  --up-bg: #e8f8ef;
  --down: #c62828;
  --down-bg: #fdecea;
  --warn: #9a6700;
  --warn-bg: #fff8c5;
  --info: #0b5cab;
  --info-bg: #e8f2fb;
  --bar-ok: #1f8f4e;
  --bar-partial: #d4a72c;
  --bar-bad: #c62828;
  --bar-empty: #d8d8d8;
  --font: "DM Sans", "Segoe UI", sans-serif;
  --max: 1040px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font);
  background: var(--page);
  line-height: 1.4;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Brand header: E mark + System Status */
.hero {
  background: var(--brand);
  color: #fff;
}

.hero-inner {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.15rem 0;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  display: inline-flex;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand-mark:hover {
  text-decoration: none;
  opacity: 0.9;
}

.brand-mark img {
  display: block;
  width: 42px;
  height: 42px;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.65rem, 3.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: #fff;
}

.page,
.site-footer {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.page {
  padding: 1.25rem 0 2.25rem;
}

.announcement {
  margin-bottom: 0.85rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-left-color: var(--info);
  border-radius: 6px;
  background: var(--info-bg);
}

.announcement[data-level="maintenance"] {
  border-left-color: var(--warn);
  background: var(--warn-bg);
}

.announcement[data-level="incident"] {
  border-left-color: var(--down);
  background: var(--down-bg);
}

.announcement .label {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.announcement p {
  margin: 0;
  font-size: 0.92rem;
}

.overall {
  margin-bottom: 0.85rem;
  border: 1px solid transparent;
  border-radius: 6px;
}

.overall[data-state="operational"] {
  background: var(--up-bg);
  border-color: #b7e4c7;
  color: #146c3a;
}

.overall[data-state="degraded"] {
  background: var(--warn-bg);
  border-color: #d4a72c;
  color: var(--warn);
}

.overall[data-state="outage"] {
  background: var(--down-bg);
  border-color: #f5a8a8;
  color: var(--down);
}

.overall[data-state="loading"] {
  background: #eef1f4;
  border-color: var(--line);
  color: var(--muted);
}

.overall-inner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.95rem;
}

.overall-icon {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}

.overall-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: inherit;
}

.overall-meta {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  opacity: 0.85;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.panel-head {
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
}

.panel-head p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

/* GitHub-style compact 2-column grid */
.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.service {
  padding: 0.7rem 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-width: 0;
}

.service:nth-child(2n) {
  border-right: 0;
}

.service:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.service-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.service-identity {
  min-width: 0;
}

.service-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
}

.service-url {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-url:hover {
  color: var(--info);
}

.service-status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.service-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.service-status.up {
  color: var(--up);
}

.service-status.down {
  color: var(--down);
}

.degraded-note {
  margin: 0.25rem 0 0;
  color: var(--down);
  font-size: 0.72rem;
  font-weight: 600;
}

.service-history {
  margin-top: 0.45rem;
}

.history-bars {
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: 1.5px;
  height: 10px;
}

.history-bar {
  position: relative;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background: var(--bar-empty);
  cursor: default;
}

.history-bar[data-level="ok"] {
  background: var(--bar-ok);
}

.history-bar[data-level="partial"] {
  background: var(--bar-partial);
}

.history-bar[data-level="bad"] {
  background: var(--bar-bad);
}

.history-bar[data-level="empty"] {
  background: var(--bar-empty);
}

.history-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 5;
  min-width: 150px;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: #1a1a1a;
  color: #fff;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: pre-line;
  text-align: left;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
}

.history-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
}

.history-bar:hover .history-tip,
.history-bar:focus-visible .history-tip {
  opacity: 1;
  visibility: visible;
}

.history-bar:hover,
.history-bar:focus-visible {
  outline: none;
  filter: brightness(0.9);
  transform: scaleY(1.35);
  transform-origin: center;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.uptime {
  margin: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.site-footer {
  padding: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  font-weight: 650;
  color: var(--ink);
}

.error-banner {
  grid-column: 1 / -1;
  padding: 0.85rem 1rem;
  color: var(--down);
  background: var(--down-bg);
}

@media (max-width: 760px) {
  .service-list {
    grid-template-columns: 1fr;
  }

  .service {
    border-right: 0;
  }

  .service:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .service:last-child {
    border-bottom: 0;
  }

  .brand-mark img {
    width: 36px;
    height: 36px;
  }
}
