:root {
  --bg: #0f151b; --panel: #151d25; --line: rgba(255,255,255,.1); --text: #eef3f7; --mut: #9aa7b3;
  --p: #78c8ff; --s: #ff9a4a; --l: #b6f26b; --accent: #4ade80;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
#app { display: grid; grid-template-columns: 1fr 350px; height: 100vh; }
#stage { display: grid; grid-template-rows: 1fr 210px; min-width: 0; min-height: 0; }
#viewWrap { position: relative; min-height: 0; }
#earth { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#hudTime { position: absolute; top: 12px; left: 14px; pointer-events: none; display: flex; flex-direction: column; }
#hudTime b { font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
#hudTime span { color: var(--mut); font-size: 12px; }
#hudHint { position: absolute; bottom: 8px; left: 14px; color: var(--mut); font-size: 11px; pointer-events: none; }
#tip { position: absolute; pointer-events: none; background: rgba(10,14,18,.92); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: 12px; line-height: 1.45; max-width: 230px; z-index: 5; }
#tip b { font-size: 13px; }
#tip span { color: var(--mut); }
#seisWrap { border-top: 1px solid var(--line); background: #0b1015; display: flex; flex-direction: column; min-height: 0; }
.seisHead { display: flex; align-items: center; gap: 10px; padding: 6px 14px; font-size: 13px; }
.seisHead span { color: var(--mut); font-size: 12px; flex: 1; }
.seisHead select { background: #1b252e; border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; }
.seisHead label { color: var(--mut); font-size: 12px; }
#seis { flex: 1; width: 100%; min-height: 0; display: block; }

#panel { background: var(--panel); border-left: 1px solid var(--line); padding: 16px 18px 24px; overflow-y: auto; }
h1 { margin: 0 0 4px; font-size: 22px; }
h2 { margin: 20px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--mut); }
.sub, .note, .foot { color: var(--mut); font-size: 12px; line-height: 1.5; margin: 0 0 12px; }
.foot { margin-top: 18px; font-size: 11px; }
.row { display: flex; gap: 8px; margin-bottom: 10px; }
.row.wrap { flex-wrap: wrap; }
.primary { background: linear-gradient(135deg, #22c55e, #15803d); border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 600; flex: 1; }
.ghost { background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; }
.ghost:hover { background: rgba(255,255,255,.14); }
.preset { font-size: 12px; padding: 5px 9px; }
.ctl { display: block; font-size: 13px; margin: 8px 0; }
.ctl output { float: right; font-variant-numeric: tabular-nums; color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); margin: 4px 0 0; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 13px; }
.toggles label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.p { background: var(--p); } .sw.s { background: var(--s); } .sw.l { background: var(--l); } .sw.r { background: #fff; opacity: .5; } .sw.n { background: #888; }
table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--mut); font-weight: 500; padding: 3px 4px; }
td { padding: 5px 4px; border-top: 1px solid var(--line); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(255,255,255,.05); }
tbody tr.sel { background: rgba(74,222,128,.12); }
td.na { color: #ff8b8b; }
#legend .lg { display: grid; grid-template-columns: 14px 1fr; gap: 0 9px; margin-bottom: 8px; font-size: 12px; line-height: 1.4; }
#legend i { width: 14px; height: 14px; border-radius: 4px; margin-top: 2px; }
#legend small { color: var(--mut); }
details { margin-top: 16px; font-size: 13px; }
summary { cursor: pointer; color: var(--mut); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.facts { padding-left: 18px; line-height: 1.5; color: #cfd8df; }
.facts li { margin: 6px 0; }
.cp { color: var(--p); } .cs { color: var(--s); } .cl { color: var(--l); }
@media (max-width: 900px) {
  html, body { height: auto; }
  #app { grid-template-columns: 1fr; height: auto; }
  #stage { grid-template-rows: 70vw 190px; }
  #panel { border-left: 0; border-top: 1px solid var(--line); }
  #hudHint { display: none; }
}
