:root{--bg:#f5f6f7;--card:#fff;--ink:#2b2826;--muted:#756d67;--line:#e8e1dc;--soft:#f7f1ed;--accent:#ad684b;--accent-dark:#92553d;--ok:#80563e;--okbg:#f4ebe5;--okline:#dfcbbd;--warn:#9a621e;--warnbg:#fff7e9;--bad:#a6433b;--badbg:#fff3f1;--shadow:0 2px 7px rgba(34,29,26,.045)}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer;border:1px solid transparent;border-radius:8px;padding:9px 15px;font-weight:650;color:#fff;background:var(--accent);transition:background .15s}button:hover{background:var(--accent-dark)}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #ad684b40;outline-offset:2px}button.secondary{background:#fff;color:var(--ink);border-color:var(--line)}button.secondary:hover{background:#faf7f5}button.quiet{padding:4px 7px;background:transparent;color:var(--accent)}.top{height:72px;background:#211a17;color:#fff}.top-inner{max-width:1460px;height:100%;margin:auto;padding:0 36px;display:flex;align-items:center;justify-content:space-between}.brand,.top-right{display:flex;align-items:center;gap:18px}.brand img{width:137px}.brand>span{height:25px;width:1px;background:#504640}.brand strong{font-size:16px;font-weight:550;color:#eee9e6}.prototype{color:#bfb2a9;font-size:12px}.avatar{display:grid;place-items:center;width:34px;height:34px;border:1px solid #685b54;border-radius:50%;background:#352c28;font-size:11px}.nav{height:57px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 max(36px,calc((100vw - 1388px)/2));gap:20px}.nav>div{display:flex;height:100%;gap:26px}.nav button{position:relative;border:0;background:transparent;padding:0 2px;border-radius:0;color:var(--muted);font-weight:550}.nav button.active{color:var(--accent)}.nav button.active:after{content:"";position:absolute;bottom:0;height:3px;background:var(--accent);left:0;right:0;border-radius:2px 2px 0 0}.local-mark{font-size:11px;color:var(--muted);white-space:nowrap}.local-mark i{display:inline-block;width:6px;height:6px;border-radius:50%;background:#99765f;margin-right:6px}main{max-width:1388px;margin:0 auto;padding:29px 0 64px}.page-title{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}.eyebrow{font-size:11px;color:var(--muted);margin-bottom:6px;letter-spacing:.03em}h1{font-size:25px;letter-spacing:-.035em;line-height:1.3;margin:0 0 8px;font-weight:650}h2{font-size:16px;margin:0}h3{font-size:14px;margin:0}.subtitle,.muted{color:var(--muted)}.subtitle{font-size:13px;margin:0}.actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.card{background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);overflow:hidden}.card-head{display:flex;align-items:center;justify-content:space-between;padding:20px 23px;border-bottom:1px solid #eee9e5;gap:16px}.card-body{padding:23px}.grid{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:20px}.left-stack,.right-stack{display:flex;flex-direction:column;gap:20px}.stepper{display:flex;gap:34px;margin:0 0 23px;align-items:center;color:var(--muted);font-size:12px}.stepper>span{display:flex;align-items:center;gap:9px}.stepper b{font-size:11px;display:grid;place-items:center;height:25px;width:25px;border:1px solid var(--line);border-radius:50%;font-weight:550}.stepper .on{color:var(--accent)}.stepper .on b{background:#f4e9e1;border-color:#e2cfc2}.stepper .line{height:1px;flex:1;background:var(--line);max-width:60px}.drop{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:31px 18px;border:1.5px dashed #d9c9bd;border-radius:10px;background:#fdfbf9;min-height:221px}.drop.over{background:#f8ede5;border-color:var(--accent)}.upload-icon{display:grid;place-items:center;width:46px;height:46px;background:#f3e9e2;color:var(--accent);border:1px solid #ebddd3;border-radius:12px;margin-bottom:12px}.upload-icon svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.6}.drop strong{font-size:15px;font-weight:600}.drop p{font-size:12px;color:var(--muted);margin:6px 0 16px}.drop .hint{margin:12px 0 0;font-size:11px;color:var(--muted)}.text-link{border:0;background:none;color:var(--accent);padding:0;font-size:12px}.upload-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:15px;font-size:12px;color:var(--muted)}.field{display:flex;flex-direction:column;gap:7px;font-size:12px;color:var(--muted);margin-bottom:17px}.field input,.field select,.field textarea,input.search,select.filter{border:1px solid #ded8d3;border-radius:8px;background:#fff;padding:9px 11px;color:var(--ink);width:100%;min-width:0;outline-offset:2px}.field textarea{min-height:90px;resize:vertical}.field small{font-size:11px;color:var(--muted)}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.formula{font-size:12px;background:var(--soft);border:1px solid #ecdfd5;border-radius:8px;padding:12px;color:#81553f;line-height:1.9}.formula strong{font-weight:600;color:#624435}.formula .code{font-size:12px;letter-spacing:.01em}.rule-note{margin:15px 0 0;color:var(--muted);font-size:11px;line-height:1.8}.checkbox{display:flex;gap:9px;align-items:center;font-size:12px;color:var(--muted);margin:10px 0}.checkbox input{accent-color:var(--accent)}.summary{display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid var(--line);margin-top:21px;padding-top:19px;gap:12px}.summary .value{font-size:24px;font-weight:600;letter-spacing:-.03em;line-height:1.2}.summary .label{color:var(--muted);font-size:11px;margin-top:5px}.summary .warn{color:var(--warn)}.file-row{display:flex;gap:12px;align-items:center;border:1px solid var(--line);padding:13px;border-radius:8px;margin-bottom:8px}.file-symbol{color:var(--ok);background:var(--okbg);width:33px;height:38px;display:grid;place-items:center;font-size:11px;font-weight:700;border:1px solid var(--okline);border-radius:6px}.file-row strong{font-size:13px;display:block}.file-row small{font-size:11px;color:var(--muted)}.notice{padding:12px 15px;font-size:12px;border:1px solid #efdfc3;border-radius:8px;color:var(--warn);background:var(--warnbg);line-height:1.8;margin:12px 0}.notice.good{color:var(--ok);border-color:var(--okline);background:var(--okbg)}.notice.bad{color:var(--bad);border-color:#ecd2cc;background:var(--badbg)}.chips{display:flex;gap:7px;flex-wrap:wrap}.chip,.badge{display:inline-block;border:1px solid #e9e2dc;border-radius:5px;font-size:10px;padding:3px 7px;background:#f9f7f5;color:var(--muted);font-weight:500;white-space:nowrap}.badge.ok{background:var(--ok);border-color:var(--ok);color:#fff}.badge.warn{background:var(--warnbg);border-color:#efdfc3;color:var(--warn)}.badge.muted{color:var(--muted);background:#f5f3f1}.empty{padding:47px 20px;text-align:center;color:var(--muted)}.empty .empty-icon{display:grid;place-items:center;font-size:24px;color:#b8a89b;background:#f8f4f1;width:54px;height:54px;border-radius:13px;margin:0 auto 12px}.empty strong{font-size:14px;display:block;color:#6f655c;font-weight:550}.empty p{font-size:12px;margin:7px auto;max-width:440px}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;text-align:left;white-space:nowrap}th{background:#faf8f6;color:var(--muted);font-size:10px;font-weight:600;letter-spacing:.025em;padding:12px 17px;border-bottom:1px solid var(--line)}td{padding:14px 17px;border-bottom:1px solid #f0ece8;font-size:12px;vertical-align:middle}tbody tr:last-child td{border-bottom:0}tbody tr:hover{background:#fdfbf9}.cell-sub{display:block;font-size:10px;color:var(--muted);margin-top:3px}.amount{font-variant-numeric:tabular-nums;text-align:right}.table-tools{padding:16px 20px;display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--line)}input.search{max-width:420px;font-size:12px}select.filter{width:auto;min-width:130px;font-size:12px}.count{margin-left:auto;color:var(--muted);font-size:11px}.page-foot{padding:13px 20px;display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--muted);border-top:1px solid var(--line)}.help-list{margin:0;padding:0;list-style:none}.help-list li{padding:11px 0;border-bottom:1px solid #eee9e5;font-size:12px;color:var(--muted)}.help-list li:last-child{border:0}.help-list strong{color:#554a42;font-weight:550;display:block;margin-bottom:3px}.rule-item{display:flex;gap:12px;padding:14px 0;border-bottom:1px solid #f0ece8}.rule-item:last-child{border:0}.rule-number{width:24px;height:24px;flex-shrink:0;display:grid;place-items:center;border-radius:6px;font-size:11px;color:var(--accent);background:var(--soft)}.rule-item p{margin:3px 0 0;font-size:12px;color:var(--muted)}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.settings-grid .wide{grid-column:1/-1}code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;background:#f5f1ed;padding:2px 5px;border-radius:4px}.loading{text-align:center;padding:100px;color:var(--muted)}#toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);background:#30251f;color:white;border-radius:9px;padding:11px 18px;box-shadow:0 5px 20px #0002;z-index:100;opacity:0;pointer-events:none;transition:opacity .2s}#toast.show{opacity:1}dialog{border:1px solid var(--line);border-radius:13px;box-shadow:0 20px 90px #0003;padding:0;max-width:1100px;width:calc(100% - 44px);max-height:92vh;color:var(--ink);background:var(--bg)}dialog::backdrop{background:#1d171345;backdrop-filter:blur(2px)}.modal-head{position:sticky;top:0;background:#fff;padding:17px 22px;display:flex;align-items:center;justify-content:space-between;z-index:2;border-bottom:1px solid var(--line)}.modal-head h2{font-size:17px}.icon-btn{color:var(--muted);background:none;padding:3px 10px;font-size:24px;font-weight:400}.icon-btn:hover{background:#f2ece6}#modal-body{padding:24px}.modal-form{max-width:640px;margin:auto;background:white;padding:24px;border:1px solid var(--line);border-radius:10px}.modal-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:20px}.sheet-tabs{display:flex;gap:4px;margin:0 auto 15px;max-width:800px}.sheet-tabs button{border:1px solid var(--line);background:#fff;color:var(--muted);font-size:12px}.sheet-tabs button.on{color:var(--accent);background:var(--soft);border-color:#dbc9bb}.paper{background:white;max-width:800px;margin:auto;min-height:720px;padding:45px 35px;color:#111;font:12px/1.55 SimSun,"Songti SC",serif;box-shadow:0 3px 15px #0000000a;border:1px solid #e4e0da}.paper h2{text-align:center;font-size:20px;font-weight:bold;margin:0 0 28px}.paper-meta{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-bottom:27px}.paper-meta p{margin:5px 0;white-space:pre-wrap}.paper-meta b{display:inline-block;min-width:82px;font-weight:normal}.paper table{white-space:normal;border-collapse:collapse}.paper th,.paper td{padding:5px 7px;border:1px solid #000;color:#000;background:#fff;font-size:12px}.paper th{font-weight:normal}.paper .total{font-weight:bold}.signatures{display:grid;grid-template-columns:1fr 1fr;gap:32px;margin-top:65px;line-height:2.4}.paper-caption{text-align:center;font-size:11px;color:var(--muted);margin-top:13px}.detail-preview{overflow:auto;background:white;max-height:60vh}.detail-preview table{font-size:11px}.detail-preview td,.detail-preview th{font-size:11px;padding:8px}.hint-line{font-size:11px;color:var(--muted);margin:8px 0}.subnav-link{color:var(--accent);font-size:12px;text-decoration:none}.unit-fix{font-size:11px;color:var(--muted)}@media(min-width:1460px){main{padding-left:0;padding-right:0}}@media(max-width:1460px){main{padding-left:32px;padding-right:32px}}@media(max-width:1000px){.grid{grid-template-columns:1fr 290px}.top-inner{padding:0 25px}.nav{padding:0 25px}.nav>div{gap:20px}main{padding-left:24px;padding-right:24px}.stepper{gap:14px}.local-mark{display:none}.settings-grid{grid-template-columns:1fr}}@media(max-width:760px){.top{height:64px}.top-inner{padding:0 17px}.brand{gap:12px}.brand img{width:112px}.brand strong{font-size:14px}.prototype{display:none}.top-right{gap:8px}.nav{padding:0 17px;overflow:auto;height:51px}.nav>div{gap:22px;min-width:max-content}.nav button{font-size:12px}.grid{grid-template-columns:1fr}.right-stack{order:0}.page-title{align-items:flex-start;flex-direction:column;gap:12px}.page-title .actions{width:100%}.page-title .actions button{flex:1}main{padding:22px 16px 50px}h1{font-size:22px}.stepper{gap:9px;justify-content:space-between}.stepper>span{font-size:10px;gap:5px}.stepper .line{display:none}.card-head,.card-body{padding:18px}.summary{gap:8px}.summary .value{font-size:21px}.summary .label{font-size:10px}.upload-foot{align-items:flex-start;flex-direction:column}.table-tools{flex-wrap:wrap;padding:13px}input.search{max-width:none}.count{margin-left:0}.settings-grid{grid-template-columns:1fr}.settings-grid .wide{grid-column:auto}.paper{padding:24px 15px}.paper-meta{grid-template-columns:1fr;gap:6px}.signatures{gap:15px}.paper-caption{line-height:1.7}#modal-body{padding:13px}.modal-form{padding:17px}.two{gap:9px}.brand>span{height:20px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

.contract-table td,.contract-table th{padding-left:12px;padding-right:12px}.contract-table .row-actions button{display:block;padding:3px 4px;font-size:11px}.contract-table .row-actions{min-width:70px}
/* Monthly flow: keep one decision visible at a time. */
main{max-width:1200px;padding-top:32px}.page-title{margin-bottom:30px}.simple-steps{display:flex;align-items:center;gap:20px;max-width:680px;margin:0 auto 30px;color:var(--muted);font-size:13px}.simple-steps span{display:flex;align-items:center;gap:10px;white-space:nowrap}.simple-steps b{display:grid;place-items:center;width:28px;height:28px;border:1px solid #ded7d2;border-radius:50%;font-size:12px;font-weight:500}.simple-steps i{height:1px;background:var(--line);flex:1}.simple-steps .current{color:#92553d;font-weight:600}.simple-steps .current b{background:#ad684b;color:white;border-color:#ad684b}.simple-steps .complete b{background:var(--accent-dark);color:#fff;border-color:var(--accent-dark)}.start-card{max-width:820px;margin:auto}.start-card .card-body{padding:32px}.start-card .drop{min-height:280px;background:#fdfbf9}.start-card .drop strong{font-size:18px}.start-card .upload-icon{margin-bottom:18px}.start-footer{display:flex;justify-content:space-between;gap:16px;font-size:11px;color:var(--muted);padding-top:18px}.start-note{text-align:center;margin-top:22px;color:var(--muted);font-size:12px}.batch-overview{margin-bottom:20px}.batch-overview .card-body{padding:20px 24px}.source-line{display:flex;justify-content:space-between;align-items:center;gap:15px}.source-line>div{display:flex;gap:12px;align-items:center;min-width:0}.source-line strong{font-size:13px;font-weight:550;overflow-wrap:anywhere}.file-label{font-size:11px;background:var(--ok);border:1px solid var(--ok);color:#fff;padding:3px 8px;border-radius:5px;white-space:nowrap}.overview-counts{display:flex;gap:30px;align-items:center;margin-top:18px;color:var(--muted);font-size:12px;flex-wrap:wrap}.overview-counts b{font-size:18px;color:var(--ink);font-weight:600;margin-right:4px}.overview-counts details{margin-left:auto;position:relative;font-size:11px}.overview-counts details>div{position:absolute;right:0;top:28px;z-index:3;min-width:220px;border:1px solid var(--line);padding:12px 18px;background:white;border-radius:8px;box-shadow:var(--shadow)}summary{cursor:pointer;list-style-position:inside}summary:focus-visible{outline:2px solid #ad684b;outline-offset:3px}.purchase-card{margin-bottom:24px}.purchase-card .card-head{align-items:flex-start}.purchase-card .card-head .hint-line{margin-bottom:0;max-width:660px;font-size:12px}.gap-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:25px}.gap-grid>div{padding:3px 18px;border-left:2px solid #dec5b5}.gap-grid strong{display:block;font-size:14px;font-weight:550}.gap-grid span{display:block;color:#9a621e;font-size:12px;margin:5px 0}.gap-grid small{display:block;color:var(--muted);font-size:11px}.purchase-next{background:#f8f4f0;border:1px solid #eee3da;border-radius:9px;display:flex;justify-content:space-between;align-items:center;gap:28px;padding:20px}.purchase-next strong{font-size:14px;font-weight:550}.purchase-next p{font-size:12px;color:var(--muted);margin:6px 0 0;max-width:660px}.purchase-next button{flex-shrink:0}.disclosure{font-size:12px;color:var(--muted);border-top:1px solid #eee9e5;padding:15px 0 0;margin-top:16px}.disclosure p{line-height:1.9;max-width:850px}.waiting-output{display:flex;gap:16px;align-items:center;padding:12px 22px 25px;color:var(--muted)}.waiting-output>span{display:grid;place-items:center;width:30px;height:30px;border:1px solid var(--line);border-radius:50%;font-size:12px}.waiting-output strong{font-size:13px;font-weight:500}.waiting-output p{font-size:12px;margin:4px 0 0}.batch-options{margin-bottom:20px}.option-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:20px}.option-grid .field{margin-bottom:0}.option-note{display:flex;justify-content:space-between;gap:20px;align-items:center;font-size:11px;color:var(--muted);margin-top:14px}.review-strip{display:flex;align-items:center;justify-content:space-between;gap:20px;border:1px solid #efdfc3;background:#fff9ef;border-radius:9px;padding:16px 22px;margin-bottom:20px}.review-strip strong{font-size:13px;display:block;font-weight:550}.review-strip span{display:block;font-size:12px;color:var(--muted);margin-top:3px}.batch-bottom{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:20px;font-size:11px;color:var(--muted)}.purchase-settings{margin-bottom:20px}.purchase-settings .field{max-width:800px}.contract-table .row-actions button{display:inline-block;font-size:12px;margin:0 3px}.contract-table .row-actions{min-width:170px}.contract-table td{padding-top:18px;padding-bottom:18px}.settings-grid .formula{line-height:2}
@media(max-width:800px){.simple-steps{gap:10px;font-size:12px}.simple-steps span{gap:6px}.simple-steps b{width:24px;height:24px}.start-card .card-body{padding:20px}.start-footer{flex-direction:column;gap:8px}.overview-counts{gap:18px}.overview-counts details{margin-left:0}.gap-grid{grid-template-columns:1fr 1fr;gap:22px 10px}.purchase-next{flex-direction:column;align-items:flex-start;gap:16px}.option-grid{grid-template-columns:1fr 1fr;gap:14px}.option-note,.batch-bottom{align-items:flex-start;flex-direction:column}.source-line{align-items:flex-start}.source-line>div{align-items:flex-start;flex-direction:column;gap:6px}.review-strip{align-items:flex-start}.purchase-card .card-head{flex-direction:column;gap:8px}}

.batch-facts{display:grid;grid-template-columns:1fr 1fr;gap:24px}.batch-facts small{display:block;color:var(--muted);font-size:11px;margin-bottom:6px}.batch-facts strong{display:block;font-size:15px;font-weight:550}.batch-facts span{display:block;color:var(--muted);font-size:11px;margin-top:5px}.duty-entry{margin-top:20px;max-width:420px}.duty-entry .field{margin-bottom:0}@media(max-width:600px){.batch-facts{grid-template-columns:1fr;gap:18px}}
.library-summary{display:flex;gap:24px;align-items:center;flex-wrap:wrap;color:var(--muted);font-size:12px;margin-bottom:20px}.library-summary b{color:var(--ink);font-size:18px;margin-right:5px;font-weight:600}.source-long{white-space:normal;max-width:450px;overflow-wrap:anywhere;vertical-align:top}.source-long .cell-sub{white-space:normal;line-height:1.8}.source-table th{font-size:11px}.source-table td{vertical-align:top}.modal-form .disclosure{margin-bottom:16px}.modal-form .disclosure p{white-space:normal;overflow-wrap:anywhere}

/* Material names: three primary fields, compact customer and provenance. */
.dictionary-table{table-layout:fixed;min-width:860px}.dictionary-table th:nth-child(1){width:20%}.dictionary-table th:nth-child(2){width:36%}.dictionary-table th:nth-child(3){width:25%}.dictionary-table th:nth-child(4){width:11%}.dictionary-table th:nth-child(5){width:8%}.dictionary-table td{vertical-align:top}.dictionary-table .material-code,.dictionary-table .material-description,.dictionary-table .material-chinese{white-space:normal;overflow-wrap:anywhere;line-height:1.65}.dictionary-table strong{font-weight:550}.dictionary-table .cell-sub{white-space:normal;font-size:11px;margin-top:3px}.name-option{display:inline-block;margin:0 10px 2px 0}.pending-label{color:var(--warning,#9a6a21)}.source-context{display:block;font-size:11px;color:var(--muted);margin-bottom:5px}.source-location summary{cursor:pointer;line-height:1.7}.source-location p{font-size:11px;color:var(--muted);margin:6px 0;overflow-wrap:anywhere}.source-name{white-space:normal;min-width:95px;line-height:1.7}.source-table th:nth-child(1){width:35%}.source-table th:nth-child(2){width:16%}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

.dictionary-table th:nth-child(1){width:16%}.dictionary-table th:nth-child(2){width:32%}.dictionary-table th:nth-child(3){width:23%}.dictionary-table th:nth-child(4){width:13%}.dictionary-table th:nth-child(5){width:9%}.dictionary-table th:nth-child(6){width:7%}.material-customer{white-space:normal;overflow-wrap:anywhere}

@media(max-width:700px){.dictionary-table{display:block;min-width:0;table-layout:auto}.dictionary-table thead{display:none}.dictionary-table tbody{display:block}.dictionary-table tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);padding:16px;gap:12px 16px;border-bottom:1px solid var(--line,#e7e5e2)}.dictionary-table td{display:block;padding:0;border:0;min-width:0;white-space:normal}.dictionary-table td[data-label]:before{content:attr(data-label);display:block;color:var(--muted);font-size:10px;letter-spacing:.02em;margin-bottom:3px}.dictionary-table .material-code,.dictionary-table .material-description{grid-column:1/-1}.dictionary-table .material-code{font-size:14px}.dictionary-table .material-description{font-size:12px}.dictionary-table td:nth-child(5){align-self:end}.dictionary-table td:nth-child(6){text-align:right}.dictionary-table .quiet{padding:3px 0}.dictionary-table .empty{grid-column:1/-1}.dictionary-table tr:last-child{border-bottom:0}}

/* Keep labels and business values; omit explanatory microcopy. */
h1{margin-bottom:0}.batch-facts .fact-label{display:block;color:var(--muted);font-size:12px;margin-bottom:6px}.start-footer{justify-content:flex-end}.batch-bottom{justify-content:flex-end}.drop>strong{margin-bottom:18px}

.contract-dates{display:grid;grid-template-columns:1fr 1fr;gap:14px}.contract-dates .field{margin:0}.contract-dates input{min-width:0}.batch-facts{align-items:center}.batch-facts:has(.contract-dates){grid-template-columns:minmax(0,2fr) minmax(140px,1fr)}@media(max-width:600px){.batch-facts:has(.contract-dates){grid-template-columns:1fr}.contract-dates{gap:12px}}

.dictionary-table th{vertical-align:top}.column-filter label{display:flex;flex-direction:column;gap:9px}.column-filter input{width:100%;min-width:0;border:1px solid var(--line);border-radius:6px;padding:7px 9px;background:white;color:var(--ink);font-size:12px;font-weight:400}.column-filter input::placeholder{color:#b1a8a1}.dictionary-table thead tr{background:#faf8f6}@media(max-width:700px){.dictionary-table thead{display:block}.dictionary-table thead tr{display:grid;grid-template-columns:1fr 1fr;padding:14px;gap:12px;border-bottom:1px solid var(--line)}.dictionary-table thead th{display:none;border:0;padding:0;min-width:0;background:transparent}.dictionary-table thead th.column-filter{display:block}.column-filter label{gap:6px}.column-filter input{font-size:12px}}

@media(max-width:700px){.dictionary-table thead th.column-filter{width:auto}}

.dictionary-table{min-width:700px}.dictionary-table th,.dictionary-table td{padding-left:12px;padding-right:12px}.dictionary-table th{white-space:normal}.dictionary-table .quiet{padding-left:0;padding-right:0}.dictionary-table th:nth-child(2){width:30%}.dictionary-table th:nth-child(5){width:11%}@media(max-width:700px){.dictionary-table{min-width:0}.dictionary-table td{padding:0}.dictionary-table thead th.column-filter{width:auto;padding:0}}

.header-search-trigger{display:inline-flex;align-items:center;gap:7px;padding:0;border:0;border-radius:4px;background:transparent;color:inherit;text-align:left;font-size:inherit;font-weight:inherit;line-height:1.6}.header-search-trigger:hover{background:transparent;color:var(--accent)}.header-search-trigger svg{width:13px;height:13px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;opacity:.55}.header-search-trigger.active{color:var(--accent)}.header-search-trigger.active svg{opacity:1}.column-search-panel{position:fixed;inset:auto;margin:0;padding:10px;border:1px solid var(--line);border-radius:9px;background:white;color:var(--ink);box-shadow:0 8px 24px #30251f1c;max-width:calc(100vw - 24px);overflow:visible}.column-search-panel::backdrop{background:transparent}.column-search-row{display:flex;align-items:center;gap:10px}.column-search-panel input{flex:1;width:0;min-width:0;font-size:12px}.column-search-panel .quiet{flex:none;padding:5px 0;font-size:12px}.dictionary-table .column-filter{vertical-align:middle}

/* Top-level workflow and nested administration navigation. */
.top{height:auto;min-height:72px;background:#211a17}.top-inner{max-width:none;min-height:72px;padding:10px 26px;gap:24px}.brand{gap:12px;flex:none}.brand img{width:137px}.brand-divider{display:block;width:1px;height:27px;background:#58473e;flex:none}.app-badge{display:flex;align-items:center;gap:8px;padding:5px 10px;border:1px solid #b67b58;border-radius:10px;white-space:nowrap}.app-badge svg{width:20px;height:20px;fill:none;stroke:#cd9774;stroke-width:1.6}.app-badge strong{font-size:15px}.top-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;min-width:0}.main-tabs{display:flex;align-items:center;gap:3px;padding:4px;border:1px solid #55453c;border-radius:12px;background:#2b221e;white-space:nowrap}.main-tabs button{padding:7px 13px;border-radius:8px;background:transparent;color:#c9beb7;font-weight:550;font-size:13px;border:0}.main-tabs button:hover{background:#3b302a;color:white}.main-tabs button.active{background:white;color:#302822;box-shadow:0 1px 3px #0002}.new-contract{display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;padding:11px 15px;border-radius:10px;font-size:13px}.new-contract>span{font-size:17px;line-height:1}.admin-tab{display:grid;place-items:center;flex:none;width:40px;height:40px;padding:8px;border:1px solid #78675d;background:transparent;color:#ded5ce;border-radius:10px}.admin-tab svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.admin-tab:hover{background:#3b302a}.admin-tab.active{background:#f6eee8;color:#935b40;border-color:#bd8b6c}.top-actions .avatar{flex:none;width:34px;height:34px;font-size:11px}.admin-layout{display:grid;grid-template-columns:174px minmax(0,1fr);gap:28px;align-items:start}.admin-sidebar{padding:8px;border:1px solid var(--line);border-radius:11px;background:white;display:flex;flex-direction:column;gap:5px}.admin-sidebar button{background:transparent;color:var(--muted);font-size:13px;padding:11px 14px;font-weight:500;text-align:left;border-radius:7px}.admin-sidebar button:hover{background:#faf6f2;color:var(--accent)}.admin-sidebar button.active{background:var(--soft);color:var(--accent);font-weight:600}.admin-content{min-width:0}.admin-content .page-title{margin-bottom:24px}main:has(.admin-layout){max-width:1400px}.admin-content .settings-grid{grid-template-columns:1fr 1fr}.admin-content .dictionary-table{min-width:700px}@media(max-width:1150px){.top-inner{gap:14px;padding:11px 20px}.app-badge strong{font-size:13px}.brand img{width:115px}.app-badge{padding:5px 8px}.top-actions{gap:8px}.main-tabs button{padding:7px 10px;font-size:12px}.new-contract{padding:11px 12px;font-size:12px}.admin-layout{grid-template-columns:148px minmax(0,1fr);gap:20px}.admin-content .settings-grid{grid-template-columns:1fr}}@media(max-width:950px){.top-inner{flex-wrap:wrap;padding:12px 20px;gap:12px}.brand{flex:1}.top-actions{flex:1;justify-content:flex-end}.admin-layout{grid-template-columns:1fr;gap:22px}.admin-sidebar{flex-direction:row;padding:5px;justify-self:start}.admin-sidebar button{padding:9px 17px;text-align:center}.admin-content .settings-grid{grid-template-columns:1fr 1fr}}@media(max-width:760px){.top-inner{padding:12px 16px}.top-actions{width:100%;flex-basis:100%;justify-content:space-between;gap:8px}.main-tabs{flex:1;justify-content:space-around}.main-tabs button{padding:7px 11px}.brand img{width:112px}.app-badge strong{font-size:13px}.brand-divider{height:23px}.app-badge svg{width:18px;height:18px}.new-contract{padding:10px 12px}.admin-tab{width:36px;height:36px}.top-actions .avatar{width:30px;height:30px;font-size:10px}.admin-sidebar{width:100%;justify-self:stretch}.admin-sidebar button{flex:1;padding:9px 8px}.admin-content .settings-grid{grid-template-columns:1fr}}@media(max-width:700px){.admin-content .dictionary-table{min-width:0}}@media(max-width:390px){.top-actions .avatar{display:none}.main-tabs button{padding:7px 8px;font-size:11px}.new-contract{padding:10px;font-size:11px}}

.admin-tab{display:inline-flex;align-items:center;justify-content:center;gap:7px;width:auto;min-width:40px;padding:8px 11px;white-space:nowrap;font-size:12px;font-weight:500}@media(max-width:760px){.admin-tab{min-width:36px;padding:7px}.admin-tab>span{display:none}}

/* Plain text navigation, matching the supplied header reference. */
.plain-top .top-inner{min-height:64px;padding:0 26px;flex-wrap:nowrap;gap:24px}.header-left{display:flex;align-items:center;gap:30px;min-width:0}.plain-top .brand{gap:12px}.plain-top .brand img{width:127px}.plain-top .brand strong{font-size:14px;font-weight:500;color:#e7dfd8;white-space:nowrap}.plain-top-nav{display:flex;align-items:stretch;align-self:stretch;gap:25px;min-width:0;white-space:nowrap}.plain-top-nav>button{display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:20px 0;border:0;border-radius:0;background:transparent;color:#bfb6af;font-weight:500;font-size:14px;position:relative}.plain-top-nav>button:hover{color:white;background:transparent}.plain-top-nav>button.active{color:#fff}.plain-top-nav>button.active:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background:#b47a5b}.nav-chevron{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.5}.header-tools{display:flex;align-items:center;gap:18px;flex:none;margin-left:auto}.header-gear{padding:5px;border:0;background:transparent;color:#bfb6af;display:grid;place-items:center;width:30px;height:32px}.header-gear svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.header-gear:hover,.header-gear.active{background:transparent;color:white}.plain-top .avatar{width:30px;height:30px;font-size:10px;border-color:#625148;background:transparent}.nav-dropdown{position:fixed;inset:auto;margin:0;width:180px;padding:6px;border:1px solid #55463c;border-radius:7px;background:#2b231f;color:#e4dcd5;box-shadow:0 8px 22px #0003}.nav-dropdown::backdrop{background:transparent}.nav-dropdown>button{display:block;text-align:left;width:100%;border:0;border-radius:4px;padding:10px 13px;background:transparent;color:inherit;font-size:13px;font-weight:400}.nav-dropdown>button:hover,.nav-dropdown>button:focus-visible{background:#44342b;color:white}.nav-dropdown>button.active{color:#e9ba9b;background:#3c2d25}@media(max-width:1150px){.header-app-title{display:none}.header-left{gap:24px}.plain-top-nav{gap:24px}.plain-top .top-inner{gap:20px}}@media(max-width:760px){.plain-top .top-inner{padding:0 16px;min-height:60px;gap:15px}.plain-top .brand img{width:106px}.header-left{gap:18px;flex:1}.plain-top-nav{gap:17px}.plain-top-nav>button{font-size:12px;padding:20px 0}.header-tools{gap:9px}.brand-divider{display:none}}@media(max-width:480px){.plain-top .top-inner{padding:0 12px;gap:10px}.plain-top .brand img{width:89px}.header-left{gap:14px}.plain-top-nav{gap:12px;overflow-x:auto}.plain-top-nav>button{font-size:11px;flex:none}.header-tools .avatar{display:none}.header-tools{gap:0}.header-gear{width:24px}.nav-dropdown{width:170px}}

.plain-top{min-height:64px}@media(max-width:760px){.plain-top{min-height:60px}}

/* Three supporting pages live in the gear menu. */
.nav-dropdown{width:208px;padding:5px;background:#fff;color:#49413b;border:1px solid #e9e1db;border-radius:7px;box-shadow:0 5px 16px #30251f21}.nav-dropdown>button{display:flex;align-items:center;gap:11px;padding:10px 12px;color:#49413b;font-size:13px}.nav-dropdown>button svg{width:17px;height:17px;fill:none;stroke:#94877c;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;flex:none}.nav-dropdown>button:hover,.nav-dropdown>button:focus-visible{background:#f6f2ee;color:#302822}.nav-dropdown>button.active{background:#f6eee8;color:#985f42}.nav-dropdown>button.active svg{stroke:#ad7755}.header-gear{width:38px;height:36px;border:1px solid transparent;border-radius:7px}.header-gear:hover,.header-gear.active,.header-gear[aria-expanded="true"]{border-color:#a69b93;background:#ffffff0b;color:white}.plain-top-nav{gap:28px}@media(max-width:480px){.header-gear{width:32px;height:34px}.nav-dropdown{width:208px}.plain-top-nav{gap:16px}}

.usage-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.usage-metrics .card{padding:24px}.usage-metrics span{display:block;color:var(--muted);font-size:13px}.usage-metrics strong{display:block;font-size:30px;font-weight:550;margin-top:10px}@media(max-width:600px){.usage-metrics{grid-template-columns:1fr;gap:12px}.usage-metrics .card{padding:20px}}

/* Authentication and administration use the existing LS tokens. */
[hidden]{display:none!important}.login-gate{min-height:100vh;display:grid;place-items:center;padding:24px;background:#f4f5f7}.login-card{width:min(440px,100%);padding:40px;text-align:center}.login-card>img{width:150px;background:#261f1b;padding:14px;border-radius:8px;box-sizing:content-box}.login-card h1{margin:30px 0;font-size:23px}.login-card p{color:#857a73;font-size:14px;min-height:20px}.account{display:flex;align-items:center;gap:9px;color:#d5cfca;font-size:13px}.account-name{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-logout{padding:5px 9px;background:transparent;border:1px solid #665c55;color:inherit;font-size:12px}.access-table select{min-width:130px}.role-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:20px}.role-summary .card{padding:20px}.role-summary p{font-size:14px;line-height:1.7;color:#877b73;margin:10px 0 0}.role-summary strong{font-size:16px}.admin-error{padding:24px;color:#a74c32}.access-table .checkbox{display:inline-flex;margin:0}.admin-subtitle{margin:0 0 16px;color:#857a73}.permission-disabled{opacity:.45}.account-logout:disabled{opacity:.7}@media(max-width:850px){.account-name{display:none}.role-summary{grid-template-columns:1fr}.header-tools{gap:8px}}

.demo-account-switch{background:#302823;color:#e9e2dc;border:1px solid #665c55;border-radius:6px;padding:6px 8px;font:inherit;max-width:128px}.demo-account-switch option{background:#302823;color:#fff}

.roles-panel{padding:27px}.role-add-bar{display:flex;align-items:center;gap:10px;margin-bottom:18px}.role-add-bar>input{width:360px;max-width:100%;height:44px}.role-add-bar>select{width:170px;height:44px}.role-add-bar>button{height:44px;padding:0 19px;white-space:nowrap}.role-add-bar>button>span{font-size:21px;vertical-align:-1px;margin-right:5px}.roles-list{width:100%;table-layout:fixed}.roles-list th{background:#f6f1ed;font-size:14px;font-weight:500;padding:9px 14px}.roles-list td{padding:10px 14px;height:58px;font-size:15px;border-bottom:1px solid #eee5df;vertical-align:middle}.roles-list th:nth-child(1){width:34%}.roles-list th:nth-child(2){width:18%}.roles-list th:nth-child(3){width:36%}.roles-list th:last-child,.roles-list td:last-child{text-align:right}.roles-list .cell-sub{font-size:13px;line-height:1.5;margin-top:1px}.assigned-at{color:var(--muted)}.role-edit{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:8px;border:1px solid #e5d8cf;background:white;border-radius:7px;color:#97887a}.role-edit svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.role-edit:hover{background:#faf6f2}.role-edit:disabled{opacity:.35}.roles-pagination{display:flex;justify-content:space-between;align-items:center;padding-top:14px;font-size:13px;color:var(--muted)}.roles-pagination>div{display:flex;align-items:center;gap:9px}.role-page-arrow{width:32px;height:32px;padding:0;border:1px solid #e7dcd4;border-radius:7px;background:white;color:var(--muted);font-size:24px;line-height:1}.role-page-arrow:disabled{opacity:.35}.roles-list .badge{margin-left:9px}@media(max-width:650px){.roles-panel{padding:16px}.role-add-bar{flex-wrap:wrap}.role-add-bar>input{width:100%}.role-add-bar>select{flex:1}.roles-list{min-width:600px}.roles-pagination{gap:12px}}
.role-add-bar>input,.role-add-bar>select{font:inherit;font-size:14px;color:#302a25;border:1px solid #e5d8cf;border-radius:7px;background:#fff;padding:0 13px;box-sizing:border-box}.role-add-bar>input::placeholder{color:var(--muted)}.role-add-bar>input:focus,.role-add-bar>select:focus{outline:2px solid #c18f78;outline-offset:2px}

/* Shared UI scale. Contract paper retains its original document typography. */
:root{--bg:#f5f6f7;--card:#fff;--ink:#302b27;--muted:#756d67;--line:#e7e1dc;--soft:#f7f3ef;--accent:#9d6047;--accent-dark:#844c35;--shadow:0 1px 3px #302b2708,0 3px 12px #302b2704}
body{font-size:14px;line-height:1.6;-webkit-font-smoothing:antialiased}
main{max-width:1280px;padding-top:32px}
h1{font-size:25px;line-height:1.35;letter-spacing:-.025em;font-weight:600}
h2{font-size:16px;font-weight:600;color:var(--ink)}
.page-title{margin-bottom:24px;min-height:40px}.page-title .actions:empty{display:none}
button{font-size:14px;font-weight:500;line-height:1.5;border-radius:8px;padding:9px 16px}
button.secondary{color:var(--ink);border-color:var(--line)}
button.quiet{font-size:13px;font-weight:500;padding:5px 8px;color:var(--accent)}
button.quiet:hover{background:var(--soft)}
button:disabled{opacity:.5;cursor:not-allowed}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.card{border-color:var(--line);border-radius:12px;box-shadow:var(--shadow)}
.card-head{padding:18px 24px;border-color:var(--line)}.card-body{padding:24px}
main th{font-size:12px;font-weight:500;letter-spacing:0;background:#f8f5f2;color:var(--muted);padding:12px 16px;vertical-align:middle}
main td{font-size:14px;line-height:1.6;padding:15px 16px;border-bottom-color:var(--line)}
main td strong{font-weight:500}main tbody tr:hover{background:#fcfaf8}
.cell-sub{font-size:12px;color:var(--muted);line-height:1.5;margin-top:3px}
.field{font-size:13px;font-weight:500;line-height:1.5;color:var(--muted);gap:8px;margin-bottom:20px}
:is(main,.modal-form) :is(input:not([type='checkbox']):not([type='hidden']),select,textarea){font:inherit;font-size:14px;color:var(--ink);border:1px solid #d9d1ca;border-radius:8px;background:#fff;padding:9px 12px;min-height:40px;line-height:1.5}
:is(main,.modal-form) input::placeholder{color:#8b8179}
.checkbox{font-size:14px;line-height:1.5;color:var(--ink);gap:9px}.checkbox input{width:16px;height:16px;margin:0;flex:none}
.badge{font-size:12px;line-height:1.5;padding:2px 8px;border-radius:5px;font-weight:500}.badge.muted{color:var(--muted)}
.notice{font-size:14px;padding:12px 16px}.notice p{margin:4px 0 0}.notice strong{font-weight:600}.notice.bad{color:#94463f}
.empty strong{font-size:14px;color:var(--muted);font-weight:500}.loading{font-size:14px;padding:72px 20px}
.page-foot,.roles-pagination{font-size:13px;color:var(--muted);padding:14px 20px;gap:12px}
.roles-pagination{padding:16px 0 0}.roles-panel{padding:26px}
.roles-list th{font-size:13px;padding:10px 14px;color:var(--muted);background:var(--soft)}
.roles-list td{font-size:14px;height:58px;padding:10px 14px;border-bottom-color:var(--line)}
.roles-list .cell-sub{font-size:12px}.assigned-at{color:var(--muted)}
.role-edit{color:var(--muted);border-color:#ded5ce;width:36px;height:36px;padding:8px}
.role-page-arrow{color:var(--muted);border-color:var(--line)}
.role-add-bar{gap:10px;margin-bottom:20px}.role-add-bar>button{height:42px}.role-add-bar>input,.role-add-bar>select{height:42px}
.roles-list th:last-child,.roles-list td:last-child{width:72px}
.simple-steps{font-size:13px;margin-bottom:26px;color:var(--muted)}.simple-steps .current{color:var(--accent);font-weight:500}.simple-steps .current b{background:var(--accent);border-color:var(--accent)}
.start-card{max-width:820px}.start-card .card-body{padding:32px}.start-card .drop{min-height:280px;background:#fdfbf9;border-color:#d6c7bc}.drop strong{font-size:18px;font-weight:500}.subnav-link{font-size:13px;color:var(--accent)}
.start-footer{padding-top:16px}.upload-icon{color:var(--accent);background:var(--soft);border-color:var(--line)}
.source-line strong{font-size:14px;font-weight:500}.file-label{font-size:12px}.overview-counts{font-size:13px;color:var(--muted)}.overview-counts details{font-size:13px}.overview-counts b{font-size:20px;font-weight:600}
.batch-facts:has(.contract-dates){grid-template-columns:minmax(0,1fr)}.contract-dates{max-width:640px;gap:20px}.duty-entry{max-width:310px;margin-top:20px}
.review-strip{border-color:#eadac2;background:#fffbf4;padding:16px 20px}.review-strip strong{font-size:14px;font-weight:500}
.contract-table th,.contract-table td{padding-left:16px;padding-right:16px}.contract-table .row-actions{min-width:176px}.contract-table .row-actions button{font-size:13px;margin:0 2px}
.dictionary-table th{font-size:12px}.dictionary-table td{font-size:13px;line-height:1.65;padding:16px 12px}.dictionary-table strong{font-weight:500}.dictionary-table .quiet{font-size:13px}
.header-search-trigger{font-size:12px;font-weight:500;color:var(--muted);padding:0}.header-search-trigger svg{width:14px;height:14px;opacity:.8}.header-search-trigger:hover{color:var(--accent)}
.column-search-panel{padding:12px;border-color:var(--line);box-shadow:0 6px 24px #302b2714}.column-search-panel input{font-size:14px;min-height:36px;padding:7px 10px}.column-search-panel .quiet{font-size:13px}
.source-table th{font-size:12px}.source-table td{font-size:13px}.source-location p{font-size:12px;color:var(--muted)}
.usage-metrics{margin-bottom:22px}.usage-metrics .card{padding:22px 24px}.usage-metrics span{font-size:13px;color:var(--muted)}.usage-metrics strong{font-size:30px;font-weight:600;line-height:1.2;color:var(--ink)}
.settings-grid{gap:22px;align-items:start}.settings-grid .field:last-child{margin-bottom:0}
.modal-head{padding:16px 24px}.modal-head h2{font-size:17px}.icon-btn{padding:3px 10px;font-size:24px;color:var(--muted)}.modal-form{border-color:var(--line);padding:24px}.modal-actions button{min-width:80px}
.sheet-tabs button{font-size:13px}.sheet-tabs button.on{color:var(--accent);border-color:#d8c7bb;background:var(--soft)}
.detail-preview td,.detail-preview th{font-size:13px;padding:10px 12px}
.plain-top .top-inner{min-height:64px}.plain-top-nav>button{font-size:14px;color:#ccc3bc;font-weight:500}.plain-top-nav>button.active{color:#fff}.plain-top-nav>button.active:after{background:#c28e72}
.nav-dropdown{border-color:var(--line);box-shadow:0 6px 24px #302b2714}.nav-dropdown>button{font-size:14px;color:var(--ink);padding:10px 12px}.nav-dropdown>button svg{stroke:var(--muted)}.nav-dropdown>button.active{color:var(--accent);background:var(--soft)}
.header-gear{color:#ccc3bc}.demo-account-switch{font-size:13px;font-weight:400;min-height:34px;border-color:#65554b;color:#eee7e1;border-radius:7px}.account-name{font-size:13px;color:#e1d8d1}
@media(max-width:700px){main{padding-top:24px}.card-head,.card-body{padding:18px}.roles-panel{padding:18px}.dictionary-table td{padding:0}.dictionary-table tr{padding:18px;gap:12px 18px}.dictionary-table td[data-label]:before{font-size:12px;color:var(--muted)}.dictionary-table .material-description{font-size:13px}.dictionary-table thead th.column-filter{padding:0;width:auto}.page-title{gap:14px}.start-card .card-body{padding:22px}.roles-pagination{flex-wrap:wrap;row-gap:12px}}
@media(max-width:640px){.plain-top .top-inner{display:grid;grid-template-columns:1fr auto;gap:0 14px;padding:10px 16px 0}.header-left{display:contents}.plain-top .brand{grid-column:1;grid-row:1;min-width:0}.plain-top .brand img{width:112px}.header-tools{grid-column:2;grid-row:1;gap:8px}.plain-top-nav{grid-column:1/-1;grid-row:2;gap:24px;overflow:visible;margin-top:5px}.plain-top-nav>button{font-size:13px;padding:12px 0}.plain-top{min-height:0}.contract-dates{gap:14px}.role-add-bar>input{width:100%}.role-add-bar>select{min-width:0}.overview-counts{gap:16px}.contract-table .row-actions{min-width:170px}}
.batch-options .card-body{display:flex;align-items:flex-end;flex-wrap:wrap;gap:20px 24px}.batch-options .card-body>.notice{flex-basis:100%;margin:0}.batch-options .batch-facts{flex:1;min-width:min(100%,420px)}.contract-dates{max-width:none}.batch-options .duty-entry{flex:0 1 260px;margin-top:0}.settings-grid{align-items:stretch}.dictionary-table [data-action='nameSources']{color:var(--muted)}
dialog:has(.modal-form){max-width:560px;background:#fff}dialog:has(.modal-form) .modal-form{max-width:none;margin:0;padding:0;border:0;background:transparent}
.account:has(.demo-account-switch) .account-name{display:none}@media(max-width:640px){.header-tools .avatar{display:grid;width:28px;height:28px;font-size:10px}}

.factory-review{table-layout:fixed;white-space:normal}.factory-review th:first-child{width:150px}.factory-review th,.factory-review td{padding:14px 16px;font-size:13px;vertical-align:top}.factory-review td{overflow-wrap:anywhere}.factory-review td strong{font-weight:500;display:block;margin-bottom:8px}.factory-review td div{color:var(--muted);line-height:1.7}.factory-review th{font-size:12px}.factory-review td:last-child{background:#fbf8f5}@media(max-width:650px){.factory-review{min-width:650px}.factory-review th:first-child{width:115px}}
.card-head:has([data-action='exportReport']){flex-wrap:wrap}.card-head:has([data-action='exportReport'])>.actions{margin-left:auto;justify-content:flex-end}@media(max-width:640px){.card-head:has([data-action='exportReport'])>.actions{width:100%;display:grid;grid-template-columns:1fr}.card-head:has([data-action='exportReport'])>.actions button{width:100%}}

.factory-actions{white-space:nowrap}.factory-actions button+button{margin-left:6px}button.danger-text{color:var(--bad)}button.danger-text:hover{color:var(--bad);background:var(--badbg)}button.danger-button{background:var(--bad);color:#fff}button.danger-button:hover{background:#8d3932}dialog:has(.delete-factory-confirm){max-width:520px;background:#fff}.delete-factory-confirm>strong{font-size:15px;font-weight:500}.delete-factory-confirm>p{font-size:14px;color:var(--muted);line-height:1.7;margin:14px 0 24px}

/* Contract preview */
dialog:has(.contract-preview){max-width:1180px;max-height:94vh;background:#eef1f4;overflow:hidden}
dialog:has(.contract-preview)[open]{display:flex;flex-direction:column}
dialog:has(.contract-preview) .modal-head{flex:none;background:#fff;border-bottom:1px solid #e0e5e9;padding:17px 24px}
dialog:has(.contract-preview) #modal-body{padding:0;overflow:auto;min-height:0}
.preview-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 26px;background:#fff;border-bottom:1px solid #e0e5e9;position:sticky;top:0;z-index:3}
.preview-sheets{display:flex;gap:4px;padding:3px;background:#f0f3f5;border-radius:9px}
.preview-sheets button{background:transparent;color:#68727a;border:1px solid transparent;font-size:13px;padding:7px 17px;border-radius:6px;font-weight:550}
.preview-sheets button.on{background:#fff;border-color:#e0e5e9;color:#243746;box-shadow:0 1px 3px #2437460a}
.preview-sheets button span{font-size:12px;color:#71808d;margin-left:5px;font-variant-numeric:tabular-nums}
.preview-download{display:flex;align-items:center;gap:8px;font-size:13px;padding:9px 16px}
.preview-download svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.preview-stage{padding:28px 32px 36px}
.contract-paper{max-width:860px;min-height:640px;padding:38px 42px 40px;font:14px/1.65 Arial,"PingFang SC","Microsoft YaHei",sans-serif;color:#283746;border:1px solid #dce3e8;box-shadow:0 5px 22px #26374609}
.contract-paper h2{font:600 24px/1.4 Arial,"PingFang SC","Microsoft YaHei",sans-serif;letter-spacing:2px;margin:0 0 26px;color:#243746}
.contract-facts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;padding:17px 0;border-top:1px solid #dbe5ed;border-bottom:1px solid #dbe5ed}
.contract-facts>div{display:flex;flex-direction:column;gap:5px}.contract-facts span,.contract-parties h3,.contract-signatures span{font-size:12px;font-weight:400;color:#75808b}
.contract-facts strong{font-size:14px;font-weight:550;font-variant-numeric:tabular-nums}
.contract-parties{display:grid;grid-template-columns:1fr 1fr;gap:38px;padding:25px 0 29px}
.contract-parties section{min-width:0}.contract-parties h3{margin:0 0 7px}.contract-parties strong{font-size:14px;font-weight:600;line-height:1.7;display:block}.contract-parties p{font-size:13px;line-height:1.8;color:#596673;margin:7px 0 0;overflow-wrap:anywhere}
.contract-summary-table{overflow-x:auto}.contract-paper table{width:100%;font:inherit;border-collapse:collapse;table-layout:fixed;white-space:normal}
.contract-paper th,.contract-paper td{border:1px solid #d5dfe7;padding:11px 14px;font-size:13px;background:#fff;color:#283746;line-height:1.5}
.contract-paper th{background:#e4eff6;font-weight:550}.contract-paper th:nth-child(1){width:30%}.contract-paper th:nth-child(2){width:18%}.contract-paper th:nth-child(3){width:22%}.contract-paper tfoot td{font-weight:650;border-top:2px solid #b7cdda}.contract-paper tfoot td:first-child{text-align:right;color:#596673}.contract-paper tfoot .amount{font-size:16px;color:#243746}.contract-paper .amount{font-variant-numeric:tabular-nums;white-space:nowrap}
.contract-signatures{display:grid;grid-template-columns:1fr 1fr;gap:38px;margin-top:50px}.contract-signatures>div{border-top:1px solid #dbe5ed;padding-top:14px;display:flex;flex-direction:column;gap:9px}.contract-signatures strong{font-size:13px;font-weight:500;overflow-wrap:anywhere}
.preview-stage.is-detail{padding:22px}.contract-detail{max-height:none;overflow:auto;border:1px solid #dce3e8;border-radius:8px;max-width:100%;background:#fff}
.contract-detail table{min-width:1850px;white-space:nowrap}.contract-detail th{position:sticky;top:0;background:#e4eff6;color:#31485a;font-weight:550;z-index:1}.contract-detail td,.contract-detail th{padding:12px 15px;font-size:13px;border-right:1px solid #e4e9ed;border-bottom:1px solid #e4e9ed}.contract-detail td:first-child,.contract-detail th:first-child{position:sticky;left:0;z-index:2;background:#fff;box-shadow:1px 0 0 #dce3e8}.contract-detail th:first-child{background:#e4eff6;z-index:3}.contract-detail td:nth-child(2){min-width:260px;max-width:420px;white-space:normal}.contract-detail .amount{font-variant-numeric:tabular-nums}
@media(max-width:680px){dialog:has(.contract-preview){width:calc(100% - 16px);max-height:96vh}dialog:has(.contract-preview) .modal-head{padding:14px 16px}.preview-toolbar{padding:12px;gap:8px}.preview-sheets button{padding:7px 11px}.preview-download{padding:9px 11px}.preview-stage{padding:14px 10px 20px}.contract-paper{padding:26px 19px;min-height:0}.contract-paper h2{font-size:21px;margin-bottom:20px}.contract-facts{grid-template-columns:1fr 1fr;gap:14px 24px}.contract-parties{grid-template-columns:1fr;gap:20px;padding:22px 0}.contract-paper th,.contract-paper td{padding:9px 6px;font-size:12px}.contract-paper tfoot .amount{font-size:14px}.contract-signatures{gap:22px;margin-top:35px}.preview-stage.is-detail{padding:12px}}
.contract-detail{max-height:65vh}
.form-section-title{font-size:14px;font-weight:600;border-top:1px solid var(--line);padding-top:18px;margin:4px 0 16px}
.exception-panel{padding:2px}.exception-search{display:flex;gap:10px;align-items:center;margin-bottom:16px}.exception-search input{max-width:440px;flex:1;min-width:0;border:1px solid #d9d1ca;border-radius:8px;padding:10px 12px;font:inherit;background:#fff;color:var(--ink)}.exception-table{max-height:48vh;overflow:auto;border:1px solid var(--line);border-radius:8px;background:#fff}.exception-table th{position:sticky;top:0;z-index:1}.exception-editor{display:flex;align-items:end;gap:14px;flex-wrap:wrap;padding:20px 0 2px}.exception-editor .field{margin:0;max-width:170px}.exception-editor .reason-field{max-width:none;flex:1;min-width:220px}.exception-editor button{min-height:40px}.exception-impact{font-size:13px;color:var(--muted);align-self:center;font-variant-numeric:tabular-nums}.exception-table input[type=checkbox]{accent-color:var(--accent);width:16px;height:16px}.exception-table select{border:1px solid #d9d1ca;border-radius:6px;padding:7px 10px;font:inherit;color:var(--ink);background:#fff}.decision-identity{display:flex;flex-direction:column;gap:7px;margin-bottom:22px}.decision-identity strong{font-weight:600}.decision-identity span{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}.negative-editor{max-width:620px!important}.filing-basis{white-space:normal;max-width:360px;font-size:13px;color:var(--muted)}.import-count{font-size:17px;font-weight:600;margin-bottom:18px}.duty-entry{display:flex;align-items:end;gap:12px}.duty-entry .field{margin-bottom:0;max-width:220px}.negative-strip{border-color:#ead9bd;background:#fffaf2}
@media(max-width:680px){.exception-search{flex-wrap:wrap}.exception-search input{flex-basis:100%;max-width:none}.exception-editor{display:grid;grid-template-columns:1fr}.exception-editor .field{max-width:none}.exception-editor .reason-field{min-width:0}.exception-table{max-height:42vh}.duty-entry{flex-wrap:wrap}.row-actions{flex-wrap:wrap}}

/* Inline setup feedback and a single, actionable review queue. */
.batch-setup,.batch-review{--review-soft:#f6f3ef;--review-symbol:#8a6c53;--review-border:var(--line);margin-bottom:20px}
.setup-heading,.review-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:19px 24px 0}.setup-heading h2,.review-heading h2{font-size:16px;font-weight:600;line-height:1.5}.setup-status{font-size:13px;color:var(--muted);font-weight:400}.has-error{color:var(--bad)!important}
.batch-setup-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(290px,.9fr);gap:22px;padding:20px 24px 24px;align-items:start}.batch-setup-body:not(:has(.batch-duty)){grid-template-columns:repeat(2,minmax(0,1fr))}.batch-setup .setup-field{margin:0;gap:8px;min-width:0;color:var(--muted);font-size:13px}.batch-setup input{width:100%;min-width:0;min-height:44px;background:var(--card);border:1px solid #d9d1ca;border-radius:8px;padding:10px 12px;font:inherit;font-size:14px;color:var(--ink);line-height:1.5}.batch-setup input[aria-invalid=true]{border-color:var(--bad)}.batch-setup .field-hint{font-size:12px;color:var(--muted);font-weight:400;line-height:1.5}.batch-duty{display:flex;flex-direction:column;gap:8px;min-width:0}.batch-duty>label{font-size:13px;color:var(--muted)}.duty-controls{display:grid;grid-template-columns:minmax(110px,1fr) auto;align-items:stretch;gap:10px}.duty-controls button{white-space:nowrap;min-width:104px;min-height:44px;padding:9px 14px;display:flex;align-items:center;justify-content:center;gap:7px;font-weight:500}.button-count{font-size:12px;background:var(--review-soft);border-radius:5px;padding:0 5px;color:var(--muted);font-variant-numeric:tabular-nums}
.review-heading{padding:18px 24px 12px}.review-heading>div{display:flex;align-items:center;gap:10px}.review-summary{font-size:12px;line-height:1.5;color:var(--muted);padding:2px 7px;border-radius:5px;background:var(--review-soft)}.review-items{padding:0 24px 5px}.review-item{display:flex;align-items:center;gap:13px;padding:14px 0;border-top:1px solid var(--review-border);min-height:68px}.review-item:first-child{border-top:0}.review-symbol{display:grid;place-items:center;flex:0 0 32px;width:32px;height:32px;border-radius:9px;color:var(--review-symbol);background:var(--review-soft)}.review-symbol svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.review-item.is-complete .review-symbol{color:var(--ok);background:var(--okbg)}.review-item-content{display:flex;align-items:center;gap:12px;flex:1;min-width:0;flex-wrap:wrap}.review-item-content strong{font-size:14px;font-weight:500;color:var(--ink)}.review-item-count{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}.review-item-tag{font-size:12px;color:var(--muted);padding-left:12px;border-left:1px solid var(--line)}button.review-action{display:inline-flex;align-items:center;justify-content:flex-end;gap:7px;min-height:40px;padding:8px 0 8px 12px;flex:none;white-space:nowrap;background:transparent;color:var(--accent-dark);font-size:13px;font-weight:550;border-radius:6px}button.review-action:hover{background:var(--review-soft)}.review-action svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.data-gap-input{border:1px solid var(--line);border-radius:7px;padding:9px 11px;font:inherit;max-width:190px;min-width:110px;background:var(--card);color:var(--ink)}.data-gap-reason{margin-top:20px}
@media(max-width:980px){.batch-setup-body{grid-template-columns:repeat(2,minmax(0,1fr))}.batch-duty{grid-column:1/-1;max-width:370px;width:100%}}
@media(max-width:560px){.setup-heading,.review-heading{padding-left:18px;padding-right:18px}.batch-setup-body,.batch-setup-body:not(:has(.batch-duty)){grid-template-columns:1fr;gap:17px;padding:18px}.batch-duty{max-width:none}.review-items{padding:0 18px 4px}.review-item{gap:10px;align-items:center}.review-item-content{gap:3px 9px}.review-item-content strong{flex-basis:100%}.review-item-tag{padding-left:8px}.review-action{max-width:112px}.setup-status{font-size:12px}.review-symbol{width:29px;height:29px;flex-basis:29px}}
.source-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}.drop-hint{font-size:12px;color:var(--muted)}
.dark .batch-setup,.dark .batch-review,[data-theme=dark] .batch-setup,[data-theme=dark] .batch-review{--review-soft:#332d29;--review-symbol:#d0aa8c;--review-border:#4a413b}
.batch-setup .batch-setup-body.uses-document-dates{grid-template-columns:minmax(0,1fr) minmax(290px,.65fr);align-items:start}.batch-setup .batch-setup-body.uses-document-dates:not(:has(.batch-duty)){grid-template-columns:1fr}.automatic-dates{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.automatic-dates>span{font-size:13px;color:var(--muted)}.automatic-dates>strong{font-size:14px;font-weight:500;color:var(--ink)}.automatic-dates button{display:inline-flex;align-items:center;gap:5px;padding:0;min-height:26px;font-size:13px;font-weight:400}.automatic-dates svg{height:15px;width:15px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.contract-range{font-variant-numeric:tabular-nums;white-space:nowrap;font-size:13px}.contract-range span{display:block}.contract-range span+span{color:var(--muted);margin-top:3px}
@media(max-width:800px){.batch-setup .batch-setup-body.uses-document-dates{grid-template-columns:1fr}.uses-document-dates .batch-duty{max-width:370px}}

/* Source selection and asynchronous D365 import. */
.import-choice{max-width:960px;margin:46px auto 70px}.import-choice-heading{text-align:center;margin-bottom:26px}.import-choice-heading h2{font-size:20px;font-weight:600;margin:0;color:var(--ink)}.import-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.import-option{display:flex;align-items:flex-start;flex-direction:column;text-align:left;min-width:0;padding:34px;border:1px solid var(--line);border-radius:16px;background:var(--card);color:var(--ink);box-shadow:var(--shadow);transition:border-color .2s,box-shadow .2s,transform .2s}.import-option:hover{background:var(--card);border-color:#bd8a72;box-shadow:0 8px 24px #30251f0d;transform:translateY(-2px)}.import-option-icon{display:grid;place-items:center;width:52px;height:52px;border-radius:14px;background:var(--soft);color:var(--accent);margin-bottom:28px}.import-option-icon svg{width:27px;height:27px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.import-option.is-manual .import-option-icon{color:#646f76;background:#f0f3f5}.import-option-title{font-size:22px;font-weight:600;line-height:1.4}.import-option-desc{font-size:14px;font-weight:400;color:var(--muted);margin-top:9px}.import-option-cta{display:flex;align-items:center;gap:12px;color:var(--accent);font-size:14px;font-weight:600;margin-top:40px}.import-option-cta svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.is-manual .import-option-cta{color:#646f76}.import-manual{max-width:960px;margin:36px auto 60px;padding:26px 30px 20px}.import-panel-top{display:flex;align-items:center;justify-content:space-between;gap:16px}.import-panel-top h2{font-size:18px;margin:0}.import-manual .drop{border:1px dashed #d5c9c0;background:#fdfcfa;margin-top:24px;padding:48px 20px;border-radius:12px}.import-manual .drop.over{background:var(--soft);border-color:var(--accent)}.import-manual .drop>strong{font-size:17px;font-weight:500;margin-bottom:20px}.import-manual .upload-icon{background:transparent;margin-bottom:18px;color:var(--accent)}.import-filetype{display:block;color:var(--muted);font-size:12px;margin-top:12px}.import-manual-footer{display:flex;justify-content:flex-end;margin-top:16px}.import-manual-footer a{color:var(--muted);font-size:13px;text-underline-offset:3px}.import-wait{max-width:960px;margin:36px auto 60px;padding:26px 40px 32px;text-align:center}.import-wait-top{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px;color:var(--muted)}.import-tag{font-weight:550;color:var(--ink)}.import-wait h2{font-size:22px;font-weight:600;margin:14px 0 8px}.import-stage-detail{font-size:14px;color:var(--muted);margin:0 auto;max-width:600px;overflow-wrap:anywhere;min-height:22px}.import-activity{height:4px;border-radius:8px;background:var(--soft);max-width:440px;margin:28px auto 32px;overflow:hidden}.import-activity>span{display:block;width:32%;height:100%;background:#ba8166;border-radius:8px;animation:import-travel 2s ease-in-out infinite}.import-milestones{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;max-width:630px;padding:0;margin:0 auto;list-style:none}.import-milestones li{display:flex;flex-direction:column;align-items:center;gap:10px;font-size:13px;color:var(--muted);position:relative}.import-milestones li>span{display:grid;place-items:center;width:28px;height:28px;border:1px solid var(--line);border-radius:50%;background:var(--card);z-index:1;font-size:12px}.import-milestones li+li:before{content:'';position:absolute;height:1px;top:14px;width:calc(100% - 28px);right:calc(50% + 18px);background:var(--line)}.import-milestones .is-current{font-weight:600;color:var(--accent)}.import-milestones .is-current>span{background:var(--accent);border-color:var(--accent);color:#fff}.import-milestones .is-done>span{border-color:var(--accent-dark);background:var(--accent-dark);color:#fff}.import-wait-note{margin:28px 0 0;font-size:13px;color:var(--muted)}.import-recovery{display:flex;justify-content:center;gap:12px;margin-top:30px}.import-wait.has-failed .import-stage-detail{color:var(--bad)}.import-wait.has-failed .import-milestones{margin-top:28px}.import-wait.has-failed .running-dog *,.import-wait.has-failed .dog-motion,.import-wait.has-failed .run-dash{animation-play-state:paused}.dog-runway{position:relative;max-width:300px;height:140px;margin:12px auto 0;overflow:hidden}.dog-motion{position:absolute;left:calc(50% - 70px);top:20px;width:140px;animation:dog-float .55s ease-in-out infinite}.running-dog{width:140px;height:100px;overflow:visible;fill:none;stroke:#6d5141;stroke-width:7;stroke-linecap:round;stroke-linejoin:round}.dog-coat{fill:#d8b08b;stroke:#8e6951;stroke-width:2}.dog-ear{fill:#9e7355;stroke:none}.dog-patch{fill:#f3dfc6;stroke:none}.dog-eye,.dog-nose{fill:#463831;stroke:none}.dog-collar{stroke:#ad684b;stroke-width:5}.dog-tail{transform-origin:42px 47px;animation:dog-tail .35s ease-in-out infinite alternate}.dog-leg{transform-origin:75px 63px;animation:dog-stride .55s ease-in-out infinite alternate}.back-leg,.front-leg{animation-delay:-.55s}.far-leg{stroke:#b28b6e}.dog-ground{position:absolute;width:230px;height:1px;background:var(--line);bottom:17px;left:35px}.run-dash{position:absolute;bottom:16px;height:3px;width:20px;background:#d5c1b1;border-radius:3px;animation:ground-run .8s linear infinite}.dash-one{left:240px}.dash-two{left:240px;animation-delay:-.4s;width:12px}.dog-runway .dog-motion{transform-origin:center}.import-wait.has-failed .run-dash{display:none}
@keyframes dog-stride{from{transform:rotate(-22deg)}to{transform:rotate(24deg)}}@keyframes dog-tail{from{transform:rotate(-14deg)}to{transform:rotate(16deg)}}@keyframes dog-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}@keyframes ground-run{from{transform:translateX(0);opacity:0}20%{opacity:1}to{transform:translateX(-210px);opacity:0}}@keyframes import-travel{from{transform:translateX(-100%)}to{transform:translateX(420%)}}
@media(max-width:640px){.import-choice{margin:28px auto 40px}.import-choice-heading{margin-bottom:20px}.import-choice-heading h2{font-size:18px}.import-options{grid-template-columns:1fr;gap:16px}.import-option{padding:24px;display:grid;grid-template-columns:48px minmax(0,1fr);column-gap:18px}.import-option-icon{grid-row:1/4;width:48px;height:48px;margin:0}.import-option-title{font-size:19px}.import-option-desc{font-size:13px;margin-top:5px}.import-option-cta{grid-column:2;margin-top:18px}.import-manual{padding:20px 18px;margin-top:26px}.import-manual .drop{padding:36px 14px}.import-wait{padding:22px 16px;margin-top:26px}.import-wait h2{font-size:20px}.import-stage-detail{font-size:13px}.import-milestones{gap:4px}.import-milestones li{font-size:11px}.import-milestones li+li:before{width:calc(100% - 24px);right:calc(50% + 14px)}.import-recovery{flex-wrap:wrap}.import-wait-note{font-size:12px}}
@media(prefers-reduced-motion:reduce){.import-option{transition:none}.import-option:hover{transform:none}.dog-motion,.running-dog *,.run-dash{animation:none!important}.import-activity>span{width:100%;opacity:.5;animation:none}}

/* Restored eight-frame hand-drawn walking cycle. */
.sticker-runway{height:148px;max-width:240px;margin:10px auto 0}.sticker-motion{width:132px;height:132px;left:calc(50% - 66px);top:0;animation:none;transform:none}.kesong-walk{display:block;width:132px;height:132px;background-image:url('assets/kesong-walk.png');background-repeat:no-repeat;background-size:400% 200%;background-position:0 0;animation:kesong-walk-cycle 1.1s step-end infinite}.sticker-shadow{position:absolute;left:calc(50% - 28px);bottom:13px;width:56px;height:4px;background:#b49e8b;opacity:.12;border-radius:50%}.import-wait.has-failed .kesong-walk{animation-play-state:paused}
@keyframes kesong-walk-cycle{0%{background-position:0% 0%}12.5%{background-position:33.333333% 0%}25%{background-position:66.666667% 0%}37.5%{background-position:100% 0%}50%{background-position:0% 100%}62.5%{background-position:33.333333% 100%}75%{background-position:66.666667% 100%}87.5%{background-position:100% 100%}100%{background-position:0% 0%}}
@media(prefers-reduced-motion:reduce){.kesong-walk{animation:none!important;background-position:0 0}}

/* Contract dates and procurement handoff stay next to the work they affect. */
.contract-duty-inline{display:flex;align-items:center;gap:12px;padding:14px 24px;border-bottom:1px solid var(--line);font-size:13px;flex-wrap:wrap}
.contract-duty-inline input{width:108px;height:36px}
.contract-date-button{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:3px;color:var(--ink);background:transparent;border:1px solid transparent;padding:6px 26px 6px 8px;margin-left:-9px;text-align:left;font-size:12px;white-space:nowrap;line-height:1.6}
.contract-date-button:hover{border-color:var(--line);background:var(--bg,#f7f5f3)}
.contract-date-button svg{position:absolute;right:5px;top:10px;width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.4;color:var(--muted)}
.name-handoff-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px;font-size:14px;flex-wrap:wrap}
.name-handoff-toolbar>span,#nameReturnStatus{color:var(--muted);font-size:13px}
.date-edit-error{color:var(--bad);font-size:13px}
.review-item>.quiet{white-space:nowrap;font-size:12px}
.contract-date-button:focus-visible{outline:2px solid var(--accent,#a55c40);outline-offset:2px}
@media(max-width:760px){.review-item{flex-wrap:wrap}.review-item-content{min-width:60%}.name-handoff-toolbar .actions{flex-wrap:wrap}.contract-duty-inline{padding:14px 18px}}

.contract-list-toolbar{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:13px 24px;border-bottom:1px solid var(--line);background:var(--card)}
.contract-list-toolbar>span{color:var(--muted);font-size:12px;white-space:nowrap}
.contract-list-toolbar .actions{gap:8px}
.contract-list-toolbar button{font-size:12px;min-height:34px;padding:7px 12px}
.contract-list-toolbar [data-action="importNameHandoff"]{background:var(--card);border:1px solid var(--line);color:var(--ink)}
.contract-review-links{display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-width:130px}
button.contract-review-link{display:inline-flex;align-items:center;gap:5px;background:transparent;border:0;color:var(--accent-dark);font-size:12px;font-weight:500;padding:4px 0;min-height:28px;white-space:nowrap;text-align:left}
button.contract-review-link:hover{color:var(--ink);text-decoration:underline;text-underline-offset:3px;background:transparent}
.contract-review-link svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.5}
.contract-review-link:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(max-width:640px){.contract-list-toolbar{padding:12px 18px;flex-wrap:wrap}.contract-list-toolbar .actions{flex-wrap:wrap}}

/* Full contract dates share one line and one text style. */
.contract-table .contract-range .contract-date-button{display:inline-flex;flex-direction:row;align-items:center;gap:7px;padding:6px 26px 6px 0;margin:0;font-size:13px;font-weight:400;line-height:1.5;color:var(--ink);white-space:nowrap}
.contract-table .contract-range .contract-date-button span{display:inline;margin:0;color:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}
.contract-table .contract-range .contract-date-button svg{top:50%;transform:translateY(-50%)}

dialog:has(.name-editor){max-width:680px}
.name-material-context{border:1px solid var(--line);border-radius:8px;padding:18px 20px;margin-bottom:24px;background:var(--card)}
.name-material-meta{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:17px 24px;margin:0}
.name-material-meta>div{min-width:0}
.name-material-meta dt{color:var(--muted);font-size:12px;line-height:1.5;margin:0 0 5px}
.name-material-meta dd{margin:0;color:var(--ink);font-size:14px;line-height:1.65;overflow-wrap:anywhere;user-select:text}
.name-material-meta dd p{margin:0;white-space:pre-wrap}
.name-material-meta dd p+p{margin-top:7px}
.name-material-description,.name-material-factories{grid-column:1/-1}
.name-material-description{border-top:1px solid var(--line);padding-top:15px}
.name-editor>.field{margin:0}
.name-editor .modal-actions{margin-top:22px}
@media(max-width:560px){.name-material-context{padding:16px}.name-material-meta{gap:15px}.name-material-meta dd{font-size:13px}}

.overview-counts .excluded-details-trigger{margin-left:auto;display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:400;color:var(--muted)}
.excluded-details-trigger svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.5}
.excluded-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px;color:var(--muted);font-size:13px}
.excluded-toolbar label{display:flex;align-items:center;gap:12px}
.excluded-toolbar select{border:1px solid var(--line);border-radius:7px;background:var(--card);color:var(--ink);padding:8px 12px;font:inherit;min-width:230px}
.excluded-table{max-height:56vh;border:1px solid var(--line);border-radius:8px;overflow:auto}
.excluded-table th{position:sticky;top:0;z-index:1;background:var(--soft);white-space:nowrap}
.excluded-table td,.excluded-table th{padding:12px;vertical-align:top}
.excluded-table td:nth-child(2){min-width:240px;max-width:340px;overflow-wrap:anywhere}
.excluded-table td:last-child{min-width:110px}
.excluded-source{max-width:150px;overflow-wrap:anywhere;white-space:normal}
.excluded-description{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6}
@media(max-width:560px){.excluded-toolbar{align-items:flex-start}.excluded-toolbar label{align-items:flex-start;flex-direction:column;gap:6px}.excluded-toolbar select{min-width:0;max-width:260px}.overview-counts .excluded-details-trigger{margin-left:0}}

.contract-batch-controls{display:flex;align-items:center;justify-content:space-between;gap:16px 24px;padding:13px 24px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.contract-batch-controls .contract-duty-inline{padding:0;border:0;gap:10px}
.contract-batch-controls .contract-duty-inline input{width:104px}
.contract-name-controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.contract-name-controls>span{color:var(--muted);font-size:12px;white-space:nowrap}
.contract-name-controls .actions{gap:8px}
.contract-name-controls button{font-size:12px;min-height:34px;padding:7px 12px}
.contract-name-controls [data-action="importNameHandoff"]{background:var(--card);border:1px solid var(--line);color:var(--ink)}
@media(max-width:640px){.contract-batch-controls{padding:13px 18px}.contract-name-controls{gap:10px}}

.excluded-table{background:var(--card)}

/* Two interchangeable loading scenes; the countdown is an estimate, not completion. */
.import-wait-tools{display:flex;align-items:center;gap:20px;flex-wrap:wrap;justify-content:flex-end}
.loading-theme-picker{display:inline-flex;gap:3px;padding:3px;border:1px solid var(--line);border-radius:8px;background:var(--bg)}
.loading-theme-picker button{padding:5px 11px;min-height:30px;border-radius:5px;border:1px solid transparent;background:transparent;color:var(--muted);font-size:12px;font-weight:450;white-space:nowrap}
.loading-theme-picker button[aria-pressed="true"]{background:var(--card);border-color:var(--line);color:var(--ink);box-shadow:0 1px 2px #211a1708}
.loading-theme-picker button:hover{color:var(--ink);background:var(--card)}
.materials-motion{position:relative;width:min(360px,100%);height:148px;margin:10px auto 0}
.materials-icons{position:absolute;top:34px;left:15px;right:15px;display:flex;align-items:center;justify-content:space-between;gap:18px}
.material-motion-tile{display:grid;place-items:center;width:64px;height:64px;flex:none;border:1px solid #e6ddd6;border-radius:14px;background:#faf8f5;color:#98735b;box-shadow:0 4px 9px #49372b05;animation:materials-float 3.6s ease-in-out infinite;animation-delay:calc(var(--motion-index)*-.65s)}
.material-motion-tile svg{width:44px;height:44px;fill:none;stroke:currentColor;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round}
.material-motion-tile.is-button{background:#fff;color:#95816c}
.material-motion-tile.is-hanger{background:#f7f5f2;color:#826e60}
.material-motion-tile.is-tag{background:#faf3ee;color:#a96e51}
.materials-thread{position:absolute;width:100%;height:40px;left:0;bottom:13px;overflow:visible;fill:none;stroke:#d8c9bc;stroke-width:1;stroke-linecap:round;stroke-dasharray:3 5;opacity:.65;animation:materials-thread 8s linear infinite}
.materials-thread-dot{position:absolute;bottom:30px;left:20px;width:5px;height:5px;background:#bb9075;border-radius:50%;opacity:.45;animation:materials-thread-dot 5s ease-in-out infinite}
@keyframes materials-float{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(-9px) rotate(2deg)}}
@keyframes materials-thread{to{stroke-dashoffset:-48}}
@keyframes materials-thread-dot{0%{left:20px;opacity:0}12%{opacity:.5}88%{opacity:.5}100%{left:calc(100% - 25px);opacity:0}}
.import-estimate{display:flex;justify-content:center;align-items:baseline;gap:12px;margin:21px auto 23px;min-height:24px}
.import-estimate>span{color:var(--muted);font-size:13px}
.import-estimate>strong{font-size:18px;line-height:1.4;letter-spacing:.02em;font-variant-numeric:tabular-nums;font-weight:500;color:var(--ink)}
.import-estimate.is-overdue>span{color:var(--warn)}
.import-estimate.is-overdue>strong{color:var(--muted);font-size:18px}
.import-wait.has-failed .materials-motion *{animation-play-state:paused}
@media(max-width:640px){.import-wait-tools{gap:10px;flex-direction:column;align-items:flex-end}.loading-theme-picker button{padding:4px 9px}.materials-icons{left:10px;right:10px;gap:9px}.material-motion-tile{width:56px;height:56px;border-radius:12px}.material-motion-tile svg{width:39px;height:39px}.import-estimate{gap:9px;margin:18px auto}.import-estimate>strong{font-size:18px}}
@media(prefers-reduced-motion:reduce){.materials-motion *{animation:none!important}.materials-thread-dot{display:none}}

/* Kesong playing with yarn: a paw-led eight-pose loop. */
.kesong-yarn{display:block;width:156px;height:156px;background:url('assets/kesong-yarn.png') no-repeat 0 0 / 400% 200%;animation:kesong-yarn-play 2.4s step-end infinite}
.sticker-motion:has(.kesong-yarn){width:156px;height:156px;left:calc(50% - 78px);top:-8px}
.sticker-runway:has(.kesong-yarn) .sticker-shadow{display:none}
@keyframes kesong-yarn-play{0%{background-position:0% 0%}18%{background-position:33.333333% 0%}29%{background-position:66.666667% 0%}40%{background-position:100% 0%}51%{background-position:0% 100%}63%{background-position:33.333333% 100%}75%{background-position:66.666667% 100%}87%{background-position:100% 100%}100%{background-position:0% 0%}}
.import-wait.has-failed .kesong-yarn{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.kesong-yarn{animation:none!important;background-position:0 0}}

.audit-detail{max-height:65vh;overflow:auto}.audit-detail dl{display:grid;grid-template-columns:1fr 1fr;gap:20px 32px;margin:0}.audit-detail dl>div{min-width:0}.audit-detail dt{color:var(--muted);font-size:12px;margin-bottom:5px}.audit-detail dd{margin:0;color:var(--ink);font-size:14px;overflow-wrap:anywhere}.audit-detail .notice{margin-bottom:22px}.audit-detail details{margin-top:24px;border-top:1px solid var(--line);padding-top:16px}.audit-detail pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}@media(max-width:640px){.audit-detail dl{grid-template-columns:1fr;gap:16px}}

/* Keep contract information and actions inside the card at every viewport. */
.contract-table{table-layout:fixed;white-space:normal;width:100%}
.contract-table .contract-col-factory{width:23%}
.contract-table .contract-col-site{width:5%}
.contract-table .contract-col-date{width:23%}
.contract-table .contract-col-count{width:7%}
.contract-table .contract-col-amount{width:14%}
.contract-table .contract-col-review{width:15%}
.contract-table .contract-col-actions{width:13%}
.contract-table th,.contract-table td{padding:14px 12px;overflow-wrap:anywhere;vertical-align:middle}
.contract-table td{font-size:13px}
.contract-table td:first-child strong{font-weight:550;line-height:1.6}
.contract-table .cell-sub{white-space:normal}
.contract-table .row-actions{min-width:0}
.contract-row-actions{display:flex;flex-wrap:wrap;align-items:center;gap:3px 8px}
.contract-table .row-actions button{display:inline-flex;align-items:center;min-height:30px;padding:3px 0;margin:0;font-size:13px;white-space:nowrap}
.contract-table .contract-review-links{min-width:0;max-width:100%}
.contract-table .contract-review-link{max-width:100%;white-space:normal}
@media(max-width:1100px){
 .contract-list-wrap{overflow:visible}
 .contract-table,.contract-table tbody{display:block;width:100%}
 .contract-table colgroup,.contract-table thead{display:none}
 .contract-table tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px 20px;padding:18px;border-bottom:1px solid var(--line)}
 .contract-table tr:last-child{border-bottom:0}
 .contract-table td{display:block;min-width:0;padding:0;border:0;text-align:left}
 .contract-table td::before{content:attr(data-label);display:block;margin-bottom:4px;font-size:11px;font-weight:400;color:var(--muted)}
 .contract-table td:first-child{grid-column:1/-1;order:1}
 .contract-table td:first-child::before{display:none}
 .contract-table td:nth-child(2){order:2}
 .contract-table td:nth-child(4){order:3}
 .contract-table .contract-range{grid-column:1/-1;order:4}
 .contract-table td:nth-child(5){order:5}
 .contract-table td:nth-child(6){order:6}
 .contract-table .row-actions{grid-column:1/-1;order:7;padding-top:10px;border-top:1px solid var(--line)}
 .contract-table .row-actions::before{display:none}
 .contract-row-actions{gap:4px 20px}
 .contract-table .contract-date-button{max-width:100%;flex-wrap:wrap;row-gap:0}
}

.contract-table td:nth-child(2),.contract-table td:nth-child(4){white-space:nowrap}

.amount-policy-note{margin:0;color:var(--muted);font-size:13px;line-height:1.6}.draft-save-state{font-size:12px;color:var(--muted)}.draft-save-state.is-error{color:var(--bad)}.contract-table .contract-col-factory{width:27%}.contract-table .contract-col-actions{width:9%}.contract-row-actions .contract-icon-action{display:inline-flex;align-items:center;justify-content:center;padding:6px;width:34px;height:34px;border:1px solid var(--line);border-radius:6px;min-height:34px}.contract-icon-action svg{width:18px;height:18px;stroke:currentColor;stroke-width:1.5;fill:none}.contract-icon-action:disabled{opacity:.35;cursor:not-allowed}.draft-list td:first-child{white-space:normal;min-width:180px}

.source-report-status{display:flex;flex-wrap:wrap;gap:8px 18px;margin-top:12px;font-size:12px;color:var(--muted)}
.history-groups{display:grid;gap:18px}.history-month{overflow:hidden}.history-month>summary,.history-batch>summary{display:flex;align-items:center;gap:12px;cursor:pointer;list-style:none;min-width:0}.history-month>summary{padding:22px 24px;background:var(--card,#fff)}.history-month summary::-webkit-details-marker{display:none}.history-month h2{margin:0;font-size:18px}.history-count{margin-left:auto;color:var(--muted);font-size:13px}.history-chevron{font-size:24px;line-height:1;color:var(--muted);transition:transform .15s}.history-month[open]>summary>.history-chevron,.history-batch[open]>summary>.history-chevron{transform:rotate(90deg)}.history-month-body{padding:0 24px 24px}.history-batch{border:1px solid var(--line);border-radius:8px;margin-top:12px;overflow:hidden}.history-batch>summary{padding:16px 18px;background:var(--soft,#faf8f6);font-size:14px}.history-batch-meta{color:var(--muted);font-size:13px;margin-left:auto}.history-batch-body{padding:18px;background:var(--card,#fff)}.history-resume{display:flex;gap:20px;align-items:center;justify-content:space-between;margin-bottom:16px}.history-resume>span{font-size:13px;color:var(--muted);overflow-wrap:anywhere;min-width:0}.history-resume>button{flex-shrink:0}.history-files{min-width:580px}.history-files td:first-child{white-space:normal;overflow-wrap:anywhere;max-width:540px}.history-files td:last-child{text-align:right}.history-no-files{color:var(--muted);font-size:13px;padding:10px 0}.history-month summary:focus-visible{outline:2px solid var(--accent,#a45f43);outline-offset:-3px}@media(max-width:600px){.history-month>summary{padding:18px 14px;gap:8px}.history-month-body{padding:0 12px 12px}.history-month h2{font-size:16px}.history-batch>summary{padding:14px 10px;gap:8px;flex-wrap:wrap}.history-batch>summary>strong{font-size:13px}.history-batch-meta{font-size:12px}.history-batch-body{padding:14px 12px}.history-count{font-size:12px}.history-resume{align-items:flex-start;flex-wrap:wrap;gap:12px}}

@media(max-width:1000px){.draft-list,.draft-list tbody{display:block;width:100%}.draft-list thead{display:none}.draft-list tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px 20px;padding:18px;border-bottom:1px solid var(--line)}.draft-list tr:last-child{border-bottom:0}.draft-list td{display:block;min-width:0;padding:0;border:0;white-space:normal}.draft-list td::before{content:attr(data-label);display:block;margin-bottom:4px;font-size:11px;color:var(--muted)}.draft-list td:first-child,.draft-list td:nth-child(3),.draft-list td:last-child{grid-column:1/-1}.draft-list td:first-child::before,.draft-list td:last-child::before{display:none}.draft-list td:first-child{min-width:0;order:1}.draft-list td:nth-child(2){order:2}.draft-list td:nth-child(4){order:3}.draft-list td:nth-child(3){order:4}.draft-list td:last-child{order:5;border-top:1px solid var(--line);padding-top:10px}}

.usage-five{grid-template-columns:repeat(5,minmax(0,1fr))}.usage-five .card{min-width:0;padding:22px 18px}.usage-five .metric-time{font-size:23px;white-space:nowrap;font-variant-numeric:tabular-nums}@media(max-width:1100px){.usage-five{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:760px){.usage-five{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.usage-five .card{padding:18px 14px}.usage-five strong{font-size:26px}.usage-five .metric-time{font-size:20px}}
