:root {
  --bg: #080b14;
  --panel: #101728;
  --panel-2: #16203a;
  --line: #24304d;
  --fg: #e8eefc;
  --fg-dim: #8fa0c4;
  --accent: #4dd0ff;
  --accent-2: #ffb454;
  --ok: #5ce08a;
  --warn: #ff8a6b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  /* ダブルタップでの拡大を止める（意図的なピンチ操作は残す）。
     時刻ジャンプのボタンを連打したときに拡大されるのを防ぐ */
  touch-action: manipulation;
}

/* ---------- ヘッダ ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0d1322, #080b14);
}
.topbar h1 {
  margin: 0;
  font-size: 17px;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* SVG自体の絵柄（地球・軌道）が下寄りなので、テキストと並べたときの
   見た目の重心を合わせるため少し上へ寄せる */
.topbar .logo { display: block; border-radius: 6px; transform: translateY(-2px); }
.topbar .sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--fg-dim);
  margin-left: 8px;
}
.sat-select {
  font-size: 13px;
  max-width: 320px;
  border-color: #35456d;
}
.tle-status {
  margin-left: auto;
  font-size: 12px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}
.tle-status.err { color: var(--warn); }

/* ---------- レイアウト ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  padding: 16px;
  align-items: start;
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 地図 ---------- */
.map-pane { min-width: 0; }
.map-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #05070f;
}
/* 等倍のときは1本指の縦ドラッグをページスクロールに譲るためpan-y。
   拡大中はJS側（syncCanvasTouchAction）でnoneに切り替え、地図の縦パンに使う */
