* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex; flex-direction: column;
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1c1f24; background: #f4f5f7;
}
header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  background: #14213d; color: #fff;
}
h1 { font-size: 17px; margin: 0; font-weight: 600; flex: 1 1 auto; }
nav { display: flex; gap: 4px; }
button { font: inherit; cursor: pointer; }
.tab {
  min-height: 40px; padding: 6px 16px; border: 0; border-radius: 20px;
  background: transparent; color: #cfd6e4;
}
.tab.active { background: #fff; color: #14213d; font-weight: 600; }
.status {
  display: flex; align-items: center; gap: 6px; min-height: 40px;
  padding: 6px 10px; border: 1px solid #3a4a6b; border-radius: 20px;
  background: transparent; color: #cfd6e4; font-size: 13px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: #9aa3b2; flex: none; }
.dot.ok { background: #2e7d32; }
.dot.warn { background: #f9a825; }
.dot.bad { background: #c62828; }
.panel { background: #fff; border-bottom: 1px solid #d9dde3; padding: 8px 12px; }
.panel[hidden] { display: none; }
.controls { display: flex; gap: 12px; flex-wrap: wrap; }
.controls label { display: flex; flex-direction: column; font-size: 12px; color: #555d6b; }
.controls select { min-height: 40px; font: inherit; font-size: 15px; padding: 4px 8px; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; font-size: 14px; }
dt { color: #555d6b; }
dd { margin: 0; }
main { flex: 1 1 auto; min-height: 200px; }
.notice {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 1000; max-width: 80%; padding: 10px 16px; border-radius: 8px;
  background: rgba(20, 33, 61, .88); color: #fff; text-align: center; pointer-events: none;
}
.notice[hidden] { display: none; }
footer {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 6px 12px; padding-bottom: max(6px, env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid #d9dde3; font-size: 13px; color: #555d6b;
}
footer label { display: flex; align-items: center; gap: 6px; min-height: 36px; }
.note { flex: 1 1 auto; text-align: right; }
.popup b { display: block; font-size: 15px; margin-bottom: 2px; }
.popup div { color: #444; }
.legend {
  background: #fff; padding: 6px 8px; border-radius: 6px; font-size: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3); line-height: 1.6;
}
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.legend .age0 { background: #d32f2f; }
.legend .age1 { background: #f57c00; }
.legend .age2 { background: #fbc02d; }
@media (max-width: 560px) {
  h1 { font-size: 15px; flex-basis: 100%; }
  .note { text-align: left; }
}
