/* 足場拾い出し — focused field workspace */
:root{--paper:#f2f5f9;--card:#fff;--ink:#14243b;--ink2:#52647b;--line:#dbe3ee;--blue:#2466db;--blue-d:#184eb0;--yellow:#b9d1ff;--warn:#b83432;--ok:#147653;--r:16px;--rail:232px}
html{scroll-padding-top:104px}
body{font-family:"Zen Kaku Gothic New",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:16px;padding:0 0 110px;background:var(--paper);line-height:1.65}
button,a,input,select{-webkit-tap-highlight-color:transparent}
button{cursor:pointer;font-family:inherit;touch-action:manipulation}
button:focus-visible,a:focus-visible{outline:3px solid #7ca9ff;outline-offset:3px}
[hidden]{display:none!important}
.appbar{position:sticky;top:0;z-index:20;background:#12233d;color:#fff;padding:0;border-bottom:1px solid #263952}
.appbar-inner{max-width:1440px;margin:auto;min-height:80px;padding:0 40px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.brand{display:flex;align-items:center;gap:14px}
.brand-mark{display:grid;grid-template-columns:repeat(2,9px);gap:4px;padding:11px;border:1px solid #647992;border-radius:11px}
.brand-mark i{width:9px;height:9px;background:#b9d1ff;border-radius:1px}
.brand h1{font-size:21px;letter-spacing:.08em;font-weight:700}
.brand h1 small{font-size:12px;color:#afbed0;margin-top:1px;letter-spacing:.14em}
.app-version{font-size:12px;letter-spacing:.08em;color:#b8c8dc;border:1px solid #445772;padding:5px 10px;border-radius:6px;white-space:nowrap}
.header-project{font-size:14px;color:#d8e1ee;max-width:35%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.header-actions{display:flex;align-items:center;gap:12px;flex-shrink:0}
.appbar .manual-link{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:7px 12px;border:1px solid #647992;border-radius:7px;color:#fff;font-size:14px;font-weight:600;line-height:1.4;text-decoration:none;white-space:nowrap}
.appbar .manual-link:hover{background:#263952}
@media(max-width:800px){.header-actions{flex-direction:column;gap:3px}.appbar .manual-link{min-height:32px;padding:4px 10px}.header-actions .app-version{white-space:nowrap}}
.app-shell{display:grid;grid-template-columns:var(--rail) minmax(0,1fr);max-width:1440px;margin:auto;gap:40px;padding:30px 40px 0}
.workspace-rail{position:sticky;top:110px;align-self:start;display:flex;flex-direction:column;min-height:calc(100dvh - 240px)}
.rail-label{font-size:12px;font-weight:700;color:#687b94;letter-spacing:.16em;padding:0 14px 12px}
.workspace-nav{display:flex;flex-direction:column;gap:7px}
.workspace-nav button{display:flex;align-items:center;gap:13px;width:100%;background:transparent;color:#52647b;border:1px solid transparent;border-radius:10px;text-align:left;min-height:56px;padding:12px 14px;font-size:15px;font-weight:700}
.workspace-nav button:hover{background:#e8edf5}
.workspace-nav button[aria-selected=true]{background:#fff;color:#174d9e;border-color:#dbe3ee;box-shadow:0 3px 10px #20375906}
.nav-num{font-family:"IBM Plex Mono",monospace;font-size:12px;font-weight:500;color:#7386a0}
[aria-selected=true] .nav-num{color:#2466db}
.nav-count{margin-left:auto;border-radius:5px;background:#e9eef6;padding:0 6px;font-size:12px}
.rail-context{margin-top:28px;border-top:1px solid var(--line);padding:22px 14px;color:#687b94;font-size:13px;line-height:1.9}
.rail-context strong{display:block;font-size:14px;color:#344a66;font-weight:700;margin-bottom:6px}
.rail-help{margin-top:auto;padding:24px 14px 0;color:#6a7c91;font-size:12px}
.rail-help a{color:inherit;text-decoration:none;border-bottom:1px solid #a8b8cc}
.workspace-main{min-width:0;max-width:1048px;width:100%;padding-bottom:20px}
.view-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin:0 0 24px;padding:4px 0}
.view-heading .eyebrow{font-family:"IBM Plex Mono",monospace;letter-spacing:.12em;font-size:12px;font-weight:500;color:#687d99;margin-bottom:5px}
.view-heading h2{font-size:28px;line-height:1.45;font-weight:700;letter-spacing:.015em}
.view-heading p{font-size:14px;color:var(--ink2);margin-top:6px}
.view-status{font-size:13px;white-space:nowrap;color:#56708e;padding:6px 12px;border:1px solid #d5dfeb;border-radius:7px;background:#fff;margin-top:9px}
.step,.rcard{border:1px solid var(--line);padding:26px;margin:0 0 22px;box-shadow:0 3px 12px #20375904;border-radius:var(--r)}
.step h2,.rcard h2{font-size:17px;font-weight:700;gap:10px;margin-bottom:22px}
.step h2 .no,.rcard h2 .no{background:#edf2fa;color:#5d7596;font-size:12px;font-weight:500;border-radius:5px;padding:3px 8px}
#step1>h2{display:none}
.seg{border:0;border-radius:10px;background:#edf2f8;padding:5px;gap:4px;margin-bottom:26px;overflow:visible}
.seg button{background:transparent;min-height:48px;font-size:15px;border-radius:7px;color:#516681;padding:10px 6px}
.seg button.on{background:#fff;color:#184a92;box-shadow:0 2px 7px #1d3e6920}
.grid2,.grid3{gap:18px}
.f{min-width:0;margin-bottom:18px}
.f label,.detail .f label{font-size:14px;color:#4a5f79;font-weight:500;margin-bottom:7px;line-height:1.5}
.unit{font-size:12px;color:#6a7e98;line-height:1.5}
input[type=number],input[type=text],input[type=date],select{font-size:17px;border:1px solid #cfdbe9;min-height:50px;padding:11px 13px;border-radius:8px;background:#fff;box-shadow:0 1px 2px #1c365705}
input[type=number]{font-variant-numeric:tabular-nums;font-weight:500}
input:focus,select:focus{border-color:#3976d8;box-shadow:0 0 0 3px #2a72e619}
#dimBox>.grid3{gap:18px;margin-bottom:6px}
#dimBox>.grid3 input{height:76px;font-size:32px;padding:14px 18px;background:#f9fbfe;border-color:#ccdaed}
#dimBox>.grid3 .f label{font-size:14px}
#dimBox{border-bottom:1px solid var(--line);margin-bottom:24px;padding-bottom:5px}
#faceBox{padding-bottom:8px}
.chk{font-size:15px;gap:12px;min-height:48px;padding:12px 4px;line-height:1.6;overflow-wrap:anywhere}
.chk input[type=checkbox]{width:23px;height:23px;accent-color:var(--blue);cursor:pointer}
.chk small{font-size:14px}
#step2>.chk{border-bottom:1px solid #edf1f6;padding-top:14px;padding-bottom:14px}
#step2>.grid2,#step2>.grid3{margin-top:20px}
#step2>#sakiOpts{background:#f5f8fd;padding:16px;border-radius:10px;margin-top:12px}
#step2>#sakiOpts .f{margin-bottom:0}
#stepLn .lead,#stepLn .rule{font-size:14px;color:#566d8a}
.addface{font-size:14px;font-weight:500;min-height:50px;border:1px dashed #a6bcdb;color:#355e98;border-radius:9px;background:#f9fbfe;line-height:1.6;padding:12px 14px}
.addface:hover{border-color:#427de0;background:#f1f6ff}
#btnPdfWs{border:1px solid #b9cdec;background:#edf4ff;color:#174e9c;font-weight:700}
.samplenote{font-size:13px;line-height:1.8;color:#657995}
#faceList{counter-reset:face}
#faceList>[data-sid]{counter-increment:face;position:relative;border:1px solid var(--line);border-radius:12px;padding:22px;margin-bottom:18px;background:#fff;box-shadow:0 2px 7px #20375904}
#faceList>[data-sid]::before{content:"区間 " counter(face,decimal-leading-zero);display:block;font-family:"IBM Plex Mono",sans-serif;font-size:12px;font-weight:500;letter-spacing:.07em;color:#6b80a0;margin-bottom:15px}
html:lang(en) #faceList>[data-sid]::before{content:"Section " counter(face,decimal-leading-zero)}
.facerow{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) minmax(0,.8fr) 44px;gap:12px}
.facerow .del{border:1px solid #d9e2ef;background:#f9fbfe;min-height:50px;height:50px;color:#7990ae;font-size:16px;border-radius:8px}
.facerow .del:hover{color:var(--warn);background:#fff1f0}
.tglrow{margin-top:14px;padding-top:12px;border-top:1px solid #edf1f6;gap:12px;justify-content:space-between}
.dtgl{font-size:14px;font-weight:500;min-height:44px;padding:8px 0;color:#355f9b}
.obschip{font-size:14px;min-height:44px;border-radius:7px;padding:7px 11px;border:1px solid #bbddcf;background:#eef8f3;color:#156348;gap:8px}
.obschip.none{border-color:#c3d2e6;color:#557091;background:#f8faff}
.obschip.warn{border-color:#ebc8c5;background:#fdf2f0;color:#a43831}
.obschip .bd{font-size:12px;border-radius:4px;background:#b53b33;padding:1px 6px}
.detail{padding:18px 0 0;margin:6px 0 0;border:0;border-radius:0;background:#fff}
.detail>.grid3:not(:first-child){margin-top:18px}
.detail .grid3 .chk{font-size:14px}
.detail .hintline{font-size:13px;background:#fff5eb;border-color:#ecd7b9;color:#8a5720;font-weight:500;padding:11px 13px;min-height:46px;border-radius:8px}
.obsbox{border:1px solid #c7d9f0!important;border-left:3px solid #3b78cf!important;border-radius:10px!important;background:#f5f9ff!important;padding:18px!important;margin:0 0 26px!important}
.obsbox strong{font-size:15px!important;font-weight:700}
.obsbox>div:nth-child(2){font-size:13px!important;color:#5c7391!important;margin:10px 0 16px!important}
.obsbox>div:last-child{color:#667e9e!important}
.obsbox button{font-size:14px!important;min-height:44px!important;padding:8px 12px!important;background:#fff;color:#315d96;border:1px solid #bcd0eb;border-radius:7px}
.obsbox .grid2{align-items:end}
.obsbox .grid2>div:last-child{align-items:center!important;flex-wrap:wrap}
.obsbox .grid2 .chk{flex:1;font-size:14px;font-weight:700;color:#2d557c;min-width:200px}
.obsbox .grid2>div:last-child>button{color:#a4463c;border-color:#e6ccc6}
.obsbox .f{margin-bottom:12px}
.btn,.exp button{font-size:14px;border:1px solid #c4d5ed;border-radius:9px;font-weight:500;min-height:48px;background:#fff}
.btn:hover,.exp button:hover{background:#f1f6ff}
#btnSave{background:var(--blue);color:#fff;border-color:var(--blue);font-weight:700}
.btn.warnb{border-color:#e7c9c6;color:#ad3b32}
.hist{padding-top:22px;margin-top:24px;border-top:1px solid var(--line)}
.hist>div:first-child{font-size:14px!important}
.hist .hrow{gap:12px;flex-wrap:wrap;padding:15px 0;font-size:14px}
.hist .hrow .dt{font-size:12px}
.hist .hrow button{min-height:44px;font-size:14px;border-color:#cfdbeb}
.empty-result{background:#fff;border:1px dashed #b5c8e1;padding:64px 28px;text-align:center;border-radius:16px;color:#58708e}
.empty-result .empty-symbol{font-family:"IBM Plex Mono",monospace;display:block;font-size:46px;font-weight:400;color:#91add1;margin-bottom:8px}
.empty-result h3{font-size:20px;font-weight:500;color:#233b5c;margin-bottom:10px}
.empty-result p{font-size:15px;max-width:450px;margin:auto auto 22px}
.empty-result button{padding:11px 25px;min-height:48px;font-size:15px}
.qjump{top:80px;padding:10px 0;margin:0 0 18px;background:#f2f5f9f5;border-color:#d6e0ee;gap:7px;z-index:10}
.qjump button{font-size:14px;border:1px solid #c3d2e7;border-radius:7px;padding:8px 14px;min-height:44px;color:#426286}
.sum{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 18px}
.sum .c{border:1px solid var(--line);padding:18px 15px;border-radius:12px}
.sum .c .k{font-size:12px;font-weight:500;color:#5f7390;line-height:1.6}
.sum .c .v{font-size:30px;margin-top:7px;color:#173d70;font-weight:500}
.sum .c .v small{font-size:13px;margin-left:5px}
.total{background:#142b4c;padding:22px 26px;margin:0 0 20px;border-radius:12px}
.total .row{gap:18px;padding:6px 0}
.total .row .k{font-size:14px;font-weight:500}
.total .row .v{font-size:28px}
.total .row .v small{font-size:13px;white-space:nowrap}
.pendbox,.asmbox,.note{font-size:14px;padding:18px 20px;line-height:1.9;border-radius:10px;margin:0 0 20px}
.pendbox{background:#fff1ec;border-color:#efcbbb;border-left:3px solid #c86b42}
.pendbox b{color:#a94e29}
.asmbox{background:#edf4fd;border-color:#c5d7f0}
.note{background:#fdf9ed;border-color:#e9dcb6;color:#665b3e}
.cat{border-radius:12px;margin:0 0 20px;box-shadow:0 2px 8px #20375903}
.cat h3{padding:16px 20px;font-size:16px;font-weight:700;background:#eaf0f8;color:#264568}
.cat h3 .w{font-size:13px;color:#58718f}
table{font-size:15px;min-width:650px}
th{font-size:12px;padding:13px 14px;background:#fbfcfe;color:#607590}
td{padding:15px 14px;border-color:#e7edf5;line-height:1.6}
td:first-child{min-width:205px}
td .spec{font-size:12px;margin-top:3px;color:#687d97}
td.num:nth-child(2){font-size:21px;font-weight:600;color:#1e508b}
td input.price{min-height:44px;border:1px solid #ccd9ea;border-radius:6px;font-size:14px;width:90px}
.badge{font-size:12px;font-weight:500;padding:1px 5px;border-radius:4px;vertical-align:0}
.badge.ref{background:#f7f2e4;color:#817033;border-color:#e8dfc3}
.segtable th,.segtable td{font-size:14px}
.segment-print-list{display:none}
#condBox{font-size:14px!important;line-height:2!important}
.gauge .face{margin-bottom:24px}
.gauge .face .nm{font-size:14px;margin-bottom:10px}
.bar{height:38px;border-color:#88a8d4;border-radius:6px}
.bar span{background:#eaf2ff;border-color:#88a8d4;color:#315d96;font-size:13px}
.fit{font-size:13px;margin-top:7px}
.cands button{font-size:13px;min-height:44px;border-color:#d2dfee;border-radius:6px}
.chips .chip{min-height:44px}
.kgrid .knm{font-size:14px}
.kgrid{margin-bottom:20px}
.exp{gap:12px;margin-top:24px}
.exp button{font-weight:700}
.exp .fill{background:var(--blue)}
.calc-dock{position:fixed;bottom:0;left:0;right:0;z-index:30;background:#fffffff2;backdrop-filter:blur(14px);border-top:1px solid #cfdbeb;padding:14px 40px calc(14px + env(safe-area-inset-bottom));box-shadow:0 -6px 25px #18365407}
.calc-dock-inner{display:flex;align-items:center;gap:14px;max-width:1088px;margin:0 auto;padding-left:80px}
.dock-state{flex:1;min-width:0;font-size:13px;color:#69809c;line-height:1.6}
.dock-state strong{display:block;color:#294767;font-size:15px;font-weight:700}
.dock-state[data-valid=true] strong{color:#147653}
.dock-save{min-width:86px;background:#fff;border:1px solid #c7d7ea;color:#3a5c89;border-radius:8px;min-height:50px;font-size:14px;padding:10px 18px}
.calcbtn{width:auto;min-width:240px;min-height:52px;border-radius:8px;font-size:16px;font-weight:700;padding:12px 28px;box-shadow:0 4px 12px #2466db26;letter-spacing:.02em}
.calcbtn:hover{background:#1b55bd}
#calcHint{display:block;font-size:14px;text-align:left!important;margin:10px 0;color:#9d4c31}
.foot{font-size:12px;padding:20px 10px 6px;text-align:left;color:#687c96}
@media(min-width:1500px){.app-shell{gap:55px}.workspace-main{max-width:1040px}}
@media(max-width:1100px){:root{--rail:194px}.app-shell{gap:24px;padding:26px 24px 0}.appbar-inner{padding:0 24px}.workspace-nav button{gap:9px;font-size:14px;padding:11px}.step,.rcard{padding:22px}.calc-dock-inner{padding-left:165px}.sum{grid-template-columns:repeat(2,minmax(0,1fr))}.view-heading h2{font-size:25px}}
@media(max-width:800px){
 .appbar-inner{padding:0 18px;min-height:68px}.brand{gap:10px}.brand h1{font-size:18px}.brand h1 small{font-size:12px}.brand-mark{padding:8px;grid-template-columns:repeat(2,7px);gap:3px}.brand-mark i{width:7px;height:7px}.app-version{font-size:12px;padding:3px 7px}.header-project{display:none}
 .app-shell{display:block;padding:0 18px;max-width:700px}.workspace-rail{position:sticky;top:68px;z-index:15;min-height:0;margin:0 -18px 22px;padding:10px 14px;background:#f2f5f9f5;border-bottom:1px solid #dbe3ee;backdrop-filter:blur(12px)}
 .rail-label,.rail-context,.rail-help{display:none}.workspace-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}.workspace-nav button{padding:8px 2px;font-size:13px;min-height:48px;justify-content:center;border-radius:7px;gap:4px}.nav-num{display:none}.nav-count{margin:0;font-size:12px;padding:0 4px}
 .view-heading{margin:0 0 20px;gap:8px}.view-heading h2{font-size:24px}.view-heading p{font-size:14px}.view-status{font-size:12px;padding:4px 7px}.view-heading .eyebrow{font-size:12px}
 .step,.rcard{padding:20px;margin-bottom:18px}.step h2,.rcard h2{font-size:16px;margin-bottom:18px}.seg{margin-bottom:22px}.seg button{font-size:14px}
 #dimBox>.grid3{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}#dimBox>.grid3 input{font-size:26px;padding:12px 9px;height:68px}#dimBox>.grid3 .f label{font-size:13px}.grid2,.grid3{gap:14px}
 .calc-dock{padding:12px 16px calc(12px + env(safe-area-inset-bottom))}.calc-dock-inner{padding:0;gap:9px;max-width:650px}.dock-state{font-size:12px}.dock-state strong{font-size:13px}.dock-save{min-width:60px;padding:10px;min-height:48px}.calcbtn{min-width:0;flex:1;font-size:15px;white-space:nowrap;padding:12px 14px;max-width:300px}
 .qjump{top:137px;flex-wrap:nowrap;overflow-x:auto;padding:9px 0;gap:6px}.qjump button{font-size:13px;white-space:nowrap;padding:8px 12px}
 .total{padding:18px}.total .row .k{font-size:13px}.total .row .v{font-size:24px}.sum .c .v{font-size:29px}
 #faceList>[data-sid]{padding:16px}.facerow{grid-template-columns:1.25fr 1fr .8fr 40px;gap:8px}.facerow input{font-size:17px;padding:11px 8px}.facerow .f label{font-size:12px}.facerow .unit{display:block;font-size:12px}.facerow .del{height:50px}.tglrow{gap:6px}.dtgl{font-size:13px}.obschip{font-size:13px;padding:7px 9px}
 .obsbox{padding:14px!important}.obsbox .grid3{grid-template-columns:1fr 1fr}.obsbox .grid3>.f:first-child{grid-column:1/-1}.obsbox .grid2{grid-template-columns:1fr}.obsbox .grid2>div:last-child{justify-content:space-between}.obsbox .grid2 .chk{min-width:0;flex:initial}.obsbox strong{font-size:14px!important}.obsbox button{font-size:13px!important}
 .detail>.grid3{grid-template-columns:1fr 1fr}.detail>.grid3:first-of-type>div:first-child{grid-column:1/-1}.detail .chk{font-size:14px}.hintline{font-size:13px}.pendbox,.asmbox,.note{font-size:14px;padding:15px 16px}.empty-result{padding:45px 18px}
}
@media(max-width:430px){
 .app-shell{padding:0 12px}.workspace-rail{margin-left:-12px;margin-right:-12px;padding-left:8px;padding-right:8px}.workspace-nav button{font-size:12px}.step,.rcard{padding:16px}.view-heading h2{font-size:22px}.view-heading .eyebrow{display:none}.view-heading p{font-size:13px}
 .grid3{grid-template-columns:1fr 1fr}.grid2{gap:12px}.f label,.detail .f label{font-size:14px}.seg button{font-size:13px}.facerow{grid-template-columns:1fr 1fr 40px}.facerow>.f:first-child{grid-column:1/3}.facerow>.del{grid-column:3;grid-row:1/3;align-self:start}.facerow .f label{font-size:13px}.facerow .unit{display:inline}.tglrow{display:flex;align-items:flex-start;flex-direction:column;gap:2px}.obschip{font-size:13px}.dtgl{min-height:40px}.detail>.grid3,.detail>.grid2{grid-template-columns:1fr 1fr}
 .total .row{align-items:flex-start;flex-direction:column;gap:3px}.total .row+.row{border-top:1px solid #3d516e;margin-top:10px;padding-top:13px}.total .row .v{font-size:29px}.total .row .v small{font-size:12px}.sum .c{padding:15px 12px}.sum .c .k{font-size:12px}.sum .c .v{font-size:28px}
 .dock-state{display:none}.dock-save{min-width:68px}.calcbtn{max-width:none;min-height:50px}.cat h3{font-size:14px;padding:14px 16px}.exp{gap:9px}.exp button{font-size:13px;padding:10px}.view-status{max-width:105px;white-space:normal;text-align:center}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
@media print{
 .appbar,.workspace-rail,.view-heading,.calc-dock,.empty-result,.qjump,.foot{display:none!important}
 body{padding:0;background:white}.app-shell{display:block;padding:0;max-width:none}.workspace-main{max-width:none;padding-bottom:0}.workspace-panel{display:none!important}.workspace-panel#view-results{display:block!important}
 .sum{grid-template-columns:repeat(4,1fr)}.sum .c .v{font-size:23px}.total{color:#000;background:#fff;border:1px solid #aaa}.total .row .k,.total .row .v small{color:#333}
 .cat,.rcard,.sum .c{box-shadow:none}.tableWrap{overflow:visible}.cat{break-inside:avoid}table{min-width:0;font-size:11px}th,td{padding:6px}td:first-child{min-width:0}td.num:nth-child(2){font-size:14px;color:#000}td .spec,.badge{font-size:10px}.pendbox,.note,.asmbox{font-size:11px}.rcard{padding:12px}
 /* Set the material columns independently of the section references' natural width. */
 #catBox table{table-layout:fixed;width:100%}
 #catBox th,#catBox td{font-size:11px;padding:4px;white-space:normal;overflow-wrap:anywhere}
 #catBox th:nth-child(1){width:40%}#catBox th:nth-child(2){width:8%}#catBox th:nth-child(3){width:8%}
 #catBox th:nth-child(4){width:11%}#catBox th:nth-child(5){width:11%}#catBox th:nth-child(6){width:10%}#catBox th:nth-child(7){width:12%}
 #catBox td.num{white-space:nowrap;overflow-wrap:normal}
 /* The screen table stays unchanged; print groups each face with its full reference. */
 #segTable{display:none!important}.segment-print-list{display:block}
 .segment-print-card{margin:0 0 14px;padding:0 0 12px;border-bottom:1px solid #bbb;page-break-inside:avoid;break-inside:avoid}
 .segment-print-card:last-child{margin-bottom:0}
 .segment-print-title{font-size:13px;margin:0 0 6px;overflow-wrap:anywhere}
 .segment-print-title .spec,.segment-print-reference .spec{display:block;font-size:11px}
 .segment-print-card table{table-layout:fixed;width:100%;margin:0 0 7px}
 .segment-print-card th,.segment-print-card td{width:16.666%;padding:4px;font-size:11px;vertical-align:top;white-space:normal;overflow-wrap:anywhere}
 .segment-print-card td.num{white-space:nowrap;overflow-wrap:normal}
 .segment-print-card td .spec{white-space:normal;overflow-wrap:anywhere}
 .segment-print-reference{font-size:11px;line-height:1.6;overflow-wrap:anywhere}
 .segment-print-reference>b{display:block;margin-bottom:3px}
 .gauge .face,#noteBox{page-break-inside:avoid;break-inside:avoid}
 /* Keep one wall-tie face label and its dot grid together; other faces may paginate. */
 #kabeBox>.kgrid{page-break-inside:avoid;break-inside:avoid}
 #result h2,.segment-print-title{page-break-after:avoid;break-after:avoid}
 #noteBox{margin-bottom:0}
}

/* v3.0 beta rev1: a compact route to planning; version remains visible on phones. */
.planner-link{display:block;padding:10px 14px;font-size:14px;color:var(--blue);text-decoration:underline}
.appbar .page-switch{max-width:1440px;margin:auto;padding:4px 40px 10px;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.appbar .page-switch-link{display:inline-flex;align-items:center;min-height:44px;padding:8px 14px;border:1px solid #647992;border-radius:7px;color:#fff;text-decoration:none;font-size:14px;font-weight:600}
.appbar .page-switch-link:hover{background:#263952}
.appbar .page-switch span{font-size:14px;color:#bed0e5}
.workspace-rail{top:calc(var(--app-header-height,134px) + 30px)}
.storage-copy{font-size:14px;line-height:1.8;margin:12px 0 20px;color:var(--ink2)}
@media(max-width:800px){.appbar .page-switch{padding:4px 18px 10px;gap:8px}.appbar .page-switch span{display:none}.workspace-rail{top:var(--app-header-height,122px)}.dock-save{max-width:128px;line-height:1.4;white-space:normal}}
.planner-transfer{margin-bottom:18px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.planner-transfer small{font-size:12px;color:var(--ink2);overflow-wrap:anywhere}
@media(max-width:760px){.planner-link{padding:5px 10px;text-align:right;font-size:13px}.app-version{letter-spacing:0;white-space:normal}}

/* Keep the detailed input header below the iPhone status bar. */
@media screen{.appbar{padding-top:env(safe-area-inset-top,0px)}}

/* Keep detailed controls clear of both landscape safe-area edges. */
@media screen{
 :root{--workspace-safe-gutter:40px}
 .appbar-inner,.appbar .page-switch,.app-shell,.calc-dock{padding-left:calc(var(--workspace-safe-gutter) + env(safe-area-inset-left,0px));padding-right:calc(var(--workspace-safe-gutter) + env(safe-area-inset-right,0px))}
}
@media screen and (max-width:1100px){:root{--workspace-safe-gutter:24px}}
@media screen and (max-width:800px){:root{--workspace-safe-gutter:18px}}
/* Let the longer localized action fit beside the saved-state controls. */
@media screen and (max-width:800px){
 .calc-dock .calcbtn{white-space:normal;overflow-wrap:anywhere;line-height:1.4}
}
@media screen and (max-height:500px) and (min-width:801px){.appbar{position:relative}.workspace-rail{top:0}}

/* Keep compact fields at least 16px for iOS focus without reducing larger inputs. */
@media screen and (max-width:800px), screen and (hover:none) and (pointer:coarse){
 input,textarea,td input.price,.pwPanel input:not([type]),.pwPanel select,.pwPanel textarea{font-size:16px}
 /* This field has an inline 14px font size in the detailed form. */
 #inStairN{font-size:16px!important}
}
