:root {
  --navy-900: #050e1f;
  --navy-800: #07142b;
  --navy-700: #0c2140;
  --navy-600: #143057;
  --mint: #5ef2c2;
  --mint-dim: rgba(94, 242, 194, 0.55);
  --mint-faint: rgba(94, 242, 194, 0.16);
  --amber: #ffb547;
  --amber-dim: rgba(255, 181, 71, 0.6);
  --text: #d9f4ea;
  --text-dim: #8fb3a8;
  /* 参考（公式の発表ではない情報）：点線と、この青灰色で見分ける */
  --ref: #a8bce0;
  --ref-dim: rgba(168, 188, 224, 0.5);
  --danger: #ff7a6b;
  --font-body: "Zen Kaku Gothic New", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--navy-800);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body { overflow: hidden; }

.mono { font-family: var(--font-mono); }
.amber { color: var(--amber); }
.small { font-size: 0.85rem; }
[hidden] { display: none !important; }

/* ---------- ボタン ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--mint-dim);
  background: rgba(7, 20, 43, 0.72);
  color: var(--mint);
  font-size: 0.85rem;
  padding: 0.45em 0.9em;
  border-radius: 3px;
  cursor: pointer;
  min-height: 36px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover:not(:disabled) { background: var(--mint-faint); }
.btn:focus-visible, .linklike:focus-visible, .close:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.btn[aria-pressed="true"] {
  background: var(--mint);
  color: var(--navy-800);
  box-shadow: 0 0 12px var(--mint-dim);
}
.btn[aria-pressed="true"]:hover:not(:disabled) { background: var(--mint); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary {
  border-color: var(--amber);
  color: var(--amber);
  font-size: 1rem;
  letter-spacing: 0.2em;
  padding: 0.7em 1.8em;
}
.btn-primary:hover:not(:disabled) { background: rgba(255, 181, 71, 0.12); box-shadow: 0 0 18px var(--amber-dim); }

.linklike {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--mint);
  text-decoration: underline;
  text-underline-offset: 3px;
  font: inherit;
  cursor: pointer;
}

/* ---------- 起動画面（横長のヒーロー） ---------- */
#boot {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
  padding: clamp(24px, 6vw, 72px);
  background: var(--navy-900);
  overflow: hidden;
  transition: opacity 0.6s ease;
}
#boot.leaving { opacity: 0; pointer-events: none; }
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 10, 22, 0.96) 0%, rgba(4, 10, 22, 0.78) 34%, rgba(4, 10, 22, 0.1) 62%, rgba(4, 10, 22, 0.35) 100%),
    url("../assets/earth/hero-1600.webp") right center / cover no-repeat;
  animation: hero-in 1.6s ease-out both;
}
#noise {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.05;
  mix-blend-mode: screen;
  pointer-events: none;
}
.crt::before, .crt-overlay {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.22) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  z-index: 2;
}
.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.7);
  z-index: 3;
}
.hero-main, .hero-side { position: relative; z-index: 4; }
.hero-main { animation: crt-on 0.9s ease-out both; }
.logo {
  margin: 0;
  line-height: 0;
  animation: flicker 5s infinite;
}
.logo img { width: min(80vw, 560px); height: auto; }
.subtitle {
  margin: 0.8rem 0 2.2rem;
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  color: var(--text);
  letter-spacing: 0.35em;
}
.hero-start {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  padding: 0.85rem 1.4rem;
  font-size: 1.05rem;
  letter-spacing: 0.2em;
}
.hero-start .chev { font-size: 1.3rem; line-height: 1; }
.boot-status {
  min-height: 4.5em;
  margin: 1.6rem 0 0;
  font-size: 0.74rem;
  line-height: 1.6;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  white-space: pre-line;
}
.boot-status.error { color: var(--danger); letter-spacing: 0; }
.hero-side {
  justify-self: end;
  align-self: start;
  max-width: 23rem;
  padding-top: 1rem;
  animation: hero-copy-in 1.4s 0.4s ease-out both;
}
.hero-copy {
  margin: 0 0 1.4rem;
  font-size: 0.98rem;
  line-height: 1.9;
  letter-spacing: 0.12em;
  color: var(--text);
  text-shadow: 0 0 12px rgba(4, 10, 22, 0.9);
}
.unofficial {
  margin: 2rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(233, 244, 255, 0.25);
  font-size: 0.74rem;
  line-height: 1.7;
  color: var(--text-dim);
}
.hero-credit {
  position: absolute;
  right: clamp(16px, 3vw, 32px);
  bottom: 12px;
  z-index: 4;
  margin: 0;
  font-size: 0.66rem;
  color: var(--text-dim);
  opacity: 0.8;
}
@media (max-width: 900px) {
  #boot {
    grid-template-columns: 1fr;
    align-items: end;
    align-content: end;
    gap: 1.2rem;
    padding-bottom: 48px;
  }
  .hero-bg {
    background:
      linear-gradient(180deg, rgba(4, 10, 22, 0.2) 0%, rgba(4, 10, 22, 0.55) 45%, rgba(4, 10, 22, 0.97) 72%),
      url("../assets/earth/hero-1600.webp") 72% top / auto 62vh no-repeat,
      var(--navy-900);
  }
  .hero-side { justify-self: start; padding-top: 0; order: 2; }
  .hero-copy { font-size: 0.86rem; margin-bottom: 0.6rem; }
  .hero-copy br { display: none; }
  .subtitle { letter-spacing: 0.2em; margin-bottom: 1.4rem; }
}
@keyframes hero-in {
  from { opacity: 0; transform: scale(1.06); }
  to { opacity: 1; transform: none; }
}
@keyframes hero-copy-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes crt-on {
  0% { transform: scale(1, 0.01); filter: brightness(3); opacity: 0; }
  40% { transform: scale(1, 0.02); filter: brightness(3); opacity: 1; }
  70% { transform: scale(1, 1.03); filter: brightness(1.4); }
  100% { transform: scale(1, 1); filter: none; }
}
@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: 0.82; }
  94% { opacity: 1; }
  96% { opacity: 0.9; }
}

