#moyskladLinksDialog{width:min(1180px,calc(100vw - 28px));max-width:calc(100vw - 28px)}
#moyskladLinksDialog p{line-height:1.5}
.moysklad-links-table{overflow:auto;max-height:52vh;margin:16px 0}
.moysklad-links-table table{min-width:920px;width:100%;table-layout:fixed}
.moysklad-links-table th:last-child{width:48px}
.moysklad-links-table th{position:sticky;top:0;z-index:1;background:var(--surface)}
.moysklad-links-table td{vertical-align:top;white-space:normal}
.moysklad-links-table input{width:100%;min-width:0;box-sizing:border-box}
.moysklad-links-table small{display:block;font-size:11px;line-height:1.45;color:var(--muted);margin-top:5px}
#moyskladLinksBody tr[hidden]{display:none}
@media(max-width:760px){#moyskladLinksDialog{padding:0}#moyskladLinksForm{padding:18px}.moysklad-links-table{max-height:40vh}.moysklad-links-table table{min-width:0;display:block}.moysklad-links-table thead{display:none}.moysklad-links-table tbody{display:block}.moysklad-links-table tr{display:grid;grid-template-columns:1fr;position:relative;border-bottom:1px solid var(--border);padding:8px 0 16px}.moysklad-links-table td{display:block;padding:6px 0;border:0}.moysklad-links-table td::before{content:attr(data-label);display:block;margin-bottom:4px;color:var(--muted);font-size:11px}.moysklad-links-table td:last-child{position:absolute;top:0;right:0}.moysklad-links-table td:last-child::before{display:none}#moyskladLinksDialog menu{flex-wrap:wrap}}
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --ink: #172026;
  --muted: #66737b;
  --line: #dce2e6;
  --line-strong: #c6d0d6;
  --green: #16815c;
  --green-soft: #e3f3ec;
  --blue: #2f6fed;
  --blue-soft: #e9f0ff;
  --amber: #a86600;
  --amber-soft: #fff2d7;
  --red: #c43f4c;
  --red-soft: #fdebed;
  --purple: #7253b6;
  --sidebar: #172026;
  --shadow: 0 1px 2px rgba(23, 32, 38, .06);
}

[hidden] { display: none !important; }

/* Competitor intelligence */
.competitor-head{align-items:flex-end}
.competitor-toolbar{display:grid;grid-template-columns:minmax(150px,1fr) minmax(140px,.8fr) minmax(150px,.8fr) minmax(150px,.8fr) minmax(240px,1.5fr);gap:10px;margin:14px 0}
.competitor-toolbar label,.competitor-form-grid label,.competitor-observation-grid label{display:flex;flex-direction:column;gap:6px;min-width:0}
.competitor-toolbar label>span,.competitor-form-grid label>span,.competitor-observation-grid label>span{color:var(--muted);font-size:11px}
.competitor-toolbar select,.competitor-toolbar input{width:100%;height:38px}
.competitor-shell{max-height:58vh}
.competitor-shell table{min-width:1180px}
.competitor-group td{background:var(--surface-2);border-top:1px solid var(--line-strong);border-bottom:1px solid var(--line);padding:0!important}
.competitor-group-button{width:100%;display:grid;grid-template-columns:20px minmax(240px,1fr) auto;align-items:center;gap:10px;padding:11px 14px;border:0;background:transparent;color:var(--ink);text-align:left}
.competitor-group-button>svg{width:16px;height:16px;color:var(--muted);transition:transform .15s ease}
.competitor-group.expanded .competitor-group-button>svg{transform:rotate(90deg)}
.competitor-group-main{display:flex;flex-direction:column;gap:3px;min-width:0}
.competitor-group-main strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.competitor-group-main small{color:var(--muted);font-size:11px}
.competitor-group-meta{color:var(--muted);font-size:11px;white-space:nowrap}
.competitor-group-meta b{color:var(--ink)}
.competitor-group-meta em{color:var(--amber);font-style:normal;font-weight:700}
.competitor-row{cursor:pointer}
.competitor-row.selected td{background:var(--green-soft)}
.competitor-product{display:flex;flex-direction:column;gap:2px;min-width:260px;max-width:390px}
.competitor-product strong{color:var(--ink)}
.competitor-product span{color:var(--ink);white-space:normal;line-height:1.3}
.competitor-product small,.competitor-update small,.competitor-row td>small{display:block;color:var(--muted);font-size:10px;margin-top:3px}
.competitor-update{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:126px}
.competitor-source.manual{color:var(--muted)}
.competitor-source.mpstats{color:#70a5ff;background:rgba(75,126,220,.12)}
.competitor-source.ozon_premium{color:var(--green);background:var(--green-soft)}
.competitor-row .positive{color:var(--green)}
.competitor-row .negative{color:var(--red)}
.row-actions{display:flex;gap:5px;align-items:center;white-space:nowrap}
.row-actions a.icon-btn{display:inline-flex;text-decoration:none}
.competitor-detail{margin-top:14px}
.competitor-detail>.section-head p{color:var(--muted);font-size:12px;margin-top:3px}
.competitor-detail .unit-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.competitor-detail .unit-actions a{text-decoration:none}
.competitor-latest-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:1px solid var(--line);margin-top:12px}
.competitor-latest-facts>span{display:flex;flex-direction:column;min-height:90px;padding:13px 15px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);color:var(--muted);font-size:11px}
.competitor-latest-facts>span:nth-child(3n){border-right:0}
.competitor-latest-facts>span:nth-last-child(-n+3){border-bottom:0}
.competitor-latest-facts strong{color:var(--ink);font-size:18px;margin:7px 0 3px}
.competitor-latest-facts small{color:var(--muted);font-size:10px;line-height:1.35}
.competitor-notes{margin-top:10px;padding:12px 14px;border-left:3px solid var(--amber);background:var(--amber-soft)}
.competitor-notes strong{display:block;margin-bottom:5px}
.competitor-notes p{margin:3px 0;color:var(--ink);line-height:1.45}
.competitor-reference-note{display:flex;align-items:flex-start;gap:8px;margin-top:10px;padding:10px 12px;border:1px solid var(--line);background:var(--surface-2);color:var(--muted);font-size:11px;line-height:1.45}
.competitor-reference-note svg{width:15px;height:15px;flex:0 0 15px;margin-top:1px}
.competitor-detail-grid{display:grid;grid-template-columns:minmax(0,1fr) 260px;border:1px solid var(--line);margin:12px 0}
.competitor-chart-wrap{min-height:210px;padding:12px;border-right:1px solid var(--line);display:flex;align-items:center}
.competitor-chart-box{width:100%}
.competitor-chart-legend{display:flex;gap:16px;justify-content:flex-end;color:var(--muted);font-size:10px}
.competitor-chart-legend span{display:flex;align-items:center;gap:5px}
.competitor-chart-legend i{width:18px;height:3px;border-radius:2px;background:var(--blue)}
.competitor-chart-legend i.seller{background:var(--amber)}
.competitor-chart{display:block;width:100%;height:190px;overflow:visible}
.competitor-chart .grid-line{stroke:var(--line-strong);stroke-width:1}
.competitor-chart .chart-line{fill:none;stroke:var(--blue);stroke-width:3;stroke-linejoin:round;stroke-linecap:round}
.competitor-chart .chart-line-seller{fill:none;stroke:var(--amber);stroke-width:3;stroke-linejoin:round;stroke-linecap:round}
.competitor-chart .chart-line-points circle{fill:var(--surface);stroke:var(--blue);stroke-width:3}
.competitor-chart .chart-line-seller-points circle{fill:var(--surface);stroke:var(--amber);stroke-width:3}
.competitor-facts{display:grid;grid-template-rows:repeat(3,1fr)}
.competitor-facts span{display:flex;flex-direction:column;justify-content:center;padding:12px 16px;border-bottom:1px solid var(--line);color:var(--muted);font-size:11px}
.competitor-facts span:last-child{border-bottom:0}
.competitor-facts strong{color:var(--ink);font-size:17px;margin-top:4px}
.competitor-form-grid,.competitor-observation-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.competitor-form-grid .dialog-wide-field,.competitor-observation-grid .dialog-wide-field{grid-column:1/-1}
.competitor-form-grid textarea,.competitor-observation-grid textarea{min-height:78px;resize:vertical}
.competitor-extra-fields,.competitor-history-details{border:1px solid var(--line);background:var(--surface-2)}
.competitor-extra-fields>summary,.competitor-history-details>summary{cursor:pointer;list-style:none;padding:11px 13px;color:var(--ink);font-weight:700}
.competitor-extra-fields>summary::-webkit-details-marker,.competitor-history-details>summary::-webkit-details-marker{display:none}
.competitor-extra-fields>summary::after,.competitor-history-details>summary::after{content:"+";float:right;color:var(--muted);font-size:17px;line-height:1}
.competitor-extra-fields[open]>summary::after,.competitor-history-details[open]>summary::after{content:"−"}
.competitor-extra-grid{grid-template-columns:repeat(3,minmax(0,1fr));padding:12px;border-top:1px solid var(--line)}
.competitor-history-details{margin-top:12px;background:var(--surface)}
.competitor-history-details .table-shell{border:0;border-top:1px solid var(--line)}
#competitorImportDialog form{min-width:min(560px,calc(100vw - 40px))}

