/* Mobile-first. No framework, no external font, no CDN. */

:root {
  --bg: #0e1117;
  --panel: #161b24;
  --panel-2: #1c2230;
  --line: #2a3241;
  --text: #e6e9ef;
  --muted: #97a0b0;
  --accent: #5eead4;
  --warn: #fbbf24;
  --up: #4ade80;
  --down: #f87171;
  --radius: 10px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa;
    --panel: #ffffff;
    --panel-2: #f0f2f6;
    --line: #dde1e8;
    --text: #1a1f28;
    --muted: #5c6675;
    --accent: #0d9488;
    --warn: #b45309;
    --up: #15803d;
    --down: #b91c1c;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
               "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

header { padding-top: 32px; }

h1 {
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: 0.02em;
}

h2 {
  font-size: 1.15rem;
  margin: 40px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.sub { margin: 4px 0 0; color: var(--muted); }
.stamp { margin: 8px 0 0; color: var(--muted); font-size: 0.8rem; }
.lead { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; }
.foot { margin: 8px 0 0; color: var(--muted); font-size: 0.8rem; }
.muted { color: var(--muted); }

/* Channel link. One line of fact plus one link -- deliberately not styled as
   a call-to-action button, because there is nothing to sell yet. */
.channel {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  font-size: 0.85rem;
  color: var(--muted);
}
.chan-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 12px;
  text-decoration: none;
  white-space: nowrap;
}
.chan-link:hover { border-color: var(--accent); }

.sub-h {
  font-size: 0.9rem;
  margin: 18px 0 6px;
  color: var(--muted);
  font-weight: 600;
}

/* The caveat block. Deliberately visually heavy -- it must not read as
   boilerplate a visitor scrolls past. */
.notice {
  margin-top: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.notice p { margin: 0 0 8px; font-size: 0.9rem; }
.notice p:last-child { margin-bottom: 0; }

/* Tables scroll inside their own container so the page body never scrolls
   sideways on a phone. */
.tablewrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

th, td {
  padding: 9px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

thead th {
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
}

tbody tr:last-child td { border-bottom: none; }
.num { text-align: right; }
.big { color: var(--accent); font-weight: 600; }

a { color: var(--accent); }
a:hover { text-decoration: none; }

.sym { font-weight: 600; }
.ca {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  color: var(--muted);
}

details { margin-top: 16px; }
summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 6px 0;
}

/* Alerts render as cards rather than a table: each one carries three
   price/MC pairs, which does not fit a phone-width row. */
.alert {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.alert-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 8px;
}
.alert-head .sym { font-size: 1.05rem; }
.badge {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 0.78rem;
  color: var(--accent);
}
.rows { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; }
.rows dt { color: var(--muted); font-size: 0.82rem; }
.rows dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
}
.alert .ca { margin-top: 10px; word-break: break-all; white-space: normal; }

footer {
  margin: 48px 0 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}
footer p { margin: 0 0 8px; }

.err {
  background: var(--panel);
  border: 1px solid var(--down);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.88rem;
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  h1 { font-size: 1.5rem; }
  th, td { padding: 8px 10px; }
}
