:root {
  --bg: #15130f;
  --panel: #1f1c17;
  --line: #34302a;
  --text: #ece6da;
  --muted: #9b9384;
  --gold: #d6b25e;
  --sell: #e07a5f;
  --buy: #5fb3a1;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

main, .top, .foot { max-width: 560px; margin: 0 auto; padding: 0 16px; }

.top { padding-top: 20px; padding-bottom: 8px; }
.top h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; color: var(--gold); }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}
.card h3 { margin: 0 0 10px; font-size: 16px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.search-row { display: flex; gap: 8px; }
input[type="search"], select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
input[type="search"] { flex: 1; min-width: 0; padding: 12px 14px; font-size: 17px; }
input[type="search"]:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

button, .file-btn {
  background: var(--gold);
  color: #1a1610;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.file-btn { display: inline-flex; align-items: center; height: 44px; }
.file-btn input { display: none; }

.filters { display: flex; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.filters label { display: flex; align-items: center; gap: 6px; }
.filters select { padding: 6px 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chips:empty { display: none; }
.chip {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 400;
  font-size: 14px;
}

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid;
  border-radius: var(--radius);
  padding: 14px;
}
.stat.sell { border-top-color: var(--sell); }
.stat.buy { border-top-color: var(--buy); }
.stat h2 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.big { margin: 4px 0 2px; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.range { margin: 0; font-size: 13px; color: var(--muted); white-space: pre-line; }

.note { margin: 8px 2px 0; font-size: 13px; color: var(--muted); }
.note:empty { display: none; }

#chart svg { display: block; width: 100%; height: auto; }
.legend { margin: 6px 0 0; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 6px; }
.dot.sell { background: var(--sell); }
.dot.buy { background: var(--buy); }

.muted { color: var(--muted); font-weight: 400; font-size: 14px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.row1 { display: flex; align-items: baseline; gap: 8px; }
.tag { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; }
.tag.sell { background: rgba(224, 122, 95, .18); color: var(--sell); }
.tag.buy { background: rgba(95, 179, 161, .18); color: var(--buy); }
.tag.krw { background: rgba(214, 178, 94, .18); color: var(--gold); }
.stat.krw { border-top-style: dashed; }
.tag.unknown { background: rgba(155, 147, 132, .18); color: var(--muted); }
.price { font-weight: 800; font-variant-numeric: tabular-nums; }
.when { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.snippet { margin: 2px 0 0; font-size: 14px; color: var(--muted); word-break: break-all; }
.tel { display: inline-block; margin-top: 6px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--gold); text-decoration: none; font-size: 14px; font-variant-numeric: tabular-nums; }
.more { width: 100%; height: 40px; margin-top: 8px; background: transparent; color: var(--gold); border: 1px solid var(--line); }

.status { margin: 10px 0 0; font-size: 14px; color: var(--gold); }
.status:empty { display: none; }

details { margin-top: 12px; font-size: 14px; }
summary { cursor: pointer; color: var(--gold); }
details ol { padding-left: 20px; }

.rooms { list-style: none; margin: 12px 0 0; padding: 0; }
.rooms li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.rooms .name { font-weight: 700; }
.rooms .meta { color: var(--muted); font-size: 12px; }
.rooms button { margin-left: auto; background: transparent; color: var(--muted); border: 1px solid var(--line); height: 32px; padding: 0 12px; font-weight: 400; }

.empty { color: var(--muted); text-align: center; padding: 12px 0; margin: 0; }

.foot { color: var(--muted); font-size: 12px; padding-top: 8px; padding-bottom: 32px; }
.foot p { margin: 4px 0; }
