/* Подвкладка «Себестоимость»: стиль карточек главного экрана */
.cost-banner{padding:12px 18px;border-radius:18px;background:#dfece2b3;color:#25523a;font-size:13px;line-height:19px}
.cost-banner-warn{background:#f9e6d5b0;color:#7a3a00}
.cost-meta{font-size:12px;color:#5a6a75;padding:0 6px}
.cost-tools{gap:8px}
.cost-bulk{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 14px;border-radius:16px;background:#ffffff80;font-size:12px;color:#344655}
.cost-status{font-size:12px;color:#25523a;min-width:120px}
.cost-bad{color:#c0141f}
.cost-input{height:32px;padding:0 10px;border:1px solid #dfe3e1;border-radius:10px;background:#fffffff0;font-size:12px;color:#092033;box-sizing:border-box;min-width:0}
.cost-input:focus{outline:2px solid #2f86e8;outline-offset:-1px;border-color:transparent}
.cost-num{text-align:right;white-space:nowrap}
.cost-save{margin-top:0!important;width:auto!important;padding:0 20px;border:0}
.cost-save:disabled{opacity:.5;cursor:default}
.cost-table-wrap{overflow:auto;border-radius:20px;background:linear-gradient(110deg,#faf9f5ce,#f7f6f3d6)}
.cost-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12px}
.cost-table th{position:sticky;top:0;z-index:2;padding:10px 8px;background:#e7ebee;color:#344655;font-weight:500;font-size:11px;text-align:left}
.cost-table td{padding:8px;vertical-align:middle;border-bottom:1px solid #e6e5e1}
.cost-table tr:last-child td{border-bottom:0}
.cost-row-none{background:#f9e6d540}
.cost-name{max-width:280px}
.cost-name span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;color:#092033}
.cost-name small,.cost-history{color:#7a8893;font-size:11px}
.cost-src{display:inline-block;margin-top:2px;padding:1px 8px;border-radius:10px;background:#e7ebee;color:#344655;font-size:11px}
.cost-src-none{background:#f9e6d5;color:#a84900}
.cost-table .cost-input.cost-num{width:110px}
.cost-table select.cost-input{width:84px}
.cost-table input[type=date].cost-input{width:132px}
.cost-table .cost-input:not(.cost-num):not(select):not([type=date]){width:100%}

/* Свои даты в переключателе периода Дашборда */
.dg-dates{display:inline-flex;align-items:center;gap:6px;margin-left:6px}
.dg-date{height:32px;padding:0 8px;border:1px solid #dfe3e1;border-radius:10px;background:#fffffff0;font-size:12px;color:#092033}
.dg-date-error{color:#c0141f;font-size:11px}

/* Подвкладка «Продажи» */
.sales-panel{display:flex;flex-direction:column;gap:8px}
.sales-periods{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.sales-dates{display:inline-flex;align-items:center;gap:6px;margin-left:6px}
.sales-row{display:flex;gap:10px;align-items:center}
.sales-error{color:#c0141f;font-size:11px;min-height:0}
.sales-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.sales-kpi{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:12px 16px;border:0;border-radius:18px;background:linear-gradient(130deg,#f9f8f5db,#f8f7f5c9);cursor:pointer;text-align:left;color:#092033}
.sales-kpi.active{background:linear-gradient(135deg,#454a4c,#303639);color:#fff}
.sales-kpi-name{font-size:12px;opacity:.8}
.sales-kpi strong{font-size:18px;font-weight:500;letter-spacing:-.4px}
.sales-kpi-label{font-size:11px;opacity:.7}
.sales-kpi-unknown{color:#a84900;opacity:1}
.sales-chart-card{padding:14px 18px 10px;border-radius:20px;background:linear-gradient(110deg,#faf9f5ce,#f7f6f3d6)}
.sales-chart-head{display:flex;justify-content:space-between;gap:12px;align-items:baseline;flex-wrap:wrap}
.sales-chart-head small{font-size:11px;color:#6b7d8d}
.sales-chart{position:relative;height:230px;margin:10px 0 20px 0}
.sales-cols{position:absolute;inset:0 0 0 0;display:flex;gap:2px;align-items:stretch}
.sales-col{position:relative;flex:1 1 0;min-width:0}
.sales-bar{position:absolute;left:12%;right:12%;border-radius:4px 4px 0 0;min-height:1px}
.sales-bar-neg{border-radius:0 0 4px 4px}
.sales-x{position:absolute;top:calc(100% + 4px);left:50%;transform:translateX(-50%);font-size:10px;color:#6b7d8d;white-space:nowrap}
.sales-zero{position:absolute;left:0;right:0;height:1px;background:#73818b55}
.sales-y{position:absolute;left:0;font-size:10px;color:#7a8893;background:#faf9f5cc;padding:0 4px;z-index:2}
.sales-y-top{top:0}
.sales-y-bottom{bottom:0}
.sales-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#7a8893;font-size:13px;margin:0}
.sales-sort{border:0;background:transparent;font:inherit;color:inherit;cursor:pointer;padding:0}
.sales-sort.active{color:#092033;font-weight:600}

/* Сезонность товара в разборе штуки */
.season-block{display:flex;flex-direction:column;gap:6px;margin:6px 0 4px}
.season-line{margin:0;font-size:12px;color:#3d5260}
.season-months{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:3px}
.season-chip{height:26px;border:0;border-radius:8px;font-size:10px;cursor:pointer;background:#eceeed;color:#6b7d8d;padding:0}
.season-peak{background:#cfe9d7;color:#25523a}
.season-low{background:#dfe3e6;color:#7a8893}
.season-mine{background:#454a4c;color:#fff}
.season-now{outline:2px solid #2f86e8;outline-offset:1px}
.season-note{margin:0;font-size:11px;color:#7a8893}
.season-owner{font-size:12px}
.season-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.season-status{font-size:11px;color:#25523a}

/* Блок Дашборда «Календарь закупок» */
.cal-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.cal-month{display:flex;flex-direction:column;gap:3px;padding:8px 10px;border-radius:14px;background:#ffffff80;min-width:0}
.cal-month b{font-size:11px;font-weight:500;color:#3d5260;text-transform:capitalize}
.cal-now{background:#f9e6d5a0}
.cal-item,.cal-empty{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#092033}
.cal-empty{color:#9aa5ad}
.cal-item.cal-пора{color:#a84900}
.cal-row{display:flex;justify-content:space-between;gap:8px;font-size:12px;padding:3px 0}
.cal-row b{font-weight:500;white-space:nowrap}
.cal-пора b{color:#a84900}

/* «Потеряшки»: спокойные карточки, когда потерь нет */
.loss-ok{background:linear-gradient(130deg,#e4efe7cc,#edf4eacc)}
.loss-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
.loss-kpis .sales-kpi{cursor:default}

/* «Финансы» */
.fin-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}
.fin-kpis .sales-kpi,.fin-net{cursor:default}
.fin-table td{padding:7px 10px}
.fin-row td:first-child{width:62%}
.fin-total td{font-weight:600;background:#ece9e2;border-top:1px solid #d5d3cc}
.fin-kind{font-size:11px;color:#7a8893;width:90px}
.fin-honest{color:#7a3a00}
.fin-net{margin-top:6px;flex-direction:column}
.fin-net strong{font-size:22px}

/* План закупок в разделе поставок и короткая сводка в карточке товара. */
.supply-plan,.product-buy-plan {
  --plan-ink:#26383e;
  --plan-muted:#4e6269;
  --plan-accent:#245950;
  --plan-rule:#d5dfdc;
  box-sizing:border-box;
  color:var(--plan-ink);
  background:#fffefa;
  text-align:left;
  overflow-wrap:anywhere;
  line-height:1.45;
}
.supply-plan {
  container-type:inline-size;
  flex:none;
  min-width:0;
  padding:clamp(14px,2.4vw,28px);
  border:1px solid var(--plan-rule);
  border-radius:22px;
  font-size:15px;
}
.supply-plan :is(p,h2,h3,h4,dl,dd) { margin:0; }
.supply-head,.supply-item-head,.supply-store-name,.supply-budget {
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  justify-content:space-between;
  gap:6px 18px;
}
.supply-head { margin-bottom:16px; }
.supply-head h2 { font-size:clamp(21px,2vw,28px); line-height:1.18; }
.supply-head>span,.supply-note,.supply-dates,.supply-plan small { color:var(--plan-muted); }
.supply-plan :is(select,button),.product-buy-plan button { font:inherit; cursor:pointer; }
.supply-plan select { max-width:100%; min-width:0; padding:8px 12px; color:inherit; background:#fff; border:1px solid #a2b3ad; border-radius:9px; }
.supply-plan :is(select,button,summary):focus-visible,.product-buy-plan button:focus-visible { outline:3px solid #32786b; outline-offset:2px; }
.supply-modes { display:flex; flex-wrap:wrap; gap:4px; margin:8px 0 12px; }
.supply-modes button { padding:7px 12px; min-height:37px; border:1px solid transparent; background:#eef1ed; border-radius:9px; color:#344a44; }
.supply-modes button[aria-pressed=true] { background:var(--plan-accent); color:white; }
.supply-results { min-width:0; }
.supply-period-choice { width:auto; margin-bottom:12px; }
.supply-budget { background:#edf3ee; border-radius:12px; padding:12px 16px; align-items:center; }
.supply-budget strong { display:block; font-size:clamp(20px,2vw,27px); line-height:1.22; color:#183e34; }
.supply-budget :is(span,p) { font-size:14px; color:#344e43; }
.supply-costs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; padding:12px 0; }
.supply-costs div { min-width:0; }
.supply-costs dt,.supply-note,.supply-plan small { font-size:13px; }
.supply-costs dt { color:var(--plan-muted); }
.supply-costs dd,.supply-qty { font-weight:600; font-variant-numeric:tabular-nums; }
.supply-note { margin:5px 0 11px!important; }
.supply-store-name { padding:12px 0 7px; font-size:16px; color:var(--plan-accent); }
.supply-line { border-top:1px solid var(--plan-rule); padding:12px 0; }
.supply-item-head h4 { flex:1 1 140px; font-size:16px; line-height:1.35; color:var(--plan-ink); }
.supply-qty { white-space:nowrap; }
.supply-dates { padding-top:2px; font-size:14px; }
.supply-line summary,.supply-more>summary { width:fit-content; max-width:100%; padding:5px 0; font-size:14px; cursor:pointer; color:var(--plan-accent); }
.supply-terms { display:grid; gap:.55rem; max-width:34rem; padding:.5rem 0; }
.supply-terms label { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.supply-terms select { font:inherit; color:var(--plan-ink); padding:.35rem .55rem; max-width:100%; }
.supply-terms button { justify-self:start; }
.supply-terms p:empty { display:none; }
.supply-reason[open] { margin:4px 0; }
.supply-reason p,.supply-season-note { color:var(--plan-muted); font-size:14px; }
.supply-more>summary { min-height:32px; text-decoration:underline; text-underline-offset:3px; }
.supply-economics,.product-buy-plan .plan-product-link {
  display:inline-block;
  background:transparent;
  border:0;
  padding:5px 0;
  color:var(--plan-accent);
  font:inherit;
  font-size:14px;
  font-weight:600;
  line-height:1.4;
  text-align:left;
  text-decoration:underline;
  text-underline-offset:3px;
  cursor:pointer;
}
.supply-target { outline:2px solid var(--plan-accent); outline-offset:-2px; border-radius:10px; padding:12px; background:#f0f6f1; }
.product-buy-plan { padding:14px 16px; margin:10px 0; border-inline-start:3px solid var(--plan-accent); background:#edf3ee; border-radius:8px; }
.product-buy-plan h3 { margin:0 0 5px; font-size:17px; color:var(--plan-ink); }
.product-buy-plan p { margin:4px 0; font-size:15px; line-height:1.45; color:var(--plan-ink); }
@container (max-width:540px) {
  .supply-costs { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .supply-head { align-items:flex-start; }
  .supply-head select { font-size:14px; }
  .supply-modes button { font-size:14px; }
}
.product-buy-actions { display:flex; align-items:center; gap:6px 14px; flex-wrap:wrap; margin-top:10px; }
.product-buy-actions .plan-product-add { min-height:39px; padding:8px 14px; border:0; border-radius:9px; background:var(--plan-accent); color:#fff; font:inherit; font-size:15px; font-weight:600; }
.product-buy-actions .plan-product-add:disabled { opacity:.65; cursor:progress; }
.product-buy-actions .plan-product-link { min-height:39px; }

/* Решение о закупке и факты прогноза в карточке товара. */
.product-buy-plan { background:#fff; color:#263b35; border:1px solid #c2d4cb; border-radius:12px; padding:14px 18px; container-type:inline-size; }
.product-buy-plan h3 { font-size:16px; font-weight:650; color:#334942; margin:0 0 10px; }
.buy-decision { display:grid; grid-template-columns:1fr 1fr; align-items:start; gap:12px; }
.buy-decision>div { min-width:0; display:grid; gap:2px; }
.buy-quantity span { color:#175546; font-size:16px; font-weight:650; }
.buy-quantity strong { color:#124b3d; font-size:32px; font-weight:750; line-height:1.05; }
.buy-quantity strong small { font-size:18px; font-weight:600; }
.buy-estimate { border-inline-start:1px solid #cbd9d1; padding-inline-start:16px; }
.buy-estimate>span,.buy-facts dt,.buy-estimate small { font-size:13px; color:#4c6058; }
.buy-estimate strong { color:#253d35; font-size:21px; font-weight:700; line-height:1.2; }
.buy-facts { display:flex; flex-wrap:wrap; gap:8px 25px; margin:12px 0 0; padding-top:9px; border-top:1px solid #dce4df; }
.buy-facts dt,.buy-facts dd { margin:0; }
.buy-facts dd { margin-top:2px; color:#283d36; font-size:16px; font-weight:650; }
.buy-facts .buy-low-stock dd { color:#a6381b; }
@container (max-width:380px) {
  .buy-decision { grid-template-columns:auto minmax(0,1fr); gap:10px; }
  .buy-estimate { padding-inline-start:10px; }
  .buy-estimate strong { font-size:18px; }
  .buy-facts { gap:8px 14px; }
}

.product-buy-plan .buy-period-budget { margin-top:12px; padding-top:10px; border-top:1px solid #d4e0d9; }
.product-buy-plan .buy-period-budget h4 { margin:0 0 7px; color:#263b35; font-size:16px; font-weight:700; }
.buy-period-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0; background:#edf4ee; border-radius:9px; padding:10px 0; }
.buy-period { display:grid; align-content:start; gap:3px; min-width:0; padding-inline:13px; }
.buy-period + .buy-period { border-inline-start:1px solid #c4d6cc; }
.product-buy-plan .buy-period h5 { margin:0; color:#315549; font-size:14px; font-weight:650; }
.product-buy-plan .buy-period-money { font-size:clamp(17px,3.2cqi,23px); font-weight:750; line-height:1.18; color:#124b3d; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.buy-period-dates,.buy-period small { color:#41544d; line-height:1.3; font-size:13px; }
.product-buy-plan .buy-period-missing { color:#5d4933; font-size:13px; margin:6px 0 0; }
.buy-period-details { margin-top:6px; font-size:14px; color:#344e43; }
.buy-period-details summary { cursor:pointer; width:fit-content; text-decoration:underline; text-underline-offset:3px; padding:4px 0; }
.buy-period-details table { width:100%; border-collapse:collapse; margin-top:5px; font-variant-numeric:tabular-nums; }
.buy-period-details :is(th,td) { padding:5px 4px; border-bottom:1px solid #dbe6de; text-align:right; font-size:13px; overflow-wrap:anywhere; }
.buy-period-details th:first-child { text-align:left; }
.buy-period-details tbody th { font-weight:500; }
@container (max-width:390px) {
  .buy-period { padding-inline:8px; }
  .product-buy-plan .buy-period h5 { font-size:13px; }
}

/* Стоимость единицы и основание двух расчётов в карточке товара. */
.product-unit-cost {
  flex:none; margin:8px 0 0; padding:12px 16px; border:1px solid var(--unit-line,#becfc9);
  border-radius:12px; background:var(--unit-bg,#fff); color:var(--unit-ink,#263b35);
  text-align:start; line-height:1.35; container-type:inline-size;
}
.product-unit-cost h3,.pd-sales-heading { margin:0 0 8px; font-size:17px; font-weight:680; }
.unit-cost-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 16px; }
.unit-cost-pair > div { min-width:0; }
.unit-cost-actual { border-inline-start:1px solid var(--unit-line,#c9d5ce); padding-inline-start:16px; }
.product-unit-cost h4 { margin:0 0 2px; font-size:15px; font-weight:600; color:inherit; }
.unit-stock-cost { margin-top:10px; padding-top:10px; border-top:1px solid var(--unit-line,#c9d5ce); }
.unit-cost-value,.stock-cost-value { display:block; color:var(--unit-number,#244e44); font-size:clamp(18px,3.5cqi,25px);
  line-height:1.18; font-weight:700; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.product-unit-cost p { margin:4px 0 0; color:var(--unit-soft,#4b6058); font-size:13px; line-height:1.4; overflow-wrap:anywhere; }
.product-unit-cost .unit-cost-note { color:var(--unit-note,#72502c); }
.product-unit-cost details { margin-top:7px; font-size:14px; }
.product-unit-cost summary,.unit-cost-link { width:fit-content; cursor:pointer; color:var(--unit-number,#245447);
  font:inherit; text-decoration:underline; text-underline-offset:3px; padding:3px 0; }
.unit-cost-link { border:0; background:none; }
.product-unit-cost :is(button,summary,input,select):focus-visible,.product-image[role="button"]:focus-visible {
  outline:3px solid #348273; outline-offset:2px;
}
.unit-cost-breakdown table { width:100%; border-collapse:collapse; margin-top:4px; color:inherit; }
.unit-cost-breakdown :is(th,td) { padding:5px 4px; border-bottom:1px solid var(--unit-line,#d6e0d9); text-align:end;
  font-size:13px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.unit-cost-breakdown th:first-child { text-align:start; }
.unit-cost-breakdown tbody th { font-weight:500; }
.unit-cost-history ul { list-style:none; margin:4px 0; padding:0; }
.unit-cost-history li { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 14px; justify-content:space-between;
  padding:5px 0; border-bottom:1px solid var(--unit-line,#d6e0d9); font-size:13px; }
.unit-cost-receipt form { margin-top:6px; padding:10px; border-radius:8px; background:var(--unit-form,#f1f6f3); }
.unit-cost-receipt label { display:grid; gap:4px; align-content:start; font-size:13px; }
.unit-cost-receipt :is(input,select) { width:100%; min-width:0; box-sizing:border-box; min-height:36px; padding:4px 8px;
  color:inherit; border:1px solid var(--unit-line,#adbbb3); border-radius:6px; background:var(--unit-bg,#fff); font:inherit; }
.receipt-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:end; gap:6px 12px; margin-top:8px; }
.unit-cost-receipt .unit-cost-instruction { margin:10px 0 4px; }
.unit-cost-save { margin-top:8px; padding:7px 12px; font:inherit; cursor:pointer; color:#fff; border:0; border-radius:7px; background:#215849; }
.unit-cost-save:disabled { opacity:.65; cursor:default; }
html[data-theme="graphite"] .product-unit-cost { --unit-ink:#eef4f0; --unit-bg:#25302c; --unit-line:#485c53; --unit-number:#a4e1c7;
  --unit-note:#f4cb98; --unit-soft:#c3d5cc; --unit-form:#2c3833; }
#widget-panel-body:has(> .pd-sales-region) { overflow-y:auto; scrollbar-width:thin; overscroll-behavior:contain; }
#widget-panel-body:has(> .pd-sales-region) > * { flex:none; }
@container (max-width:360px) {
  .unit-cost-pair { gap:6px 10px; }
  .unit-cost-actual { padding-inline-start:10px; }
  .unit-cost-pair h4 { font-size:13px; }
  .receipt-fields { grid-template-columns:1fr; }
}
/* Раскрытые расчёты в карточке Uzum и календаре закупок. */
.product-buy-plan, .supply-plan {
  --detail-paper: #fff;
  --detail-wash: #f1f6f3;
  --detail-ink: #263b35;
  --detail-muted: #455e54;
  --detail-accent: #215848;
  --detail-rule: #d2dfd8;
}
.buy-period-details, .supply-reason, .supply-more {
  border-block-start: 1px solid var(--detail-rule);
  margin-block-start: 8px;
}
.product-buy-plan .buy-period-details > summary,
.supply-plan :is(.supply-reason,.supply-more) > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 9px 5px;
  list-style: none;
  color: var(--detail-accent);
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
:is(.buy-period-details,.supply-reason,.supply-more) > summary::-webkit-details-marker { display: none; }
:is(.buy-period-details,.supply-reason,.supply-more) > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  flex: none;
  margin-inline-end: 5px;
}
:is(.buy-period-details,.supply-reason,.supply-more)[open] > summary::after {
  transform: translateY(2px) rotate(225deg);
}
:is(.buy-period-details,.supply-reason,.supply-more) > summary:focus-visible {
  outline: 2px solid var(--detail-accent);
  outline-offset: -2px;
  border-radius: 5px;
}
@media (hover:hover) {
  :is(.buy-period-details,.supply-reason,.supply-more) > summary:hover { background: var(--detail-wash); }
}
.product-buy-plan .buy-period-details table { width: 100%; table-layout: fixed; margin: 6px 0; }
.product-buy-plan .buy-period-details :is(th,td) {
  padding: 8px 5px; font-size: 14px; line-height: 1.4; color: var(--detail-ink);
  text-align: end; border-color: var(--detail-rule); overflow-wrap: anywhere;
}
.product-buy-plan .buy-period-details th:first-child { width: 39%; text-align: start; }
.product-buy-plan .buy-period-details thead th {
  color: var(--detail-muted); font-size: 13px; font-weight: 600; vertical-align: bottom;
}
.product-buy-plan .buy-period-details tfoot :is(th,td) {
  background: var(--detail-wash); color: var(--detail-accent); font-weight: 700; border: 0;
}
.payment-calendar { display: grid; gap: 16px; margin: 2px 0 14px; }
.payment-calendar section { min-width: 0; }
.payment-calendar h4 { padding: 5px 9px; background: var(--detail-wash); color: var(--detail-accent); font-size: 15px; border-radius: 4px; }
.payment-calendar ul { list-style: none; margin: 0; padding: 0 8px; }
.payment-calendar li {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: baseline; gap: 12px; padding: 8px 0; line-height: 1.4;
}
.payment-calendar li + li { border-block-start: 1px solid var(--detail-rule); }
.payment-description { min-width: 0; display: grid; gap: 2px; }
.payment-description span { font-weight: 600; }
.payment-calendar strong { text-align: end; font-variant-numeric: tabular-nums; }
.supply-order-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px; padding: 9px 12px; background: var(--detail-wash); border-radius: 6px;
}
.supply-order-facts dt { color: var(--detail-muted); font-size: 13px; }
.supply-order-facts dd { color: var(--detail-ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.supply-order-facts + p { margin-block-start: 8px; }
.supply-terms select, .supply-terms button { min-height: 44px; }
@container (max-width:420px) {
  .supply-terms label { display: grid; grid-template-columns: 1fr; gap: 3px; }
  .supply-terms select { width: 100%; }
}
.forecast-windows { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.forecast-window { min-width: 0; margin: 0; padding: 12px; background: var(--detail-wash); }
.forecast-window:first-child { border-radius: 8px 0 0 8px; }
.forecast-window:last-child { border-radius: 0 8px 8px 0; }
.forecast-window + .forecast-window { border-inline-start: 1px solid var(--detail-rule); }
.product-buy-plan .forecast-window h4 { margin: 0; color: var(--detail-accent); font-size: 16px; line-height: 1.35; }
.forecast-dates, .forecast-coverage { display: block; color: var(--detail-muted); font-size: 13px; }
.forecast-values { margin: 8px 0; }
.forecast-values > div, .product-buy-plan p.forecast-error {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.forecast-values dt { font-size: 14px; color: var(--detail-ink); }
.forecast-values dd, .forecast-error strong { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }
.product-buy-plan .forecast-error { margin: 6px 0; padding-top: 6px; border-top: 1px solid var(--detail-rule); font-size: 14px; }
.product-buy-plan .forecast-state { font-weight: 600; color: var(--detail-ink); margin-block-start: 8px; }
.product-buy-plan p.detail-note { max-width: 72ch; margin: 7px 0; color: var(--detail-muted); font-size: 14px; line-height: 1.45; }
@container (max-width:540px) {
  .forecast-windows { grid-template-columns: 1fr; gap: 8px; }
  .forecast-window:first-child, .forecast-window:last-child { border-radius: 7px; }
  .forecast-window + .forecast-window { border-inline-start: 0; }
}
.product-unit-cost details { border-block-start: 1px solid var(--unit-line,#d2dfd8); margin-block-start: 8px; }
.product-unit-cost details > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-sizing: border-box; width: 100%; min-height: 44px; padding: 9px 5px;
  list-style: none; text-decoration: none; font-size: 15px; font-weight: 650;
}
.product-unit-cost details > summary::-webkit-details-marker { display: none; }
.product-unit-cost details > summary::after {
  content: ""; width: 8px; height: 8px; flex: none; margin-inline-end: 5px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg);
}
.product-unit-cost details[open] > summary::after { transform: translateY(2px) rotate(225deg); }
@media (hover:hover) { .product-unit-cost details > summary:hover { background: var(--unit-form,#f1f6f3); } }
.stock-cost-method { display: grid; gap: 9px; margin: 2px 0 10px; }
.stock-cost-method dt { font-weight: 650; }
.stock-cost-method dd { margin: 2px 0 0; max-width: 65ch; color: var(--unit-soft,#455e54); }
.unit-cost-breakdown table { table-layout: fixed; }
.unit-cost-breakdown :is(th,td) { padding: 8px 5px; line-height: 1.4; font-size: 14px; }
.unit-cost-breakdown th:first-child { width: 39%; }
.unit-cost-breakdown .unit-cost-missing { color: var(--unit-soft,#455e54); font-size: 13px; }
.unit-cost-breakdown tfoot :is(th,td) { background: var(--unit-form,#edf4ee); color: var(--unit-number,#245447); font-weight: 700; }
.unit-cost-history li { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; gap: 10px; padding: 9px 4px; }
.unit-cost-history li > div { display: grid; gap: 3px; overflow-wrap: anywhere; }
.unit-batch-outcome { text-align: end; font-variant-numeric: tabular-nums; }
.unit-cost-history small { color: var(--unit-soft,#455e54); font-size: 13px; }
.unit-cost-receipt fieldset { margin: 12px 0 0; padding: 8px 0; border: 0; border-block-start: 1px solid var(--unit-line,#c9d5ce); min-width: 0; }
.unit-cost-receipt legend { font-weight: 650; padding: 0 7px 0 0; }
.unit-cost-receipt :is(input,select,button) { min-height: 44px; }
.unit-cost-receipt .unit-cost-instruction { margin: 2px 0 5px; }
@container (max-width:380px) {
  .unit-cost-breakdown :is(th,td), .product-buy-plan .buy-period-details :is(th,td) { padding-inline: 3px; }
  .unit-cost-breakdown th:first-child { width: 35%; }
}
.plan-basis .buy-facts { margin: 0; padding: 0 4px 8px; border: 0; }
.product-buy-plan .plan-demand { padding: 10px 12px; background: var(--detail-wash); color: var(--detail-ink); border-radius: 7px; }
.product-buy-plan .plan-demand h4 { margin: 0 0 7px; font-size: 15px; line-height: 1.4; }
.plan-demand .buy-facts { padding: 0; }
.pd-sales-source .pd-sales-heading { margin-block-end: 2px; }
.pd-sales-source p { margin: 0 0 8px; color: #455e54; font-size: 14px; }
html[data-theme="graphite"] .pd-sales-source p { color: #c3d5cc; }

/* Карточка товара открывается в общей панели; её оформление ограничено окном Uzum. */
#widget-panel:has(> #widget-panel-body > .pd-uzum-head) {
  --pd-paper: #fffefa;
  --pd-ink: #223730;
  --pd-muted: #51655c;
  --pd-line: #d9dfd6;
  --pd-mint: #e7f2e9;
  --pd-tile: #f4f3eb;
  --pd-accent: #20533f;
  --pd-button-ink: #fff;
  --pd-tag: #eee8fe;
  --pd-tag-ink: #563b77;
  border-radius: 24px;
  border-color: var(--pd-line);
  padding: 0;
  color: var(--pd-ink);
  background: var(--pd-paper);

  & > .stock-preview-close {
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 1px solid var(--pd-line);
    background: var(--pd-paper);
    color: var(--pd-muted);
  }
  #widget-panel-body { container: uzum-card / inline-size; }
  .pd-uzum-head {
    justify-content: flex-start;
    gap: 14px;
    padding: 18px 56px 15px 22px;
    margin: 0;
  }
  .pd-head-text { text-align: start; overflow-wrap: anywhere; }
  .pd-head-text h2 {
    margin: 3px 0 2px;
    font-size: clamp(20px, 3.8cqi, 25px);
    line-height: 1.2;
    font-weight: 700;
    color: var(--pd-ink);
  }
  .pd-shop-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
  .pd-shop-line, .pd-sub { margin: 0; font-size: 13px; color: var(--pd-muted); }
  .pd-market { border-radius: 7px; padding: 2px 8px; background: var(--pd-tag); color: var(--pd-tag-ink); font-weight: 700; }
  .pd-photo { width: 66px; height: 68px; border-radius: 14px; }
  .product-buy-plan, .pd-budget-region, .product-unit-cost {
    --detail-paper: var(--pd-paper);
    --detail-wash: var(--pd-tile);
    --detail-ink: var(--pd-ink);
    --detail-muted: var(--pd-muted);
    --detail-accent: var(--pd-accent);
    --detail-rule: var(--pd-line);
    --plan-ink: var(--pd-ink);
    --plan-accent: var(--pd-accent);
    --unit-number: var(--pd-accent);
  }
  .product-buy-plan {
    background: var(--pd-mint);
    color: var(--pd-ink);
    border: 0;
    border-radius: 17px;
    padding: 14px 18px;
    margin: 0 16px;
  }
  .product-buy-plan > h3 { margin: 0 0 4px; font-size: 14px; color: var(--pd-accent); }
  .buy-decision { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; }
  .buy-decision .buy-title {
    margin: 0;
    font-size: clamp(20px, 4cqi, 28px);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.025em;
    color: var(--pd-ink);
  }
  .plan-product-add {
    border: 0;
    border-radius: 11px;
    padding: 9px 15px;
    min-height: 40px;
    background: var(--pd-accent);
    color: var(--pd-button-ink);
    font-weight: 700;
  }
  .plan-product-add:disabled { opacity: .72; cursor: progress; }
  .buy-context { margin: 8px 0 2px; font-size: 14px; }
  .buy-period-details, .buy-facts :is(dt,dd) { color: var(--pd-ink); }
  .product-buy-actions { gap: 4px 14px; margin-top: 2px; }
  .product-unit-cost, .pd-budget-region, .pd-sales-region { margin: 0; padding: 16px 22px; text-align: start; }
  .product-unit-cost { border: 0; border-radius: 0; background: transparent; }
  .product-unit-cost > h3, .buy-period-budget > h4, .pd-sales-heading { margin: 0 0 8px; font-size: 18px; color: var(--pd-ink); }
  .unit-cost-pair { gap: 10px; }
  .unit-cost-pair > div { padding: 12px 15px; border: 0; border-radius: 13px; background: var(--pd-tile); }
  .unit-cost-pair h4 { font-size: 14px; }
  .unit-cost-value { margin: 6px 0 4px; font-size: clamp(18px, 3.6cqi, 23px); color: var(--pd-ink); }
  .unit-cost-pending { font-size: 17px; }
  .pd-budget-region, .pd-sales-region { border-top: 1px solid var(--pd-line); }
  .buy-period-budget { margin: 0; padding: 0; border: 0; }
  .buy-period-pair { display: block; padding: 0; background: transparent; }
  .buy-period {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 3px 12px;
    padding: 8px 0;
    border: 0;
  }
  .buy-period + .buy-period { border-block-start: 1px solid var(--pd-line); }
  .buy-period h5 { margin: 0; font-size: 15px; line-height: 1.4; color: var(--pd-ink); }
  .buy-period-money { text-align: end; color: var(--pd-ink); font-size: 17px; font-variant-numeric: tabular-nums; }
  .buy-period small { text-align: end; }
  .buy-period-dates, .buy-period small, .pd-budget-region .detail-note { color: var(--pd-muted); font-size: 13px; }
  .pd-budget-region :is(.buy-period-missing,.detail-note) { margin: 6px 0; line-height: 1.4; }
  .pd-budget-region .buy-period-details > summary {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    width: 100%; min-height: 44px; padding: 6px 5px; list-style: none;
    text-decoration: none; color: var(--pd-accent); font-weight: 650;
  }
  .pd-budget-region .buy-period-details table { table-layout: fixed; }
  .pd-budget-region .buy-period-details th:first-child { width: 39%; }
  .pd-budget-region .buy-period-details tfoot { background: var(--pd-tile); }
  :is(button,summary,input,select):focus-visible { outline: 2px solid var(--pd-accent); outline-offset: 1px; }

  @container uzum-card (max-width: 500px) {
    .pd-uzum-head { padding: 14px 51px 12px 14px; gap: 10px; }
    .pd-photo { width: 54px; height: 56px; }
    .product-buy-plan { margin: 0 9px; padding: 13px; }
    .product-unit-cost, .pd-budget-region, .pd-sales-region { padding: 14px; }
    .unit-cost-pair { gap: 7px; }
    .unit-cost-pair > div { padding: 11px; }
  }
  @container uzum-card (max-width: 395px) {
    .unit-cost-pair { grid-template-columns: 1fr; }
    .buy-decision { flex-direction: column; align-items: flex-start; }
    .buy-period { display: flex; flex-direction: column; gap: 3px; }
    .buy-period-money, .buy-period small { text-align: start; }
  }
  @media (pointer: coarse) {
    & > .stock-preview-close, .plan-product-add { min-width: 44px; min-height: 44px; }
  }
}
html[data-theme="graphite"] #widget-panel:has(> #widget-panel-body > .pd-uzum-head) {
  --pd-paper: #202925;
  --pd-ink: #edf6f0;
  --pd-muted: #b9ccc1;
  --pd-line: #47554b;
  --pd-mint: #223c31;
  --pd-tile: #32372f;
  --pd-accent: #b1dfbf;
  --pd-button-ink: #102d20;
  --pd-tag: #443756;
  --pd-tag-ink: #e8d8ff;
}