@media (max-width:1100px){.competitor-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}.competitor-toolbar .search-field{grid-column:1/-1}.competitor-detail-grid{grid-template-columns:1fr}.competitor-chart-wrap{border-right:0;border-bottom:1px solid var(--line)}.competitor-facts{grid-template-columns:repeat(3,1fr);grid-template-rows:auto}.competitor-facts span{border-bottom:0;border-right:1px solid var(--line)}.competitor-facts span:last-child{border-right:0}.competitor-latest-facts{grid-template-columns:repeat(2,minmax(0,1fr))}.competitor-latest-facts>span:nth-child(3n){border-right:1px solid var(--line)}.competitor-latest-facts>span:nth-child(2n){border-right:0}.competitor-latest-facts>span:nth-last-child(-n+3){border-bottom:1px solid var(--line)}.competitor-latest-facts>span:nth-last-child(-n+2){border-bottom:0}}
@media (max-width:700px){.competitor-toolbar,.competitor-form-grid,.competitor-observation-grid,.competitor-extra-grid{grid-template-columns:1fr}.competitor-toolbar .search-field,.competitor-form-grid .dialog-wide-field,.competitor-observation-grid .dialog-wide-field,.competitor-extra-grid .dialog-wide-field{grid-column:auto}.competitor-head{align-items:flex-start}.competitor-head .unit-actions{width:100%;display:grid;grid-template-columns:repeat(3,1fr)}.competitor-head .unit-actions button{min-width:0}.competitor-facts{grid-template-columns:1fr}.competitor-facts span{border-right:0;border-bottom:1px solid var(--line)}.competitor-group-button{grid-template-columns:18px minmax(0,1fr)}.competitor-group-meta{grid-column:2;white-space:normal}.competitor-latest-facts{grid-template-columns:1fr}.competitor-latest-facts>span,.competitor-latest-facts>span:nth-child(2n),.competitor-latest-facts>span:nth-child(3n),.competitor-latest-facts>span:nth-last-child(-n+2){border-right:0;border-bottom:1px solid var(--line)}.competitor-latest-facts>span:last-child{border-bottom:0}}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 14px; letter-spacing: 0; }
.session-loading .nav, .session-loading .main, .session-error .nav, .session-error .main { visibility: hidden; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
svg { display: block; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; z-index: 20; display: flex; flex-direction: column; overflow-y: auto; background: var(--sidebar); color: #fff; padding: 22px 14px 18px; }
.sidebar-backdrop { display: none; border: 0; padding: 0; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 14px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; overflow: hidden; flex: 0 0 36px; }
.brand-mark img { display: block; width: 100%; height: 100%; }
.brand strong, .brand span, .sidebar-foot strong, .sidebar-foot span { display: block; }
.brand strong { font-size: 16px; }
.brand span, .sidebar-foot span { color: #aab5bb; font-size: 12px; margin-top: 2px; }
.sidebar-account { display: grid; gap: 10px; margin: 0 0 14px; padding: 12px 8px 14px; border-top: 1px solid #2e3a41; border-bottom: 1px solid #2e3a41; }
.sidebar-profile { display: grid; grid-template-columns: 30px minmax(0, 1fr) 26px; align-items: center; gap: 8px; }
.sidebar-profile-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #0e432f; background: #9ae2c2; font-size: 12px; font-weight: 800; }
.sidebar-profile-copy { min-width: 0; }
.sidebar-profile-copy strong, .sidebar-profile-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile-copy strong { color: #fff; font-size: 12px; }
.sidebar-profile-copy span { margin-top: 2px; color: #9ba9b0; font-size: 10px; }
.sidebar-logout { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 4px; color: #9ba9b0; background: transparent; }
.sidebar-logout[hidden] { display: none; }
.sidebar-logout:hover { color: #fff; background: #2a383f; }
.sidebar-logout svg { width: 15px; height: 15px; }
.marketplace-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 2px; border: 1px solid #34434b; border-radius: 6px; background: #111a1f; }
.marketplace-switch button { height: 28px; padding: 0 8px; border: 0; border-radius: 4px; color: #9ba9b0; background: transparent; font-size: 11px; font-weight: 700; }
.marketplace-switch button:hover { color: #fff; }
.marketplace-switch button.active { color: #fff; background: #16815c; }
.store-switch { display: grid; gap: 4px; }
.store-switch > span { color: #9ba9b0; font-size: 10px; font-weight: 600; }
.store-switch select { width: 100%; height: 32px; min-width: 0; padding: 0 28px 0 9px; border: 1px solid #34434b; border-radius: 5px; color: #eef4f1; background: #111a1f; font-size: 11px; }
.nav { display: grid; gap: 4px; }
.nav-item { width: 100%; height: 42px; border: 0; border-radius: 6px; display: flex; align-items: center; gap: 11px; color: #bfc9ce; background: transparent; padding: 0 12px; text-align: left; text-decoration: none; font: inherit; cursor: pointer; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { color: #fff; background: #202c33; }
.nav-item.active { color: #fff; background: #2a383f; box-shadow: inset 3px 0 #67d3a4; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 9px 0; border-top: 1px solid #2e3a41; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #65d09f; box-shadow: 0 0 0 4px rgba(101, 208, 159, .12); }
.sidebar-foot strong { font-size: 12px; }

.main { min-width: 0; min-height: 100vh; margin-left: 232px; }
.topbar { min-width: 0; height: 104px; display: flex; align-items: center; gap: 16px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.page-title { min-width: 0; }
.page-title h1, h2, h3, p { margin: 0; }
.page-title h1 { font-size: 23px; line-height: 1.15; }
.eyebrow { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.top-actions { flex: 0 0 auto; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.compact-export { height: 34px; padding: 0 10px; gap: 6px; font-size: 11px; }
.compact-export svg { width: 15px; height: 15px; }
#exportBtn[hidden], #managerFilterField[hidden], .unit-view-toolbar[hidden] { display: none !important; }
.global-period-wrap { min-width: 448px; margin-left: auto; display: grid; gap: 4px; justify-items: center; }
.global-period { width: 100%; }
@media (max-width: 640px) {
  #globalPeriod { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #globalPeriod button { white-space: normal; line-height: 1.15; min-height: 40px; padding: 6px 4px; }
  #globalPeriod button:nth-child(4n) { border-right: 0; }
  #globalPeriod button:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  #trendPeriod { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #trendPeriod button { white-space: normal; }
}
.global-period button { min-width: 64px; padding-inline: 8px; white-space: nowrap; }
.custom-period-form { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 5px; }
.custom-period-form label { min-width: 0; height: 28px; display: flex; align-items: center; gap: 5px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.custom-period-form label span, .custom-period-separator { color: var(--muted); font-size: 9px; font-weight: 700; white-space: nowrap; }
.custom-period-form input { min-width: 0; width: 100%; height: 24px; border: 0; padding: 0; background: transparent; color: var(--ink); font-size: 10px; color-scheme: dark; }
.custom-period-form button { height: 28px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 10px; background: var(--surface-2); color: var(--ink); font-size: 10px; font-weight: 800; white-space: nowrap; }
.custom-period-form button:hover { border-color: var(--green); color: #fff; }
.custom-period-form:has(input:focus) label { border-color: var(--line-strong); }
.global-period-wrap > span { max-width: 100%; color: var(--muted); font-size: 10px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .global-period-wrap + .top-actions { margin-left: 0; }
.icon-btn, .primary-btn, .secondary-btn, .text-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; padding: 0; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.small { width: 32px; height: 32px; }
.primary-btn, .secondary-btn { min-height: 38px; padding: 0 14px; font-weight: 700; }
.primary-btn { border-color: var(--green); color: #fff; background: var(--green); }
.secondary-btn { background: var(--surface-2); }
.mobile-menu { display: none; }
.mobile-filters { display:none; position:relative; }
.mobile-filters > span { position:absolute; right:-4px; top:-5px; display:grid; place-items:center; min-width:17px; height:17px; padding:0 4px; border:2px solid var(--surface); border-radius:999px; background:var(--green); color:#fff; font-size:9px; font-weight:800; }
.mobile-filters > span[hidden] { display:none; }

.filters { display: grid; grid-template-columns: 170px 170px minmax(190px, 240px) minmax(220px, 1fr); gap: 10px; padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.filters.team-mode-off { grid-template-columns: 170px minmax(190px, 240px) minmax(220px, 1fr); }
.filters label, dialog label { min-width: 0; display: grid; gap: 5px; }
.filters label > span, dialog label > span { font-size: 11px; color: var(--muted); font-weight: 600; }
.filters select, .search-field > div, dialog input, dialog select { width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); padding: 0 10px; color: var(--ink); }
.search-field > div { display: flex; align-items: center; gap: 8px; }
.search-field svg { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; }
.search-field input { border: 0; outline: 0; width: 100%; min-width: 0; background: transparent; }
.view { display: none; padding: 24px 28px 40px; }
.active-view { display: block; }
.view-data-loading { display:flex; align-items:center; gap:10px; margin:0 0 14px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--muted); font-size:13px; }
.view-data-loading[hidden] { display:none; }
.view-data-loading svg { width:17px; height:17px; color:var(--green); animation:data-loading-spin .9s linear infinite; }
@keyframes data-loading-spin { to { transform:rotate(360deg); } }
.source-note { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border: 1px solid #cde0ef; background: #edf6fc; border-radius: 6px; color: #31556c; margin-bottom: 16px; font-size: 12px; }
.source-note svg { width: 16px; height: 16px; flex: 0 0 auto; }
.data-readiness-panel { display:grid; grid-template-columns:38px minmax(0,1fr) auto; gap:12px; align-items:center; margin:0 0 16px; padding:14px 16px; border:1px solid var(--line); border-radius:6px; background:var(--surface); }
.data-readiness-panel[hidden] { display:none !important; }
.data-readiness-panel > i { display:grid; place-items:center; width:34px; height:34px; border-radius:6px; color:var(--accent); background:color-mix(in srgb,var(--accent) 12%,transparent); }
.data-readiness-panel > i svg { width:18px; height:18px; }
.data-readiness-panel h2 { margin:2px 0 4px; font-size:15px; }
.data-readiness-panel p { margin:0; color:var(--muted); font-size:11px; line-height:1.45; }
.data-readiness-panel .eyebrow { font-size:9px; }
.data-readiness-panel.warn { border-color:color-mix(in srgb,var(--amber) 48%,var(--line)); background:color-mix(in srgb,var(--amber) 7%,var(--surface)); }
.data-readiness-panel.warn > i { color:var(--amber); background:color-mix(in srgb,var(--amber) 14%,transparent); }
.data-readiness-panel.error { border-color:color-mix(in srgb,var(--red) 48%,var(--line)); background:color-mix(in srgb,var(--red) 7%,var(--surface)); }
.data-readiness-panel.error > i { color:var(--red); background:color-mix(in srgb,var(--red) 14%,transparent); }
.data-readiness-panel .secondary-btn { white-space:nowrap; text-decoration:none; }
.overview-source-bar { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 12px; align-items: stretch; margin-bottom: 16px; }
.overview-source-bar > * { min-width: 0; }
.overview-source-bar .source-note { margin-bottom: 0; align-items: center; }
.api-health { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.api-health-item { min-width: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; }
.api-health-item > svg { width: 17px; height: 17px; padding: 8px; box-sizing: content-box; border-radius: 6px; color: #65d09f; background: rgba(101,208,159,.12); }
.api-health-item.warn > svg { color: #f6bd60; background: rgba(246,189,96,.12); }
.api-health-item.stale > svg { color: var(--red); background: var(--red-soft); }
.api-health-item strong, .api-health-item span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-health-item strong { font-size: 12px; }
.api-health-item span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.api-health-item > b { color: #65d09f; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.api-health-item.warn > b { color: #f6bd60; }
.api-health-item.stale > b { color: var(--red); }
.data-quality { margin:0 0 16px; border:1px solid var(--line); border-radius:6px; background:var(--surface); }
.data-quality > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:42px; padding:0 12px; cursor:pointer; list-style:none; }
.data-quality > summary::-webkit-details-marker { display:none; }
.data-quality > summary > span { display:flex; align-items:center; gap:8px; }
.data-quality > summary svg { width:16px; height:16px; color:var(--green); }
.data-quality > summary b { font-size:11px; }
.data-quality > summary small { color:var(--muted); font-size:10px; }
.data-quality-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-top:1px solid var(--line); }
.data-quality-grid article { display:grid; gap:3px; min-width:0; padding:11px 12px; border-right:1px solid var(--line); }
.data-quality-grid article:last-child { border-right:0; }
.data-quality-grid span, .data-quality-grid small { color:var(--muted); font-size:9px; }
.data-quality-grid strong { font-size:13px; }
.data-quality-grid article.warn strong { color:var(--amber); }
.data-quality-grid article.ok strong { color:var(--green); }
.finance-period { min-width: 0; display: grid; gap: 5px; padding: 8px 10px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.finance-period span { color: var(--muted); font-size: 10px; font-weight: 700; }
.finance-period select { width: 100%; min-width: 0; height: 30px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); padding: 0 8px; text-overflow: ellipsis; }
.finance-period small { color: var(--muted); font-size: 9px; line-height: 1.3; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.kpi { padding: 16px; min-height: 94px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.kpi-top svg { width: 16px; height: 16px; }
.kpi strong { display: block; margin-top: 12px; font-size: 19px; line-height: 1.1; white-space: nowrap; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; margin-left: 5px; }
.delta.good { color: var(--green); }
.delta.bad { color: var(--red); }
.delta.neutral { color: var(--muted); }
.kpi small { display: block; color: var(--muted); font-size: 10px; margin-top: 7px; }
.kpi-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
#adsKpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
#unitKpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (min-width: 1401px) {
  #kpiGrid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 16px; margin-top: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 18px; }
.panel-head, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-head h2, .section-head h2, .method-intro h2, .automation-band h2 { font-size: 17px; }
.trend-tools { display: flex; align-items: center; justify-content: flex-end; gap: 16px; min-width: 0; }
.trend-period button { min-height: 30px; padding-inline: 10px; white-space: nowrap; }
.trend-metric-mode button { min-width: 38px; min-height: 30px; padding-inline: 9px; }
.trend-series { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 12px; color: var(--muted); font-size: 10px; }
.trend-series label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.trend-series label.disabled { opacity: .38; cursor: not-allowed; }
.trend-series input { margin: 0; accent-color: currentColor; }
.trend-series i { width: 16px; height: 3px; border-radius: 3px; background: currentColor; }
.trend-series-orders { color: var(--blue); }
.trend-series-buyouts { color: var(--green); }
.trend-series-profit { color: var(--purple); }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { width: 18px; height: 3px; border-radius: 3px; background: var(--blue); }
.chart-wrap { position: relative; height: 250px; margin-top: 12px; }
#trendChart { width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: #e7ecef; stroke-width: 1; }
.chart-label { fill: #7a878f; font-size: 10px; }
.chart-area { fill: rgba(47, 111, 237, .08); }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 2.5; }
.chart-point { fill: var(--surface); stroke: var(--blue); stroke-width: 2; }
.trend-chart-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trend-chart-line.trend-orders, .trend-chart-point.trend-orders { stroke: var(--blue); }
.trend-chart-line.trend-buyouts, .trend-chart-point.trend-buyouts { stroke: var(--green); }
.trend-chart-line.trend-profit, .trend-chart-point.trend-profit { stroke: var(--purple); }
.trend-chart-line.trend-profit { stroke-dasharray: 7 5; }
.trend-chart-point { fill: var(--surface); stroke-width: 2; }
.trend-chart-point.negative { fill: var(--red); stroke: var(--red); }
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-tooltip { position: absolute; z-index: 4; min-width: 178px; pointer-events: none; opacity: 0; transform: translateY(4px); padding: 10px 12px; color: #fff; background: #26343b; border-radius: 6px; box-shadow: 0 10px 28px rgba(23,32,38,.24); transition: opacity .12s ease, transform .12s ease; }
.chart-tooltip.show { opacity: 1; transform: translateY(0); }
.chart-tooltip span, .chart-tooltip strong, .chart-tooltip small { display: block; }
.chart-tooltip span { color: #bfcbd1; font-size: 10px; }
.chart-tooltip strong { margin-top: 5px; font-size: 13px; }
.chart-tooltip small { margin-top: 6px; color: #dbe3e7; font-size: 10px; line-height: 1.45; }
.chart-tooltip em { color: #aebbc2; font-style: normal; }
.chart-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.chart-foot strong { color: var(--ink); }
.heatmap-toolbar { display:grid; grid-template-columns:minmax(280px,1fr) minmax(260px,.7fr) auto; gap:14px; align-items:end; margin:16px 0 12px; }
.heatmap-toolbar .section-head { align-items:flex-start; }
.heatmap-toolbar .section-head p { margin-top:5px; color:var(--muted); font-size:11px; }
.heatmap-toolbar label { display:grid; gap:5px; }
.heatmap-toolbar label > span { color:var(--muted); font-size:10px; font-weight:700; text-transform:uppercase; }
.heatmap-toolbar select { width:100%; min-height:38px; padding:0 10px; border:1px solid var(--line-strong); border-radius:5px; color:var(--ink); background:var(--surface); }
.heatmap-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--line); background:var(--surface); }
.heatmap-kpis article { min-width:0; padding:12px 14px; border-right:1px solid var(--line); }
.heatmap-kpis article:last-child { border-right:0; }
.heatmap-kpis span,.heatmap-kpis strong,.heatmap-kpis small { display:block; }
.heatmap-kpis span { color:var(--muted); font-size:9px; text-transform:uppercase; }
.heatmap-kpis strong { margin-top:5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.heatmap-kpis small { margin-top:4px; color:var(--muted); font-size:10px; }
.order-heatmap-shell { max-width:100%; margin-top:12px; overflow:auto; border:1px solid var(--line); background:var(--surface); }
.order-heatmap-table { width:100%; min-width:1060px; border-collapse:separate; border-spacing:2px; padding:7px; table-layout:fixed; }
.order-heatmap-table th { height:28px; padding:4px 2px; color:var(--muted); background:var(--surface-2); font-size:9px; text-align:center; }
.order-heatmap-table .heatmap-weekday { position:sticky; left:0; z-index:2; width:48px; color:var(--ink); background:var(--surface); box-shadow:4px 0 7px rgba(0,0,0,.08); }
.order-heatmap-table td { height:40px; padding:2px; color:var(--ink); background:rgba(31,143,112,var(--heat)); text-align:center; font-size:9px; font-weight:700; cursor:help; }
.order-heatmap-table td span { display:block; overflow:hidden; text-overflow:ellipsis; }
.heatmap-empty { display:grid; place-items:center; min-height:250px; padding:28px; color:var(--muted); text-align:center; }
.heatmap-empty svg { width:28px; height:28px; margin-bottom:10px; color:var(--green); }
.heatmap-empty strong,.heatmap-empty span { display:block; }
.heatmap-empty span { margin-top:6px; font-size:11px; }
.heatmap-mobile-hint { display:none; margin:8px 0 0; color:var(--muted); font-size:10px; }
.ad-change-journal { margin-top:22px; }
.ad-change-journal .section-head p { margin-top:5px; color:var(--muted); font-size:11px; }
.ad-change-list { display:grid; gap:8px; margin-top:10px; }
.ad-change-card { display:grid; grid-template-columns:140px minmax(280px,.9fr) minmax(330px,1.1fr); border:1px solid var(--line); background:var(--surface); }
.ad-change-card > div { min-width:0; padding:12px 14px; border-right:1px solid var(--line); }
.ad-change-card > div:last-child { border-right:0; }
.ad-change-time strong,.ad-change-time span,.ad-change-main > span,.ad-change-main > strong,.ad-change-main > small,.ad-change-effect span,.ad-change-effect strong,.ad-change-effect small { display:block; }
.ad-change-time strong { font-size:12px; }
.ad-change-time span,.ad-change-main > span,.ad-change-main > small,.ad-change-effect span,.ad-change-effect small { margin-top:4px; color:var(--muted); font-size:9px; }
.ad-change-main > span { margin-top:0; text-transform:uppercase; }
.ad-change-main > strong { margin-top:4px; font-size:13px; }
.ad-change-values { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin-top:9px; }
.ad-change-values svg { width:14px; height:14px; color:var(--muted); }
.ad-change-values b { font-size:12px; }
.ad-change-delta { padding:3px 6px; border-radius:4px; font-size:9px; font-weight:800; }
.ad-change-delta.up { color:var(--red); background:rgba(224,85,85,.12); }
.ad-change-delta.down { color:var(--green); background:rgba(31,143,112,.12); }
.ad-change-effect strong { margin-top:5px; font-size:12px; line-height:1.45; }
.ad-change-effect.pending { display:flex; flex-direction:column; justify-content:center; }
.ad-change-empty { display:grid; place-items:center; min-height:150px; padding:24px; border:1px dashed var(--line-strong); color:var(--muted); text-align:center; }
.ad-change-empty svg { width:24px; height:24px; margin-bottom:8px; color:var(--green); }
.ad-change-empty strong,.ad-change-empty span { display:block; }
.ad-change-empty span { max-width:620px; margin-top:5px; font-size:10px; line-height:1.5; }
.plan-stack { display: grid; gap: 16px; margin: 20px 0; }
.plan-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.plan-row span { color: var(--muted); font-size: 12px; }
.plan-row strong { font-size: 18px; text-align: right; }
.plan-row.fact strong { color: var(--blue); }
.plan-row.pace strong { color: var(--green); }
.progress-track { height: 8px; background: #e8edf0; overflow: hidden; border-radius: 4px; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--green); transition: width .3s ease; }
.muted { color: var(--muted); font-size: 11px; margin-top: 11px; line-height: 1.5; }

.table-section { margin-top: 22px; }
.section-head { margin-bottom: 12px; }
.text-btn { border: 0; background: transparent; color: var(--blue); padding: 7px; font-weight: 700; }
.text-btn svg { width: 15px; height: 15px; }
.table-shell { width: 100%; overflow: auto; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.main, .view, .table-section, .table-shell { min-width:0; }
table { width: 100%; border-collapse: collapse; min-width: 920px; font-size: 12px; }
th { position: sticky; top: 0; z-index: 2; color: #65727a; background: #f3f6f7; font-size: 10px; text-align: left; text-transform: uppercase; padding: 10px 11px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--ink); }
th.sortable::after { content: "↕"; margin-left: 5px; color: #9aa5ab; font-size: 9px; }
th.sortable.sorted::after { content: attr(data-arrow); color: var(--green); }
td { padding: 10px 11px; border-bottom: 1px solid #edf0f2; vertical-align: middle; white-space: nowrap; }
tbody tr:hover > td { background: #f8fbfc; }
.model-cell { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.expand-btn { width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted); border-radius: 4px; display: grid; place-items: center; padding: 0; }
.expand-btn:hover { background: #e9eef1; color: var(--ink); }
.expand-btn svg { width: 15px; height: 15px; transition: transform .15s ease; }
.expanded .expand-btn svg { transform: rotate(90deg); }
.model-name { font-weight: 700; }
.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 240px;
  margin-top: 5px;
}
.hashtag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
}
.copyable-value { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; vertical-align: middle; }
.copyable-value > span, .copyable-value > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-value-btn { display: inline-grid; place-items: center; width: 23px; height: 23px; flex: 0 0 23px; padding: 0; border: 0; border-radius: 4px; color: var(--muted); background: transparent; opacity: .58; }
.copy-value-btn:hover, .copy-value-btn:focus-visible { color: var(--green); background: var(--green-soft); opacity: 1; outline: none; }
.copy-value-btn.copied { color: #fff; background: var(--green); opacity: 1; }
.copy-value-btn svg { width: 13px; height: 13px; }
.model-meta { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.pill { display: inline-flex; align-items: center; min-height: 23px; border-radius: 4px; padding: 3px 7px; font-size: 10px; font-weight: 700; }
.pill.active { color: #116245; background: var(--green-soft); }
.pill.sale { color: #8d5600; background: var(--amber-soft); }
.pill.season { color: #4a61a6; background: var(--blue-soft); }
.pill.exit { color: #9b3440; background: var(--red-soft); }
.pill.neutral { color: #536068; background: #edf0f2; }
.strategy-pill { border: 0; gap: 5px; white-space: nowrap; }
.strategy-pill svg { width: 11px; height: 11px; opacity: .65; }
.strategy-pill:hover { box-shadow: inset 0 0 0 1px currentColor; }
.risk { display: inline-flex; align-items: center; gap: 5px; }
.risk-dot { width: 7px; height: 7px; border-radius: 50%; }
.risk-high .risk-dot { background: var(--red); }
.risk-mid .risk-dot { background: var(--amber); }
.risk-low .risk-dot { background: var(--green); }
.risk-neutral .risk-dot { background: var(--muted); }
.size-row td { background: #fbfcfd; color: #4d5a61; }
.size-row td:first-child { padding-left: 49px; }
.size-row:hover td { background: #f2f7f8 !important; }
.bar-cell { min-width: 115px; }
.mini-bar { height: 5px; background: #e7ecef; border-radius: 3px; margin-top: 5px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.mini-bar.red span { background: var(--red); }
.segmented { display: inline-grid; grid-auto-flow: column; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; background: var(--surface); }
.segmented button { min-height: 34px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); padding: 0 12px; font-size: 11px; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { color: #fff; background: var(--green); }
.subview-tabs { display: inline-flex; gap: 2px; margin-bottom: 16px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); }
.subview-tabs button { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 13px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.subview-tabs button:hover { color: var(--ink); }
.subview-tabs button.active { color: #fff; background: var(--green); }
.subview-tabs svg { width: 15px; height: 15px; }
.master-shell { max-height: calc(100vh - 205px); }

.matrix-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 210px auto 100px; gap: 12px; align-items: end; margin-bottom: 12px; }
.conversion-toolbar { grid-template-columns: minmax(240px, 1fr) auto 220px 130px; }
.matrix-toolbar label { display: grid; gap: 5px; }
.matrix-toolbar label > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.matrix-toolbar select { width: 100%; height: 36px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); padding: 0 9px; }
.matrix-title { margin: 0; align-self: center; }
.matrix-note { min-height: 32px; display: flex; align-items: center; color: var(--muted); font-size: 11px; padding: 0 2px 10px; }
#unitNote { display: block; min-height: 0; padding: 10px 2px 12px; line-height: 1.55; overflow-wrap: anywhere; }
#unitNote b { color: var(--ink); }
.matrix-shell { max-height: 520px; }
.matrix-shell table { min-width: 1120px; table-layout: auto; }
.matrix-shell th.period-head { min-width: 104px; text-align: right; }
.matrix-shell td.period-value { text-align: right; font-variant-numeric: tabular-nums; }
.matrix-shell .model-summary td { background: #f3f7f6; font-weight: 700; border-top: 1px solid var(--line-strong); }
.matrix-shell .model-summary:hover td { background: #edf4f1; }
.matrix-shell .history-sku-row { cursor: pointer; }
.matrix-shell .history-sku-row.selected td { background: #eaf3ff; }
.matrix-shell .sticky-id { position: sticky; left: 0; z-index: 1; min-width: 230px; background: var(--surface); box-shadow: 1px 0 var(--line); }
.matrix-shell th.sticky-id { z-index: 3; background: #f3f6f7; }
.matrix-shell .model-summary .sticky-id { background: #f3f7f6; }
.heat-good { background: #e7f5ee !important; color: #116245; }
.heat-warn { background: #fff3dc !important; color: #8d5600; }
.heat-bad { background: #fdebed !important; color: #9b3440; }
.period-value strong { display: block; font-size: 11px; }
.period-value em { display: flex; justify-content: flex-end; gap: 6px; margin-top: 3px; color: currentColor; font-size: 9px; font-style: normal; font-weight: 700; opacity: .82; white-space: nowrap; }
.period-value small { display: block; margin-top: 3px; font-size: 9px; font-weight: 700; }
.period-context { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 5px; color: var(--muted); font-size: 8px; font-weight: 600; white-space: nowrap; }
.period-context b { color: currentColor; font-weight: 800; }
.context-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 4px; border: 1px solid transparent; border-radius: 3px; }
.context-chip i { padding-left: 3px; border-left: 1px solid currentColor; font-size: 7px; font-style: normal; opacity: .75; }
.context-good { color: var(--green); background: rgba(22,129,92,.1); border-color: rgba(22,129,92,.18); }
.context-warn { color: var(--amber); background: rgba(168,102,0,.1); border-color: rgba(168,102,0,.18); }
.context-bad { color: var(--red); background: rgba(196,63,76,.1); border-color: rgba(196,63,76,.18); }
.context-neutral { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.cell-note, .head-note { display: inline-flex; align-items: center; justify-content: center; gap: 3px; color: var(--amber); font-size: 9px; font-weight: 800; cursor: help; }
.cell-note { margin-top: 5px; }
.cell-note svg, .head-note svg { width: 11px; height: 11px; }
.head-note { margin-left: 6px; vertical-align: middle; }
.chart-point.has-note { fill: var(--amber); stroke: var(--surface); stroke-width: 2px; cursor: help; }
.matrix-shell td.period-value.signal-good { background: rgba(22,129,92,.16) !important; color: var(--green); box-shadow: inset 3px 0 var(--green); }
.matrix-shell td.period-value.signal-warn { background: rgba(168,102,0,.14) !important; color: var(--amber); box-shadow: inset 3px 0 var(--amber); }
.matrix-shell td.period-value.signal-bad { background: rgba(196,63,76,.16) !important; color: var(--red); box-shadow: inset 3px 0 var(--red); }
.matrix-shell td.period-value.signal-flat { background: var(--surface-2) !important; color: var(--muted); }
.matrix-shell td.period-value.signal-good strong, .matrix-shell td.period-value.signal-good small, .matrix-shell td.period-value.signal-good em { color: var(--green); }
.matrix-shell td.period-value.signal-warn strong, .matrix-shell td.period-value.signal-warn small, .matrix-shell td.period-value.signal-warn em { color: var(--amber); }
.matrix-shell td.period-value.signal-bad strong, .matrix-shell td.period-value.signal-bad small, .matrix-shell td.period-value.signal-bad em { color: var(--red); }
.signal-legend { display: inline-flex; align-items: center; gap: 5px; margin: 0 8px; }
.signal-legend i { width: 8px; height: 8px; border-radius: 2px; }
.signal-legend .good { background: var(--green); }
.signal-legend .bad { background: var(--red); margin-left: 5px; }
.detail-panel { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 0; }
.detail-panel:empty { display: none; }
.detail-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.detail-head h3 { font-size: 16px; }
.detail-head p { color: var(--muted); font-size: 11px; margin-top: 4px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .7fr); }
.history-chart-wrap { height: 230px; padding: 16px; border-right: 1px solid var(--line); }
.history-chart-wrap svg { width: 100%; height: 100%; }
.change-journal { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.history-note-form { display: grid; grid-template-columns: 150px 150px minmax(220px, 1fr) 150px minmax(300px, 1.5fr) auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.history-note-form label { min-width: 0; display: grid; gap: 5px; }
.history-note-form label > span, .plan-page-actions label > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.history-note-form input, .history-note-form select, .history-note-form textarea, .plan-page-actions input, .plan-number-input { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--surface); padding: 0 9px; }
.history-note-form input, .history-note-form select, .plan-page-actions input { height: 38px; }
.history-note-form textarea { min-height: 38px; padding-block: 8px; resize: vertical; line-height: 1.35; }
.history-note-form .is-disabled { opacity: .45; }
.note-article-combobox { position: relative; min-width: 0; }
.note-article-combobox input[type="search"] { padding-right: 30px; }
.note-article-combobox::after { content: ""; position: absolute; top: 15px; right: 12px; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.note-article-options { position: absolute; z-index: 80; top: calc(100% + 5px); left: 0; right: 0; max-height: 300px; overflow: auto; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); box-shadow: 0 14px 34px rgba(0,0,0,.24); }
.note-article-option { width: 100%; min-height: 42px; padding: 7px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.note-article-option:last-child { border-bottom: 0; }
.note-article-option:hover, .note-article-option.is-active { background: var(--surface-2); }
.note-article-option strong, .note-article-option span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-article-option span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.note-article-empty { padding: 12px; color: var(--muted); font-size: 12px; }
.history-note-actions { display: flex; gap: 6px; align-items: center; }
.history-note-actions .secondary-btn { padding-inline: 10px; }
.journal-note { margin-bottom: 10px; }
.history-notes-list { border: 1px solid var(--line); background: var(--surface); }
.price-toolbar { grid-template-columns: minmax(240px, 1fr) 210px 100px; }
.price-diary { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.price-observation-form { display: grid; grid-template-columns: 145px 145px minmax(230px, 1.15fr) 150px 150px minmax(150px, .8fr); gap: 10px; align-items: end; margin-bottom: 12px; }
.price-observation-form label { min-width: 0; display: grid; gap: 5px; }
.price-observation-form label > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.price-observation-form input, .price-observation-form select, .price-observation-form textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--surface); padding: 0 9px; }
.price-observation-form input, .price-observation-form select { height: 38px; }
.price-observation-form textarea { min-height: 38px; padding-block: 8px; resize: vertical; line-height: 1.35; }
.price-observation-form .price-action-field { grid-column: 1 / 3; }
.price-observation-form .price-comment-field { grid-column: 3 / 6; }
.price-observation-form > button { grid-column: 6; }
.price-cell { min-width: 138px; vertical-align: top; }
.price-cell strong { display: block; font-size: 12px; }
.price-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.3; }
.price-cell .price-manual { color: var(--green); font-weight: 750; }
.price-cell .price-card { color: #6aa9ff; }
.price-cell .price-action { color: #d9a84e; }
.price-cell .price-action-api { color: #6aa9ff; font-weight: 750; }
.price-cell.has-observation { background: color-mix(in srgb, var(--green) 8%, var(--surface)); box-shadow: inset 3px 0 0 var(--green); }
.price-model-row td { background: var(--surface-2); font-weight: 700; }
.price-model-row { cursor: pointer; }
.price-size-row td:first-child { padding-left: 42px; }
.price-size-row td { background: var(--surface); }
.price-change { margin-left: 5px; color: var(--muted); font-size: 9px; font-weight: 600; }
.price-change.up { color: var(--green); }
.price-change.down { color: var(--red); }
.price-observations-list { border: 1px solid var(--line); background: var(--surface); }
.price-observation-row { display: grid; grid-template-columns: 120px minmax(210px, .9fr) minmax(250px, 1.2fr) 34px; gap: 14px; align-items: center; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.price-observation-row:last-child { border-bottom: 0; }
.price-observation-row strong, .price-observation-row span { display: block; }
.price-observation-row small { color: var(--muted); font-size: 10px; }
.price-observation-values { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--ink); font-size: 11px; }
.price-observation-values b { color: var(--green); }
.price-observation-copy p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.history-note-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.history-note-row:last-child { border-bottom: 0; }
.history-note-row .note-date strong, .history-note-row .note-date span, .history-note-row p { display: block; }
.history-note-row .note-date span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.history-note-row p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.history-note-row .note-actions { display: flex; gap: 5px; }
.history-note-row .icon-btn { width: 32px; height: 32px; color: var(--muted); }
.history-note-row .icon-btn[data-delete-note] { color: var(--red); }
.compact-empty { min-height: 100px; }

.plan-page-head { align-items: flex-end; }
.plan-page-actions { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.plan-page-actions label { display: grid; gap: 5px; min-width: 165px; }
.sales-plan-shell table { min-width: 1280px; }
.sales-plan-shell td { vertical-align: middle; }
.plan-number-input { width: 92px; height: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.plan-progress { min-width: 92px; display: grid; gap: 5px; }
.plan-progress > span { display: block; height: 5px; overflow: hidden; background: var(--line); border-radius: 4px; }
.plan-progress > span i { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.plan-mode-bar { display: flex; align-items: center; gap: 3px; margin-bottom: 18px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); }
.plan-mode-bar button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.plan-mode-bar button svg { width: 15px; height: 15px; }
.plan-mode-bar button.active { color: #fff; background: var(--green); }
.plan-mode-bar > span { margin-left: 8px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.production-page-head p { max-width: 680px; margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.production-horizon { display: grid; justify-items: end; gap: 6px; }
.production-horizon > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.segmented.small button { min-height: 32px; padding-inline: 11px; }
.production-settings-card { margin: 0 0 12px; border: 1px solid var(--line); background: var(--surface); }
.production-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); }
.production-settings-grid > label { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 12px; border-right: 1px solid var(--line); }
.production-settings-grid > label:last-child { border-right: 0; }
.production-settings-grid > label:nth-child(3n) { border-right: 0; }
.production-settings-grid > label:not(:nth-last-child(-n+3)) { border-bottom: 1px solid var(--line); }
.production-settings-grid label > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.production-settings-grid label > small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.production-settings-grid select, .production-settings-grid input { width: 100%; min-width: 0; height: 36px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--bg); padding: 0 9px; }
.input-with-unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.input-with-unit input { border-radius: 6px 0 0 6px; text-align: right; }
.input-with-unit b { display: grid; place-items: center; height: 36px; min-width: 38px; padding: 0 8px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 6px 6px 0; color: var(--muted); background: var(--surface-2); font-size: 10px; }
.production-stock-options { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; padding: 10px 12px; border-top: 1px solid var(--line); }
.check-control { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: 10px; font-weight: 600; cursor: pointer; }
.check-control input { width: 16px; height: 16px; accent-color: var(--green); }
.production-formula-note { margin-bottom: 12px; }
.production-alert { margin: 0 0 12px; border: 1px solid rgba(231, 168, 59, .45); background: rgba(231, 168, 59, .08); }
.production-alert p { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; color: var(--orange); font-size: 10px; line-height: 1.45; }
.production-alert p + p { border-top: 1px solid rgba(231, 168, 59, .25); }
.production-alert svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; }
.production-plan-shell table { min-width: 2180px; }
.supply-plan-shell table { min-width: 1380px; }
.production-plan-shell td { vertical-align: middle; }
#productionPlanKpis.kpi-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.marketplace-sku-meta { display:block; }
.marketplace-sku-meta .copyable-value { display:inline-flex; vertical-align:middle; }
.marketplace-sku-meta .copy-value-btn { width:18px; height:18px; }
.production-model-row { cursor: pointer; }
.production-model-row.expanded { background: color-mix(in srgb, var(--green) 5%, transparent); }
.production-size-row { background: var(--surface-2); }
.production-size-row td:first-child { padding-left: 54px; }
.plan-number-input.inline { display: inline-block; width: 54px; height: 27px; margin: 4px 3px 0; padding-inline: 5px; }
.production-model-controls { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.65; white-space: normal; }
.production-model-controls .plan-number-input.inline { width: 48px; margin: 0 2px; }
.production-model-controls .plan-number-input.inline[data-production-field="test_batch"] { width: 64px; }
.production-reason { display: block; max-width: 320px; line-height: 1.4; }
.production-calc-details { width: 310px; margin-top: 7px; text-align: left; }
.production-calc-details summary { color: var(--green); font-size: 10px; font-weight: 700; cursor: pointer; }
.production-calc-details > div { display: grid; gap: 7px; margin-top: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.production-calc-details p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.production-calc-details b { color: var(--ink); }
.detail-metrics { display: grid; grid-template-columns: 1fr 1fr; }
.detail-metric { padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-metric:nth-child(even) { border-right: 0; }
.detail-metric span { color: var(--muted); font-size: 10px; }
.detail-metric strong { display: block; margin-top: 7px; font-size: 16px; }
.empty-state { display: grid; place-items: center; min-height: 180px; padding: 28px; color: var(--muted); text-align: center; }
.empty-state svg { width: 28px; height: 28px; margin-bottom: 9px; }

.import-guide { margin-top: 30px; border-top: 1px solid var(--line-strong); padding-top: 24px; }
.import-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: var(--surface); margin-top: 12px; }
.import-grid article { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 16px; border-right: 1px solid var(--line); }
.import-grid article:nth-child(3n) { border-right: 0; }
.import-grid article:nth-child(-n+6) { border-bottom: 1px solid var(--line); }
.import-grid svg { width: 19px; height: 19px; color: var(--green); }
.import-grid h3 { font-size: 13px; }
.import-grid code { display: block; margin-top: 7px; color: var(--blue); font-size: 10px; overflow-wrap: anywhere; }
.import-grid p { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.import-log-shell { margin-top: 12px; max-height: 300px; }
.import-log-shell table { min-width: 760px; }

.stock-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stock-chip { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); padding: 14px; }
.stock-chip i { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; }
.stock-chip svg { width: 18px; height: 18px; }
.stock-chip strong, .stock-chip span { display: block; }
.stock-chip strong { font-size: 18px; }
.stock-chip span { color: var(--muted); font-size: 11px; margin-top: 2px; }
.stock-chip.danger i { color: var(--red); background: var(--red-soft); }
.stock-chip.warn i { color: var(--amber); background: var(--amber-soft); }
.stock-chip.ok i { color: var(--green); background: var(--green-soft); }
.stock-chip.neutral i { color: var(--blue); background: var(--blue-soft); }
.stock-model-row td { background: #f8faf9; font-weight: 700; }
.stock-size-row { cursor: pointer; }
.stock-size-row td:first-child { padding-left: 34px; }
.stock-size-row .expand-btn:disabled { opacity: .25; cursor: default; }
.warehouse-row td { background: #fbfcfd; color: #5c6970; font-size: 10px; }
.warehouse-row td:first-child { padding-left: 70px; }
.warehouse-indent { display: inline-flex; align-items: center; gap: 7px; }
.warehouse-indent svg { width: 13px; height: 13px; color: var(--blue); }

.unit-head, .ai-head { align-items: flex-end; }
.unit-actions { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.unit-actions svg { width: 15px; height: 15px; }
.unit-view-toolbar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; }
.unit-view-toolbar > .unit-actions { margin-left: auto; }
.unit-view-choice { display: grid; gap: 5px; }
.unit-view-choice > span { font-size: 10px; color: var(--muted); text-transform: uppercase; font-weight: 750; }
.unit-section-mode { width: auto; min-width: 260px; }
.unit-scenario-actions { justify-content: flex-end; margin-bottom: 12px; }
.unit-defaults-panel { margin-bottom: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.unit-defaults-panel > summary { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 9px 12px; cursor: pointer; list-style: none; }
.unit-defaults-panel > summary::-webkit-details-marker { display: none; }
.unit-defaults-panel > summary > div { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 2px; }
.unit-defaults-panel > summary .eyebrow { grid-column: 1 / 3; }
.unit-defaults-panel > summary strong { font-size: 13px; }
.unit-defaults-panel > summary small { min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.unit-defaults-panel > summary > svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--muted); transition: transform .18s ease; }
.unit-defaults-panel[open] > summary > svg { transform: rotate(180deg); }
.unit-defaults-panel[open] > summary { background: var(--surface-2); }
.unit-defaults { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); background: var(--surface); border-top: 1px solid var(--line); }
.unit-defaults label { display: grid; gap: 6px; padding: 12px; border-right: 1px solid var(--line); }
.unit-defaults label:last-child { border-right: 0; }
.unit-defaults span, .learning-date span { color: var(--muted); font-size: 10px; font-weight: 700; }
.unit-defaults input, .unit-defaults select, .learning-date input { width: 100%; height: 34px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 8px; background: var(--surface); color: var(--ink); }
.unit-defaults [hidden], .unit-dialog-grid [hidden] { display: none !important; }
.unit-tax-mode { min-width: 210px; }
.unit-tax-hint { grid-column: 1 / -1; margin: 0; padding: 9px 12px; color: var(--muted); background: var(--blue-soft); border-top: 1px solid var(--line); font-size: 10px; line-height: 1.45; }
.unit-defaults-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border-top: 1px solid var(--line); }
.unit-defaults-actions p { margin: 0; }
.unit-defaults-actions > div { display: flex; gap: 8px; flex: 0 0 auto; }
.unit-shell { max-height: calc(100vh - 330px); }
.unit-shell table { min-width: 1680px; }
.unit-operations-shell { max-height: calc(100vh - 310px); margin-top: 12px; }
.unit-operations-shell table { min-width: max-content; table-layout: fixed; }
.unit-operations-shell col.ops-label-col { width: 260px; min-width: 260px; }
.unit-operations-shell col.ops-month-col { width: 154px; min-width: 154px; }
.unit-operations-shell th:first-child { position: sticky; left: 0; z-index: 3; width: 260px; min-width: 260px; max-width: 260px; background: var(--surface); text-align: left; }
.unit-operations-shell thead th:not(:first-child), .unit-operations-shell tbody td { width: 154px; min-width: 154px; max-width: 154px; }
.unit-operations-shell thead th { vertical-align: bottom; }
.unit-operations-shell thead th:first-child { z-index: 5; }
.unit-operations-shell .ops-section-row th,
.unit-operations-shell .ops-section-row td { background: color-mix(in srgb, var(--green) 13%, var(--surface)); border-top: 1px solid var(--line-strong); }
.unit-operations-shell .ops-section-row th { color: var(--ink); font-size: 12px; }
.unit-operations-shell .ops-detail-row th { padding-left: 26px; color: var(--muted); font-weight: 600; }
.ops-source { display: block; width: fit-content; margin-top: 5px; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.ops-source.closed { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.ops-source.api { color: #e3b65d; border-color: #69562d; }
.ops-coverage { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.25; white-space: normal; }
.unit-tax-confirmation { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: -4px 0 16px; padding: 14px 16px; border: 1px solid #69562d; border-radius: 8px; background: color-mix(in srgb, #e3b65d 9%, var(--surface)); }
.unit-tax-confirmation[hidden] { display: none; }
.unit-tax-confirmation > div { display: grid; gap: 4px; min-width: 0; }
.unit-tax-confirmation strong { color: #e3b65d; font-size: 14px; }
.unit-tax-confirmation p { max-width: 880px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.unit-tax-confirmation .primary-btn { flex: 0 0 auto; min-height: 40px; }
.ops-excluded { margin: 12px 0; border: 1px solid #69562d; border-radius: 8px; background: color-mix(in srgb, #e3b65d 8%, var(--surface)); }
.ops-excluded details > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; cursor: pointer; list-style: none; }
.ops-excluded details > summary::-webkit-details-marker { display: none; }
.ops-excluded details > summary span { display: grid; gap: 3px; }
.ops-excluded details > summary strong { color: #e3b65d; font-size: 13px; }
.ops-excluded details > summary small { color: var(--muted); font-size: 11px; }
.ops-excluded details > summary > svg { width: 16px; height: 16px; color: var(--muted); transition: transform .2s ease; }
.ops-excluded details[open] > summary > svg { transform: rotate(180deg); }
.ops-excluded-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 14px 14px; }
.ops-excluded-list span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 11px; }
.ops-excluded-list svg { width: 13px; height: 13px; color: #e3b65d; }
.unit-edit { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); display: grid; place-items: center; }
.unit-edit:hover { color: var(--green); border-color: var(--green); }
.unit-edit svg { width: 14px; height: 14px; }
.unit-value-good { color: var(--green); font-weight: 800; }
.unit-value-warn { color: var(--amber); font-weight: 800; }
.unit-value-bad { color: var(--red); font-weight: 800; }
.unit-reference-cell { min-width: 165px; }
.unit-reference-cell .model-meta { white-space: normal; line-height: 1.35; }
.unit-unallocated { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 16px; margin: 12px 0; border: 1px solid var(--line); background: var(--surface-2); }
.unit-unallocated p { margin: 4px 0 0; color: var(--muted); font-size: 12px; max-width: 760px; }
.unit-unallocated-values { display: flex; gap: 18px; flex-wrap: wrap; }
.unit-unallocated-values span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.unit-unallocated-values b { display: block; margin-top: 3px; color: var(--ink); font-size: 14px; }
.unit-main-row { cursor: pointer; }
.unit-main-row.expanded { background: var(--surface-2); }
.unit-main-row.expanded .expand-btn svg { transform: rotate(90deg); }
.unit-model-row { cursor: pointer; }
.unit-model-row td { background: var(--surface-2); border-top: 1px solid var(--line-strong); font-weight: 700; }
.unit-model-row:hover td { background: var(--green-soft); }
.unit-model-row.expanded .expand-btn svg { transform: rotate(90deg); }
.unit-size-row td:first-child { padding-left: 38px; }
.unit-size-row:hover td { background: var(--blue-soft); }
.unit-detail-row td { padding: 0 !important; background: var(--surface-2); }
.unit-detail-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.unit-detail-grid > section { padding: 18px; min-width: 0; }
.unit-detail-grid > section + section { border-left: 1px solid var(--line); }
.unit-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.unit-detail-head h3 { margin: 3px 0 0; font-size: 15px; }
.unit-cost-ledger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.unit-cost-ledger > div { min-height: 74px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.unit-cost-ledger > div:nth-child(3n) { border-right: 0; }
.unit-cost-ledger > div:nth-last-child(-n+3) { border-bottom: 0; }
.unit-cost-ledger span, .unit-cost-ledger small { display: block; color: var(--muted); font-size: 10px; }
.unit-cost-ledger strong { display: block; margin: 6px 0 4px; font-size: 14px; }
.unit-cost-ledger .cost-negative { color: var(--red); }
.unit-simple-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--surface-1); }
.unit-simple-kpis > div { min-height: 86px; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.unit-simple-kpis > div:nth-child(even) { border-right: 0; }
.unit-simple-kpis > div:nth-last-child(-n+2) { border-bottom: 0; }
.unit-simple-kpis span, .unit-simple-kpis strong { display: block; }
.unit-simple-kpis span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.unit-simple-kpis strong { margin-top: 8px; font-size: 19px; }
.unit-simple-kpis .unit-simple-result { background: var(--green-soft); }
.unit-period-result { display: grid; grid-template-columns: minmax(66px, auto) minmax(82px, auto); align-items: baseline; gap: 4px 9px; min-width: 168px; text-align: left; }
.unit-period-result span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.unit-period-result strong { text-align: right; white-space: nowrap; }
.unit-period-result small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; line-height: 1.35; }
.unit-period-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; border: 1px solid var(--line); background: var(--surface-1); }
.unit-period-compare > div { min-width: 0; padding: 13px; border-right: 1px solid var(--line); }
.unit-period-compare > div:nth-child(2) { border-right: 0; }
.unit-period-compare span, .unit-period-compare strong, .unit-period-compare small { display: block; }
.unit-period-compare span { color: var(--muted); font-size: 11px; font-weight: 700; }
.unit-period-compare strong { margin-top: 7px; font-size: 20px; }
.unit-period-compare small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.unit-period-compare p { grid-column: 1 / -1; margin: 0; padding: 10px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.45; }
.unit-simple-breakdown { margin-top: 12px; border: 1px solid var(--line); }
.unit-simple-breakdown-head { grid-column: 1 / -1; padding: 10px 12px; background: var(--surface-1); }
.unit-simple-breakdown-head strong, .unit-simple-breakdown-head span { display: block; }
.unit-simple-breakdown-head strong { font-size: 12px; }
.unit-simple-breakdown-head span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.unit-simple-breakdown > div:not(.unit-simple-breakdown-head) { display: grid; grid-template-columns: minmax(120px, .8fr) auto minmax(180px, 1.4fr); align-items: center; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--line); }
.unit-simple-breakdown > div > span { color: var(--muted); font-size: 10px; }
.unit-simple-breakdown > div > strong { color: var(--red); font-size: 12px; text-align: right; white-space: nowrap; }
.unit-simple-breakdown > div > small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.unit-average-details { margin-top: 12px; border: 1px solid var(--line); background: var(--surface-1); }
.unit-average-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; cursor: pointer; list-style: none; }
.unit-average-details > summary::-webkit-details-marker { display: none; }
.unit-average-details > summary span, .unit-average-details > summary strong, .unit-average-details > summary small { display: block; }
.unit-average-details > summary strong { font-size: 12px; }
.unit-average-details > summary small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.unit-average-details > summary svg { width: 16px; transition: transform .16s ease; }
.unit-average-details[open] > summary svg { transform: rotate(180deg); }
.unit-average-content { padding: 0 12px 12px; }
.unit-average-intro { display: grid; gap: 4px; margin-bottom: 10px; padding: 10px 12px; color: var(--muted); background: var(--blue-soft); border-left: 3px solid var(--blue); font-size: 10px; line-height: 1.45; }
.unit-average-intro strong { color: var(--ink); font-size: 11px; }
.unit-order-story { margin-top: 12px; padding: 14px; border: 1px solid var(--line); background: var(--surface-1); }
.unit-order-story-copy { display: grid; gap: 4px; }
.unit-order-story-copy strong { font-size: 13px; }
.unit-order-story-copy span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.unit-order-flow { display: grid; grid-template-columns: minmax(110px, 1fr) auto minmax(110px, 1fr) minmax(110px, 1fr); align-items: stretch; gap: 8px; margin-top: 12px; }
.unit-order-flow > div { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface-2); }
.unit-order-flow > i { align-self: center; color: var(--muted); font-style: normal; }
.unit-order-flow small, .unit-order-flow em { color: var(--muted); font-size: 9px; font-style: normal; }
.unit-order-flow b { font-size: 14px; }
.unit-order-flow .success { border-color: rgba(30,180,130,.32); background: var(--green-soft); }
.unit-order-flow .failed { border-color: rgba(235,91,91,.28); background: rgba(235,91,91,.06); }
.unit-logistics-proof { display: grid; grid-template-columns: minmax(150px, .7fr) auto minmax(210px, 1.3fr); align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--blue); background: var(--blue-soft); }
.unit-logistics-proof span { color: var(--muted); font-size: 10px; }
.unit-logistics-proof strong { font-size: 14px; white-space: nowrap; }
.unit-logistics-proof small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.unit-sale-ledger { margin-top: 12px; border: 1px solid var(--line); }
.unit-sale-ledger-head { padding: 11px 12px; background: var(--surface-1); }
.unit-sale-ledger-head strong, .unit-sale-ledger-head span { display: block; }
.unit-sale-ledger-head strong { font-size: 12px; }
.unit-sale-ledger-head span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.unit-sale-ledger-row { display: grid; grid-template-columns: 86px minmax(150px, .8fr) minmax(210px, 1.2fr) auto; align-items: center; gap: 10px; min-height: 44px; padding: 7px 12px; border-top: 1px solid var(--line); }
.unit-ledger-group { width: fit-content; padding: 3px 6px; color: var(--muted); background: var(--surface-1); border-radius: 3px; font-size: 9px; }
.unit-ledger-name { color: var(--ink); font-size: 10px; }
.unit-sale-ledger-row small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.unit-sale-ledger-row > strong, .unit-sale-ledger-total strong { color: var(--red); font-size: 12px; text-align: right; white-space: nowrap; }
.unit-sale-ledger-total, .unit-sale-ledger-profit { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border-top: 1px solid var(--line-strong); background: var(--surface-1); font-size: 11px; font-weight: 700; }
.unit-sale-ledger-profit { background: var(--green-soft); }
.unit-sale-ledger-profit strong { font-size: 15px; }
.help-tip { position: relative; display: inline-flex !important; align-items: center; vertical-align: middle; margin-left: 3px; color: var(--muted); cursor: help; outline: none; }
.help-tip > svg { width: 13px; height: 13px; }
.help-tip-popover { position: absolute; z-index: 20; left: 50%; bottom: calc(100% + 8px); width: min(260px, 70vw); padding: 9px 10px; color: #fff !important; background: #26343b; border-radius: 5px; box-shadow: 0 8px 24px rgba(0,0,0,.22); font-size: 10px !important; font-weight: 400; line-height: 1.45 !important; opacity: 0; pointer-events: none; transform: translate(-50%, 4px); transition: opacity .12s ease, transform .12s ease; }
.help-tip:hover .help-tip-popover, .help-tip:focus .help-tip-popover { opacity: 1; transform: translate(-50%, 0); }
.unit-detail-footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 12px; color: var(--muted); font-size: 11px; }
.unit-detail-footer b { color: var(--ink); }
.unit-detail-footer span { display: grid; gap: 3px; }
.unit-detail-footer small { max-width: 380px; color: var(--muted); line-height: 1.35; }
.unit-fact-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.unit-dialog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.unit-dialog-result { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 16px; border: 1px solid var(--line); background: var(--surface-2); }
.unit-dialog-result div { padding: 12px; border-right: 1px solid var(--line); }
.unit-dialog-result div:last-child { border-right: 0; }
.unit-dialog-result span, .unit-dialog-result strong { display: block; }
.unit-dialog-result span { color: var(--muted); font-size: 10px; }
.unit-dialog-result strong { margin-top: 6px; font-size: 16px; }

.learning-date { display: grid; gap: 5px; min-width: 180px; }
[data-owner-only][hidden] { display: none !important; }
[data-platform-admin-only][hidden], [data-team-management][hidden], .nav-item[hidden], .view[hidden] { display: none !important; }
.sidebar-profile { cursor: pointer; }
.sidebar-profile:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.ai-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: 16px; }
.ai-brief { padding: 0; }
.ai-brief-head { padding: 18px; border-bottom: 1px solid var(--line); }
.ai-brief-head h2 { font-size: 17px; }
.ai-brief-head p { color: var(--muted); font-size: 12px; line-height: 1.55; margin-top: 8px; }
.ai-diagnosis { display: grid; grid-template-columns: repeat(2, 1fr); }
.ai-diagnosis article { padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ai-diagnosis article:nth-child(even) { border-right: 0; }
.ai-diagnosis article:nth-last-child(-n+2) { border-bottom: 0; }
.ai-diagnosis h3 { font-size: 13px; }
.ai-diagnosis p { color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 7px; white-space: normal; }
.ai-priorities { padding: 0; }
.ai-priorities .panel-head { padding: 18px; border-bottom: 1px solid var(--line); }
.ai-action { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ai-action:last-child { border-bottom: 0; }
.ai-action > span { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 5px; font-size: 11px; font-weight: 800; }
.ai-action.high > span { background: var(--red); }
.ai-action.mid > span { background: var(--amber); }
.ai-action strong { display: block; font-size: 12px; }
.ai-action p { color: var(--muted); font-size: 10px; line-height: 1.45; margin-top: 4px; }
.ai-confidence { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; margin-top: 10px; }
.ai-confidence i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.ai-context-panel { margin-top: 16px; padding: 0; }
.ai-context-panel .panel-head { padding: 18px; border-bottom: 1px solid var(--line); }
.ai-context-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ai-context-card { min-width: 0; padding: 16px 18px; border-right: 1px solid var(--line); }
.ai-context-card:last-child { border-right: 0; }
.ai-context-card > header { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.ai-context-card > header svg { width: 16px; height: 16px; color: var(--green); }
.ai-context-card h3 { font-size: 13px; }
.ai-source-list, .ai-change-list { display: grid; gap: 8px; }
.ai-source-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 11px; }
.ai-source-row span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-source-row b { font-size: 10px; }
.ai-source-row.ok b { color: var(--green); }
.ai-source-row.warn b { color: var(--amber); }
.ai-source-row.stale b { color: var(--red); }
.ai-change-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; font-size: 10px; line-height: 1.4; }
.ai-change-row time { color: var(--muted); }
.ai-change-row p { min-width: 0; white-space: normal; }
.ai-change-row strong { color: var(--ink); }
.ai-context-empty, .ai-context-copy { color: var(--muted); font-size: 11px; line-height: 1.55; white-space: normal; }
.ai-change-flag { display: block; margin-top: 6px; color: var(--blue); font-size: 9px; line-height: 1.4; }
.decision-center { margin: 16px 0; padding: 0; overflow: hidden; }
.decision-center-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 18px; border-bottom: 1px solid var(--line); }
.decision-center-head h2 { font-size: 17px; }
.decision-center-head p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.decision-filters { flex: 0 0 auto; width: auto; }
.decision-filters button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; min-width: 92px; }
.decision-filters button span { min-width: 18px; padding: 2px 5px; border-radius: 8px; color: var(--muted); background: var(--surface-2); font-size: 9px; line-height: 1; }
.decision-filters button.active span { color: var(--green); background: var(--surface); }
.decision-summary { display: flex; align-items: center; gap: 16px; min-height: 42px; padding: 9px 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.decision-summary span { white-space: nowrap; }
.decision-summary b { color: var(--ink); font-size: 12px; }
.decision-summary small { margin-left: auto; max-width: 640px; line-height: 1.4; text-align: right; }
.decision-queue { display: grid; }
.decision-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; padding: 16px 18px 16px 21px; border-bottom: 1px solid var(--line); background: var(--surface); }
.decision-card:last-child { border-bottom: 0; }
.decision-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--green); }
.decision-card.severity-high::before { background: var(--red); }
.decision-card.severity-mid::before { background: var(--amber); }
.decision-card.status-done { opacity: .72; }
.decision-card.status-done h3 { text-decoration: line-through; text-decoration-color: var(--muted); }
.decision-card-main { min-width: 0; }
.decision-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.decision-zone { color: var(--muted); font-size: 10px; font-weight: 700; }
.decision-status { margin-left: auto; padding: 4px 7px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 9px; font-weight: 800; }
.decision-status.working { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); }
.decision-status.snoozed { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }
.decision-status.done { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.decision-card h3 { margin-top: 9px; font-size: 14px; }
.decision-object { margin-top: 3px; color: var(--ink); font-size: 11px; font-weight: 700; }
.decision-evidence, .decision-action { max-width: 1020px; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.decision-action b { color: var(--ink); }
.decision-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 9px; padding: 8px 10px; border-left: 2px solid var(--blue); color: var(--muted); background: var(--blue-soft); font-size: 10px; line-height: 1.4; }
.decision-note svg { flex: 0 0 14px; width: 14px; height: 14px; }
.decision-card aside { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 8px; }
.decision-card aside > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.decision-card aside > span svg { width: 14px; height: 14px; }
.decision-card aside > span.overdue { color: var(--red); font-weight: 800; }
.decision-card aside > span.today { color: var(--amber); font-weight: 800; }
.decision-card-buttons { display: flex; gap: 7px; margin-top: 3px; }
.decision-card-buttons button { min-height: 34px; padding-inline: 10px; font-size: 10px; }
.decision-card-buttons svg { width: 14px; height: 14px; }
.decision-empty { padding: 24px; }
.decision-table-actions { display: flex; align-items: center; gap: 5px; }
.decision-dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.decision-dialog-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.decision-dialog-grid label:first-child { grid-column: 1 / 2; }
.decision-dialog-note { grid-column: 1 / 3; }
.decision-dialog-grid select, .decision-dialog-grid input, .decision-dialog-grid textarea { width: 100%; min-height: 38px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 10px; color: var(--ink); background: var(--surface); font: inherit; }
.decision-dialog-grid textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
#decisionEvidence { margin-top: 14px; }
.sku360-dialog { width: min(1120px, calc(100vw - 32px)); }
.sku360-dialog form { max-height: calc(100vh - 40px); overflow: auto; }
.sku360-dialog .dialog-head { position: sticky; top: -20px; z-index: 4; margin: -20px -20px 16px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sku360-dialog .dialog-head p { margin-top: 4px; }
.sku360-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 2px 0 14px; }
.sku360-hero h3 { margin-top: 3px; font-size: 19px; }
.sku360-hero p { margin-top: 4px; }
.sku360-badges { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.sku360-badges span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface-2); font-size: 9px; }
.sku360-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); }
.sku360-metric { min-width: 0; padding: 11px 12px; border-right: 1px solid var(--line); }
.sku360-metric:last-child { border-right: 0; }
.sku360-metric > span, .sku360-metric > strong, .sku360-metric > small { display: block; }
.sku360-metric > span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.sku360-metric > strong { margin-top: 6px; overflow: hidden; color: var(--ink); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.sku360-metric > small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.sku360-metric.bad > strong { color: var(--red); }
.sku360-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.sku360-sections > section { min-width: 0; border: 1px solid var(--line); background: var(--surface); }
.sku360-sections > section > header { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.sku360-sections > section > header svg { width: 15px; height: 15px; color: var(--green); }
.sku360-sections h4 { font-size: 12px; }
.sku360-ledger { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sku360-ledger .sku360-metric { min-height: 72px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sku360-ledger .sku360-metric:nth-child(even) { border-right: 0; }
.sku360-ledger .sku360-metric:nth-last-child(-n+2) { border-bottom: 0; }
.sku360-ledger .sku360-metric:last-child:nth-child(odd) { grid-column: 1 / 3; border-right: 0; }
.sku360-notes { display: grid; }
.sku360-notes article { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sku360-notes article:last-child { border-bottom: 0; }
.sku360-notes time { color: var(--muted); font-size: 9px; }
.sku360-notes strong { font-size: 10px; }
.sku360-notes p { margin-top: 3px; font-size: 10px; }
.sku360-empty { padding: 14px 12px; }
.sku360-actions { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.sku360-actions button { min-height: 36px; }
.sku360-loading { position: static; min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); background: var(--surface-2); }
.sku360-loading svg { width: 18px; height: 18px; animation: spin .8s linear infinite; }
.conversion-audit { margin-top: 28px; }
.conversion-audit .ai-brief { margin-bottom: 16px; }
.conversion-shell { max-height: 540px; }
.conversion-shell table { min-width: 1480px; }
.conversion-shell th { min-width: 104px; text-align: right; white-space: normal; line-height: 1.25; }
.conversion-shell th.sticky-id { min-width: 238px; text-align: left; }
.conversion-shell .sticky-id { position: sticky; left: 0; z-index: 2; min-width: 238px; box-shadow: 1px 0 var(--line); }
.conversion-shell thead .sticky-id { z-index: 4; background: #f3f6f7; }
.conversion-model-row { cursor: pointer; }
.conversion-model-row td { background: #f3f7f6; border-top: 1px solid var(--line-strong); }
.conversion-model-row:hover td { background: #edf4f1; }
.conversion-model-row .sticky-id { background: #f3f7f6; }
.conversion-model-row.expanded .expand-btn svg { transform: rotate(90deg); }
.conversion-sku-row { cursor: pointer; }
.conversion-sku-row .sticky-id { padding-left: 38px; background: var(--surface); }
.conversion-sku-row.selected td { background: var(--blue-soft); }
.conversion-sku-row.selected .sticky-id { background: var(--blue-soft); }
.funnel-value { text-align: right; font-variant-numeric: tabular-nums; }
.funnel-value strong { display: block; font-size: 11px; }
.funnel-value small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 600; }
.funnel-value.heat-good { color: var(--green); background: rgba(22,129,92,.09); }
.funnel-value.heat-warn { color: var(--amber); background: rgba(196,125,0,.10); }
.funnel-value.heat-bad { color: var(--red); background: rgba(196,63,76,.10); }
.conversion-detail-head { border-bottom: 1px solid var(--line); }
.conversion-funnel-strip { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); overflow: auto; border-bottom: 1px solid var(--line); }
.conversion-funnel-strip article { position: relative; min-height: 88px; padding: 14px 26px 12px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.conversion-funnel-strip article:nth-child(5n) { border-right: 0; }
.conversion-funnel-strip article:nth-child(n+6) { border-top: 1px solid var(--line); }
.conversion-funnel-strip article > span, .conversion-funnel-strip article > small { display: block; color: var(--muted); }
.conversion-funnel-strip article > span { font-size: 9px; font-weight: 800; text-transform: uppercase; }
.conversion-funnel-strip article > strong { display: block; margin: 7px 0 4px; font-size: 16px; font-variant-numeric: tabular-nums; }
.conversion-funnel-strip article > small { font-size: 9px; line-height: 1.3; }
.conversion-funnel-strip article > svg { position: absolute; top: 34px; right: 7px; width: 13px; height: 13px; color: var(--muted); }
.conversion-funnel-strip article.heat-good { background: rgba(22,129,92,.08); }
.conversion-funnel-strip article.heat-good strong { color: var(--green); }
.conversion-funnel-strip article.heat-warn { background: rgba(196,125,0,.09); }
.conversion-funnel-strip article.heat-warn strong { color: var(--amber); }
.conversion-funnel-strip article.heat-bad { background: rgba(196,63,76,.09); }
.conversion-funnel-strip article.heat-bad strong { color: var(--red); }
.conversion-chart-panel { display: grid; grid-template-columns: 175px minmax(0, 1fr); min-height: 220px; }
.conversion-chart-title { padding: 18px; border-right: 1px solid var(--line); }
.conversion-chart-title span, .conversion-chart-title small { display: block; color: var(--muted); font-size: 10px; }
.conversion-chart-title strong { display: block; margin: 7px 0 12px; font-size: 14px; }
.conversion-chart-panel .history-chart-wrap { border-right: 0; }
.ads-shell { max-height: 560px; }
.ads-shell table { min-width: 1320px; }
.ads-shell th:first-child, .ads-shell td:first-child { position: sticky; left: 0; z-index: 2; min-width: 245px; box-shadow: 1px 0 var(--line); }
.ads-shell thead th:first-child { z-index: 4; background: #f3f6f7; }
.ads-model-row { cursor: pointer; }
.ads-model-row td { background: #f3f7f6; border-top: 1px solid var(--line-strong); font-weight: 700; }
.ads-model-row td:first-child { background: #f3f7f6; }
.ads-model-row:hover td { background: #edf4f1; }
.ads-model-row.expanded .expand-btn svg { transform: rotate(90deg); }
.ads-size-row td:first-child { padding-left: 38px; background: var(--surface); }
.ads-size-row:hover td { background: var(--blue-soft); }
.ad-table-value { font-variant-numeric: tabular-nums; }
.ad-table-value strong { display: block; }
.ad-table-value .model-meta { max-width: 190px; margin-left: auto; white-space: normal; line-height: 1.3; }

.queries-head { align-items: flex-start; flex-direction: column; }
.report-import-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.report-import-actions .secondary-btn:disabled { cursor: not-allowed; opacity: .48; }
.report-import-status { min-height: 16px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.report-import-status[data-status="queued"], .report-import-status[data-status="running"] { color: #d7ae54; }
.report-import-status[data-status="success"] { color: var(--green); }
.report-import-status[data-status="error"] { color: var(--red); }
.report-file-field input[type="file"] { height: auto; min-height: 42px; padding: 8px 10px; }
.button-spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: button-spin .75s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.query-controls { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 10px; width: 100%; }
.query-controls label, .seo-text-grid label { min-width: 0; display: grid; gap: 5px; }
.query-controls label > span, .seo-text-grid label > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.query-controls select, .query-controls input { width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--surface); padding: 0 10px; }
.query-brief { margin-bottom: 20px; }
.query-row { cursor: pointer; }
.query-row.selected > td { background: var(--blue-soft); }
.query-compare-section { margin-top: 24px; }
.seo-check-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.secondary-btn svg { width: 16px; height: 16px; }
.seo-text-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seo-text-grid textarea { min-height: 132px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--surface); padding: 11px; font: inherit; line-height: 1.5; }
.seo-result { margin-top: 12px; border: 1px solid var(--line); background: var(--surface); }
.seo-score { display: grid; grid-template-columns: repeat(3, 1fr); }
.seo-score article { padding: 14px 16px; border-right: 1px solid var(--line); }
.seo-score article:last-child { border-right: 0; }
.seo-score span, .seo-score strong, .seo-score small { display: block; }
.seo-score span { color: var(--muted); font-size: 10px; }
.seo-score strong { margin-top: 7px; font-size: 18px; }
.seo-score small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.seo-keywords { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line); }
.keyword { padding: 5px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.keyword.competitor { color: #9b3440; background: var(--red-soft); }
.keyword.missing { color: #8d5600; background: var(--amber-soft); }

.method-layout { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 28px; align-items: start; }
.method-intro p { color: var(--muted); line-height: 1.6; max-width: 580px; margin-top: 10px; }
.method-steps { border-top: 1px solid var(--line-strong); }
.method-steps article { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.method-steps article > span { color: var(--green); font-weight: 800; font-size: 18px; }
.method-steps h3 { font-size: 14px; margin-bottom: 5px; }
.method-steps p { color: var(--muted); line-height: 1.5; font-size: 12px; }
.automation-band { margin-top: 28px; padding: 22px 0; border-top: 1px solid var(--line-strong); display: grid; grid-template-columns: .8fr 1fr 1fr; gap: 30px; }
.automation-band ul { margin: 0; padding-left: 18px; line-height: 1.8; }
.automation-band p { color: var(--muted); line-height: 1.6; }

dialog { border: 1px solid var(--line); border-radius: 6px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 22px 70px rgba(23,32,38,.22); }
.wide-dialog { width: min(780px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(16, 25, 30, .42); }
dialog form { padding: 20px; }
.danger-text { color: var(--red); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
dialog input { margin-top: 3px; }
dialog p { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 12px; }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 20px 0 0; }
.confirm-dialog { width: min(500px, calc(100vw - 32px)); }
.confirm-dialog p { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.55; }
.confirm-dialog .danger-btn { border-color: var(--red); color: #fff; background: var(--red); }
.confirm-dialog .danger-btn:hover { filter: brightness(.94); }
.assignment-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.assignment-toolbar .search-field > div { height: 38px; }
.assignment-list { max-height: min(58vh, 560px); overflow: auto; margin-top: 12px; border: 1px solid var(--line); }
.assignment-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 14px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.assignment-row:last-child { border-bottom: 0; }
.assignment-row:hover { background: #f8fbfc; }
.assignment-row.unassigned { background: var(--amber-soft); }
.assignment-row strong, .assignment-row span { display: block; }
.assignment-row span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.assignment-row select { width: 100%; height: 34px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); padding: 0 8px; }
.moysklad-warehouse-list { display: grid; gap: 8px; max-height: min(52vh, 480px); margin: 14px 0; overflow: auto; }
.moysklad-warehouse-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 240px); gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.moysklad-warehouse-row strong, .moysklad-warehouse-row small { display: block; }
.moysklad-warehouse-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.moysklad-warehouse-row select { width: 100%; min-height: 36px; margin: 0; }
.bulk-toolbar { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(220px, 1.3fr); gap: 14px; align-items: end; margin-bottom: 14px; }
.bulk-toolbar select { width: 100%; }
.bulk-scope-summary { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); background: var(--surface-2); }
.bulk-scope-summary strong { font-size: 15px; }
.bulk-scope-summary span { color: var(--muted); font-size: 11px; }
.bulk-field > span { display: flex; align-items: center; gap: 7px; }
.bulk-field > span input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.bulk-field > input:disabled { opacity: .55; background: var(--surface-2); }
.bulk-warning { padding: 10px 12px; border-left: 3px solid var(--amber); background: var(--amber-soft); color: var(--ink); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 360px; color: #fff; background: #26343b; border-radius: 6px; padding: 12px 14px; box-shadow: 0 12px 32px rgba(0,0,0,.2); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.empty { padding: 36px !important; color: var(--muted); text-align: center !important; }
.marketplace-feature-hidden { display: none !important; }
.marketplace-feature-state {
  display: grid;
  grid-template-columns: 46px minmax(0, 720px);
  gap: 16px;
  align-items: start;
  margin: 26px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}
.marketplace-feature-state[hidden] { display: none !important; }
.marketplace-feature-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 6px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.marketplace-feature-icon svg { width: 20px; height: 20px; }
.marketplace-feature-state h2 { margin: 4px 0 8px; font-size: 19px; }
.marketplace-feature-state p { margin: 0; color: var(--muted); line-height: 1.55; }
.marketplace-feature-state ul { margin: 14px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.65; }
.marketplace-placeholder { min-height: calc(100vh - 76px); padding: 72px 28px; place-items: center; align-content: center; text-align: center; }
.marketplace-placeholder:not([hidden]) { display: grid; }
.marketplace-placeholder-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 15px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--green); background: var(--surface); }
.marketplace-placeholder-icon svg { width: 24px; height: 24px; }
.marketplace-placeholder h2 { font-size: 22px; }
.marketplace-placeholder p { max-width: 580px; margin: 10px 0 22px; color: var(--muted); line-height: 1.55; }
.marketplace-placeholder .secondary-btn svg { width: 16px; height: 16px; }

@media (max-width: 1400px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  #unitKpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-right: 0; }
  .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(220px, 1.5fr); }
  .unit-defaults { grid-template-columns: repeat(3, 1fr); }
  .unit-defaults label { border-bottom: 1px solid var(--line); }
  .unit-defaults label:nth-child(3n) { border-right: 0; }
  .unit-defaults label:nth-last-child(-n+3) { border-bottom: 0; }
  .history-note-form { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
  .history-note-form .note-text-field { grid-column: 1 / 4; }
}

@media (max-width: 1180px) {
  #adsKpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); }
  .matrix-toolbar { grid-template-columns: 1fr 1fr; }
  .price-observation-form { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .price-observation-form .price-action-field, .price-observation-form .price-comment-field, .price-observation-form > button { grid-column: auto; }
  .conversion-toolbar { grid-template-columns: 1fr 1fr; }
  .import-grid { grid-template-columns: 1fr 1fr; }
  .import-grid article:nth-child(3n) { border-right: 1px solid var(--line); }
  .import-grid article:nth-child(even) { border-right: 0; }
  .import-grid article:nth-child(-n+6) { border-bottom: 1px solid var(--line); }
  .ai-layout { grid-template-columns: 1fr; }
  .ai-context-grid { grid-template-columns: 1fr; }
  .ai-context-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .ai-context-card:last-child { border-bottom: 0; }
  .queries-head { align-items: flex-start; }
  .report-import-actions { width: 100%; }
  .query-controls { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .unit-detail-grid { grid-template-columns: 1fr; }
  .unit-detail-grid > section + section { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 18px 0 40px rgba(0,0,0,.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(8, 18, 24, .52); }
  body.menu-open { overflow: hidden; }
  .main { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .topbar { height: auto; min-height: 76px; padding: 8px 16px; flex-wrap: wrap; }
  .page-title { flex: 1 1 180px; }
  .top-actions { margin-left: auto; }
  .global-period-wrap { order: 3; width: 100%; min-width: 0; }
  .global-period-wrap > span { text-align: center; }
  .custom-period-form { max-width: 520px; }
  .filters { padding: 12px 16px; grid-template-columns: 1fr 1fr; }
  .filters label:nth-child(3) { grid-column: 1 / 3; }
  .search-field { grid-column: 1 / 3; grid-row: auto; }
  .view { padding: 18px 16px 30px; }
  #unitKpis { grid-template-columns: 1fr 1fr; }
  .overview-grid, .method-layout, .overview-source-bar, .api-health { grid-template-columns: 1fr; }
  .data-quality-grid { grid-template-columns:1fr 1fr; }
  .data-quality-grid article:nth-child(even) { border-right:0; }
  .data-quality-grid article:nth-child(n+3) { border-top:1px solid var(--line); }
  .automation-band { grid-template-columns: 1fr; gap: 14px; }
  .stock-summary { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .history-chart-wrap { border-right: 0; border-bottom: 1px solid var(--line); }
  .section-head { align-items: flex-start; flex-direction: column; }
  .conversion-funnel-strip { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .conversion-funnel-strip article:nth-child(5n) { border-right: 1px solid var(--line); }
  .conversion-funnel-strip article:nth-child(even) { border-right: 0; }
  .conversion-funnel-strip article:nth-child(n+3) { border-top: 1px solid var(--line); }
  .conversion-chart-panel { grid-template-columns: 1fr; }
  .conversion-chart-title { border-right: 0; border-bottom: 1px solid var(--line); }
  .unit-head, .ai-head { align-items: flex-start; }
  .unit-actions { width: 100%; }
  .unit-actions .primary-btn, .unit-actions .secondary-btn { flex: 1 1 auto; }
  .unit-defaults-panel > summary > div { grid-template-columns: 1fr; }
  .unit-defaults-panel > summary .eyebrow { grid-column: 1; }
  .unit-defaults-panel > summary small { white-space: normal; }
  .learning-date { flex: 1 1 180px; }
  .unit-defaults { grid-template-columns: repeat(2, 1fr); }
  .unit-defaults label:nth-child(3n) { border-right: 1px solid var(--line); }
  .unit-defaults label:nth-child(even) { border-right: 0; }
  .unit-defaults label:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .unit-defaults label:last-child { border-bottom: 0; }
  .unit-dialog-grid { grid-template-columns: repeat(2, 1fr); }
  .unit-dialog-result { grid-template-columns: repeat(2, 1fr); }
  .unit-dialog-result div:nth-child(2) { border-right: 0; }
  .unit-dialog-result div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .segmented { width: 100%; }
  .segmented button { width: 100%; }
  .query-controls { grid-template-columns: 1fr 1fr; }
  .seo-text-grid { grid-template-columns: 1fr; }
  .unit-unallocated { align-items: flex-start; flex-direction: column; }
  .history-note-form { grid-template-columns: 1fr 1fr; }
  .history-note-form .note-text-field { grid-column: 1 / 3; }
  .history-note-actions { width: 100%; }
  .history-note-actions button { flex: 1 1 auto; }
  .price-observation-form { grid-template-columns: 1fr 1fr; }
  .price-observation-form .price-target-field, .price-observation-form .price-action-field, .price-observation-form .price-comment-field { grid-column: 1 / 3; }
  .price-observation-form > button { grid-column: 1 / 3; width: 100%; }
  .price-observation-row { grid-template-columns: 1fr 34px; }
  .price-observation-row > :nth-child(3) { grid-column: 1; }
  .plan-page-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .plan-page-actions label { grid-column: 1 / 3; }
  .heatmap-toolbar { grid-template-columns:1fr 1fr; }
  .heatmap-toolbar .section-head { grid-column:1 / 3; }
  .heatmap-kpis { grid-template-columns:1fr 1fr; }
  .heatmap-kpis article:nth-child(2) { border-right:0; }
  .heatmap-kpis article:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .ad-change-card { grid-template-columns:120px minmax(240px,1fr); }
  .ad-change-effect { grid-column:1 / 3; border-top:1px solid var(--line); }
}

@media (max-width: 560px) {
  #unitKpis { grid-template-columns: 1fr; }
  #unitKpis .kpi { border-right: 0 !important; }
  .topbar { height: auto; min-height: 66px; }
  .page-title h1 { font-size: 19px; }
  .top-actions .primary-btn span { display: none; }
  .top-actions .primary-btn { width: 38px; padding: 0; }
  .mobile-filters { display:inline-flex; }
  .compact-export span { display:none; }
  .compact-export { width:38px; padding:0; }
  .filters.mobile-collapsed { display:none; }
  .data-readiness-panel { grid-template-columns:34px minmax(0,1fr); padding:12px; }
  .data-readiness-panel .secondary-btn { grid-column:1 / -1; width:100%; }
  .filters:not(.mobile-collapsed) { border-top:1px solid var(--line); }
  .filters select, .filters input, .custom-period-form input { min-height:40px; }
  .segmented button, .subview-tabs button { min-height:40px; }
  .text-btn, .primary-btn, .secondary-btn { min-height:40px; }
  .global-period button { min-width: 0; padding-inline: 5px; font-size: 10px; }
  .custom-period-form { grid-template-columns: 1fr auto 1fr; }
  .custom-period-form button { grid-column: 1 / 4; width: 100%; }
  .filters { grid-template-columns: 1fr; }
  .filters label { grid-column: 1 !important; }
  .search-field { grid-column: 1 !important; grid-row: auto !important; }
  .kpi-grid, .kpi-grid.compact { grid-template-columns: 1fr 1fr; }
  .data-quality > summary { align-items:flex-start; flex-direction:column; justify-content:center; padding-block:8px; }
  .data-quality-grid { grid-template-columns:1fr; }
  .data-quality-grid article, .data-quality-grid article:nth-child(even) { border-right:0; border-top:1px solid var(--line); }
  .data-quality-grid article:first-child { border-top:0; }
  #adsKpis { grid-template-columns: 1fr 1fr; }
  .kpi { min-height: 86px; border-bottom: 1px solid var(--line); }
  .kpi:nth-child(odd) { border-right: 1px solid var(--line) !important; }
  .kpi:nth-child(even) { border-right: 0 !important; }
  .kpi strong { font-size: 17px; }
  .panel { padding: 14px; }
  .panel-head { align-items: flex-start; }
  .trend-tools { align-items: flex-end; flex-direction: column; gap: 8px; }
  .legend { display: none; }
  .trend-tools, .trend-period, .trend-series { width: 100%; }
  .trend-series { justify-content: flex-start; }
  .chart-wrap { height: 210px; }
  .chart-foot { flex-direction: column; }
  .assignment-toolbar, .assignment-row { grid-template-columns: 1fr; }
  .moysklad-warehouse-row { grid-template-columns: 1fr; }
  .bulk-toolbar { grid-template-columns: 1fr; }
  .matrix-toolbar { grid-template-columns: 1fr; }
  .matrix-shell .sticky-id { min-width:170px; max-width:170px; }
  .matrix-shell th.period-head { min-width:92px; }
  .import-grid { grid-template-columns: 1fr; }
  .import-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .import-grid article:last-child { border-bottom: 0; }
  .plan-row strong { font-size: 17px; }
  .unit-defaults { grid-template-columns: 1fr; }
  .unit-defaults label, .unit-defaults label:nth-child(4n), .unit-defaults label:nth-child(even), .unit-defaults label:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .unit-defaults label:last-child { border-bottom: 0; }
  .unit-dialog-grid, .ai-diagnosis { grid-template-columns: 1fr; }
  .unit-actions { display: grid; grid-template-columns: 1fr; }
  .unit-actions .primary-btn, .unit-actions .secondary-btn, .unit-actions .learning-date { width: 100%; min-width: 0; }
  .unit-actions .primary-btn, .unit-actions .secondary-btn { white-space: normal; line-height: 1.25; padding-block: 9px; }
  .unit-defaults-actions { align-items: stretch; flex-direction: column; }
  .unit-defaults-actions > div { display: grid; grid-template-columns: 1fr; }
  .ai-diagnosis article, .ai-diagnosis article:nth-child(even), .ai-diagnosis article:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .ai-diagnosis article:last-child { border-bottom: 0; }
  .query-controls, .seo-score { grid-template-columns: 1fr; }
  .report-import-actions { align-items: stretch; flex-direction: column; }
  .report-import-actions .secondary-btn { width: 100%; }
  .unit-cost-ledger { grid-template-columns: 1fr 1fr; }
  .unit-cost-ledger > div, .unit-cost-ledger > div:nth-child(3n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .unit-cost-ledger > div:nth-child(even) { border-right: 0; }
  .unit-cost-ledger > div:nth-last-child(-n+2) { border-bottom: 0; }
  .unit-detail-footer { flex-direction: column; }
  .unit-simple-kpis { grid-template-columns: 1fr; }
  .unit-period-compare { grid-template-columns: 1fr; }
  .unit-period-compare > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .unit-period-compare > div:nth-child(2) { border-bottom: 0; }
  .unit-simple-kpis > div, .unit-simple-kpis > div:nth-child(even) { border-right: 0; border-bottom: 1px solid var(--line); }
  .unit-simple-kpis > div:last-child { border-bottom: 0; }
  .unit-simple-breakdown > div:not(.unit-simple-breakdown-head) { grid-template-columns: 1fr auto; }
  .unit-simple-breakdown > div > small { grid-column: 1 / -1; }
  .unit-order-flow { grid-template-columns: 1fr; }
  .unit-order-flow > i { justify-self: center; transform: rotate(90deg); }
  .unit-logistics-proof { grid-template-columns: 1fr; }
  .unit-sale-ledger-row { grid-template-columns: 1fr auto; }
  .unit-ledger-group { grid-column: 1; }
  .unit-ledger-name { grid-column: 1; }
  .unit-sale-ledger-row small { grid-column: 1 / -1; grid-row: 3; }
  .unit-sale-ledger-row > strong { grid-column: 2; grid-row: 1 / 3; }
  .seo-score article { border-right: 0; border-bottom: 1px solid var(--line); }
  .seo-score article:last-child { border-bottom: 0; }
  .view { padding-inline: 10px; }
  .topbar { padding-inline: 10px; }
  .filters { padding-inline: 10px; }
  .history-note-form, .plan-page-actions { grid-template-columns: 1fr; }
  .history-note-form .note-text-field, .plan-page-actions label { grid-column: 1; }
  .history-note-actions { flex-direction: column; }
  .history-note-actions button { width: 100%; }
  .history-note-row { grid-template-columns: 1fr auto; }
  .history-note-row .note-date { grid-column: 1 / 3; }
  .subview-tabs { display: grid; grid-template-columns: 1fr; width: 100%; }
  .subview-tabs button { justify-content: center; }
  .price-observation-form { grid-template-columns: 1fr; }
  .price-observation-form .price-target-field, .price-observation-form .price-action-field, .price-observation-form .price-comment-field, .price-observation-form > button { grid-column: 1; }
  .stock-section-head, .stock-tools { width:100%; }
  .stock-tools { justify-content:flex-start; }
  .stock-calculation-control { width:100%; overflow-x:auto; justify-content:flex-start; }
  #stocksView .table-shell, #unitView .table-shell, #assortmentView .table-shell { max-width:calc(100vw - 20px); }
  .mobile-card-table { min-width:0 !important; width:100%; }
  .mobile-card-table thead { display:none; }
  .mobile-card-table tbody { display:grid; gap:10px; padding:10px; }
  .mobile-card-table tbody tr { display:grid; grid-template-columns:1fr 1fr; gap:0; border:1px solid var(--line); border-radius:8px; overflow:hidden; background:var(--surface); }
  .mobile-card-table tbody td { display:flex; min-width:0; min-height:48px; padding:9px 10px; align-items:flex-end; justify-content:space-between; gap:8px; border:0; border-bottom:1px solid var(--line); color:var(--ink); white-space:normal; }
  .mobile-card-table tbody td:nth-child(even) { border-right:1px solid var(--line); }
  .mobile-card-table tbody td::before { content:attr(data-label); color:var(--muted); font-size:9px; line-height:1.25; text-transform:uppercase; }
  .mobile-card-table tbody td:first-child, .mobile-card-table tbody td:last-child, .mobile-card-table tbody td[colspan] { grid-column:1 / -1; }
  .mobile-card-table tbody td:first-child { align-items:center; min-height:58px; }
  .mobile-card-table tbody td:first-child::before, .mobile-card-table tbody td[colspan]::before { display:none; }
  .mobile-card-table tbody td:last-child { border-bottom:0; }
  .mobile-card-table .model-cell { width:100%; }
  .heatmap-toolbar { grid-template-columns:1fr; }
  .heatmap-toolbar .section-head { grid-column:1; }
  .heatmap-kpis { grid-template-columns:1fr 1fr; }
  .order-heatmap-shell { max-width:calc(100vw - 20px); }
  .heatmap-mobile-hint { display:block; }
  .ad-change-card { grid-template-columns:1fr; }
  .ad-change-card > div { border-right:0; border-bottom:1px solid var(--line); }
  .ad-change-card > div:last-child { border-bottom:0; }
  .ad-change-effect { grid-column:1; }
}
.team-user{display:flex;align-items:center;gap:8px;min-width:0;padding-right:4px;border-right:1px solid var(--line)}
.team-user[hidden]{display:none}
.team-user-avatar{display:grid;place-items:center;width:32px;height:32px;flex:0 0 32px;border-radius:50%;background:#1f8f70;color:#fff;font-size:13px;font-weight:800}
.team-user-copy{display:flex;flex-direction:column;min-width:0;max-width:130px}
.team-user-copy strong,.team-user-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.team-user-copy strong{font-size:12px}.team-user-copy small{color:var(--muted);font-size:10px;text-transform:uppercase}

/* Pulsento workspace shell */
.brand-mark svg{width:20px;height:20px;stroke-width:2.4}
.brand strong{letter-spacing:0;font-size:17px}
.brand span{font-size:10px;text-transform:uppercase;letter-spacing:.04em}
.store-switch-row{display:grid;grid-template-columns:minmax(0,1fr) 32px;align-items:end;gap:6px}
.store-add-btn{display:grid;place-items:center;width:32px;height:32px;border:1px solid #34434b;border-radius:5px;color:#c9d6d2;background:#111a1f;cursor:pointer}
.store-add-btn:hover{border-color:#2a9d78;color:#8fe0c2}
.store-add-btn svg{width:15px;height:15px}
.marketplace-wb .filters{display:grid !important}.marketplace-wb .global-period-wrap{display:flex !important}.marketplace-wb #managerSettingsBtn,.marketplace-wb #refreshBtn,.marketplace-wb #exportBtn{display:inline-flex !important}
.marketplace-wb .view{display:none !important}.marketplace-wb .view.active-view{display:block !important}
.marketplace-wb .nav{pointer-events:auto;opacity:1}
.marketplace-wb #stocksView .stock-tools{display:none!important}
.marketplace-wb #stocksTable{min-width:1320px}
.marketplace-wb #modelTable{min-width:1120px}
.marketplace-wb .marketplace-feature-state{min-height:260px}
.marketplace-wb #unitView .unit-shell{margin-top:12px}
.marketplace-notice{display:flex;align-items:center;gap:10px;margin:14px 24px 0;padding:10px 12px;border:1px solid #563f7c;border-radius:6px;color:#d8c9f3;background:#1c1724;font-size:12px;line-height:1.4}
.marketplace-notice[hidden]{display:none}
.marketplace-notice svg{width:17px;height:17px;flex:0 0 17px;color:#a98bdf}
.campaign-mode-btn{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:5px 8px;border:1px solid var(--line-strong);border-radius:5px;color:var(--muted);background:var(--surface);font-size:10px;white-space:nowrap;cursor:pointer}
.campaign-mode-btn:hover{color:var(--ink);border-color:var(--green)}
.campaign-mode-btn.learning{color:#f2c879;border-color:#7d622d;background:#2a2317}
.campaign-mode-btn svg{width:13px;height:13px}
.store-marketplaces{display:flex;gap:16px;margin:14px 0 0;padding:12px;border:1px solid var(--line);border-radius:6px}
.store-marketplaces legend{padding:0 5px;color:var(--muted);font-size:11px}
.store-marketplaces label{display:flex;align-items:center;grid-template-columns:auto 1fr;gap:7px;color:var(--ink);font-size:12px}
.store-marketplaces input{width:16px;height:16px;margin:0}
#aiView .kpi-grid.compact{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:760px){.marketplace-notice{margin-inline:10px}#aiView .kpi-grid.compact{grid-template-columns:1fr}.store-switch-row{grid-template-columns:minmax(0,1fr) 32px}}
@media(max-width:900px){
  .production-page-head{align-items:flex-start;flex-direction:column}
  .production-horizon{width:100%;justify-items:start}
  .production-settings-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .production-settings-grid>label,.production-settings-grid>label:nth-child(3n){border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
  .production-settings-grid>label:nth-child(2n){border-right:0}
  .production-settings-grid>label:last-child{border-right:0;border-bottom:0}
  #productionPlanKpis.kpi-grid.compact{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:560px){
  .plan-mode-bar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
  .plan-mode-bar>span{grid-column:1/-1;margin:4px 6px 2px}
  .production-horizon .segmented{grid-template-columns:repeat(4,1fr);grid-auto-flow:row}
  .production-settings-grid{grid-template-columns:1fr}
  .production-settings-grid>label,.production-settings-grid>label:nth-child(2n),.production-settings-grid>label:nth-child(3n),.production-settings-grid>label:nth-last-child(-n+2){border-right:0;border-bottom:1px solid var(--line)}
  .production-settings-grid>label:last-child{border-bottom:0}
  .production-stock-options{align-items:flex-start;flex-direction:column;gap:10px}
  #productionPlanKpis.kpi-grid.compact{grid-template-columns:1fr}
}
.stock-section-head{align-items:flex-end}
.marketplace-ozon #stocksTable{min-width:1600px}
.stock-tools{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.stock-calculation-control{display:flex;align-items:center;gap:6px;min-height:34px;padding:3px;border:1px solid var(--line);border-radius:6px;background:var(--surface)}
.stock-calculation-base{display:grid;gap:1px;padding:0 8px 0 6px;border-right:1px solid var(--line)}
.stock-calculation-base small{color:var(--muted);font-size:8px;line-height:1;text-transform:uppercase}
.stock-calculation-base strong{font-size:10px;line-height:1.2;white-space:nowrap}
.stock-calculation-toggle{position:relative;display:flex!important;grid-template-columns:none!important;align-items:center;gap:6px!important;min-height:26px;padding:0 8px;border:1px solid transparent;border-radius:4px;color:var(--muted);font-size:10px;font-weight:700;cursor:pointer;white-space:nowrap}
.stock-calculation-toggle:hover{border-color:var(--line-strong);color:var(--ink)}
.stock-calculation-toggle:has(input:checked){border-color:var(--green);color:#fff;background:var(--green)}
.stock-calculation-toggle:has(input:disabled){opacity:.42;cursor:not-allowed}
.stock-calculation-toggle input{position:absolute;inline-size:1px;block-size:1px;opacity:0;pointer-events:none}
.stock-tools .secondary-btn{min-height:34px;padding:0 11px;font-size:11px}
.stock-tools .secondary-btn svg{width:15px;height:15px}
.fbs-stock-editor{display:grid;gap:7px;margin-top:14px;color:var(--muted);font-size:11px;font-weight:700}
.fbs-stock-editor textarea{width:100%;min-height:260px;padding:12px;border:1px solid var(--line-strong);border-radius:7px;background:var(--surface);color:var(--ink);font:12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace;resize:vertical}
.fbs-stock-editor textarea:focus{outline:2px solid color-mix(in srgb,var(--green) 28%,transparent);border-color:var(--green)}
#fbsStockDialog .source-note{margin-top:12px}
#fbsStockDialog menu{flex-wrap:wrap}
.stock-recommendations{margin:0 0 14px}
.stock-advice-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:2px 0 9px}
.stock-advice-head h3{font-size:15px;margin-top:2px}
.stock-advice-head>span,.stock-advice-note{color:var(--muted);font-size:10px}
.stock-advice-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:1px solid var(--line);background:var(--surface)}
.stock-advice-item{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;min-width:0;padding:11px 12px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.stock-advice-item:nth-child(3n){border-right:0}
.stock-advice-item div{min-width:0}
.stock-advice-item strong,.stock-advice-item span{display:block}
.stock-advice-item strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stock-advice-item span{margin-top:3px;color:var(--muted);font-size:10px}
.stock-advice-item b{flex:0 0 auto;max-width:46%;font-size:10px;line-height:1.35;text-align:right;color:var(--orange)}
.stock-advice-item.priority-4 b{color:var(--red)}
.stock-advice-note{margin:7px 0 0}
@media(max-width:1100px){.stock-advice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.stock-advice-item:nth-child(3n){border-right:1px solid var(--line)}.stock-advice-item:nth-child(2n){border-right:0}}
@media(max-width:760px){.stock-tools,.stock-calculation-control{width:100%}.stock-calculation-control{flex-wrap:wrap}.stock-calculation-base{flex:1 1 100%;padding:4px 7px;border-right:0;border-bottom:1px solid var(--line)}.stock-calculation-toggle{flex:1;justify-content:center}.stock-tools .secondary-btn{flex:1}.stock-advice-grid{grid-template-columns:1fr}.stock-advice-item{border-right:0!important}}
@media(max-width:760px){.unit-tax-confirmation{align-items:stretch;flex-direction:column;padding:13px}.unit-tax-confirmation .primary-btn{width:100%;justify-content:center}}

@media(max-width:1024px){
  .decision-center-head{align-items:flex-start;flex-direction:column}
  .decision-filters{width:100%;overflow-x:auto}
  .decision-filters button{min-width:106px}
  .decision-summary{align-items:flex-start;flex-wrap:wrap}
  .decision-summary small{flex:1 1 100%;margin-left:0;text-align:left}
  .decision-card{grid-template-columns:minmax(0,1fr) 210px}
  .sku360-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
  .sku360-kpis .sku360-metric{border-bottom:1px solid var(--line)}
  .sku360-kpis .sku360-metric:nth-child(3n){border-right:0}
  .sku360-kpis .sku360-metric:nth-last-child(-n+3){border-bottom:0}
}
@media(max-width:700px){
  .decision-center-head{padding:14px}
  .decision-summary{gap:9px;padding-inline:14px}
  .decision-card{grid-template-columns:1fr;gap:12px;padding:14px 14px 14px 17px}
  .decision-status{margin-left:0}
  .decision-card aside{align-items:flex-start;padding-top:10px;border-top:1px solid var(--line)}
  .decision-card-buttons{width:100%}
  .decision-card-buttons button{flex:1;min-height:42px;justify-content:center}
  .decision-dialog-grid{grid-template-columns:1fr}
  .decision-dialog-grid label:first-child,.decision-dialog-note{grid-column:1}
  .sku360-dialog{width:calc(100vw - 16px)}
  .sku360-dialog form{padding:14px;max-height:calc(100vh - 16px)}
  .sku360-dialog .dialog-head{top:-14px;margin:-14px -14px 12px;padding:14px}
  .sku360-hero{align-items:flex-start;flex-direction:column}
  .sku360-badges{justify-content:flex-start}
  .sku360-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .sku360-kpis .sku360-metric,.sku360-kpis .sku360-metric:nth-child(3n){border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
  .sku360-kpis .sku360-metric:nth-child(even){border-right:0}
  .sku360-kpis .sku360-metric:nth-last-child(-n+2){border-bottom:0}
  .sku360-sections{grid-template-columns:1fr}
  .sku360-actions{display:grid;grid-template-columns:1fr 1fr}
  .sku360-actions button{justify-content:center;min-height:42px}
  #sku360Dialog menu{position:sticky;bottom:-14px;margin:14px -14px -14px;padding:10px 14px;background:var(--surface);border-top:1px solid var(--line)}
}

.product-structure-head{align-items:flex-end;margin-top:14px}
.product-structure-head p{max-width:760px;margin-top:4px;color:var(--muted);font-size:11px}
.product-structure-toolbar{display:grid;grid-template-columns:minmax(210px,1.2fr) 180px minmax(260px,1.4fr) auto auto;gap:8px;align-items:end;margin:12px 0}
.product-structure-toolbar label{display:grid;gap:5px;min-width:0;color:var(--muted);font-size:9px;font-weight:800;text-transform:uppercase}
.product-structure-toolbar input,.product-structure-toolbar select,.structure-cell-input{min-width:0;height:36px;padding:0 10px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);font:inherit}
.product-structure-toolbar input:focus,.product-structure-toolbar select:focus,.structure-cell-input:focus{outline:2px solid color-mix(in srgb,var(--green) 24%,transparent);border-color:var(--green)}
.product-structure-shell{max-width:calc(100vw - var(--sidebar) - 64px)}
#productStructureTable{min-width:1220px}
#productStructureTable th:first-child,#productStructureTable td:first-child{width:42px;min-width:42px;text-align:center}
#productStructureTable th:nth-child(2),#productStructureTable td:nth-child(2){min-width:230px}
#productStructureTable th:nth-child(3),#productStructureTable td:nth-child(3){min-width:120px}
#productStructureTable th:nth-child(4),#productStructureTable td:nth-child(4){min-width:210px}
#productStructureTable th:nth-child(5),#productStructureTable td:nth-child(5){min-width:250px}
#productStructureTable th:nth-child(6),#productStructureTable td:nth-child(6){min-width:150px}
#productStructureTable .structure-cell-input{width:100%}
#productStructureTable input[type="checkbox"]{width:16px;height:16px;accent-color:var(--green)}
#productStructureTable tr:has([data-structure-select]:checked){background:color-mix(in srgb,var(--green) 7%,var(--surface))}
@media(max-width:1180px){.product-structure-toolbar{grid-template-columns:1fr 180px 1fr}.product-structure-toolbar .secondary-btn{width:100%}.product-structure-shell{max-width:calc(100vw - var(--sidebar) - 36px)}}
@media(max-width:760px){.product-structure-head{align-items:stretch;flex-direction:column}.product-structure-head .primary-btn{width:100%;justify-content:center}.product-structure-toolbar{grid-template-columns:1fr}.product-structure-shell{max-width:calc(100vw - 20px)}#productStructureTable.mobile-card-table{min-width:0}.product-structure-shell .mobile-card-table tbody tr{grid-template-columns:44px 1fr}.product-structure-shell .mobile-card-table tbody td:first-child{grid-column:1;min-height:48px;justify-content:center}.product-structure-shell .mobile-card-table tbody td:not(:first-child){grid-column:2}.product-structure-shell .mobile-card-table tbody td:nth-child(even){border-right:0}.product-structure-shell .mobile-card-table tbody td:last-child{grid-column:1 / -1}}
:where(table th:not(:last-child), table td:not(:last-child)) {
  border-right: 1px solid rgba(116, 131, 145, .24);
}

/* P1.41: fixed, user-controlled widths; business tables may still scroll when needed. */
table.pulsento-resizable { table-layout: fixed; min-width: 0 !important; max-width: none; }
.pulsento-resizable > thead > tr > th {
  padding: 10px 14px 10px 9px; white-space: normal; overflow-wrap: anywhere;
}
.pulsento-resizable > tbody > tr > td:not([colspan]) {
  padding: 10px 9px; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.pulsento-resizable .model-cell { min-width: 0; gap: 7px; }
.pulsento-resizable .model-cell > div { min-width: 0; }
.pulsento-resizable .model-cell .expand-btn { flex-shrink: 0; }
.pulsento-resizable .copyable-value { max-width: 100%; }
.pulsento-resizable .model-meta { white-space: normal; overflow-wrap: anywhere; }
.pulsento-resizable .risk, .pulsento-resizable .pill { max-width: 100%; white-space: normal; }
.pulsento-resizable .unit-size-row > td:first-child { padding-left: 26px; }
.column-resize-handle {
  position: absolute; top: 0; right: 0; bottom: 0; width: 8px; z-index: 3;
  cursor: col-resize; touch-action: none; user-select: none;
}
.column-resize-handle:hover, .column-resize-handle:focus-visible {
  background: rgba(47, 111, 237, .2); outline: none; border-right: 2px solid var(--blue, #2f6fed);
}
.table-column-dragging, .table-column-dragging * { cursor: col-resize !important; user-select: none !important; }
.table-width-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; color: var(--muted); font-size: 11px; }
.table-width-toolbar[hidden] { display: none; }
.table-width-toolbar .secondary-btn { min-height: 32px; padding: 6px 10px; font-size: 11px; flex-shrink: 0; }
#stockSourceNote { display: block; overflow-wrap: anywhere; }
@media (max-width: 760px) { .table-width-toolbar { flex-wrap: wrap; } }
