:root {
  --bg: #07090e;
  --card-bg: #0f172a;
  --bg-elevated: #151f38;
  --bg-inset: #0b1329;
  --bg-canvas: #07090e;
  --bg-surface: #0f172a;
  --text-primary: #f8fafc;
  --brand-primary: #38bdf8;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #38bdf8;
  --accent-hover: #0284c7;
  --accent-subtle: rgba(56, 189, 248, 0.10);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
}
* { box-sizing: border-box; }
body { background-color: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; line-height: 1.6; margin: 0; padding: 32px 16px; }
.container { max-width: 960px; margin: 0 auto; }
.card { background-color: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-card); }
h1, h2, h3 { color: var(--text); margin-top: 0; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 700; }
h2 { font-size: 20px; line-height: 1.3; font-weight: 600; }
h3 { font-size: 16px; line-height: 1.4; font-weight: 600; }
.touch-target { min-height: 44px; min-width: 44px; padding: 10px 14px; font-size: 16px; border-radius: 8px; }
button.touch-target { background-color: var(--accent); color: var(--bg); font-weight: 600; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
input.touch-target, select.touch-target { background-color: var(--bg-elevated); border: 1px solid var(--border); color: var(--text); width: 100%; }
.multi-dataset-join { background-color: var(--bg-elevated); border-left: 4px solid var(--accent); padding: 20px; border-radius: 8px; margin-bottom: 24px; }
.result-box { min-height: 110px; contain: layout style; background-color: var(--bg-inset); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-top: 20px; }
.output-value { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; border: 1px solid var(--border); border-radius: 8px; margin-top: 16px; }
table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { border: 1px solid var(--border); padding: 12px; text-align: left; }
th { background-color: var(--bg-elevated); }
@media (max-width: 640px) {
  body { padding: 16px 12px; }
  .card { padding: 16px; margin-bottom: 16px; }
  .calculator-form { display: flex; flex-direction: column; gap: 12px; }
}