/* ---------- 観測画面 ---------- */
#app { position: fixed; inset: 0; }
#globe { position: absolute; inset: 0; }
.crt-overlay { z-index: 5; opacity: 0.35; }
.k { color: var(--text-dim); font-size: 0.75rem; }

:root {
  --panel-bg: rgba(7, 20, 43, 0.84);
  --panel-border: rgba(94, 242, 194, 0.18);
  --top-h: 72px;
  --bottom-h: 138px;
  --nav-h: 0px; /* 部屋の帯の高さ（PC だけ 48px） */
}

/* ヘッダー */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 12px) 20px 10px;
  background: linear-gradient(180deg, rgba(5, 14, 31, 0.85), rgba(5, 14, 31, 0));
  pointer-events: none;
}
.top-bar > * { pointer-events: auto; }
.brand { line-height: 0; }
.brand img { height: 30px; width: auto; }
.brand-sub { font-size: 0.72rem; color: var(--text-dim); letter-spacing: 0.2em; }
.clock-block { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--text); }
.live-badge {
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  white-space: nowrap;
}
.live-badge { background: none; font-family: var(--font-mono); line-height: inherit; }
.live-badge[data-live="false"] { cursor: pointer; } /* 時刻をずらしているときは、押すと現在に戻る */
.live-badge[data-live="true"] { border-color: var(--mint); color: var(--mint); }
.live-badge[data-paused="true"]::after { content: " 停止中"; }
.live-badge[data-live="true"]::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 6px var(--mint);
  vertical-align: 1px;
}

/* 左右のパネル */
.side-panel {
  position: absolute;
  z-index: 10;
  top: calc(var(--top-h) + var(--nav-h));
  bottom: calc(var(--bottom-h) + 8px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  overflow: auto;
  overscroll-behavior: contain;
}
.list-panel { left: 16px; width: 330px; padding: 12px; }
.detail-panel { right: 16px; width: 420px; padding: 14px 16px 12px; }
.sheet-handle { display: none; }

.fam-tabs { display: flex; flex-wrap: wrap; gap: 4px 6px; overflow-x: auto; scrollbar-width: none; }
.fam-tabs::-webkit-scrollbar { display: none; }
.fam-group { display: flex; gap: 3px; }
.fam-views { margin-left: auto; } /* 「予定」「観測」は右にまとめる（入らなければ2つ一緒に次の行へ） */
.fam-tab {
  appearance: none;
  display: inline-grid; /* 文字と、太字の幅をとる見えない文字を重ねる。選んで太字になっても幅が変わらない */
  justify-items: center;
  border: 1px solid transparent;
  background: rgba(94, 242, 194, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.fam-tab > span { grid-area: 1 / 1; }
.fam-bold { font-weight: 700; visibility: hidden; }
.fam-tab[aria-pressed="true"] { background: var(--mint); color: var(--navy-800); }
.fam-tab[aria-pressed="true"] .fam-label { font-weight: 700; }
/* PC：タブを1行に並べる（パネルの幅 330px に入る大きさ）。ブラウザの文字を大きくしていて入らないときは、
   main.js の fitFamTabs が --fam-fit で文字だけを小さくする */
@media (min-width: 901px) {
  .fam-tabs { flex-wrap: nowrap; gap: 4px; }
  .fam-group { gap: 2px; }
  .fam-tab { font-size: calc(0.75rem * var(--fam-fit, 1)); padding: 5px 5px; }
  .list-panel { scrollbar-width: thin; scrollbar-gutter: stable; } /* スクロールバーが出ても消えても、中の幅が変わらない */
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search { display: block; margin: 0 0 10px; position: relative; }
.search::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--text-dim);
  border-radius: 50%;
  transform: translateY(-60%);
}
.search::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 58%;
  width: 6px;
  height: 1.5px;
  background: var(--text-dim);
  transform: rotate(45deg);
}
.search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: rgba(4, 12, 28, 0.7);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}
.search input::placeholder { color: var(--text-dim); }
.search input:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }
.list-empty { list-style: none; padding: 12px 4px; }
.st-pip { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; background: var(--text-dim); }
.st-pip.ok { background: var(--mint); box-shadow: 0 0 5px var(--mint-dim); }
.st-pip.warn { background: var(--amber); box-shadow: 0 0 5px var(--amber-dim); }
.tonight-chip .pin { margin-right: 6px; }
.tonight-chip .chip-short { display: none; }
.tonight-chip .sep { display: inline-block; width: 1px; height: 0.9em; margin: 0 10px; vertical-align: -1px; background: var(--amber-dim); }
.list-title { margin: 14px 2px 6px; font-size: 0.8rem; color: var(--text-dim); font-weight: 400; letter-spacing: 0.1em; }
.craft-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.craft-item {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto 12px;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(12, 33, 64, 0.6);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.craft-item:hover { border-color: var(--mint-dim); }
.craft-item[aria-current="true"] { border-color: var(--mint); box-shadow: 0 0 0 1px var(--mint-dim) inset; }
.craft-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--c);
  box-shadow: 0 0 8px color-mix(in srgb, var(--c) 50%, transparent);
  position: relative;
}
.craft-icon::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--c);
}
.craft-names { display: flex; flex-direction: column; min-width: 0; }
.craft-id { font-size: 0.92rem; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.craft-ja { font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.craft-alt { font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; }
.chev { color: var(--text-dim); font-size: 1.2rem; }
.list-note { margin: 12px 2px 0; }

/* 詳細パネル */
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.panel-title { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.panel-en { font-size: 0.8rem; font-weight: 400; color: var(--text-dim); letter-spacing: 0.05em; }
.panel-ja { font-size: 0.9rem; color: var(--mint); }
.panel-actions { display: flex; gap: 8px; flex: none; }
.follow-mini {
  width: 34px;
  height: 34px;
  border: 1px solid var(--mint-faint);
  background: transparent;
  color: var(--mint);
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
}
.follow-mini[aria-pressed="true"] { background: var(--mint); color: var(--navy-800); }
.close {
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--mint-faint);
  background: transparent;
  color: var(--mint);
  font-size: 1.1rem;
  border-radius: 6px;
  cursor: pointer;
}
.sample-banner {
  margin: 0 0 10px;
  padding: 6px 10px;
  border: 1px solid var(--amber);
  background: repeating-linear-gradient(135deg, rgba(255, 181, 71, 0.12) 0 8px, rgba(255, 181, 71, 0.04) 8px 16px);
  color: var(--amber);
  font-size: 0.78rem;
  border-radius: 4px;
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--panel-border); margin-bottom: 12px; }
.tab {
  appearance: none;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.85rem;
  padding: 8px 4px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab[aria-selected="true"] { color: var(--mint); border-bottom-color: var(--mint); font-weight: 700; }
.tab-body p { margin: 0.35rem 0; }
.panel-foot {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--panel-border);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.orbit-stats { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: 0.88rem; }
.orbit-stats dt { color: var(--text-dim); }
.orbit-stats dd { margin: 0; font-family: var(--font-mono); }
.minimap { margin: 0; }
.minimap svg { display: block; width: 100%; height: auto; border: 1px solid var(--panel-border); border-radius: 6px; }
.mm-sea { fill: #081a36; }
.mm-grid { stroke: rgba(94, 242, 194, 0.12); stroke-width: 0.5; fill: none; }
.mm-land { fill: rgba(94, 242, 194, 0.22); stroke: rgba(94, 242, 194, 0.4); stroke-width: 0.3; }
.mm-past { fill: none; stroke: rgba(255, 181, 71, 0.4); stroke-width: 1.2; stroke-dasharray: 3 2; }
.mm-future { fill: none; stroke: var(--amber); stroke-width: 1.4; }
.mm-now { fill: var(--amber); stroke: var(--navy-900); stroke-width: 1; }
.mm-key { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--amber); vertical-align: middle; margin-left: 6px; }
.mm-key.past { border-top: 2px dashed rgba(255, 181, 71, 0.5); margin-left: 0; }
.mm-key.now { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--amber); }
.link-list { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; font-size: 0.88rem; }
.link-list a { color: var(--mint); text-underline-offset: 3px; }
.link-off { color: var(--text-dim); }
.fam-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
  margin-right: 6px;
  vertical-align: 0;
}

