/* Status page. One layout, three brandings chosen by html[data-site]. */

:root {
  --bg: #0f172a; --card: #1e293b; --line: #334155;
  --ink: #e2e8f0; --muted: #94a3b8; --link: #38bdf8;
  --head-bg: transparent; --head-ink: #e2e8f0; --head-line: #334155;
  --focus: #38bdf8;
  /* day bars and status icons */
  --s-operational: #22c55e; --s-degraded: #f59e0b; --s-down: #ef4444;
  --s-offline: #cbd5e1; --s-blocked: #60a5fa; --s-halted: #c084fc;
  --s-nodata: #475569; --s-unknown: #94a3b8;
  --tip-bg: #f8fafc; --tip-ink: #0f172a;
  --btn-bg: #38bdf8; --btn-ink: #0f172a; --field-line: #94a3b8;
}
html[data-site="aqua"] {
  --bg: #000; --card: #0d0d0d; --line: #2e2e2e;
  --ink: #fff; --muted: #9a9a9a; --link: #fff;
  --head-ink: #fff; --head-line: #2e2e2e;
  --focus: #fff;
  --btn-bg: #fff; --btn-ink: #000; --field-line: #9a9a9a;
  --s-nodata: #444; --s-offline: #d4d4d4;
}
html[data-site="store"] {
  --bg: #eaeded; --card: #fff; --line: #d5d9d9;
  --ink: #0f1111; --muted: #565959; --link: #0a5cb0;
  --head-bg: #132133; --head-ink: #fff; --head-line: #132133;
  --focus: #0b74de;
  --s-operational: #067d62; --s-degraded: #d97706; --s-down: #c81e1e;
  --s-offline: #4b5563; --s-blocked: #2563eb; --s-halted: #7c3aed;
  --s-nodata: #b6bcbc; --s-unknown: #6b7280;
  --tip-bg: #0f1111; --tip-ink: #fff;
  --btn-bg: #ffbe3d; --btn-ink: #0f1111; --field-line: #6b7272; --field-bg: #fff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--link); }
a:focus-visible, .strip:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* header */
.top { background: var(--head-bg); color: var(--head-ink); border-bottom: 1px solid var(--head-line); }
.top-in { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--head-ink); text-decoration: none; min-width: 0; }
.brand img { display: block; height: 28px; width: auto; }
html[data-site="aqua"] .brand img, html[data-site="store"] .brand img { height: 36px; border-radius: 8px; }
html[data-site="store"] .brand img { border: 1px solid rgba(255, 255, 255, .28); }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -.01em; white-space: nowrap; }
html[data-site="store"] .brand-name b { color: #ffbe3d; font-weight: 800; }
.top-status {
  font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding-left: 12px; border-left: 1px solid currentColor; opacity: .85;
}
.top-back { margin-left: auto; color: var(--head-ink); font-size: 14px; white-space: nowrap; }
.top .brand:focus-visible, .top .top-back:focus-visible { outline-color: var(--head-ink); }

/* subscribe: header button, panel, and the confirm / unsubscribe notice */
button { font: inherit; }
.sub-open {
  flex: none; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--head-ink); border: 1.5px solid currentColor;
  font-size: 14px; font-weight: 600; line-height: 1.2;
}
.sub-open:hover, .sub-open[aria-expanded="true"] { background: var(--head-ink); color: var(--bg); }
html[data-site="store"] .sub-open:hover, html[data-site="store"] .sub-open[aria-expanded="true"] { color: #132133; }
.sub-open:focus-visible { outline: 2px solid var(--head-ink); outline-offset: 3px; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sub-panel {
  position: absolute; z-index: 10; top: calc(100% + 8px); right: 16px;
  width: 360px; max-width: calc(100vw - 32px); padding: 18px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
.sub-panel h2 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.sub-panel p { margin: 0 0 8px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.sub-panel label { display: block; margin: 14px 0 6px; font-size: 14px; font-weight: 600; }
.sub-panel input {
  display: block; width: 100%; padding: 10px 12px; border-radius: 6px;
  font: inherit; font-size: 16px; color: var(--ink); background: var(--field-bg, var(--bg));
  border: 1px solid var(--field-line);
}
.sub-panel input[aria-invalid="true"] { border-color: var(--s-down); border-width: 2px; padding: 9px 11px; }
.sub-panel .sub-error { margin: 6px 0 0; color: var(--ink); font-weight: 600; }
.sub-panel .sub-error:empty { display: none; }
.sub-panel .sub-sent { color: var(--ink); font-size: 16px; font-weight: 700; }
.sub-panel .sub-sent:focus { outline: none; }
.sub-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.sub-actions:empty { display: none; }
.btn, .btn-plain {
  padding: 9px 16px; border-radius: 6px; cursor: pointer; font-size: 15px; font-weight: 600; line-height: 1.2;
}
.btn { background: var(--btn-bg); color: var(--btn-ink); border: 1px solid var(--btn-bg); }
.btn[disabled] { opacity: .65; cursor: default; }
.btn-plain { background: transparent; color: var(--ink); border: 1px solid var(--field-line); }

.notice {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 28px 0 -12px; padding: 16px 18px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--s, var(--s-unknown));
}
.notice .ico { width: 22px; height: 22px; margin-top: 1px; align-self: flex-start; }
.notice .ico svg { width: 22px; height: 22px; }
.notice-body { min-width: 0; }
.notice h2 { margin: 0; font-size: 17px; font-weight: 700; }
.notice h2:focus { outline: none; }
.notice p { margin: 4px 0 0; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.notice p:empty { display: none; }

/* overall banner */
.banner {
  display: flex; align-items: center; gap: 14px;
  margin: 28px 0 10px; padding: 18px 20px; border-radius: 10px;
  color: #fff; background: #475569;
}
.banner[data-kind="ok"] { background: #15803d; }
.banner[data-kind="problem"] { background: #b45309; }
.banner[data-kind="down"] { background: #b91c1c; }
.banner[data-kind="unavailable"], .banner[data-kind="loading"] { background: #475569; }
.banner-icon { flex: none; width: 28px; height: 28px; }
.banner-icon svg { display: block; width: 28px; height: 28px; }
.banner p { margin: 0; }
.banner-title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.banner-sub { font-size: 15px; margin-top: 4px !important; }

.updated { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.updated.stale { color: var(--ink); font-weight: 600; }

/* categories and service rows */
.cat { margin-top: 28px; }
.cat h2, .legend h2 { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.cat-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
.svc { padding: 16px 18px 12px; }
.svc + .svc { border-top: 1px solid var(--line); }
.svc-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; }
.svc-name { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.svc-state { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600; margin-left: auto; text-align: right; }
.svc-note { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.ico { flex: none; width: 16px; height: 16px; align-self: center; }
.ico svg { display: block; width: 16px; height: 16px; }
[data-state="operational"] { --s: var(--s-operational); }
[data-state="degraded"] { --s: var(--s-degraded); }
[data-state="down"] { --s: var(--s-down); }
[data-state="offline"] { --s: var(--s-offline); }
[data-state="blocked"] { --s: var(--s-blocked); }
[data-state="halted"] { --s: var(--s-halted); }
[data-state="nodata"] { --s: var(--s-nodata); }
[data-state="unknown"] { --s: var(--s-unknown); }
.ico { color: var(--s); }

/* 90 day strip: always 90 columns, so every bar stays visible at any width */
.strip {
  display: grid; grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 2px;
  align-items: end; height: 34px; margin-top: 12px;
  cursor: default; touch-action: pan-y;
}
.bar { height: 100%; background: var(--s); border-radius: 2px; min-width: 0; }
/* a day with no record is a short stub, so it differs by shape as well as color */
.bar[data-state="nodata"] { height: 34%; }
.bar.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 12px; }

/* day detail */
.tip {
  position: absolute; z-index: 5; max-width: 260px; padding: 7px 10px; border-radius: 6px;
  background: var(--tip-bg); color: var(--tip-ink); font-size: 13px; line-height: 1.35;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35); pointer-events: none;
}
.tip b { display: block; font-weight: 700; }

/* legend */
.legend { margin-top: 32px; }
.legend dl {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 24px;
  margin: 0; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
.legend .item { display: grid; grid-template-columns: 16px 1fr; gap: 0 9px; align-items: start; align-content: start; }
.legend .ico { margin-top: 4px; }
.legend dt { font-weight: 600; font-size: 15px; }
.legend dd { grid-column: 2; margin: 0; color: var(--muted); font-size: 14px; }
.legend-hint { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.noscript { margin-top: 20px; }

/* footer */
.foot { margin-top: 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding-top: 18px; padding-bottom: 28px; }

@media (max-width: 520px) {
  .strip { gap: 1px; height: 30px; }
  .bar { border-radius: 1px; }
  .svc { padding: 14px 12px 10px; }
  .banner { padding: 16px; margin-top: 20px; }
  .banner-title { font-size: 18px; }
  .brand-name { font-size: 18px; }
  .top-status { font-size: 12px; padding-left: 10px; }
  .top-in { gap: 10px; }
  .top-back { display: none; }
  .sub-open { margin-left: auto; }
  .sub-panel { left: 16px; right: 16px; width: auto; max-width: none; }
  .notice { margin-top: 20px; padding: 14px; }
  .legend dl { padding: 14px 12px; }
}
@media (max-width: 400px) {
  html[data-site="vhproduct"] .brand img { height: 22px; }
}
