/* Same design as lizard-monitoring's status page (status_page.go), on Lizard's
   brand system (lizard-client/DESIGN.md: Geist, #070707, emerald #10B981). */

@font-face { font-family: "Geist"; src: url("/fonts/Geist-Regular-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Medium-latin.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/Geist-SemiBold-latin.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Bold-latin.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #070707; --card: #141414; --border: #2E2E2E; --divider: rgba(255, 255, 255, 0.06);
  --text: #E9EDF4; --muted: #858B94; --dim: #5F646D;
  --emerald: #10B981; --pillActive: #2E2E2E;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
.wrap {
  max-width: 900px; margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 20px calc(80px + env(safe-area-inset-bottom, 0px));
}

/* Header */
header { display: flex; align-items: center; gap: 14px; padding: 6px 0 26px; }
.brand { display: flex; align-items: center; gap: 3px; }
.logo { width: 28px; height: 28px; color: var(--emerald); display: block; }
.logo svg { width: 100%; height: 100%; display: block; }
.word { font-size: 20px; font-weight: 700; letter-spacing: -0.2px; color: rgba(233, 237, 244, 0.9); }
nav { display: flex; gap: 6px; margin-left: 6px; }
.pill { padding: 8px 14px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 600; transition: color .12s; }
.pill:hover { color: var(--text); }
.pill.active { background: var(--pillActive); color: var(--text); }
.spacer { flex: 1; }
.cta {
  height: 36px; padding: 0 16px; border-radius: 8px; background: rgba(16, 185, 129, 0.5);
  border: 1px solid var(--emerald); color: #fff; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.cta:hover { background: var(--emerald); }
.cta svg { width: 14px; height: 14px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; border-radius: 6px; }

/* Banner */
.banner { border-radius: 12px; padding: 18px 20px; margin-bottom: 24px; border: 1px solid transparent; }
.banner.ok { background: rgba(16, 185, 129, 0.09); border-color: rgba(16, 185, 129, 0.22); }
.banner.bad { background: rgba(245, 158, 11, 0.09); border-color: rgba(245, 158, 11, 0.24); }
.banner.loading { background: var(--card); border-color: var(--border); }
.banner h1 { margin: 0; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; }
.tick { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--dim); }
.banner.ok .tick { background: var(--emerald); }
.banner.bad .tick { background: #F59E0B; }
.banner p { margin: 12px 0 0; padding-left: 12px; border-left: 2px solid var(--border); color: var(--muted); font-size: 13.5px; max-width: 640px; }
.banner.ok p { border-color: var(--emerald); }
.banner.bad p { border-color: #F59E0B; }

/* Groups */
.group { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; overflow: hidden; background: var(--card); }
.group > summary {
  list-style: none; cursor: pointer; padding: 16px 20px; display: flex;
  align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
}
.group > summary::-webkit-details-marker { display: none; }
.group > summary .chev { color: var(--dim); transition: transform .15s; font-size: 11px; display: inline-block; }
.group[open] > summary .chev { transform: rotate(90deg); }
.badge { font-size: 12.5px; color: var(--muted); font-weight: 500; white-space: nowrap; }

.comp { padding: 18px 20px; border-top: 1px solid var(--divider); }
.comp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.comp-name { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; min-width: 0; flex-wrap: wrap; }
.comp-detail { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.bar { display: flex; gap: 2px; height: 32px; }
.bar i { flex: 1 1 0; border-radius: 2px; min-width: 0; cursor: default; }

/* Tooltip */
#tip {
  position: fixed; z-index: 60; pointer-events: none; display: none; min-width: 150px; max-width: 260px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); overflow: hidden;
}
#tip .th { padding: 9px 13px; font-size: 13.5px; font-weight: 600; border-bottom: 1px solid var(--border); }
#tip .td { padding: 9px 13px; font-size: 13.5px; font-weight: 500; color: var(--text); }
#tip .ti { padding: 0 13px 9px; font-size: 12.5px; color: var(--muted); }

/* Active incidents */
.incident { border-radius: 12px; margin-bottom: 14px; border: 1px solid rgba(245, 158, 11, 0.24); background: var(--card); overflow: hidden; }
.incident.major, .incident.critical { border-color: rgba(239, 68, 68, 0.3); }
.incident.maintenance { border-color: rgba(59, 130, 246, 0.3); }
.incident-head { padding: 14px 20px; font-weight: 600; font-size: 15px; background: rgba(245, 158, 11, 0.09); color: #FBBF24; }
.incident.major .incident-head, .incident.critical .incident-head { background: rgba(239, 68, 68, 0.09); color: #F87171; }
.incident.maintenance .incident-head { background: rgba(59, 130, 246, 0.09); color: #93C5FD; }
.incident .updates { padding: 2px 20px 16px; }
.update { padding-top: 12px; }
.update p { margin: 0; }
.update-status { font-weight: 600; margin-right: 6px; }
.update time { display: block; margin-top: 2px; color: var(--dim); font-size: 12.5px; }

/* History */
.history { margin-top: 40px; scroll-margin-top: 20px; }
.history h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.day { padding: 16px 0; border-bottom: 1px solid var(--divider); }
.day h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.day-empty { margin: 0; color: var(--dim); font-size: 13.5px; }
.past + .past { margin-top: 14px; }
.past-title { font-weight: 600; font-size: 14px; color: #FBBF24; }
.past-title.major, .past-title.critical { color: #F87171; }
.past-title.maintenance { color: #93C5FD; }
.past .update { padding-top: 6px; }
.past .update p { color: var(--muted); font-size: 13.5px; }

footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 32px; color: var(--dim); font-size: 12.5px; }
.foot-links { display: flex; gap: 16px; }
.foot-links a:hover { color: var(--muted); }

.error { padding: 18px 20px; color: var(--muted); }

@media (max-width: 560px) {
  nav { display: none; }
  .bar { height: 26px; }
  .comp, .group > summary { padding-left: 16px; padding-right: 16px; }
  .comp-detail { display: none; }
}