/* 銘板（概要タブ） */
.ov { padding: 4px 2px 0; }
.ov-figure { margin: 0 0 12px; }
.ov-art { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; border: 1px solid var(--panel-border); }
.ov-figure figcaption { margin-top: 4px; line-height: 1.5; }
.ov-figure figcaption a { color: var(--text-dim); }
/* ひまわりの最新画像（801×641。切り取らない） */
.ov-live { display: block; width: 100%; aspect-ratio: 801 / 641; object-fit: contain; background: #000; border-radius: 6px; border: 1px solid var(--panel-border); }
.live-sat.failed { display: none; }
.craft-thumb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--c);
  box-shadow: 0 0 8px color-mix(in srgb, var(--c) 40%, transparent);
}
.craft-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ov-lead { margin: 0 0 10px !important; font-size: 0.95rem; line-height: 1.75; color: var(--text); }
.ov-catch { margin: 0 0 10px !important; color: var(--mint); font-size: 0.9rem; font-weight: 700; }
.ov-catch .k { font-weight: 400; font-size: 0.66rem; }
.class-chip {
  display: inline-block;
  margin-right: 10px;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 400;
  vertical-align: 4px;
  letter-spacing: 0.05em;
}
.plate {
  position: relative;
  text-align: center;
  padding: 14px 12px 8px;
  border: 1px solid rgba(255, 181, 71, 0.45);
  outline: 1px solid rgba(255, 181, 71, 0.18);
  outline-offset: 3px;
  margin: 4px;
}
.plate-art {
  display: block;
  width: min(100%, 320px);
  margin: 4px auto;
  filter: drop-shadow(0 0 6px rgba(255, 181, 71, 0.25));
}
.plate-class {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
  color: var(--mint);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
}
.plate-class::before, .plate-class::after { content: ""; flex: 1; height: 1px; background: rgba(255, 181, 71, 0.35); }
.plate-class .k { letter-spacing: 0.05em; }
.plate-name { margin: 6px 0 0; font-size: 1.6rem; font-weight: 700; color: var(--amber); letter-spacing: 0.06em; line-height: 1.3; }
.plate-name-en { font-size: 0.82rem; color: var(--text); letter-spacing: 0.08em; }
.plate-headline { margin: 8px 0 0 !important; font-size: 0.88rem; }
.dot { color: var(--amber-dim); margin: 0 0.4em; }
.plate-catch { margin: 10px 0 0 !important; color: var(--mint); font-size: 0.95rem; font-weight: 700; }
.plate-catch-note { margin: 0 !important; font-size: 0.66rem; }
.plate-rows { margin: 12px 0 4px; text-align: left; }
.plate-row {
  display: grid;
  grid-template-columns: 24px 2.8em 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 2px;
  border-top: 1px solid rgba(255, 181, 71, 0.22);
  font-size: 0.85rem;
}
.plate-row:last-child { border-bottom: 1px solid rgba(255, 181, 71, 0.22); }
.plate-row .icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--mint-dim);
  border-radius: 50%;
  color: var(--mint);
  font-size: 0.65rem;
}
.plate-row .label { color: var(--amber); font-weight: 700; padding-top: 1px; }
.plate-row .body { padding-top: 1px; min-width: 0; }

