* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #1a1a2e; color: #eee; font-family: 'Segoe UI', sans-serif; }
body { display: flex; flex-direction: column; padding: 16px 12px; gap: 6px; }

.header { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.header h1 { font-size: clamp(0.95rem, 3vw, 1.2rem); color: #a8dadc; }
.header h1 a { color: inherit; text-decoration: none; }
.header h1 a:hover { opacity: 0.75; }
.header .meta { font-size: 0.74rem; color: #7a7a99; text-align: right; }

.cards { display: flex; gap: 8px; flex-shrink: 0; }
.card { flex: 1; background: #0f3460; border-radius: 8px; padding: 6px 12px; display: flex; flex-direction: column; justify-content: center; gap: 2px; height: 72px; }
.card .val { font-size: 1.4rem; font-weight: bold; white-space: nowrap; }
.card .lbl { font-size: 0.98rem; color: #9999b8; }

.tab-bar { display: flex; gap: 6px; flex-shrink: 0; }
.tab-btn { padding: 4px 18px; border-radius: 6px; border: 1px solid #1a4a8a; background: #0f3460; color: #fb923c; font-size: 0.8rem; cursor: pointer; }
.tab-btn.active { background: #1a4a8a; color: #fff; }
.tab-btn:hover { background: #1a4a8a; }

.charts { flex: 1; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.chart-wrap { flex: 1; background: #16213e; border-radius: 10px; padding: 6px 10px 4px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chart-wrap h2 { font-size: 12px; color: #9999b8; margin-bottom: 2px; flex-shrink: 0; }
@media (min-width: 768px) {
  .chart-wrap h2 { font-size: 1.02rem; }
}
.chart-wrap canvas { flex: 1; min-height: 0; display: block; width: 100%; }

.slider-wrap { flex-shrink: 0; padding: 2px 0; }
.slider-row { display: flex; align-items: center; gap: 8px; }
.slider-row input[type=range] { flex: 1; height: 4px; accent-color: #fb923c; cursor: pointer; }
.slider-label { font-size: 1.13rem; color: #d6d6f5; white-space: nowrap; min-width: 115px; text-align: right; }
.btn-now { background: #0f3460; border: 1px solid #1a4a8a; color: #fb923c; border-radius: 6px; padding: 3px 10px; font-size: 0.7rem; cursor: pointer; white-space: nowrap; }
.btn-now:hover { background: #1a4a8a; }

#tip { position: fixed; background: rgba(15,52,96,0.95); border: 1px solid #1a4a8a;
  border-radius: 6px; padding: 5px 9px; font-size: 0.75rem; color: #eee;
  pointer-events: none; display: none; white-space: nowrap; z-index: 50; line-height: 1.6; }

.set-wrap { flex-shrink: 0; background: #16213e; border-radius: 10px; padding: 12px 16px; }
.set-wrap h3 { font-size: 0.82rem; color: #7a7a99; margin-bottom: 8px; }
.set-row { display: flex; align-items: center; gap: 8px; }
.set-row input { background: #0f3460; border: 1px solid #1a4a8a; border-radius: 6px;
  color: #eee; padding: 6px 10px; font-size: 0.95rem; width: 130px; }
.set-unit { color: #7a7a99; font-size: 0.85rem; }
.set-btn { background: #1a4a8a; border: none; border-radius: 6px; color: #eee;
  padding: 6px 16px; font-size: 0.9rem; cursor: pointer; }
.set-btn:hover { background: #2563b0; }
#setMsg { margin-top: 6px; font-size: 0.82rem; min-height: 1.2em; }
