/* top.css — 最初の画面（DXF 読み込み前）と左の手順1（DXFを読み込む）・平面図の高さの欄・動画。
   並びは天空率チェッカーのトップ（見出し・動画・画像2枚・［サンプルを見る］・ドロップ枠）と同じ。色は B3-1（b3.css の変数）・形（角の丸み）は天空率チェッカーと同じ（VOX#10087）。 */

/* ---- 左の手順1（DXFを読み込む） ---- */
.dxL { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 10px; row-gap: 3px; font-size: 13px; line-height: 1.5; }
.dxL > li { display: contents; }
.dxL .nm { font-weight: 700; white-space: nowrap; }
.dxL .ds { min-width: 0; }
.dxL .nb, .dxL .dsTip { display: inline-block; }
.dxL .dsTip { text-decoration: underline; text-decoration-color: var(--b3-teal); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: help; }
#btnPickDxf { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 40px; font-size: 16px; font-weight: 700; background: var(--b3-teal); border-color: var(--b3-teal); color: #fff; }
#btnPickDxf:hover { background: var(--b3-teal-d); }
#btnPickDxf svg { width: 18px; height: 18px; }
.step.done #dxfBlock { display: none; }
body.noModel .step:not([data-wrap="0"]) > *:not(.stephead) { display: none !important; }
body.noModel .step[data-wrap="0"] { background: #f2f9f9; padding-bottom: 12px; }
#bld2dBlock .vnote { font-size: 11px; color: var(--mute); margin-top: 2px; white-space: nowrap; }
#bld2dBlock #btnBld2d { display: flex; align-items: center; justify-content: center; gap: 6px; }
#bld2dBlock #btnBld2d svg { width: 16px; height: 16px; }

/* ---- 高さの欄（線の端をクリックした所に出す） ---- */
#zEdit { position: fixed; z-index: 120; display: none; background: var(--panel); border: 1px solid var(--b3-teal); border-radius: 8px; padding: 8px 10px; width: 230px; }
#zEdit .t { font-size: 12px; color: var(--dim); margin-bottom: 4px; }
#zEdit .ctl { margin-top: 0; display: flex; align-items: center; gap: 4px; }
#zEdit .ctl input { padding: 5px 7px; flex: 1; min-width: 0; }
#zEdit .ctl input.empty { border-color: var(--red); }
#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); }

/* ---- 出力される図面・現在未対応（折りたたみ） ---- */
details.fold { border: 0; border-radius: 0; background: none; }
details.fold > summary.ht { list-style: none; cursor: pointer; user-select: none; padding-left: 0; padding-right: 0; }
details.fold > summary.ht::-webkit-details-marker { display: none; }
details.fold > summary.ht::before { content: ""; flex: none; width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 9px; border-color: transparent transparent transparent var(--b3-teal); transition: transform .15s; margin-right: 2px; }
details.fold[open] > summary.ht::before { transform: rotate(90deg); }
details.fold > summary.ht svg { color: var(--mute); }
details.fold .olBody { padding-left: 17px; }
details.fold .olBody ul { list-style: none; margin: 0; padding: 0; }
details.fold .olBody li::before { content: "・"; }
@media (prefers-reduced-motion: reduce) { details.fold > summary.ht::before { transition: none; } }

/* ---- サンプルで見る: ［プレビュー］を脈打たせて促す ---- */
#btnPreview.nudge { animation: nudge 1.4s ease-in-out infinite; border-color: var(--b3-teal); color: var(--b3-teal-d); }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(59, 165, 165, .55); } 50% { box-shadow: 0 0 0 7px rgba(59, 165, 165, 0); } }
@media (prefers-reduced-motion: reduce) { #btnPreview.nudge { animation: none; box-shadow: 0 0 0 3px rgba(59, 165, 165, .5); } }

/* ---- 最初の画面 ---- */
body.noModel { background-color: #f3f5f6; }
body.noModel #panel, body.noModel #navHint { display: none; }
body.noModel #helpBtns { right: 12px; }
#dropHint { position: fixed; top: 50%; transform: translateY(-50%); z-index: 60; left: calc(var(--pw) + 36px); right: 24px; margin: 0 auto; width: auto; max-width: 1160px; min-width: 0;
  max-height: calc(100vh - 84px); overflow: visible; color: var(--txt); background: rgba(255, 255, 255, .97); border: 1px solid var(--panel-bd); border-radius: 14px; padding: 26px 32px 24px; box-shadow: var(--shadow); container-type: inline-size; cursor: default; }
.heroH { margin: 10px 0 6px; font-family: "Noto Serif JP", "Noto Serif CJK JP", "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "BIZ UDPMincho", serif;
  font-size: min(34px, 4.8cqi); font-weight: 900; letter-spacing: .06em; line-height: 1.45; color: var(--b3-ink); text-align: center; white-space: nowrap; }
.heroSub { margin: -2px 0 0; font-size: 16px; font-weight: 600; color: var(--dim); text-align: center; white-space: nowrap; letter-spacing: .04em; }
.heroCta { position: relative; display: flex; flex-direction: column; align-items: center; margin: 22px auto 0; }
.ctaMain { width: 340px; max-width: 100%; margin: 0; min-height: 58px; padding: 12px 18px; font-size: 21px; font-weight: 800; border-radius: 12px; white-space: nowrap; background: var(--b3-teal); border-color: var(--b3-teal); color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 6px; }
.ctaMain:hover, .ctaMain.open { background: var(--b3-teal-d); }
.ctaMain .caret { width: 8px; height: 8px; margin-left: 4px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform .18s; }
.ctaMain.open .caret { transform: translateY(2px) rotate(-135deg); }
.ctaPick { position: absolute; top: calc(100% + 12px); left: 50%; z-index: 5; width: 340px; max-width: calc(100vw - 40px); display: flex; gap: 10px; padding: 12px; background: #fff; border: 1px solid var(--panel-bd); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .18); transform: translateX(-50%); animation: pickIn .18s ease-out; }
.ctaPick[hidden] { display: none; }
.ctaPick::before { content: ""; position: absolute; top: -7px; left: calc(50% - 7px); width: 12px; height: 12px; background: #fff; border-left: 1px solid var(--panel-bd); border-top: 1px solid var(--panel-bd); transform: rotate(45deg); }
.ctaPick > * { flex: 1; width: auto; margin: 0; min-height: 50px; padding: 10px; font-size: 19px; font-weight: 800; white-space: nowrap; text-decoration: none; display: flex; align-items: center; justify-content: center;
  background: var(--b3-teal); color: #fff; border: 1px solid var(--b3-teal); border-radius: 10px; }
.ctaPick > *:hover { background: var(--b3-teal-d); }
@keyframes pickIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .ctaPick { animation: none; } .ctaMain .caret { transition: none; } }
.dhDrop { margin: 14px auto 0; width: 340px; max-width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px; border: 1.5px dashed #a9c9c9; border-radius: 12px; background: #fff; cursor: pointer; }
.dhDrop:hover, .dhDrop:focus-visible { border-color: var(--b3-teal); background: #f3f9f9; outline: none; }
body.dragover .dhDrop { border-color: var(--b3-teal); background: #e6f4f4; }
#dropHint .dhDrop .dhIco { width: 28px; height: 28px; flex: none; margin: 0; color: var(--b3-teal); }
.dhDropT { display: flex; flex-direction: column; align-items: flex-start; }
#dropHint .dhDrop .big { font-size: 18px; font-weight: 700; line-height: 1.3; white-space: nowrap; text-align: left; }
#dropHint .dhDrop .sub { font-size: 12.5px; font-weight: 600; color: var(--dim); line-height: 1.5; white-space: nowrap; margin: 0; text-align: left; }
.dxMore { margin-top: 1px; font-size: 12px; color: var(--b3-teal-d); white-space: nowrap; }
.heroMain { margin: 22px auto 0; }
.heroMain figcaption, .heroCards span { margin-top: 6px; font-size: 13px; color: var(--dim); text-align: center; white-space: nowrap; }
.hvWrap { position: relative; background: #0f172a; line-height: 0; border: 1px solid var(--panel-bd); border-radius: 8px; overflow: hidden; }
.hvWrap video { display: block; width: 100%; height: 100%; object-fit: contain; background: #0f172a; }
.heroVid { cursor: zoom-in; }
.hvZoom { position: absolute; top: 8px; right: 8px; width: 32px !important; height: 32px; margin: 0 !important; padding: 0 !important; display: flex; align-items: center; justify-content: center; border-radius: 6px;
  background: rgba(15, 23, 42, .62) !important; border: 0 !important; color: #fff !important; cursor: pointer; z-index: 2; }
.hvZoom:hover { background: rgba(15, 23, 42, .85) !important; }
.hvZoom svg { width: 18px; height: 18px; }
.heroCards { list-style: none; margin: 0; padding: 0; }
.heroCards li { display: flex; flex-direction: column; }
.heroCards img { display: block; aspect-ratio: 16 / 9; border: 1px solid var(--panel-bd); border-radius: 8px; background: #fff; object-fit: cover; }
.heroPc { display: none; }
@media (min-width: 761px) {
  #dropHint { display: grid; grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr); grid-template-areas: "h h h h" "s s s s" ". main k1 ." ". main k2 ." "btn btn btn btn"; column-gap: 16px;
    --vidH: min(calc((100cqi - 16px) * .6 * 9 / 16 - 2px), calc(100vh - 330px)); }
  .heroH { grid-area: h; } .heroSub { grid-area: s; }
  .heroCta { grid-area: btn; justify-self: center; transform: translateX(calc(-50% - 8px)); margin-top: 26px; }
  .heroCta .ctaMain { min-height: 70px; }
  .dhDrop { grid-area: btn; justify-self: center; transform: translateX(calc(50% + 8px)); margin-top: 26px; min-height: 70px; }
  .heroMain { grid-area: main; justify-self: end; align-self: start; margin: 18px 0 0; }
  .heroVid { height: var(--vidH); width: auto; aspect-ratio: 16 / 9; }
  .heroCards { display: contents; }
  .heroCards li:nth-child(1) { grid-area: k1; } .heroCards li:nth-child(2) { grid-area: k2; }
  .heroCards li { justify-self: start; align-items: center; margin-top: 18px; }
  .heroCards li:nth-child(2) { margin-top: 10px; align-self: end; }
  .heroCards img { height: calc((var(--vidH) + 26px - 18px - 10px - 2 * 25px) / 2); width: auto; }
}
@container (max-width: 720px) {
  .heroCta, .dhDrop { grid-area: auto !important; grid-column: 1 / -1 !important; transform: none !important; }
}
@media (max-width: 760px) {
  body.noModel #controls { display: none; }
  #dropHint { display: flex; flex-direction: column; left: 10px; right: 10px; top: 54px; transform: none; max-height: calc(100dvh - 54px - 64px); overflow-y: auto; padding: 18px 14px; }
  html #legal { max-width: calc(100vw - 24px); gap: 0 12px; } /* スマホ: 規約の行は横いっぱい（2 段まで）・カードはその上で止める＝重ならない（天空率チェッカーと同じ・VOX#8871） */
  .heroH { font-size: 5.5cqi; letter-spacing: .04em; } .heroSub { font-size: 3.6cqi; }
  .heroCta, .dhDrop { display: none !important; }
  .heroMain { order: 2; margin: 18px 0 0; width: 100%; } .heroVid { width: 100%; aspect-ratio: 16 / 9; }
  .heroCards { order: 3; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
  .heroCards img { width: 100%; height: auto; }
  .heroCards span { font-size: min(13px, 3.4cqi); }
  .heroPc { order: 4; position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 16px; font-size: min(15px, 4.2cqi); font-weight: 700; white-space: nowrap; }
  .heroPc .ctaMain { width: 100%; min-height: 50px; font-size: 18px; background: var(--b3-teal-d); border-color: var(--b3-teal-d); }
  .heroPc .ctaPick { position: relative; top: auto; left: auto; transform: none; width: 100%; max-width: none; margin-top: 4px; animation: none; }
  .heroPc .ctaPick::before { display: none; }
  .heroPc .ctaPick > * { min-height: 48px; font-size: 18px; }
}
#dropHint[hidden] { display: none !important; }
/* ボリュームチェックの枠の中で建物の DXF だけを待つとき: ドロップ枠だけ */
#dropHint .dhBld { display: none; }
body.waitBuilding #dropHint .dhAll { display: none; } body.waitBuilding #dropHint .dhBld { display: inline; }
body.waitBuilding #dropHint { display: block; width: 420px; left: 50%; right: auto; transform: translate(-50%, -50%); }
body.waitBuilding #dropHint .dhDrop { display: flex !important; transform: none; }
body.waitBuilding #dropHint > :not(.dhDrop):not(input) { display: none !important; }

/* ---- 動画を大きく ---- */
#vidModal { position: fixed; inset: 0; z-index: 300; background: rgba(15, 23, 42, .78); display: flex; align-items: center; justify-content: center; }
#vidModal[hidden] { display: none; }
#vidModal .vmBox { position: relative; width: min(94vw, calc(88vh * 16 / 9)); }
#vidModal video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #0f172a; }
#vidModal .vmClose { position: absolute; top: -40px; right: 0; width: 34px; height: 34px; margin: 0; padding: 0; font-size: 22px; line-height: 1; background: rgba(255, 255, 255, .92); color: var(--b3-ink); border: 0; }
.hvHelp { margin-bottom: 10px; }
.hvHelp video { aspect-ratio: 16 / 9; }
body.noModel { background-image: linear-gradient(#e3e7ea 1px, transparent 1px), linear-gradient(90deg, #e3e7ea 1px, transparent 1px); background-size: 40px 40px; }
body.noModel #viewport, body.noModel #labels { visibility: hidden; }