/* 状態（運用状況） */
.st-line { line-height: 1.6; }
.place { color: var(--amber); font-weight: 700; }
.st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.st-dot.ok { background: var(--mint); box-shadow: 0 0 6px var(--mint-dim); }
.st-dot.down { background: var(--amber); box-shadow: 0 0 6px var(--amber-dim); }
.st-notice { margin: 6px 0 2px; padding: 5px 8px; border: 1px dashed var(--amber-dim); border-radius: 4px; font-size: 0.8rem; line-height: 1.5; }
.st-notice.active { border-style: solid; background: rgba(255, 181, 71, 0.08); }
.st-tag { display: inline-block; margin-right: 6px; padding: 0 5px; border: 1px solid var(--amber); border-radius: 3px; color: var(--amber); font-size: 0.7rem; }
.st-src { margin-top: 4px; }
.st-src a { color: var(--mint); }
.st-badge { display: inline-block; margin-left: 4px; padding: 0 4px; border: 1px dashed var(--amber-dim); border-radius: 3px; color: var(--amber); font-size: 0.65rem; font-weight: 400; vertical-align: 1px; }
.st-badge.down { border-style: solid; }
.crew-summary { font-weight: 700; }
.team { margin-top: 8px; }
.team-name { font-size: 0.85rem; color: var(--mint); }
.members { list-style: none; margin: 2px 0 0; padding: 0; font-size: 0.85rem; }
.members li { padding-left: 0.8em; text-indent: -0.8em; }
.members li::before { content: "・"; color: var(--amber-dim); }
.nw { white-space: nowrap; display: inline-block; }
.role { white-space: nowrap; font-size: 0.72rem; color: var(--amber); border: 1px solid var(--amber-dim); padding: 0 4px; border-radius: 2px; }

/* 環のスケール注記とラベル */
.scale-note {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: calc(var(--bottom-h) + 14px);
  transform: translateX(-50%);
  margin: 0;
  padding: 2px 10px;
  border-radius: 4px;
  background: rgba(5, 14, 31, 0.6);
  white-space: nowrap;
}
.scale-note b { color: var(--mint); font-weight: 400; }
.ring-label {
  transform: translate(-50%, -120%);
  font-size: 11px;
  color: var(--mint);
  white-space: nowrap;
  text-shadow: 0 0 4px var(--navy-900), 0 0 8px var(--navy-900);
  pointer-events: none;
}
.ring-label small { display: block; font-size: 9px; color: var(--text-dim); }

/* 地球の上の機体の印 */
.craft-marker {
  position: relative;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  padding: 0;
}
.craft-marker .ring {
  position: absolute;
  inset: 8px;
  border: 1.5px solid var(--c);
  border-radius: 50%;
  box-shadow: 0 0 10px color-mix(in srgb, var(--c) 60%, transparent);
  animation: ping 2s ease-out infinite;
}
.craft-marker .core {
  width: 10px;
  height: 10px;
  background: var(--c);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--c);
}
.craft-marker .tag {
  position: absolute;
  left: 34px;
  top: 4px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--c);
  white-space: nowrap;
  text-shadow: 0 0 6px var(--navy-900);
}
.craft-marker.tag-left .tag { left: auto; right: 34px; }
.craft-marker.selected .core { outline: 2px solid var(--c); outline-offset: 5px; }
@keyframes ping {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* 下：タイムラインと表示切り替え */
.bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 10px 20px calc(env(safe-area-inset-bottom) + 8px);
  background: linear-gradient(0deg, rgba(5, 14, 31, 0.95) 60%, rgba(5, 14, 31, 0));
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.timeline { display: flex; align-items: center; gap: 12px; }
.round-btn {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--mint-dim);
  background: rgba(7, 20, 43, 0.8);
  color: var(--mint);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.round-btn svg { width: 18px; height: 18px; fill: currentColor; }
.round-btn[data-playing="true"] .i-play, .round-btn[data-playing="false"] .i-pause { display: none; }
.live-btn { flex: none; }
.slider-wrap { position: relative; flex: 1; min-width: 0; padding-bottom: 16px; }
#timeline { width: 100%; accent-color: var(--mint); margin: 0; }
.ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; font-size: 10px; color: var(--text-dim); }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ticks span:first-child { transform: none; }
.ticks span:last-child { transform: translateX(-100%); }
.speeds { display: flex; gap: 4px; flex: none; }
.controls-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.fam-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; cursor: pointer; white-space: nowrap; }
.toggle input { accent-color: var(--mint); margin: 0 2px 0 0; }
.list-open { display: none; }
/* スマホだけで出すもの */
.narrow-only { display: none; }
.footnote {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 8px;
}
.footnote .sep { color: var(--mint-faint); }
.warning {
  margin: 0 auto;
  max-width: 36rem;
  font-size: 0.74rem;
  color: var(--amber);
  text-align: center;
  background: rgba(5, 14, 31, 0.75);
  padding: 4px 8px;
  border-radius: 3px;
}

/* 今夜・頭の上 */
.tonight {
  margin: -2px -2px 12px;
  padding: 10px 10px 8px;
  border: 1px solid rgba(255, 181, 71, 0.4);
  border-radius: 8px;
  background: rgba(255, 181, 71, 0.05);
}
.tonight-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tonight-title { margin: 0; font-size: 0.95rem; color: var(--amber); letter-spacing: 0.08em; }
.pref-select {
  font: inherit;
  font-size: 0.8rem;
  color: var(--text);
  background: var(--navy-700);
  border: 1px solid var(--mint-dim);
  border-radius: 6px;
  padding: 4px 6px;
}
.tonight-body { margin-top: 8px; }
.tonight-body p { margin: 0.3rem 0; }
.pass-when { font-size: 1.05rem; font-weight: 700; }
.pass-time { color: var(--amber); }
.pass-dir { font-size: 0.9rem; }
.pass-dir strong { color: var(--mint); }
.pass-height { margin-top: 2px; }
.sky-chart { display: block; width: 100%; max-width: 220px; margin: 6px auto 4px; }
.sky-horizon { fill: rgba(8, 26, 54, 0.9); stroke: var(--mint-dim); stroke-width: 1; }
.sky-ring { fill: none; stroke: rgba(94, 242, 194, 0.18); stroke-width: 0.8; }
.sky-dir { fill: var(--mint); font-size: 11px; text-anchor: middle; font-family: var(--font-body); }
.sky-zenith { fill: var(--text-dim); font-size: 8px; font-family: var(--font-body); }
.sky-path { fill: none; stroke: var(--amber); stroke-width: 2.2; }
.sky-arrowhead { fill: var(--amber); }
.sky-start { fill: var(--amber); }
.sky-end { fill: var(--amber); }
.sky-label { fill: var(--amber); font-size: 9px; text-anchor: middle; font-family: var(--font-body); }
.pass-jump { width: 100%; margin-top: 4px; }
.pass-more { list-style: none; margin: 8px 0 0; padding: 6px 0 0; border-top: 1px solid var(--panel-border); display: grid; gap: 4px; font-size: 0.8rem; }
.pass-more li { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.tonight-note { margin-top: 8px !important; line-height: 1.5; }
.tonight-chip {
  appearance: none;
  margin-left: auto;
  margin-right: 12px;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--amber-dim);
  background: rgba(255, 181, 71, 0.08);
  color: var(--amber);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}