#map { display: block; width: 100%; cursor: crosshair; touch-action: pan-y; }
#map.dragging { cursor: grabbing; }
.map-reset {
  position: absolute;
  right: 10px; top: 10px;
  font-size: 11px;
  font-family: inherit;
  color: var(--accent);
  background: rgba(8, 11, 20, .82);
  border: 1px solid #2b5a72;
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
}
.map-reset[hidden] { display: none; }
.map-reset:hover { background: #16203a; }

.map-zoom {
  position: absolute;
  right: 10px; bottom: 60px;
  display: flex;
  flex-direction: column;
  border: 1px solid #2b5a72;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(8, 11, 20, .88);
}
.map-zoom-btn {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 17px/1 -apple-system, sans-serif;
  color: var(--fg);
  background: none;
  border: none;
  cursor: pointer;
}
.map-zoom-btn:active { background: #16203a; }
.map-zoom-btn + .map-zoom-btn { border-top: 1px solid #2b5a72; }

.map-geo {
  position: absolute;
  right: 10px; bottom: 10px;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  border: 1px solid #2b5a72;
  border-radius: 50%;
  background: rgba(8, 11, 20, .88);
  cursor: pointer;
}
.map-geo:active { background: #16203a; }

.map-hint {
  position: absolute;
  left: 10px; bottom: 10px;
  font-size: 11px;
  color: var(--fg-dim);
  background: rgba(8, 11, 20, .72);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  pointer-events: none;
}

/* ---------- 時刻バー ---------- */
.timebar {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.time-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.clock-main {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.time-actions { display: flex; gap: 8px; align-items: center; }
/* LIVE・早送り・倍率の高さを揃える */
.time-actions .btn,
.time-actions .sel { height: 32px; padding-top: 0; padding-bottom: 0; display: flex; align-items: center; }
.time-actions .btn { gap: 5px; }
.btn-icon { font-size: 12px; line-height: 1; }

/* 早送りボタンと倍率セレクトは隙間なくくっつけて1つの部品に見せる */
.speed-group { display: flex; align-items: center; }
.speed-group .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.speed-group .sel { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: none; }

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.slider-cap { font-size: 11px; color: var(--fg-dim); white-space: nowrap; }
#timeSlider {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
}
.offset-label {
  text-align: center;
  font-size: 12px;
  color: var(--accent);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  min-height: 18px;
}

.time-more-toggle {
  display: none;                    /* スマホ幅でのみ出す */
  width: 100%;
  margin-top: 12px;
  padding: 7px;
  font: inherit;
  font-size: 12px;
  color: var(--fg-dim);
  background: none;
  border: 1px dashed var(--line);
  border-radius: 7px;
  cursor: pointer;
}
.time-more-toggle:hover { color: var(--fg); }

.jump-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.dt-label {
  margin-left: auto;
  font-size: 11px;
  color: var(--fg-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- パーツ ---------- */
.btn {
  background: var(--panel-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #1d2a49; border-color: #35456d; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-now { color: var(--accent); border-color: #2b5a72; }
/* 早送りボタンと見た目を揃える（色・文字サイズは .btn のまま） */
.btn-live { letter-spacing: .05em; }
.btn-live .btn-icon { font-size: 12px; }
.btn-live.is-on {
  color: #041018;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}
.btn-primary {
  width: 100%;
  margin-top: 10px;
  background: #1c5f7a;
  border-color: #2b7fa3;
  color: #eaf9ff;
  font-weight: 600;
}
.btn-primary:hover { background: #23748f; }
.btn:disabled { opacity: .5; cursor: default; }

.sel, input[type="number"], input[type="datetime-local"] {
  background: var(--panel-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 13px;
  font-family: inherit;
}
.sel-sm { font-size: 12px; padding: 4px 6px; }
/* 同じ行に並ぶボタンとセレクトの高さを揃える */
.field-row > .btn-sm,
.field-row > .sel-sm { height: 28px; padding-top: 0; padding-bottom: 0; }
input[type="number"] { width: 100%; }

/* iOS Safari は 16px 未満の入力欄にフォーカスするとページ全体を勝手に拡大し、
   閉じても元の倍率に戻らない。タッチ端末でだけ 16px まで上げて回避する */
@media (pointer: coarse) {
  .sel, .sel-sm, .sat-select,
  input[type="number"], input[type="datetime-local"] { font-size: 16px; }
  /* 都市選択（.sel-sm）が上のルールで16pxになるので、隣の「現在地を使う」ボタンも揃える */
  #btnGeo { font-size: 16px; }
}

/* ---------- サイドカード ---------- */
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.card h2 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--fg-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.stats > div { min-width: 0; }
.stats dt { font-size: 11px; color: var(--fg-dim); }
.stats dd {
  margin: 0;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ref-check {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.6;
  color: var(--fg-dim);
}
.ref-check:empty { display: none; }
.ref-check b { color: var(--ok); font-variant-numeric: tabular-nums; }
.ref-check.err { color: var(--warn); }
.ref-check.err b { color: var(--warn); }
.note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--fg-dim);
}
.note:empty { display: none; }
.note.err { color: var(--warn); }

/* ---------- 観測地点フォーム ---------- */
.obs-form { display: flex; flex-direction: column; gap: 8px; }
.field-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field-row > label {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--fg-dim);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.field-row > label.tight { flex: 0 0 auto; }

.obs-display {
  margin: 2px 0 2px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.obs-coords.unset { color: var(--fg-dim); }
.chk {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--fg-dim);
  cursor: pointer;
}
.chk input { accent-color: var(--accent); }

/* ---------- パス結果 ---------- */
.pass-result { margin-top: 12px; }
.pass-result:empty { display: none; }
.pass-result .empty, .pass-result .working {
  font-size: 12px;
  color: var(--fg-dim);
  margin: 0;
}
.pass-summary {
  font-size: 11px;
  line-height: 1.6;
  color: var(--fg-dim);
  margin: 0 0 8px;
}
.pass-summary.err { color: var(--warn); }
.pass-summary b { color: var(--fg); }
.pass-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pass {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #0d1424;
}
.pass.vis { border-left-color: var(--accent-2); }
.pass.next { background: #12203a; }
.pass.soon {
  background: #1d2c1c;
  border-color: #3d6b3a;
  box-shadow: 0 0 0 1px rgba(92, 224, 138, .25);
}
.pass-eta.soon { color: var(--ok); font-weight: 700; }
.pass-when {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.pass-date { font-size: 14px; font-weight: 600; }
.pass-eta { font-size: 11px; color: var(--fg-dim); }
.pass-meta {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}
.pass-meta b { color: var(--fg); font-weight: 600; }
.pass-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.pass-tag {
  display: inline-block;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--fg-dim);
}
/* 保存カードではタグが直前の行に接するので、上に余白を取る */
.clip > .pass-tag { margin-top: 9px; }
.pass-tag.vis { color: #ffdca8; border-color: #6b4d1f; background: #2a1f0c; }
.pass-goto {
  margin-left: auto;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  font-family: inherit;
}
.pass-goto:hover { text-decoration: underline; }

/* ---------- 保存したパス ---------- */
.clip-list { margin-top: 10px; }
.clip-list .empty { font-size: 12px; color: var(--fg-dim); margin: 0; }
.clip-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.clip {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #0d1424;
}
.clip.vis { border-left-color: var(--accent-2); }
.clip.done { opacity: .5; }
.clip.done .clip-eta { color: var(--fg-dim); }

/* カレンダーの予定から辿ってきたとき、対象を一度だけ光らせて知らせる */
.clip-focus { animation: clip-focus 2.4s ease-out; }
@keyframes clip-focus {
  0%, 35% { box-shadow: 0 0 0 2px var(--accent), 0 0 18px rgba(77, 208, 255, .35); }
  100% { box-shadow: 0 0 0 2px transparent, 0 0 18px transparent; }
}

.clips-past { margin-top: 12px; }
.chk-count { color: var(--fg-dim); }
.clip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.clip-sat { font-size: 13px; font-weight: 700; letter-spacing: .03em; }
.clip-eta { font-size: 11px; color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.clip-eta.now { color: var(--accent-2); font-weight: 700; }
.clip-when { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.clip-meta { font-size: 11.5px; color: var(--fg-dim); margin-top: 3px; font-variant-numeric: tabular-nums; }
.clip-meta b { color: var(--fg); }
.clip-weather { font-size: 11.5px; color: var(--fg-dim); margin-top: 4px; }
.clip-weather[hidden] { display: none; }
.clip-place {
  background: none;
  border: none;
  border-bottom: 1px dashed var(--fg-dim);
  padding: 0 0 1px;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
}
.clip-place:hover { color: var(--fg); border-bottom-color: var(--accent); }
.clip-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.btn-ar { color: var(--accent); border-color: #2b5a72; }
.btn-cal { color: var(--accent-2); border-color: #6a4c22; }
.btn-del { color: var(--fg-dim); }

/* 追加先のカレンダー */
.cal-pref { margin: 12px 0 0; font-size: 12px; color: var(--fg-dim); }
.cal-pref b { color: var(--fg); font-weight: 600; }
.link-btn {
  background: none;
  border: none;
  border-bottom: 1px dashed var(--fg-dim);
  padding: 0 0 1px;
  margin-left: 6px;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
}
.link-btn:hover { color: var(--fg); border-bottom-color: var(--accent); }

.cal-choices { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.cal-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  text-align: left;
}
.cal-choice-name { font-size: 14px; font-weight: 600; }
.cal-choice-note { font-size: 11.5px; color: var(--fg-dim); }

.btn-more {
  width: 100%;
  margin-top: 10px;
  font-size: 12px;
  color: var(--accent);
  border-color: #2b5a72;
}

.pass-links { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.pass-clip {
  background: none; border: none; cursor: pointer; padding: 2px 0;
  font-family: inherit; font-size: 10.5px; white-space: nowrap;
  color: var(--fg-dim);
}
.pass-clip:hover { color: var(--accent-2); }
.pass-clip.saved { color: var(--accent-2); font-weight: 600; }

/* ---------- ARビュー ---------- */
body.ar-open { overflow: hidden; }
.ar-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #05070f;
}
.ar-overlay[hidden] { display: none; }
#arVideo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
#arCanvas { position: absolute; inset: 0; }
.ar-top, .ar-bottom {
  position: absolute;
  left: 0; right: 0;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(5,7,15,.85), rgba(5,7,15,0));
}
.ar-top { top: 0; }
.ar-bottom {
  bottom: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  background: linear-gradient(0deg, rgba(5,7,15,.88), rgba(5,7,15,0));
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.ar-title { font-size: 14px; font-weight: 700; letter-spacing: .03em; flex: 1; }
.ar-info { font-size: 13px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.ar-info b { color: var(--accent-2); }
.ar-warn { margin: 0; font-size: 11px; line-height: 1.6; color: var(--warn); }
.ar-warn:empty { display: none; }
.ar-actions { display: flex; gap: 8px; }

/* ---------- 技術情報 ---------- */
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn {
  position: relative;
  width: 22px; height: 22px;
  padding: 0;                       /* ボタン既定の左右余白を消してから中央寄せする */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--fg-dim);
  font: italic 700 12px/1 Georgia, serif;
  cursor: pointer;
  flex: 0 0 auto;
  transition: color .12s, border-color .12s;
}
.icon-btn:hover { color: var(--fg); border-color: #35456d; }
.icon-btn.err { color: var(--warn); border-color: var(--warn); }
#btnClips { font: 700 13px/1 -apple-system, sans-serif; }
#btnClips.has-clips { color: var(--accent-2); border-color: #6b4d1f; }
.clip-badge {
  position: absolute;
  top: -5px; right: -6px;
  min-width: 14px; height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: var(--accent-2);
  color: #2a1f0c;
  font: 700 9px/14px -apple-system, sans-serif;
}

/* 保存直後、ここから見られることに気付いてもらうためヘッダーの星を1回だけ光らせる */
#btnClips.ping { animation: clip-icon-ping .7s ease-out; }
@keyframes clip-icon-ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 180, 84, .6); }
  40% { transform: scale(1.3); box-shadow: 0 0 0 8px rgba(255, 180, 84, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 8px rgba(255, 180, 84, 0); }
}

.info-dialog {
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--fg);
  padding: 18px 20px;
  max-width: 460px;
  font-size: 14px;
}
.info-dialog::backdrop { background: rgba(4, 8, 20, .65); }
.info-dialog h2 {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--fg-dim);
  text-transform: uppercase;
}
.info-body { margin: 0; display: flex; flex-direction: column; gap: 7px; }
.info-body > div { display: flex; gap: 12px; align-items: baseline; }
.info-body dt { flex: 0 0 84px; font-size: 11px; color: var(--fg-dim); }
.info-body dd { margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.info-body dd.err { color: var(--warn); }
.info-body dd .ok { color: var(--ok); }
.info-body dd .err { color: var(--warn); }
.info-dialog form { margin-top: 16px; text-align: right; }

.guide-dialog { max-width: 640px; }
.guide-img { display: block; width: 100%; height: auto; border-radius: 6px; margin-top: 8px }

/* ---------- スマホ幅（1列レイアウト）向けの調整 ---------- */
@media (max-width: 1100px) {
  /* ヘッダーを画面上部に固定する */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 10px;
    padding: 10px 14px;
  }
  .topbar .sub { display: none; }
  /* 固定ヘッダーが高くならないよう1段に収める */
  .topbar { flex-wrap: nowrap; }
  /* スマホではアイコンだけにして、衛星の選択に幅を回す */
  .topbar .brand { display: none; }
  .sat-select { flex: 1; min-width: 0; max-width: none; }
  .topbar-actions { margin-left: 0; }

  /* 地図の操作説明は消し、代わりに現在地ピンを出す */
  .map-hint { display: none; }

  /* 細かい時刻操作は縦幅がもったいないので出さない（スマホでは無くてOK） */
  .time-more-toggle { display: none; }
  .time-more { display: none; }

  /* LIVE・早送り・倍率は日時と同じ行の右側へ。幅を稼ぐため文字は出さない */
  .time-head { flex-wrap: nowrap; gap: 8px; }
  .time-actions { margin-left: auto; gap: 6px; }
  .time-actions .btn-label { display: none; }
  .time-actions .btn { padding: 0 10px; }
  .time-actions .btn-icon { font-size: 15px; }

  /* 時刻表示は主役ではないので、狭い画面では小さめにする */
  .clock-main { font-size: 15px; }
  .timebar { padding: 12px 14px; }
  .slider-cap { font-size: 10px; }
  .offset-label { font-size: 11px; }

  /* 倍率の文字はボタン類より少し小さく見せる。実フォントサイズを16px未満にすると
     iOSでフォーカス時にズームしたままになる（.sel-smの注記と同じ理由）ため、
     見た目だけscaleで縮める。scaleは高さも縮めてしまうので、早送りボタンと
     高さが揃うよう縮小分だけ先に枠を大きくしておく */
  #speed {
    height: calc(32px / 0.85);
    transform: scale(0.85);
    transform-origin: left center;
  }

  /* この時刻の値はラベルと値を横並びにして省スペースにする */
  .stats > div { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
}

/* ---------- PC幅：画面内に収め、結果はカード内でスクロールさせる ---------- */
@media (min-width: 1101px) {
  html, body { height: 100%; }
  body { display: flex; flex-direction: column; overflow: hidden; }

  .layout {
    flex: 1;
    min-height: 0;
    align-items: stretch;          /* 2列とも高さいっぱいに伸ばす */
  }
  /* 地図側は高さが足りなければこの列だけスクロールする */
  .map-pane { min-height: 0; overflow-y: auto; }
  .side { min-height: 0; }

  /* 「次の観測チャンスを探す」を残りの高さいっぱいに。
     見出しは固定したまま、条件と結果だけを内側でスクロールする */
  .card-search {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .card-search > h2 { flex: 0 0 auto; }
  .card-search-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;            /* スクロールバーとカードの縁が接しないように */
  }

  /* OS標準の太いスクロールバーは主張が強いので、細い見た目にする */
  .map-pane, .card-search-body {
    scrollbar-width: thin;
    scrollbar-color: #35456d transparent;
  }
  .map-pane::-webkit-scrollbar, .card-search-body::-webkit-scrollbar { width: 8px; }
  .map-pane::-webkit-scrollbar-track, .card-search-body::-webkit-scrollbar-track { background: transparent; }
  .map-pane::-webkit-scrollbar-thumb, .card-search-body::-webkit-scrollbar-thumb {
    background: #35456d;
    border-radius: 4px;
  }
  .map-pane::-webkit-scrollbar-thumb:hover, .card-search-body::-webkit-scrollbar-thumb:hover { background: #4a5f8f; }
}
