/* LiDAR Damage Detection — app styles
   2026.10.01: LP・コラム（lidar-site の column.css + site.css）と同じトークンに揃えた。
   色の役割: 深紺＝構造 / 青緑＝操作・選択・進行 / 赤＝写真や図面への書き込みとエラー。
   面の角丸は 2px（円形はスピナーと位置の点だけ）。文字は最小 12px。 */
:root{
  --ink:#14202c; --ink-2:#263546; --muted:#56667a;
  --paper:#f4f6f7; --card:#ffffff; --surface-2:#eef2f4;
  --line:#d7dee5; --line-in:#788a94;   /* 入力欄・ボタンの枠（背景に対して 3:1 以上） */
  --navy:#0d2231; --navy-2:#28536b;
  --teal:#087777; --teal-d:#065c5c; --teal-tint:#edf6f4;
  --mark:#c8231c;                 /* 書き込み（損傷の線・通り芯・位置の点） */
  --accent:#c8231c; --danger:#c8231c;   /* app.js が未入力の枠に var(--accent) を使う */
  --ok:#1d6b33; --ok-tint:#eaf5f0; --warn:#8a6100; --warn-tint:#fbf4e3;
  --stage:#0d1b2a;                /* pcd.js の canvas 背景（0x0d1b2a）と同じ値 */
  --r:2px;
  --h-appbar:56px;
  --w-side:360px;
  --shadow:0 14px 34px rgba(14,31,45,.16);   /* 重なる面（ダイアログ）だけ */
}
*{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0}
body{
  /* 丸数字（①〜㊿）を読める大きさで出すため、和文フォントを先に置く */
  font-family:"Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,-apple-system,BlinkMacSystemFont,sans-serif;
  background:var(--paper); color:var(--ink); font-size:15px; line-height:1.7;
  -webkit-font-smoothing:antialiased; font-variant-numeric:tabular-nums; line-break:strict;
  padding-left:env(safe-area-inset-left); padding-right:env(safe-area-inset-right);
}
h1,h2,h3{line-height:1.35}
a{color:var(--navy-2)}
input,select,textarea,button{font:inherit; color:inherit}
input[type=range],input[type=checkbox]{accent-color:var(--teal)}
:focus-visible{outline:2px solid var(--teal); outline-offset:2px}
.muted{color:var(--muted); font-size:12.5px}
.keep,.nowrap{white-space:nowrap}