/* 上のバー：次の出来事（狭い画面では一覧の「予定」タブだけ） */
.next-chip {
  appearance: none;
  margin-right: 12px;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--mint-dim);
  background: rgba(94, 242, 194, 0.08);
  color: var(--mint);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 30vw;
}
.next-chip .next-k { margin-right: 8px; color: var(--text-dim); font-size: 0.72rem; }
.next-chip .next-left { margin-left: 8px; }
.tonight-chip:focus-visible, .next-chip:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
@media (max-width: 1100px) { .next-chip { display: none; } }

/* 予定（次の出来事）：一覧の「予定」タブ */
.events {
  margin: -2px -2px 12px;
  padding: 10px 10px 8px;
  border: 1px solid var(--mint-dim);
  border-radius: 8px;
  background: rgba(94, 242, 194, 0.04);
}
.events-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.events-title { margin: 0; font-size: 0.95rem; color: var(--mint); letter-spacing: 0.08em; }
.events-body { margin-top: 8px; }
.events-note { margin-top: 8px !important; line-height: 1.5; }
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.event-item {
  appearance: none;
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 62px 1fr 12px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(12, 33, 64, 0.6);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.event-item:hover { border-color: var(--mint-dim); }
.event-item:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.event-tonight { border-color: rgba(255, 181, 71, 0.5); background: rgba(255, 181, 71, 0.07); }
.event-when { display: flex; flex-direction: column; font-size: 0.78rem; line-height: 1.35; color: var(--mint); }
.event-tonight .event-when { color: var(--amber); }
.event-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.event-title { font-size: 0.9rem; font-weight: 700; }
.event-sub { font-size: 0.74rem; color: var(--text-dim); }
.event-left { margin-left: 8px; color: var(--mint); white-space: nowrap; }
.event-src { font-size: 0.68rem; color: var(--text-dim); }
/* 予定の詳細：残り時間 */
.event-countdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(94, 242, 194, 0.07);
}
.event-countdown .mono { font-size: 1.35rem; font-weight: 700; color: var(--mint); letter-spacing: 0.02em; }
.event-h { margin: 14px 0 6px; font-size: 0.85rem; color: var(--mint); }
.event-rows .plate-row { grid-template-columns: 24px 4.3em 1fr; } /* 「予備期間」「ロケット」を1行に */

/* 地球の上の射場のピン（ひし形。打ち上がるまで軌道は描かない） */
.site-marker {
  position: relative;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  padding: 0;
}
.site-marker .diamond {
  width: 11px;
  height: 11px;
  border: 2px solid var(--c);
  background: var(--navy-900);
  transform: rotate(45deg);
  box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent);
}
/* 名前はひし形の真下に（機体の名前は右上に出るので、重なりにくい） */
.site-marker .tag {
  position: absolute;
  left: 50%;
  top: 33px;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--c);
  white-space: nowrap;
  text-shadow: 0 0 6px var(--navy-900);
}
.site-marker.selected .diamond { outline: 2px solid var(--c); outline-offset: 4px; }
/* 名前が重なったピン：名前を隠す（ひし形は残る。マウスを乗せる・キーボードで選ぶと出る） */
.site-marker.tag-hidden .tag { visibility: hidden; }
.site-marker.tag-hidden:hover .tag, .site-marker.tag-hidden:focus-visible .tag { visibility: visible; }
/* 一覧の行にマウスを乗せているあいだ：同じ射場のピンを光らせる */
.site-marker.peek .diamond { outline: 2px dashed var(--c); outline-offset: 5px; }
.site-marker.peek .tag { color: var(--text); }
.site-marker:focus-visible { outline: 2px solid var(--amber); outline-offset: -8px; border-radius: 50%; }
/* 凡例：予定はひし形 */
.fam-dot.fam-planned { width: 8px; height: 8px; border-radius: 1px; background: none; border: 1.5px solid var(--c); transform: rotate(45deg); }

/* ---------- 参考（公式の発表ではない情報）：点線の「参考」の印と、ホバー・フォーカスで出る説明 ---------- */
.ref-mark {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border: 1px dashed var(--ref);
  border-radius: 3px;
  color: var(--ref);
  font-size: 0.66rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.04em;
  vertical-align: 1px;
  white-space: nowrap;
}
/* 説明の吹き出し：行（または見出し）の幅いっぱいに、すぐ下へ出す。少し待ってから出す（一覧の上をなぞったときにちらつかない） */
.ref-tip {
  position: absolute;
  z-index: 5;
  left: 8px;
  right: 8px;
  top: calc(100% + 4px);
  padding: 6px 9px;
  border: 1px dashed var(--ref);
  border-radius: 6px;
  background: rgba(5, 14, 31, 0.96);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  white-space: normal;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0s linear 0.15s;
}
.event-item.is-ref, .ref-anchor { position: relative; }
.event-list li:last-child .event-item.is-ref .ref-tip { top: auto; bottom: calc(100% + 4px); } /* 最後の行は上に */
@media (hover: hover) {
  .event-item.is-ref:hover .ref-tip,
  .ref-anchor .ref-mark:hover .ref-tip,
  .site-marker.is-ref:hover .ref-tip { opacity: 1; visibility: visible; transition-delay: 0.25s, 0.25s; }
}
.event-item.is-ref:focus-visible .ref-tip,
.site-marker.is-ref:focus-visible .ref-tip { opacity: 1; visibility: visible; transition-delay: 0s, 0s; }
@media (prefers-reduced-motion: reduce) { .ref-tip { transition: none; } }

