:root {
  --ink: #1d1d1f; --muted: #6a6a6f; --brand: #cc3338; --line: #e5e5ea; --bg: #fff;
  /* home page: cards, charts (SPEC 9.25). One series color; status colors only for state, always with an icon and a word. */
  --card: #f5f5f7; --grid: #dcdce1; --axis: #c7c7cc; --seg: #e3e3e8; --seg-on: #fff; --row-on: #e8e8ed;
  --series: #2a78d6; --wash: rgba(42, 120, 214, 0.1); --spark: #aeaeb2; --nodata: #d1d1d6;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --up: #cc3338; --down: #1c5cab; --tip: #fff; --tip-line: rgba(0, 0, 0, 0.1);
}
/* Rises and falls: red up and blue down as Korean stock apps show them; green up and red down in English. */
html[lang="en"] { --up: #007a1f; --down: #cc3338; }
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f5f7; --muted: #a1a1a6; --brand: #ff6366; --line: #38383a; --bg: #000;
    --card: #1c1c1e; --grid: #38383a; --axis: #48484a; --seg: #2c2c2e; --seg-on: #636366; --row-on: #2c2c2e;
    --series: #3987e5; --wash: rgba(57, 135, 229, 0.14); --spark: #636366; --nodata: #3a3a3c;
    --up: #ff6366; --down: #6da7ec; --tip: #2c2c2e; --tip-line: rgba(255, 255, 255, 0.12);
  }
  html[lang="en"] { --up: #30c754; --down: #ff6366; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Apple SD Gothic Neo", sans-serif; -webkit-text-size-adjust: 100%; }
:lang(ko) body, body:lang(ko) { word-break: keep-all; }
header, main, footer { max-width: 720px; margin: 0 auto; padding: 0 20px; }
header { display: flex; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
nav a { color: var(--muted); text-decoration: none; margin-left: 16px; font-size: 15px; white-space: nowrap; }
h1 { font-size: 34px; line-height: 1.2; letter-spacing: -0.02em; margin: 28px 0 6px; text-wrap: balance; }
h2 { font-size: 21px; margin: 34px 0 8px; }
.date, .lead { color: var(--muted); }
.lead { font-size: 19px; text-wrap: pretty; }
ul { padding-left: 22px; }
li { margin: 4px 0; }
a { color: var(--brand); }
.box { border: 1px solid var(--line); border-radius: 16px; padding: 4px 18px; margin: 18px 0; }
footer { color: var(--muted); font-size: 14px; padding-top: 30px; padding-bottom: 40px; border-top: 1px solid var(--line); margin-top: 48px; }
.hero { text-align: center; padding: 40px 0 10px; }
.hero > img { width: 120px; height: 120px; border-radius: 27px; box-shadow: 0 12px 30px rgba(204, 51, 56, 0.25); }
.hero h1 { font-size: 40px; margin-top: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- home page */
.home header, .home main, .home footer { max-width: 980px; }
.home .hero .lead { max-width: 640px; margin: 0 auto; }
.get { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 26px; }
.store { display: inline-block; border-radius: 9px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.store img { display: block; height: 50px; width: auto; }
.store:focus-visible { outline: 2px solid var(--series); outline-offset: 3px; }
.store-note { margin: 0; font-size: 14px; color: var(--muted); transition: color 0.2s; }
.store-note.flash { color: var(--ink); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 56px 0 0; }
.feature { background: var(--card); border-radius: 20px; padding: 22px 20px 20px; }
.feature svg { display: block; width: 30px; height: 30px; color: var(--brand); }
.feature h3 { margin: 12px 0 4px; font-size: 18px; line-height: 1.3; }
.feature p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }

.board { margin-top: 60px; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.board h2 { margin: 0; font-size: 28px; letter-spacing: -0.01em; }
.live-meta { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--nodata); flex: none; }
.dot.good { background: var(--good); }
.dot.warning { background: var(--warning); }
.dot.critical { background: var(--critical); }
.dot.pulse { animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.5); } 70%, 100% { box-shadow: 0 0 0 9px rgba(12, 163, 12, 0); } }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.kpi { display: flex; flex-direction: column; min-width: 0; background: var(--card); border-radius: 18px; padding: 16px 16px 14px; }
.kpi-label { font-size: 14px; line-height: 1.35; color: var(--muted); }
.kpi-value { margin-top: 4px; font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.kpi-unit { margin-left: 2px; font-size: 18px; font-weight: 600; letter-spacing: 0; }
.kpi-sub { margin-top: 4px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.mini { display: block; flex: none; width: 100%; height: 24px; margin-top: auto; padding-top: 10px; box-sizing: content-box; }
.mini .past { fill: var(--spark); }
.mini .zero { fill: var(--grid); }
.mini .today { fill: var(--series); }
.note { margin: 10px 2px 0; font-size: 13px; line-height: 1.55; color: var(--muted); }

.card { background: var(--card); border-radius: 22px; padding: 20px 20px 16px; margin-top: 14px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.card h3 { margin: 0; font-size: 20px; line-height: 1.3; }
.card h4 { margin: 0; font-size: 16px; line-height: 1.3; }
.sub { margin: 2px 0 0; font-size: 14px; line-height: 1.4; color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: 9px; background: var(--seg); }
.seg button { min-height: 30px; padding: 4px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.seg button[aria-pressed="true"] { background: var(--seg-on); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
button:focus-visible, .chart:focus-visible, .ticker:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; }

.quote { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin: 16px 0 8px; }
.quote-name { width: 100%; font-size: 14px; font-weight: 600; }
.price { font-size: 44px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.delta { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }
.range-name { font-size: 14px; color: var(--muted); }

.chart { position: relative; margin: 0 -4px; touch-action: pan-y; -webkit-user-select: none; user-select: none; border-radius: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .wash-top { stop-color: var(--series); stop-opacity: 0.16; }
.chart .wash-bottom { stop-color: var(--series); stop-opacity: 0; }
.chart .dot-mark { fill: var(--series); stroke: var(--card); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .fail-mark { fill: var(--critical); }
.tip { position: absolute; z-index: 2; max-width: 260px; padding: 7px 11px; border: 1px solid var(--tip-line); border-radius: 11px; background: var(--tip); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14); font-size: 13px; line-height: 1.4; pointer-events: none; white-space: nowrap; }
.tip strong { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.tip span { display: block; color: var(--muted); }

.tickers { margin-top: 14px; border-top: 1px solid var(--grid); }
.ticker { display: grid; grid-template-columns: minmax(0, 1fr) auto 76px 84px; align-items: center; gap: 12px; width: 100%; padding: 10px 10px; border: 0; border-bottom: 1px solid var(--grid); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ticker[aria-pressed="true"] { background: var(--row-on); border-radius: 10px; }
.t-name { min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.t-src { display: block; overflow: hidden; font-size: 12px; font-weight: 400; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.t-val { font-size: 15px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.t-chg { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-chg.flat { color: var(--muted); }
.spark { display: block; width: 84px; height: 28px; }
.spark-line { fill: none; stroke: var(--spark); stroke-width: 1.5; stroke-linejoin: round; }
.spark-end { fill: var(--series); }

.link { margin-top: 12px; padding: 4px 0; border: 0; background: none; color: var(--brand); font: inherit; font-size: 14px; cursor: pointer; }
.ping .link { margin: 0; padding: 0; font-size: 13px; }
.ping-result { display: block; margin-top: 2px; color: var(--ink); }
.pill { padding: 8px 16px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.empty { padding: 22px 0 8px; }
.empty p { margin: 0 0 10px; color: var(--muted); }

.table-wrap { margin-top: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.data th, .data td { padding: 7px 10px; border-bottom: 1px solid var(--grid); text-align: left; font-weight: 400; }
.data thead th { color: var(--muted); font-weight: 600; }
.data .num { text-align: right; font-variant-numeric: tabular-nums; }

.summary { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.state-icon { width: 17px; height: 17px; flex: none; }
.state-icon.good { fill: var(--good); }
.state-icon.warning { fill: var(--warning); }
.state-icon.critical { fill: var(--critical); }
.state-icon.unknown { fill: var(--spark); }
.services { margin: 12px 0 0; padding: 0; list-style: none; }
.service { margin: 0; padding: 12px 0 10px; border-top: 1px solid var(--grid); }
.svc-top { display: flex; align-items: center; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.svc-name { font-size: 15px; font-weight: 600; }
.svc-right { display: inline-flex; align-items: center; gap: 12px; }
.svc-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc-state { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; }
.bars-wrap { position: relative; margin-top: 8px; }
.bars { display: flex; gap: 2px; height: 30px; cursor: default; touch-action: pan-y; }
.bar { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--nodata); }
.bar.good { background: var(--good); }
.bar.warning { background: var(--warning); }
.bar.serious { background: var(--serious); }
.bar.critical { background: var(--critical); }
.bar.on { opacity: 0.6; }
.bars-tip { bottom: 38px; }
.bars-axis { display: flex; justify-content: space-between; margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.latency-head { align-items: center; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--grid); }
.latency-head + .chart { margin-top: 10px; }

@media (max-width: 760px) {
  .features { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .home .hero h1 { font-size: 32px; }
  .home .lead { font-size: 17px; }
  .kpi-value { font-size: 28px; }
  .price { font-size: 36px; }
  .card { padding: 16px 14px 12px; border-radius: 20px; }
  .ticker { grid-template-columns: minmax(0, 1fr) auto 60px; gap: 10px; padding: 10px 6px; }
  .t-spark { display: none; }
  nav a { margin-left: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .dot.pulse { animation: none; }
  .store-note { transition: none; }
}
