:root {
  --bg: #121212;
  --panel: #1e1e1e;
  --border: #333;
  --text: #f0f0f0;
  --muted: #a0a0a0;
  --accent: #4d8dff;
  --up: #3ecf8e;
  --down: #ff6b6b;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --border: #dcdfe4;
  --text: #15171a;
  --muted: #5d6570;
  --accent: #1a5fe0;
  --up: #12805a;
  --down: #c9302c;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-text-size-adjust: 100%;
}

.app { max-width: 1000px; margin: 0 auto; padding: 20px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.topbar h1 { font-size: 1.4rem; margin: 0; }
.topbar h1 span { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); }
.actions { display: flex; gap: 8px; }

.btn {
  min-height: 44px; /* comfortable touch target on iPad */
  padding: 0 16px; border: 0; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 1rem; cursor: pointer;
}
.btn.ghost { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
.btn:disabled { opacity: .6; cursor: default; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px;
}
.price h2 { margin: 0 0 6px; font-size: 1rem; color: var(--muted); font-weight: 500; }
.price .big { font-size: 2.2rem; font-weight: 700; margin: 0; }
.price .row { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }

.status { min-height: 1.2em; color: var(--muted); font-size: .85rem; margin: 10px 2px; }

.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid { grid-template-columns: 1fr 1fr; } }

.news-card h3 { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.3; }
.news-card .src { font-size: .8rem; color: var(--muted); margin: 0 0 8px; }
.news-card p.desc { margin: 0 0 10px; color: var(--muted); line-height: 1.4; }
.news-card a { color: var(--accent); text-decoration: none; font-weight: 600; }
.news-card a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