/* 予定タブの下の段：世界の打ち上げ（公式の予定の箱とは、点線と色で分ける） */
.events.world { border-style: dashed; border-color: var(--ref-dim); background: rgba(168, 188, 224, 0.04); }
.world-title { color: var(--ref); }
.event-item.is-ref { border-style: dashed; }
.event-item.is-ref:hover { border-color: var(--ref); }
.event-item.is-ref .event-when,
.event-item.is-ref .event-left { color: var(--ref); }
/* 1行ずつに収める（名前が長ければ末尾を省く。全部の名前は詳細と読み上げに出る） */
.ref-line { display: flex; align-items: baseline; min-width: 0; }
.ref-line .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-line .event-left { flex: none; margin-left: 6px; }
/* 一覧の行では、印は日時の下にそろえて置く */
.event-when .ref-mark { align-self: flex-start; margin: 3px 0 0; font-family: var(--font-body); }

/* 詳細：説明の文は常に出す */
.ref-note {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px !important;
  padding: 8px 10px;
  border: 1px dashed var(--ref-dim);
  border-radius: 8px;
  background: rgba(168, 188, 224, 0.06);
  font-size: 0.85rem;
  line-height: 1.6;
}
.ref-note .ref-mark { margin-left: 0; flex: none; }
.class-chip.ref-chip { --c: var(--ref); border-style: dashed; }
.event-countdown.ref-box { border-style: dashed; background: rgba(168, 188, 224, 0.07); }
.event-countdown.ref-box .mono { color: var(--ref); }

/* 地球の上の世界の打ち上げのピン：点線のひし形。説明は名前の下に */
.site-marker.is-ref { --c: var(--ref); }
.site-marker.is-ref .diamond { border-style: dashed; box-shadow: none; }
.site-marker.is-ref .tag .ref-mark { margin-left: 2px; padding: 0 3px; font-size: 9px; vertical-align: 1px; }
.site-marker.is-ref .ref-tip { left: 50%; right: auto; top: 54px; width: 230px; transform: translateX(-50%); }

/* ---------- このアプリについて（ダイアログ） ---------- */
dialog.card {
  width: min(560px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 2 * var(--gutter));
  padding: 0;
  border: 1px solid var(--mint-dim);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(12, 33, 64, 0.97), rgba(5, 14, 31, 0.97));
  color: var(--text);
  box-shadow: 0 0 40px rgba(94, 242, 194, 0.15);
  overflow: auto;
}
dialog.card::backdrop { background: rgba(3, 8, 18, 0.65); backdrop-filter: blur(2px); }
.card-inner { position: relative; padding: 18px 18px 14px; }
.card-inner .close { position: absolute; top: 10px; right: 10px; }
.card-inner h2 { margin: 0 0 0.5rem; font-size: 1.15rem; color: var(--amber); }
.card-inner h3 { margin: 1rem 0 0.25rem; font-size: 0.95rem; color: var(--mint); }
.card-inner p { margin: 0.35rem 0; }
#about-tle { white-space: pre-line; }

