:root {
  --up: #f6465d;
  --down: #2f80ed;
  --flat: #a8b0bd;
  --text: #f2f4f8;
  --muted: #8b93a7;
  --bg: #12141a;
  --card: rgba(32, 36, 46, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

body {
  padding: calc(12px + var(--safe-top)) 12px calc(16px + var(--safe-bottom));
}

.app {
  max-width: 560px;
  margin: 0 auto;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.3px;
}

.muted,
.hint,
.foot,
.meta {
  color: var(--muted);
}

.hint,
.foot,
.meta {
  font-size: 12px;
  line-height: 1.4;
}

.install {
  flex-shrink: 0;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(246, 70, 93, 0.18);
  color: var(--up);
  font-weight: 700;
  font-size: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 10px;
  padding: 10px 10px 6px;
}

.section-title {
  margin: 0 4px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--muted);
  text-transform: uppercase;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 4px;
  min-height: 52px;
}

.row.clickable {
  cursor: pointer;
}

.name {
  font-size: 14px;
  font-weight: 600;
}

.values {
  text-align: right;
  min-width: 92px;
}

.price {
  font-size: 15px;
  font-weight: 700;
}

.chg {
  font-size: 12px;
}

.up {
  color: var(--up);
}

.down {
  color: var(--down);
}

.flat {
  color: var(--flat);
}

.spark {
  width: 120px;
  height: 44px;
  display: block;
}

.proxy {
  font-size: 11px;
  margin-top: 2px;
}

.grid {
  display: grid;
  grid-template-columns: 64px 1fr 1fr 1fr;
  gap: 6px 8px;
  padding: 4px 4px 8px;
  font-size: 13px;
}

.grid .head,
.grid .right {
  text-align: right;
}

.foot {
  margin: 8px 4px 0;
}

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  padding: 0 0 var(--safe-bottom);
}

.sheet[hidden] {
  display: none;
}

.sheet-card {
  width: 100%;
  background: #1b1e27;
  border-radius: 18px 18px 0 0;
  padding: 14px 14px 18px;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

#sheetCanvas {
  width: 100%;
  height: 220px;
  display: block;
  margin-top: 8px;
}
