:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #eef1f6;
  --ink: #18202c;
  --muted: #5a6577;
  --line: #dde2ea;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: #e6edfd;
  --down: #b42318;
  --down-soft: #fdecea;
  --good: #14653a;
  --warn: #8a4b00;
  --warn-soft: #fdf2e0;
  --c-gulliver: #1d4ed8;
  --c-navikuru: #c2410c;
  --c-zba: #0f766e;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b;
    --panel: #171e28;
    --panel-2: #1f2834;
    --ink: #e6ebf2;
    --muted: #9aa6b6;
    --line: #2b3542;
    --accent: #7aa2ff;
    --accent-ink: #0b1530;
    --accent-soft: #1b2a4d;
    --down: #ff8a80;
    --down-soft: #3a1d1b;
    --good: #6fd39a;
    --warn: #f5b45a;
    --warn-soft: #332611;
    --c-gulliver: #7aa2ff;
    --c-navikuru: #fb923c;
    --c-zba: #2dd4bf;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141b; --panel: #171e28; --panel-2: #1f2834; --ink: #e6ebf2; --muted: #9aa6b6; --line: #2b3542;
  --accent: #7aa2ff; --accent-ink: #0b1530; --accent-soft: #1b2a4d; --down: #ff8a80; --down-soft: #3a1d1b;
  --good: #6fd39a; --warn: #f5b45a; --warn-soft: #332611;
  --c-gulliver: #7aa2ff; --c-navikuru: #fb923c; --c-zba: #2dd4bf; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px; line-height: 1.7;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }

.site-head { background: var(--panel); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 18px; }
.logo svg { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.tagline { color: var(--muted); font-size: 13px; margin-left: auto; }

.hero { padding-top: 28px; padding-bottom: 8px; }
.hero h1 { font-size: clamp(22px, 5.6vw, 30px); line-height: 1.4; margin: 0 0 10px; }
.lead { margin: 0 0 12px; color: var(--muted); }
.points { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; }
.points li { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 12px; font-size: 13px; font-weight: 600; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.form { display: grid; gap: 16px; }
.field label, .field .label { display: block; font-weight: 700; margin-bottom: 6px; }
.opt { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
select, input[type="number"] {
  width: 100%; font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 46px;
}
select:disabled { background: var(--panel-2); color: var(--muted); }
select:focus-visible, input:focus-visible, .btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; border-color: var(--accent); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.unit { position: relative; }
.unit input { padding-right: 48px; }
.unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg label { margin: 0; font-weight: 600; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 10px 22px; cursor: pointer; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + span { outline: 3px solid var(--accent-soft); outline-offset: -3px; }
.btn {
  font: inherit; font-weight: 700; font-size: 17px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); padding: 14px 18px; min-height: 52px;
}
.btn:disabled { opacity: .6; cursor: progress; }
.fine { margin: 0; color: var(--muted); font-size: 13px; }
.error { margin: 0; color: var(--down); background: var(--down-soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; }

.shoot { display: grid; gap: 10px; text-align: center; }
.btn-shoot { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 19px; min-height: 60px; }
.btn-shoot svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.btn-sub { color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; justify-self: center; padding: 4px 8px; }
.file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file:focus-visible + .btn-sub, .btn-shoot:focus-within { outline: 3px solid var(--accent-soft); }
.shoot .hint { text-align: left; }
.safe { margin: 0; font-size: 13px; color: var(--good); text-align: left; }
.safe::before { content: "🔒 "; }
.shoot-status { text-align: left; border-top: 1px solid var(--line); padding-top: 12px; }
.shoot-status p { margin: 0 0 6px; }
.shoot-status dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 6px 0 10px; }
.shoot-status dt { color: var(--muted); }
.shoot-status dd { margin: 0; font-weight: 700; }
.cands { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.cand { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.cand[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.form-title { font-size: 16px; margin: 22px 0 8px; }
.field.filled select, .field.filled input { border-color: var(--good); }
.next { outline: 3px solid var(--accent-soft); border-radius: 12px; }

.result { padding-top: 20px; display: grid; gap: 14px; }
.summary { text-align: center; }
.summary .cond { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.summary .range { font-size: clamp(28px, 8vw, 40px); font-weight: 800; letter-spacing: .01em; margin: 0; font-variant-numeric: tabular-nums; }
.summary .range small { font-size: .5em; font-weight: 700; }
.summary .mid { margin: 4px 0 0; color: var(--muted); }
.lanes { display: grid; gap: 8px; margin: 16px 0 2px; text-align: left; }
.lane { display: grid; grid-template-columns: 7.5em 1fr 7.5em; align-items: center; gap: 10px; font-size: 13px; }
.lane .who { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane .val { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.lane .track { position: relative; height: 14px; background: var(--panel-2); border-radius: 7px; }
.lane .span { position: absolute; top: 0; bottom: 0; border-radius: 7px; min-width: 6px; }
.lane .dot { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--panel); transform: translate(-50%, -50%); }
@media (max-width: 420px) {
  .lane { grid-template-columns: 5.5em 1fr; }
  .lane .val { grid-column: 2; text-align: left; margin-top: -6px; }
}

.sites { display: grid; gap: 12px; }
.site { border-left: 5px solid var(--c); }
.site h3 { margin: 0; font-size: 16px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.site h3 .kind { font-weight: 400; font-size: 13px; color: var(--muted); }
.site .price { font-size: 26px; font-weight: 800; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.site .price small { font-size: 14px; font-weight: 700; }
.site .muted { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.site .note { color: var(--warn); background: var(--warn-soft); font-size: 13px; border-radius: 8px; padding: 4px 10px; margin: 8px 0 0; display: inline-block; }
.site .skip { color: var(--muted); margin: 6px 0 0; }
.site .link { display: inline-block; margin-top: 8px; font-size: 14px; }
.site.loading .price { color: var(--muted); font-size: 16px; font-weight: 400; }

.trend h3 { margin: 0 0 4px; font-size: 16px; }
.trend .alert { margin: 8px 0 0; color: var(--down); background: var(--down-soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 600; }
.chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .grid { stroke: var(--line); }
.chart .line { fill: none; stroke: var(--c-navikuru); stroke-width: 2.5; }
.chart .fut { stroke-dasharray: 5 4; }
.chart .pt { fill: var(--c-navikuru); }
.chart .now { fill: var(--panel); stroke: var(--c-navikuru); stroke-width: 3; }
.chart .nowband { fill: var(--accent-soft); }

.tips { font-size: 14px; }
.tips h3 { margin: 0 0 6px; font-size: 16px; }
.tips ul { margin: 0; padding-left: 1.2em; }

.about { padding-top: 28px; padding-bottom: 20px; }
.about h2 { font-size: 18px; margin: 22px 0 8px; }
.about p { margin: 0 0 8px; }
.sources { margin: 0; display: grid; gap: 10px; }
.sources div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.sources dt { font-weight: 700; }
.sources dd { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.site-foot { border-top: 1px solid var(--line); margin-top: 20px; padding: 16px 0 28px; color: var(--muted); font-size: 13px; }
.site-foot p { margin: 0; }

.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
