:root {
  --ink: #1C1A17; --body: #4A453D; --muted: #7A7368; --line: #E3E8EE; --bg: #FFFFFF; --sand: #F2F5F8; --brand: #00395F;
  --up: #2E9F5E; --degraded: #E8A317; --partial: #EA7A2E; --down: #DC4848; --maint: #3E7BD6; --none: #DEE4EA;
  color-scheme: only light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font: 16px/1.5 "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-left)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button { font: inherit; color: inherit; }

/* header */
.top { background: var(--sand); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; min-height: 132px; padding-top: 18px; padding-bottom: 18px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--brand); }
.logo img { display: block; height: 44px; width: auto; border-radius: 10px; }
.logo-t { font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.sub { position: relative; }
.sub-btn { border: 0; background: var(--brand); color: #fff; border-radius: 999px; padding: 11px 20px; font-weight: 700; font-size: 14px; cursor: pointer; }
.sub-btn:hover { background: #002a47; }
.sub-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; width: min(300px, calc(100vw - 40px)); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: 0 24px 50px -24px rgba(28,26,23,.35); }
.sub-menu b { font-size: 15px; } .sub-menu p { margin: 2px 0 12px; color: var(--muted); font-size: 14px; }
.sub-row { display: block; padding: 11px 12px; border-radius: 10px; background: var(--sand); text-decoration: none; font-weight: 600; font-size: 14px; margin-top: 8px; }
.sub-row:hover { background: #E6ECF2; }

main.wrap { padding-top: 40px; padding-bottom: max(40px, env(safe-area-inset-bottom)); }

/* overall banner */
.banner { border-radius: 14px; padding: 22px 24px; color: #fff; font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 12px; }
.banner::before { content: ""; width: 22px; height: 22px; flex: none; border-radius: 50%; background: rgba(255,255,255,.22) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat; }
.banner.up { background: var(--up); }
.banner.degraded { background: var(--degraded); color: #2B1F00; } .banner.partial { background: var(--partial); } .banner.down { background: var(--down); }
.banner.degraded::before, .banner.partial::before, .banner.down::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E"); }
.banner.degraded::before { filter: invert(1); }
.banner.none { background: var(--sand); color: var(--muted); } .banner.none::before { display: none; }
.stale { margin: 10px 2px 0; font-size: 14px; color: var(--muted); }

/* active incidents */
.inc-live { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 18px; }
.inc-live > h3 { margin: 0; padding: 14px 20px; color: #fff; font-size: 17px; }
.inc-live.minor > h3 { background: var(--partial); } .inc-live.major > h3, .inc-live.critical > h3 { background: var(--down); } .inc-live.maintenance > h3 { background: var(--maint); }
.inc-live .upd { padding: 14px 20px; border-top: 1px solid var(--line); }
.inc-live .upd:first-of-type { border-top: 0; }
.upd b { text-transform: capitalize; } .upd p { margin: 2px 0 4px; color: var(--body); }
.upd small, .when { color: var(--muted); font-size: 14px; }

/* components */
.lede { margin: 36px 0 10px; text-align: center; color: var(--muted); font-size: 15px; }
.lede a { color: var(--maint); text-decoration: none; } .lede a:hover { text-decoration: underline; }
.comps { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.comp { padding: 20px 22px 18px; border-top: 1px solid var(--line); }
.comp:first-child { border-top: 0; }
.comp-top { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.comp-top .nm { font-weight: 700; font-size: 17px; }
.comp-top .st { margin-left: auto; font-size: 15px; font-weight: 600; white-space: nowrap; }
.st.up { color: var(--up); } .st.degraded { color: #B47B00; } .st.partial { color: var(--partial); } .st.down { color: var(--down); }
.q { width: 22px; height: 22px; border-radius: 50%; border: 1px solid #CFC8BD; background: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; padding: 0; flex: none; }
.q:hover, .q[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }
.desc { margin: 6px 0 0; font-size: 14px; color: var(--body); background: var(--sand); border-radius: 10px; padding: 9px 12px; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: 36px; margin-top: 12px; }
.bar { border: 0; padding: 0; border-radius: 2px; background: var(--none); cursor: pointer; min-width: 0; }
.bar.up { background: var(--up); } .bar.degraded { background: var(--degraded); } .bar.partial { background: var(--partial); } .bar.down { background: var(--down); }
.bar:hover, .bar[aria-expanded="true"] { opacity: .65; }
.bar:focus-visible, .q:focus-visible, .pg:focus-visible, .tabs button:focus-visible, .seg button:focus-visible, .sub-btn:focus-visible, .cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.axis { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.axis i { flex: 1; height: 1px; background: var(--line); }
.axis .pct { color: var(--body); }
.group > .comp-top { cursor: pointer; }
.tog { width: 20px; height: 20px; border: 1.5px solid #B9B1A5; border-radius: 4px; display: inline-grid; place-items: center; font-size: 14px; line-height: 1; color: var(--muted); background: #fff; padding: 0; cursor: pointer; flex: none; }
.group-kids { margin: 14px -22px -18px; background: #FCFBF9; }
.group-kids .comp { padding-left: 40px; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend i.up { background: var(--up); } .legend i.degraded { background: var(--degraded); } .legend i.partial { background: var(--partial); } .legend i.down { background: var(--down); } .legend i.none { background: var(--none); }

/* metrics */
.metrics { margin-top: 56px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.seg { display: inline-flex; background: var(--sand); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--brand); color: #fff; }
.chart { border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px 14px; }
.chart-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.chart-top b { font-size: 17px; } .chart-top span { font-size: 20px; font-weight: 700; color: var(--body); }
.chart svg { display: block; width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.chart .gl { stroke: var(--line); } .chart .tx { fill: var(--muted); font-size: 11px; }
.chart .ln { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.chart .ar { fill: rgba(28,26,23,.06); }
.chart .empty { fill: var(--muted); font-size: 14px; }

/* past incidents */
.past { margin-top: 56px; }
.past h2 { margin-bottom: 8px; }
.day { padding: 22px 0 6px; }
.day h3 { margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 17px; }
.day .noinc { margin: 0; color: var(--muted); }
.inc { margin: 0 0 18px; }
.inc summary { list-style: none; cursor: pointer; }
.inc summary::-webkit-details-marker { display: none; }
.inc .t { font-weight: 700; font-size: 17px; }
.inc.minor .t { color: #C9601C; } .inc.major .t, .inc.critical .t { color: var(--down); } .inc.maintenance .t { color: var(--maint); } .inc.none .t { color: var(--ink); }
.inc .sum { margin: 2px 0; color: var(--body); }
.inc .more { font-size: 14px; color: var(--maint); }
.inc[open] .more { display: none; }
.inc .upd { margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--line); }

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.foot a { color: var(--maint); text-decoration: none; }

/* popover */
.pop { position: absolute; z-index: 40; width: min(320px, calc(100vw - 24px)); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 40px 16px 18px; box-shadow: 0 24px 50px -20px rgba(28,26,23,.35); font-size: 15px; }
.pop::before { content: ""; position: absolute; top: -7px; left: var(--ax, 50%); width: 12px; height: 12px; background: #fff; border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.pop.below::before { display: block; } .pop.above::before { top: auto; bottom: -7px; transform: translateX(-50%) rotate(225deg); }
.pop-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; background: var(--sand); border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); }
.pop b { display: block; margin-bottom: 4px; }
.pop p { margin: 0; color: var(--body); }
.pop .pi { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.pop .pi strong { display: block; font-size: 14px; }
.pop .pi span { font-size: 13px; color: var(--muted); }

/* history page */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.tabs button { border: 0; background: none; padding: 12px 18px; font-size: 16px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.pg { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink); }
.pg:disabled { opacity: .35; cursor: default; }
.pg-label { font-size: 17px; text-align: center; }
.month { padding: 26px 0 4px; }
.month h3 { margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 17px; }
.pick select { width: 100%; appearance: none; -webkit-appearance: none; border: 0; border-radius: 12px; background: var(--sand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C1A17' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E") right 16px center / 18px no-repeat; padding: 15px 48px 15px 18px; font: inherit; font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 18px; }
.cals { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 28px; }
.cal-h { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 10px; }
.cal-h b { font-size: 16px; } .cal-h span { font-size: 13px; color: var(--muted); }
.grid7 { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 5px; }
.cell { aspect-ratio: 1; border: 0; padding: 0; border-radius: 4px; background: var(--none); cursor: pointer; }
.cell.up { background: var(--up); } .cell.degraded { background: var(--degraded); } .cell.partial { background: var(--partial); } .cell.down { background: var(--down); }
.cell.blank { visibility: hidden; cursor: default; }
.cell.future { background: #F3F0EB; cursor: default; }

@media (max-width: 760px) { .cals { grid-template-columns: minmax(0, 1fr); gap: 4px; } .cals .grid7 { max-width: 340px; } .cals .cal-h { max-width: 340px; } }
@media (max-width: 600px) {
  body { font-size: 15px; }
  .top-in { min-height: 96px; }
  .logo img { height: 38px; } .logo-t { font-size: 18px; }
  main.wrap { padding-top: 26px; }
  .banner { font-size: 17px; padding: 18px; }
  .comp { padding: 16px 16px 14px; }
  .group-kids { margin: 12px -16px -14px; } .group-kids .comp { padding-left: 28px; }
  .bars { gap: 2px; height: 32px; }
  .chart { padding: 16px; }
  .axis { font-size: 12px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
