:root {
  --bg: #14181d; --panel: #1c2229; --line: #2f3944; --text: #e8edf2; --sub: #a9b4c0;
  --accent: #5cc4f5; --ok: #7ed492; --ng: #ff8b85; --btn: #27303a; --btn-on: #093d5a; --dim: #9aa5b1;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font: 14px/1.6 "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif; line-break: strict; word-break: keep-all; }
.nw { white-space: nowrap; }
#view { position: fixed; inset: 0 320px 0 0; }
#view canvas { display: block; }
#labels { position: fixed; inset: 0 320px 0 0; pointer-events: none; overflow: hidden; }
#labels div { position: absolute; transform: translate(-50%, -50%); padding: 2px 8px; border-radius: 4px; white-space: nowrap;
  background: rgba(10, 14, 18, .88); color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; border: 1px solid var(--accent); }
#labels div.clear { border-color: var(--ok); }
#labels div.hit { border-color: var(--ng); }

#panel { position: fixed; top: 0; right: 0; bottom: 0; width: 320px; background: var(--panel); border-left: 1px solid var(--line);
  padding: 16px 16px 24px; overflow-y: auto; }
h1 { font-size: 16px; margin: 0 0 4px; white-space: nowrap; }
.scene { margin: 0 0 10px; color: var(--sub); font-size: 13px; } .scene b { color: var(--text); }
h1 span { margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: var(--btn); color: var(--sub); font-size: 12px; font-weight: 400; }
h2 { font-size: 12px; color: var(--sub); font-weight: 700; margin: 0 0 8px; letter-spacing: .08em; }
section { padding: 12px 0; border-top: 1px solid var(--line); }
.row { display: flex; gap: 8px; margin-top: 8px; }
.row:first-of-type { margin-top: 0; }
button { flex: 1; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--btn); color: var(--text);
  font: inherit; cursor: pointer; white-space: nowrap; }
button:hover:not(:disabled) { border-color: var(--accent); }
button.on { background: var(--btn-on); border-color: var(--accent); }
button:disabled { color: var(--dim); cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { margin: 8px 0 0; color: var(--sub); font-size: 13px; }
.note { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--sub); font-size: 12px; }
.none { color: var(--sub); margin: 0; }
label { display: block; margin: 2px 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
#objs { max-height: 216px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
#objs li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 10px; cursor: pointer; white-space: nowrap; }
#objs li:hover { background: var(--btn); }
#objs li.sel { background: var(--btn-on); }
#objs li.off { color: var(--dim); }
#objs li.sel.off { color: #d5dde5; }
#objs li em, #sel em { font-style: normal; }
em.ok { color: var(--ok); } em.ng { color: var(--ng); } em.mv { color: var(--accent); }
#sel dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0 0 4px; }
#sel dt { color: var(--sub); white-space: nowrap; } #sel dd { margin: 0; font-variant-numeric: tabular-nums; }
#sel b.name { font-size: 15px; }
#meas li { display: flex; justify-content: space-between; padding: 2px 0; font-variant-numeric: tabular-nums; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 10; }
#loading > div { width: 280px; text-align: center; }
#bar { height: 4px; margin-top: 12px; background: var(--btn); border-radius: 2px; overflow: hidden; }
#bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* スマホ（縦）：上に 3D、下に操作欄 */
@media (max-width: 760px) {
  #view, #labels { inset: 0 0 46vh 0; }
  #panel { top: auto; left: 0; width: auto; height: 46vh; border-left: 0; border-top: 1px solid var(--line); padding: 12px 16px 20px; }
  h1 { font-size: 15px; margin-bottom: 8px; }
  section { padding: 10px 0; }
  #objs { max-height: 132px; }
}