/* 地球の左上：現在の地球 */
/* 地球の上：表示切替と、遠くを見る部屋への入口（PC は横に並べる） */
.globe-top {
  position: absolute;
  z-index: 6;
  top: calc(var(--top-h) + var(--nav-h) + 4px);
  left: 362px;
  display: flex;
  align-items: center;
  gap: 10px;
}
/* 地球の上の表示切替（すべて／日本のみ／衛星のみ／打ち上げ予定のみ）。押しているものはミント色 */
.view-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--mint-dim);
  border-radius: 999px;
  background: rgba(4, 12, 28, 0.72);
  backdrop-filter: blur(4px);
}
.view-switch button {
  appearance: none;
  position: relative;
  border: 0;
  border-radius: 999px;
  padding: 4px 12px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
}
.view-switch button:hover { background: var(--mint-faint); }
.view-switch button[aria-pressed="true"] { background: var(--mint); color: var(--navy-800); font-weight: 700; }
.view-switch button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.view-switch .vs-short { display: none; }
/* 遠くを見る部屋への入口：ほかの部屋へ行くボタンなので、表示切替（ミント）と分けてアンバーにする */
.far-open {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid var(--amber-dim);
  border-radius: 999px;
  background: rgba(255, 181, 71, 0.1);
  color: var(--amber);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.far-open:hover { background: rgba(255, 181, 71, 0.2); }
.far-open:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.far-open[aria-busy="true"] { cursor: progress; opacity: 0.75; }
.far-open .chev { font-size: 1rem; line-height: 1; }
/* 幅の狭い PC で詳細を開いているあいだは隠す（詳細のパネルと重なるため。閉じると戻る） */
@media (min-width: 901px) and (max-width: 1180px) { #app.has-selected .globe-top { display: none; } }

.earth-info {
  position: absolute;
  z-index: 6;
  top: calc(var(--top-h) + var(--nav-h) + 48px); /* 表示切替の下 */
  left: 362px;
  padding: 10px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: rgba(4, 12, 28, 0.62);
  font-size: 0.74rem;
  pointer-events: none;
}
.earth-info-title { margin: 0 0 6px; font-size: 0.82rem; font-weight: 700; color: var(--text); }
.earth-info dl { display: grid; grid-template-columns: auto auto; gap: 2px 12px; margin: 0; }
.earth-info dt { color: var(--text-dim); }
.earth-info dd { margin: 0; color: var(--text); }
@media (max-width: 1180px) { .earth-info { display: none; } }
/* メニュー */
.menu-btn {
  display: inline-grid;
  gap: 4px;
  width: 34px;
  height: 30px;
  place-content: center;
  margin-left: 6px;
  border: 0;
  background: none;
  cursor: pointer;
}
.menu-btn span { display: block; width: 20px; height: 1.5px; background: var(--text); }
.menu-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- 狭い画面：一覧と詳細は下から出るシート ---------- */
/* ---------- 部屋の帯と、右の「次の出来事」の列（PC。イメージ図の A 案。2026-10-04 オーナー） ---------- */
/* 部屋の帯：上のバーの下の真ん中。いまある部屋だけ（地球のまわり・遠くを見る・これから行く）。スマホは出さない */
.room-nav { display: none; }
.next-panel { display: none; }
@media (min-width: 901px) {
  :root { --nav-h: 48px; }
  .room-nav {
    position: absolute;
    z-index: 11;
    top: var(--top-h);
    left: 50%;
    transform: translateX(-50%);
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .room-nav button {
    appearance: none;
    height: 36px;
    padding: 0 18px;
    border: 1px solid var(--navy-600);
    border-radius: 18px;
    background: rgba(5, 14, 31, 0.6);
    color: var(--text);
    font: inherit;
    font-size: 0.875rem;
    white-space: nowrap;
    cursor: pointer;
    backdrop-filter: blur(4px);
  }
  .room-nav button[aria-current="true"] { background: var(--mint); border-color: var(--mint); color: #04211a; font-weight: 700; }
  .room-nav button[aria-busy="true"] { cursor: progress; opacity: 0.75; }
  .room-nav button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
  /* 帯と同じものは、地球の上に出さない（遠くを見る部屋の入口、打ち上げ予定のみ＝これから行く） */
  .far-open, .view-switch [data-view="launches"] { display: none; }
  /* 地球の注記：左の一覧と右（列・詳細）のあいだの真ん中に。入らなければ2行に */
  .scale-note { left: 362px; right: var(--right-gap, 16px); width: fit-content; max-width: calc(100vw - 362px - var(--right-gap, 16px)); margin: 0 auto; transform: none; white-space: normal; text-wrap: balance; text-align: center; }
  #app.has-selected .scale-note { --right-gap: 452px; }
}
@media (min-width: 901px) and (hover: hover) {
  .room-nav button:not([aria-current="true"]):hover { border-color: var(--mint-dim); background: rgba(94, 242, 194, 0.08); }
}
/* 右の列：広い画面（1181px から）だけ。詳細を開いているあいだと、一覧で「予定」を見ているあいだ（左に同じものが出る）は出さない */
@media (min-width: 1181px) {
  .next-panel { display: block; right: 16px; width: 340px; padding: 16px; }
  #app.has-selected .next-panel, #app.list-planned .next-panel { display: none; }
  #app:not(.has-selected):not(.list-planned) .scale-note { --right-gap: 372px; }
}
.next-panel .events-head { gap: 4px 10px; }
.next-panel-title { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--mint); letter-spacing: 0.04em; }
.next-panel-body { margin-top: 12px; }
.next-panel .event-item { grid-template-columns: 64px 1fr 12px; align-items: start; padding: 10px 12px; border-radius: 10px; }
.next-panel .event-when { font-size: 0.8rem; }
.event-desc { font-size: 0.74rem; line-height: 1.6; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 900px) {
  :root { --top-h: 56px; --switch-h: 44px; }
  /* 上のバーは1行：ロゴ（下に時刻）・今夜・LIVE・メニュー */
  .top-bar {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas: "brand chip badge menu" "time chip badge menu";
    align-items: center;
    gap: 2px 8px;
    padding: calc(env(safe-area-inset-top) + 6px) 8px 4px 12px;
  }
  .brand-block { grid-area: brand; }
  .brand img { height: 18px; }
  .brand-sub { display: none; }
  .clock-block { display: contents; }
  #sim-time { grid-area: time; font-size: 0.66rem; color: var(--text-dim); white-space: nowrap; }
  .live-badge { grid-area: badge; font-size: 0.72rem; padding: 2px 8px; }
  .menu-btn { grid-area: menu; width: 44px; height: 44px; margin-left: 0; }
  .tonight-chip {
    grid-area: chip;
    justify-self: end;
    position: relative;
    margin: 0;
    max-width: none;
    padding: 4px 12px;
    font-size: 0.85rem;
  }
  .tonight-chip::after { content: ""; position: absolute; inset: -8px -4px; } /* 押せる範囲を44pxに */
  .tonight-chip .chip-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tonight-chip .chip-short { display: inline; }
  /* スマホ：上の表示が「現在へ」を兼ねる。ずれているときは ↺ を付け、押せる範囲を44pxに */
  .live-badge { position: relative; }
  .live-badge::after, .live-badge[data-paused="true"]::after { content: ""; position: absolute; inset: -10px -4px; }
  .live-badge[data-live="false"]::before { content: "↺ "; }
  #now { display: none; }
  .side-panel {
    --sheet-bg: rgb(7, 20, 43); /* 不透明：上に残る名前の裏に本文が透けないように */
    top: auto;
    left: 0;
    right: 0;
    bottom: var(--bottom-h);
    width: auto;
    /* 開いたときは半分（地球が見える）。つまみで全部に広げる */
    max-height: calc((100dvh - var(--top-h) - var(--bottom-h)) * 0.6);
    transition: max-height 0.2s ease, height 0.2s ease, transform 0.2s ease;
    border-radius: 14px 14px 0 0;
    padding: 0 14px 12px;
    z-index: 20;
    background: var(--sheet-bg);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  }
  .side-panel.expanded {
    max-height: calc(100dvh - var(--top-h) - var(--switch-h) - var(--bottom-h) - 8px);
    height: calc(100dvh - var(--top-h) - var(--switch-h) - var(--bottom-h) - 8px);
  }
  /* シートを全部の高さに広げたときは、上に少しだけ見える地球の名前を消す（上のバーの文字と重なるため） */
  #app:has(.side-panel.expanded) #globe .tag { visibility: hidden; }
  /* 表示切替：上のバーのすぐ下に左寄せ。押せる範囲を44pxに */
  /* シートを全部に広げても隠れないように、シートより上に置き、シートはその下から */
  .globe-top { display: contents; }
  .view-switch { position: absolute; z-index: 21; left: 12px; top: calc(var(--top-h) + 2px); max-width: calc(100vw - 24px); }
  /* 入口は表示切替の下の右。一覧・詳細のシートを広げたときは、シートの下に隠れる */
  .far-open { position: absolute; z-index: 19; right: 12px; top: calc(var(--top-h) + var(--switch-h) + 8px); min-height: 40px; }
  .view-switch button { padding: 6px 10px; font-size: 0.8rem; }
  .view-switch button::after { content: ""; position: absolute; inset: -7px -1px; }
  /* つまみ：スクロールしても上に残る。押すと広げる／縮める、下へ引くと閉じる */
  .sheet-handle {
    position: sticky;
    top: 0;
    z-index: 3;
    display: block;
    width: calc(100% + 28px);
    height: 28px;
    margin: 0 -14px;
    padding: 0;
    border: 0;
    border-radius: 14px 14px 0 0;
    background: var(--sheet-bg);
    cursor: grab;
    touch-action: none;
  }
  .sheet-handle::before { content: ""; display: block; width: 40px; height: 4px; margin: 12px auto; border-radius: 2px; background: var(--mint-dim); }
  .sheet-handle:focus-visible { outline: 2px solid var(--amber); outline-offset: -4px; }
  /* 詳細の名前と × は、スクロールしても上に残す */
  .detail-panel .panel-head {
    position: sticky;
    top: 28px;
    z-index: 2;
    margin: 0 -14px 8px;
    padding: 0 14px 8px;
    background: var(--sheet-bg);
    border-bottom: 1px solid var(--panel-border);
    align-items: center;
  }
  /* 名前の行：種類の札は名前の上に小さく。名前・英名・NORAD は途中で折らない */
  .detail-panel .panel-title { font-size: 1.15rem; }
  .detail-panel .panel-title .class-chip { display: table; margin: 0 0 4px; font-size: 0.66rem; padding: 1px 6px; }
  .detail-panel .panel-head > div:first-child { min-width: 0; }
  .detail-panel .panel-ja > span { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
  .detail-panel .close, .detail-panel .follow-mini.narrow-only { display: block; width: 44px; height: 44px; }
  #follow { display: none; } /* スマホの追尾は、詳細の名前の横（◎） */
  .list-panel { display: none; }
  .list-panel.open { display: block; }
  .list-open { display: inline-block; flex: none; white-space: nowrap; }
  .btn { padding: 0.35em 0.6em; font-size: 0.78rem; min-height: 32px; }
  .wide-only { display: none; }
  /* 下のバーは1行：再生・時間・速さ・一覧（現在へは上の LIVE、追尾は詳細の名前の横） */
  .bottom-bar {
    padding: 8px 12px calc(env(safe-area-inset-bottom) + 6px);
    background: rgba(5, 14, 31, 0.94);
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas: "play slider speed ctl";
    align-items: center;
    gap: 6px 10px;
  }
  .timeline { display: contents; }
  #play { grid-area: play; width: 44px; height: 44px; }
  .slider-wrap { grid-area: slider; padding-top: 4px; }
  .ticks span:nth-child(2) { display: none; } /* −3h は狭いと重なる */
  .speeds { display: none; }
  .speed-cycle { grid-area: speed; display: inline-block; min-width: 56px; min-height: 44px; font-size: 0.85rem; }
  .bottom-bar .btn { min-height: 44px; padding: 0.35em 0.9em; font-size: 0.85rem; }
  /* 「現在へ」：いまを見ているときは控えめ、時刻がずれたら目立たせる */
  #now { grid-area: now; }
  #now .narrow-only { display: inline; }
  #app[data-live="true"] #now { opacity: 0.45; }
  #app[data-live="false"] #now { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 10px var(--amber-dim); }
  .controls-row { grid-area: ctl; gap: 8px; justify-content: flex-start; flex-wrap: nowrap; }
  .controls-row .fam-legend, .controls-row .rings-toggle { display: none; } /* 一覧のタブと、一覧の下の「環」で切り替える */
  .footnote { display: none; } /* 軌道データの日時と「このアプリについて」はメニューの中にある */
  .bottom-bar .warning { grid-column: 1 / -1; }
  /* 一覧を詰めて、カードが多く見えるように */
  .list-panel .list-title { display: none; }
  .list-panel .fam-tabs { margin-bottom: 8px; flex-wrap: nowrap; gap: 4px; }
  .fam-group { gap: 4px; }
  .fam-tab { padding: 5px 10px; }
  .search { margin-bottom: 8px; }
  .search input { padding-top: 7px; padding-bottom: 7px; }
  .craft-item { padding: 6px 10px; }
  .craft-thumb, .craft-icon { width: 30px; height: 30px; }
  .list-rings.narrow-only { display: flex; min-height: 44px; margin-top: 8px; padding-top: 4px; border-top: 1px solid var(--panel-border); font-size: 0.85rem; gap: 8px; white-space: normal; }
  .list-rings input { width: 20px; height: 20px; flex: none; }
  /* 環の注記は1行（くわしい数字は「このアプリについて」にある） */
  .scale-note { bottom: calc(var(--bottom-h) + 8px); font-size: 0.66rem; white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 16px); }
  .scale-note .narrow-only { display: inline; }
}
@media (max-width: 400px) {
  .orbit-stats { grid-template-columns: auto 1fr; }
}
/* とても狭い画面（幅320〜374）：上のバーを1行に収める */
@media (max-width: 374px) {
  .top-bar { gap: 2px 6px; padding-left: 10px; }
  #sim-time { font-size: 0.58rem; }
  .tonight-chip { padding: 4px 8px; }
  .tonight-chip .pin { display: none; }
  .scale-note { font-size: 0.6rem; }
  .ticks span:nth-child(1), .ticks span:nth-child(4), .ticks span:nth-child(5) { display: none; } /* 現在と +24h だけ */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* とても狭い画面（幅380px未満）では、表示切替を短い名前に（読み上げは長い名前のまま） */
@media (max-width: 379px) {
  .view-switch .vs-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .view-switch .vs-short { display: inline; }
}
