:root {
  --orange: #f26b1d;
  --orange-soft: #fff1e8;
  --text: #1f2430;
  --muted: #6b7280;
  --line: #ececec;
  --bg: #fafaf8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

main { max-width: 960px; margin: 0 auto; padding: 40px 16px 24px; }

.eyebrow { margin: 0; color: var(--orange); font-weight: 700; font-size: 14px; }
h1 { margin: 4px 0 8px; font-size: clamp(28px, 5vw, 40px); }
h2 { margin: 0 0 12px; font-size: 18px; }
h2 small { color: var(--muted); font-weight: 400; font-size: 14px; }
.lead { margin: 0 0 24px; color: var(--muted); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }

select, button {
  font: inherit;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #d9d9d9;
  padding: 0 12px;
  background: #fff;
}

select:focus-visible, button:focus-visible { outline: 3px solid var(--orange-soft); border-color: var(--orange); }

button {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  font-weight: 700;
  padding: 0 28px;
  cursor: pointer;
}
button:disabled { opacity: .6; cursor: wait; }

.status { min-height: 1.6em; color: var(--muted); }
.status.error { color: #c0392b; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stats .card { margin-bottom: 0; }
.stat span { display: block; color: var(--muted); font-size: 14px; }
.stat strong { font-size: 22px; }
#s-change.up { color: var(--orange); }
#s-change.down { color: #2563eb; }
.warn { margin: -4px 0 16px; padding: 10px 14px; border-radius: 10px; background: var(--orange-soft); color: #9a3c06; font-size: 14px; }

.chart { position: relative; height: 360px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 14px; }

.notes ul { margin: 0; padding-left: 20px; color: var(--muted); }

footer { color: var(--muted); font-size: 13px; }

@media (max-width: 720px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .controls button { grid-column: 1 / -1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .chart { height: 280px; }
}
