*{box-sizing:border-box}body{margin:0;font:16px/1.45 system-ui,Arial,sans-serif;background:#f3f5f8;color:#1b2430}
.top{background:#1f3a5f;color:#fff;padding:.6rem 1rem;display:flex;flex-wrap:wrap;gap:.5rem 1rem;align-items:center;justify-content:space-between}
.top a{color:#fff;text-decoration:none}.brand{font-weight:700}.top nav{display:flex;flex-wrap:wrap;gap:.2rem .9rem;align-items:center}
main{max-width:760px;margin:0 auto;padding:1rem}h1{font-size:1.4rem;margin:.4rem 0}h2{font-size:1.1rem;margin:1rem 0 .4rem}
.card{background:#fff;border-radius:10px;padding:.9rem;margin:.6rem 0;box-shadow:0 1px 3px #0001}
.item{display:flex;flex-direction:column;gap:.15rem;color:inherit;text-decoration:none}.item span{color:#456}
.narrow{max-width:360px;margin:3rem auto}label{display:block;font-size:.85rem;color:#456;margin:.5rem 0}
input,select,textarea{width:100%;padding:.6rem;border:1px solid #b9c3d0;border-radius:8px;font:inherit;background:#fff}
.two{display:grid;grid-template-columns:1fr 1fr;gap:.6rem}.three{display:grid;grid-template-columns:.7fr 1fr 1.3fr;gap:.5rem}
.btn{display:inline-block;background:#1f3a5f;color:#fff;border:0;border-radius:8px;padding:.65rem 1rem;font:inherit;text-decoration:none;cursor:pointer;margin:.3rem 0}
.btn.light{background:#dfe7f2;color:#1f3a5f}.btn.danger{background:#b3261e}
.row{display:flex;justify-content:space-between;align-items:center;gap:.6rem;flex-wrap:wrap}.inl{display:flex;gap:.6rem;align-items:center;justify-content:space-between}
.links a{margin-right:.8rem}.muted{color:#678}.hint,.flash{background:#fff7d6;border-radius:8px;padding:.6rem .8rem;margin:.6rem 0}.flash{background:#e0f3e3}.err{background:#fde4e2;border-radius:8px;padding:.6rem;margin:.5rem 0}
.link{background:none;border:0;color:inherit;text-decoration:underline;cursor:pointer;font:inherit;padding:0}.top .link{color:#fff}.inline{display:inline}
.sticky{position:sticky;bottom:0;background:#f3f5f8;padding:.5rem 0}.sticky .btn{width:100%}.search{margin:.6rem 0}
a{color:#1f3a5f}.total{background:#eaf1fb}.sum{color:#456}
[hidden]{display:none!important}
.navbtn{background:none;border:0;color:#fff;font:inherit;cursor:pointer;padding:0;text-decoration:none}.top .me{opacity:.85}
.back{display:inline-flex;align-items:center;color:#1f3a5f;margin:.1rem 0 .3rem;padding:.2rem .3rem .2rem 0;text-decoration:none}
.group h2{margin-top:1.2rem;color:#345}.w small{color:#567}
.vform[data-mode=view] .edit-only,.vform[data-mode=view] .v-save{display:none!important}
.vform[data-mode=edit] .v-edit{display:none!important}
.vform[data-mode=view] input:disabled,.vform[data-mode=view] select:disabled,.vform[data-mode=view] textarea:disabled{
 border-color:transparent;background:transparent;color:inherit;-webkit-text-fill-color:currentColor;opacity:1;appearance:none;-webkit-appearance:none;resize:none;padding-left:0}
.vform[data-mode=view] input::placeholder{color:#789}
.unit{background:#fff;border-radius:10px;padding:.5rem .8rem;margin:.4rem 0;box-shadow:0 1px 3px #0001}.unit>input{flex:1}
details>summary{cursor:pointer;list-style:none}details>summary::-webkit-details-marker{display:none}details[open]>summary{margin-bottom:.4rem}
.off{opacity:.55}.acw{position:relative;display:block}
.ac{position:absolute;left:0;right:0;top:100%;z-index:30;background:#fff;border:1px solid #b9c3d0;border-radius:8px;box-shadow:0 6px 18px #0003;max-height:48vh;overflow:auto}
.ac button{display:flex;justify-content:space-between;gap:.6rem;width:100%;text-align:left;background:none;border:0;border-bottom:1px solid #eef1f5;padding:.55rem .7rem;font:inherit;cursor:pointer}
.ac button.hi,.ac button:hover{background:#e8f0fb}.ac small{color:#567;white-space:nowrap}.ac .add{color:#1f3a5f;font-weight:600}
.line.warn{outline:2px solid #e0a100}.line[data-fixed="1"] .qty-wrap{display:none}.typ{margin:0}.typ select{width:auto}
.line .three{grid-template-columns:.8fr .9fr 1.3fr}.line[data-fixed="1"] .three{grid-template-columns:.8fr 1.3fr}
dialog{border:0;border-radius:12px;padding:1rem;width:min(92vw,460px)}dialog::backdrop{background:#0006}
@media (max-width:520px){.three{grid-template-columns:1fr 1fr}.line .three{grid-template-columns:1fr 1fr}.line .three label:last-child{grid-column:1/3}.line[data-fixed="1"] .three{grid-template-columns:1fr}}
/* Act 1.2: compact spacing, readable text, separate labels and touch targets. */
main{max-width:960px;padding:.75rem 1rem}h1{margin:.3rem 0}h2{margin:.65rem 0 .3rem}
.card{padding:.65rem .8rem;margin:.45rem 0;border-radius:12px}.card>p{margin:.35rem 0}
label{margin:.3rem 0;min-width:0}label>input,label>select,label>textarea,label>.acw{margin-top:.25rem}
input,select,textarea{padding:.48rem .65rem;min-height:40px;min-width:0;border-radius:9px;line-height:1.35}
textarea{resize:vertical}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}input:focus-visible,select:focus-visible,textarea:focus-visible,button:focus-visible,a:focus-visible{outline:2px solid #527da4;outline-offset:2px}
.two,.three{gap:.35rem .75rem}.two>*,.three>*{min-width:0}.btn{min-height:40px;padding:.5rem .85rem;margin:.2rem 0;border-radius:9px}
.vform[data-mode=view] input:disabled,.vform[data-mode=view] select:disabled,.vform[data-mode=view] textarea:disabled{min-height:28px;padding:.12rem 0;margin-top:.1rem}
.vform[data-mode=view] textarea:disabled{overflow:hidden}.typ{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.typ select{margin:0;max-width:100%}
.group h2{margin-top:.8rem}.w{margin:.35rem 0}.w>label:first-child{margin-top:0}.sticky{padding:.35rem 0;z-index:10}.sticky .v-save{display:flex;flex-wrap:nowrap}.sticky .v-save .btn{width:auto;flex:1}
.ac button{min-height:44px;align-items:center}.ac small{white-space:normal;flex-shrink:0;max-width:40%}.unit>input{min-width:80px}.row.links{gap:.4rem .75rem}.links a{margin-right:0}
#import-dialog{width:min(94vw,900px);max-height:90dvh;padding:1rem;border-radius:16px;box-shadow:0 20px 70px #0004;overflow:auto}
#import-dialog p{margin:.4rem 0}.import-map{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem .75rem}.check{display:flex;gap:.55rem;align-items:center}.check input{width:20px;height:20px;min-height:20px;flex:none;margin:0;accent-color:#315b80}
.import-row{border:1px solid #dde3eb;border-radius:12px;padding:.65rem .8rem;margin:.6rem 0;background:#fff}.import-row .warn-text{color:#795000;margin:.4rem 0;font-size:.85rem}.import-row .three{grid-template-columns:repeat(3,minmax(0,1fr))}.import-footer{position:sticky;bottom:-1rem;background:#fff;padding:.65rem 0;display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;border-top:1px solid #e2e7ed}.import-footer small{flex:1;min-width:160px}
@media(min-width:700px){.w.vform{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:.2rem .85rem;align-items:start}.w>.two{grid-column:1}.w>.row{grid-column:2;align-self:end}.line{padding:.55rem .8rem}.line>label{margin-top:0}}
@media(max-width:520px){main{padding:.6rem .7rem}.top{padding:.6rem .75rem}.top nav{gap:.45rem .75rem;font-size:.9rem}.card{padding:.6rem .7rem}.two{grid-template-columns:1fr 1fr}.import-map{grid-template-columns:1fr 1fr}#import-dialog{padding:.8rem}.import-row .three{grid-template-columns:1fr 1fr}.import-row .three label:last-child{grid-column:1/-1}.ac button{font-size:.9rem}.line[data-fixed="1"] .three label:last-child{grid-column:auto}.typ{font-size:.8rem}.inl{flex-wrap:wrap}}
