/* Shared visual language and platform navigation. */
:root{--surface-soft:#f7f9fc;--surface-hover:#edf2ff;--shadow:0 14px 44px #20396016;color-scheme:light}
:root[data-theme=dark]{--bg:#111721;--surface:#192230;--surface-soft:#202b3a;--surface-hover:#26364e;--ink:#e8edf5;--muted:#a3b1c3;--line:#324055;--blue:#91adff;--blue-soft:#23365a;--green:#75d9b2;--green-soft:#193b33;--amber:#f0be75;--amber-soft:#3c3020;--red:#ff98a5;--red-soft:#402733;--shadow:0 14px 44px #0005;color-scheme:dark}
.theme-toggle,.ozon-module .theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:34px;border:1px solid var(--line);border-radius:7px;padding:6px 10px;background:var(--surface);color:var(--muted);white-space:nowrap;font-size:12px}
.theme-toggle:hover{background:var(--surface-hover);color:var(--ink)}
.auth-theme{position:absolute;top:22px;right:24px;z-index:2}
.brand>div>strong{line-height:1.2}.brand:not(.auth-brand){min-height:54px}.auth-brand{align-items:center}
.market-switch{display:inline-flex;align-items:center;padding:3px;border:1px solid var(--line);border-radius:8px;background:var(--surface-soft);gap:2px;white-space:nowrap}
.market-switch button{border:0;border-radius:5px;padding:6px 9px;font-size:12px;font-weight:550;color:var(--muted);background:transparent;line-height:20px}
.market-switch button.active{background:var(--surface);color:var(--ink);box-shadow:0 1px 4px #192e4915}
.market-switch button[data-marketplace=wb].active{color:var(--blue)}
.market-switch button[data-marketplace=ozon].active{color:var(--blue)}
.market-loading{min-height:100vh;background:var(--bg)}.market-loading>header{display:flex;justify-content:flex-end;gap:12px;padding:18px 25px;border-bottom:1px solid var(--line)}.market-loading>div{display:flex;align-items:center;flex-direction:column;gap:18px;padding:20vh 25px;text-align:center}.market-loading p{color:var(--muted)}
.loading-ring{display:inline-block;width:24px;height:24px;border:2px solid var(--line);border-top-color:var(--blue);border-radius:50%;animation:marzh-spin .8s linear infinite;flex:none}@keyframes marzh-spin{to{transform:rotate(360deg)}}
.product-thumb{display:inline-flex;position:relative;width:38px;height:50px;min-width:38px;border:1px solid var(--line);border-radius:5px;background:var(--surface-soft);overflow:hidden;align-items:center;justify-content:center;flex:none;color:var(--muted);font-size:9px;text-align:center;line-height:1.2}
.product-thumb img{display:block;width:100%;height:100%;object-fit:contain;background:#fff}.product-thumb .photo-fallback{display:none}.product-thumb.is-broken img{display:none}.product-thumb.is-broken .photo-fallback{display:block}.drawer-product .product-thumb{width:66px;height:88px}.compact .product-thumb{height:35px;width:27px;min-width:27px}.data-table td .product-cell{min-height:51px}.compact .data-table td .product-cell{min-height:35px}
.sim-search{margin-bottom:18px}.sim-search>label{display:block;font-size:12px;font-weight:550;margin-bottom:8px}.sim-search .search-field{width:100%;max-width:none}.sim-search input{width:100%}.sim-search-list{border:1px solid var(--line);border-radius:8px;background:var(--surface);max-height:315px;overflow:auto;margin-top:8px}.sim-search-list>button{display:flex;align-items:center;gap:12px;padding:10px 12px;width:100%;text-align:left;border-bottom:1px solid var(--line)}.sim-search-list>button:last-child{border:0}.sim-search-list>button:hover{background:var(--surface-hover)}.sim-search-list>button>span:not(.product-thumb){display:flex;flex:1;flex-direction:column;gap:4px}.sim-search-list small,.sim-search>div>small{color:var(--muted);font-size:11px}.sim-search-list strong{font-weight:550;font-size:12px}
.cost-summary{display:flex;gap:28px;flex-wrap:wrap;margin:4px 0 18px;color:var(--muted);font-size:13px}.cost-summary strong{color:var(--ink);margin-right:5px;font-size:20px;font-weight:600;font-variant-numeric:tabular-nums}.cost-explanation{margin-bottom:18px;font-size:12px;line-height:1.7}.costs-panel{border:1px solid var(--line);border-radius:10px;background:var(--surface);overflow:hidden}.costs-table{border-collapse:separate;border-spacing:0;width:100%;font-size:12px}.costs-table th{text-align:left;white-space:nowrap;font-size:11px;color:var(--muted);font-weight:500;background:var(--surface-soft);padding:13px 12px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.costs-table td{padding:13px 12px;border-bottom:1px solid var(--line);background:var(--surface);vertical-align:top}.costs-table tr:last-child td{border-bottom:0}.costs-table th:first-child,.costs-table td:first-child{position:sticky;left:0;z-index:1;min-width:225px;max-width:280px;border-right:1px solid var(--line)}.costs-table th:first-child{z-index:2}.costs-table input,.costs-table select{border:1px solid var(--line);background:var(--surface);color:var(--ink);height:34px;border-radius:5px;padding:6px 8px;font-size:12px;width:100%;min-width:75px}.costs-table input[inputmode=decimal]{width:124px}.costs-table td:nth-child(6),.costs-table td:nth-child(7){min-width:142px;white-space:nowrap}.costs-table input[type=date]{width:141px}.costs-table td>small,.costs-table .cost-rate small{display:block;font-size:10px;color:var(--muted);margin-top:5px;white-space:normal;max-width:150px}.costs-table .product-info{display:flex;flex-direction:column;min-width:0}.costs-table .product-info strong{white-space:normal}.costs-table .product-info span{white-space:normal;font-size:10px}.costs-table .cost-row-edited td{background:var(--blue-soft)}.cost-rate{display:block;margin-top:7px}.cost-rate-preview,.cost-revert{display:block;text-align:left;font-size:10px;color:var(--blue);padding:6px 0;max-width:150px}.cost-identity{display:inline-block;color:var(--muted);padding:8px 0;white-space:nowrap}.cost-revert{margin-top:5px}.costs-table .btn{white-space:nowrap}.costs-panel .table-tools{flex-wrap:wrap}.costs-panel .search-field{min-width:230px}
.price-publish{border-top:1px solid var(--line);margin-top:20px;padding-top:20px}.price-publish>select{width:100%;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);padding:10px;margin:6px 0 14px}.price-publish .cost-note{margin:12px 0}.price-publish .field{margin-bottom:16px}.inline-link{color:var(--blue);padding:0;text-decoration:underline}.price-token-panel .field{margin:20px 0}.price-token-panel>.btn{margin-top:12px}.price-confirm-modal{width:640px;max-width:calc(100vw - 24px)}.price-confirm-product{border:1px solid var(--line);border-radius:8px;background:var(--surface-soft);padding:14px;margin:18px 0;display:flex;flex-direction:column;gap:5px}.price-confirm-product>span{font-size:12px;color:var(--muted)}.price-confirm-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:20px}.price-confirm-column{padding:16px;border:1px solid var(--line);border-radius:8px}.price-confirm-column>span{display:block;color:var(--muted);font-size:12px;margin-bottom:7px}.price-confirm-column>strong{font-size:25px;font-weight:600;font-variant-numeric:tabular-nums}.price-confirm-column dl{font-size:11px;display:grid;gap:9px;margin-bottom:0;color:var(--muted)}.price-confirm-column dl>div{display:flex;gap:12px;justify-content:space-between}.price-confirm-column dd{margin:0;color:var(--ink);white-space:nowrap}.price-status{display:flex;align-items:center;gap:15px;line-height:1.6}.price-confirm-grid .price-confirm-column:last-child{border-color:var(--blue);background:var(--blue-soft)}
/* Explicit dark surfaces keep tables, menus and dialogs consistent. */
[data-theme=dark] .sidebar{background:#151e2b}
[data-theme=dark] :is(.workspace,.btn,.stats-strip,.table-card,.table-tools,.panel,.drawer,.drawer-top,.drawer-bottom,.modal,.overview-hero,.recommendation,.auth-card,.welcome-notice,.reconciliation-panel,.noscript,.table-footer,.skip-link){background:var(--surface);color:var(--ink);border-color:var(--line)}
[data-theme=dark] :is(input,select,textarea,.field input,.field select,.field-row input[type=number],.field-row select,.product-picker,.settings-layout .field-row select,.action-status-select,.search-field input,.filter-select){background:var(--surface);color:var(--ink);border-color:var(--line)}
[data-theme=dark] :is(.data-table td,.marketing-table td:first-child){background:var(--surface);border-color:var(--line)}
[data-theme=dark] :is(.data-table th,.marketing-table th,.marketing-table th:first-child){background:var(--surface-soft);color:var(--muted);border-color:var(--line)}
[data-theme=dark] :is(.data-table tbody tr:hover td,.marketing-table tr:hover td){background:var(--surface-soft)}
[data-theme=dark] :is(.data-table tbody tr.selected td,.edit-cell.changed,.scenario-table tr.active,.active-filter,.nav-item.active,.view-tab.active small,.page-num,.bulk-bar){background:var(--blue-soft);border-color:var(--line);color:var(--blue)}
[data-theme=dark] :is(.nav-item:hover,.icon-btn:hover,.btn:hover,.edit-cell:hover,.command-result:hover,.command-result:focus-visible,.job-history:hover,.topbar-user:hover){background:var(--surface-hover);border-color:var(--line)}
[data-theme=dark] :is(.prototype-note,.state-note,.sim-hero,.scenario-chips button,.comparison-strip,.rec-skus button,.masked-preview,.demo-prompt,.modal-footer,.save-indicator,.segmented,.stock-view-tabs){background:var(--surface-soft);border-color:var(--line);color:var(--muted)}
[data-theme=dark] :is(.segmented button.active,.stock-view-tabs button.active){background:var(--surface);color:var(--ink)}
[data-theme=dark] :is(.workspace-icon,.nav-count,.avatar,.topbar-user .avatar,.account .avatar,.product-symbol,.step-circle,.empty-icon,.action-icon,kbd){background:var(--surface-soft);color:var(--muted);border-color:var(--line)}
[data-theme=dark] :is(.mini-progress,.margin-track,.cost-bar,.stock-days,.health-row .track,.progress-track,.loading-shimmer,.masked-preview .skeleton){background:#304058}
[data-theme=dark] :is(.pill,.prototype-pill,.view-tab small){background:var(--surface-soft);color:var(--muted);border-color:var(--line)}
[data-theme=dark] :is(.pill.green,.save-indicator.saved,.update-step.done .step-circle){background:var(--green-soft);color:var(--green);border-color:#2b5648}
[data-theme=dark] :is(.pill.amber,.state-note.amber,.save-banner,.save-indicator.error,.save-indicator.conflict){background:var(--amber-soft);color:var(--amber);border-color:#685333}
[data-theme=dark] :is(.pill.red,.update-step.error .step-circle){background:var(--red-soft);color:var(--red);border-color:#6d3d4b}
[data-theme=dark] :is(.pill.blue,.state-note.blue,.update-step.running .step-circle){background:var(--blue-soft);color:var(--blue);border-color:#3b527c}
[data-theme=dark] :is(.field-row,.cost-row,.scenario-table td,.scenario-table th,.data-pairs div,.drawer-tabs,.modal-head,.action-row,.update-step,.history-row,.job-log>div,.marketing-table td){border-color:var(--line)}
[data-theme=dark] :is(.btn-primary,.ozon-module .oz-btn-primary){background:#416aed;color:#fff;border-color:#5074ed}
[data-theme=dark] :is(.btn-primary:hover,.ozon-module .oz-btn-primary:hover){background:#5078f3;color:#fff}
[data-theme=dark] :is(.brand-mark,.oz-brand-mark){background:#e1e9fa}
[data-theme=dark] :is(.auth-subtitle,.auth-footer,.cost-note,.settings-note,.section-label,.field label,.field small,.product-info span,.breadcrumbs,.comparison-strip small,.cost-row,.data-pairs dt,.drawer-product p,.history-row,.range-labels,.scenario-chips button){color:var(--muted)}
[data-theme=dark] :is(.brand strong,.product-info strong,.sim-profit strong,.comparison-strip strong,.data-pairs dd,.panel h2,.breadcrumbs strong,.topbar-user,.overview-hero h2){color:var(--ink)}
[data-theme=dark] .ozon-module{--oz-bg:var(--bg);--oz-surface:var(--surface);--oz-ink:var(--ink);--oz-muted:var(--muted);--oz-line:var(--line);--oz-blue:var(--blue);--oz-blue-soft:var(--blue-soft);--oz-green:var(--green);--oz-amber:var(--amber);--oz-red:var(--red)}
[data-theme=dark] .ozon-module :is(.oz-sidebar,.oz-nav-item:hover,.oz-icon-button:hover,.oz-table tr:hover td,.oz-product-symbol,.oz-field input:focus,.oz-field select:focus){background:var(--surface-soft)}
[data-theme=dark] .ozon-module :is(.oz-nav-item.active,.oz-badge.blue,.oz-notice){background:var(--blue-soft);color:var(--blue)}
.ozon-module .oz-topbar>div{display:flex;align-items:center;gap:10px;flex-shrink:0}.ozon-module .oz-topbar>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ozon-module .market-switch,.ozon-module .theme-toggle{font-family:inherit}.ozon-module .oz-topbar .market-switch button{font-size:12px}.ozon-module .oz-account .icon-btn{margin-left:auto}.ozon-module .theme-toggle .icon{width:17px;height:17px;fill:none;stroke:currentColor}
@media(max-width:1350px){.topbar-actions .command-trigger{padding:7px}.topbar-actions .command-trigger>span,.topbar-actions .command-trigger>kbd{display:none}.topbar-actions{gap:9px}.topbar-user>span[data-account-name]{display:none}}
@media(max-width:1050px){.topbar .breadcrumbs>span,.topbar .breadcrumbs>.icon{display:none}.theme-toggle>span{display:none}.theme-toggle{padding:7px}.ozon-module .oz-topbar>span{font-size:11px}.ozon-module .oz-topbar>div{gap:6px}}
@media(max-width:720px){.topbar{gap:8px;min-height:64px}.topbar-actions{gap:5px;margin-left:auto}.topbar .breadcrumbs,.topbar .command-trigger,.topbar-help,.topbar-actions .save-indicator{display:none}.market-switch button{padding:5px 7px;font-size:11px}.market-switch{padding:2px}.auth-theme{top:12px;right:14px}.auth-shell{padding-top:62px}.cost-summary{gap:14px}.cost-summary strong{font-size:17px}.price-confirm-grid{grid-template-columns:1fr}.price-confirm-modal .modal-footer{flex-wrap:wrap}.price-confirm-modal .modal-footer>.btn{flex:1}.ozon-module .oz-topbar{height:auto;min-height:64px;gap:8px;flex-wrap:wrap}.ozon-module .oz-topbar>span{display:none}.ozon-module .oz-topbar>div{width:100%;justify-content:flex-end}.ozon-module .oz-topbar .oz-badge{display:none}.costs-panel .table-tools>.muted{display:none}}
@media(prefers-reduced-motion:reduce){.loading-ring{animation:none}.market-loading *{scroll-behavior:auto}}

[data-theme=dark] .ozon-module .oz-brand-mark{background:#e1e9fa}
/* Pseudo-elements cannot be arguments of :is(); keep explicit selectors. */
[data-theme=dark] .brand-mark::before,[data-theme=dark] .brand-mark::after,[data-theme=dark] .ozon-module .oz-brand-mark::before,[data-theme=dark] .ozon-module .oz-brand-mark::after{background:#1b2c47}
[data-theme=dark] .auth-side{background:transparent}
[data-theme=dark] .auth-card .field input:invalid:not(:user-invalid),[data-theme=dark] #password-form .field input:invalid:not(:user-invalid){border-color:var(--line)}
[data-theme=dark] .auth-card .field input:invalid:not(:user-invalid):focus,[data-theme=dark] #password-form .field input:invalid:not(:user-invalid):focus{border-color:var(--blue)}



/* A visible platform switch, separate from page tools and account actions. */
header.market-header:is(.topbar,.oz-topbar,.sc-topbar){height:auto;min-height:68px;flex-wrap:wrap;gap:12px;padding-top:10px;padding-bottom:10px}
header.market-header>div.market-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex:1 1 auto;flex-wrap:wrap;min-width:0;max-width:100%;margin-left:auto}
.market-navigation.market-switch{display:inline-flex;align-items:stretch;gap:4px;padding:4px;min-width:0;max-width:100%;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft);white-space:normal}
.market-header .market-header-actions>.market-navigation.market-switch{flex:0 1 auto;overflow:visible}
.market-navigation.market-switch>button.market-option{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;min-width:0;padding:7px 12px;margin:0;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--muted);font-family:inherit;font-size:12px;font-weight:600;line-height:1.25;white-space:nowrap;cursor:pointer;box-shadow:none}
.market-header .market-navigation.market-switch>button.market-option{font-family:inherit;font-size:12px;font-weight:600;line-height:1.25;padding:7px 12px;min-height:36px;flex:0 1 auto}
.market-navigation.market-switch>button.market-option:hover{background:var(--surface-hover);color:var(--ink)}
.market-navigation.market-switch>button.market-option[aria-pressed=true]{background:var(--surface);border-color:var(--line);color:var(--ink);box-shadow:0 1px 3px #17212b12,inset 0 -2px 0 var(--blue)}
.market-navigation.market-switch>button.market-option:focus-visible{outline:2px solid var(--blue);outline-offset:1px}
.market-navigation .market-dot{width:6px;height:6px;flex:0 0 6px;border-radius:50%;background:currentColor}
.market-navigation .market-dot-control{border-radius:2px;background:var(--muted)}
.market-navigation .market-dot-wb{background:#a95cdb}.market-navigation .market-dot-ozon{background:#5288f0}.market-navigation .market-dot-emall{background:#e78448}
.market-navigation .market-name-short{display:none}
.market-header .market-utilities{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0;flex:0 0 auto}
.market-header>.market-header-actions>.market-utilities>button{min-height:36px;flex:0 0 auto;font-size:12px}
.market-header .market-utilities>.theme-toggle,.market-header .market-utilities>[data-marzh-action=logout]{min-width:36px}
.market-header>.market-header-actions>.market-utilities>.theme-toggle{margin:0}
@media(max-width:760px){
  header.market-header:is(.topbar,.oz-topbar,.sc-topbar){display:grid;grid-template-columns:40px minmax(0,1fr) auto;gap:8px;min-height:0;height:auto;padding:10px 12px;align-items:center}
  header.market-header>div.market-header-actions{display:contents}
  .market-header .market-header-actions>.market-navigation.market-switch{grid-column:1/-1;grid-row:1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%;min-width:0;max-width:100%;gap:3px;padding:3px;overflow:visible;border-radius:12px}
  .market-header .market-navigation.market-switch>button.market-option{min-height:44px;width:100%;padding:8px 4px;font-size:12px;gap:5px;border-radius:8px}
  .market-navigation .market-name-long{display:none}.market-navigation .market-name-short{display:inline}
  .market-header .market-utilities{grid-column:3;grid-row:2;gap:6px;justify-self:end;min-width:0;max-width:100%}
  .market-header>.market-header-actions>.market-utilities>button{min-height:40px;min-width:40px;height:auto;padding:8px;font-size:12px}
  .market-header>.market-header-actions>.market-utilities>.theme-toggle>span{display:none}
  header.market-header>:is(.breadcrumbs,.cc-breadcrumb,.sc-breadcrumb,span){display:none}
  header.market-header>:is(.mobile-menu,.cc-menu-button){grid-column:1;grid-row:2;margin:0;width:40px;min-width:40px;height:40px;min-height:40px;padding:8px}
  header.market-header>[data-return-strategy]{grid-column:2;grid-row:2;justify-self:start;min-width:0;max-width:100%;min-height:40px;margin:0;padding:7px 9px;font-size:11px;white-space:normal;text-align:left}
  .market-loading>header{flex-wrap:wrap;padding:12px}
  .market-loading>header>.market-navigation.market-switch{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%}
  .market-loading>header>.market-navigation.market-switch>button{min-height:44px;padding:8px 4px}
}
