/* Design system (Notion: AI Cowork / AI Skills / Design System): blue-gray tokens, Pretendard,
   Phosphor icons, borderless shadowless cards separated by background color only. */
@font-face { font-family: 'Pretendard'; font-weight: 400; font-display: swap; src: local('Pretendard Regular'), url(/fonts/Pretendard-Regular.subset.woff2) format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 500; font-display: swap; src: local('Pretendard Medium'), url(/fonts/Pretendard-Medium.subset.woff2) format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 600; font-display: swap; src: local('Pretendard SemiBold'), url(/fonts/Pretendard-SemiBold.subset.woff2) format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 700; font-display: swap; src: local('Pretendard Bold'), url(/fonts/Pretendard-Bold.subset.woff2) format('woff2'); }

:root {
  --paper: #f2f5f9;
  --card: #ffffff;
  --ink: #1a2130;
  --muted: #5d6879;
  --rule: #e6ecf5;
  --rule-strong: #d6e0ee;
  --accent: #3c62a6;
  --accent-soft: #e7edf7;
  --accent-line: #b8c8e3;
  --ok: #2f8f5b;
  --ok-soft: #e3f3ea;
  --warn: #c27c0e;
  --warn-soft: #fbf0dc;
  --bad: #c8423b;
  --bad-soft: #fae6e4;
  --none: var(--rule);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #11151c; --card: #1a1f28; --ink: #e6eaf1; --muted: #97a2b4; --rule: #232c3b; --rule-strong: #2e3a50;
    --accent: #8daee8; --accent-soft: #1d2940; --accent-line: #3a4e73;
    --ok: #5cc48b; --ok-soft: #173326; --warn: #e3a64a; --warn-soft: #382a12; --bad: #ef7a72; --bad-soft: #3a1c1b;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #11151c; --card: #1a1f28; --ink: #e6eaf1; --muted: #97a2b4; --rule: #232c3b; --rule-strong: #2e3a50;
  --accent: #8daee8; --accent-soft: #1d2940; --accent-line: #3a4e73;
  --ok: #5cc48b; --ok-soft: #173326; --warn: #e3a64a; --warn-soft: #382a12; --bad: #ef7a72; --bad-soft: #3a1c1b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 13.5px/1.5 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.ph { width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-right: 0.35em; flex: none; }

.top {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--paper) 60%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.top-inner { max-width: 760px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; font-weight: 600; font-size: 14px; }
.top-inner .ph { color: var(--accent); }
.top-sub { color: var(--muted); font-weight: 400; margin-left: 6px; }

main { max-width: 760px; margin: 0 auto; padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 12px; }

.card { background: var(--card); border-radius: 16px; padding: 18px 20px; }
.card h2 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }

.overall { display: flex; align-items: center; gap: 4px; }
.overall h1 { margin: 0; font-size: 19px; font-weight: 700; }
.overall .sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.ph-overall { width: 34px; height: 34px; margin-right: 12px; }
[data-state='up'] > .ph-overall, [data-state='up'] .ph-status { color: var(--ok); }
[data-state='degraded'] > .ph-overall, [data-state='degraded'] .ph-status { color: var(--warn); }
[data-state='down'] > .ph-overall, [data-state='down'] .ph-status { color: var(--bad); }
[data-state='unknown'] > .ph-overall, [data-state='unknown'] .ph-status, [data-state='resolved'] .ph-status { color: var(--muted); }

.checks, .incidents { list-style: none; margin: 0; padding: 0; }
.check { padding: 12px 0; }
.check + .check { border-top: 1px solid var(--rule); }
.check-head { display: flex; align-items: center; gap: 2px; min-width: 0; }
.check-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-link { width: 0.95em; height: 0.95em; margin: 0 0 0 4px; color: var(--muted); vertical-align: -0.12em; }
.uptime { color: var(--muted); font-size: 12px; }

.bars { display: flex; gap: 2px; height: 26px; margin: 8px 0 6px; }
.bar { flex: 1; min-width: 2px; border-radius: 2px; background: var(--ok); }
.bar[data-s='warn'] { background: var(--warn); }
.bar[data-s='bad'] { background: var(--bad); }
.bar[data-s='none'] { background: var(--none); }
.check-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11.5px; }
.check-meta > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.range { white-space: nowrap; }
.range-30 { display: none; }

.incident { display: flex; align-items: flex-start; gap: 2px; padding: 10px 0; }
.incident + .incident { border-top: 1px solid var(--rule); }
.incident .ph-status { margin-top: 2px; }
.incident-title { font-weight: 600; }
.incident-meta { color: var(--muted); font-size: 12px; }
.empty { margin: 4px 0 0; color: var(--muted); }

footer { max-width: 760px; margin: 0 auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 11.5px; text-align: center; }

/* Phone width: last 30 days only, so bars stay readable without horizontal scrolling. */
@media (max-width: 520px) {
  .bar:nth-child(-n + 60) { display: none; }
  .range-90 { display: none; }
  .range-30 { display: inline; }
  .card { padding: 16px; }
}
