:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --text: #17212b;
    --muted: #687684;
    --line: #dde3e8;
    --brand: #176b57;
    --brand-dark: #105343;
    --blue: #2467a6;
    --warning: #9a6513;
    --danger: #a13d3d;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(23, 33, 43, 0.06);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; color: var(--text); background: var(--bg); font: 14px/1.55 "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

.site-header { position: sticky; top: 0; z-index: 20; min-height: 68px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; padding: 0 max(24px, calc((100vw - 1240px) / 2)); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.97); }
.logo { display: flex; align-items: center; gap: 9px; color: #16372f; font-size: 18px; font-weight: 800; white-space: nowrap; }
.logo span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; color: #fff; background: var(--brand); font-size: 11px; }
.main-nav { display: flex; justify-content: center; gap: 3px; }
.main-nav a { padding: 8px 10px; border-radius: 5px; color: #4e5c68; font-weight: 600; }
.main-nav a:hover, .main-nav a.active { color: var(--brand); background: #e9f2ef; }
.nav-count { display: inline-grid; min-width: 18px; height: 18px; margin-left: 4px; place-items: center; padding: 0 5px; border-radius: 9px; color: #fff; background: var(--danger); font-size: 10px; }
.user-info { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.user-info span { color: #4e5c68; font-weight: 650; }
.user-info a { color: var(--brand); font-weight: 650; }
.header-register { padding: 7px 11px; border: 1px solid #b7d2ca; border-radius: 5px; }
.nav-toggle { display: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

.page-shell { width: min(1240px, calc(100% - 40px)); min-height: calc(100vh - 147px); margin: 0 auto; padding: 34px 0 54px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-heading h1, .auth-copy h1, .welcome-band h1 { margin: 3px 0 4px; font-size: 32px; line-height: 1.2; }
.page-heading p, .auth-copy p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--brand); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.muted { color: var(--muted); }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid transparent; border-radius: 6px; font-weight: 700; }
.button.primary { color: #fff; background: var(--brand); }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { color: #34434e; border-color: #cbd4da; background: #fff; }
.button.secondary:hover { border-color: #8da59e; }
.button.danger { color: var(--danger); border-color: #e2b9b9; background: #fff; }
.button.danger:hover { border-color: var(--danger); background: #fff6f6; }
.button.compact { min-height: 32px; padding: 0 10px; font-size: 12px; }
.button.full { width: 100%; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }

.welcome-band { padding: 58px 52px; color: #fff; border-radius: var(--radius); background: #164f43; }
.welcome-band .eyebrow { color: #a9d8cb; }
.welcome-band h1 { max-width: 760px; margin-top: 8px; font-size: 44px; }
.welcome-band p { max-width: 680px; margin: 14px 0 0; color: #d4e7e2; font-size: 16px; }
.welcome-band .button.primary { color: #164f43; background: #fff; }
.welcome-band .button.secondary { color: #fff; border-color: #77a99c; background: transparent; }
.feature-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding: 38px 4px 0; }
.feature-list article { padding-top: 18px; border-top: 2px solid #8eb7ac; }
.feature-list article:nth-child(2) { border-color: #d49a52; }
.feature-list article:nth-child(3) { border-color: #6f9dca; }
.feature-list span { color: var(--muted); font-size: 11px; font-weight: 800; }
.feature-list h2 { margin: 5px 0; font-size: 18px; }
.feature-list p { margin: 0; color: var(--muted); }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { display: grid; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.stat span { color: var(--muted); font-weight: 650; }
.stat strong { margin: 3px 0 9px; font-size: 30px; }
.stat a { color: var(--brand); font-size: 12px; font-weight: 700; }

.panel { margin-top: 22px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.panel-heading h2 { margin: 0; font-size: 17px; }
.panel-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.panel-heading > a { color: var(--brand); font-size: 12px; font-weight: 700; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr); gap: 20px; }
.two-column > .panel { margin-top: 0; }
.compact-panel { align-self: start; }

.table-panel { padding: 0; overflow: hidden; }
.table-panel > .panel-heading { padding: 20px 20px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 11px 13px; color: #667480; background: #f7f8f9; font-size: 11px; text-align: left; text-transform: uppercase; }
td { padding: 13px; border-bottom: 1px solid #edf0f2; color: #41505c; }
tbody tr:last-child td { border-bottom: 0; }
.cell-wrap { max-width: 280px; white-space: normal; }
.product-name { display: flex; align-items: center; gap: 10px; color: var(--text); }
.product-name > span:last-child { display: grid; gap: 2px; }
.product-source { color: var(--brand); font-size: 11px; font-weight: 700; }
.product-name img, .image-placeholder { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 6px; }
.product-name img { object-fit: cover; }
.image-placeholder { display: grid; place-items: center; color: #315e54; background: #deece8; font-size: 12px; font-weight: 800; }

.filter-bar { display: grid; grid-template-columns: minmax(220px, 480px) auto auto; gap: 9px; align-items: center; margin-bottom: 16px; }
.filter-bar input { min-height: 40px; padding: 0 12px; border: 1px solid #cbd4da; border-radius: 6px; }
.filter-bar > a { color: var(--brand); font-weight: 650; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.catalog-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.catalog-select { position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #cbd4da; border-radius: 5px; background: rgba(255, 255, 255, 0.95); box-shadow: var(--shadow); cursor: pointer; }
.catalog-select input { margin: 0; }
.catalog-media { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #eef2f3; }
.catalog-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease; }
.catalog-card:hover .catalog-media img { transform: scale(1.025); }
.catalog-media > span { width: 100%; height: 100%; display: grid; place-items: center; color: #527168; font-size: 42px; font-weight: 800; }
.catalog-state { position: absolute; top: 10px; left: 10px; padding: 4px 8px; border-radius: 4px; font-size: 11px; }
.catalog-state.ready { color: #fff; background: #176b57; }
.catalog-state.draft { color: #734e12; background: #fff0cf; }
.catalog-body { display: grid; gap: 8px; padding: 14px; }
.catalog-body > strong, .catalog-body > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-body > strong { font-size: 15px; }
.catalog-body > small { min-height: 21px; color: var(--muted); }
.catalog-price, .catalog-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.catalog-price b { color: #b13a2b; font-size: 20px; }
.catalog-price span, .catalog-meta { color: var(--muted); font-size: 11px; }
.catalog-missing { min-height: 36px; margin: 0; overflow: hidden; color: var(--warning); font-size: 11px; line-height: 18px; }
.catalog-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.cart-inline { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; }
.cart-inline label { display: grid; grid-template-columns: 1fr; }
.cart-inline label span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cart-inline input { width: 100%; min-height: 40px; padding: 0 8px; border: 1px solid #cbd4da; border-radius: 6px; }
.selection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
.selection-toolbar > div { display: flex; align-items: center; gap: 12px; }
.selection-toolbar span { color: var(--muted); font-size: 12px; }

.auth-layout { min-height: 620px; display: grid; grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1fr); align-items: center; gap: 70px; max-width: 980px; margin: auto; }
.auth-copy h1 { font-size: 38px; }
.auth-copy code { padding: 2px 5px; border-radius: 4px; color: #315e54; background: #e4efec; }
.form-card { display: grid; gap: 15px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 12px 32px rgba(23, 33, 43, 0.08); }
.form-card h2 { margin: 0 0 3px; font-size: 20px; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #c8d1d7; border-radius: 6px; background: #fff; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(23, 107, 87, 0.16); border-color: var(--brand); }
.field-divider { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.field-divider::before, .field-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.form-foot { margin: 0; color: var(--muted); text-align: center; }
.form-foot a { color: var(--brand); font-weight: 700; }
.alert { padding: 10px 12px; border-radius: 6px; }
.alert.error { color: #8f3030; border: 1px solid #efc3c3; background: #fbe9e9; }
.alert.success { color: #175a49; border: 1px solid #bad6cd; background: #e8f3f0; }
.alert.info { color: #245e72; border: 1px solid #bdd6df; background: #edf6f8; }

.upload-panel { display: grid; align-content: start; gap: 16px; }
.upload-panel .panel-heading { margin-bottom: 0; }
.file-picker { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; border: 1px dashed #9eabb4; border-radius: 7px; background: #fafbfc; cursor: pointer; }
.file-picker.dragging { border-color: var(--brand); background: #edf5f2; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker small { margin-top: 3px; color: var(--muted); }
.file-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px; border-radius: 50%; color: var(--brand); background: #deece8; font-size: 22px; }
.code-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.code-table span { padding: 7px; border-radius: 4px; color: #456057; background: #edf3f1; font-size: 11px; text-align: center; }
.code-table.ozon-columns { grid-template-columns: 1fr 1fr; }

.product-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.product-card { min-width: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.product-card img, .product-card .product-image-empty { width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; object-fit: cover; color: var(--muted); background: #edf1f3; }
.product-card div { padding: 11px; }
.product-card strong, .product-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card small { margin-top: 3px; color: var(--muted); }
.loading-row { color: var(--muted); }

.selection-list { display: grid; }
.selection-item { display: grid; grid-template-columns: auto 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 5px; border-top: 1px solid #edf0f2; }
.selection-item:hover { background: #fafbfb; }
.selection-item.incomplete { color: var(--muted); }
.selection-item.incomplete:hover { background: transparent; }
.selection-item em { display: block; overflow: hidden; color: var(--warning); font-size: 11px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.selection-item b a { color: var(--brand); font-size: 12px; }
.selection-cover { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; }
.selection-details { min-width: 0; }
.selection-item strong, .selection-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selection-item small { color: var(--muted); }
.check-all { color: var(--muted); font-size: 12px; }
.bulk-actions, .selection-actions { display: flex; align-items: center; gap: 12px; }
.selection-actions { justify-content: flex-end; }
.selection-actions > b { min-width: 74px; text-align: right; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 16px; }
.credential-state, .badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.credential-state.ready, .badge.success, .badge.delivered { color: #166047; background: #e0f1ea; }
.credential-state.local { color: #6f531b; background: #fff0cf; }
.credential-state.missing, .badge.fail { color: #913535; background: #f9e4e4; }
.badge.pending { color: #875c14; background: #fff0d4; }
.badge.submitted { color: #245e92; background: #e3eef8; }
.badge.shipped, .badge.awaiting_deliver, .badge.posting_acceptance_in_progress { color: #245e92; background: #e3eef8; }

.order-layout { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.65fr); }
.order-table { white-space: normal; min-width: 1120px; }
.order-action { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 130px; }
.inline-limit-form { display: flex; align-items: center; gap: 7px; }
.inline-limit-form input { width: 72px; min-height: 32px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; }
.compact-row { margin-top: 0; align-items: center; }
.compact-row form { margin: 0; }
.field-help { margin: 0; color: var(--muted); font-size: 13px; }
.status-select { min-height: 34px; padding: 0 8px; border: 1px solid #c8d1d7; border-radius: 5px; background: #fff; }
.badge.paid, .badge.packing { color: #875c14; background: #fff0d4; }
.badge.cancelled { color: #913535; background: #f9e4e4; }
.badge.awaiting_payment, .badge.pending_payment { color: #875c14; background: #fff0d4; }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.cart-lines { display: grid; }
.cart-line { display: grid; grid-template-columns: 58px minmax(160px, 1fr) 80px 130px 90px auto; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line:first-child { padding-top: 0; }
.cart-line:last-child { padding-bottom: 0; border-bottom: 0; }
.cart-line > img, .cart-line > .image-placeholder { width: 58px; height: 58px; border-radius: 6px; object-fit: cover; }
.cart-product { min-width: 0; }
.cart-product strong, .cart-product small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-product small { color: var(--muted); }
.cart-quantity { display: flex; gap: 6px; }
.cart-quantity input { width: 58px; min-height: 32px; padding: 0 7px; border: 1px solid #cbd4da; border-radius: 5px; }
.cart-summary { position: sticky; top: 92px; display: grid; gap: 10px; padding: 18px; border-left: 1px solid var(--line); }
.cart-summary > span { color: var(--muted); }
.cart-summary > strong { font-size: 28px; }
.cart-summary p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.cart-payment-qr { width: min(100%, 190px); aspect-ratio: 1; justify-self: center; border: 1px solid var(--line); object-fit: contain; background: #fff; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); gap: 20px; align-items: start; }
.checkout-layout > .panel { margin-top: 0; }
.checkout-form { display: grid; gap: 15px; }
.checkout-form .panel-heading { margin-bottom: 0; }
.checkout-summary { display: grid; gap: 10px; }
.checkout-summary > div:not(.panel-heading) { display: flex; justify-content: space-between; gap: 18px; padding: 8px 0; border-bottom: 1px solid #edf0f2; }
.checkout-summary .checkout-total { margin-top: 4px; padding-top: 15px; border-top: 2px solid var(--line); border-bottom: 0; font-size: 17px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr); gap: 20px; }
.settings-layout > .panel { margin-top: 0; }
.settings-form { display: grid; gap: 15px; }
.settings-form .panel-heading { margin-bottom: 0; }
.settings-actions { justify-content: flex-start; padding-top: 2px; }
.authorization-summary { align-self: start; }
.authorization-summary dl { margin: 0; }
.authorization-summary dl div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #edf0f2; }
.authorization-summary dt { color: var(--muted); }
.authorization-summary dd { margin: 0; font-weight: 700; word-break: break-all; }
.settings-note { margin: 16px 0 0; color: var(--muted); font-size: 12px; }
.text-danger { margin-top: 18px; padding: 0; border: 0; color: var(--danger); background: transparent; font-weight: 700; }
.order-form { align-self: start; display: grid; gap: 14px; }
.order-form .panel-heading { margin-bottom: 0; }
.status-box { padding: 11px 13px; border: 1px solid #bad6cd; border-radius: 6px; color: #175a49; background: #e8f3f0; }
.status-box { white-space: pre-wrap; }
.status-box.error { color: #8f3030; border-color: #efc3c3; background: #fbe9e9; }
.status-box.page-status { margin: -8px 0 18px; }
.empty-state { padding: 52px 20px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 16px; }
.empty-state p { margin: 0 0 15px; }
.empty-state.small { padding: 25px; }
.empty-state.small p { margin: 0; }
.table-action { min-height: 32px; padding: 0 10px; font-size: 12px; }
.product-edit-form { max-width: 820px; display: grid; gap: 16px; }
.field small { color: var(--muted); }
.product-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.product-editor .panel { margin-top: 0; }
.editor-section { display: grid; gap: 15px; }
.editor-section .panel-heading { margin-bottom: 0; }
.editor-wide { grid-column: 1 / -1; }
.editor-cover { width: 150px; aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: 6px; object-fit: cover; }
.public-upload-box { display: grid; gap: 13px; padding: 14px; border: 1px solid #b9d2cb; border-radius: 7px; background: #f2f8f6; }
.public-upload-box input[type="file"] { padding: 8px; background: #fff; }
.storage-hint { margin: 0; color: var(--warning); font-size: 12px; }
.storage-hint a { color: var(--brand); font-weight: 700; }
.dimension-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.code-input { font-family: Consolas, "Courier New", monospace; font-size: 12px; }
.ozon-category-picker { position: relative; display: grid; gap: 12px; padding: 16px; border: 1px solid #b9d2cb; border-radius: 7px; background: #f5faf8; }
.category-picker-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.category-picker-heading, .attribute-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.category-picker-heading strong, .attribute-editor-heading strong { display: block; font-size: 15px; }
.category-picker-heading small, .attribute-editor-heading small { display: block; margin-top: 3px; color: var(--muted); }
.category-selected { padding: 10px 12px; border-left: 3px solid var(--brand); color: #284d44; background: #e6f1ee; font-size: 12px; font-weight: 700; }
.category-results { position: absolute; z-index: 12; top: 126px; left: 16px; right: 16px; max-height: 360px; overflow-y: auto; border: 1px solid #aebbc2; border-radius: 6px; background: #fff; box-shadow: 0 14px 30px rgba(23, 33, 43, 0.16); }
.category-result { width: 100%; display: grid; gap: 2px; padding: 10px 12px; border: 0; border-bottom: 1px solid #edf0f2; background: #fff; text-align: left; cursor: pointer; }
.category-result:hover, .category-result:focus { outline: 0; background: #edf6f3; }
.category-result strong { font-size: 13px; }
.category-result small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.category-results > p { margin: 0; padding: 18px; color: var(--muted); text-align: center; }
.ozon-attribute-editor { display: grid; gap: 14px; padding-top: 5px; border-top: 1px solid var(--line); }
.ozon-attribute-fields { display: grid; gap: 20px; }
.attribute-group { display: grid; gap: 10px; }
.attribute-group h3 { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.attribute-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ozon-attribute-field { align-content: start; }
.ozon-attribute-field.required > span { color: #74431d; }
.ozon-attribute-field small { max-height: 54px; overflow-y: auto; line-height: 18px; }
.attribute-more { justify-self: start; padding: 0; border: 0; color: var(--brand); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.attribute-empty { margin: 0; padding: 25px; color: var(--muted); background: #f7f9fa; text-align: center; }
.error-text { color: var(--danger); }
.attribute-advanced { color: var(--muted); font-size: 11px; }
.attribute-advanced summary { cursor: pointer; }
.attribute-advanced pre { max-height: 260px; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: #f7f9fa; white-space: pre-wrap; }
.category-sync-actions { display: grid; gap: 10px; padding-top: 16px; }
.editor-actions { display: flex; justify-content: flex-end; gap: 10px; }
.ai-editor { border-color: #9dc8bc; background: #f6fbf9; }
.ai-editor-actions { display: flex; align-items: center; gap: 12px; }
.ai-editor-actions .status-box { flex: 1; }
.ai-copy-results { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; padding-top: 4px; }
.ai-copy-results[hidden] { display: none; }
.ai-copy-results .field { min-width: 0; }
.ai-copy-results textarea { resize: vertical; white-space: pre-wrap; }
.ai-copy-results .button { margin-bottom: 1px; }
.danger-zone { margin-top: 18px; text-align: right; }
.membership-strip { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: -8px 0 22px; padding: 16px 18px; border: 1px solid #b9d2cb; border-radius: 7px; background: #f3f8f6; }
.membership-strip.inactive { border-color: #e5c99a; background: #fff8eb; }
.membership-strip strong, .membership-strip span { display: block; }
.membership-strip span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.membership-summary { margin-bottom: 20px; padding: 20px; border-left: 4px solid var(--brand); background: #edf6f3; }
.membership-summary.inactive { border-left-color: #b98024; background: #fff8eb; }
.membership-summary span, .membership-summary strong { display: block; }
.membership-summary strong { margin-top: 4px; font-size: 24px; }
.membership-summary p { margin: 5px 0 0; color: var(--muted); }
.membership-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; margin-bottom: 20px; }
.membership-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.plan-card > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.plan-card > strong { display: block; margin: 8px 0 2px; font-size: 28px; }
.plan-card > p { margin: 0 0 18px; color: var(--muted); }
.plan-card form { display: grid; gap: 12px; }
.payment-panel { padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.payment-panel img { width: 100%; aspect-ratio: 1 / 1; border: 1px solid var(--line); object-fit: contain; background: #fff; }
.payment-panel ol { margin: 16px 0 0; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.inline-actions { display: flex; gap: 7px; }
.verification-row { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 10px; align-items: end; }
.verification-row .button { margin-bottom: 1px; }
.payment-checkout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.payment-order-summary dl, .payment-code-panel { display: grid; gap: 14px; }
.payment-order-summary dl > div { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.payment-order-summary dt { color: var(--muted); }
.payment-order-summary dd { margin: 0; font-weight: 750; text-align: right; }
.payment-code-panel { justify-items: center; text-align: center; }
.payment-code-panel img { width: min(100%, 300px); aspect-ratio: 1; border: 1px solid var(--line); object-fit: contain; background: #fff; }
.payment-code-panel strong { font-size: 28px; }
.payment-code-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

footer { padding: 22px 20px; border-top: 1px solid var(--line); color: var(--muted); background: #fff; text-align: center; }
footer p { margin: 0; }

@media (max-width: 1500px) {
    .site-header { grid-template-columns: auto auto 1fr; gap: 12px; }
    .nav-toggle { display: block; }
    .main-nav { position: absolute; top: 68px; left: 20px; right: 20px; z-index: 20; display: none; flex-direction: column; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 10px 24px rgba(23, 33, 43, 0.12); }
    .main-nav.open { display: flex; }
    .user-info { justify-self: end; }
}

@media (max-width: 960px) {
    .site-header { grid-template-columns: auto auto 1fr; gap: 12px; }
    .nav-toggle { display: block; }
    .main-nav { position: absolute; top: 68px; left: 20px; right: 20px; display: none; flex-direction: column; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 10px 24px rgba(23, 33, 43, 0.12); }
    .main-nav.open { display: flex; }
    .user-info { justify-self: end; }
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dimension-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .two-column, .order-layout, .settings-layout, .checkout-layout, .cart-layout, .membership-layout, .payment-checkout { grid-template-columns: 1fr; }
    .payment-panel { max-width: 420px; }
    .cart-summary { position: static; border-top: 1px solid var(--line); border-left: 0; }
    .cart-line { grid-template-columns: 58px minmax(120px, 1fr) 80px 130px 80px auto; gap: 10px; }
    .auth-layout { gap: 32px; }
}

@media (max-width: 680px) {
    .site-header { min-height: 62px; padding: 0 15px; }
    .main-nav { top: 62px; left: 12px; right: 12px; }
    .logo { font-size: 0; }
    .logo span { font-size: 11px; }
    .user-info span { display: none; }
    .page-shell { width: min(100% - 28px, 1240px); padding: 24px 0 38px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
    .heading-actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .heading-actions .button { min-width: 0; padding: 0 9px; white-space: normal; text-align: center; }
    .heading-actions .button:last-child { grid-column: 1 / -1; }
    .page-heading h1, .auth-copy h1 { font-size: 27px; }
    .welcome-band { padding: 38px 24px; }
    .welcome-band h1 { font-size: 34px; }
    .feature-list, .stats-grid, .auth-layout { grid-template-columns: 1fr; }
    .membership-plans { grid-template-columns: 1fr; }
    .membership-strip { align-items: stretch; flex-direction: column; }
    .auth-layout { min-height: auto; gap: 22px; }
    .form-columns { grid-template-columns: 1fr; }
    .verification-row { grid-template-columns: 1fr; }
    .form-card { padding: 21px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .catalog-body { padding: 11px; }
    .catalog-price b { font-size: 17px; }
    .catalog-actions .button { padding: 0 8px; font-size: 12px; white-space: nowrap; }
    .product-editor { grid-template-columns: 1fr; }
    .editor-wide { grid-column: auto; }
    .ai-editor-actions { align-items: stretch; flex-direction: column; }
    .ai-copy-results { grid-template-columns: 1fr; }
    .dimension-grid { grid-template-columns: 1fr 1fr; }
    .attribute-grid { grid-template-columns: 1fr; }
    .category-picker-heading, .attribute-editor-heading { align-items: flex-start; flex-direction: column; }
    .category-picker-heading .button { width: 100%; }
    .category-picker-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
    .category-results { top: 226px; }
    .filter-bar { grid-template-columns: 1fr auto; }
    .filter-bar input { min-width: 0; }
    .filter-bar > a { grid-column: 1 / -1; }
    .ozon-toolbar { align-items: flex-start; }
    .ozon-toolbar .bulk-actions { align-items: flex-end; flex-direction: column-reverse; gap: 7px; }
    .selection-toolbar { align-items: flex-start; }
    .selection-toolbar > .bulk-actions { align-items: flex-end; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
    .selection-item { grid-template-columns: auto 42px minmax(0, 1fr); }
    .selection-actions { grid-column: 3; justify-content: space-between; }
    .cart-line { grid-template-columns: 52px minmax(0, 1fr) auto; align-items: start; }
    .cart-line > img, .cart-line > .image-placeholder { width: 52px; height: 52px; grid-row: span 2; }
    .cart-line > b { text-align: right; }
    .cart-quantity { grid-column: 2; }
    .cart-line > strong { grid-column: 3; grid-row: 2; text-align: right; }
    .cart-line > form:last-child { grid-column: 2 / -1; }
}
