:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --line: #e2e5ea;
  --text: #1a1d21;
  --muted: #6b7280;
  --accent: #16a34a;
  --accent-soft: #e8f8ee;
  --warn: #b45309;
  --warn-bg: #fff7ed;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
}

.wrap {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sub {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.pill {
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}
.pill.ok { color: #15803d; border-color: #bbf7d0; background: var(--accent-soft); }

.search {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.search input {
  flex: 1;
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22,163,74,0.12); }
.search button {
  border: 0;
  border-radius: 8px;
  padding: 0.7rem 1.1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.search button:disabled { opacity: 0.55; cursor: wait; }

.status {
  min-height: 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.banner {
  display: none;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--warn-bg);
  border: 1px solid #fdba74;
  color: var(--warn);
  font-size: 0.88rem;
}
.banner.show { display: block; }

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: baseline;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
}
.summary .kw {
  font-weight: 700;
  font-size: 1.05rem;
  margin-right: 0.25rem;
}
.summary .metric {
  color: var(--muted);
  font-size: 0.88rem;
}
.summary .metric b {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.95rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.85rem 0.4rem;
  margin-bottom: 0.85rem;
}
.panel h2 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 700;
}
.panel h2 span {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  padding: 0.48rem 0.35rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  white-space: nowrap;
}
td.num, th.num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
tbody tr:hover { background: #fafbfc; }

.chart {
  width: 100%;
  height: 140px;
  display: block;
}

.hidden { display: none !important; }
