:root{font-family:system-ui,-apple-system,"Noto Sans JP",sans-serif;color:#17324a;background:#edf2f6;font-size:16px}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer;min-height:48px;padding:10px 18px;border:1px solid #cbd5df;border-radius:10px;background:white;color:#17324a;font-weight:600}button:hover{border-color:#008d84}button.primary,.active{background:#007f79;color:white;border-color:#007f79}header{background:#133450;color:white;display:flex;align-items:center;gap:16px;padding:16px 28px;position:sticky;top:0;z-index:5}header button{color:white;background:transparent;border-color:#496078}.brand{border:0;display:flex;gap:12px;align-items:center;font-size:28px;padding:0;text-align:left}.brand span{font-size:18px}.brand small{display:block;font-size:12px;font-weight:400;opacity:.75}#save{margin-left:auto;font-size:14px}main{max-width:1250px;margin:auto;padding:28px}.top{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:24px}h1{font-size:28px;margin:0 0 8px}h2{font-size:20px;margin:0 0 20px}h3{font-size:17px}.muted,.hint{color:#61758a;font-size:14px;line-height:1.7}.notice{background:#fff6dc;border:1px solid #ead99a;border-radius:10px;padding:12px 16px;line-height:1.7;margin-bottom:24px;font-size:14px}.card{background:white;border:1px solid #dce4eb;border-radius:14px;padding:24px;margin-bottom:20px}.cards,.split,.plans{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.plans{grid-template-columns:repeat(3,minmax(0,1fr))}.job{cursor:pointer;border-left:5px solid #008d84}.job:hover{box-shadow:0 5px 20px #13345012}.badge{display:inline-block;background:#e4f4f2;color:#00736b;font-size:14px;padding:5px 10px;border-radius:6px}.row{display:flex;gap:12px;flex-wrap:wrap;align-items:center}.tabs{display:flex;gap:8px;overflow:auto;margin:20px 0}.tabs button{white-space:nowrap}label{display:block;font-weight:600;font-size:14px;margin-bottom:14px}input,select,textarea{display:block;width:100%;min-height:50px;border:1px solid #c5d1dc;border-radius:8px;padding:12px;background:white;margin-top:7px;color:#17324a}textarea{min-height:110px}.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}.measure{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.measure input{font-size:24px;font-variant-numeric:tabular-nums}.result{padding:14px;background:#eef7f7;border-radius:8px;margin-top:8px;font-weight:700;color:#00736b}.photo{width:100%;height:200px;object-fit:contain;background:#edf2f6;border-radius:8px}.price{font-size:30px;font-weight:750;letter-spacing:-1px;margin:24px 0 12px}.planmark{font-size:13px;letter-spacing:2px;color:#008d84}.checkrow{border-bottom:1px solid #e2e8ee;padding:16px 0}.checkrow select{max-width:190px}.checkrow textarea{min-height:70px}dialog{width:95vw;max-width:1400px;border:0;border-radius:14px;padding:18px}dialog::backdrop{background:#102a42b0}.editorhead{display:flex;align-items:center;justify-content:space-between;gap:12px}.tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0}.tools label{margin:0}.tools input{width:180px}.tools input[type=color]{width:55px}.tools input[type=range]{width:110px}.tools select{width:200px}.tools button{padding:8px 12px}#canvaswrap{background:#dce4eb;overflow:auto;max-height:65vh}canvas{display:block;width:100%;touch-action:none;background:white}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:#133450;color:white;padding:12px 22px;border-radius:10px;display:none;z-index:20}.full{grid-column:1/-1}a{color:#007f79}.customer main{max-width:1200px}.customer #settings,.customer #save{display:none}@media(max-width:700px){header{padding:12px 16px;gap:8px}.brand small{font-size:11px}#save{font-size:12px}header button{padding:8px}main{padding:18px 14px}.cards,.split,.plans{grid-template-columns:1fr}.card{padding:18px}.top{align-items:flex-start}h1{font-size:24px}.fields{grid-template-columns:1fr}.measure{gap:8px}.measure input{padding:10px 8px;font-size:21px}.tools input{width:150px}.price{font-size:28px}dialog{padding:12px}button{min-height:48px}}
/* The editor uses the entire viewport so phone users keep room to draw. */
#editor{position:fixed;inset:0;margin:0;width:100vw;max-width:none;height:100dvh;max-height:none;border-radius:0;padding:max(10px,env(safe-area-inset-top)) 12px max(10px,env(safe-area-inset-bottom));overflow:hidden}
#editor[open]{display:flex;flex-direction:column;gap:8px;background:#f4f7fa}
#editor .editorhead{flex-shrink:0;min-height:48px}#etitle{font-size:16px}#editor .editorhead button{white-space:nowrap}
#editor #tools{flex-shrink:0;flex-wrap:nowrap;overflow-x:auto;margin:0;padding-bottom:4px;scrollbar-width:thin}#tools button{flex-shrink:0;min-width:70px}
.quicktools{display:flex;gap:8px;flex-shrink:0}.quicktools button{flex:1;padding:8px;min-height:44px}
#editorOptions{flex-shrink:0;max-height:32dvh;overflow:auto;border:1px solid #d6e0e9;border-radius:10px;background:white;padding:8px 12px}
#editorOptions[hidden]{display:none}#editorOptions .tools{margin:0;gap:10px}#editorOptions label{font-size:14px}#editorOptions input,#editorOptions select{min-height:44px}
#editor #canvaswrap{flex:1;min-height:100px;max-height:none;overflow:auto;overscroll-behavior:contain;border-radius:8px;padding:8px;position:relative}
#editor canvas{margin:auto;max-width:none;flex-shrink:0;box-shadow:0 2px 8px #15324a22}
.editorfooter{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0}.editorfooter #toolHint{font-size:14px;color:#526a7d}.editorfooter .row{flex-wrap:nowrap;gap:6px}.editorfooter button{min-width:44px;padding:8px 12px}
button.danger{color:#b12727;border-color:#db9b9b;background:#fff6f6}#clearConfirm{max-width:460px;line-height:1.7}#clearConfirm h2{margin-bottom:14px}#clearConfirm .row{justify-content:flex-end}
@media(max-width:700px){#editor{padding-left:8px;padding-right:8px;gap:6px}#tools button{font-size:14px;padding:8px 12px;min-height:46px}#etitle{font-size:14px}#editor .editorhead button{font-size:14px;padding:8px 12px}.editorfooter #toolHint{font-size:12px}.editorfooter button{font-size:14px}#clearConfirm{width:92vw;padding:20px}#editorOptions{max-height:30dvh}}
@media(max-height:500px){#editor[open]{gap:4px}#editor .editorhead{min-height:40px}#editor button{min-height:40px}#editorOptions{max-height:35dvh}.editorfooter #toolHint{font-size:12px}}
.section-divider{border:0;border-top:1px solid #dce4eb;margin:24px 0}select:disabled{background:#edf2f6;color:#61758a}
/* Native file inputs are triggered by the photo buttons only. */
[hidden]{display:none!important}
.opening-diagram{display:block;width:100%;max-width:340px;height:auto;margin:0 auto 16px}.opening-diagram text{font-family:inherit;font-size:18px;fill:#17324a;font-weight:600}
button:disabled{cursor:default;opacity:.55}.report-sheet{background:white;max-width:900px;margin:24px auto;padding:36px;border:1px solid #dce4eb;border-radius:8px;color:#17324a}.report-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;border-bottom:3px solid #17324a;padding-bottom:14px}.report-heading small,.report-meta{font-size:14px;line-height:1.8}.report-sheet h2{margin:24px 0 12px;font-size:19px}.report-table{width:100%;border-collapse:collapse;font-size:14px;table-layout:fixed}.report-table td,.report-table th{border:1px solid #bac9d5;padding:10px;text-align:left;word-break:break-word;white-space:pre-wrap}.report-table th{background:#eef3f7}.report-note{white-space:pre-wrap;font-size:14px;line-height:1.7}.visual-page img{display:block;max-width:100%;max-height:900px;margin:20px auto}.report-controls label{margin:0}#revisionDialog{max-width:520px}
@media(max-width:700px){.report-sheet{padding:16px}.report-heading h1{font-size:21px}.report-table{font-size:12px}.report-table td,.report-table th{padding:7px}.report-heading{gap:10px}}
@media print{@page{size:A4;margin:12mm}body{background:white;color:black}body>header,#lockBanner,.report-controls,#app>.top,#app>.row,#app>.tabs,#toast{display:none!important}main,#app{max-width:none;padding:0;margin:0}#content{display:block}.report-sheet{max-width:none;margin:0;border:0;border-radius:0;padding:0;font-size:11pt}.report-sheet h1{font-size:20pt}.report-sheet h2{font-size:13pt;break-after:avoid}.report-table{font-size:10pt}.report-table td,.report-table th{padding:6px}.report-table tr{break-inside:avoid}.report-heading,.report-note{break-inside:avoid}.report-meta{font-size:10pt}.visual-page{break-before:page;break-inside:avoid}.visual-page img{width:auto;max-width:100%;max-height:235mm;object-fit:contain}dialog{display:none!important}}
.app-shell{display:grid;grid-template-columns:215px minmax(0,1fr);min-height:calc(100dvh - 90px)}#mainNav{background:#133450;color:white;padding:28px 16px}.nav-title{font-weight:750;font-size:23px;margin:4px 12px 28px}.nav-title small{display:block;font-size:14px;font-weight:400;margin-top:8px;opacity:.8}#mainNav nav{display:grid;gap:8px}#mainNav button{text-align:left;background:transparent;color:white;border-color:transparent;border-radius:8px}#mainNav button.nav-active{background:#1b6b9c}main{width:100%;min-width:0}.home-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:28px 0}.home-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:190px;border:0;color:white;box-shadow:0 4px 12px #14365214;border-radius:16px;gap:12px}.home-tile:hover{filter:brightness(1.06)}.home-tile strong{font-size:24px}.home-tile small{font-size:14px;font-weight:400}.tile-green{background:#15957b}.tile-slate{background:#536e80}.tile-blue{background:#137eb1}.tile-icon{font-size:40px;line-height:1}.home-search label{font-size:16px}.home-job{display:flex;align-items:center;justify-content:space-between;text-align:left;gap:12px;width:100%;padding:18px;min-width:0}.home-job small{display:block;color:#61758a;font-weight:400;margin-top:8px;overflow-wrap:anywhere}.document-card h2{overflow-wrap:anywhere;font-size:18px;margin-top:20px}.document-empty{grid-column:1/-1;padding:28px 8px;text-align:center}.customer #mainNav{display:none}.customer .app-shell{grid-template-columns:1fr}
@media(max-width:900px){.app-shell{grid-template-columns:175px minmax(0,1fr)}#mainNav{padding:20px 10px}.nav-title{font-size:20px;margin-left:8px}.home-tile strong{font-size:21px}}
@media(max-width:700px){.app-shell{display:block}#mainNav{padding:8px 10px}.nav-title{display:none}#mainNav nav{display:flex;gap:4px;overflow:auto}#mainNav button{white-space:nowrap;font-size:14px;min-height:44px;padding:8px 12px}.home-actions{gap:12px;margin:20px 0}.home-tile{min-height:150px;border-radius:12px;padding:16px 8px}.home-tile strong{font-size:19px}.home-tile small{font-size:12px}.tile-icon{font-size:34px}.home-job{padding:12px;flex-wrap:wrap}.home-search .cards{gap:12px}}
@media print{#mainNav{display:none!important}.app-shell{display:block;min-height:0}}
.glass-price-row{display:grid;grid-template-columns:minmax(160px,1.3fr) 1fr 1fr;gap:16px;align-items:center;padding:16px 0;border-bottom:1px solid #dce4eb}.glass-price-row label{margin:0}#glassResult .report-table{font-size:15px}#glassRows input[type=number]{font-size:20px}@media(max-width:700px){.glass-price-row{grid-template-columns:1fr 1fr;gap:10px}.glass-price-row strong{grid-column:1/-1}#glassResult .report-table{font-size:13px}#glassSettingsLink{font-size:14px}}
.tile-glass{background:#bd651a}
.case-selectable{-webkit-touch-callout:none;user-select:none;touch-action:pan-y}#caseActions,#caseDeleteConfirm{max-width:480px;line-height:1.7}#caseActionName,#caseDeleteName{overflow-wrap:anywhere;font-weight:600}#caseActions .row,#caseDeleteConfirm .row{justify-content:flex-end}
.inner-layout{display:grid;grid-template-columns:minmax(230px,300px) minmax(0,1fr);gap:20px;align-items:start}.inner-list{position:sticky;top:20px;max-height:85vh;overflow:auto}.inner-window{display:flex;flex-direction:column;align-items:flex-start;width:100%;gap:8px;text-align:left;margin-top:10px;padding:16px}.inner-window.selected{border:2px solid #147d94;background:#eaf6f8}.inner-window small{line-height:1.6;color:#456174}.inner-diagram{width:100%;max-width:520px;display:block;margin:auto}.inner-triple{grid-template-columns:repeat(3,minmax(0,1fr))!important}.inner-triple label{min-width:0}.inner-triple input{width:100%;min-width:0}.inner-print-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.inner-print-values{display:flex;justify-content:space-between;gap:8px;border-bottom:1px solid #b4c1c8;padding:8px 0}.inner-print-window{border:1px solid #527182;padding:14px;margin:14px 0;break-inside:avoid}.inner-print-window h2{margin:0 0 8px}.inner-print-window p{line-height:1.5}.inner-print-note{white-space:pre-wrap;overflow-wrap:anywhere}.inner-order{background:#f0f6f8;border:1px solid #537184;padding:10px}.inner-print-page h1{font-size:24px}.inner-print-page h3{font-size:16px;margin:8px 0}.inner-print-page{font-size:12px}@media(max-width:700px){.inner-layout{grid-template-columns:1fr}.inner-list{position:static;max-height:300px}.inner-print-grid{grid-template-columns:1fr}.inner-triple{gap:8px!important}.inner-triple label{font-size:13px}.inner-triple input{font-size:18px;padding:10px}}
@media print{.inner-print-grid{grid-template-columns:1fr 1fr}.inner-print-page{font-size:10pt;padding:0!important;min-height:0!important}.inner-print-window{padding:8px;margin:10px 0}.inner-print-window h2{font-size:13pt}.inner-print-values{padding:6px 0}.inner-print-page p{margin:5px 0}.inner-print-page h1{font-size:17pt}.inner-order{background:white}.inner-print-note{max-height:none}}
@media print{.inner-print-page+.inner-print-page{break-before:page}.inner-print-page .report-heading{padding-bottom:6px}.inner-print-page .report-meta{font-size:8pt;line-height:1.5}.inner-print-page .inner-print-window h2{margin:0 0 6px}.inner-print-page .inner-print-window h3{margin:5px 0}}
.inner-print-diagram{display:block;width:100%;height:auto;max-width:540px;margin:8px auto}.inner-print-grid>div{min-width:0}@media print{.inner-print-diagram{margin:3px auto}.inner-print-page .inner-print-grid{gap:8px}.inner-print-page .inner-print-window{break-inside:avoid}}
.door-height-diagram{display:block;width:100%;max-width:600px;margin:14px auto}@media print{.door-height-diagram{max-width:125mm;max-height:65mm;break-inside:avoid}}
.spec-group{padding:16px;margin:16px 0;border:1px solid #d2dfe7;border-radius:12px;background:#f8fbfd}.spec-group>h3{margin:0 0 14px;color:#133450}.spec-group h4{margin:14px 0 10px}.spec-group .fields{margin-bottom:0}@media(max-width:700px){.spec-group{padding:12px}}
.inner-group-title{margin-top:26px!important;padding:10px 14px;background:#eaf2f7;border-left:4px solid #147d94;border-radius:6px;font-size:18px}.inner-list .row{flex-wrap:wrap}#innerSketch{display:block;width:100%;padding:18px;margin-bottom:22px;background:#eaf7f6;border-color:#147d94}
.bath-measure-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:18px;align-items:center}.bath-report-levels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}@media(max-width:700px){.bath-measure-layout{grid-template-columns:1fr;gap:6px}.bath-measure-layout .opening-diagram{max-width:260px}}@media print{.bath-report-levels{break-inside:avoid}}

/* Keep field controls aligned even when Japanese captions wrap. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
.fields>label,.measure>label{min-width:0;display:flex;flex-direction:column;justify-content:flex-end;line-height:1.5}
input,select,textarea{min-width:0;max-width:100%}
input[type=date]{min-width:0;max-width:100%;text-align:left;-webkit-appearance:none;appearance:none}
input[type=date]::-webkit-date-and-time-value{text-align:left}
.measure input{font-size:20px;padding:12px 8px}
.measure input::placeholder{font-size:16px}
@media screen and (max-width:1100px){
.app-shell{display:block}
#mainNav{padding:8px 12px}
.nav-title{display:none}
#mainNav nav{display:flex;gap:4px;overflow:auto}
#mainNav button{white-space:nowrap;min-height:44px;padding:8px 12px}
.split{grid-template-columns:1fr}
.inner-layout{grid-template-columns:1fr}
.inner-list{position:static;max-height:300px}
}

.login-card{max-width:480px;margin:40px auto}header{flex-wrap:wrap}header form{margin:0}header form input[type=hidden]{display:none}
/* XServer sync controls: keep the header usable on tablets and phones. */
header{flex-wrap:wrap}header>select{width:auto;max-width:220px;min-height:44px;margin:0;font-size:14px}header>form{margin:0}.customer #syncNow,.customer header>select,.customer header>form{display:none}[hidden]{display:none!important}.login-card{max-width:520px;margin:8vh auto}body:has(.login-card) main{width:100%}@media(max-width:700px){header #save{flex-basis:50%;margin-left:0}header>select{max-width:100%;font-size:13px}header>form button,header>#syncNow{font-size:13px}}
