



:root {
  color-scheme: dark;
  --bg: #10161c;
  --card: #18222c;
  --line: #314152;
  --text: #f4f7f8;
  --muted: #c5d0d8;
  --faint: #9aabb8;
  --gold: #e4b56a;
  --ink: #1a140c;
  --good: #47c690;
  --mid: #e3b15a;
  --bad: #ef7d7d;
  --track: #2c3b49;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input, select { font: inherit; color: inherit; }

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.kicker {
  margin: 0;
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}

h1 {
  margin: 6px 0 8px;
  font-size: 40px;
  line-height: 1.2;
}

.lede, .hint, .muted, .faint { color: var(--faint); }

.lede { margin: 0 0 24px; }

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel, .hero, .detail, .candidate {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.panel { padding: 18px; position: sticky; top: 16px; }

h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.hint { margin: 0 0 14px; font-size: 13px; }

.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.member {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.member label, .field { display: grid; gap: 4px; font-size: 13px; color: var(--faint); }

input[type="text"], input[type="number"], select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
}

input[type="range"] { width: 100%; accent-color: var(--gold); }

.fields { display: grid; gap: 14px; margin-top: 16px; }

.tools { display: flex; flex-wrap: wrap; gap: 8px; }

.tools button { font-size: 13px; min-height: 40px; padding: 0 10px; }

.tool-note { min-height: 1.4em; margin: 8px 0 0; font-size: 13px; color: var(--gold); }

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 0 0 12px;
}

.filters label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--faint);
}

.filters select { min-width: 11rem; min-height: 44px; }

.filter-count { margin: 0 0 10px; color: var(--muted); font-size: 14px; }

.empty-filter { margin: 0; }

.stepper { display: flex; align-items: center; gap: 8px; }

.stepper input[type="number"] { width: 84px; text-align: center; }

button {
  border: 0;
  border-radius: 10px;
  min-height: 44px;
  padding: 0 14px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

button.ghost, button.remove {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

button.remove { justify-self: start; }

button:disabled { opacity: 0.45; cursor: not-allowed; }

button:focus-visible, input:focus-visible, select:focus-visible, .candidate:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.results { display: grid; gap: 16px; }

.banner {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #2a2418;
  color: var(--gold);
}

.banner.error { background: #2c1c1c; color: #ffc7c7; }

.sources {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.sources h2 { margin: 0; font-size: 16px; }

.sources-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.sources ul {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.sources li { font-size: 14px; color: var(--muted); }

.pill {
  display: inline-block;
  margin: 0 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.live { background: #16382c; color: var(--good); }
.pill.estimate { background: #2a2418; color: var(--gold); }

.hero {
  padding: 0;
  border-color: var(--gold);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  overflow: hidden;
}

.hero-copy { padding: 18px 20px 16px; }

.rocket-frame { margin: 0; background: #0c1218; position: relative; }
.rocket-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rocket-frame figcaption, .rocket-fallback {
  color: var(--faint);
  font-size: 11px;
  line-height: 1.4;
}
.rocket-frame figcaption { padding: 6px 8px 8px; }
.rocket-fallback {
  display: none;
  place-items: center;
  text-align: center;
  padding: 16px;
  min-height: 120px;
  background:
    radial-gradient(circle at 50% 20%, #243044, #10161c 70%);
  color: var(--gold);
  font-weight: 700;
}
.rocket-frame.is-fallback img { display: none; }
.rocket-frame.is-fallback .rocket-fallback { display: grid; }

.rocket-hero { min-height: 220px; }
.rocket-hero img { min-height: 220px; object-position: center 35%; }
.rocket-thumb { width: 64px; height: 80px; border-radius: 10px; overflow: hidden; }
.rocket-thumb figcaption { display: none; }
.rocket-thumb img { height: 80px; }
.rocket-detail { border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.rocket-detail img { max-height: 280px; object-position: center 30%; }

.formula { margin: 8px 0 0; color: var(--gold); font-weight: 700; }

.viewing { margin: 8px 0 18px; }
.viewing h3 { margin: 0 0 4px; font-size: 18px; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.steps h4 { margin: 0 0 8px; font-size: 14px; }
.steps ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.steps li span { color: var(--faint); font-size: 12px; }
.steps li small { color: var(--muted); font-size: 12px; }

.hero .tag, .tag {
  display: inline-block;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.hero h2 { font-size: 32px; margin: 4px 0; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-top: 14px;
}

.stats strong { display: block; font-size: 26px; line-height: 1.2; }

.stats span { color: var(--faint); font-size: 13px; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.urgency-blocked { background: #3a1c1c; color: #ffb4b4; }
.urgency-now { background: #4a2618; color: #ffc2a8; }
.urgency-soon { background: #3a3018; color: #f0d7a2; }
.urgency-relaxed, .urgency-unneeded { background: #143028; color: #9ee0c0; }
.urgency-unknown, .urgency-none { background: #243140; color: #c5d0d8; }
button.mark {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
button.mark-yes { color: #9ee0c0; border-color: #1f6b4a; }
button.mark-maybe { color: #f0d7a2; border-color: #8a6a2a; }
button.mark-no { color: #ffb4b4; border-color: #8a3030; }
tr.out { opacity: 0.55; }
.money .badge { margin-top: 4px; }

.good { color: var(--good); }
.mid { color: var(--mid); }
.bad { color: var(--bad); }

.candidates { display: grid; gap: 8px; }

.candidate {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: var(--card);
  display: grid;
  grid-template-columns: 64px 36px minmax(0, 1fr) 72px minmax(120px, 168px);
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
}

.candidate[aria-pressed="true"] { border-color: var(--gold); }

.rank {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #243140;
  font-weight: 700;
}

.candidate.best .rank { background: var(--gold); color: var(--ink); }

.who small, .money small { display: block; color: var(--faint); font-size: 13px; font-weight: 400; }

.prob { font-weight: 700; font-size: 20px; }

.money { text-align: right; }

.money strong { font-size: 16px; }

.detail { padding: 18px 20px 8px; }

.meta { display: grid; gap: 6px; margin: 8px 0 14px; color: var(--muted); }

.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
  margin: 8px 0 16px;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--good);
}

.bar.mid i { background: var(--mid); }
.bar.bad i { background: var(--bad); }
.bar.muted i { background: var(--faint); }

.costs { width: 100%; border-collapse: collapse; }

.costs th {
  text-align: left;
  color: var(--faint);
  font-weight: 400;
  font-size: 13px;
  padding: 0 8px 8px 0;
}

.costs td {
  padding: 10px 8px 10px 0;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.costs .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.total-row td { font-weight: 700; }

.foot {
  margin: 18px 0 8px;
  color: var(--faint);
  font-size: 13px;
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .panel { position: static; }
  h1 { font-size: 32px; }
  .hero { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .candidate { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .rank { display: none; }
  .money { grid-column: 2 / -1; text-align: left; }
}

@media (max-width: 640px) {
  .page { width: min(100% - 20px, 1180px); }
  .sources-head { flex-wrap: wrap; }
  .costs thead { display: none; }
  .costs tr { display: block; padding: 10px 0; }
  .costs td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    padding: 3px 0;
  }
  .costs td::before { content: attr(data-label); color: var(--faint); }
  .costs .num { text-align: right; }
}
