/* 監視カメラ設置シミュレーター（画面いっぱいに使う作り）。共通の /assets/style.css の上に重ねる。 */
:root { --line2: #c5d9e5; --text2: #4a5a65; }
[hidden] { display: none !important; }
html { height: 100%; overflow: hidden; }
body.campage { margin: 0; height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; line-height: 1.5; font-size: 14px;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }

/* ---- シミュレーター本体 ---- */
.camapp {
  --c-panel: #ffffff; --c-soft: #f4f9fc; --c-line: #d5e4ed; --c-text: #1d2a33; --c-muted: #566874;
  --c-accent: #155e85; --c-sel: #e6f2f9; --c-warn: #8a5a00;
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column;
  color: var(--c-text); background: var(--c-panel);
}
.camapp button, .camapp input, .camapp select, .camapp textarea,
.cview button, .toast { font: inherit; color: inherit; }
.camapp button, .cview button { cursor: pointer; }
.camapp :focus-visible { outline-offset: 1px; }
.noscript { padding: 16px; margin: 0; }

.atop { position: relative; z-index: 20; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--c-line);
  background: radial-gradient(circle 150px at calc(100% - 70px) 0, rgba(190, 225, 245, 0.36), rgba(255, 255, 255, 0) 100%), #fff; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; margin-right: 6px; }
.atop h1 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 500; letter-spacing: .03em; line-height: 1.5; white-space: nowrap; }
.atop h1::before { content: ""; flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #a9d6ea); box-shadow: inset 0 0 0 1px #8cc3dc; }
.actions { display: flex; align-items: center; gap: 8px; }
.camapp .actions .btn:disabled { opacity: .45; cursor: not-allowed; }
/* バージョン表示（サイズ測定ツールと同じ丸い枠のボタン） */
.camapp .verbtn { flex: 0 0 auto; font: 500 12px var(--font-latin), var(--font-body); color: var(--c-muted); background: #fff; border: 1px solid var(--c-line); border-radius: 999px; padding: 2px 10px; line-height: 1.5; cursor: pointer; letter-spacing: 0; white-space: nowrap; }
.camapp .verbtn:hover { color: var(--accent-ink); border-color: #3f9ec6; }
/* バージョン情報の窓の更新履歴 */
.histlist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.histlist > li { padding: 10px 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line2); border-radius: 14px; }
.histlist > li:first-child { background: radial-gradient(circle 90px at calc(100% - 20px) 10px, rgba(190, 225, 245, 0.4), rgba(255, 255, 255, 0) 100%), linear-gradient(180deg, #f3f9fc, #fff); box-shadow: inset 0 0 0 1px #b9d9e8; }
.histlist b { font: 500 15px var(--font-latin), var(--font-body); }
.histlist .hd { color: var(--text2); font-size: 13px; margin-left: 8px; }
.histlist ul { margin: 4px 0 0; padding-left: 1.2em; font-size: 13.5px; color: var(--text2); line-height: 1.85; }
.verdlg { width: min(560px, calc(100vw - 20px)); }
.camapp .actions .btn { white-space: nowrap; }
.others .h9s__btn { min-height: 30px; padding: 0 12px; font-size: 12px; font-weight: 400; color: var(--text2); border-color: var(--line2); white-space: nowrap; }
.others .h9s__btn:hover { color: var(--accent-ink); }
.spacer { flex: 1; }
.aseg { display: flex; border: 1px solid var(--c-line, #d5e4ed); border-radius: 999px; overflow: hidden; background: #fff; }
.aseg button { background: none; border: 0; padding: 4px 14px; color: var(--c-muted, #566874); white-space: nowrap; }
.aseg button + button { border-left: 1px solid var(--c-line, #d5e4ed); }
.aseg button.on { background: #e3f1f9; color: #155e85; font-weight: 500; box-shadow: inset 0 0 0 1px #9cc8df; }
.seglabel { font-size: 12px; color: var(--c-muted); margin-right: -6px; }
.camapp .btn, .cview .btn { background: #fff; border: 1px solid #b7cedb; border-radius: 999px; padding: 4px 12px; line-height: 1.5; color: #1f5f80; }
.camapp .btn:hover, .cview .btn:hover { border-color: #3f9ec6; background: #f4f9fc; }
.camapp .btn.primary, .cview .btn.primary { background: #2a7ea3; border-color: #2a7ea3; color: #fff; font-weight: 500; }
.camapp .btn.primary:hover, .cview .btn.primary:hover { background: #21708f; }
.camapp .btn.danger { color: #a63c27; }
.camapp .btn.full { width: 100%; padding: 8px 12px; }
.camapp .btn:disabled { opacity: .45; cursor: default; }
.menuwrap { position: relative; }
.expmenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: #fff; border-radius: 16px; padding: 8px; width: 270px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: 0 18px 40px -18px rgba(40, 90, 120, 0.4), inset 0 0 0 1px var(--c-line); }
.camapp .actions .expmenu .btn { display: block; width: 100%; white-space: normal; text-align: left; border-radius: 12px; padding: 8px 12px; font-size: 14px; line-height: 1.5; } /* 説明文を折り返して枠に収める */
.expmenu small { color: var(--c-muted); display: block; font-size: 11px; }

.amain { flex: 1; min-height: 0; display: grid; grid-template-columns: 78px minmax(0, 1fr) 348px; grid-template-rows: minmax(0, 1fr); }
.amain.closed { grid-template-columns: 78px minmax(0, 1fr) 0; }
.amain.closed .apanel { display: none; }

.rail { background: #fff; border-right: 1px solid var(--c-line); display: flex; flex-direction: column; gap: 2px; padding: 5px 4px; overflow: auto; }
.rail .cap { font-size: 10px; color: var(--c-muted); padding: 6px 4px 2px; letter-spacing: .06em; }
.camapp .rail button { position: relative; flex: 0 0 auto; background: none; border: 1px solid transparent; border-radius: 12px; padding: 5px 1px 3px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10.5px; white-space: nowrap; letter-spacing: -.02em; color: var(--c-muted); line-height: 1.3; }
.rail button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.camapp .rail button:hover { color: var(--c-text); background: var(--c-soft); }
.camapp .rail button.on { color: var(--c-accent); border-color: #9cc8df; background: var(--c-sel); }
.rail button .n { position: absolute; top: 2px; right: 4px; font-size: 10px; color: var(--c-text); background: #eef5f9; border-radius: 8px; padding: 0 5px; }
.rail .grow { flex: 1; min-height: 8px; }

.stage { position: relative; min-height: 0; overflow: hidden; background: #fff; container-type: size; } /* 映像の小窓を、図面の高さに合わせて縮めるため */
#cv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 240px); background: rgba(255, 255, 255, .93); border: 1px solid var(--c-line); border-radius: 16px; padding: 4px 14px; font-size: 12px; text-align: center; pointer-events: none; box-shadow: 0 6px 16px -10px rgba(40, 90, 120, .5); }
.banner.hot { border-color: #3f9ec6; color: var(--c-accent); }
.hud { position: absolute; display: flex; gap: 6px; align-items: center; }
.hud.tr { top: 10px; right: 24px; }
.hud.tl { top: 48px; left: 10px; }
#stage.side .hud.tr, #stage.side .pip, #stage.side .pipshow { right: 68px; } /* 右の高さの目盛りを避ける */
#stage.side .legend { max-width: calc(100% - 400px); }
#stage.side .banner { max-width: calc(100% - 460px); min-width: 220px; }
.camapp .hud .btn { background: rgba(255, 255, 255, .94); min-width: 34px; }
.legend { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 4px 10px; flex-wrap: wrap; font-size: 11px; color: var(--c-muted); background: rgba(255, 255, 255, .92); border: 1px solid var(--c-line); border-radius: 10px; padding: 4px 10px; max-width: calc(100% - 350px); pointer-events: none; align-items: center; }
.pip[hidden] ~ .legend, .legend:has(~ .pip[hidden]) { max-width: calc(100% - 20px); }
.camapp .qbtn { pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; border: 1px solid #8cc3dc; background: radial-gradient(circle at 35% 30%, #fff, #d6edf7); font-size: 12px; line-height: 1; padding: 0; display: grid; place-items: center; }
.helpbox { position: absolute; left: 10px; bottom: 46px; z-index: 20; width: 520px; max-width: calc(100% - 20px); max-height: calc(100% - 70px); overflow: auto; background: #fff; border: 1px solid var(--c-line); border-radius: 16px; padding: 10px 14px; box-shadow: 0 18px 40px -18px rgba(40, 90, 120, .45); }
.hhead { display: flex; justify-content: space-between; align-items: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pip { position: absolute; right: 24px; bottom: 10px; width: 370px; max-width: calc(100% - 20px); background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 40px -18px rgba(30, 70, 100, .55), 0 0 0 1px var(--c-line); }
.pip.big { width: 600px; }
.pip, #stage.side .pip { width: min(370px, calc(100cqw - 20px), calc((100cqh - 100px) * 1.6)); }
.pip.big, #stage.side .pip.big { width: min(600px, calc(100cqw - 20px), calc((100cqh - 100px) * 1.6)); }
.piphead { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; font-size: 12px; }
.piphead b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camapp .piphead .btn { padding: 1px 7px; font-size: 11px; white-space: nowrap; }
#pipc { width: 100%; display: block; background: #0d1116; aspect-ratio: 16/9; touch-action: none; cursor: zoom-in; }
.pipcap { font-size: 11px; color: var(--c-muted); padding: 3px 10px 5px; min-height: 22px; font-variant-numeric: tabular-nums; }
.pipshow { position: absolute; right: 24px; bottom: 10px; }
.camapp .ptoggle { position: absolute; right: 0; top: 0; bottom: 0; width: 14px; background: #f4f9fc; border: 0; border-left: 1px solid var(--c-line); color: var(--c-muted); padding: 0; font-size: 12px; z-index: 6; }
.camapp .ptoggle:hover { color: var(--c-text); background: #e6f2f9; }

/* ---- 右の設定パネル ---- */
.apanel { container-type: inline-size; background: #fff; border-left: 1px solid var(--c-line); overflow: auto; min-height: 0; padding: 12px 12px 24px; }
.phead { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.phead svg { width: 26px; height: 26px; flex: none; stroke: #2a7ea3; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.apanel .phead h2 { font-size: 15px; font-weight: 500; margin: 0; letter-spacing: .02em; line-height: 1.5; }
.phead p { margin: 2px 0 0; font-size: 12px; color: var(--c-muted); }
.camapp .note { color: var(--c-muted); font-size: 12px; margin: 6px 0; max-width: none; line-height: 1.7; }
.steps { margin: 10px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.steps li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: start; font-size: 13px; }
.steps li b { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #d6edf7); border: 1px solid #b9ddee; display: grid; place-items: center; font-size: 12px; font-weight: 500; }
.steps li span { color: var(--c-muted); font-size: 12px; display: block; }
.camlist { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.lhead { display: flex; align-items: center; gap: 6px; margin: 14px 0 2px; font-size: 13px; }
.lhead b { font-weight: 500; }
.camapp .btn.sm { font-size: 11px; padding: 2px 9px; }
.camapp .em { color: var(--c-text); font-weight: 500; }
.crow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; border: 1px solid var(--c-line); border-radius: 12px; padding: 2px 6px 2px 10px; background: var(--c-soft); }
.crow:hover { border-color: #8cc3dc; }
.crow.off .nm { color: var(--c-muted); text-decoration: line-through; }
.crow.on { border-color: #8cc3dc; background: var(--c-sel); border-radius: 12px 12px 0 0; }
.camapp .crow .pick { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; width: 100%; padding: 5px 0; }
.crow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camapp .crow button[aria-expanded] span.chev { transform: none; }
.crow span.chev { width: auto; height: auto; transition: none; font-size: 11px; color: var(--c-accent); border: 1px solid var(--c-line); border-radius: 10px; padding: 0 8px; white-space: nowrap; background: #fff; }
.crow:hover span.chev { border-color: #3f9ec6; }
.cdetail { border: 1px solid #8cc3dc; border-top: 0; border-radius: 0 0 12px 12px; padding: 4px 8px 6px; margin-top: -4px; background: #f8fbfd; }
.crow input, .camapp input[type=checkbox], .camapp input[type=range] { accent-color: #2a7ea3; }
.camapp .crow button, .camapp .lnk { background: none; border: 0; padding: 2px 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camapp .crow.on button.pick, .camapp tr.on .lnk { color: var(--c-accent); font-weight: 500; }
.camapp .lnk { text-decoration: underline; text-underline-offset: 2px; }
.crow span.inf { font-size: 11px; color: var(--c-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.camapp .crow .del { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 8px; color: var(--c-muted); overflow: visible; }
.camapp .crow .del:hover { color: #a63c27; background: #fbeeeb; }
.crow .del svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
details.sec { border: 1px solid var(--c-line); border-radius: 12px; margin: 8px 0; background: #fff; }
details.sec > summary { cursor: pointer; padding: 7px 10px; font-size: 13px; font-weight: 500; list-style: none; display: flex; align-items: center; gap: 6px; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::before { content: "▸"; color: var(--c-muted); font-size: 11px; width: 10px; }
details.sec[open] > summary::before { content: "▾"; }
details.sec > .in { padding: 2px 10px 10px; }
.f { display: grid; grid-template-columns: 78px minmax(0, 1fr) 88px; gap: 8px; align-items: center; margin: 5px 0; }
.f label { font-size: 12px; color: var(--c-muted); }
.f input[type=range] { width: 100%; }
.num { display: flex; align-items: center; gap: 4px; }
.num input, .tri input, .f select, .f input[type=text], .f input[type=file] { width: 100%; min-width: 0; background: #fff; border: 1px solid #b9ced9; border-radius: 8px; padding: 2px 6px; }
.camapp .num input, .camapp .tri input { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.camapp input:disabled { background: #eef2f5; color: #8a9aa5; }
.num i { font-style: normal; font-size: 11px; color: var(--c-muted); width: 20px; flex: none; }
.f.wide { grid-template-columns: 78px minmax(0, 1fr); }
.tri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tri label { font-size: 11px; display: flex; flex-direction: column; gap: 2px; }
.f select, .f input[type=text], .f input[type=file] { padding: 3px 6px; }
.camapp .f input[type=file] { font-size: 12px; padding: 5px; }
.chk { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--c-muted); margin: 5px 0; }
.rowbtn { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; align-items: center; }
.camapp .rowbtn .btn { font-size: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12px; margin: 0; }
.kv dt { color: var(--c-muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; padding: 0 7px; border-radius: 9px; font-size: 11px; line-height: 18px; font-weight: 500; color: #10151b; }
.camapp .warn { color: var(--c-warn); font-size: 12px; margin: 6px 0; }
.camapp table { border-collapse: collapse; width: 100%; font-size: 12px; }
.camapp th, .camapp td { padding: 4px 6px; border-bottom: 1px solid var(--c-line); text-align: right; white-space: nowrap; }
.camapp th { color: var(--c-muted); font-weight: 500; }
.camapp th:first-child, .camapp td:first-child { text-align: left; }
.camapp td { font-variant-numeric: tabular-nums; }
.camapp .scroll { overflow-x: auto; }
.looks { display: flex; flex-direction: column; gap: 8px; }
.look { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; border-bottom: 1px solid var(--c-line); padding-bottom: 8px; }
.look canvas { background: #0d1116; border-radius: 6px; image-rendering: pixelated; display: block; }
.look .t { font-size: 12px; }
.look .t b { display: block; font-weight: 500; }
.look .t > span { color: var(--c-muted); display: block; }

/* ---- カメラ映像の全画面（映像が見やすいように、背景だけ暗くする） ---- */
.cview { position: fixed; inset: 0; z-index: 45; background: #0b1015; display: flex; flex-direction: column; font-size: 14px; line-height: 1.5; }
.cvhead { display: flex; gap: 10px; align-items: center; padding: 6px 12px; background: #fff; border-bottom: 1px solid #d5e4ed; flex-wrap: wrap; }
.cvhead b { font-weight: 500; }
.cvtabs { display: flex; gap: 4px; flex-wrap: wrap; }
.cvtabs button { background: #fff; border: 1px solid #c5d9e5; border-radius: 12px; padding: 1px 12px; font-size: 12px; }
.cvtabs button.on { border-color: #3f9ec6; background: #e3f1f9; color: #155e85; }
.cvbody { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px; }
.cvbody canvas { display: block; background: #0d1116; touch-action: none; }
#cvc { cursor: zoom-in; }
.cvcap { font-size: 12px; color: #c3ced6; }
.cvbody.grid { display: grid; gap: 6px; padding: 6px; }
.cview .cell { position: relative; width: 100%; height: 100%; align-self: stretch; background: #0d1116; border: 1px solid #2c3a46; border-radius: 6px; overflow: hidden; padding: 0; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.cview .cell:hover { border-color: #7fc4e2; }
.cell b { position: absolute; left: 6px; top: 6px; background: rgba(255, 255, 255, .9); color: #1d2a33; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); width: max-content; background: #fff; border: 1px solid #3f9ec6; border-radius: 14px; padding: 8px 16px; z-index: 50; font-size: 13px; line-height: 1.6; max-width: 90vw; box-shadow: 0 14px 30px -16px rgba(40, 90, 120, .5); }

/* ---- 下の細い帯（運営者情報などのリンク） ---- */
body.campage footer.afoot { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 4px 16px; flex-wrap: wrap;
  padding: 3px 14px; border-top: 1px solid #d5e4ed; font-size: 11.5px; line-height: 1.7; color: var(--text2); background: #fff; }
.afoot nav { display: flex; gap: 2px 18px; flex-wrap: wrap; }
.afoot a { color: var(--text2); }
.afoot a:hover { color: var(--accent-ink); }
.afoot .copy { color: var(--accent-ink); }

/* ---- 「使い方・説明」の窓 ---- */
.about { width: min(780px, calc(100vw - 20px)); max-width: none; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 22px;
  color: var(--ink); background: #fff; box-shadow: 0 30px 70px -30px rgba(20, 60, 90, 0.6), inset 0 0 0 1px var(--line2); overflow: hidden; }
.about[open] { display: flex; flex-direction: column; }
.about::backdrop { background: rgba(30, 60, 80, 0.35); }
.about-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #d5e4ed;
  background: radial-gradient(circle 130px at calc(100% - 60px) 0, rgba(190, 225, 245, 0.4), rgba(255, 255, 255, 0) 100%), #fff; }
.about-head h2 { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.5; }
.about .btn { font: inherit; font-size: 13px; line-height: 1.5; color: #1f5f80; background: #fff; border: 1px solid #b7cedb; border-radius: 999px; padding: 4px 14px; cursor: pointer; }
.about .btn:hover { border-color: #3f9ec6; background: #f4f9fc; }
.about-body { overflow: auto; min-height: 0; padding: 16px 18px 20px; display: grid; gap: 14px; overscroll-behavior: contain; }
.about .intro { margin: 0; font-size: 14px; color: var(--text2); line-height: 1.95; }
/* 泡の雰囲気の枠: 線は引かず、薄い影と内側の線。右上にだけ小さな泡の光 */
.about section.box { min-width: 0; padding: 18px 20px 16px; border: 0; border-radius: 20px;
  background: radial-gradient(circle 110px at calc(100% - 20px) 20px, rgba(190, 225, 245, 0.32), rgba(255, 255, 255, 0) 100%), #fff;
  box-shadow: 0 18px 40px -32px rgba(40, 110, 150, 0.45), inset 0 0 0 1px var(--line2); }
/* 見出しの左は縦線でなく、小さな泡の丸 */
.about h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 15px; font-weight: 500; letter-spacing: .04em; line-height: 1.5; }
.about h3::before { content: ""; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #a9d6ea); box-shadow: inset 0 0 0 1px #8cc3dc; }
.box p { margin: 0 0 10px; font-size: 13.5px; color: var(--text2); line-height: 1.9; }
.box p:last-child { margin-bottom: 0; }
.how { margin: 0; padding-left: 1.4em; font-size: 13.5px; color: var(--text2); line-height: 1.9; }
.how li { margin-bottom: 5px; }
.how b { font-weight: 500; color: var(--ink); }
.box .fine { font-size: 12.5px; margin-top: 12px; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 8px 9px; border-bottom: 1px solid #d5e4ed; text-align: right; line-height: 1.6; white-space: nowrap; }
.tbl thead th { font-size: 12px; font-weight: 500; color: #3c4c57; background: #f1f7fb; }
.tbl th[scope="row"], .tbl thead th:first-child { text-align: left; font-weight: 500; color: var(--ink); }
.tbl .d { text-align: left; white-space: normal; min-width: 12em; color: var(--text2); font-size: 12.5px; }
.tbl .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }

/* 高さの低いPC画面でも、左の列がスクロールなしで収まるように詰める */
@media (min-width: 901px) and (max-height: 840px) {
  .camapp .rail button { padding: 2px 1px 1px; gap: 0; font-size: 10px; line-height: 1.25; }
  .rail button svg { width: 18px; height: 18px; }
  .rail .cap { padding: 2px 4px 0; line-height: 1.3; }
  .rail { gap: 1px; padding-block: 3px; }
  .rail .grow { min-height: 0; }
}

/* ---- 狭い画面 ---- */
@media (max-width: 1100px) {
  .amain { grid-template-columns: 78px minmax(0, 1fr) 300px; }
  .seglabel { display: none; }
}
/* スマホ・縦長: 上から ツールの列・図面・設定（下から開く） */
@media (max-width: 900px) {
  .amain, .amain.closed { display: flex; flex-direction: column; }
  .rail { flex: 0 0 auto; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--c-line); }
  .camapp .rail button { min-width: 58px; }
  .rail .cap, .rail .grow { display: none; }
  .stage { flex: 1 1 0; }
  .apanel { flex: 0 0 auto; max-height: 40vh; max-height: 40dvh; border-left: 0; border-top: 1px solid var(--c-line); overscroll-behavior: contain; }
  .camapp .ptoggle { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: 20px; border-left: 0; border-top: 1px solid var(--c-line); writing-mode: vertical-rl; display: flex; align-items: center; justify-content: center; }
  .hud.tr, #stage.side .hud.tr { right: 10px; }
  .hud.tl { top: 52px; right: 10px; left: 10px; overflow-x: auto; }
  .banner, #stage.side .banner { max-width: calc(100% - 150px); left: 10px; transform: none; }
  .legend, #stage.side .legend { max-width: calc(100% - 20px); bottom: 26px; font-size: 10px; gap: 1px 8px; padding: 3px 8px; }
  .pip, #stage.side .pip { width: max(180px, min(280px, calc(100cqw - 20px), calc((100cqh - 160px) * 1.75))); right: 10px; bottom: 90px; }
  .pip.big, #stage.side .pip.big { width: max(180px, min(calc(100cqw - 20px), calc((100cqh - 160px) * 1.75))); }
  .pipcap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* 小窓の高さが図面からはみ出さないよう1行に */
  .pipshow, #stage.side .pipshow { right: 10px; bottom: 90px; }
  .helpbox { bottom: 30px; max-height: calc(100% - 40px); }
  /* 小窓の見出しは1行にして、ボタンが入りきらないときは横にずらして見る */
  .piphead { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .piphead::-webkit-scrollbar { display: none; }
  .piphead b { flex: 0 0 auto; margin-right: 4px; }
  .piphead .spacer { display: none; }
}
@media (max-width: 760px) {
  .atop { gap: 6px 8px; padding: 6px 8px; }
  .brand { order: -2; flex: 1 0 100%; margin: 0; gap: 6px; }
  .atop h1 { min-width: 0; gap: 6px; font-size: 14px; letter-spacing: 0; overflow: hidden; }
  .camapp .actions .btn .lbl { display: none; } /* 狭い画面では「↶」「↷」の記号だけにする */
  .camapp .actions #undoBtn, .camapp .actions #redoBtn { min-width: 34px; padding-inline: 8px; }
  .others { margin-left: auto; }
  .atop .spacer, .seglabel { display: none; }
  .aseg button { padding: 3px 10px; font-size: 13px; }
  .camapp .actions .btn { font-size: 13px; padding: 3px 10px; }
  .actions { gap: 6px; }
  .expmenu { right: auto; left: -80px; width: 250px; }
  body.campage footer.afoot { justify-content: center; font-size: 10.5px; padding: 2px 8px; }
  .afoot nav { gap: 2px 12px; justify-content: center; }
  .afoot > span { display: none; }
}
@media (max-width: 359px) { .atop h1 { font-size: 13px; } .atop h1::before { display: none; } .others .h9s__btn { padding: 0 8px; font-size: 11px; } }
/* スマホ横向き: 図面と設定を左右に並べる */
@media (max-width: 900px) and (orientation: landscape) {
  .amain, .amain.closed { display: grid; grid-template-columns: minmax(0, 1fr) 270px; grid-template-rows: auto minmax(0, 1fr); }
  .amain.closed { grid-template-columns: minmax(0, 1fr) 0; }
  .rail { grid-column: 1 / -1; }
  .apanel { max-height: none; min-height: 0; border-top: 0; border-left: 1px solid var(--c-line); }
  .camapp .ptoggle { top: 0; left: auto; width: 16px; height: auto; border-top: 0; border-left: 1px solid var(--c-line); writing-mode: horizontal-tb; }
  .hud.tr, #stage.side .hud.tr { right: 24px; }
  .pip, #stage.side .pip, .pip.big, #stage.side .pip.big { right: 24px; bottom: 8px; width: max(150px, min(240px, calc((100cqh - 75px) * 1.75))); }
  .pipshow, #stage.side .pipshow { right: 24px; bottom: 8px; }
  .legend, #stage.side .legend { bottom: 8px; max-width: calc(100% - 20px); padding: 4px; }
  .legend span { display: none; } /* 低い画面では「？」だけにして、色の説明はその中で見る */
}

/* 設定パネルが細いとき（スマホ横向きなど）は、一覧の行の大きさ表示を省いて「設定」「閉じる」を収める */
@container (max-width: 300px) { .crow span.inf { display: none; } }
/* 図面の高さが足りないとき（小さいスマホで設定を開いたときなど）: 色の凡例は「？」だけにし、映像の小窓を下に寄せて収める */
@container (max-height: 330px) {
  .legend, #stage.side .legend { padding: 4px; max-width: none; }
  .legend span { display: none; }
  .pip, #stage.side .pip, .pip.big, #stage.side .pip.big { bottom: 30px; width: max(150px, min(280px, calc(100cqw - 70px), calc((100cqh - 85px) * 1.75))); }
  .pipshow, #stage.side .pipshow { bottom: 30px; }
}