/* ---- buttons ---- */
button{cursor:pointer}
button:disabled{opacity:.45; cursor:not-allowed}
.primary,.secondary{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  min-height:40px; padding:8px 18px; border:1px solid transparent; border-radius:var(--r);
  font-size:14px; font-weight:700; line-height:1.4; text-decoration:none; text-align:center; cursor:pointer;
  transition:background-color .15s, border-color .15s, color .15s;
}
.primary{background:var(--teal); color:#fff}
.secondary{background:#fff; color:var(--ink); border-color:var(--line-in)}
@media (hover:hover){
  .primary:not(:disabled):hover{background:var(--teal-d)}
  .secondary:not(:disabled):hover{border-color:var(--ink); background:var(--surface-2)}
}
.link-btn{background:none; border:0; border-radius:var(--r); padding:0; color:var(--navy-2);
  font-size:13px; font-weight:600; text-decoration:underline; text-underline-offset:3px; cursor:pointer}
@media (hover:hover){ .link-btn:hover{color:var(--teal)} }

/* ---- app bar ---- */
.appbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  min-height:var(--h-appbar); padding:0 24px;
  background:var(--paper); border-bottom:1px solid var(--line);
}
.brand{display:flex; align-items:center; gap:10px; min-width:0; overflow:hidden}
.brand-mark{flex:none; width:12px; height:12px; border-radius:var(--r);
  background:linear-gradient(135deg,var(--teal),var(--navy-2))}
.brand-text{display:flex; align-items:baseline; gap:10px; min-width:0}
.brand-text strong{font-size:15px; font-weight:800; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.brand-text small{font-size:12px; font-weight:600; color:var(--muted); white-space:nowrap}
.appbar-nav{display:flex; align-items:center; gap:10px; flex:none}
.izu-mark{display:inline-flex; align-items:center; gap:6px; min-height:32px; text-decoration:none;
  color:var(--muted); font-size:12px; font-weight:700; letter-spacing:.14em}
.izu-cube{width:16px; height:16px; stroke:currentColor; stroke-width:1.6; flex:none}
.appbar-sep{width:1px; height:18px; background:var(--line)}
.ghost-btn{min-height:34px; padding:5px 12px; background:transparent; color:var(--ink-2);
  border:1px solid var(--line-in); border-radius:var(--r); font-size:13px; font-weight:700; white-space:nowrap;
  transition:background-color .15s, border-color .15s, color .15s}
@media (hover:hover){ .ghost-btn:hover{border-color:var(--ink); color:var(--ink); background:#fff} }

/* ---- workflow stepper: 4つの手順を1本の帯でつなぐ ---- */
.stepper{
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr));
  max-width:1320px; margin:16px auto 0; padding:0 20px;
}
.step{
  display:flex; align-items:center; gap:10px; min-width:0; min-height:56px;
  padding:8px 14px; text-align:left;
  background:#fff; color:var(--ink); border:1px solid var(--line-in); border-radius:0;
  transition:background-color .15s, color .15s;
}
.step + .step{border-left:0}
.step:first-child{border-radius:var(--r) 0 0 var(--r)}
.step:last-child{border-radius:0 var(--r) var(--r) 0}
.step-no{flex:none; position:relative; width:26px; height:26px; display:grid; place-items:center;
  border:1px solid var(--line-in); border-radius:var(--r);
  font-size:14px; font-weight:800; color:var(--muted)}
.step-label{display:flex; flex-direction:column; min-width:0; line-height:1.35}
.step-label b{font-size:14px; font-weight:700}
.step-label small{font-size:12px; color:var(--muted)}
@media (hover:hover){ .step:not(.active):hover{background:var(--surface-2)} }
.step.active{background:var(--navy); border-color:var(--navy); color:#fff}
.step.active .step-no{border-color:#fff; color:#fff}
.step.active .step-label small{color:#c5d2dc}
/* 済みの手順: 番号をチェックの線に置き換える */
.step.done .step-no{border-color:var(--teal); font-size:0}
.step.done .step-no::after{content:""; width:6px; height:11px; margin-top:-3px;
  border:solid var(--teal); border-width:0 2px 2px 0; transform:rotate(45deg)}

/* ---- 手順の見出し（Step 1・Step 4・案件一覧） ---- */
.proj-wrap{max-width:1000px; margin:20px auto 32px; padding:0 20px}
.proj-hero{max-width:880px; margin:0 auto 14px}
.proj-eyebrow{display:flex; align-items:center; gap:8px; margin:0 0 4px;
  font-size:12px; font-weight:800; letter-spacing:.13em; color:var(--teal)}
.proj-eyebrow::before{content:""; width:18px; height:2px; background:currentColor}
.proj-title{font-size:22px; font-weight:800; margin:0 0 4px}
.proj-lead{color:var(--muted); font-size:14px; margin:0; max-width:46em}
.proj-cols{display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); gap:20px; align-items:start; max-width:880px; margin:0 auto}
.proj-card{background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:20px; margin:0; min-width:0}
.proj-cta{width:100%; margin-top:14px; min-height:46px; font-size:15px}
.card-head{font-size:14px; font-weight:800; margin:0 0 10px}
/* Step 1 は入力カード1枚 */
#viewproject .proj-hero,.proj-cols-1{max-width:820px}
.proj-cols-1{grid-template-columns:minmax(0,1fr)}
#viewprojects .proj-hero{max-width:760px}
@media (max-width:760px){ .proj-cols{grid-template-columns:minmax(0,1fr)} }

/* ---- Step 4: 提出前の確認（サブ情報。罫線で区切った行） ---- */
.proj-flow{max-width:440px; min-width:0}
.flow-eyebrow{margin:0 0 6px; font-size:14px; font-weight:800}
.flow-guide{list-style:none; margin:0; padding:0; border-top:1px solid var(--line)}
.flow-guide li{padding:10px 0; border-bottom:1px solid var(--line)}
.flow-guide b{display:block; font-size:14px}
.flow-guide small{display:block; font-size:12.5px; color:var(--muted); line-height:1.65}
.flow-note{margin:10px 0 0}

/* ---- 案件一覧 ---- */
.projects-toolbar{max-width:760px; margin:0 auto 12px; display:flex; align-items:center; justify-content:space-between; gap:12px}
.projects-list{max-width:760px; margin:0 auto; border-top:1px solid var(--line)}
.projects-empty{max-width:760px; margin:8px auto; padding:28px 16px; text-align:center; color:var(--muted); font-size:14px;
  background:#fff; border:1px dashed var(--line-in); border-radius:var(--r)}
.pj-card{display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:14px 0; border-bottom:1px solid var(--line)}
.pj-main{min-width:0}
.pj-name{font-size:16px; font-weight:700; line-height:1.4; overflow-wrap:anywhere}
.pj-meta{font-size:13px; color:var(--muted)}
.pj-badges{display:flex; flex-wrap:wrap; gap:4px 14px; margin-top:2px}
.pj-badge{font-size:12.5px; font-weight:700; color:var(--muted)}
.pj-badge.ok{color:var(--ok)}
.pj-side{display:flex; align-items:center; gap:14px; flex:none}
.pj-date{font-size:12.5px; color:var(--muted)}
.pj-actions{display:flex; align-items:center; gap:8px}
.pj-open{min-height:36px; padding:6px 16px; font-size:13px; white-space:nowrap}
.pj-del{min-height:36px; padding:6px 10px; background:transparent; border:1px solid transparent; border-radius:var(--r);
  color:var(--muted); font-size:13px; text-decoration:underline; text-underline-offset:3px}
@media (hover:hover){ .pj-del:hover{color:var(--danger)} }
@media (max-width:560px){
  .pj-card{flex-direction:column; align-items:stretch; gap:8px}
  .pj-side{justify-content:space-between}
}

/* ---- layout（Step 2・Step 3・点群ビューア） ---- */
.layout{
  display:grid; grid-template-columns:var(--w-side) minmax(0,1fr); gap:20px; align-items:start;
  max-width:1320px; margin:16px auto 32px; padding:0 20px;
}
.layout>.panel{min-width:0}
.panel{background:var(--card); border:1px solid var(--line); border-radius:var(--r)}
.sidebar{padding:18px}
.viewer{padding:20px; min-height:60vh}

.block{margin-bottom:22px}
.block:last-child{margin-bottom:0}
.block h2{font-size:14px; font-weight:800; margin:0 0 10px; padding-bottom:6px; border-bottom:1px solid var(--line)}
.block-head{display:flex; justify-content:space-between; align-items:baseline; gap:8px; margin-bottom:10px; border-bottom:1px solid var(--line)}
.block-head h2{flex:1; margin:0; border:0}
.block-shots{margin-top:14px}
.block-note{margin:6px 0 0}
.block-lead{margin:0 0 8px}
/* 折りたたみ（任意の入力） */
.collapse summary{display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 8px; min-height:32px; padding-bottom:6px;
  font-size:14px; font-weight:800; border-bottom:1px solid var(--line);
  cursor:pointer; list-style:none; user-select:none}
.collapse summary::-webkit-details-marker{display:none}
.collapse summary::before{content:""; flex:none; align-self:center; width:7px; height:7px; margin-right:4px;
  border:solid var(--muted); border-width:0 2px 2px 0; transform:rotate(-45deg); transition:transform .15s}
.collapse[open] summary::before{transform:rotate(45deg)}
.collapse[open] summary{margin-bottom:12px}
.collapse summary small{font-weight:600}

/* ---- dropzone ---- */
.dropzone{
  border:1px dashed var(--line-in); border-radius:var(--r); padding:18px 14px; text-align:center;
  cursor:pointer; background:#fff; transition:background-color .15s, border-color .15s;
}
.dropzone.drag,.dropzone.over{border-color:var(--teal); background:var(--teal-tint)}
@media (hover:hover){ .dropzone:hover{border-color:var(--teal); background:var(--teal-tint)} }
.dropzone.loading{border-style:solid; border-color:var(--navy-2); background:var(--surface-2); cursor:progress}
.dropzone.loaded{border-style:solid; border-color:var(--ok); background:var(--ok-tint)}
.dropzone.loaded b{font-size:14px; overflow-wrap:anywhere}
.dropzone p{margin:0; font-size:14px; font-weight:700}
.dropzone span{color:var(--muted); font-size:12.5px; font-weight:400}
.dz-slim{padding:10px}
.dz-slim p{font-size:12.5px; font-weight:400; color:var(--muted)}
.dz-gap{margin-top:12px}

/* ---- gallery（サンプル写真） ---- */
.gallery{display:grid; grid-template-columns:repeat(3,1fr); gap:8px; max-height:260px; overflow-y:auto; padding:3px}
.gcell{position:relative; aspect-ratio:1}
.gallery img{width:100%; height:100%; object-fit:cover; display:block; border-radius:var(--r); cursor:pointer;
  outline:0 solid var(--teal); transition:outline-width .1s}
.gallery img.sel{outline-width:3px}
.gcell.picked img{outline:3px solid var(--navy)}
.gcheck{position:absolute; top:4px; right:4px; width:24px; height:24px; padding:0; display:grid; place-items:center;
  border:2px solid #fff; border-radius:var(--r); background:rgba(6,19,31,.45)}
.gcell.picked .gcheck{background:var(--navy)}
.gcell.picked .gcheck::after{content:""; width:5px; height:10px; margin-top:-2px;
  border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg)}
.batch-bar{margin-top:10px; display:flex; flex-direction:column; gap:8px}
.batch-actions{display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px}
.batch-actions.gap-s{margin-top:8px}
.batch-actions.gap-m{margin-top:14px}
.batch-actions .push{margin-left:auto}
.batch-bar .secondary{width:100%}

/* ---- form controls ---- */
.switch-row,.field{display:flex; flex-direction:column; gap:5px; margin-bottom:14px; font-size:13px; font-weight:700}
.field small,.switch-row small{font-weight:400}
.field.tight{margin-bottom:6px}
.switch-row{flex-direction:row; align-items:center; justify-content:space-between; gap:12px}
.field input,.field select{
  width:100%; min-height:40px; border:1px solid var(--line-in); border-radius:var(--r);
  padding:7px 10px; font-size:15px; font-weight:400; background:#fff;
}
.field input:focus,.field select:focus,.trow select:focus,.trow input:focus,.tf-grid input:focus,
.ink-opt input:focus,.meas-in:focus{outline:2px solid var(--teal); outline-offset:-1px; border-color:var(--teal)}
/* 未入力のまま進もうとしたとき（app.js が border-color を入れる）は、フォーカス中も赤で見せる */
.field input[style*="border-color"]:focus{outline-color:var(--danger); border-color:var(--danger)}
/* スライダーとチェックボックスは入力欄の枠を持たせない */
.field input[type=range]{min-height:28px; padding:0; border:0; background:none}
.field input[type=checkbox]{width:18px; height:18px; min-height:0; margin:0; padding:0; border:0; flex:none}
.switch{appearance:none; -webkit-appearance:none; flex:none; width:44px; height:24px; margin:0;
  border-radius:var(--r); background:var(--line-in); position:relative; cursor:pointer; transition:background-color .15s}
.switch:checked{background:var(--teal)}
.switch::after{content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:1px;
  background:#fff; transition:left .15s}
.switch:checked::after{left:23px}
.row2{display:flex; gap:10px}
.row2 .field{flex:1; min-width:0}
.hint{margin:-6px 0 12px}
.hint-b{margin:8px 0 0}

/* ---- viewer head ---- */
.viewer-head{display:flex; justify-content:space-between; align-items:flex-start; gap:12px 20px; flex-wrap:wrap; margin-bottom:14px}
.viewer-head>div:first-child{flex:1 1 420px; min-width:0}
.viewer-head h1{font-size:19px; font-weight:800; margin:0 0 2px; overflow-wrap:anywhere}
.viewer-head p{margin:0}
.viewer-head .marker-note{margin-top:6px}
.actions{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end}

/* ---- stage（写真・図面・点群を見せる面） ---- */
.stage{position:relative; border-radius:var(--r); overflow:hidden; background:var(--stage); min-height:340px;
  display:grid; place-items:center; scroll-margin-top:calc(var(--h-appbar) + 12px)}
.stage.empty{background:var(--surface-2); border:1px dashed var(--line-in)}
.stage img{width:100%; display:block; max-height:64vh; object-fit:contain}
.placeholder{text-align:center; color:var(--muted); font-size:14px; padding:16px}
.ph-icon{margin-bottom:6px; color:var(--line-in)}
.ph-icon svg{width:36px; height:36px}
.spinner{position:absolute; inset:0; display:flex; flex-direction:column; gap:12px; align-items:center; justify-content:center;
  background:rgba(13,27,42,.6); color:#fff; font-size:14px}
.ring{width:40px; height:40px; border-radius:50%; border:3px solid rgba(255,255,255,.3); border-top-color:#fff; animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---- 集計: ラベルと値を罫線の間に1行で並べる ---- */
.summary{display:flex; flex-wrap:wrap; gap:4px 28px; margin-top:14px; padding:10px 2px;
  border-top:1px solid var(--line); border-bottom:1px solid var(--line)}
.chip{display:flex; align-items:baseline; gap:8px; min-width:0}
.chip .k{font-size:12.5px; color:var(--muted); white-space:nowrap}
.chip .v{font-size:15px; font-weight:800; overflow-wrap:anywhere}

/* ---- table ---- */
.table-wrap{margin-top:18px}
.table-wrap, #dTableWrap{overflow-x:auto}
.table-wrap table{min-width:520px}
.ctable{width:100%; border-collapse:collapse; font-size:14px}
.ctable th{padding:8px 10px; text-align:center; font-size:13px; font-weight:700; white-space:nowrap;
  background:var(--surface-2); border-bottom:2px solid var(--ink)}
.ctable th:nth-child(2),.ctable td:nth-child(2){text-align:left}
.ctable td{padding:8px 10px; text-align:center; white-space:nowrap; border-bottom:1px solid var(--line)}
.table-gap{margin-top:10px}
/* 番号: AI の検出＝下書き（枠だけ）／ペン入れ＝点検者が描いたもの（塗り） */
.badge{display:inline-grid; place-items:center; min-width:24px; height:22px; padding:0 5px; border-radius:var(--r);
  border:1.5px solid var(--mark); background:#fff; color:var(--mark); font-size:12.5px; font-weight:800; line-height:1}
.badge.dmg{border-color:var(--ink); color:var(--ink)}
.badge.pen{border-color:var(--navy); background:var(--navy); color:#fff}
/* 損傷度 A〜E: 色分けは文字色だけ */
.grade{font-size:14px; font-weight:800; white-space:nowrap}
.grade.ga{color:var(--ok)}
.grade.gb{color:var(--navy-2)}
.grade.gc{color:var(--warn)}
.grade.gd{color:#a8501a}
.grade.ge{color:var(--mark)}
.grade.gna{color:var(--muted); font-weight:400}
.grade-ok{color:var(--ok); font-weight:800}
.grade-ng{color:var(--mark); font-weight:800}
.note{font-size:12.5px; color:var(--muted); margin:12px 0 0; line-height:1.75; max-width:60em}
.dtable-head{font-size:15px; font-weight:800; margin:20px 0 8px}
.dm-spalling{color:#a84f00; font-weight:700}
.dm-exposed_rebars{color:#a02c96; font-weight:700}
.dm-efflorescence{color:#0e6f7c; font-weight:700}

/* ---- 写真の比較スライダー（元画像 / AI解析）----
   #cmpWrap の箱＝画像の箱。境目とペン入れの座標はこの箱の割合で計算するので、余白・枠を足さない */
.cmp-wrap{position:relative; --cut:50%; max-width:100%; line-height:0; touch-action:none; display:inline-block}
.cmp-wrap img{display:block; width:auto; height:auto; max-width:100%; max-height:64vh;
  -webkit-user-drag:none; user-select:none; -webkit-user-select:none}   /* 画像のドラッグが始まると境目の操作が途切れる */
#imageBefore{position:absolute; inset:0; width:100%; height:100%; max-width:none; max-height:none;
  clip-path:inset(0 calc(100% - var(--cut)) 0 0); pointer-events:none}
.cmp-handle{position:absolute; top:0; bottom:0; left:var(--cut); width:2px;
  background:#fff; box-shadow:0 0 0 1px rgba(0,0,0,.35); cursor:ew-resize}
.cmp-grip{position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:32px; height:32px; border-radius:50%; background:#fff; box-shadow:0 1px 6px rgba(0,0,0,.4); cursor:ew-resize}
.cmp-grip::before,.cmp-grip::after{content:""; position:absolute; top:50%; width:7px; height:7px;
  border:solid var(--ink); border-width:0 0 2px 2px}
.cmp-grip::before{left:8px; transform:translateY(-50%) rotate(45deg)}
.cmp-grip::after{right:8px; transform:translateY(-50%) rotate(-135deg)}
.cmp-tag{position:absolute; top:8px; padding:2px 8px; border-radius:var(--r);
  font-size:12px; line-height:1.5; background:rgba(6,19,31,.78); color:#fff}
.cmp-tag.l{left:8px}
.cmp-tag.r{right:8px}

/* ---- 凡例（AI検出の色。サーバが描く色と同じ値） ---- */
.legend{display:flex; flex-wrap:wrap; gap:6px 16px; align-items:center; margin-top:10px; font-size:13px}
.legend .lg{display:inline-flex; align-items:center; gap:6px}
.legend .lg i{width:12px; height:12px; border-radius:var(--r); display:inline-block}
.lg-crack i{background:#e02020}
.lg-spalling i{background:#ff7a00}
.lg-rebar i{background:#c83cb4}
.lg-efflo i{background:#28b4c8}

/* ---- Step 3: 面に割り当てて転記 ---- */
.t-stage{background:#fff; border:1px solid var(--line); place-items:start stretch}
.t-stage .placeholder{align-self:center; justify-self:center}
.t-stage img{max-height:60vh}
.t-stage.picking img{cursor:crosshair}
/* #t_zoom はステージの左上に置く（面の拡大は左上を原点に計算している） */
.t-zoom{position:relative; width:100%; transform-origin:0 0; transition:transform .25s ease}
.t-pick-layer{position:absolute; pointer-events:none}
.t-foot{position:absolute; border:2px solid var(--teal); background:rgba(8,119,119,.12); box-sizing:border-box; min-width:6px; min-height:6px}
.t-foot.cur{border-color:var(--navy); background:rgba(13,34,49,.14)}
.t-foot span{position:absolute; left:-2px; top:-20px; font-size:12px; line-height:18px; padding:0 5px; background:var(--teal); color:#fff; white-space:nowrap}
.t-foot.cur span{background:var(--navy)}
.t-stage.picking .t-foot span{display:none}   /* 面を拡大している間はラベルも拡大されて図面を覆う */
.t-foot i{position:absolute; width:9px; height:9px; margin:-5px 0 0 -5px; border-radius:50%; background:#fff; border:2px solid var(--navy)}
.t-pick-hint{display:flex; margin:0 0 8px; gap:10px; align-items:center; justify-content:space-between;
  padding:8px 12px; background:var(--navy); color:#fff; font-size:13px; line-height:1.5; border-radius:var(--r)}
.t-pick-hint .link-btn{color:#fff; flex:none}
.t-custom{margin:0 0 14px; padding:12px 12px 6px; border:1px solid var(--line); border-left:4px solid var(--navy-2); border-radius:var(--r); background:var(--surface-2)}
.t-custom .field{margin-bottom:10px}
.t-faces{display:flex; flex-direction:column; border-top:1px solid var(--line)}
.t-face{padding:10px 0; border-bottom:1px solid var(--line)}
.t-face .tf-name{font-size:14px; font-weight:700}
.t-face .tf-name small{font-size:12.5px; font-weight:400; color:var(--muted); margin-left:6px}
.t-face .tf-grid{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; margin-top:4px}
.t-face .tf-grid label{display:flex; flex-direction:column; font-size:12px; color:var(--muted)}
.t-face .tf-grid input{width:100%; min-width:0; min-height:34px; padding:4px 6px; font-size:13px;
  border:1px solid var(--line-in); border-radius:var(--r)}
.t-face.missing{padding-left:10px; border-left:4px solid var(--mark)}
/* 写真の割当: 1枚＝1行。並びは 写真・面・合わせ方／数値／位置決め／位置合わせ／位置 */
.trow{display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:6px; align-items:center;
  padding:10px 0; border-bottom:1px solid var(--line)}
.trow:first-child{border-top:1px solid var(--line)}
.trow select,.trow input{width:100%; min-width:0; min-height:36px; padding:5px 6px; font-size:13px;
  border:1px solid var(--line-in); border-radius:var(--r); background:#fff}
.trow .tr-img{grid-column:1/-1}
.trow .tr-sub{grid-column:1/-1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto auto; gap:6px; align-items:end}
.trow .tr-sub label{display:flex; flex-direction:column; min-width:0; font-size:12px; line-height:1.4; color:var(--muted)}
.trow .tr-sub label.tr-ai{flex-direction:row; align-items:center; gap:4px; align-self:end; padding-bottom:8px; color:var(--ink)}
.trow .tr-ai input{width:18px; height:18px; min-height:0; margin:0; padding:0}
.trow .tr-sub .link-btn{align-self:end; padding:0 2px 9px; font-size:12.5px; color:var(--muted)}
.trow .tr-pick{grid-column:1/-1; justify-self:start; min-height:34px; padding:5px 12px;
  font-size:13px; font-weight:700; line-height:1.4; text-decoration:none; color:var(--ink);
  border:1px solid var(--line-in); border-radius:var(--r); background:#fff}
.trow .tr-pick.on{background:var(--navy); border-color:var(--navy); color:#fff}
.trow .tr-pos{grid-column:1/-1; font-size:12.5px; color:var(--muted)}
.trow .tr-align{grid-column:1/-1; display:flex; flex-wrap:wrap; align-items:center; gap:8px}
.trow .tr-align .secondary{min-height:34px; padding:5px 12px; font-size:13px}
.trow .tr-alState{font-size:12.5px; color:var(--muted)}
.trow .tr-alState.ok{color:var(--ok); font-weight:700}
#t_gen{width:100%; min-height:46px}

/* 主ボタンは1画面に1つ: 段が進んだら、前の段の主ボタンは枠だけにする（JS は触らない） */
#view2d:has(#stage:not(.empty)) #camBtn,
#view2d:has(#inkBar:not([hidden])) #go_dxf,
#view2d:has(#inkBar:not([hidden])) #detectBtn,
#viewdxf:has(#t_result:not([hidden])) #t_gen{background:#fff; color:var(--ink); border-color:var(--line-in)}

/* ---- 手順の間の「次へ」 ---- */
.step-next{display:flex; justify-content:flex-end; margin:18px 0 4px; padding:0 3px 3px}
.step-next .primary{min-width:260px; min-height:46px}

/* ---- Step 4: 提出物 ---- */
.out-list{list-style:none; margin:0; padding:0; border-top:1px solid var(--line)}
.out-item{display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--line)}
.out-item .oi-main{display:flex; flex-direction:column; gap:1px; min-width:0; flex:1}
.out-item .oi-main b{font-size:14px; color:var(--muted)}
.out-item.ready .oi-main b{color:var(--ink)}
.out-item .oi-main small{font-size:12.5px; color:var(--muted); line-height:1.6}
.out-item .oi-none{font-size:12.5px; color:var(--muted); flex:none}
.out-item.ready .oi-none{display:none}
.out-item .secondary{flex:none; min-width:112px}
.out-empty{margin:12px 0 0}

/* ---- 撮影・写真の一覧（Step 2） ---- */
.shot-btns{display:flex; gap:8px; margin-bottom:8px}
.shot-btn{flex:1; padding:8px 8px; min-height:44px}
.shot-btn svg{width:18px; height:18px; flex:none}
/* 撮り方の注意（左線の箱） */
.shoot-note{margin-top:10px; padding:10px 12px; border-left:4px solid var(--teal); background:var(--surface-2); border-radius:var(--r); font-size:13px; line-height:1.7}
.shoot-note>b{display:block; margin-bottom:4px}
.shoot-note ol{margin:0; padding-left:1.4em}
.shoot-note li{margin:2px 0}
.shoot-note li b{font-weight:700}
.shoot-note a{color:var(--navy-2); font-weight:700}
.shoot-sub{margin:6px 0 0; font-size:12.5px; line-height:1.65; color:var(--muted)}
.marker-note,.meas-note{margin:6px 0 0; padding:6px 10px; font-size:13px; line-height:1.6;
  border-left:4px solid var(--ok); background:var(--ok-tint); border-radius:var(--r)}
.meas-note{margin:0 0 8px}
.marker-note.warn{border-left-color:var(--warn); background:var(--warn-tint)}
.marker-note.none,.meas-note.none{border-left-color:var(--line-in); background:var(--surface-2); color:var(--muted)}
.meas-in{width:72px; min-height:30px; padding:3px 6px; border:1px solid var(--line-in); border-radius:var(--r); font-size:13px; text-align:right}
.shots{display:grid; grid-template-columns:repeat(3,1fr); gap:8px; max-height:260px; overflow-y:auto; padding:3px}
.shot{position:relative; aspect-ratio:1; border-radius:var(--r); overflow:hidden; cursor:pointer; outline:0 solid var(--teal); transition:outline-width .1s}
.shot img{width:100%; height:100%; object-fit:cover; display:block}
.shot.sel{outline-width:3px}
.shot-no{position:absolute; left:4px; top:4px; min-width:20px; height:20px; padding:0 5px; border-radius:var(--r);
  background:rgba(6,19,31,.78); color:#fff; font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center}
.shot-badges{position:absolute; right:4px; bottom:4px; display:flex; gap:3px}
.sb{min-width:20px; height:20px; padding:0 4px; display:grid; place-items:center; border-radius:var(--r);
  font-size:12px; font-weight:800; line-height:1; background:#fff; color:var(--mark); border:1.5px solid var(--mark)}
.sb.pen{background:var(--navy); color:#fff; border-color:var(--navy)}
/* 撮り忘れの知らせ（U-8）: 一覧の印と、まとめの1行。止めない・控えめに */
.shot-issue{position:absolute; right:4px; top:4px; height:20px; padding:0 5px; display:flex; align-items:center; border-radius:var(--r);
  background:var(--warn-tint); color:var(--warn); border:1.5px solid var(--warn); font-size:12px; font-weight:800; line-height:1}
.shots-check{margin:8px 0 0; font-size:12.5px; line-height:1.6; color:var(--muted); overflow-wrap:anywhere}
.shots-check.warn{padding:6px 10px; border-left:4px solid var(--warn); background:var(--warn-tint); color:var(--ink); border-radius:var(--r)}
.shots-check.sel{margin-top:6px; color:var(--ink)}
/* チョーク入り／なしの写真の対（C-6） */
.sb.chalk{width:auto; padding:0 5px; font-size:11.5px; color:var(--navy-2); border-color:var(--navy-2)}
.sb.chalk.paired{background:var(--navy-2); color:#fff}
.shot-kind{display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; margin-top:8px; font-size:13px}
.shot-kind label{display:inline-flex; align-items:center; gap:6px}
.shot-kind select{min-height:32px; padding:2px 28px 2px 8px; border:1px solid var(--line-in); border-radius:var(--r); background-color:#fff}
.shots-check:empty{display:none}
.pair-rows{display:flex; flex-direction:column; gap:8px; margin-top:8px}
.pair-row{display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 12px; padding:8px 10px;
  border:1px solid var(--line); border-left:4px solid var(--teal); background:#fff; border-radius:var(--r); max-width:440px}
.pair-row.done{border-left-color:var(--navy-2); background:var(--surface-2)}
.pair-text{display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; min-width:0}
.pair-shot{display:inline-flex; align-items:center; gap:6px; font-size:13px; font-weight:700}
.pair-shot img{width:44px; height:44px; object-fit:cover; border-radius:var(--r); flex:none}
.pair-shot small{display:block; font-weight:400; color:var(--muted); font-size:11.5px; line-height:1.3}
.pair-meta{flex-basis:100%}
.pair-acts{display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px}

/* ---- ペン入れ ---- */
.ink-toggle svg{width:16px; height:16px; flex:none}
.ink-toggle.on,.ink-toggle.on:not(:disabled):hover{background:var(--navy); color:#fff; border-color:var(--navy)}
.ink-bar{display:flex; flex-direction:column; gap:8px; margin:0 0 12px; padding:10px 12px;
  background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r)}
.ink-kinds{display:flex; flex-wrap:wrap; gap:6px}
.ink-kind{display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:5px 10px; font-size:13px; font-weight:700;
  background:#fff; color:var(--ink); border:1px solid var(--line-in); border-radius:var(--r)}
.ink-kind i{width:12px; height:12px; border-radius:var(--r); background:var(--kc); display:inline-block; flex:none}
.ink-kind small{font-weight:600; color:var(--muted); font-size:12px}
.ink-kind.on{border-color:var(--navy); box-shadow:inset 0 0 0 1px var(--navy), inset 0 -3px 0 var(--kc)}
.ink-opts{display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px}
.ink-opt{display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:var(--muted); white-space:nowrap}
.ink-opt input[type=number]{width:72px; min-height:36px; padding:5px 8px; font-size:15px; border:1px solid var(--line-in); border-radius:var(--r); background:#fff}
.ink-opt input[type=range]{width:110px}
.ink-mini{min-height:36px; padding:5px 12px; font-size:13px}
.ink-status{margin-left:auto}
.ink-canvas{position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:3}
.ink-canvas.on{pointer-events:auto; touch-action:none; cursor:crosshair}
.ink-dot{display:inline-block; width:10px; height:10px; border-radius:var(--r); background:var(--kc); margin-right:6px; vertical-align:-1px}

/* ---- PDF→CAD の結果（左線の箱） ---- */
.pdf-box,.base-box{margin-top:12px; padding:12px; border:1px solid var(--line); border-left:4px solid var(--navy-2); border-radius:var(--r); background:var(--surface-2)}
.pdf-head{display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; font-size:14px}
.pdf-tag{font-size:12px; font-weight:800; letter-spacing:.08em; color:var(--teal)}
.pdf-tag.warn{color:var(--warn)}
.pdf-info{margin:4px 0 8px}
.pdf-warn{margin:8px 0 0; padding:6px 10px; font-size:13px; color:var(--ink); background:var(--warn-tint); border-left:4px solid var(--warn); border-radius:var(--r)}

/* ---- 入口の選択（A: CAD / B: PDF / C: 3Dから作る） ---- */
.entry-pick{display:grid; grid-template-columns:minmax(0,1fr); gap:8px; margin:0 0 14px}
.entry-opt{display:flex; align-items:center; gap:10px; width:100%; min-width:0; min-height:56px; text-align:left; padding:8px 12px;
  border:1px solid var(--line-in); border-radius:var(--r); background:#fff}
.entry-opt b{flex:none; width:26px; height:26px; display:grid; place-items:center; border-radius:var(--r);
  border:1px solid var(--line-in); color:var(--muted); font-size:13px; font-weight:800}
.entry-opt span{display:flex; flex-direction:column; min-width:0; line-height:1.4}
.entry-opt strong{font-size:14px; font-weight:700}
.entry-opt small{font-size:12px; color:var(--muted)}
@media (hover:hover){ .entry-opt:hover{border-color:var(--ink)} }
.entry-opt.on{border-color:var(--navy); box-shadow:inset 0 0 0 1px var(--navy)}
.entry-opt.on b{background:var(--navy); border-color:var(--navy); color:#fff}
@media (min-width:861px){ .entry-pick{grid-template-columns:repeat(3,minmax(0,1fr))} }

/* ---- 入口C: ベース画像 ---- */
.base-head{display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; margin-bottom:8px}
.base-head b{font-size:14px}
/* 画像の箱に余白を足さない（通り芯のタップ位置を画像の割合で読む） */
.base-stage{position:relative; background:#fff; border:1px solid var(--line); border-radius:var(--r); overflow:hidden; cursor:crosshair}
.base-stage img{display:block; width:100%; height:auto}
.base-marks{position:absolute; inset:0; pointer-events:none}
.base-marks i{position:absolute; top:0; bottom:0; width:0; border-left:2px dashed var(--mark)}
.base-marks i span{position:absolute; bottom:4px; left:4px; font-style:normal; font-size:12px; font-weight:700; line-height:18px; padding:0 6px;
  background:var(--mark); color:#fff; white-space:nowrap}
.base-marks i.r span{left:auto; right:4px}
.base-hint{margin:8px 0 10px}
.field.base-flipf .base-flip{display:flex; flex-wrap:wrap; gap:14px; min-height:40px; align-items:center}
.field.base-flipf .base-flip label.chk{display:inline-flex; align-items:center; gap:6px; font-size:14px; font-weight:400; white-space:nowrap}

/* ---- 点群ビューア ---- */
.pcd-list{display:flex; flex-direction:column; border-top:1px solid var(--line)}
.pcd-item{display:flex; flex-direction:column; align-items:flex-start; gap:0; width:100%; text-align:left;
  padding:9px 10px; background:#fff; border:0; border-bottom:1px solid var(--line); border-left:4px solid transparent; border-radius:0}
@media (hover:hover){ .pcd-item:hover{background:var(--surface-2)} }
.pcd-item.sel{border-left-color:var(--teal); background:var(--teal-tint)}
.pcd-item .pl{font-size:14px; font-weight:700}
.pcd-item .pm{font-size:12px; color:var(--muted); overflow-wrap:anywhere}
.pcd-item.result .pl::before{content:""; display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--mark); margin-right:7px; vertical-align:2px}
#pcdCanvas{width:100%; display:block}
#pcdStage .placeholder{color:#c5d2dc}
.depth-stats{margin-top:12px; border-top:1px solid var(--line)}
.depth-stats .ds-row{display:flex; justify-content:space-between; align-items:baseline; gap:10px; padding:6px 0; font-size:13px; border-bottom:1px solid var(--line)}
.depth-stats .ds-row b{font-size:14px}
.depth-stats .ds-sub{font-size:13px; font-weight:800; margin:12px 0 6px}
.depth-stats .ds-note{font-size:12.5px; color:var(--muted); margin-top:8px; line-height:1.7}
.ftable{width:100%; border-collapse:collapse; font-size:12.5px}
.ftable th{padding:5px 4px; font-size:12px; font-weight:700; background:var(--surface-2); border-bottom:2px solid var(--ink)}
.ftable td{padding:5px 4px; text-align:center; border-bottom:1px solid var(--line)}

/* ---- 転記前 / 転記後 の見比べ ---- */
.ba-card{max-width:880px; margin:0 auto 20px}
.ba-head{display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:10px}
.ba-head h2{font-size:15px; font-weight:800; margin:0}
.ba-toggle{display:inline-flex; border:1px solid var(--line-in); border-radius:var(--r); overflow:hidden}
.ba-toggle button{appearance:none; border:0; border-radius:0; background:#fff; color:var(--ink); font-size:13px; font-weight:700; padding:6px 14px; min-height:36px}
.ba-toggle button + button{border-left:1px solid var(--line-in)}
.ba-toggle button.on{background:var(--navy); color:#fff}
.ba-toggle button:focus-visible{outline-offset:-3px}
.ba-toggle-s3{margin:0 0 8px}
.ba-faces{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px}
.ba-faces button{appearance:none; min-height:34px; border:1px solid var(--line-in); background:#fff; color:var(--ink); font-size:13px; padding:5px 10px; border-radius:var(--r)}
.ba-faces button.on{border-color:var(--navy); box-shadow:inset 0 0 0 1px var(--navy); font-weight:700}
.ba-faces button b{color:var(--mark); font-weight:800; margin-left:4px}
/* 2枚の画像をぴったり重ねる（境目は画面上の割合で切る） */
.ba-stage{position:relative; overflow:hidden; background:#fff; border:1px solid var(--line); border-radius:var(--r); height:min(56vh, 520px)}
.ba-zoom{position:absolute; inset:0; transform-origin:0 0; transition:transform .25s ease}
.ba-zoom img{position:absolute; inset:0; width:100%; height:100%; object-fit:contain; display:block}
.ba-line{position:absolute; top:0; bottom:0; width:2px; margin-left:-1px; background:var(--navy); pointer-events:none}
.ba-tag{position:absolute; top:8px; font-size:12px; line-height:20px; padding:0 8px; background:var(--navy); color:#fff}
.ba-tag.l{left:8px} .ba-tag.r{right:8px}
.ba-range{width:100%; margin:10px 0 0}
.ba-note{margin:10px 0 0}

/* ---- 写真の位置合わせ（ダイアログ） ---- */
.al-dlg{position:fixed; inset:0; z-index:60; display:flex; align-items:flex-start; justify-content:center;
  padding:16px; background:rgba(6,19,31,.6); overflow-y:auto}
body.al-open{overflow:hidden}
.al-card{width:100%; max-width:1180px; background:#fff; border-radius:var(--r); padding:18px; box-shadow:var(--shadow)}
.al-head{display:flex; align-items:center; justify-content:space-between; gap:12px}
.al-head h2{margin:0; font-size:17px; font-weight:800}
.al-msg{margin:8px 0 12px; font-size:14px}
.al-msg.warn{padding:6px 10px; background:var(--warn-tint); border-left:4px solid var(--warn); border-radius:var(--r)}
.al-view{background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r); overflow:auto; max-height:62vh}
.al-view img{display:block; width:100%; height:auto}
.al-note{margin:8px 0 0}
.al-pair{display:grid; grid-template-columns:minmax(0,1fr); gap:12px; margin-top:12px}
.al-pair figure{margin:0; min-width:0}
.al-pair figcaption{font-size:13px; font-weight:700; margin-bottom:4px}
/* 画像の箱に余白を足さない（タップ位置を画像の割合で読む） */
.al-pick{position:relative; border:1px solid var(--line); border-radius:var(--r); overflow:hidden; background:var(--surface-2); cursor:crosshair}
.al-pick img{display:block; width:100%; height:auto}
.al-dots{position:absolute; inset:0; pointer-events:none}
.al-dots i{position:absolute; min-width:22px; height:22px; margin:-11px 0 0 -11px; padding:0 5px; border-radius:11px;
  background:var(--mark); color:#fff; font-style:normal; font-size:12px; font-weight:700; line-height:22px; text-align:center;
  box-shadow:0 0 0 2px #fff}
/* ---- 使い方（マニュアル）のダイアログ ---- */
.help-card{max-width:860px}
.help-sec{margin-top:18px; padding-top:16px; border-top:1px solid var(--line)}
.help-sec h3{margin:0 0 10px; font-size:15px; font-weight:800}
.help-sec h3 small{margin-left:8px; font-size:12.5px; font-weight:600}
.help-video{display:block; width:100%; aspect-ratio:16/9; height:auto; background:var(--stage); border-radius:var(--r)}
.help-note{margin:0 0 12px; font-size:13.5px}
.help-pdf{display:inline-flex; align-items:center; text-decoration:none}
.al-actions{display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin-top:14px}
@media (min-width:900px){ .al-pair{grid-template-columns:minmax(0,1fr) minmax(0,1fr)} .al-dlg{padding:32px} }

/* =====================================================================
   幅ごとの調整（上の定義より後ろに置く。同じ詳細度なら後ろが勝つ）
   JS 側の 1カラム判定は 860px（app.js・tenkaizu.js）。境目を変えるときは JS も直す
   ===================================================================== */

/* デスクトップ: 点群ビューアは1画面に収める */
@media (min-width:861px){
  #view3d.layout{height:calc(100vh - var(--h-appbar) - 122px); min-height:520px; align-items:stretch}
  #view3d .sidebar{align-self:stretch; overflow-y:auto}
  #view3d .viewer{min-height:0; display:flex; flex-direction:column; overflow:hidden}
  #view3d .viewer-head{flex-wrap:nowrap}
  #view3d .stage{flex:1 1 auto; min-height:0}
  #view3d #pcdCanvas{height:100%; max-height:100%; object-fit:contain}
  #view3d #pcdResult{flex:0 0 auto; max-height:42%; overflow:auto; margin-top:12px}

  /* Step 3: 割り当てている間は図面を見えたままにする（結果の表が出たら通常の流れに戻す） */
  #viewdxf .viewer:has(#t_result[hidden]){position:sticky; top:calc(var(--h-appbar) + 12px); min-height:0}

  /* Step 2: 写真を大きく保ち、表は下に続ける */
  #view2d .viewer{display:flex; flex-direction:column}
  #view2d #stage{flex:0 0 auto; min-height:62vh; display:flex; align-items:center; justify-content:center}
  #view2d #image{max-height:62vh}
}

/* iPad 横（861〜1200px）: サイドを少し細く */
@media (min-width:861px) and (max-width:1200px){
  :root{--w-side:320px}
  .layout{gap:14px; padding:0 14px}
  .stepper{padding:0 14px}
  .sidebar{padding:14px}
  .viewer{padding:16px}
  .shot-btn{font-size:13px; padding:8px 4px}
}

/* 手順の補足は幅が足りないときは出さない */
@media (max-width:1100px){
  .step-label small{display:none}
}

/* 1カラム（iPad 縦・スマホ） */
@media (max-width:860px){
  .layout{grid-template-columns:minmax(0,1fr); margin:14px auto 28px}
  .gallery{grid-template-columns:repeat(4,1fr)}
  .actions{width:100%; justify-content:flex-start}
  .actions>*{flex:1 1 auto; white-space:nowrap}
  .ctable{font-size:13px}
  .ctable th,.ctable td{padding:7px 6px}
  .proj-flow{max-width:none}
  .ba-stage{height:56vh}
  .brand-text small{display:none}
  .izu-mark,.appbar-sep{display:none}
  .viewer{min-height:0}
  /* 幅の狭い画面では、写真・図面を上、設定と一覧を下に置く（2026-11-21 修正指示 第2版 U-10）。
     Step 2 は、写真を開いているときだけ（開く前は「写真を撮る・選ぶ」が先頭） */
  #viewdxf > .viewer{order:-1}
  #view2d .layout:has(#stage:not(.empty)) > .viewer{order:-1}
  /* 並べ替えた枠では、線を引くたびにブラウザが表示位置を合わせ直して写真が上へ跳ぶのを止める */
  #view2d .layout, #viewdxf{overflow-anchor:none}
}

@media (max-width:640px){
  :root{--h-appbar:50px}
  .appbar{padding:0 12px; gap:8px}
  .brand{gap:8px}
  .brand-text strong{font-size:11.5px}
  .appbar-nav{gap:2px}
  /* 狭い幅では枠を外して文字だけにする（製品名と重ならないように） */
  .ghost-btn{padding:5px 3px; font-size:12px; border-color:transparent; text-decoration:underline; text-underline-offset:3px}
  .nav-long{display:none}
  .stepper{grid-template-columns:repeat(2,minmax(0,1fr)); margin-top:12px; padding:0 14px}
  .step{min-height:48px; padding:6px 10px; gap:8px}
  .step:first-child,.step:last-child{border-radius:0}
  .step:nth-child(odd){border-left:1px solid var(--line-in)}
  .step:nth-child(n+3){border-top:0}
  .step.active{border-color:var(--navy)}
  .step-label b{font-size:13px}
  .proj-wrap,.layout{padding:0 14px}
  .proj-card{padding:16px}
  .sidebar,.viewer{padding:14px}
  .proj-title{font-size:20px}
  .step-next .primary{width:100%; min-width:0}
  .out-item{align-items:stretch; flex-direction:column; gap:8px}
  .out-item .secondary{width:100%}
  .al-actions .primary,.al-actions .secondary{flex:1 1 100%}
  .row2{flex-wrap:wrap}
  .row2 .field{flex:1 1 140px}
  .t-custom .row2 .field{flex:1 1 100%}
}

@media (max-width:389px){
  .brand-text strong{font-size:12px}
}

/* タッチ端末（iPad・スマホ）: 押しやすい大きさに。16px 未満の入力欄は iOS が拡大する */
@media (pointer:coarse){
  .primary,.secondary,.ghost-btn,.izu-mark,.ink-kind,.ba-toggle button,.ba-faces button,.pj-del,.pj-open{min-height:44px}
  .proj-cta,.step-next .primary{min-height:46px}
  .trow .tr-align .secondary,.trow .tr-pick{min-height:44px}
  .link-btn{min-height:44px; display:inline-flex; align-items:center}
  .trow .tr-sub .link-btn{padding:0 6px; min-height:44px}
  .collapse summary{min-height:44px; align-items:center}
  .field input,.field select,.t-custom .field input,.t-custom .field select,
  .trow select,.trow input,.t-face .tf-grid input,.ink-opt input[type=number],.meas-in{min-height:44px; font-size:16px}
  .field input[type=range],.ink-opt input[type=range]{min-height:44px}
  .field input[type=checkbox],.trow .tr-ai input{width:22px; height:22px; min-height:0}
  .trow .tr-sub label.tr-ai{min-height:44px; padding-bottom:0}
  .switch-row{min-height:44px}
  .ba-range{min-height:44px}
  .field.base-flipf .base-flip label.chk{min-height:44px}
  .meas-in{width:84px}
  .gcheck{width:40px; height:40px}
  .switch{width:52px; height:30px}
  .switch::after{top:4px; left:4px; width:22px; height:22px}
  .switch:checked::after{left:26px}
  .shoot-note a{display:inline-flex; align-items:center; min-height:44px}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition:none !important; scroll-behavior:auto !important}
}

/* ---- 未入力で先に進めない／進むと困る欄（縮尺・ペン入れの幅） ---- */
#p_pdfScale.need,.itable .ink-w.need{border-color:var(--danger); box-shadow:0 0 0 1px var(--danger)}
.itable .ink-w{width:84px; min-height:36px; padding:4px 6px; font-size:16px}
.itable .ink-src{max-width:160px; min-height:36px; font-size:14px}
.trow .tr-est{font-size:12.5px; color:var(--warn); margin:2px 0 4px}
/* 面の枠（図面の上）とドラッグ中の枠 */
.t-facebox{position:absolute; border:1.5px dashed var(--navy-2); box-sizing:border-box; pointer-events:none}
.t-facebox span{position:absolute; left:0; top:0; font-size:11px; line-height:16px; padding:0 4px; background:rgba(255,255,255,.85); color:var(--navy)}
.t-facebox.drag{border:2px solid var(--teal); background:rgba(8,119,119,.10)}
.t-stage.picking .t-facebox span{display:none}
.t-stage.dragging,.t-stage.dragging img{cursor:crosshair; touch-action:none}
.t-face .tf-drag{margin-top:4px}
.t-faces .tf-add{margin-top:6px}

/* 10/13 改修依頼 #17〜#22 */
.field.field-check{display:flex; flex-direction:row; align-items:flex-start; gap:8px; padding-top:22px}
.field.field-check span{font-weight:400}
.t-check{margin:0 0 12px; padding:10px 12px; background:var(--warn-tint); border-left:4px solid var(--warn); border-radius:var(--r); font-size:13.5px}
.t-check-head{margin:0 0 6px}
.t-check-list{list-style:none; margin:0; padding:0; max-height:280px; overflow:auto}
.t-check-list li{display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 10px; padding:5px 0; border-top:1px solid rgba(138,97,0,.18)}
.t-check-list li span{font-weight:600}
.t-check-list li span small{font-weight:400; color:var(--muted); margin-left:6px}
.t-check-list li em{font-style:normal; color:var(--warn)}
.t-check-list li .link-btn{margin-left:auto}
.trow.flash{outline:2px solid var(--warn); outline-offset:2px}
.pen-card{max-width:560px}
.pen-q{margin:0 0 14px}
.pen-q p{margin:0 0 6px}
.pen-q label{display:flex; align-items:flex-start; gap:8px; padding:6px 0; font-size:14px; line-height:1.5}
.pen-q label small{display:block}
.pen-q input[type=radio]{margin-top:4px; flex:none}
.ba-stage.face{height:min(78vh, 860px)}

/* 案件保存、チョーク確認、原画の部分拡大 */
.project-savebar{display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:8px 24px;border-bottom:1px solid var(--line);background:#fff;font-size:13px}
.project-savebar span{overflow-wrap:anywhere}.project-savebar .warn{color:#a23324}
.project-savebar button{flex-shrink:0}
.chalk-review{margin:16px 0;padding:16px;border:1px solid var(--line);background:#fff}
.chalk-review-head,.chalk-review-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.chalk-review-head{justify-content:space-between}
.chalk-review-row{border-top:1px solid var(--line);padding:12px 0}
.chalk-review-row p{margin:0 0 8px;overflow-wrap:anywhere}
.chalk-review-inputs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:10px}
.chalk-review-inputs label{display:flex;flex-direction:column;gap:4px;font-size:13px}
.chalk-review-inputs input,.chalk-review-inputs select{width:100%;min-width:0}
.karte-files{margin:12px 0}.karte-files a{display:inline-block;margin:0 16px 8px 0}
.photo-zoom-dialog{width:min(960px,94vw);max-height:94dvh;border:1px solid var(--line);border-radius:2px;padding:18px;color:var(--ink);background:#fff;overflow:auto}
.photo-zoom-dialog::backdrop{background:rgba(13,34,49,.65)}
.photo-zoom-head,.photo-zoom-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.photo-zoom-head h2{font-size:18px;margin:0}.photo-zoom-tools{justify-content:flex-start;flex-wrap:wrap}
.photo-zoom-tools label{display:flex;align-items:center;gap:8px}
#photoZoomCanvas{display:block;max-width:100%;max-height:65dvh;width:auto;height:auto;margin:auto;touch-action:none;cursor:crosshair}
#photoZoomStatus{font-size:13px;min-height:1.5em}
#photoZoomDraw[aria-pressed="true"]{border-color:var(--accent);color:var(--accent)}
@media(max-width:600px){.project-savebar{padding:8px 12px;align-items:flex-start}.chalk-review-inputs{grid-template-columns:repeat(2,minmax(0,1fr))}.chalk-review-actions button{flex:1}.photo-zoom-dialog{padding:12px}.photo-zoom-head h2{font-size:15px}.pj-card{flex-wrap:wrap}.chalk-review{padding:12px}}
.ink-opt input#inkMinCm{width:56px}
@media (max-width:860px){
  .field.field-check{padding-top:0}
  .t-check-list li .link-btn{margin-left:0; min-height:44px}
}
.itable tr.ink-short td{color:var(--muted)}

.photo-record-panel{background:var(--panel,#fff); border:1px solid var(--line); border-radius:8px; padding:14px 16px; margin:12px 0}
.photo-record-panel h2{font-size:16px; margin:0 0 4px}.photo-record-panel p{margin:0 0 8px}
.photo-record-panel .field{max-width:260px; margin:8px 0}
.photo-record-panel a,.photo-record-panel button{display:inline-flex; margin:4px 4px 4px 0}
.photo-record-panel [hidden]{display:none}.photo-record-panel [role=status]{display:block}
.itable .ink-k{width:72px; padding:5px; font-size:16px}
.photo-only .step[data-view=viewdxf],.photo-only .step[data-view=viewout],.photo-only #detectBtn,.photo-only #reportBtn,.photo-only #go_dxf,.photo-only #galleryBlock{display:none}
.photo-only .stepper{grid-template-columns:repeat(2,minmax(0,1fr))}
.photo-only .detection-settings{display:none}
@media(min-width:861px){.entry-pick{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ---- 写真から3D（2026-11-10） ---- */
.p3-box{margin:14px 0 0; padding:14px 0 0; border-top:1px solid var(--line)}
.p3-lead{margin:0 0 10px; font-size:13px; line-height:1.7}
.p3-lead b{display:block; font-size:13.5px}
.p3-msg{margin:10px 0 0; font-size:13px}
.p3-msg.warn{color:var(--mark)}
.p3-ok{font-size:13px; font-weight:700; color:var(--teal-d)}
.p3-span{align-self:end; margin:0 0 16px; font-size:12.5px}
.p3-span.ok{color:var(--teal-d); font-weight:700}
#pcdStage{position:relative}
.pcd-labels{position:absolute; inset:0; pointer-events:none; overflow:hidden}
.pcd-label{position:absolute; transform:translate(-50%,-135%); padding:3px 8px; background:#fff; color:var(--navy);
  border:1px solid var(--navy); border-radius:var(--r); font-size:12.5px; font-weight:700; line-height:1.4; white-space:nowrap;
  pointer-events:auto; cursor:pointer}
.pcd-label::after{content:""; position:absolute; left:50%; top:100%; width:1px; height:9px; background:var(--navy)}
.pcd-label.sel{background:var(--navy); color:#fff}
@media (hover:hover){ .pcd-label:hover{background:var(--teal-tint)} .pcd-label.sel:hover{background:var(--navy)} }
#pcdLinesBody tr{cursor:pointer}
#pcdLinesBody tr.sel td{background:var(--teal-tint)}
#pcdLinesBlock .chk{margin-top:10px}

/* ヘッダのボタンが3つになったので、狭い幅では製品名の前の印を外して名前を欠けさせない */
@media (max-width:420px){ .brand-mark{display:none} }

/* 割当: 転記に使わない写真（行を削除した写真）を一覧の末尾に畳んで出す */
.t-skipped{margin-top:10px; border-top:1px solid var(--line); padding-top:8px; font-size:13px}
.t-skipped summary{cursor:pointer; color:var(--muted); padding:4px 0}
.t-skip-row{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:6px 0; border-top:1px solid var(--line)}
.t-skip-row span{min-width:0; overflow-wrap:anywhere}
.t-skip-row .link-btn{flex:none}
/* 転記前の確認: 幅の下限で対象外になる線の一覧 */
.pen-wlist{margin:0 0 8px; padding-left:1.2em; max-height:180px; overflow:auto; font-size:13.5px; line-height:1.7}
/* 転記の設定: 説明の長いチェック欄は横に並べず縦に積む（左の列は幅が狭い） */
.t-checks{display:flex; flex-direction:column; gap:2px; margin:2px 0 10px}
.t-checks .field.field-check{padding-top:6px}
.t-checks .field.field-check small{display:block}
/* チョーク取り込み: 採用しなかった線（候補・外した線）の一覧 */
.chalk-extra-row{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; border-top:1px solid var(--line); padding:8px 0; font-size:13.5px}
.chalk-extra-acts{display:flex; align-items:center; gap:12px; flex:none}
/* ペン入れの一覧: まとめて外す */
.ink-bulk{margin:10px 0 4px; border-top:1px solid var(--line); padding-top:8px; font-size:13.5px}
.ink-bulk summary{cursor:pointer; padding:4px 0}
.ink-bulk-row{display:flex; align-items:center; gap:10px; padding:6px 0; border-top:1px solid var(--line)}
.ink-bulk-row input{width:18px; height:18px; flex:none}
.ink-bulk button{margin:8px 0 4px}
.ocr-rules-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:6px 0 4px}
.ocr-rules-grid label{display:flex;flex-direction:column;gap:4px;font-size:13px;min-width:0}
.ocr-rules-grid input,.ocr-rules-grid select{width:100%;min-width:0;min-height:40px}
.ocr-rules-grid .wide{grid-column:1/-1}
.ocr-rules summary{min-height:40px;display:flex;align-items:center}
#inkReread{min-height:40px}
@media(max-width:600px){.ocr-rules-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ocr-rules-grid label:first-child{grid-column:1/-1}}
/* まとめて取り込む */
.chalk-batch{margin-top:10px; border:1px solid var(--line); background:#fff; padding:14px}
.chalk-batch p{margin:0 0 10px; font-size:13.5px; line-height:1.7}
.cb-table td,.cb-table th{font-size:13px; white-space:nowrap}
.cb-table td.cb-name{white-space:normal; overflow-wrap:anywhere; min-width:110px}
.cb-table td.cb-need{font-weight:700; color:#b4532a}
.cb-table input{width:18px; height:18px}
.cb-table .link-btn{min-height:40px; padding:0 6px}   /* 「開く」「やり直す」を指で押せる大きさに（U-10 の 2） */
.chalk-batch .table-wrap{margin-top:0; overflow-x:auto}
/* 画面内のお知らせ（閉じるまで残る帯）。標準の alert の代わり */
.ui-notices{position:fixed; left:16px; right:16px; bottom:16px; z-index:80; display:flex; flex-direction:column; gap:8px; align-items:center; pointer-events:none}
.ui-notice{pointer-events:auto; width:100%; max-width:720px; display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
  background:#fff; border:1px solid var(--line); border-left:4px solid #b4532a; border-radius:var(--r); padding:12px 14px; box-shadow:var(--shadow)}
.ui-notice.info{border-left-color:var(--teal)}
.ui-notice p{margin:0; font-size:14px; line-height:1.7; white-space:pre-line; overflow-wrap:anywhere}
.ui-notice .link-btn{flex:none}
.ui-dlg-body p{white-space:pre-line; line-height:1.7}
.ui-history{margin-top:24px; font-size:13.5px}
.ui-history summary{cursor:pointer; padding:6px 0}
.ui-history-row{border-top:1px solid var(--line); padding:8px 0}
.ui-history-row p{margin:2px 0 0; white-space:pre-line; overflow-wrap:anywhere}
/* 案件の引き継ぎ用のリンク */
.share-box{margin:0 0 16px; padding:14px; border:1px solid var(--line); background:#fff; max-width:640px}
.share-box p{margin:0 0 8px; font-size:13.5px; line-height:1.7}
.share-box input{width:100%; min-height:40px; padding:6px 8px; font-size:13px}
/* 要確認の一覧・順に見るときの帯・ステップの件数 */
.todo-open{margin-left:auto; border-color:#b4532a; color:#b4532a}
.todo-rows{max-height:52vh; overflow:auto; border-top:1px solid var(--line)}
.todo-row{display:flex; align-items:flex-start; justify-content:space-between; gap:14px; border-bottom:1px solid var(--line); padding:10px 0; font-size:14px; line-height:1.6}
.todo-row > span{display:flex; flex-direction:column; min-width:0; overflow-wrap:anywhere}
.todo-row b{font-size:12px; letter-spacing:.08em; color:#b4532a}
.todo-row .link-btn{flex:none}
.todo-bar{position:fixed; left:0; right:0; bottom:0; z-index:70; display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap;
  padding:10px 16px; background:var(--navy); color:#fff; font-size:14px; line-height:1.6}
.todo-bar-acts{display:flex; align-items:center; gap:14px; flex:none}
.todo-bar .link-btn{color:#fff}
.step-todo{display:block; margin-top:2px; font-size:11.5px; font-weight:700; color:#b4532a}
.trow.todo-hit,.chalk-review-row.todo-hit{outline:2px solid #b4532a; outline-offset:2px}
/* 写真から3D: Pコンの直径（縮尺の根拠に使う。現場の規格に合わせて変えられる） */
.p3-dia{display:inline-flex; align-items:center; gap:8px; font-size:13px; color:var(--muted)}
.p3-dia input{width:76px; min-height:34px; padding:4px 6px}
/* ---- AI検出の線を確かめる（Step 3。修正指示 第2版 U-3） ---- */
.trow .tr-aiRev{grid-column:1/-1; display:flex; flex-wrap:wrap; align-items:center; gap:8px}
.trow .tr-aiRev .secondary{min-height:34px; padding:5px 12px; font-size:13px}
.trow .tr-aiState{font-size:12.5px; color:var(--warn)}
.trow .tr-aiState.ok{color:var(--ok); font-weight:700}
#ai_title small{margin-left:8px; font-size:13px; font-weight:600}
#ai_close{white-space:nowrap; flex:none}
.ai-rev{display:grid; grid-template-columns:minmax(0,1fr); gap:12px}
/* 箱を写真の大きさに合わせる（線の重ね＝写真の割合で置く）。縦長の写真も1画面に収める */
.ai-pick{position:relative; align-self:start; justify-self:start; width:fit-content; max-width:100%;
  border:1px solid var(--line); border-radius:var(--r); overflow:hidden; background:var(--surface-2)}
.ai-pick img{display:block; width:auto; max-width:100%; height:auto; max-height:70vh}
.ai-svg{position:absolute; inset:0; width:100%; height:100%}
.ai-ln polyline{fill:none; stroke-linecap:round; stroke-linejoin:round}
.ai-ln .halo{stroke:#fff; stroke-width:6; opacity:.9}
.ai-ln .main{stroke:#e07a00; stroke-width:3; stroke-dasharray:7 5}
.ai-ln.accept .main{stroke:var(--mark); stroke-dasharray:none}
.ai-ln.reject .main{stroke:#7d8a96; stroke-dasharray:2 4}
.ai-ln.reject .halo{opacity:.5}
.ai-ln.sel .halo{stroke-width:11}
.ai-ln.sel .main{stroke-width:5}
.ai-ln .hit{stroke:transparent; stroke-width:22; pointer-events:stroke; cursor:pointer}
.ai-tags{position:absolute; inset:0; pointer-events:none}
.ai-tag{position:absolute; transform:translate(6px,-50%); padding:1px 5px; border:1.5px solid #e07a00; border-radius:var(--r);
  background:#fff; color:#8a4a00; font-style:normal; font-size:12px; font-weight:800; line-height:16px; white-space:nowrap}
.ai-tag.accept{border-color:var(--mark); color:var(--mark)}
.ai-tag.reject{border-color:#7d8a96; color:#56667a}
.ai-tag.sel{background:var(--navy); border-color:var(--navy); color:#fff}
.ai-legend{margin:0 0 8px; font-size:12.5px}
.ai-list{margin:0; padding:0; list-style:none; max-height:44vh; overflow-y:auto; border-top:1px solid var(--line)}
.ai-row{display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:8px; padding:6px 4px; border-bottom:1px solid var(--line)}
.ai-row.sel{background:var(--warn-tint)}
.ai-name{font-weight:800; min-width:40px; text-align:left}
.ai-st{font-size:12.5px; color:var(--warn)}
.ai-st.accept{color:var(--ok); font-weight:700}
.ai-st.reject{color:var(--muted)}
.ai-act{display:flex; gap:6px}
.ai-act .secondary{min-height:34px; padding:4px 10px; font-size:13px}
.ai-act .secondary.on{background:var(--navy); border-color:var(--navy); color:#fff}
@media (min-width:900px){ .ai-rev{grid-template-columns:minmax(0,1fr) 340px} .ai-list{max-height:60vh} }
@media (pointer:coarse){ .trow .tr-aiRev .secondary,.ai-act .secondary{min-height:44px} }
/* 2本の指で拡大・移動（pinch.js。2026-11-21 修正指示 第2版 U-10 の 3）。
   枠の上ではページ全体の拡大をさせない（1本指のスクロールは残す）。拡大中は1本指も枠の中で扱う */
.pinch-view{touch-action:pan-x pan-y}
.pinch-view.zoomed{touch-action:none}
.pinch-live{transition:none !important}
.zoom-reset{position:absolute; right:8px; bottom:8px; z-index:6; min-height:40px; padding:6px 14px; font-size:13px}
.al-view.zoomed{overflow:hidden}
.al-view{position:relative}   /* 「全体」ボタンを枠の右下に置く（市松の確認画像） */
/* 拡大しても、置いた点・面のラベル・通り芯の名前は画面上の大きさのまま（--zk は pinch.js が入れる倍率） */
.pinch-view .al-dots i{transform-origin:11px 11px; scale:calc(1 / var(--zk, 1))}
.pinch-view .t-foot span{transform-origin:0 100%; scale:calc(1 / var(--zk, 1))}
.pinch-view .t-foot i{transform-origin:5px 5px; scale:calc(1 / var(--zk, 1))}
.pinch-view .t-facebox span{transform-origin:0 0; scale:calc(1 / var(--zk, 1))}
.pinch-view.zoomed .t-facebox span{white-space:nowrap}   /* 小さく戻したラベルを細い枠の幅で折り返さない */
.pinch-view .base-marks i span{transform-origin:0 100%; scale:calc(1 / var(--zk, 1))}
.pinch-view .base-marks i.r span{transform-origin:100% 100%}
/* 図面の枠（修正指示 第2版 D-2・D-3）: 外形の頂点・円柱の 0° の位置をベース画像の上に重ねる */
.bf-box{margin:4px 0 12px; padding:10px 0 2px; border-top:1px solid var(--line)}
.bf-head{display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; margin-bottom:8px}
.bf-head b{font-size:14px}
.bf-mode{margin-bottom:6px}
.bf-state{margin:4px 0 6px; font-size:13px}
.bf-tools{margin:0 0 8px}
.bf-cyl > p{margin:4px 0 6px; font-size:13px}
.base-marks svg.bf-svg{position:absolute; inset:0; width:100%; height:100%; overflow:visible}
.bf-svg .bf-poly{fill:rgba(200,35,28,.08); stroke:var(--mark); stroke-width:2; vector-effect:non-scaling-stroke}
.bf-svg .bf-open{fill:none}
.bf-svg .bf-cand{fill:none; stroke:var(--navy-2); stroke-width:2; stroke-dasharray:6 4; vector-effect:non-scaling-stroke}
.bf-svg .bf-zero{stroke:var(--navy); stroke-width:2; vector-effect:non-scaling-stroke}
.bf-svg .bf-div{stroke:var(--navy-2); stroke-width:1.5; stroke-dasharray:4 4; vector-effect:non-scaling-stroke}
.base-marks b.bf-pt{position:absolute; width:12px; height:12px; margin:-6px 0 0 -6px; background:#fff; border:2px solid var(--mark)}
.base-marks b.bf-pt.first{background:var(--mark)}
.pinch-view .base-marks b.bf-pt{scale:calc(1 / var(--zk, 1))}

/* ---- 面の種類（修正指示 第2版 P-9）と確かさ（P-10） ---- */
.p3-kind{margin:0 0 10px; padding:0; border:0; min-width:0}
.p3-kind legend{padding:0; margin:0 0 6px; font-size:13px; font-weight:700}
.p3-kinds{display:flex; flex-wrap:wrap; gap:4px 18px}
.p3-kinds label{display:inline-flex; align-items:center; gap:6px; min-height:40px; font-size:14px; cursor:pointer}
.p3-kinds input{margin:0}
.p3-note{margin:4px 0 8px; font-size:12.5px; line-height:1.6}
.p3-curve{margin:0 0 12px; padding:10px 12px; border:1px solid var(--line); border-radius:var(--r); background:var(--card); max-width:560px}
.p3-curve .row2{flex-wrap:wrap}
.p3-curve .row2 .field{flex:1 1 140px}
.p3-low{display:inline-flex; align-items:center; gap:6px; min-height:40px; font-size:13.5px}
.p3-guideHead{margin:6px 0 2px; font-size:12.5px; font-weight:700}
.p3-guide{margin:0; padding-left:1.2em; font-size:12.5px; line-height:1.7; color:var(--ink-2)}
.p3-fit{margin:12px 0 0; padding:10px 12px; border:1px solid var(--line); border-radius:var(--r); background:var(--card); max-width:440px}
.p3-fitText{margin:0 0 6px; font-size:13px; line-height:1.6}
.p3-fitFig svg{display:block; width:100%; max-width:260px; height:auto; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r)}
.p3-fitKey{display:flex; flex-wrap:wrap; gap:2px 12px; margin:6px 0 0; font-size:12px; color:var(--muted)}
.p3-fitKey i{display:inline-block; width:14px; height:0; margin-right:5px; vertical-align:middle; border-top:2px solid}
.p3-fitWhy{margin:6px 0 0; padding-left:1.2em; font-size:12.5px; line-height:1.6; color:var(--mark)}
.base-qual{position:absolute; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible}
.base-acc{margin:8px 0 0}
.base-accText{margin:0 0 4px; font-size:13px; line-height:1.7}
.base-accText.warn{color:var(--warn)}
.base-accRow{display:flex; flex-wrap:wrap; align-items:center; gap:4px 16px; font-size:12.5px; color:var(--muted)}
.base-accRow label.chk{display:inline-flex; align-items:center; gap:6px; min-height:40px; font-size:13.5px; color:var(--ink)}
.base-key{display:inline-flex; align-items:center; gap:6px}
.base-key i{display:inline-block; width:14px; height:14px; border:1px solid}
.base-key .k-unv{border-color:#8a6100; background:repeating-linear-gradient(45deg, rgba(138,97,0,.55) 0 2px, rgba(138,97,0,.08) 2px 6px)}
.base-key .k-seam{border:2px solid var(--mark); border-radius:50%}
.p3-kinds input{accent-color:var(--teal)}

/* ---- 入口の 2 つの選択・展開図に 3D データを重ねる・複数の面（修正指示 第2版 L-1・L-7・L-8 の 2） ---- */
.p-posnote{margin:-6px 0 14px; padding:6px 10px; border-left:3px solid var(--line-in); max-width:46em}
.sf-guide{margin:0 0 10px; max-width:46em}
.sf-box{margin:4px 0 16px; padding:14px; border:1px solid var(--line); border-radius:var(--r); background:var(--card)}
.sf-head{display:flex; align-items:baseline; gap:10px; margin-bottom:6px}
.sf-msg{margin:6px 0}
.sf-msg.warn{padding:6px 10px; background:var(--warn-tint); border-left:4px solid var(--warn); color:var(--ink)}
.sf-fig{margin:10px 0 0; max-width:820px}
.sf-svgWrap{border:1px solid var(--line); background:#fff; overflow:hidden}
.sf-svgWrap svg{display:block; width:100%; height:auto; max-height:52vh}
.sf-ol{fill:none; stroke:#b8860b; stroke-width:2.2; vector-effect:non-scaling-stroke}
.sf-in{stroke:#1f5f8b; stroke-width:4; stroke-linecap:round; vector-effect:non-scaling-stroke}
.sf-out{stroke:#a7b1ba; stroke-width:3; stroke-linecap:round; vector-effect:non-scaling-stroke}
.sf-fp{fill:rgba(86,102,122,.10); stroke:#788a94; stroke-width:1; stroke-dasharray:4 3; vector-effect:non-scaling-stroke}
.sf-ph{fill:rgba(40,83,107,.12); stroke:#28536b; stroke-width:1.2; vector-effect:non-scaling-stroke}
.sf-v{fill:#fff; stroke:#b8860b; stroke-width:2; vector-effect:non-scaling-stroke; cursor:pointer}
.sf-v.on{fill:#b8860b}
.sf-vt{fill:var(--ink); text-anchor:middle; font-weight:700}
.sf-key{display:flex; flex-wrap:wrap; gap:6px 14px; margin:6px 0 0; font-size:12.5px; color:var(--muted)}
.sf-key span{display:inline-flex; align-items:center; gap:6px}
.sf-key i{display:inline-block; width:16px; height:0; border-top:3px solid}
.sf-key .k-ol{border-color:#b8860b} .sf-key .k-in{border-color:#1f5f8b} .sf-key .k-out{border-color:#a7b1ba}
.sf-key .k-fp{height:10px; border:1px dashed #788a94; background:rgba(86,102,122,.10)}
.sf-key .k-ph{height:10px; border:1px solid #28536b; background:rgba(40,83,107,.12)}
.sf-stat{margin:8px 0; font-size:14px}
.sf-segWrap{overflow-x:auto; margin:6px 0 10px; max-width:560px}
.sf-seg{border-collapse:collapse; font-size:13px; min-width:100%}
.sf-seg th, .sf-seg td{border-bottom:1px solid var(--line); padding:4px 8px; text-align:right; white-space:nowrap}
.sf-seg th:first-child, .sf-seg td:first-child{text-align:left}
.sf-size{margin:8px 0; padding:8px 12px; border:1px solid var(--warn); border-radius:var(--r); max-width:560px}
.sf-size legend{font-weight:700; font-size:13.5px; padding:0 4px}
.sf-size label{display:block; font-size:14px; padding:3px 0}
.sf-why{margin:6px 0; padding-left:1.2em; font-size:13.5px; color:var(--ink)}
.sf-tap{margin-top:10px}
.sf-tapStage{position:relative; display:inline-block; max-width:100%; border:1px solid var(--line)}
.sf-tapStage img{display:block; max-width:100%; height:auto; cursor:crosshair}
.sf-tapDots b{position:absolute; transform:translate(-50%,-50%); min-width:20px; height:20px; padding:0 4px; display:grid; place-items:center;
  background:var(--navy); color:#fff; font-size:12px; border-radius:var(--r); pointer-events:none}
.sf-list{list-style:none; margin:8px 0 0; padding:0; border-top:1px solid var(--line); max-width:560px}
.sf-list:empty{display:none}
.sf-list li{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 0; border-bottom:1px solid var(--line)}
.sf-list li span{display:flex; flex-direction:column; min-width:0}
.sf-list li small{color:var(--muted); font-size:12.5px}
.sf-multi{margin:12px 0 0; padding-top:10px; border-top:1px solid var(--line)}
/* 写真の貼り合わせを展開図に重ねる（修正指示 第2版 L-1・P-2 の 6） */
.sf-photo{margin:0 0 10px}
.sf-pdone{margin:6px 0 0; font-size:14px; max-width:46em}
/* 面の種類（修正指示 第2版 P-9 の 1・L-8 の 4）: 3D データの形からの初期値と、点検者の選び直し */
.shape-row{display:flex; flex-wrap:wrap; align-items:flex-end; gap:6px 14px; margin:0 0 14px}
.shape-row .field{flex:0 1 220px; min-width:0; margin:0}
.shape-note{flex:1 1 260px; margin:0 0 6px; line-height:1.6; max-width:46em}
.shape-note.warn{color:var(--warn)}
.sf-pShape{max-width:300px; margin:0 0 8px}
.sf-list li select.sf-shape{font-size:13px; padding:5px 28px 5px 8px; width:150px}
.sf-list li .sf-side{display:flex; align-items:center; gap:12px; flex:0 0 auto}
@media (max-width:480px){
  .sf-list li{flex-wrap:wrap}
  .sf-list li .sf-side{width:100%; justify-content:space-between}
}
.shot-ov{font-size:13px}
.sb.ov{width:auto; padding:0 5px; font-size:11.5px; color:#fff; background:#5b6770; border-color:#5b6770}
.al-cands{display:flex; flex-wrap:wrap; gap:8px; margin:0 0 12px}
.al-cands button{font-size:13px; text-align:left}

/* サーバ側の順番待ち（修正指示 第2版 U-7）: 進み具合・取り消し */
.job-panel{max-width:440px; margin:10px 0 0; padding:10px 12px; border:1px solid var(--line); border-left:4px solid var(--navy-2); border-radius:var(--r); background:var(--card)}
.job-text{margin:0; font-size:13px; line-height:1.6; overflow-wrap:anywhere}
.job-bar{height:6px; margin:8px 0; background:var(--surface-2); border-radius:var(--r); overflow:hidden}
.job-bar i{display:block; height:100%; width:0; background:var(--navy-2); transition:width .4s ease}
.job-note{margin:0 0 8px; font-size:12px}
.job-cancel{min-height:40px}
/* 転記の結果 → 3D と図面の画面（修正指示 第2版 D-7・U-11。画面の中身は wallview.css） */
.t-wall-link{display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; margin:12px 0 0}
.ctable tr.t-row-link{cursor:pointer}
@media (hover:hover){ .ctable tr.t-row-link:hover{background:var(--teal-tint)} }
