:root{font-family:Inter,"Segoe UI",Arial,sans-serif;color:#17315a;background:#f3f6fb;font-size:14px;font-synthesis:none;--blue:#1b4fd3;--line:#cfdaec;--muted:#6d7e99;--red:#bb493e}
*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:var(--nav-offset,145px)}
body{margin:0}
button,input,select,textarea{font:inherit}
button{cursor:pointer;background:#fff;border:1px solid #c8d5eb;border-radius:8px;padding:10px 14px;color:#1b4fd3;font-weight:600;white-space:nowrap;transition:background .15s}
button:hover{background:#edf3ff}
button:disabled{opacity:.5;cursor:wait}
.primary{background:var(--blue);border-color:var(--blue);color:white}
.primary:hover{background:#163eab}
a{color:var(--blue)}
input,select,textarea{border:1px solid #c8d5eb;border-radius:6px;background:white;padding:9px;max-width:100%;color:#17315a}
input:focus,textarea:focus,select:focus,button:focus-visible{outline:2px solid #8baaff;outline-offset:2px}
textarea{width:100%;resize:vertical}
input[type=checkbox],input[type=radio],input[type=range]{accent-color:var(--blue)}
nav a{display:flex;gap:11px;align-items:center;padding:13px 12px;margin:4px 0;text-decoration:none;color:#737d72;border-radius:7px;font-size:13px}
nav a.active,nav a:hover{background:#eaf1e7;color:#315c35}
nav a.active{font-weight:650}
main{margin:0 auto;padding:0 24px;max-width:2000px}
#save-status{font-size:11px}
.title-row{display:flex;justify-content:space-between;align-items:center;padding:34px 0 21px;gap:15px}
.eyebrow{font-size:10px;letter-spacing:1.7px;color:#758ba8;font-weight:650}
h1{font-size:30px;font-weight:600;letter-spacing:-1px;margin:9px 0}
h2{font-size:17px;letter-spacing:-.35px;font-weight:650;margin:0}
.subtitle{color:#73839b;font-size:13px;margin:0}
.header-actions{display:flex;gap:9px;align-items:center}
.kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin:0 0 23px}
.kpi{position:relative;background:#fff;border:1px solid var(--line);border-radius:7px;padding:23px;min-height:142px}
.kpi:first-child{background:#1b4fd3;color:#ffffff;border-color:#1b4fd3}
.kpi:first-child .kpi-label,.kpi:first-child small{color:#dce7ff}
.kpi-label{font-size:11px;color:#6d7e99;line-height:1.6}
.kpi-value{font-size:31px;letter-spacing:-1.1px;white-space:nowrap;margin:12px 0 7px;font-weight:600;font-variant-numeric:tabular-nums}
.kpi small{font-size:10px;color:#7c8ca4}
.negative{color:var(--red)!important}
.positive{color:#1b4fd3!important}
.panel{background:#fff;border:1px solid var(--line);border-radius:7px;margin:20px 0;padding:24px;min-width:0}
.section-head{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:22px}
.section-head p{font-size:11px;color:#73839b;margin:7px 0 0;line-height:1.5}
.tag{font-size:10px;background:#eef3fc;color:#6d7e99;border:1px solid #cfdaec;padding:6px 10px;border-radius:6px;white-space:nowrap}
.sliders{display:grid;grid-template-columns:repeat(5,1fr);gap:28px}
.slider label{display:flex;justify-content:space-between;font-size:11px;color:#6d7e99;min-height:29px}
.slider input[type=number]{width:77px;border:0;background:#eef3fc;text-align:right;font-size:16px;font-weight:600;padding:7px}
.slider input[type=range]{width:100%;height:4px;margin:22px 0 12px;cursor:pointer}
.range-ends{display:flex;justify-content:space-between;color:#8a9bb4;font-size:9px}
.settings{margin-top:22px;border-top:1px solid #e3eaf5;padding-top:15px;font-size:12px}
.settings summary,.help summary{cursor:pointer;color:#2859b9}
.fields{display:flex;gap:20px;flex-wrap:wrap;margin-top:15px}
.fields label{display:flex;flex-direction:column;gap:6px;color:#6d7e99;font-size:11px}
.fields input{max-width:160px}
.cabinets{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.cabinet{border:1px solid #d6e0f0;border-radius:9px;padding:18px;background:#fafcff}
.cabinet-title{display:flex;justify-content:space-between;font-weight:600;font-size:12px}
.cabinet-title span{color:#5173a8;font-size:10px}
.cabinet small{font-size:10px;color:#8a9bb4;display:block;margin:6px 0 12px}
.cabinet strong{font-size:23px;font-weight:600;display:block;margin:12px 0}
.cabinet label.now{display:flex;gap:7px;font-size:11px;align-items:center;color:#60789e}
.modes{display:flex;flex-wrap:wrap;gap:4px;margin-top:15px}
.mode{flex:1;text-align:center;cursor:pointer}
.mode input{position:absolute;opacity:0;width:1px}
.mode span{display:block;font-size:10px;padding:7px 5px;border:1px solid #cdd9ef;border-radius:5px}
.mode small{font-size:8px;margin:4px 0 0}
.mode input:checked+span{background:#e8efff;border-color:#799bf2;color:#1b4fd3}
.mode input:focus-visible+span{outline:2px solid #1b4fd3}
.summary-strip{display:flex;gap:40px;background:#f3f6fc;border-radius:7px;margin-top:16px;padding:13px 18px;font-size:11px;color:#6d7e99}
.summary-strip strong{color:#1b4fd3;margin-left:12px;font-size:13px}
.table-scroll{overflow:auto;max-width:100%;border:1px solid #cfdaec;border-radius:7px;max-height:530px}
table{border-collapse:separate;border-spacing:0;width:100%;font-size:11px;font-variant-numeric:tabular-nums}
th{background:#f0f4fb;color:#5c7398;font-size:10px;letter-spacing:.05px;font-weight:500;text-align:right;position:sticky;top:0;z-index:1;border-bottom:1px solid #d7e2f3}
th,td{padding:12px 14px;white-space:nowrap;border-bottom:1px solid #e3eaf5;text-align:right}
th:first-child,td:first-child{text-align:left;position:sticky;left:0;background:#fff;z-index:1;max-width:255px;overflow:hidden;text-overflow:ellipsis}
th:first-child{background:#f0f4fb;z-index:2}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover td{background:#f5f8ff}
td.name{font-weight:550;text-align:left}
.large-table table{min-width:2200px}
.large-table td{max-width:250px;overflow:hidden;text-overflow:ellipsis}
td.note-cell{min-width:170px;white-space:normal;text-align:left;cursor:text;font-size:11px;color:#617897}
td.note-cell small{display:block;font-size:9px;color:#8a9bb4;margin-top:4px}
.noted td,.noted td:first-child{background:#eef1f7}
.unknown{background:#fff0ed!important;color:#b85449!important}
.pill{display:inline-block;padding:5px 7px;background:#eef3fc;border-radius:4px;color:#617897;font-size:9px}
.pill.urgent{background:#fbece7;color:#b85845}
.pill.order{background:#fbf2dc;color:#957839}
.pill.method{color:#315fab;background:#edf3ff}
.muted{font-size:11px;color:#7d8da5;line-height:1.6}
.table-toolbar{display:flex;align-items:center;justify-content:space-between;margin:14px 0;font-size:11px;color:#7d8da5}
.search{display:flex;align-items:center;gap:8px;border:1px solid #cdd9ef;border-radius:6px;padding-left:10px;color:#7d8da5}
.search input{border:0;background:transparent;font-size:11px;width:215px;outline-offset:0}
.filters{display:flex;gap:6px;flex-wrap:wrap;margin-top:18px}
.filters button{font-size:10px;font-weight:500;padding:7px 10px;border-radius:5px}
.filters button.selected{background:#e8efff;border-color:#799bf2;color:#1b4fd3}
.filter-separator{width:1px;background:#d6e0f0;margin:3px 6px}
.table-foot{font-size:10px;color:#8a9bb4;margin:12px 0 0}
.help{padding:12px;background:#f5f8fd;font-size:11px;line-height:1.7;border-radius:6px}
.help p{color:#6d7e99;margin:10px 0 0}
.chart{width:100%;overflow:auto;min-height:245px}
.chart svg{min-width:650px;width:100%;display:block}
.chart-legend{display:flex;gap:20px;margin:26px 0 12px;color:#6d7e99;font-size:10px;flex-wrap:wrap}
.chart-legend i{width:7px;height:7px;border-radius:2px;display:inline-block;margin-right:6px}
.purchase-dot{background:#9bb7ff}
.available-dot{background:#1b4fd3}
.diff-dot{background:#c9d8ff}
.insights-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.insight{padding:18px;border-radius:9px;background:#f1f5fd;font-size:12px;line-height:1.8;color:#6d7e99}
.insight strong{display:block;color:#204fba;font-size:13px;margin-bottom:5px}
.insight.alert{background:#fcf5ea;color:#a08566}
.insight.alert strong{color:#916f4e}
.source-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:15px 0}
.assumptions-label{display:block;margin:24px 0 12px;font-size:12px;color:#4c6b9d}
footer{display:flex;justify-content:space-between;padding:15px 0 35px;font-size:10px;color:#8a9bb4}
.danger-quiet{font-size:10px;color:#a77d70}
.banner{padding:13px 17px;background:#f8f1de;border:1px solid #ecdfb9;border-radius:8px;margin:0 0 18px;color:#937b41;font-size:12px;line-height:1.7}
.banner a{margin-left:12px}
.empty{text-align:center!important;padding:35px!important;color:#8a9bb4;font-size:12px}
.total td,.total td:first-child{background:#edf3ff;font-weight:650;color:#315fab}
#bulk{background:#edf3ff;padding:14px;margin-bottom:12px;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
#bulk[hidden]{display:none}
#bulk input{width:120px;font-size:11px}
#bulk button{font-size:10px}
#terms-table input[type=number]{width:95px;padding:5px}
#terms-table input[type=text]{min-width:160px;padding:5px}
.sort{border:0;background:none;padding:0;color:inherit;font-size:inherit;font-weight:inherit}
.note-input{width:100%;min-width:160px}
#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-30%);background:#173f9e;color:#fff;padding:14px 24px;border-radius:9px;box-shadow:0 10px 40px #17315a20;z-index:20;font-size:12px;max-width:85vw}
dialog{border:1px solid #cfdaec;border-radius:14px;padding:28px;width:min(780px,94vw);max-height:85vh;overflow:auto;box-shadow:0 20px 80px #17315a40}
dialog::backdrop{background:#17315a70;backdrop-filter:blur(3px)}
dialog h2{font-size:21px;margin:0 0 15px}
dialog .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}
dialog textarea{font-family:Consolas,monospace;font-size:11px;min-height:330px}
dialog .errors{color:#b34d42;white-space:pre-wrap;font-size:12px}
.mini-table{margin:15px 0}
.mini-table td{padding:7px}
.mini-table input{width:100%}
.missing-tag{font-size:9px;color:#a27154}
.cash-warning{color:#b65d45}
.readonly{color:#946b3b}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}

@media(min-width:1600px){main{margin:0 auto;padding:0 24px;max-width:2000px}
.kpi-value{font-size:38px}
.sliders{gap:40px}
}
@media(max-width:1150px){main{margin:0 auto;padding:0 24px;max-width:2000px}
nav a{font-size:11px}
.sliders{gap:15px}
.kpi{padding:18px}
.kpi-value{font-size:26px}
.section-head{align-items:flex-start}
.cabinets{gap:10px}
.cabinet{padding:13px}
.header-actions button{font-size:11px}
.title-row{flex-wrap:wrap}
}
@media(max-width:820px){main{margin:0 auto;padding:0 24px;max-width:2000px}
.title-row{padding-top:25px}
h1{font-size:27px}
.kpis{gap:10px}
.kpi{padding:14px;min-height:124px}
.kpi-value{font-size:23px}
.kpi-label{font-size:9px}
.panel{padding:18px}
.sliders{grid-template-columns:repeat(3,1fr);gap:20px}
.cabinets{grid-template-columns:1fr}
.cabinet strong{display:inline-block;margin:5px 15px 12px 0}
.modes{max-width:500px}
.cabinet label.now{display:inline-flex}
.summary-strip{gap:15px;flex-wrap:wrap}
.section-head{flex-wrap:wrap}
.insights-grid{grid-template-columns:1fr}
.chart-legend{gap:12px}
}
@media(max-width:500px){.kpis{grid-template-columns:1fr}
.kpi{min-height:0;padding:16px 20px;display:grid;grid-template-columns:1fr 1fr;align-items:center}
.kpi-value{text-align:right;margin:0;font-size:25px}
.kpi small{grid-column:1/-1;margin-top:8px}
.sliders{grid-template-columns:repeat(2,1fr)}
.title-row{gap:20px}
.header-actions{flex-wrap:wrap}
.panel{padding:15px}
.breadcrumb{font-size:10px}
.search input{width:180px}
#toast{transform:translateX(-50%)}
.summary-strip strong{display:block;margin:4px 0 0}
.kpi:first-child small{color:#dce7ff}
}


.source-identity{display:block;font-size:10px;font-weight:400;color:var(--muted);margin-top:5px}
.source-lines{white-space:pre-line}
.source-caption{padding:0 24px;font-size:12px}


/* Compact top menu follows the supplied MPKiller reference. */
.topbar{position:sticky;top:0;z-index:5;background:#f3f6fb;border-bottom:1px solid var(--line);padding:10px 24px 8px}

.topbar-heading{display:flex;align-items:center;gap:16px;min-height:48px;margin-bottom:8px}

.brand-mark{display:grid;place-items:center;flex:none;width:48px;height:48px;border-radius:11px;background:var(--blue);color:#fff;font-size:21px;font-weight:700;text-decoration:none}

.brand-copy{min-width:0}
.brand-copy .eyebrow{font-size:8px;letter-spacing:1.2px;font-weight:400;color:#6b85ae}

.brand-copy h1{font-size:20px;letter-spacing:0;margin:6px 0 0;font-weight:650;line-height:1.2}

.topbar-status{margin-left:auto;text-align:right;color:#6d7e99;font-size:11px;line-height:1.7}
.topbar-status small{font-size:10px;color:#8a9bb4}

.topnav{display:grid;gap:3px}
.nav-group{display:flex;align-items:flex-start;gap:10px;min-height:22px}
.nav-label{width:76px;flex:none;padding-top:4px;color:#2457bc;font-size:11px}
.nav-links{display:flex;flex-wrap:wrap;gap:7px}

.topnav a{display:inline-flex;align-items:center;gap:0;margin:0;padding:3px 12px;min-height:22px;border:1px solid #245cff;border-radius:5px;color:#245cff;background:white;text-decoration:none;font-size:11px;font-weight:400;line-height:1.25}

.topnav a:hover{background:#e8efff;color:#1b4fd3}
.topnav a.active{background:var(--blue);border-color:var(--blue);color:white;font-weight:500}
.topnav a:focus-visible,.brand-mark:focus-visible{outline:2px solid #8baaff;outline-offset:2px}

button{border-color:#245cff;border-radius:5px;color:#245cff;font-weight:400;padding:7px 12px}
.primary{color:white}
.primary:hover{color:white}
.sort{border:0;padding:0;color:inherit}
.sort:hover{background:transparent}

.title-row{padding:22px 0 18px}
h1{font-size:26px;letter-spacing:-.5px}
.panel{margin:16px 0;padding:20px}
.section-head{margin-bottom:18px}
.kpi{min-height:125px;padding:20px}
.kpi-value{font-size:30px}
.tag,.pill{border-radius:4px}

.source-caption{padding:0;font-size:11px}
.source-identity{color:var(--muted)}
#toast{left:50%;transform:translateX(-50%)}

@media(max-width:820px){.topbar{padding:10px 16px 8px}
main{padding:0 16px}
.topbar-heading{gap:12px}
.brand-copy h1{font-size:18px}
.topbar-status{max-width:160px}
.nav-label{width:60px}
.topnav a{padding:3px 9px}
.panel{padding:18px}
}

@media(max-width:500px){.topbar{padding:8px 12px}
.topbar-heading{flex-wrap:wrap;gap:10px;margin-bottom:7px}
.brand-mark{width:40px;height:40px;border-radius:9px;font-size:19px}
.brand-copy{flex:1}
.brand-copy .eyebrow{font-size:7px;letter-spacing:.7px}
.brand-copy h1{font-size:17px}
.topbar-status{flex-basis:100%;max-width:none;margin-left:50px;text-align:left}
.topbar-status small{display:none}
.nav-label{width:50px;font-size:10px}
.nav-group{gap:7px}
.nav-links{gap:4px}
.topnav a{font-size:10px;padding:3px 7px}
main{padding:0 12px}
.panel{padding:15px}
.table-toolbar{gap:10px;flex-wrap:wrap}
.header-actions{gap:7px}
.section-head .header-actions{flex-wrap:wrap}
h1{font-size:23px}
}


.help-source-status{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:16px;border:1px solid var(--line);border-radius:6px;background:#f3f6fc;margin-bottom:18px}.help-source-status strong,.help-source-status span,.help-source-status small{display:block}.help-source-status strong{font-size:12px;margin-bottom:7px}.help-source-status span{font-size:11px;color:#315fab}.help-source-status small{font-size:11px;color:var(--muted);margin-top:5px}.help-source-status p{grid-column:1/-1;margin:0;font-size:11px;color:var(--muted);line-height:1.7}
.help-sources{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.help-source-card{border:1px solid var(--line);border-radius:6px;padding:18px;min-width:0}.help-source-card h3{font-size:14px;margin:0 0 12px;color:#17315a}.help-source-card p{font-size:12px;line-height:1.7;margin:9px 0;color:#526e97}.help-source-card a{color:var(--blue);text-underline-offset:3px}.source-mapping{margin:16px 0 0;font-size:12px;line-height:1.6}.source-mapping>div{display:grid;grid-template-columns:110px minmax(0,1fr);gap:14px;padding:10px 0;border-top:1px solid #e3eaf5}.source-mapping dt{font-weight:600;color:#315fab}.source-mapping dd{margin:0;color:#526e97}
@media(max-width:820px){.help-sources,.help-source-status{grid-template-columns:1fr}.help-source-status p{grid-column:1}}
@media(max-width:500px){.help-source-card{padding:14px}.source-mapping>div{grid-template-columns:90px minmax(0,1fr);gap:10px}}

/* Keep every SKU indicator within the available panel width. */
#sku-table table{min-width:0;width:100%;table-layout:fixed}
#sku-table th,#sku-table td{min-width:0;max-width:none;padding:10px 4px;white-space:normal;overflow-wrap:anywhere;line-height:1.35;font-size:clamp(10px,.65vw,12px);overflow:visible;text-overflow:clip;vertical-align:top}
#sku-table th{font-size:clamp(9px,.6vw,11px)}
#sku-table .sort{width:100%;white-space:normal;line-height:1.3}
#sku-table .pill{max-width:100%;padding:4px;white-space:normal;overflow-wrap:anywhere}
#sku-table .note-cell{min-width:0}
#sku-table .note-input{min-width:0;padding:4px;font-size:11px}
.help-sections{display:flex;gap:10px;flex-wrap:wrap;margin:20px 0}
.help-sections a{border:1px solid var(--blue);border-radius:6px;padding:9px 16px;color:var(--blue);background:white;text-decoration:none}
.help-page .help-source-card{margin:20px 0}
.help-page p{line-height:1.7;font-size:13px}
.help-table table{table-layout:fixed;width:100%}
.help-table th,.help-table td{position:static;text-align:left;white-space:normal;overflow-wrap:anywhere;max-width:none;font-size:12px;padding:12px;line-height:1.65}
.help-table th{background:#e9effa;font-weight:600}
.help-table tbody tr:nth-child(even) td{background:#f7f9fc}
.help-links a{color:var(--blue)}
@media(max-width:760px){
 #sku-table table,#sku-table thead,#sku-table tbody{display:block}
 #sku-table colgroup{display:none}
 #sku-table thead tr{display:flex;flex-wrap:wrap;gap:6px;padding:10px;background:#f0f4fb}
 #sku-table thead th{position:static;display:block;border:0;padding:4px;text-align:left}
 #sku-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-bottom:1px solid var(--line);padding:10px;gap:6px}
 #sku-table tbody td{display:block;position:static;text-align:left;border:0;font-size:12px;padding:5px;min-width:0}
 #sku-table tbody td:first-child{grid-column:1/-1;font-weight:600;font-size:14px}
 #sku-table tbody td:not(:first-child)::before{content:attr(data-label);display:block;color:var(--muted);font-size:10px;margin-bottom:4px}
}

/* Help is separated from the working sections and aligned to the right. */
.topnav{grid-template-columns:minmax(0,1fr) auto;align-items:center}
.topnav .nav-group{grid-column:1}
.topnav .nav-help{grid-column:2;grid-row:1 / 3;justify-self:end;align-self:center}
/* A supplier address needs 2.5 times the previous 160px field width. */
#terms-table table{width:100%;min-width:0;table-layout:fixed}
#terms-table th,#terms-table td{min-width:0;white-space:normal;padding:10px 8px}
#terms-table th:first-child,#terms-table td:first-child{width:36px}
#terms-table th:nth-child(2),#terms-table td:nth-child(2){width:42%;text-align:left}
#terms-table th:last-child,#terms-table td:last-child{width:48px}
#terms-table input[type=text]{width:400px;max-width:100%;min-width:0}
#terms-table input[type=number]{max-width:100%;min-width:0}
@media(max-width:760px){
 #terms-table table,#terms-table tbody{display:block}
 #terms-table thead{display:none}
 #terms-table tbody tr{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:12px;border-bottom:1px solid var(--line)}
 #terms-table tbody td{display:block;width:auto!important;padding:0;border:0}
 #terms-table tbody td:first-child{grid-column:1}
 #terms-table tbody td:nth-child(2){grid-column:1 / -1;grid-row:2}
 #terms-table tbody td:last-child{grid-column:4;grid-row:1;text-align:right}
 #terms-table input[type=text],#terms-table input[type=number]{width:100%}
 #terms-table tbody td:nth-child(n+3):nth-child(-n+6)::before{display:block;color:var(--muted);font-size:10px;margin-bottom:5px}
 #terms-table tbody td:nth-child(3)::before{content:'Аванс, %'}
 #terms-table tbody td:nth-child(4)::before{content:'Производство, %'}
 #terms-table tbody td:nth-child(5)::before{content:'Отсрочка, дней'}
 #terms-table tbody td:nth-child(6)::before{content:'Отсрочка, %'}
}

/* Monthly blocks fit the available width and keep their two-level headers. */
.market-toggle{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--muted);cursor:pointer}
.grouped-table{table-layout:fixed;min-width:0;width:100%}
.grouped-table th,.grouped-table td{min-width:0;max-width:none;padding:10px 4px;white-space:normal;overflow-wrap:anywhere;line-height:1.35;font-size:clamp(9px,.65vw,12px);vertical-align:top}
.grouped-table th{font-size:clamp(9px,.6vw,11px)}
.grouped-table thead tr:first-child th{top:0;height:32px;vertical-align:middle}
.grouped-table thead tr:nth-child(2) th{top:32px}
.grouped-table th.group-title{text-align:center;font-weight:650}
.grouped-table thead tr:nth-child(2) th:first-child{left:auto;text-align:right;z-index:1}
.grouped-table th.group-start,#forecast-table td:nth-child(4),#forecast-table td:nth-child(9),#forecast-table td:nth-child(14),#supplier-table td:nth-child(2),#supplier-table td:nth-child(6){border-left:2px solid #bdcce5}
.grouped-table td:first-child{text-align:left}
.partial-mark{color:#9a6722;margin-left:2px}
@media(max-width:760px){
 .grouped-table,.grouped-table thead,.grouped-table tbody{display:block}
 .grouped-table colgroup{display:none}
 .grouped-table thead{display:none}
 .grouped-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-bottom:1px solid var(--line);gap:6px;padding:10px}
 .grouped-table tbody td{position:static;display:block;border:0!important;text-align:left;padding:5px;font-size:12px}
 .grouped-table tbody td:first-child{grid-column:1/-1;font-weight:600;font-size:14px}
 .grouped-table tbody td:not(:first-child)::before{content:attr(data-label);display:block;font-size:10px;color:var(--muted);margin-bottom:4px}
}

.column-search,.column-filter{display:block;width:100%;min-width:0!important;margin-top:6px;padding:5px 3px!important;font-size:10px!important;line-height:1.3}
.order-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0 0 14px}
.order-total{border:1px solid var(--line);border-radius:6px;padding:13px 16px;background:#f6f8fd}
.order-total.urgent{border-left:3px solid #c2604d}
.order-total.order{border-left:3px solid #d6ab56}
.order-total strong{display:block;font-size:12px;margin-bottom:5px}
.order-total span{display:block;font-size:17px;font-variant-numeric:tabular-nums}
.order-total small{display:block;color:var(--muted);font-size:10px;margin-top:5px}
@media(max-width:760px){.order-summary{grid-template-columns:1fr}}

.purchase-label{display:block;color:var(--muted);font-size:10px;margin-top:4px}

.calendar-diagnostics summary{cursor:pointer;font-weight:650;font-size:15px}
.diagnostic-filters{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0 12px}
.diagnostic-filters button{font-size:11px;padding:7px 10px}
.diagnostic-table{max-height:450px;overflow:auto;border:1px solid var(--line);border-radius:6px}
.diagnostic-table table{table-layout:fixed;width:100%}
.diagnostic-table th,.diagnostic-table td{position:static;white-space:normal;overflow-wrap:anywhere;text-align:left;max-width:none;padding:12px}
.diagnostic-table th:nth-child(1){width:30%}
.diagnostic-table th:nth-child(2){width:6%}
.diagnostic-table th:nth-child(3){width:44%}
.diagnostic-table th:nth-child(4){width:20%}
.diagnostic-table td small{display:block;color:var(--muted);margin:4px 0 9px;line-height:1.5}
.diagnostic-product{background:transparent;border:0;padding:0;text-align:left;white-space:normal;line-height:1.5;font-size:11px}
.diagnostic-table a{display:inline-block;margin-bottom:7px}

.diagnostic-filters button.selected{background:#e8efff;border-color:#799bf2;color:#1b4fd3}

.missing-after-report table{width:100%;min-width:0;table-layout:fixed}
.missing-after-report th,.missing-after-report td{white-space:normal;overflow-wrap:anywhere;position:static;text-align:left}
.missing-after-report th:nth-child(1){width:42%}
.missing-after-report th:nth-child(2){width:7%}
.missing-after-report th:nth-child(3){width:9%}
.missing-after-report th:nth-child(4){width:42%}

.market-controls{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.hidden-products{position:relative}.hidden-products summary{list-style:none;cursor:pointer;border:1px solid #426bff;border-radius:5px;color:#245be8;padding:7px 12px;background:white}.hidden-products summary::after{content:' ▾'}.hidden-items-list{position:absolute;left:0;top:100%;z-index:15;background:white;border:1px solid #cad6ef;border-radius:6px;padding:12px;box-shadow:0 6px 20px #173d7320;width:min(460px,70vw);max-height:350px;overflow:auto}.hidden-product{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid #e2e8f5}.hidden-product span{overflow-wrap:anywhere}.hidden-product button{flex-shrink:0}.sku-context-menu{position:fixed;z-index:100;background:#fff;border:1px solid #cad6ef;padding:5px;border-radius:6px;box-shadow:0 5px 18px #173d7330}.sku-context-menu[hidden]{display:none}.methods-table{table-layout:fixed;width:100%;min-width:0}.methods-table th:first-child{width:50%}.methods-table th:nth-child(2){width:22%}.methods-table td{white-space:normal;overflow-wrap:anywhere}

.methods-table th,.methods-table td{text-align:left}

.methods-table .method-editor,.methods-table .method-comment{display:block;width:100%;max-width:100%;height:22px;min-height:22px;padding:2px 6px;border-radius:4px;font:inherit;line-height:16px;color:inherit;box-sizing:border-box}.methods-table .method-comment{resize:vertical}.methods-table tbody td{height:27px;padding:2px 14px;line-height:18px;vertical-align:middle}.methods-table tbody td:first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.hidden-products summary{display:list-item;list-style:disclosure-closed;border:0;border-radius:0;padding:7px 0;background:transparent;color:var(--blue)}.hidden-products[open] summary{list-style:disclosure-open}.hidden-products summary::after{content:none}.hidden-products summary::marker{color:var(--blue)}.hidden-items-list{position:static;width:auto;max-width:min(600px,75vw);max-height:350px;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent}.hidden-items-list ul{margin:10px 0;padding-left:14px}.hidden-items-list li{padding:4px 0}.hidden-product{border:0;padding:0;gap:18px}.hidden-product button{padding:4px 8px}.sku-context-menu{border-radius:10px;padding:5px}.sku-context-menu button{border-radius:6px;padding:9px 18px;font-size:12px}

.market-controls{align-items:flex-start;column-gap:24px;row-gap:8px}.hidden-items-list{max-height:180px;color:#17315a}
.market-controls .market-toggle{margin:0;padding:7px 0;line-height:16px;white-space:nowrap}
.market-controls .market-toggle input{margin:0;flex-shrink:0}
.hidden-products summary{display:flex;align-items:center;gap:6px;list-style:none;line-height:16px;white-space:nowrap}
.hidden-products[open] summary{list-style:none}
.hidden-products summary::-webkit-details-marker{display:none}
.hidden-products summary::before{content:'▸';display:block;flex:0 0 10px;width:10px;text-align:center;color:var(--blue)}
.hidden-products[open] summary::before{content:'▾'}

.hidden-products-actions{position:sticky;top:0;z-index:1;background:white;padding:6px 0;text-align:right}.hidden-products-actions button{padding:6px 12px}

.method-comment-actions{display:flex;align-items:center;gap:6px}.method-comment-actions .method-comment{flex:1;min-width:0}.methods-table .delete-method-row{flex:0 0 22px;width:22px;height:22px;padding:0;border-color:transparent;background:transparent;color:#bb493e;font-size:18px;line-height:20px}.methods-table .delete-method-row:hover{background:#fff1ee;border-color:#f0bfb6}#deleted-methods{margin-top:12px;font-size:11px}#deleted-methods summary{cursor:pointer;color:var(--blue)}#deleted-methods-list{max-height:220px;overflow:auto;display:grid;gap:8px;padding:10px 0}

/* Method colours stay visible in the compact editor. */
.methods-table .method-editor[data-method-value="план"]{background-color:#dcf3df;color:#17652d;border-color:#9bd3a7}
.methods-table .method-editor[data-method-value="план или выше"]{background-color:#dfefff;color:#174f8a;border-color:#a7ccef}
.methods-table .method-editor[data-method-value="сомневаюсь, разобраться"]{background-color:#fff2b3;color:#735500;border-color:#e5c354}
.methods-table .method-editor[data-method-value="есть товар аналог"]{background-color:#ffe1e1;color:#8a3030;border-color:#e8abab}
.methods-table .method-editor option{background:#fff;color:#17345c}

.methods-table th:first-child{width:34%}.methods-table th:nth-child(2){width:19%}.methods-table th:nth-child(3){width:7%}.methods-table th:nth-child(4){width:8%}.methods-table th:nth-child(5){width:20%}.methods-table th:nth-child(6){width:12%}.methods-table th{white-space:normal}.methods-table td:nth-child(3),.methods-table td:nth-child(4),.methods-table td:nth-child(6){text-align:center}.methods-table .method-flag{width:14px;height:14px;min-height:0;margin:0;vertical-align:middle;accent-color:#245be8;cursor:pointer}
@media(max-width:700px){#sku-table tbody td:first-child{grid-column:auto;font-weight:400;font-size:12px}#sku-table tbody td.name{grid-column:1/-1;font-weight:600;font-size:14px}#sku-table tbody td:not(.name)::before{content:attr(data-label);display:block;color:var(--muted);font-size:10px;margin-bottom:4px}#sku-table tbody td.name::before{display:none}}

#methods-table .methods-table th:first-child{width:40%}#methods-table .methods-table th:nth-child(2){width:19%}#methods-table .methods-table th:nth-child(3){width:25%}#methods-table .methods-table th:nth-child(4){width:16%}#methods-table .methods-table td:nth-child(3){text-align:left}#methods-table .methods-table td:nth-child(4){text-align:center}
