/* style.css — 天空率チェッカー（~/dev/arch-skyfactor-deploy/index.html 4ee646e の <style>）の写し。共通の見た目 */
  :root {
    /* 共通（明るい配色）*/
    --txt: #1f2937; --dim: #64748b; --mute: #94a3b8;
    --blue: #2563eb; --blue-2: #1d4ed8; --blue-soft: #dbeafe;
    --green: #16a34a; --green-soft: #dcfce7;
    --red: #dc2626; --red-soft: #fee2e2;
    --warn: #d97706; --warn-soft: #fef3c7;
    --info: #2563eb; --info-soft: #dbeafe;
    --accent: #1e3a8a;
    /* 採用配色: 薄い青みのある白 */
    --page: #eef5fb; --panel: #ffffff; --panel-bd: #c9d9ea; --field: #ffffff; --line: #dfe9f3; --chip: #eaf2fa;
    --accent: #1e40af;
    --shadow: 0 2px 10px rgba(15,23,42,.08);
    /* 左右パネルの幅（2026-09-24 VOX#3641: 272px→1.2倍の326px。狭い画面では 24vw まで縮め、最小272px）*/
    --pw: clamp(272px, 24vw, 326px);
  }

  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html, body { height: 100%; margin: 0; overflow: hidden; background: var(--page); }
  body { font-family: "Noto Sans CJK JP", "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif; color: var(--txt); font-size: 14px; }
  #viewport { position: fixed; inset: 0; }
  #viewport canvas { display: block; touch-action: none; }

  /* ===== パネル共通 ===== */
  .fpanel {
    position: fixed; top: 12px; background: var(--panel); border: 1px solid var(--panel-bd);
    border-radius: 10px; padding: 14px 16px; user-select: none; box-shadow: var(--shadow);
    max-height: calc(100vh - 24px); overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; z-index: 100;
    transition: transform .25s;
  }
  .fpanel::-webkit-scrollbar { width: 9px; }
  .fpanel::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
  .fpanel::-webkit-scrollbar-track { background: transparent; margin: 10px 0; }
  #controls { left: 12px; width: var(--pw); }
  #panel { right: 12px; width: var(--pw); }
  .fpanel h1 { font-size: 16.5px; margin: 0 0 6px; color: var(--accent); display: flex; align-items: center; justify-content: space-between; letter-spacing: .02em; }
  .fpanel h2 { font-size: 13px; color: var(--dim); margin: 14px 0 6px; font-weight: 700; letter-spacing: .04em; }
  #panel h2.sec { font-size: 16.5px; color: var(--accent); letter-spacing: .02em; margin: 8px 0 4px; }
  #panel h2.resh { color: #c81e1e; } /* 赤（白地でコントラスト 5.6:1） */
  .vis.off { color: var(--mute); cursor: default; }
  .vis.off .box { background: var(--line); border-color: var(--line); }

  /* ===== 手順（1〜6。いま何段目か／次にやること）===== */
  .step { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; transition: opacity .2s; }
  .step:first-of-type { border-top: none; margin-top: 4px; padding-top: 2px; }
  /* 2026-09-27 VOX#4004: 済み・未着手の段を薄くしすぎると「ロックされて戻れない」に見える → ほぼ通常の濃さ（.9／.88）。
     いま何段目かは「薄さ」ではなく「位置」＝現在の段の背景の帯＋左の青い縦線（＋番号の青）で示す */
  .step.done { opacity: .9; }
  .step.done:hover { opacity: 1; }
  .step.todo { opacity: .88; }
  .step.current { background: #f1f6fd; box-shadow: inset 3px 0 0 var(--blue); border-radius: 8px; margin-left: -8px; margin-right: -8px; padding: 8px 8px 8px 10px; border-top-color: transparent; }
  .step.current + .step { border-top-color: transparent; }
  /* まだ進めない段は中身を畳む（頭と「次にやること」だけ残す）＝1画面に詰め込まず順に聞く */
  .step.todo > *:not(.stephead):not(.stepnext) { display: none !important; }
  .step.todo.pend > #checks { display: flex !important; }
  .step.todo.pend > #btnCompute { display: flex !important; } /* 手順4が未確認でも［計算する］は押せる */
  /* ただし「計算できない理由（赤）」だけは、その段に進む前でも必ず見せる */
  .step.todo #checks { display: flex !important; }
  .step.todo #checks .chk:not(.red):not(.act) { display: none; } /* 単位のボタン付きの行も先に見せる（読み直さないと先へ進めないため） */
  /* 手順1: DXF未読込のうちは畳む。見出しはクリックで手動開閉できる（2026-09-27 VOX#4069） */
  .step.collapsed > *:not(.stephead):not(.stepnext) { display: none !important; }
  .stephead[data-step="1"] { cursor: pointer; }
  .stephead[data-step="1"]::after { content: ""; width: 6px; height: 6px; margin-left: auto; flex: none; border-right: 2px solid var(--dim); border-bottom: 2px solid var(--dim); transform: rotate(45deg); transition: transform .15s; }
  .step.collapsed .stephead[data-step="1"]::after { transform: rotate(-45deg); }
  .stepnext { font-size: 12.5px; line-height: 1.5; margin: 5px 0 2px 28px; color: var(--blue-2); font-weight: 600; }
  .stepnext:empty { display: none; }
  .note { font-size: 12px; line-height: 1.5; color: var(--mute); margin: 5px 0 0 0; }
  .step.todo .stepnext, .step.done .stepnext { color: var(--dim); font-weight: 500; }
  .stephead { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--txt); }
  .stepnum {
    width: 22px; height: 22px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; background: var(--chip); color: var(--mute); border: 1.5px solid var(--panel-bd);
  }
  /* いま何段目かは色と動きだけで示す（「済」「今ここ」などの文字は出さない）:
     今ここ＝番号が青でゆっくり脈打つ＋「次にやること」の先頭に矢印／済＝番号が緑で全体が薄い／これから＝灰で薄い */
  .stephead.current .stepnum { background: var(--blue); color: #fff; border-color: var(--blue); animation: stepPulse 2s ease-in-out infinite; }
  .stephead.done .stepnum { background: var(--green); color: #fff; border-color: var(--green); }
  .stephead.todo { color: var(--txt); }   /* 見出しは通常の色（番号の丸だけ灰＝未着手）VOX#4004 */
  #controls .stephead { font-size: 13px; gap: 6px; }
  .stepprice { margin-left: 8px; font-size: 11px; font-weight: 500; color: var(--mute); white-space: nowrap; }   /* 手順6の価格（薄いグレー1行。VOX#4492）。見出しのすぐ右に少し空けて左寄せ（VOX#4503） */
  .step.current .stepnext::before { content: "\25B8"; margin-right: 4px; animation: stepPulse2 2s ease-in-out infinite; }
  @keyframes stepPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(59, 165, 165, .45); } 50% { box-shadow: 0 0 0 5px rgba(59, 165, 165, 0); } }
  @keyframes stepPulse2 { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
  /* 動きが苦手な人の設定（OS の「視差効果を減らす」）では点滅させず、静かな輪だけにする */
  @media (prefers-reduced-motion: reduce) {
    .stephead.current .stepnum { animation: none; box-shadow: 0 0 0 3px rgba(59, 165, 165, .28); }
    .step.current .stepnext::before { animation: none; }
  }

  /* ===== ボタン ===== */
  button, .btn {
    width: 100%; margin-top: 8px; padding: 10px; font-size: 15.5px; font-weight: 700; font-family: inherit;
    border: 1px solid transparent; border-radius: 8px; background: var(--blue); color: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.1;
  }
  button:hover, .btn:hover { background: var(--blue-2); }
  button:disabled { opacity: .4; cursor: not-allowed; }
  button.ghost, .btn.ghost { background: var(--field); border-color: var(--panel-bd); color: var(--txt); font-weight: 600; font-size: 14px; padding: 8px; }
  button.ghost:hover { background: var(--chip); }
  button.on, .btn.on { background: var(--green); border-color: transparent; color: #fff; }
  button svg, .btn svg { width: 16px; height: 16px; flex: none; }
  .btn input[type=file] { display: none; }
  .link { display: inline-block; margin: 6px 0 0 2px; font-size: 13px; color: var(--blue); cursor: pointer; text-decoration: none; }
  .link:hover { text-decoration: underline; }
  .link + .link { margin-left: 12px; }
  .row2 { display: flex; gap: 6px; } .row2 > * { flex: 1; }
  /* 斜線の種別（3つから1つ選ぶ）*/
  .seg3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 6px; }
  .seg3 button { margin: 0; padding: 8px 2px; font-size: 13px; }
  #slantSeg, #methodSeg { grid-template-columns: 1fr 1fr; }
  /* 手順6: 書き出す図面の形式（DXF だけ。版を選ぶ） */
  .fmts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 8px 28px; font-size: 12.5px; color: var(--mute); }
  .fmts .fl { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
  .fmts .fl.fixed { cursor: default; opacity: .85; }
  .fmts input { margin: 0; }
  .other { display: block; margin: 8px 0 0 28px; font-size: 12.5px; color: var(--mute); background: none; border: none; padding: 0; width: auto; text-align: left; cursor: pointer; font-weight: 500; }
  .other:hover { color: var(--blue); text-decoration: underline; }
  .restitle { font-size: 13px; font-weight: 700; color: var(--accent); margin-top: 10px; padding-bottom: 2px; border-bottom: 1px solid var(--line); }

  /* ===== 行（ラベル＋値／幅いっぱいのコントロール）===== */
  .lrow { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; margin-top: 8px; gap: 8px; }
  .lrow .lab { color: var(--txt); font-weight: 700; flex: none; display: inline-flex; align-items: center; gap: 4px; }
  .lrow .val { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
  .lrow .val.ok { color: var(--green); }
  .lrow .val.ng { color: var(--red); }
  .lrow .val.warn { color: #b45309; }
  .hint { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--mute); color: var(--mute); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; cursor: help; flex: none; }
  .ctl { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
  .ctl input[type=number], .ctl select, .ctl input[type=text] {
    flex: 1; min-width: 0; width: 100%; font-family: inherit; font-size: 14px; color: var(--txt);
    background: var(--field); border: 1px solid var(--panel-bd); border-radius: 6px; padding: 7px 8px;
  }
  .ctl input:focus, .ctl select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
  .ctl input.empty, .ctl select.empty { border-color: var(--red); background: var(--red-soft); }
  .ctl .unit, .ctl .auto { color: var(--mute); font-size: 12px; flex: none; }
  select { cursor: pointer; }

  /* ===== 高さの欄（道路中心＝頂点 A・B・C…ごと／地盤面）=====
     2026-09-23 ユーザー決定（VOX#3525〜3528）: 詳細設定の中ではなく手順3（条件）の本流に常設する。
     既定は0（触らなければ従来どおり）。欄と3Dの札は双方向に光る（.hot）ので、A/B がどちらの端か図で分かる。
     「高低差はありますか」の分岐は作らない（平坦な敷地は実在しない＝道路には必ず縦断勾配がある、という指摘のため）。 */
  .zgrid { margin-top: 4px; }
  .zfield { padding: 4px 6px; border-radius: 8px; border: 1px solid transparent; transition: background .12s, border-color .12s; }
  .zfield .zlab { font-size: 13px; color: var(--dim); display: flex; align-items: center; gap: 4px; }
  .zfield .ctl { margin-top: 3px; }
  .zfield.hot { background: var(--warn-soft); border-color: var(--warn); }
  .zfield.hot .zlab { color: #92400e; font-weight: 700; }
  .dlabel.hot { background: var(--warn-soft); border-color: var(--warn); color: #92400e; box-shadow: 0 0 0 3px rgba(217,119,6,.28); animation: zpulse .8s ease-in-out infinite; z-index: 5; }
  @keyframes zpulse { 0%, 100% { scale: 1; } 50% { scale: 1.6; } }
  .znote { font-size: 12px; line-height: 1.5; color: var(--mute); margin-top: 5px; }
  /* 出力内容の一覧・サンプルの案内は薄くしない（本文と同じ濃さで読める色に。2026-09-28 VOX#4088） */
  /* 手順6の価格（2026-10-10 VOX#5160）: 段が開いたら見出し横ではなく［図面を出力］の直下に1行（プレビューの値段に見えないように）。閉じている間は見出し横 */
  .step[data-wrap="6"]:not(.todo) .stepprice { display: none; }
  .exportPrice { margin-top: 5px; font-size: 12.5px; line-height: 1.4; color: var(--dim); text-align: center; white-space: nowrap; }
  #btnViewPDF { margin-bottom: 6px; }
  .zwarn { font-size: 12px; line-height: 1.45; padding: 4px 6px 4px 20px; border-radius: 6px; position: relative; margin-top: 6px; background: var(--warn-soft); color: #92400e; }
  .zwarn::before { content: ""; position: absolute; left: 7px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
  /* 道路の中心の高さ・任意の位置の高さ（高さ1・高さ2…。2026-09-27 VOX#4061: 足す手段が中心線クリックしかなく分かりにくい→ボタンを追加） */
  /* 頂点ごとの欄（幅員・道路中心の高さ。なぞった境界線の端点・折れ点 A・B・C…の数だけ並ぶ・VOX#4729） */
  .vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; margin-top: 4px; }
  .vgrid .zfield, .vgrid .vcell { padding: 2px 4px; }
  .vgrid .ctl { margin-top: 0; gap: 4px; }
  .vgrid .vlab { font-size: 13px; font-weight: 700; color: var(--dim); flex: none; min-width: 1.1em; }
  .vgrid input[type=number] { padding: 5px 6px; }
  .vnote { font-size: 11px; color: var(--mute); margin-top: 2px; white-space: nowrap; }
  .zhead { padding: 4px 6px 0; }
  #roadMidBlock { margin: 4px 0 8px; }
  #roadMidBlock .oppRow { margin-top: 2px; }
  .zfield .ctl button.midDel { width: auto; margin: 0; padding: 2px 8px; font-size: 13px; font-weight: 700; }

  .assign { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }
  .assign .gname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .assign .seg { display: inline-flex; border: 1px solid var(--panel-bd); border-radius: 6px; overflow: hidden; flex: none; }
  .assign .seg button { width: auto; margin: 0; padding: 5px 9px; font-size: 12px; border-radius: 0; border: none; background: var(--field); color: var(--dim); }
  .assign .seg button.on { background: var(--green); color: #fff; }

  /* サマリ・チェック（常時表示）*/
  #checks { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
  .chk { font-size: 12px; line-height: 1.45; padding: 4px 6px 4px 20px; border-radius: 6px; position: relative; }
  .chk::before { content: ""; position: absolute; left: 7px; top: 8px; width: 7px; height: 7px; border-radius: 50%; }
  .chk.red { background: var(--red-soft); color: #991b1b; } .chk.red::before { background: var(--red); }
  .chk.yellow { background: var(--warn-soft); color: #92400e; } .chk.yellow::before { background: var(--warn); }
  .chk.blue { background: var(--info-soft); color: #1e40af; } .chk.blue::before { background: var(--info); }
  .chklink { margin-left: 8px; font-size: 12px; color: inherit; text-decoration: underline; cursor: pointer; white-space: nowrap; }
  .chkbox { margin-left: 8px; font-size: 12px; white-space: nowrap; cursor: pointer; }
  .chkbox input { vertical-align: middle; margin-right: 3px; }
  .chkbtn { margin-left: 8px; padding: 1px 8px; font-size: 12px; border: 1px solid currentColor; border-radius: 5px; background: #fff; color: inherit; cursor: pointer; white-space: nowrap; }
  .chk.pend { background: none; color: var(--mute, #8a8f98); padding-left: 6px; } .chk.pend::before { display: none; }
  .chk.ok { background: var(--green-soft); color: #166534; } .chk.ok::before { background: var(--green); }

  details.adv { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
  details.adv > summary { cursor: pointer; font-size: 13px; color: var(--dim); font-weight: 700; }
  details.adv[open] > summary { color: var(--txt); }

  /* 出力される図面一覧（2026-09-28 VOX#4092。旧「使い方動画」の枠。.howto/.ht は箱の外枠・見出し行として流用） */
  .howto { margin-top: 14px; border: 1px solid var(--panel-bd); border-radius: 8px; overflow: hidden; background: var(--field); }
  .howto .ht { font-size: 13px; font-weight: 700; padding: 7px 10px; display: flex; align-items: center; gap: 6px; }
  .howto .ht svg { width: 14px; height: 14px; color: var(--blue); }
  .olBody { padding: 2px 10px 8px; font-size: 12px; line-height: 1.6; color: var(--txt); }
  .olGroup { font-weight: 700; margin-top: 4px; }
  .olNote { font-size: 11px; color: var(--mute); padding: 0 10px 8px; }

  /* ===== 右パネル ===== */
  .vis { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 5px 2px; cursor: pointer; }
  .vis input { display: none; }
  .vis .box { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--panel-bd); background: var(--field); flex: none; position: relative; }
  .vis input:checked + .box { background: var(--green); border-color: var(--green); }
  .vis input:checked + .box::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
  .vp { display: flex; gap: 6px; } .vp button { flex: 1; width: auto; padding: 8px 4px; font-size: 13px; }
  .ctl select.small { padding: 6px 8px; font-size: 13px; }
  table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
  th, td { border-bottom: 1px solid var(--line); padding: 5px 4px; text-align: center; }
  th { color: var(--mute); font-weight: 600; font-size: 12px; }
  tbody tr { cursor: pointer; } tbody tr:hover { background: var(--chip); } tbody tr.sel { background: var(--blue-soft); }
  tr.ng td { color: var(--red); font-weight: 700; }
  tr.tight td { background: #fef9c3; } tr.tight td:nth-child(5) { color: #a16207; font-weight: 700; } /* ぎりぎり（差 0.02% 未満・合格）VOX#4193 */
  tr.near td:nth-child(4) { font-weight: 700; }
  .seldot { color: var(--green); font-size: 10px; }
  .badge-near { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.4; color: var(--red); background: #fff; border: 1px solid var(--red); border-radius: 6px; padding: 0 4px; margin-left: 2px; vertical-align: middle; }
  /* 総合判定（表の上に大きく。適合＝緑／不適合＝赤＋不適合の測定点）*/
  #verdict, #verdictKita { margin: 4px 0 8px; padding: 5px 10px; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; border-radius: 10px; border: 2px solid transparent; }
  #verdict:empty, #verdictKita:empty { display: none; }
  #verdict .vb, #verdictKita .vb { white-space: nowrap; } #verdict .vs, #verdictKita .vs { word-break: keep-all; overflow-wrap: anywhere; } #verdict .vt, #verdictKita .vt { flex-basis: 100%; }
  #verdict .vh, #verdictKita .vh { font-size: 12px; font-weight: 700; color: var(--mute); }
  #verdict .vb, #verdictKita .vb { font-size: 22px; font-weight: 800; line-height: 1.3; }
  #verdict .vs, #verdictKita .vs { font-size: 12.5px; font-weight: 700; line-height: 1.5; }
  #verdict .vt, #verdictKita .vt { font-size: 12px; font-weight: 700; margin-top: 3px; padding: 1px 6px; border-radius: 4px; background: #fef9c3; color: #a16207; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* ぎりぎり（合格のまま・VOX#4193） */
  #verdict.ok, #verdictKita.ok { color: var(--green); border-color: var(--green); background: #f0fdf4; }
  #verdict.ng, #verdictKita.ng { color: var(--red); border-color: var(--red); background: var(--red-soft); }
  #skyLabel { font-size: 12px; color: var(--dim); margin: 8px 0 6px; white-space: nowrap; overflow: hidden; }
  #skyLabel .skyno { font-size: 1.35em; font-weight: 800; color: #1f2937; }
  #skyLabel .skyval { color: #334155; font-weight: 600; }
  .sky { display: flex; gap: 8px; }
  .sky figure { margin: 0; flex: 1; text-align: center; font-size: 11.5px; color: var(--mute); }
  .skycv { width: 100%; aspect-ratio: 1; border: 1px solid var(--panel-bd); border-radius: 6px; overflow: hidden; background: #fff; margin-bottom: 4px; }
  .skycv svg { width: 100%; height: 100%; display: block; }
  /* 高さの低い画面（1366×768 など）では天空図を広げすぎず、右パネルを1画面に収める（2026-09-24 パネル拡幅に伴う）*/
  @media (max-height: 820px) { .skycv { max-width: 110px; margin: 0 auto 4px; } #panel th, #panel td { padding-top: 3px; padding-bottom: 3px; } #panel .vis { padding: 3px 2px; } }
  /* ===== ご意見フォーム（右パネルの結果の下・2026-09-24 VOX#3677）===== */
  #fbBox { margin-top: 26px; }
  #fbBox .fbLead { font-size: 12.5px; color: var(--dim); margin: -2px 0 6px; }
  #fbBox .fbHead { font-size: 13.5px; font-weight: 700; color: var(--blue); letter-spacing: .02em; margin: 0 0 6px; }
  #fbForm textarea { display: block; width: 100%; resize: none; height: 118px; font: inherit; font-size: 13.5px; line-height: 1.5; padding: 8px 10px;
    border: 1px solid var(--panel-bd); border-radius: 8px; background: var(--field); color: var(--txt); transition: height .15s; }
  #fbForm textarea::placeholder { color: #a8b3c2; opacity: 1; font-size: 12.5px; }
  #fbForm textarea:focus { outline: none; height: 150px; border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
  #fbForm .empty { border-color: var(--red); background: var(--red-soft); }
  #fbForm .fbRow { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
  #fbForm .fbStatus { flex: 1; font-size: 11.5px; line-height: 1.4; color: var(--dim); }
  #fbForm .fbStatus.ok { color: var(--green); font-weight: 700; }
  #fbForm .fbStatus.err { color: var(--red); }
  #fbForm .fbStatus.warn { color: #b45309; }
  #fbForm .fbPriv { font-size: 11px; color: var(--mute); text-decoration: none; }
  #fbForm .fbPriv:hover { color: var(--blue); text-decoration: underline; }
  #fbForm #fbSend { width: auto; margin: 0; padding: 4px 14px; font-size: 13px; border-radius: 6px; }
  #fbForm .fbHp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .empty { font-size: 12px; color: var(--mute); padding: 6px 2px; }
  #emptyHint { font-size: 14px; color: var(--dim); text-align: center; padding: 16px 8px; margin-top: 6px; border: 1.5px dashed var(--panel-bd); border-radius: 8px; background: var(--chip); }

  /* ===== 3D上の札（CADの注記風: 画面上で一定の小さな文字・枠なし＋白フチ。VOX#4509）===== */
  #labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 90; }
  #labels svg.leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  #labels svg.leaders path { fill: none; stroke: #64748b; stroke-width: 1; }
  .dlabel {
    position: absolute; transform-origin: 50% 50%; background: none; color: #1e293b;
    font-size: 11px; line-height: 1.25; font-weight: 600; padding: 0 2px; border: 0; border-radius: 3px; white-space: nowrap; text-align: center; pointer-events: none;
    font-variant-numeric: tabular-nums; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff;
  }
  .dlabel.edit { pointer-events: auto; cursor: pointer; color: var(--blue-2); text-decoration: underline dotted; text-underline-offset: 2px; }
  .dlabel.edit:hover { background: rgba(255,255,255,.95); }
  .dlabel.pt { font-size: 10px; font-weight: 600; color: #334155; padding: 0 1px; } /* 位置は updateLabels が決める（点のすぐ脇・重なり回避） */
  .dlabel.ml { white-space: pre; }
  .dlabel.dim { color: #c2410c; }
  .dlabel.road { color: #15803d; }
  .dlabel.conf { color: #b45309; }
  .dlabel.north { color: #7c3aed; font-weight: 700; } /* 真北の先端の N（VOX#4036） */
  .dlabel.hidden { display: none; }
  #zEdit { position: fixed; z-index: 120; display: none; background: var(--panel); border: 1px solid var(--blue); border-radius: 8px; padding: 8px 10px; width: 230px; box-shadow: var(--shadow); }
  #zEdit .t { font-size: 12px; color: var(--dim); margin-bottom: 4px; }
  #zEdit .ctl { margin-top: 0; } #zEdit .ctl input { padding: 5px 7px; }
  #zEdit .ctl button { width: auto; margin: 0; padding: 6px 10px; font-size: 13px; }
  #zEdit #zEditDel { margin-left: 4px; background: transparent; color: var(--dim); border: 1px solid var(--line); }
  #roadZWrap { margin-top: 6px; } #roadZWrap summary { cursor: pointer; font-size: 12.5px; color: var(--dim); }
  #roadZWrap .ztab { font-size: 12px; } #roadZWrap .ztab th { font-weight: 500; font-size: 11px; line-height: 1.2; }

  /* ===== ツールチップ ===== */
  #tip { position: fixed; z-index: 200; display: none; max-width: 460px; background: #1f2937; color: #f8fafc; font-size: 12.5px; line-height: 1.55; padding: 7px 10px; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.18); pointer-events: none; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }  /* 文節の途中で折り返さない（VOX#4570） */

  /* ===== なぞる・方位記号 ===== */
  #btnTrace.on, #btnSiteTrace.on, #btnNorth.on { background: #7c3aed; border-color: #7c3aed; color: #fff; }
  #traceTools, #siteTraceTools, #northTools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
  #traceTools[hidden], #siteTraceTools[hidden], #northTools[hidden] { display: none; }
  #traceTools button, #siteTraceTools button, #northTools button { margin: 0; padding: 7px 6px; font-size: 13px; }
  body.tracing #labels .dlabel { pointer-events: none !important; opacity: .35; }
  #snapMark { position: fixed; z-index: 90; pointer-events: none; display: none; width: 0; height: 0; }
  #snapMark i { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; box-sizing: border-box; border: 2.5px solid #16a34a; background: rgba(22,163,74,.18); }
  #snapMark.siteV i { border-radius: 2px; }
  #snapMark.close i { border-radius: 50%; border-color: #ea580c; background: rgba(234,88,12,.22); transform: scale(1.25); }
  #snapMark.close span { background: #ea580c; }
  #snapMark.lineEnd i { border-radius: 50%; border-color: #0284c7; background: rgba(2,132,199,.18); }
  #snapMark.lineV i { transform: rotate(45deg) scale(.85); border-color: #0284c7; background: rgba(2,132,199,.18); }
  #snapMark.free i { left: -4px; top: -4px; width: 8px; height: 8px; border: 2px solid #7c3aed; border-radius: 50%; background: transparent; }
  #snapMark span { position: absolute; left: 12px; top: -26px; white-space: nowrap; font-size: 12px; font-weight: 700; color: #fff; background: #16a34a; padding: 2px 7px; border-radius: 5px; }
  #snapMark.lineEnd span, #snapMark.lineV span { background: #0284c7; }
  #snapMark.free span { display: none; }
  #snapMark.circleC i { border-radius: 50%; border-color: #7c3aed; background: rgba(124,58,237,.2); box-shadow: 0 0 0 5px rgba(124,58,237,.25); }
  #snapMark.circleC span { background: #7c3aed; }
  #snapMark.centerNear i, #snapMark.centerEnd i { border-radius: 50%; }

  /* ===== 中央のヒント（読込前）===== */
  #dropHint { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 60; width: 600px; max-width: calc(100vw - 2 * var(--pw) - 76px); min-width: 460px;
    max-height: calc(100vh - 80px); overflow-y: auto; color: var(--txt); background: rgba(255,255,255,.95); border: 1.5px dashed var(--panel-bd); border-radius: 14px; padding: 26px 30px 16px; box-shadow: var(--shadow); }
  #dropHint .dhIco { display: block; width: 40px; height: 40px; margin: 0 auto 8px; color: var(--blue); }
  #dropHint .big { font-size: 28.5px; font-weight: 800; letter-spacing: .02em; color: var(--txt); text-align: center; line-height: 1.3; }
  #dropHint { cursor: pointer; }
  #dropHint .sub { font-size: 16.5px; font-weight: 700; color: var(--txt); text-align: center; line-height: 1.5; margin-top: 6px; }
  #dropHint b { color: var(--accent); }
  #dropHint code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--chip); border: 1px solid var(--panel-bd); border-radius: 4px; padding: 0 5px; color: var(--accent); font-weight: 700; }
  /* 用意するレイヤー（2つ）: 内容幅(fit-content)の箱にして枠の中で中央に置く（中身は左揃え。VOX#4105） */
  .dhLW { width: fit-content; max-width: 100%; margin: 0 auto; }
  .dhL { list-style: none; margin: 16px 0 0; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: max-content max-content; column-gap: 16px; row-gap: 6px; }
  .dhL > li { display: contents; }
  /* CAD案内の2行は塊(fit-content)を枠の中で中央に置く。中身（文字）は左揃えのまま（VOX#4109） */
  .dhCadLine { width: fit-content; max-width: 100%; margin: 6px auto 0; font-size: 12.5px; line-height: 1.5; color: var(--dim); text-align: left; }
  .dhL .nm { font-size: 16.5px; font-weight: 700; color: var(--txt); line-height: 1.6; white-space: nowrap; }
  .dhL .ds { font-size: 16.5px; color: var(--txt); line-height: 1.6; }  /* VOX#4006: 14→16.5 */
  .dhL .dsNote { grid-column: 2; font-size: 12.5px; color: var(--mute); line-height: 1.4; margin-top: -2px; }  /* 2026-09-28 VOX#4098 */
  /* 注意書き: 左揃えの箇条（ブロックごと中央） */
  .dhN { list-style: none; margin: 12px auto 0; padding: 0; width: max-content; max-width: 100%; display: flex; flex-direction: column; gap: 3px; }
  .dhN > li { position: relative; padding-left: 16px; font-size: 15.5px; line-height: 1.6; color: var(--txt); text-align: left; }
  .dhN > li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
  @media (max-width: 760px) {
    #dropHint { width: calc(100vw - 24px); min-width: 0; max-width: none; padding: 18px 16px 12px; }
    #dropHint .big { font-size: 24px; }
    #dropHint .sub { font-size: 15.5px; }
    .dhL { column-gap: 10px; }
  }
  /* VOX#4502: 「サンプルデータで見る」＋ボタンを一回り以上大きい主ボタンに。文言は折り返さない（狭い幅では見出しだけ上の行へ） */
  .dhTry { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 10px; margin-top: 16px; font-size: 16.5px; font-weight: 700; color: var(--txt); }
  .dhTry span { white-space: nowrap; }
  .dhTryBtns { display: inline-flex; gap: 10px; }  /* 2つのボタンは離さない（入らない幅では見出しの下に2つ並ぶ） */
  /* VOX#4091: 読み込み前は目立たせて押すのを促す（青の塗りつぶし・白文字）。ホバーは少し濃く */
  .dhTry button { width: auto; margin: 0; padding: 10px 24px; min-height: 46px; font-size: 18px; font-weight: 800; line-height: 1.2; white-space: nowrap; color: #fff; background: var(--blue); border: 1.5px solid var(--blue); border-radius: 10px; box-shadow: 0 2px 6px rgba(59, 165, 165,.28); cursor: pointer; }
  .dhTry button:hover { background: var(--blue-2); border-color: var(--blue-2); }
  .dhSub { width: max-content; max-width: 100%; margin: 10px auto 0; text-align: left; font-size: 12.5px; line-height: 1.5; color: #94a3b8; }  /* 左揃えの箇条（VOX#4025） */
  .dhSub b { display: inline; font-weight: 700; color: #94a3b8; }
  .dhSub ul { list-style: none; margin: 1px 0 0; padding: 0; }
  .dhSub li::before { content: "・"; }  /* 薄い1行（VOX#3985） */
  #dhMore { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
  #dhMore, #dhMore *, .dhTry, .dhTry * { cursor: default; }
  #dhMore > summary { cursor: pointer; font-size: 14.5px; font-weight: 700; color: var(--blue); text-align: center; }
  #dhMore > summary:hover { text-decoration: underline; }
  #dhMore ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
  #dhMore li { position: relative; padding-left: 14px; font-size: 14px; line-height: 1.6; color: var(--txt); text-align: left; }
  #dhMore li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
  #dhMore li.warn { color: #92400e; }
  body.dragover #dropHint { border-color: var(--green); }

  /* ===== 上下のHUD ===== */
  #topHud { position: fixed; left: 50%; top: 100px; transform: translateX(-50%); z-index: 80; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: max-content; max-width: min(calc(100vw - 2 * (var(--pw) + 28px)), 820px); }
  #status { max-width: 50vw; font-size: 12.5px; line-height: 1.5; color: var(--txt); background: rgba(255,255,255,.9); border: 1px solid var(--panel-bd); padding: 5px 12px; border-radius: 8px; white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
  #status:empty { display: none; }
  /* 図面の出力の状態（VOX#5167）: 濃い地に白い 17px。作成中はスピナー、完了はチェック、失敗は赤地 */
  #exportToast { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 240; display: flex; align-items: center; gap: 12px; min-width: 320px; max-width: min(640px, calc(100vw - 2 * (var(--pw) + 40px)));
    background: #1f2937; color: #fff; border-radius: 10px; padding: 12px 12px 12px 18px; box-shadow: 0 8px 24px rgba(15,23,42,.28); }
  #exportToast .tx { flex: 1; min-width: 0; }
  #exportToast .t { font-size: 17px; font-weight: 700; line-height: 1.4; }
  #exportToast .s { font-size: 14px; line-height: 1.5; color: #cbd5e1; margin-top: 2px; }
  #exportToast .s:empty { display: none; }
  #exportToast .spin { width: 22px; height: 22px; flex: none; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: exSpin .9s linear infinite; }
  #exportToast .ok { display: none; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--green); color: #fff; font-size: 16px; font-weight: 800; align-items: center; justify-content: center; }
  #exportToast.done .spin, #exportToast.err .spin { display: none; }
  #exportToast.done .ok { display: inline-flex; }
  #exportToast.err { background: #b91c1c; }
  #exportToast.err .s { color: #fee2e2; }
  #exportToast .x { width: 32px; height: 32px; margin: 0; padding: 0; flex: none; font-size: 20px; font-weight: 700; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; }
  #exportToast .x:hover { background: rgba(255,255,255,.12); }
  #exportToast.busy .x { display: none; }
  @keyframes exSpin { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: reduce) { #exportToast .spin { animation-duration: 2.5s; } }
  #status.err { color: #b91c1c; background: #fef2f2; border-color: #fca5a5; font-weight: 700; }
  #edgeHint { display: none; text-align: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--green); padding: 6px 14px; border-radius: 8px; }
  #siteHud { display: none; text-align: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--green); padding: 6px 14px; border-radius: 8px; }
  #siteHud.show { display: flex; }
  #siteHud, #edgeHint { align-items: center; justify-content: space-between; gap: 10px; white-space: nowrap; font-size: 12.5px; padding: 4px 8px 4px 12px; }
  #edgeHint.show { display: flex; }
  .oppRow { margin-top: 3px; font-size: 11.5px; color: var(--mute); white-space: nowrap; } .oppRow a { color: var(--mute); } .oppRow a:hover { color: var(--blue); }
  .oppNote { margin-top: 4px; font-size: 11px; color: var(--mute); white-space: nowrap; }
  .traceActs { display: flex; gap: 8px; margin-top: 8px; } .traceActs[hidden] { display: none; } .traceActs button { flex: 1; margin: 0; } .traceActs button:disabled { opacity: .45; cursor: default; }
  .hudBtns { display: inline-flex; gap: 5px; flex: none; }
  .hudBtns button { pointer-events: auto; width: auto; margin: 0; padding: 1px 9px; font-size: 12px; font-weight: 700; line-height: 1.5; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.85); border-radius: 6px; cursor: pointer; }
  .hudBtns button:hover { background: rgba(255,255,255,.22); } .hudBtns button:disabled { opacity: .45; cursor: default; }
  #roadPickHint { display: none; text-align: center; font-size: 12.5px; font-weight: 700; color: #fff; background: var(--green); padding: 5px 12px; border-radius: 8px; white-space: nowrap; } #roadPickHint.show { display: block; }
  #northHint { display: none; text-align: center; font-size: 13px; font-weight: 700; color: #fff; background: #7c3aed; padding: 6px 14px; border-radius: 8px; }
  #northHint.show { display: block; }
  .nangle { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; }
  .nangle .nlab { color: var(--mute); white-space: nowrap; }
  .nangle input { width: 6em; padding: 3px 5px; font-size: 13px; border: 1px solid var(--panel-bd); border-radius: 4px; background: var(--field); color: var(--txt); }
  .nangle button { margin: 0; padding: 4px 10px; font-size: 12.5px; width: auto; }
  #exportNorthMsg .other { display: block; margin-top: 4px; }
  #northBlock.flash { animation: northFlash 1.2s ease 2; border-radius: 8px; }
  @keyframes northFlash { 0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .0); } 50% { box-shadow: 0 0 0 4px rgba(124, 58, 237, .55); } }
  /* 規約の行（天空率チェッカーの本番と同じ・VOX#5822）: 左右のパネルの間の下中央に置く（入らない幅では折り返す） */
  #legal { position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px; z-index: 80; font-size: 11.5px; color: var(--mute); pointer-events: none;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; width: max-content; max-width: calc(100vw - 2 * (var(--pw) + 24px)); }
  #legal a, #legal .copy { white-space: nowrap; }
  #legal a { pointer-events: auto; color: var(--mute); text-decoration: none; }
  #legal a:hover { color: var(--txt); text-decoration: underline; }

  /* ===== 出力前の同意（見出し1行＋規約リンク＋チェック1つ＋ボタン2つ。説明は足さない）===== */
  #consent { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: rgba(15,23,42,.45); }
  #consent[hidden] { display: none; }
  #consent .box { width: 420px; max-width: calc(100vw - 24px); background: var(--panel); border: 1px solid var(--panel-bd); border-radius: 12px; padding: 18px 20px 16px; box-shadow: var(--shadow); }
  #consent .t { font-size: 16.5px; font-weight: 800; color: var(--txt); line-height: 1.4; }
  #consent .terms, #buy .terms { margin-top: 10px; height: 240px; overflow-y: auto; border: 1px solid var(--panel-bd); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; line-height: 1.6; color: var(--txt); background: var(--field); }
  :is(#consent, #buy) .terms h1 { font-size: 15px; margin: 0 0 6px; } :is(#consent, #buy) .terms h2 { font-size: 13px; margin: 12px 0 4px; } :is(#consent, #buy) .terms p, :is(#consent, #buy) .terms li { margin: 4px 0; } :is(#consent, #buy) .terms ul, :is(#consent, #buy) .terms ol { padding-left: 18px; }
  #buy .terms { height: min(240px, 30vh); }
  :is(#consent, #buy) .terms:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
  #consent .ck input:disabled { cursor: not-allowed; opacity: .5; } #consent .ck:has(input:disabled) { color: var(--mute); cursor: default; }
  #consent .link { font-size: 13px; margin: 6px 0 0 0; }
  #consent .ck { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; font-weight: 700; color: var(--txt); cursor: pointer; }
  #consent .ck input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); cursor: pointer; }
  #consent .row2 { margin-top: 14px; }
  #consent #consentTermsWrap[hidden] { display: none; }
  #consent .verRow { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; font-weight: 700; color: var(--txt); white-space: nowrap; flex-wrap: wrap; }
  #consent .verRow select { padding: 4px 6px; font-size: 13.5px; border: 1px solid var(--panel-bd); border-radius: 6px; background: var(--field); color: var(--txt); }
  #consent .verRow .vnote { font-size: 12px; font-weight: 400; color: var(--mute); flex-basis: 100%; white-space: normal; }
  #consent .row2 button { margin-top: 0; }
  #done { position: fixed; inset: 0; z-index: 320; display: flex; align-items: center; justify-content: center; background: rgba(15,23,42,.45); } #done[hidden] { display: none; }
  #done .box { width: 460px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--panel-bd); border-radius: 14px; padding: 28px 24px 20px; box-shadow: var(--shadow); text-align: center; }
  #done .ico { width: 56px; height: 56px; border-radius: 50%; background: #16a34a; color: #fff; font-size: 34px; line-height: 56px; font-weight: 800; }
  #done .t { font-size: 22px; font-weight: 800; color: var(--txt); line-height: 1.4; }
  #done .id { font-size: 14px; color: var(--mute); }
  #done .btn { display: block; width: 100%; box-sizing: border-box; padding: 11px 12px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 700; text-decoration: none; }
  #done .btn[hidden] { display: none; }
  #done button { width: 100%; }
  #done .redl { width: 100%; display: flex; flex-direction: column; gap: 6px; } #done .redl[hidden] { display: none; }
  #done .redl .rl { font-size: 14px; font-weight: 700; color: var(--txt); text-align: left; }
  #done .redl .rs { font-size: 12px; color: #4b5563; text-align: left; }
  #done .redl .row { display: flex; gap: 6px; }
  #done .redl input { flex: 1; min-width: 0; box-sizing: border-box; padding: 7px 8px; font-size: 12px; border: 1px solid var(--panel-bd); border-radius: 6px; background: var(--bg, #fff); color: var(--txt); }
  #done .redl button { width: auto; flex: none; padding: 7px 12px; font-size: 13px; }
  #buy { position: fixed; inset: 0; z-index: 310; display: flex; align-items: center; justify-content: center; background: rgba(15,23,42,.45); }
  #buy[hidden], #buy [hidden] { display: none; }
  #buy .box { width: 440px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow-y: auto; background: var(--panel); border: 1px solid var(--panel-bd); border-radius: 12px; padding: 18px 20px 16px; box-shadow: var(--shadow); }
  #buy .t { font-size: 16.5px; font-weight: 800; color: var(--txt); line-height: 1.4; }
  #buy .buyTbl { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 13.5px; color: var(--txt); }
  #buy .buyTbl th { width: 5.5em; text-align: left; font-weight: 700; color: var(--mute); padding: 4px 8px 4px 0; vertical-align: top; white-space: nowrap; }
  #buy .buyTbl td { padding: 4px 0; border-bottom: 1px solid var(--panel-bd); text-align: left; white-space: nowrap; }
  #buy .buyTbl th { border-bottom: 1px solid var(--panel-bd); }
  #buy .buyTbl tr.sum td { font-weight: 800; font-size: 15px; }
  #buy .buyLinks { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; }
  #buy .verRow { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--txt); white-space: nowrap; flex-wrap: wrap; }
  #buy .verRow select { padding: 4px 6px; font-size: 13.5px; border: 1px solid var(--panel-bd); border-radius: 6px; background: var(--field); color: var(--txt); }
  #buy .verRow .vnote { font-size: 12px; font-weight: 400; color: var(--mute); flex-basis: 100%; white-space: normal; }
  #buy .ck { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--txt); cursor: pointer; }
  #buy .ck input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); cursor: pointer; }
  #buy .row2 { margin-top: 14px; } #buy .row2 button { margin-top: 0; }
  #buy .bl { margin: 10px 0 0; font-size: 14px; color: var(--txt); } #buy .bl.ok { font-weight: 800; color: var(--green, #15803d); } #buy .bl.err { color: #b91c1c; font-size: 13px; }
  /* 種別の切り替え前の確認（はい／いいえ）。見た目は同意ゲートと同じ */
  #resetSep { margin: 22px 0 14px; border-top: 1px dashed var(--panel-bd); }
  #btnReset { margin-top: 0; color: #b42318; border: 1.5px solid #b42318; background: #fff; font-weight: 700; }
  #btnReset:hover:not(:disabled) { background: #fef3f2; }
  #btnReset:disabled { color: var(--mute); border-color: var(--panel-bd); font-weight: 600; }
  #resetAsk { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: rgba(15,23,42,.45); }
  #resetAsk[hidden] { display: none; }
  #resetAsk .box { width: 370px; background: var(--panel); border: 1px solid var(--panel-bd); border-radius: 12px; padding: 18px 20px 16px; box-shadow: var(--shadow); }
  #resetAsk .t { font-size: 16.5px; font-weight: 800; color: var(--txt); line-height: 1.5; }
  #resetAsk .s { font-size: 13.5px; color: var(--mute); margin-top: 6px; line-height: 1.5; }
  #resetAsk .row2 { margin-top: 14px; }
  #resetAsk .row2 button { margin-top: 0; }
  /* ===== PC 専用のお知らせ（スマホ幅・タッチだけの端末で最初に出す）===== */
  #pcOnly { position: fixed; inset: 0; z-index: 310; display: flex; align-items: center; justify-content: center; background: rgba(15,23,42,.55); padding: 16px; }
  #pcOnly[hidden] { display: none; }
  #pcOnly .box { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--panel-bd); border-radius: 14px; padding: 22px 20px 18px; box-shadow: var(--shadow); text-align: center; }
  #pcOnly svg { width: 44px; height: 44px; color: var(--blue); }
  #pcOnly .s { font-size: min(15.5px, 3.9vw); font-weight: 700; color: var(--txt); margin-top: 10px; line-height: 1.6; white-space: nowrap; }
  #pcOnly button { margin-top: 16px; width: 100%; }
  #pcOnly #pcOnlySample { display: block; margin-top: 10px; padding: 11px 14px; border-radius: 9px; background: var(--blue); color: #fff; font-weight: 800; text-decoration: none; }
  #pcOnly #pcOnlySample[hidden] { display: none; }
    /* 3D視点の操作（VOX#4531）: 下部中央に小さなアイコン帯（Fusion 360 のナビゲーションバー風）＋その下に操作の案内1行 */
  #navBar { position: fixed; left: calc(12px + var(--pw) + 12px); top: 8px; z-index: 70; display: flex; align-items: center; gap: 18px; padding: 0; background: none; border: 0; box-shadow: none; pointer-events: none; max-width: calc(100vw - 16px); }
  #navBar button { pointer-events: auto; width: 48px; height: 64px; padding: 0; margin: 0; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid transparent; border-radius: 12px; color: #64748b; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 4px rgba(255,255,255,.9)); cursor: pointer; }
  #navBar button:hover { background: var(--chip); }
  #navPanH, #navZoomH { touch-action: none; cursor: grab; } #navBar button.drag { background: var(--blue); color: #fff; filter: none; cursor: grabbing; }
  #navGiz { pointer-events: auto; width: 84px; height: 84px; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 4px rgba(255,255,255,.8)); touch-action: none; cursor: grab; border-radius: 8px; } #navGiz:hover { background: var(--chip); }
  #navBar svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
  #navPanH svg { width: 40px; height: 40px; } /* VOX#4535: 手は左右より小さく見えるので一回り大きく */
  #navHint { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 70; font-size: 13.5px; color: #4b5563; white-space: nowrap; pointer-events: none; max-width: calc(100vw - 16px); overflow: hidden; text-overflow: ellipsis; }
  body.noModel #navBar { display: none; }
  @media (min-width: 701px) and (max-width: 1110px) { #navHint { bottom: 50px; } } /* 操作の案内は規約の行の上に置く（重ねない）。この幅では規約の行が 2 段に折れる */
  @media (max-width: 700px) { body #navBar { left: 50%; top: auto; bottom: 66px; transform: translateX(-50%); } #navHint { bottom: 48px; } } /* 下の利用規約の行（2行に折れる）と重ねない */
  #axisHud { position: fixed; left: calc(var(--pw) + 28px); bottom: 12px; z-index: 70; font-size: 11px; color: var(--mute); pointer-events: none; font-family: ui-monospace, monospace; }

  /* ===== 説明の板（2026-09-25 VOX#3823）=====
     画面右上（右パネルの左隣）に小さなボタン2つ「使い方」「天空率の解説」。押すと右から板（ドロワー）が出る。
     3D は見えたまま（薄い幕だけ）。閉じる＝×／Esc／板の外をクリック。スマホ幅（760px 以下）では全面。
     中身は見出しごとに <details> で開閉。動きは src/help.js（インライン JS なし＝CSP のまま）。 */
  #helpBtns { position: fixed; top: 12px; right: calc(var(--pw) + 24px); z-index: 101; display: flex; gap: 6px; }
  #helpBtns button { width: auto; margin: 0; padding: 5px 11px; font-size: 12.5px; font-weight: 700; color: var(--accent); background: var(--panel); border: 1px solid var(--panel-bd); border-radius: 999px; box-shadow: var(--shadow); white-space: nowrap; gap: 5px; }
  #helpBtns button:hover, #helpBtns button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
  #helpBtns button svg { width: 13px; height: 13px; }
  body.helpOpen #helpBtns { opacity: 0; pointer-events: none; }  /* 板が開いている間はボタンを隠す（板の×・Esc・幕で閉じる） */
  /* 上の HUD がボタンに被らないように、幅を右のボタンぶん（左右対称に）狭める */
  #status { max-width: min(50vw, calc(100vw - 2 * (var(--pw) + 200px))); }
  #helpBack { position: fixed; inset: 0; z-index: 249; background: rgba(15,23,42,.10); display: none; }
  #helpBack.open { display: block; }
  #helpDrawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 250; width: min(480px, 100vw); background: var(--panel); border-left: 1px solid var(--panel-bd);
    box-shadow: -6px 0 24px rgba(15,23,42,.16); display: flex; flex-direction: column; transform: translateX(104%); transition: transform .25s ease; user-select: text; }
  #helpDrawer.open { transform: none; }
  @media (prefers-reduced-motion: reduce) { #helpDrawer { transition: none; } }
  #helpDrawer .hhead { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px 18px; border-bottom: 1px solid var(--line); flex: none; }
  #helpDrawer .hhead h2 { margin: 0; font-size: 16.5px; color: var(--accent); font-weight: 800; flex: 1; letter-spacing: .02em; }
  #helpDrawer .hclose { width: 30px; height: 30px; margin: 0; padding: 0; border-radius: 50%; background: var(--chip); border: 1px solid var(--panel-bd); color: var(--dim); font-size: 18px; line-height: 1; flex: none; }
  #helpDrawer .hclose:hover { background: var(--line); color: var(--txt); }
  #helpDrawer .htabs { display: flex; gap: 6px; padding: 8px 18px 0; flex: none; }
  #helpDrawer .htabs button { width: auto; margin: 0; padding: 6px 12px; font-size: 13px; font-weight: 700; color: var(--dim); background: var(--chip); border: 1px solid var(--panel-bd); border-bottom: none; border-radius: 8px 8px 0 0; }
  #helpDrawer .htabs button.on { color: var(--accent); background: var(--panel); border-color: var(--panel-bd); position: relative; top: 1px; }
  #helpDrawer .hbody { flex: 1; overflow-y: auto; padding: 12px 18px 28px; border-top: 1px solid var(--panel-bd); scrollbar-gutter: stable; }
  #helpDrawer .hpane[hidden] { display: none; }
  #helpDrawer .hlead { font-size: 13px; color: var(--dim); line-height: 1.6; margin: 0 0 8px; }
  #helpDrawer details.hs { border-top: 1px solid var(--line); }
  #helpDrawer details.hs:last-of-type { border-bottom: 1px solid var(--line); }
  #helpDrawer details.hs > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 2px; font-size: 14px; font-weight: 700; color: var(--txt); }
  #helpDrawer details.hs > summary::-webkit-details-marker { display: none; }
  #helpDrawer details.hs > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(-45deg); transition: transform .15s; flex: none; margin: 0 2px 0 4px; }
  #helpDrawer details.hs[open] > summary::before { transform: rotate(45deg); }
  #helpDrawer details.hs > summary:hover { color: var(--blue-2); }
  #helpDrawer .hc { padding: 0 4px 12px 22px; font-size: 13px; line-height: 1.7; color: var(--txt); }
  #helpDrawer .hc p { margin: 0 0 6px; }
  #helpDrawer .hc ul, #helpDrawer .hc ol { margin: 0 0 6px; padding-left: 18px; }
  #helpDrawer .hc li { margin: 2px 0; }
  #helpDrawer .hc li > ul { margin-top: 2px; }
  #helpDrawer .hc h4 { font-size: 13px; margin: 10px 0 3px; color: var(--accent); }
  #helpDrawer .hc code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--chip); border: 1px solid var(--panel-bd); border-radius: 4px; padding: 0 4px; color: var(--accent); }
  #helpDrawer .hc .law { color: var(--dim); font-size: 12px; }
  #helpDrawer .hc .warn { color: #92400e; background: var(--warn-soft); border-radius: 6px; padding: 5px 8px; margin: 4px 0 6px; }
  #helpDrawer .hc .soon { display: inline-block; font-size: 11px; font-weight: 700; color: #92400e; background: var(--warn-soft); border-radius: 4px; padding: 0 6px; margin-left: 4px; vertical-align: 1px; }
  #helpDrawer .hc table { font-size: 12.5px; margin: 4px 0 8px; }
  #helpDrawer .hc th, #helpDrawer .hc td { text-align: left; padding: 3px 6px; vertical-align: top; border-bottom: 1px solid var(--line); }
  #helpDrawer .hc th { color: var(--dim); font-weight: 600; white-space: nowrap; }
  #helpDrawer .hc a { color: var(--blue); }
  #helpDrawer .hfoot { font-size: 11.5px; color: var(--mute); margin-top: 14px; line-height: 1.6; }
  @media (max-width: 760px) {
    #helpBtns { right: 48px; }
    #status { max-width: calc(100vw - 2 * 210px); }
    #helpDrawer { width: 100vw; border-left: none; }
  }
