:root{font-family:-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif;color:#354f3d;background:#f7f5ed;font-synthesis:none;--cream:#f7f5ed;--sage:#e7eee3;--primary:#739579;--deep:#425c49;--muted:#849488;--line:#e8eee6;--white:#fff;--orange:#ad7b51;--red:#b86360}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;min-width:320px}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.42;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #64886b;outline-offset:2px}button,input,select,textarea{-webkit-tap-highlight-color:transparent}
.app-shell{max-width:700px;margin:0 auto;padding:22px 18px calc(108px + env(safe-area-inset-bottom));min-height:100dvh}.splash{display:grid;place-items:center;margin-top:20vh;color:var(--muted);font-size:13px}.splash img{width:98px;height:98px;border-radius:23px}
.logo-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:0 0 21px}.logo-left{display:flex;align-items:center;gap:13px;min-width:0}.brand-img{width:58px;height:58px;border-radius:15px;object-fit:cover;flex-shrink:0}.eyebrow{font-size:10px;color:#8da28d;letter-spacing:1.4px;font-weight:700}.brand-name{margin:3px 0 4px;font-size:21px;letter-spacing:-.8px;font-weight:800}.subtitle{color:#869689;font-size:12px;margin:0}.page-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:2px 0 22px}.page-head h1{font-size:24px;letter-spacing:-.8px;margin:0}.icon-btn{display:inline-grid;place-items:center;background:none;border:0;border-radius:11px;color:#67876e;width:38px;height:38px;font-size:21px}.icon-btn:hover{background:#e6eee5}.ic{width:19px;height:19px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}.ic.sm{width:16px;height:16px}.ic.lg{width:23px;height:23px}
.stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;margin-bottom:18px}.stat{background:white;border:1px solid #f0f1ec;border-radius:17px;padding:16px;text-align:left;color:var(--deep);min-height:108px;display:block;width:100%}.stat.sage{background:#e3eddf;border-color:#e3eddf}.stat-head{display:flex;align-items:center;justify-content:space-between;gap:7px;color:#748a77;font-size:12px}.stat-number{display:block;margin-top:12px;font-size:29px;font-weight:800;letter-spacing:-1px}.stat-number small{font-size:12px;font-weight:500;margin-left:4px;color:#849488}
.panel{background:var(--white);border:1px solid #edf0e9;border-radius:17px;overflow:hidden;margin-bottom:16px;box-shadow:0 1px 2px #4b624708}.panel-head{background:var(--sage);min-height:48px;padding:13px 15px;display:flex;align-items:center;justify-content:space-between;gap:8px}.panel-head h2{margin:0;font-size:14px;color:var(--deep);letter-spacing:-.2px;font-weight:750}.panel-head small{font-size:11px;color:#728675}.panel-body{padding:2px 14px}.panel-item{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:69px;padding:12px 1px;border-bottom:1px solid var(--line)}.panel-item:last-child{border-bottom:none}.item-title{font-weight:700;font-size:14px;color:var(--deep);margin:0 0 6px;word-break:break-word}.item-sub{margin:0;font-size:11.5px;color:var(--muted);line-height:1.5}.item-right{color:#597861;font-weight:750;font-size:13px;text-align:right;white-space:nowrap}.item-right small{display:block;font-size:11px;margin-top:7px;font-weight:600}.danger{color:var(--red)!important}.warning{color:var(--orange)!important}.muted{color:var(--muted)!important}.noitems{padding:29px 12px;text-align:center;color:#98a699;font-size:13px;line-height:1.7}.panel-footer{padding:10px 15px;border-top:1px solid var(--line);text-align:center}.link-button{color:#66856d;background:none;border:0;font-size:12px;font-weight:700;padding:6px 9px}
.chips{display:flex;gap:7px;flex-wrap:wrap;margin:12px 0}.chip{background:white;border:1px solid #dfe8dd;border-radius:999px;color:#77907b;font-size:12px;padding:8px 12px}.chip.active{background:#e3ecdf;border-color:#b4ceb8;color:#415e49;font-weight:700}.fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.field{display:flex;flex-direction:column;gap:6px;margin:0 0 12px}.field.full{grid-column:1/-1}.field label{font-size:12px;font-weight:700;color:#637968}.field input,.field select,.field textarea,.input{border:1px solid #dae4d9;background:#fff;border-radius:11px;padding:11px 12px;font-size:14px;color:#425a47;width:100%;min-height:44px;appearance:none}.field input[type=checkbox]{width:auto;min-height:0;appearance:auto}.field input:focus,.field select:focus,.field textarea:focus{border-color:#86a78c}.field small{font-size:11px;color:#91a092}.search{margin-bottom:13px}.search input{border:1px solid #e0e8dc;background:#fff;padding:13px 15px;border-radius:13px;width:100%;font-size:14px}.controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:11px 0 18px}.controls select{flex:1;min-width:110px;border:1px solid #dce8da;border-radius:10px;padding:9px;background:white;color:#56715a;font-size:12px}.segments{background:#edf2e9;display:flex;padding:4px;border-radius:13px;gap:3px;margin-bottom:13px}.segments button{flex:1;padding:10px 6px;font-size:12px;border:0;border-radius:10px;background:transparent;color:#748b79;font-weight:600}.segments button.active{background:#fff;color:#49684d;box-shadow:0 1px 4px #788f7422}.empty-line{padding:30px 14px;text-align:center;color:#98a599;font-size:13px;line-height:1.65}.pill{font-size:10px;border-radius:99px;padding:5px 8px;background:#f1eee1;color:#a57a49;font-weight:700;white-space:nowrap}.pill.green{background:#e6f0e2;color:#68876b}.pill.red{background:#fae9e8;color:#ae6967}
.nav{position:fixed;z-index:20;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:700px;display:grid;grid-template-columns:repeat(4,1fr);padding:9px 12px calc(8px + env(safe-area-inset-bottom));background:#fffffff5;border-top:1px solid #e8eee5;backdrop-filter:blur(12px)}.nav button{background:none;border:0;display:flex;flex-direction:column;align-items:center;gap:5px;color:#a1aea1;font-size:10px;padding:6px 4px;border-radius:10px}.nav button.active{color:#4c7354;background:#f0f5ee;font-weight:800}.nav button .ic{width:21px;height:21px}.fab{position:fixed;z-index:31;right:max(18px,calc((100vw - 700px)/2 + 18px));bottom:calc(88px + env(safe-area-inset-bottom));width:58px;height:58px;border:0;border-radius:50%;background:#78997e;box-shadow:0 6px 20px #354e3b3a;color:white;display:grid;place-items:center}.fab .ic{width:28px;height:28px;stroke-width:2.5}.quick-menu{position:fixed;z-index:30;right:max(18px,calc((100vw - 700px)/2 + 18px));bottom:calc(155px + env(safe-area-inset-bottom));width:min(320px,calc(100vw - 36px));background:white;border:1px solid #e1e9df;box-shadow:0 10px 30px #334d2a22;padding:7px;border-radius:17px}.quick-menu button{background:transparent;border:0;padding:13px 12px;width:100%;display:flex;align-items:center;gap:11px;text-align:left;border-radius:10px;color:#48674f;font-weight:650;font-size:13px}.quick-menu button:hover{background:#edf3e9}
.primary{width:100%;min-height:47px;border:0;border-radius:12px;background:#78997e;color:#fff;font-weight:800;padding:12px 18px}.secondary{min-height:40px;border:1px solid #d4e2d2;background:#fff;color:#597861;border-radius:11px;padding:10px 13px;font-weight:700;font-size:12px}.tertiary{border:0;background:none;color:#7b987e;font-weight:700;font-size:12px;padding:8px 4px}.row-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;margin:12px 0}.row-actions button{flex:1}.button-inline{border:1px solid #d4e2d2;background:#f8fbf7;color:#597861;padding:8px 10px;font-size:11px;border-radius:9px;font-weight:700}.button-danger{color:#b76e68;border-color:#e9d9d7}.selectable{cursor:pointer}.selectable:hover{background:#fcfdf9}
.overlay{position:fixed;inset:0;z-index:50;background:#15261a66;display:flex;align-items:end;justify-content:center}.sheet{background:#fff;width:100%;max-width:700px;max-height:min(90dvh,980px);overflow:auto;border-radius:23px 23px 0 0;padding:10px 19px calc(24px + env(safe-area-inset-bottom));box-shadow:0 -10px 35px #21382428}.handle{width:38px;height:5px;background:#d5dfd2;margin:1px auto 13px;border-radius:99px}.sheet-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:17px}.sheet-head h2{font-size:19px;margin:0}.sheet .notice{font-size:12px;color:#829485;line-height:1.65;background:#f5f8f3;border-radius:10px;padding:11px;margin:8px 0 14px}.sheet-actions{display:flex;gap:9px;margin-top:12px}.sheet-actions .primary{flex:2}.sheet-actions .secondary{flex:1}.switcher{display:flex;align-items:center;gap:9px;font-size:12px;color:#68806c;margin:5px 0 12px}.switcher input{accent-color:#6a926f;width:16px;height:16px}
.auth-box{width:100%;max-width:415px;margin:9vh auto;padding:24px 20px;background:#fff;border-radius:24px;border:1px solid #e5ede2;text-align:left}.auth-logo{width:82px;height:82px;border-radius:20px;display:block;margin:0 auto 14px}.auth-box h1{text-align:center;margin:0;font-size:22px}.auth-box .auth-tag{text-align:center;color:#859888;font-size:12px;margin:9px 0 23px}.auth-swap{display:block;margin:13px auto 0;background:none;border:0;color:#6e9775;font-weight:700}.mode-banner{font-size:11px;background:#fff5df;color:#93703b;border:1px solid #f0dfba;padding:10px 12px;border-radius:12px;margin:0 0 15px;line-height:1.6}.toast{position:fixed;bottom:calc(102px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);background:#3d5843;color:#fff;padding:12px 18px;border-radius:13px;z-index:80;box-shadow:0 5px 22px #263b2333;width:max-content;max-width:90vw;font-size:12px}
.setting-section{margin-bottom:20px}.setting-title{font-size:14px;margin:0 0 12px}.setting-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 0;border-bottom:1px solid var(--line);font-size:13px}.setting-row:last-child{border:0}.setting-row input{accent-color:#739579}.setting-actions{display:flex;align-items:center;gap:5px}.small-icon{background:#f4f8f2;border:1px solid #dfe9db;border-radius:8px;color:#698a70;min-width:32px;height:32px}.quick-btn-list{display:flex;gap:8px;flex-wrap:wrap}.order-line{padding:12px 0;border-bottom:1px solid var(--line)}.order-line:last-child{border:0}.progress{height:7px;background:#e9ede6;border-radius:6px;overflow:hidden;margin:12px 0}.progress>div{height:100%;background:#86a989;border-radius:6px}pre{white-space:pre-wrap}
@media (min-width:701px){.app-shell{border-left:1px solid #eff0e7;border-right:1px solid #eff0e7;min-height:100vh}.sheet{border-radius:22px;margin:0 auto 22px;max-height:90vh}.overlay{align-items:end}}
@media (max-width:359px){.app-shell{padding-left:12px;padding-right:12px}.brand-name{font-size:19px}.brand-img{width:52px;height:52px}.stat{padding:12px}}
@media (prefers-reduced-motion:no-preference){.fab,.chip,.primary,.secondary{transition:transform .15s,background .15s}.fab:active,.primary:active{transform:scale(.97)}}

/* v4: 물품 전체 수정 / 명시적 삭제 */
.edit-section-title{font-size:14px;color:var(--deep);margin:23px 0 11px;display:flex;align-items:center;justify-content:space-between;gap:8px}
.edit-section-title small{color:var(--muted);font-size:11px;font-weight:500}
.edit-lot-block{border:1px solid #dfe9db;border-radius:12px;background:#fcfdfb;margin:10px 0;overflow:hidden}
.edit-lot-block>summary{list-style:none;cursor:pointer;padding:15px 13px;color:#55705b;font-size:12px;font-weight:750;background:#f0f5ed;line-height:1.6}
.edit-lot-block>summary::-webkit-details-marker{display:none}
.edit-lot-block>summary:after{content:'⌄';float:right;margin-left:8px}
.edit-lot-block[open]>summary:after{content:'⌃'}
.lot-fields{padding:14px 12px 5px}
.delete-item-button{width:100%;display:flex;justify-content:center;align-items:center;gap:9px;margin-top:17px;margin-bottom:8px;min-height:45px;background:#fff9f8;border-color:#e8cfcf!important;color:#b35f5b!important;font-weight:750}
.delete-item-button:hover{background:#fff1ef}


/* v5: 목록/상세 재고 +/- 빠른 조절 */
.stock-item{gap:8px;min-height:88px}
.stock-item-main{flex:1;min-width:0}
.stock-item-side{display:flex;flex-direction:column;align-items:flex-end;gap:9px;flex-shrink:0}
.stock-item-side .item-right{font-size:14px}
.stock-quick{display:flex;gap:6px;align-items:center;justify-content:flex-end}
.quick-step{display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:40px;padding:0;background:#f4f8f2;color:#587861;border:1px solid #d8e4d6;border-radius:11px;cursor:pointer}
.quick-step .ic{width:17px;height:17px;stroke-width:2.4}
.quick-step:disabled{opacity:.38;cursor:not-allowed}
.quick-step:active:not(:disabled){background:#e2edde}
.lot-quick-side{display:flex;flex-direction:column;align-items:flex-end;gap:9px;max-width:52%;flex-shrink:0}
.lot-quick-side .button-inline{padding:7px 8px;white-space:normal;text-align:center}
.quick-lot-list{display:flex;flex-direction:column;gap:9px;margin-bottom:14px}
.quick-lot-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:13px;border:1px solid #d9e6d7;background:#f8fbf7;border-radius:12px;color:#486a4f;text-align:left;font-size:13px;font-weight:700}
.quick-lot-pick small{display:block;font-size:11px;color:#7e9282;font-weight:500;margin-top:5px;line-height:1.5}
@media (max-width:365px){.stock-item{flex-wrap:wrap}.stock-item-side{flex-direction:row;align-items:center;width:100%;justify-content:space-between}.stock-item-main{width:100%}}
