:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --takeoff: #059669;
  --landing: #dc2626;
  --warn-bg: #fef3c7;
  --warn-text: #92400e;
  --btn: #e2e8f0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --card: #111827;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --line: #1f2937;
    --accent: #3b82f6;
    --takeoff: #10b981;
    --landing: #f87171;
    --warn-bg: #422006;
    --warn-text: #fcd34d;
    --btn: #1f2937;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}
.top {
  padding: calc(12px + env(safe-area-inset-top)) 16px 8px;
}
h1 { font-size: 1.3rem; margin: 0; }
.privacy { margin: 4px 0 0; font-size: .8rem; color: var(--muted); }

main { max-width: 560px; margin: 0 auto; padding: 0 12px 24px; }
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  margin: 12px 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
h2 { font-size: 1rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.num {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text); font-size: .8rem;
}
.hint { font-size: .8rem; color: var(--muted); margin: 8px 0 0; }

.field { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.label { font-size: .9rem; }
.seg { display: flex; background: var(--btn); border-radius: 10px; padding: 3px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 14px; border-radius: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.seg input:checked + span { background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.15); color: var(--accent); }

button, .btn {
  font: inherit;
  border: 0;
  border-radius: 12px;
  background: var(--btn);
  color: var(--text);
  min-height: 48px;
  padding: 0 14px;
  font-weight: 600;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
button:active { transform: scale(.97); }
button:disabled { opacity: .45; }
.btn { display: flex; align-items: center; justify-content: center; width: 100%; }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); margin-top: 10px; }
.btn.takeoff { background: var(--takeoff); color: #fff; }
.btn.landing { background: var(--landing); color: #fff; }
.file input { display: none; }
.link { background: none; min-height: 36px; color: var(--accent); font-weight: 500; width: 100%; }

.videoWrap { position: relative; background: #000; border-radius: 10px; overflow: hidden; }
video { display: block; width: 100%; max-height: 60vh; background: #000; }
.badge {
  position: absolute; left: 8px; top: 8px;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: .8rem; padding: 3px 8px; border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
input[type=range] { width: 100%; margin: 14px 0 6px; accent-color: var(--accent); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.steps button { font-size: 1.1rem; font-variant-numeric: tabular-nums; min-height: 56px; }
.marks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }

.adv { margin-top: 10px; font-size: .9rem; }
.adv summary { color: var(--muted); padding: 6px 0; }
select { font: inherit; width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 0 10px; margin-top: 6px; }

.big { text-align: center; margin: 4px 0 10px; }
.big .v { font-size: 3rem; font-weight: 800; margin: 0 4px; font-variant-numeric: tabular-nums; }
.k { display: block; font-size: .8rem; color: var(--muted); }
.u { font-size: .9rem; color: var(--muted); }
.sub { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: center; margin-bottom: 12px; }
.sub .v { font-size: 1.5rem; font-weight: 700; margin-right: 3px; font-variant-numeric: tabular-nums; }
.warn { background: var(--warn-bg); color: var(--warn-text); border-radius: 8px; padding: 8px 10px; font-size: .85rem; }

.trials { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .95rem; }
.trials th, .trials td { padding: 8px 4px; text-align: right; border-bottom: 1px solid var(--line); }
.trials th:first-child { text-align: left; }
.trials thead th { font-size: .75rem; color: var(--muted); font-weight: 500; }
.trials tfoot th, .trials tfoot td { font-weight: 700; border-bottom: 0; }
.trials .del { min-height: 32px; padding: 0 8px; font-size: .8rem; background: none; color: var(--muted); }
.trials .empty td { color: var(--muted); text-align: center; }

.formula { font-size: .75rem; color: var(--muted); text-align: center; }
