:root {
  --bg: #0e1116; --card: #171b22; --card2: #1d222b; --line: #2a303a;
  --text: #f2f4f7; --muted: #9aa4b2; --up: #34d378; --down: #ff5c5c; --accent: #4c9aff;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 18px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.top { padding: 20px 18px 8px; }
h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.gate-label { margin: 4px 0 0; color: var(--muted); font-size: 16px; }

main { flex: 1; padding: 8px 14px 16px; max-width: 640px; width: 100%; margin: 0 auto; }

.add { display: flex; gap: 10px; }
.add input {
  flex: 1; min-width: 0; height: 56px; padding: 0 16px; font-size: 20px; text-transform: uppercase;
  color: var(--text); background: var(--card); border: 2px solid var(--line); border-radius: 14px; outline: none;
}
.add input::placeholder { text-transform: none; color: #6b7482; }
.add input:focus { border-color: var(--accent); }
.btn {
  height: 56px; padding: 0 20px; font-size: 19px; font-weight: 700; border: 0; border-radius: 14px;
  color: var(--text); background: var(--card2); cursor: pointer; touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn-add { background: var(--accent); color: #fff; min-width: 88px; }
.form-msg { min-height: 24px; margin: 6px 4px 2px; color: var(--down); font-size: 16px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 12px; }
.status { color: var(--muted); font-size: 15px; }
.btn-refresh { height: 48px; font-size: 17px; }
.btn-refresh.spinning { opacity: 0.6; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.row {
  display: grid; grid-template-columns: 1fr auto 52px; align-items: center; gap: 10px;
  background: var(--card); border-radius: var(--radius); padding: 16px 12px 16px 16px;
}
.sym { font-size: 24px; font-weight: 800; letter-spacing: 0.01em; }
.name { color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.when { color: var(--muted); font-size: 14px; margin-top: 4px; }
.px { text-align: right; }
.price { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chg { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ah { font-size: 14px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }
.err { color: var(--muted); font-size: 15px; }

.del {
  width: 52px; height: 52px; border-radius: 12px; border: 0; background: var(--card2); color: var(--muted);
  font-size: 22px; font-weight: 700; cursor: pointer; touch-action: manipulation;
}
.del.confirm { background: var(--down); color: #fff; font-size: 13px; line-height: 1.1; }

.empty { color: var(--muted); text-align: center; margin-top: 30px; }

.closed { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.moon { font-size: 72px; line-height: 1; margin-bottom: 12px; color: #c9d4ff; }
.closed h2 { font-size: 28px; margin: 0 0 10px; }
.closed-msg { font-size: 22px; font-weight: 600; margin: 0 0 16px; }
.closed-hours { color: var(--muted); font-size: 17px; margin: 0; }

.foot { color: #6b7482; font-size: 13px; text-align: center; padding: 14px 16px 18px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #2b313c; color: var(--text); padding: 12px 14px 12px 18px; border-radius: 14px; font-size: 17px;
  display: flex; align-items: center; gap: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.4); max-width: 92vw;
}
.toast button { background: none; border: 0; color: var(--accent); font-size: 17px; font-weight: 700; padding: 8px; cursor: pointer; }
