:root {
    color-scheme: light;
    --brand: #9e2629;
    --brand-main: var(--brand);
    --brand-hover: #7f1e21;
    --brand-dark: #651719;
    --brand-soft: #fbf1f2;
    --brand-muted: #f4dfe0;
    --brand-border: #dfb4b6;
    --brand-ring: rgba(158, 38, 41, .2);
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #d8dee6;
    --text: #1f2937;
    --muted: #64748b;
    --accent: var(--brand);
    --success: #16804f;
    --warning: #b77916;
    --danger: #b4232d;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f6f8;
    color: #1f2937;
    accent-color: var(--brand);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: #f5f6f8; }
.container { width: min(1180px, 100%); margin: 0 auto; padding: 18px 14px 56px; }
.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 3px 14px rgba(0,0,0,.04);
}
.login-card { max-width: 480px; margin: 60px auto; }
h1 { font-size: clamp(27px, 5vw, 38px); }
h2 { font-size: clamp(22px, 4vw, 30px); }
h1,h2,h3 { margin-top: 0; }
label { display: block; margin-bottom: 6px; font-weight: 600; }
input, select, textarea {
    width: 100%;
    min-width: 0;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 16px;
    background: #fff;
}
textarea { resize: vertical; font-family: inherit; }
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
input[type="checkbox"], input[type="radio"] {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}
button, .button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding: 11px 16px;
    border: 0;
    border-radius: 9px;
    background: #4f46e5;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary, .button.secondary { background: #475569; }
button.danger { background: #b91c1c; }
button.compact { min-height: 36px; padding: 7px 10px; font-size: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.alert { padding: 12px 14px; border-radius: 9px; margin: 12px 0; }
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.info { background: #e0f2fe; color: #075985; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions h2 { margin-right: auto; margin-bottom: 0; }
.muted { color: #64748b; font-size: 14px; }
code { background: #f1f5f9; padding: 2px 6px; border-radius: 5px; }
header { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom:18px; }

.settings-grid,
.prepared-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.prepared-form-grid .full { grid-column: 1 / -1; }

.product-tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.filter-field { width: min(340px, 100%); }
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 12px;
    align-items: start;
}
.product-item {
    display: grid;
    grid-template-columns: 28px 88px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}
.product-item.is-prepared { border-color: #86efac; background: #f0fdf4; }
.product-thumb {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #fff;
}
.product-thumb-placeholder {
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    color: #94a3b8;
}
.product-info { min-width: 0; }
.product-name {
    display: block;
    color: #1d4ed8;
    font-weight: 700;
    line-height: 1.28;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.product-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 9px;
    margin-top: 10px;
    font-size: 14px;
}
.product-meta dt { color: #64748b; }
.product-meta dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.workflow-box {
    margin: 16px 0 20px;
    padding: 16px;
    border: 1px solid #bae6fd;
    border-radius: 13px;
    background: #f0f9ff;
}
.workflow-box h3 { margin-bottom: 10px; }
.workflow-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}
.workflow-steps span {
    padding: 10px;
    border-radius: 9px;
    background: white;
    border: 1px solid #dbeafe;
    font-size: 14px;
    font-weight: 650;
}
.package-actions {
    display: grid;
    grid-template-columns: minmax(220px, .7fr) minmax(300px, 1.3fr);
    gap: 14px;
    align-items: end;
}
.package-actions > form:first-child button { width: 100%; }
.package-selection-info { margin-top: 6px; text-align: center; }
.package-download-status { min-height: 18px; margin-top: 5px; text-align: center; font-weight: 700; }
.package-download-status.success-text { color: #166534; }
.package-download-status.error-text { color: #b91c1c; }
.result-upload-form label { margin-bottom: 8px; }
.upload-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.prepared-list {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}
.prepared-card {
    padding: 16px;
    border: 1px solid #bbf7d0;
    border-radius: 13px;
    background: #f0fdf4;
    scroll-margin-top: 16px;
}
.prepared-topline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.export-choice {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid #86efac;
    border-radius: 9px;
    background: white;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: 13px;
    font-weight: 700;
}
.status-generated { background: #dcfce7; color: #166534; }
.status-manual { background: #fef3c7; color: #92400e; }
.status-source { background: #e0f2fe; color: #075985; }
.prepared-heading {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    margin-bottom: 16px;
}
.prepared-edit-form { margin-bottom: 14px; }

.gallery-section {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid #d1fae5;
    border-radius: 12px;
    background: white;
}
.gallery-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.gallery-header h3 { margin-bottom: 3px; }
.gallery-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.gallery-item {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}
.gallery-item > a {
    display: block;
    aspect-ratio: 1 / 1;
    padding: 6px;
    background: #f8fafc;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 7px;
}
.gallery-item-footer {
    display: grid;
    gap: 7px;
    padding: 9px;
}
.gallery-item-footer label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 13px;
}
.gallery-item-footer input[type="checkbox"],
.gallery-item-footer input[type="radio"] {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
}

.next-step-box {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    background: #f0f9ff;
}
.next-step-box h3 { margin-bottom: 6px; }

@media (max-width: 800px) {
    .workflow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .package-actions { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .container { padding: 12px 10px 44px; }
    .card { padding: 14px; border-radius: 12px; }
    header { align-items:flex-start; flex-direction:column; }
    .actions { display: grid; grid-template-columns: 1fr; width: 100%; }
    .actions h2 { margin-bottom: 4px; }
    .actions button { width: 100%; }
    .settings-grid,
    .prepared-form-grid { grid-template-columns: 1fr; }
    .prepared-form-grid .full { grid-column: auto; }
    .product-tools { display: grid; grid-template-columns: 1fr 1fr; }
    .product-tools label { grid-column: 1 / -1; }
    .product-tools button { padding-inline: 8px; font-size: 14px; }
    .product-list { grid-template-columns: 1fr; }
    .product-item {
        grid-template-columns: 26px 76px minmax(0, 1fr);
        gap: 9px;
        padding: 11px;
    }
    .product-thumb, .product-thumb-placeholder { width: 76px; height: 76px; }
    .prepared-heading { grid-template-columns: 76px minmax(0, 1fr); }
    .prepared-topline { align-items: flex-start; }
    .workflow-steps { grid-template-columns: 1fr; }
    .upload-row { grid-template-columns: 1fr; }
    .upload-row button { width: 100%; }
    .gallery-header { display: grid; }
    .gallery-quick-actions { justify-content: flex-start; }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* v0.3.1 - wiele źródeł */
.supported-sources {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0 8px;
}
.supported-sources span,
.source-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 700;
}
.variant-note { color: #9a3412; }
.variant-alert { margin-top: 10px; margin-bottom: 0; }

/* v0.4.0 - pełny przepływ Shoper */
.workflow-nav {
    position: sticky;
    top: 8px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 16px;
    padding: 7px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 5px 20px rgba(15,23,42,.08);
    backdrop-filter: blur(8px);
}
.workflow-nav a {
    padding: 9px 8px;
    border-radius: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
}
.workflow-nav a:hover { background: #eef2ff; color: #3730a3; }
details.card > summary, .subcard > summary { cursor: pointer; line-height: 1.5; }
.supplier-form { margin-top: 16px; }
.responsive-table { width: 100%; overflow-x: auto; }
.responsive-table table { width: 100%; border-collapse: collapse; min-width: 920px; }
.responsive-table th, .responsive-table td { padding: 8px; border-bottom: 1px solid #e2e8f0; text-align: left; }
.responsive-table input:not([type="checkbox"]) { min-width: 100px; padding: 8px; }
.responsive-table input[type="checkbox"] { width: 22px; height: 22px; }
.filter-search { flex: 1 1 240px; }
.filter-price { flex: 0 1 130px; }
.inline-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; }
.link-danger { background: transparent; color: #991b1b; padding: 4px 0; min-height: 30px; }
.media-report {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin: -6px 0 16px;
    padding: 10px;
    border: 1px solid #c7d2fe;
    border-radius: 9px;
    background: #eef2ff;
    font-size: 13px;
}
.media-report span { padding: 3px 7px; border-radius: 6px; background: #fff; }
.media-comparison-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 260px)); justify-content: start; gap: 12px; margin: -6px 0 12px; }
.media-comparison-grid article { padding: 0; border: 0; border-radius: 0; background: transparent; }
.media-comparison-grid article > div { display: grid; grid-template-columns: repeat(2, 110px); justify-content: start; gap: 7px; margin-top: 4px; }
button.media-preview-button { display: grid; width: 110px; min-height: 0; gap: 3px; padding: 0; border: 0; background: transparent; color: #475569; font-size: 11px; font-weight: 700; text-align: left; box-shadow: none; cursor: zoom-in; }
button.media-preview-button:hover { transform: none; color: #7f1d1d; box-shadow: none; }
button.media-preview-button:focus-visible { outline: 3px solid rgba(158, 38, 41, .28); outline-offset: 3px; }
.media-preview-button img { width: 110px; height: 120px; object-fit: contain; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; }
.confidence { margin-top: 5px; color: #166534; font-size: 13px; }
.csv-export-form { display: grid; grid-template-columns: minmax(240px, 1fr) auto; align-items: end; gap: 10px; }
.settings-panels { display: grid; gap: 10px; margin-top: 14px; }
.subcard { padding: 13px; border: 1px solid #dbeafe; border-radius: 10px; background: #fff; }
.subcard form { margin-top: 14px; }
.profile-defaults { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 9px; align-items: end; }
.profile-defaults p { margin: 0; }
.profile-defaults button { min-height: 46px; }
.batch-list { display: grid; gap: 10px; }
.batch-card { padding: 13px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; overflow-wrap: anywhere; }
.batch-card > div { margin-bottom: 6px; }
.batch-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.image-upload-summary { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #eef6ff; color: #334155; font-size: 13px; }
.image-upload-details { margin: 8px 0; }
.image-upload-details summary { cursor: pointer; color: #475569; font-weight: 700; }
.image-upload-log-list { display: grid; gap: 7px; margin-top: 7px; }
.image-upload-log-list article { padding: 8px 10px; border: 1px solid #dbe4ee; border-radius: 8px; background: #fff; }
.image-upload-log-list ul, .batch-error-list { margin: 6px 0 0; padding-left: 20px; }
.image-upload-log-list li, .batch-error-list li { margin: 3px 0; }
.log-error { margin-top: 3px; color: #991b1b; font-size: 12px; overflow-wrap: anywhere; }
.batch-actions form { margin: 0; }
.batch-actions .batch-image-upload-form { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.batch-actions .batch-image-upload-form .inline-check { margin: 0; }

@media (max-width: 640px) {
    .workflow-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .csv-export-form { grid-template-columns: 1fr; }
    .csv-export-form button { width: 100%; }
    .prepared-topline { justify-content: flex-start; }
    .batch-actions { display: grid; grid-template-columns: 1fr; }
    .batch-actions button { width: 100%; }
}

/* v0.4.1 - moduł kategorii Shopera */
.main-menu {
    display: flex;
    gap: 8px;
    margin: -4px 0 16px;
    padding: 7px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
}
.main-menu a {
    flex: 1 1 0;
    padding: 10px 12px;
    border-radius: 8px;
    color: #334155;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
}
.main-menu a.active { background: #4f46e5; color: #fff; }
.inline-form { margin-top: 12px; }
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.section-heading h2 { margin-bottom: 4px; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin: 12px 0;
}
.stats-grid > div {
    display: grid;
    gap: 2px;
    padding: 13px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fafc;
}
.stats-grid strong { font-size: 24px; color: #312e81; }
.stats-grid span { color: #64748b; font-size: 13px; }
.stats-inline { color: #475569; white-space: nowrap; }
.stats-inline strong { color: #312e81; font-size: 20px; }
.category-browser {
    max-height: 520px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
}
.category-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 8px 11px 8px calc(11px + (var(--depth, 0) * 18px));
    border-bottom: 1px solid #eef2f7;
    color: #1e293b;
    text-decoration: none;
}
.category-row:last-child { border-bottom: 0; }
.category-row:hover, .category-row.active { background: #eef2ff; color: #3730a3; }
.category-row small { color: #64748b; white-space: nowrap; }
.category-choice {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    justify-content: stretch;
    cursor: pointer;
}
.category-choice > input { margin: 0; }
.category-choice:has(input:checked) { background: #eef2ff; color: #3730a3; }
.category-choice[hidden] { display: none; }
.selection-toolbar { display: flex; gap: 7px; margin-bottom: 10px; }
.api-product-list { display: grid; gap: 9px; }
.api-product-card {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 11px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}
.api-product-card > input { margin-top: 2px; }
.category-line { margin-top: 6px; color: #475569; font-size: 13px; overflow-wrap: anywhere; }
.category-line span { color: #64748b; font-weight: 700; }
.manual-operation-box {
    position: sticky;
    bottom: 8px;
    z-index: 12;
    display: grid;
    grid-template-columns: minmax(220px, .9fr) minmax(300px, 1.5fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 14px;
    padding: 13px;
    border: 1px solid #a5b4fc;
    border-radius: 11px;
    background: rgba(238,242,255,.96);
    box-shadow: 0 8px 25px rgba(15,23,42,.12);
    backdrop-filter: blur(8px);
}
.file-import-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin: 14px 0 10px;
}
.job-items { display: grid; gap: 10px; margin: 14px 0; }
.job-item {
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-left-width: 5px;
    border-radius: 10px;
    background: #fff;
}
.status-border-ready { border-left-color: #4f46e5; }
.status-border-applied, .status-border-rolled_back { border-left-color: #16a34a; }
.status-border-invalid, .status-border-failed, .status-border-conflict,
.status-border-rollback_failed, .status-border-rollback_conflict { border-left-color: #dc2626; }
.status-border-skipped { border-left-color: #94a3b8; }
.job-item-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 6px; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.diff-grid > div { display: grid; gap: 5px; padding: 10px; border-radius: 8px; background: #f8fafc; overflow-wrap: anywhere; }
.diff-grid > div:last-child { background: #f0fdf4; }
.diff-grid small { color: #64748b; font-weight: 800; }
.diff-grid span { color: #475569; font-size: 13px; }
.confirm-operation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 13px;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    background: #eef2ff;
}
.confirm-operation .inline-check { margin: 0; }
.job-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #1e293b;
    text-decoration: none;
}
.job-history-row:hover { border-color: #a5b4fc; background: #f8fafc; }
.job-history-row > span:first-child { display: grid; gap: 3px; }
.job-history-row small { color: #64748b; }
.status-applied, .status-rolled_back { background: #dcfce7; color: #166534; }
.status-partial, .status-rollback_partial { background: #fef3c7; color: #92400e; }
.status-failed { background: #fee2e2; color: #991b1b; }
.book-profile-box {
    padding: 14px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
}
.book-profile-box h3 { margin-top: 0; }
.book-profile-box .prepared-form-grid { margin-top: 12px; }

@media (max-width: 800px) {
    .manual-operation-box { position: static; grid-template-columns: 1fr; }
    .manual-operation-box button { width: 100%; }
}

@media (max-width: 640px) {
    .main-menu { display: grid; grid-template-columns: 1fr; }
    .section-heading { display: grid; }
    .section-heading form, .section-heading button { width: 100%; }
    .file-import-form { grid-template-columns: 1fr; }
    .file-import-form button { width: 100%; }
    .diff-grid { grid-template-columns: 1fr; }
    .confirm-operation { display: grid; }
    .confirm-operation button { width: 100%; }
    .job-history-row { align-items: flex-start; }
}

/* v0.4.9 - pełniejsze karty, działania zbiorcze i poprawki Pallottinum */
:root { font-size: 14px; }
body { font-size: 14px; line-height: 1.42; }
.container { width: min(1440px, 100%); padding: 14px 14px 48px; }
.card { padding: 14px; margin-bottom: 12px; border-radius: 11px; box-shadow: 0 2px 10px rgba(15,23,42,.035); }
h1 { font-size: clamp(23px, 3vw, 29px); margin-bottom: 2px; }
h2 { font-size: clamp(19px, 2.4vw, 23px); margin-bottom: 8px; }
h3 { font-size: 16px; }
p { margin-top: 0; }
label { margin-bottom: 4px; font-size: 13px; }
input, select, textarea { padding: 8px 9px; border-radius: 7px; font-size: 14px; }
input[type="checkbox"], input[type="radio"] { width: 19px; height: 19px; flex: 0 0 19px; }
button, .button { min-height: 38px; padding: 8px 12px; border-radius: 7px; font-size: 13.5px; }
button.compact { min-height: 32px; padding: 5px 9px; font-size: 12.5px; }
button.ghost, .button.ghost { border: 1px solid #cbd5e1; background: #fff; color: #334155; }
button.ghost:hover, .button.ghost:hover { border-color: #94a3b8; background: #f8fafc; }
.muted { font-size: 12.5px; }
.alert { padding: 9px 11px; margin: 9px 0; border-radius: 7px; }
.main-menu { margin-bottom: 12px; padding: 5px; border-radius: 9px; }
.main-menu a { padding: 7px 10px; border-radius: 6px; font-size: 13.5px; }

.workflow-nav {
    top: 6px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 12px;
    padding: 5px;
    border-radius: 10px;
}
.workflow-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 5px;
    border-radius: 6px;
    font-size: 12.5px;
}
.workflow-nav a span {
    display: inline-grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 11px;
}

.workflow-guide { border-color: #c7d2fe; background: linear-gradient(135deg, #fff 0%, #f8faff 100%); }
.workflow-guide-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.workflow-guide-heading h2 { margin: 1px 0 0; }
.eyebrow { color: #4f46e5; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.workflow-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.workflow-summary span { padding: 5px 8px; border: 1px solid #dbeafe; border-radius: 999px; background: #fff; color: #475569; font-size: 11.5px; white-space: nowrap; }
.workflow-summary strong { color: #312e81; }
.workflow-guide-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 7px; margin: 0; padding: 0; list-style: none; counter-reset: workflow; }
.workflow-guide-steps li { position: relative; min-height: 88px; padding: 10px 9px 9px 36px; border: 1px solid #e0e7ff; border-radius: 8px; background: rgba(255,255,255,.88); counter-increment: workflow; }
.workflow-guide-steps li::before { content: counter(workflow); position: absolute; top: 9px; left: 9px; display: grid; width: 20px; height: 20px; place-items: center; border-radius: 999px; background: #4f46e5; color: #fff; font-size: 11px; font-weight: 800; }
.workflow-guide-steps strong, .workflow-guide-steps span { display: block; }
.workflow-guide-steps strong { margin-bottom: 4px; color: #1e293b; font-size: 12.5px; }
.workflow-guide-steps span { color: #64748b; font-size: 11.5px; line-height: 1.35; }

.section-title-row { display: flex; align-items: flex-start; gap: 10px; }
.section-title-row h2, .section-title-row h3 { margin: 0 0 2px; }
.section-title-row p { margin: 0; color: #64748b; font-size: 12.5px; }
.section-title-row .current-scan-source { margin-top: 2px; font-size: 11px; overflow-wrap: anywhere; }
.current-scan-source a { color: #4f46e5; }
.section-title-row.compact-title { align-items: center; }
.step-number { display: inline-grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 8px; background: #4f46e5; color: #fff; font-size: 13px; font-weight: 850; }
.scan-note, .selection-help { margin-top: 9px; padding: 8px 10px; border-left: 3px solid #60a5fa; border-radius: 5px; background: #eff6ff; color: #475569; font-size: 12.5px; }
.scan-load-metric { display: inline-flex; align-items: center; margin: 4px 0 0 6px; padding: 3px 8px; border: 1px solid #86efac; border-radius: 999px; background: #dcfce7; color: #166534; font-size: 12px; font-weight: 700; white-space: nowrap; }
.scan-load-metric[hidden] { display: none; }
.scan-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}
.scan-progress span {
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 11.5px;
}
.scan-continuation {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    padding: 10px;
    border: 1px solid var(--brand-border);
    border-radius: 8px;
    background: var(--brand-soft);
}
.scan-continuation span { color: var(--muted); font-size: 12px; }
.product-result-pagination { margin: 12px 0; }
.supported-sources { gap: 5px; margin: 8px 0 6px; }
.supported-sources span, .source-badge { padding: 3px 6px; font-size: 10.5px; }

.product-filter-form { display: grid; grid-template-columns: 155px 175px 155px minmax(260px, 1fr) 105px 105px auto auto; align-items: end; gap: 7px; margin: 12px 0; }
.product-filter-form .filter-field { width: auto; margin: 0; }
.product-filter-form .filter-search { min-width: 0; }
.product-filter-form .filter-price { min-width: 0; }
.product-selection-toolbar {
    position: sticky;
    top: 54px;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0;
    padding: 8px;
    border: 1px solid #a5b4fc;
    border-radius: 9px;
    background: rgba(238,242,255,.96);
    box-shadow: 0 5px 16px rgba(15,23,42,.08);
    backdrop-filter: blur(8px);
}
.selection-actions, .selection-submit { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.selection-submit { justify-content: flex-end; }
.selected-counter { padding: 6px 9px; border-radius: 7px; background: #fff; color: #475569; font-size: 12.5px; white-space: nowrap; }
.selected-counter strong { color: #312e81; font-size: 15px; }

.product-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; align-items: start; }
.product-item { grid-template-columns: 21px 68px minmax(0, 1fr); align-self: start; gap: 8px; padding: 9px; border-radius: 9px; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.product-item.is-selected { border-color: #6366f1; background: #f7f7ff; box-shadow: 0 0 0 1px rgba(99,102,241,.12); }
.product-item.is-prepared { border-color: #86efac; background: #f0fdf4; }
.product-thumb, .product-thumb-placeholder { width: 68px; height: 68px; border-radius: 7px; }
.product-state-line { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.product-state-line .status-badge { min-height: 21px; padding: 2px 6px; font-size: 9.5px; }
.product-name { display: block; overflow: visible; font-size: 13px; line-height: 1.24; -webkit-line-clamp: unset; }
.product-meta { grid-column: 2 / -1; gap: 2px 7px; margin-top: 1px; font-size: 11.5px; line-height: 1.32; }
.product-meta dt { white-space: nowrap; }
.product-wide { grid-column: 2 / -1; }
.link-danger { min-height: 24px; margin-top: 4px; font-size: 11px; }

.prepared-list { gap: 12px; margin-top: 12px; }
.prepared-card { padding: 12px; border-radius: 10px; }
.prepared-topline { gap: 6px; margin-bottom: 9px; }
.prepared-heading { grid-template-columns: 68px minmax(0, 1fr); gap: 9px; margin-bottom: 12px; }
.export-choice { gap: 5px; padding: 5px 7px; border-radius: 7px; font-size: 12px; }
.status-badge { min-height: 25px; padding: 3px 7px; font-size: 11px; }
.gallery-section { margin-bottom: 12px; padding: 10px; border-radius: 9px; }
.gallery-grid { grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 7px; }
.gallery-item-footer { gap: 4px; padding: 6px; }
.workflow-box { margin: 12px 0 14px; padding: 11px; border-radius: 9px; }
.workflow-box-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.workflow-box-heading h3 { display: inline; margin-left: 6px; }
.workflow-box-heading p { margin: 0; color: #64748b; font-size: 12px; }
.optional-badge { display: inline-flex; padding: 2px 6px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.workflow-steps { margin: 9px 0 11px; gap: 6px; }
.workflow-steps span { padding: 7px; font-size: 11.5px; }
.workflow-steps b { display: inline-grid; width: 18px; height: 18px; margin-right: 4px; place-items: center; border-radius: 999px; background: #e0e7ff; color: #4338ca; font-size: 10px; }
.next-step-box { margin-top: 14px; padding: 12px; border-radius: 9px; }
.compact-instructions { margin: 9px 0 12px; padding-left: 22px; color: #475569; font-size: 12.5px; }
.compact-instructions li { margin: 3px 0; }

.working-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(15,23,42,.48); backdrop-filter: blur(3px); }
.working-overlay[hidden] { display: none; }
.working-overlay > div { display: grid; justify-items: center; gap: 8px; width: min(390px, 100%); padding: 24px; border-radius: 12px; background: #fff; box-shadow: 0 20px 60px rgba(15,23,42,.28); text-align: center; }
.working-overlay small { color: #64748b; }
.working-spinner { width: 28px; height: 28px; border: 3px solid #c7d2fe; border-top-color: #4f46e5; border-radius: 999px; animation: working-spin .8s linear infinite; }
@keyframes working-spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
    .workflow-guide-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .product-filter-form { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .product-filter-form .filter-search { grid-column: span 2; }
}

@media (max-width: 800px) {
    .workflow-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .workflow-guide-heading, .workflow-box-heading { display: grid; }
    .workflow-summary { justify-content: flex-start; }
    .workflow-guide-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-selection-toolbar { position: static; display: grid; }
    .selection-submit { justify-content: space-between; }
}

@media (max-width: 640px) {
    :root { font-size: 14px; }
    .container { padding: 10px 9px 40px; }
    .card { padding: 11px; }
    .workflow-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .workflow-guide-steps { grid-template-columns: 1fr; }
    .workflow-guide-steps li { min-height: auto; }
    .product-filter-form { grid-template-columns: 1fr 1fr; }
    .product-filter-form label, .product-filter-form .filter-search { grid-column: 1 / -1; }
    .product-filter-form .filter-price { grid-column: auto; }
    .product-filter-form button, .product-filter-form .button { width: 100%; }
    .selection-actions, .selection-submit { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .selection-submit .selected-counter { grid-column: 1 / -1; }
    .selection-submit button { grid-column: 1 / -1; width: 100%; }
    .product-list { grid-template-columns: 1fr; }
    .product-item { grid-template-columns: 21px 64px minmax(0, 1fr); }
    .product-thumb, .product-thumb-placeholder { width: 64px; height: 64px; }
    .prepared-heading { grid-template-columns: 64px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .working-spinner { animation-duration: 1.8s; }
}

/* v0.4.10 - producenci, kategorie Shopera i kontrola jakości zdjęć */
.producer-directory { margin-top: 10px; padding: 9px 10px; border: 1px solid #dbe3ef; border-radius: 8px; background: #f8fafc; }
.producer-directory summary { cursor: pointer; color: #334155; font-weight: 750; }
.producer-directory > label { display: block; max-width: 420px; margin-top: 9px; }
.producer-directory-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 5px; max-height: 260px; margin-top: 8px; overflow: auto; }
.producer-directory-list > span { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; }
.producer-directory-list small { color: #64748b; white-space: nowrap; }
.image-warnings { margin: 8px 0; padding: 7px 9px; border: 1px solid #fde68a; border-radius: 7px; background: #fffbeb; color: #854d0e; font-size: 11.5px; }
.image-warnings summary { cursor: pointer; font-weight: 750; }
.image-warnings ul { margin: 7px 0 0; padding-left: 19px; }
.image-properties { display: grid; grid-column: 1 / -1; gap: 2px; padding-bottom: 3px; color: #475569; font-size: 10.5px; font-weight: 700; line-height: 1.25; text-align: center; }
.new-category-toggle { margin-top: 8px; }
.new-main-category { margin-top: 7px; padding: 9px; border: 1px dashed #93c5fd; border-radius: 7px; background: #eff6ff; }
.category-editor select { width: 100%; }

/* v0.4.11 - zwarte i wyraźnie rozdzielone karty przygotowanych produktów */
.prepared-card {
    position: relative;
    border-width: 2px 2px 2px 6px;
    box-shadow: 0 7px 22px rgba(15, 23, 42, .08);
}
.prepared-card:nth-child(odd) { border-color: #4ade80; background: #f0fdf4; }
.prepared-card:nth-child(even) { border-color: #60a5fa; background: #eff6ff; }
.prepared-card .prepared-topline {
    margin: -12px -12px 10px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(100, 116, 139, .2);
    border-radius: 8px 8px 0 0;
}
.prepared-card:nth-child(odd) .prepared-topline { background: #dcfce7; }
.prepared-card:nth-child(even) .prepared-topline { background: #dbeafe; }
.prepared-card .prepared-form-grid { gap: 8px 10px; }
.pricing-rule {
    margin-top: 4px;
    color: #475569;
    font-size: 11px;
    line-height: 1.3;
}
.pricing-rule button {
    min-height: 0;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: #4338ca;
    font-size: inherit;
    text-decoration: underline;
}
.compact-editor {
    overflow: hidden;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: rgba(255, 255, 255, .8);
}
.compact-editor > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    color: #1e293b;
    font-size: 12.5px;
    font-weight: 800;
}
.compact-editor > summary span { color: #64748b; font-size: 11px; font-weight: 500; text-align: right; }
.compact-editor[open] > summary { border-bottom: 1px solid #dbe3ef; background: #f8fafc; }
.compact-editor-body { padding: 9px; }
.description-fields { display: grid; gap: 9px; }
.book-profile-box { padding: 0; background: rgba(239, 246, 255, .82); }
.book-profile-box .prepared-form-grid { margin-top: 8px; }

@media (min-width: 801px) {
    .prepared-card input:not([type="checkbox"]):not([type="radio"]),
    .prepared-card select { min-height: 30px; padding: 5px 7px; font-size: 12.5px; }
    .prepared-card textarea { padding: 6px 7px; font-size: 12.5px; line-height: 1.3; }
    .prepared-card label { margin-bottom: 2px; font-size: 11.5px; }
}

@media (max-width: 640px) {
    .producer-directory-list { grid-template-columns: 1fr; }
}

/* v0.5.0 - zwarty punkt 3, edycja zbiorcza, kalkulator cen i branding */
.app-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
    width: 54px;
    height: 66px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 9px rgba(127, 29, 29, .12);
}
.app-brand h1 { margin-bottom: 1px; }

.prepared-workbench {
    display: grid;
    gap: 9px;
    margin: 12px 0;
}
.prepared-filter-bar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(190px, .55fr) auto;
    align-items: end;
    gap: 8px;
    padding: 10px;
    border: 1px solid #c7d2fe;
    border-radius: 9px;
    background: #f8faff;
}
.prepared-filter-bar label { margin: 0; }
.prepared-filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.bulk-editor {
    overflow: hidden;
    border: 1px solid #a5b4fc;
    border-radius: 9px;
    background: #eef2ff;
}
.bulk-editor > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    cursor: pointer;
    color: #312e81;
    font-weight: 800;
}
.bulk-editor[open] > summary { border-bottom: 1px solid #c7d2fe; }
.bulk-editor-body { padding: 10px; }
.bulk-groups { display: grid; grid-template-columns: 1.1fr 1.5fr .65fr; gap: 8px; }
.bulk-groups fieldset {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
    margin: 0;
    padding: 9px;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    background: rgba(255, 255, 255, .82);
}
.bulk-groups legend { padding: 0 5px; color: #312e81; font-size: 12px; font-weight: 850; }
.bulk-groups .inline-check { margin: 0; }
.bulk-groups button { align-self: end; margin-top: 2px; }

.prepared-card { transition: box-shadow .16s ease, border-color .16s ease; }
.prepared-card[hidden] { display: none; }
.prepared-card:not(.is-open) { padding-bottom: 8px; box-shadow: 0 3px 10px rgba(15, 23, 42, .055); }
.prepared-card:not(.is-open) .prepared-card-body { display: none; }
.prepared-card:not(.is-open) .prepared-heading { margin-bottom: 0; }
.prepared-card.is-open { box-shadow: 0 11px 30px rgba(15, 23, 42, .13); }
.prepared-card.is-open > .prepared-card-header {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: -12px -12px 12px;
    padding: 0 12px 1px;
    border-bottom: 1px solid var(--state-neutral-border);
    border-radius: 9px 9px 0 0;
    background: #fff;
    box-shadow: 0 7px 16px rgba(15, 23, 42, .12);
}
.prepared-card.is-open > .prepared-card-header .prepared-topline { margin: 0 -12px 8px; }
.prepared-card.is-open > .prepared-card-header .prepared-heading { margin-bottom: 8px; }
.prepared-toggle { margin-left: auto; }
.prepared-editor-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0 0 7px;
    padding: 5px;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    background: var(--brand-soft);
}
.prepared-editor-nav a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 27px;
    padding: 3px 7px;
    border-radius: 7px;
    color: var(--brand-dark);
    font-size: 11.5px;
    font-weight: 750;
    text-decoration: none;
}
.prepared-editor-nav a:hover { background: #fff; }
.prepared-editor-nav b,
.prepared-flow-heading > span,
.prepared-flow-title > span {
    display: inline-grid;
    flex: 0 0 auto;
    width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    line-height: 1;
}
.editor-step {
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--brand-border);
    border-radius: 9px;
    background: #fff;
    scroll-margin-top: 170px;
}
.editor-step-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 39px;
    padding: 7px 9px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(90deg, var(--brand-soft), rgba(255,255,255,.92));
}
.editor-step-summary::-webkit-details-marker { display: none; }
.editor-step-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.editor-step-title > b,
.editor-step-title > span:first-child {
    display: inline-grid;
    flex: 0 0 auto;
    width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    line-height: 1;
}
.editor-step-title strong { display: block; color: var(--brand-dark); font-size: 12.5px; }
.editor-step-title small { display: block; margin-top: 1px; color: var(--state-neutral-text); font-size: 10.5px; font-weight: 500; }
.editor-step-toggle { color: var(--brand-dark); font-size: 10.5px; font-weight: 800; white-space: nowrap; }
.editor-step[open] > .editor-step-summary { border-bottom: 1px solid var(--brand-border); }
.editor-step[open] > .editor-step-summary .editor-step-toggle { font-size: 0; }
.editor-step[open] > .editor-step-summary .editor-step-toggle::after { content: "Zwiń"; font-size: 10.5px; }
.editor-step-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 9px;
}
.editor-step-body > .full { grid-column: 1 / -1; }
.prepared-flow-images { padding: 0; }
.prepared-flow-images > .editor-step-body,
.prepared-review-step > .editor-step-body { display: block; }
.prepared-review-step .alert:first-child { margin-top: 0; }
.category-advanced { margin-top: 2px; }
.prepared-flow-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 7px 0 2px;
    padding: 9px 10px;
    border-top: 1px solid var(--brand-border);
    border-bottom: 1px solid var(--brand-border);
    background: linear-gradient(90deg, var(--brand-soft), transparent);
    scroll-margin-top: 170px;
}
.prepared-flow-heading strong { display: block; color: var(--brand-dark); font-size: 14px; }
.prepared-flow-heading small { display: block; margin-top: 1px; color: var(--state-neutral-text); font-size: 11.5px; }
.prepared-flow-title { display: flex; align-items: center; gap: 9px; scroll-margin-top: 170px; }
.prepared-flow-title h3 { margin: 0; }
.prepared-flow-images { scroll-margin-top: 170px; }
.prepared-review-heading { margin-top: 13px; }
.processing-prepared-edit-form > .gallery-section { margin-top: 10px; }
.processing-prepared-edit-form > .media-comparison-grid { margin-top: 10px; }
.producer-field { grid-column: 1 / -1; }
.bulk-choice { border-color: #a5b4fc; background: #eef2ff; }
.status-issues { background: #fee2e2; color: #991b1b; }
.status-ready, .status-review-ready, .status-approved { background: #dcfce7; color: #166534; }
.status-review-hold { background: #f1f5f9; color: #475569; }
.status-review-in_review, .status-review { background: #fef3c7; color: #92400e; }
.status-missing { background: #fee2e2; color: #991b1b; }
.status-package { background: #e0e7ff; color: #3730a3; }
.status-variant { background: #ffedd5; color: #9a3412; }
.quality-summary { margin-top: 0; }

.prepared-core-fields {
    display: grid;
    gap: 6px;
}
.prepared-core-fields-row {
    display: grid;
    grid-template-columns: minmax(185px, 1.45fr) minmax(160px, 1.18fr) minmax(92px, .62fr) minmax(82px, .48fr) minmax(82px, .48fr);
    gap: 6px;
    align-items: start;
}
.prepared-core-fields-row > div { min-width: 0; }
.prepared-core-fields-row label { white-space: nowrap; }
.prepared-core-fields-row .pricing-target-field input,
.prepared-core-fields-row .vat-rate-field input,
.prepared-core-fields-row .priority-field input { text-align: right; }
.prepared-core-fields-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 11px;
    min-height: 24px;
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--state-neutral-bg);
    color: var(--state-neutral-text);
    font-size: 10.75px;
    line-height: 1.25;
}
.prepared-core-fields-meta .identity-check-hint,
.prepared-core-fields-meta .pricing-rule { min-height: 0; margin: 0; color: inherit; font-size: inherit; }
.prepared-core-fields-meta .core-export-note { margin-left: auto; font-weight: 750; white-space: nowrap; }
.prepared-core-fields-meta .manual-price-note { margin-left: 2px; }
.prepared-core-fields .ean-omitted-note { margin-top: 3px; font-size: 10px; line-height: 1.2; }
.price-calculator-controls {
    overflow: hidden;
    padding: 0;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    background: rgba(238, 242, 255, .74);
    scroll-margin-top: 170px;
}
.price-calculator-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 7px 9px;
    cursor: pointer;
    list-style: none;
}
.price-calculator-heading::-webkit-details-marker { display: none; }
.price-calculator-heading::after {
    content: "Rozwiń";
    color: var(--brand-dark);
    font-size: 10.5px;
    font-weight: 800;
}
.price-calculator-controls[open] .price-calculator-heading::after { content: "Zwiń"; }
.price-calculator-heading > span:last-of-type { color: #475569; font-size: 11.5px; white-space: nowrap; }
.price-calculator-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.price-calculator-title > b {
    display: inline-grid;
    flex: 0 0 auto;
    width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
}
.price-calculator-title strong { display: block; color: var(--brand-dark); font-size: 12px; }
.price-calculator-title small { display: block; color: var(--state-neutral-text); font-size: 10.5px; font-weight: 500; }
.price-calculator-body { padding: 0 9px 9px; border-top: 1px solid rgba(158, 38, 41, .14); }
.price-calculator-grid {
    display: grid;
    grid-template-columns: .7fr .7fr 1.2fr .7fr .8fr auto;
    align-items: end;
    gap: 6px;
    padding-top: 8px;
}
.price-calculator-grid label { margin: 0; }
.manual-price-note { display: inline-block; margin-left: 5px; color: #b45309; }
.option-search { margin-bottom: 5px; }
.additional-category-select { min-height: 110px; }
.additional-category-heading { margin-bottom: 5px; }
.additional-category-heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; }
.category-inheritance-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; }
.category-is-inherited {
    padding: 10px;
    border: 1px solid var(--state-neutral-border);
    border-radius: 9px;
    background: var(--state-neutral-bg);
}
.category-is-inherited .inherited-category-control,
.category-is-inherited select:disabled,
.category-is-inherited textarea:disabled,
.category-is-inherited input:disabled { opacity: .58; cursor: not-allowed; }
.inherited-category-check { color: var(--state-neutral-text); font-weight: 750; }
.additional-category-count {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 9px;
    border: 1px solid var(--state-neutral-border);
    border-radius: 999px;
    background: var(--state-neutral-bg);
    color: var(--state-neutral-text);
    font-size: 11.5px;
    font-weight: 800;
    white-space: nowrap;
}
.additional-category-select option[data-clear-selection="1"] { font-weight: 800; }
.custom-additional-label { margin-top: 7px; }
.identity-name-field label { font-size: 13px; font-weight: 900; color: var(--text); }
.identity-name-field input { min-height: 36px; border-width: 2px; font-size: 14px; font-weight: 800; }
.target-name-picker { position: relative; }
.target-name-picker > input { padding-right: 68px; }
.target-name-picker-toggle {
    position: absolute;
    top: 4px;
    right: 4px;
    gap: 5px;
    min-width: 54px;
    min-height: 28px;
    padding: 3px 8px;
    border: 1px solid var(--brand-border);
    border-radius: 7px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 11px;
}
.target-name-picker-toggle:hover,
.target-name-picker-toggle[aria-expanded="true"] { background: var(--brand-muted); color: var(--brand-dark); }
.target-name-picker-toggle span { font-size: 13px; line-height: 1; }
.target-name-options {
    position: absolute;
    z-index: 80;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    max-height: 250px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid var(--brand-border);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(31, 41, 55, .18);
}
.target-name-option {
    display: block;
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border-radius: 6px;
    background: transparent;
    color: #1f2937;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.3;
    text-align: left;
}
.target-name-option:hover,
.target-name-option:focus-visible { background: var(--brand-soft); color: var(--brand-dark); }
.target-name-option[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--brand); background: var(--brand-soft); }
.prepared-core-fields-row input { min-height: 34px; padding-block: 5px; }
.prepared-core-fields-row label { margin-bottom: 3px; font-size: 10.5px; }
.seo-title-combobox-field { display: grid; gap: 5px; }
.seo-title-combobox { min-height: 42px; font-weight: 750; }

@media (max-width: 1100px) {
    .bulk-groups { grid-template-columns: 1fr 1fr; }
    .bulk-groups fieldset:last-child { grid-column: 1 / -1; }
    .prepared-core-fields-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .prepared-core-fields-row .identity-code-field,
    .prepared-core-fields-row .identity-ean-field { grid-column: span 3; }
    .prepared-core-fields-row .pricing-target-field,
    .prepared-core-fields-row .vat-rate-field,
    .prepared-core-fields-row .priority-field { grid-column: span 2; }
    .price-calculator-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
    .prepared-filter-bar { grid-template-columns: 1fr 1fr; }
    .prepared-filter-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .bulk-groups { grid-template-columns: 1fr; }
    .bulk-groups fieldset:last-child { grid-column: auto; }
}

@media (max-width: 640px) {
    .brand-logo { width: 45px; height: 55px; }
    .prepared-filter-bar { grid-template-columns: 1fr; }
    .prepared-filter-actions { grid-column: auto; display: grid; grid-template-columns: 1fr 1fr; }
    .prepared-filter-actions .selected-counter { grid-column: 1 / -1; }
    .prepared-core-fields-row { grid-template-columns: 1fr 1fr; }
    .prepared-core-fields-row .identity-code-field,
    .prepared-core-fields-row .identity-ean-field,
    .prepared-core-fields-row .pricing-target-field,
    .prepared-core-fields-row .vat-rate-field,
    .prepared-core-fields-row .priority-field { grid-column: auto; }
    .prepared-core-fields-row .identity-code-field,
    .prepared-core-fields-row .identity-ean-field { grid-column: 1 / -1; }
    .prepared-core-fields-meta { display: grid; }
    .prepared-core-fields-meta .core-export-note { margin-left: 0; white-space: normal; }
    .price-calculator-heading { grid-template-columns: minmax(0, 1fr) auto; }
    .price-calculator-heading > span:last-of-type { display: none; }
    .price-calculator-grid { grid-template-columns: 1fr 1fr; }
    .price-calculator-grid button { grid-column: 1 / -1; width: 100%; }
    .prepared-editor-nav { display: grid; grid-template-columns: 1fr 1fr; }
    .prepared-editor-nav a { background: rgba(255,255,255,.58); }
}

/* v0.5.1 - firmowy PMS 704 C oraz zapamiętywany tryb dzienny/nocny */
body {
    background: linear-gradient(180deg, #fcf8f8 0, #f5f6f8 210px);
    color: #1f2937;
}
header {
    padding: 8px 10px;
    border-bottom: 3px solid var(--brand);
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(158, 38, 41, .07), rgba(255, 255, 255, .82) 40%, rgba(255, 255, 255, .3));
}
.app-brand h1 { color: var(--brand-dark); }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.header-actions form { margin: 0; }
.theme-toggle { gap: 6px; white-space: nowrap; }
.theme-toggle [data-theme-icon] { display: inline-grid; width: 18px; place-items: center; font-size: 16px; line-height: 1; }

button:not(.secondary):not(.danger):not(.ghost),
.button:not(.secondary):not(.danger):not(.ghost) { background: var(--brand); }
button:not(.secondary):not(.danger):not(.ghost):hover,
.button:not(.secondary):not(.danger):not(.ghost):hover { background: var(--brand-hover); }
button:focus-visible, .button:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
    outline: 3px solid var(--brand-ring);
    outline-offset: 2px;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
.product-name, .current-scan-source a, .pricing-rule button { color: var(--brand); }
.main-menu a.active { background: var(--brand); }
.main-menu a:not(.active):hover { background: var(--brand-soft); color: var(--brand-dark); }
.workflow-nav { border-color: var(--brand-border); }
.workflow-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.workflow-nav a span { background: var(--brand-soft); color: var(--brand); }
.workflow-guide { border-color: var(--brand-border); background: linear-gradient(135deg, #fff 0%, var(--brand-soft) 100%); }
.workflow-guide-steps li { border-color: var(--brand-muted); }
.workflow-guide-steps li::before, .step-number { background: var(--brand); }
.eyebrow, .workflow-summary strong, .selected-counter strong { color: var(--brand); }
.product-selection-toolbar, .prepared-filter-bar {
    border-color: var(--brand-border);
    background: rgba(251, 241, 242, .96);
}
.product-item.is-selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand-ring); }
.bulk-editor { border-color: var(--brand-border); background: var(--brand-soft); }
.bulk-editor > summary, .bulk-groups legend { color: var(--brand-dark); }
.bulk-editor[open] > summary, .bulk-groups fieldset { border-color: var(--brand-border); }
.bulk-choice { border-color: var(--brand-border); background: var(--brand-soft); }
.price-calculator-controls { border-color: var(--brand-border); background: rgba(251, 241, 242, .78); }
.prepared-card.is-open {
    border-left-color: var(--brand);
    box-shadow: 0 11px 30px rgba(101, 23, 25, .18), 0 0 0 2px var(--brand-ring);
}
.working-spinner { border-color: var(--brand-muted); border-top-color: var(--brand); }
.category-row:hover, .category-row.active, .category-choice:has(input:checked) { background: var(--brand-soft); color: var(--brand-dark); }
.manual-operation-box { border-color: var(--brand-border); background: rgba(251, 241, 242, .96); }
.stats-grid strong, .stats-inline strong { color: var(--brand); }

html[data-theme="dark"] {
    color-scheme: dark;
    --brand: #bd4a4e;
    --brand-main: var(--brand);
    --brand-hover: #cf5c60;
    --brand-dark: #f1b2b5;
    --brand-soft: #321d20;
    --brand-muted: #4c292d;
    --brand-border: #714247;
    --brand-ring: rgba(213, 98, 103, .3);
    --surface: #1c2126;
    --surface-soft: #171b20;
    --border: #39434d;
    --text: #e6ebf0;
    --muted: #aab4be;
    --accent: var(--brand);
    --success: #7fd5a0;
    --warning: #f0c66b;
    --danger: #f08f95;
    background: #101316;
    color: #e6ebf0;
}
html[data-theme="dark"] body { background: linear-gradient(180deg, #1c1416 0, #101316 230px); color: #e6ebf0; }
html[data-theme="dark"] header {
    border-bottom-color: #bd4a4e;
    background: linear-gradient(90deg, rgba(158, 38, 41, .3), rgba(28, 32, 36, .95) 45%, rgba(28, 32, 36, .6));
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .main-menu,
html[data-theme="dark"] .workflow-nav,
html[data-theme="dark"] .product-item,
html[data-theme="dark"] .api-product-card,
html[data-theme="dark"] .subcard,
html[data-theme="dark"] .batch-card,
html[data-theme="dark"] .job-item,
html[data-theme="dark"] .job-history-row,
html[data-theme="dark"] .media-comparison-grid article,
html[data-theme="dark"] .compact-editor,
html[data-theme="dark"] .editor-step,
html[data-theme="dark"] .bulk-groups fieldset,
html[data-theme="dark"] .producer-directory-list > span,
html[data-theme="dark"] .selected-counter,
html[data-theme="dark"] .export-choice,
html[data-theme="dark"] .gallery-item,
html[data-theme="dark"] .working-overlay > div {
    border-color: #39434d;
    background: #1c2126;
    color: #e6ebf0;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    border-color: #46515c;
    background: #13171b;
    color: #edf1f5;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #7f8a95; }
html[data-theme="dark"] .target-name-options { border-color: #46515c; background: #1c2126; box-shadow: 0 12px 28px rgba(0, 0, 0, .42); }
html[data-theme="dark"] .target-name-option { color: #edf1f5; }
html[data-theme="dark"] .target-name-option:hover,
html[data-theme="dark"] .target-name-option:focus-visible,
html[data-theme="dark"] .target-name-option[aria-selected="true"] { background: var(--brand-soft); color: #f1d0d2; }
html[data-theme="dark"] button.secondary,
html[data-theme="dark"] .button.secondary { background: #3d4751; color: #fff; }
html[data-theme="dark"] button.secondary:hover,
html[data-theme="dark"] .button.secondary:hover { background: #4a5661; }
html[data-theme="dark"] button.ghost,
html[data-theme="dark"] .button.ghost { border-color: #4a5661; background: #20262c; color: #d9e0e6; }
html[data-theme="dark"] button.ghost:hover,
html[data-theme="dark"] .button.ghost:hover { border-color: var(--brand); background: var(--brand-soft); color: #fff; }
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] .compact-editor > summary,
html[data-theme="dark"] .editor-step-summary,
html[data-theme="dark"] .workflow-guide-steps strong { color: #f1f4f7; }
html[data-theme="dark"] .app-brand h1,
html[data-theme="dark"] .product-name,
html[data-theme="dark"] .current-scan-source a,
html[data-theme="dark"] .pricing-rule button,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .workflow-summary strong,
html[data-theme="dark"] .selected-counter strong,
html[data-theme="dark"] .stats-grid strong,
html[data-theme="dark"] .stats-inline strong { color: #e58b8f; }
html[data-theme="dark"] .muted,
html[data-theme="dark"] .product-meta dt,
html[data-theme="dark"] .pricing-rule,
html[data-theme="dark"] .price-calculator-heading span,
html[data-theme="dark"] .compact-editor > summary span,
html[data-theme="dark"] .editor-step-title small,
html[data-theme="dark"] .workflow-guide-steps span,
html[data-theme="dark"] .section-title-row p,
html[data-theme="dark"] .workflow-box-heading p,
html[data-theme="dark"] .category-line,
html[data-theme="dark"] .category-line span,
html[data-theme="dark"] .image-properties,
html[data-theme="dark"] .gallery-item-footer,
html[data-theme="dark"] .producer-directory summary,
html[data-theme="dark"] .producer-directory-list small,
html[data-theme="dark"] .diff-grid small,
html[data-theme="dark"] .diff-grid span,
html[data-theme="dark"] .job-history-row,
html[data-theme="dark"] .job-history-row small,
html[data-theme="dark"] button.media-preview-button { color: #aab4be; }
html[data-theme="dark"] code { background: #2b3239; color: #f0c4c6; }
html[data-theme="dark"] .package-download-status.success-text { color: #86efac; }
html[data-theme="dark"] .package-download-status.error-text { color: #fca5a5; }
html[data-theme="dark"] .main-menu a,
html[data-theme="dark"] .workflow-nav a,
html[data-theme="dark"] .category-row { color: #d7dee5; }
html[data-theme="dark"] .main-menu a.active { background: #9e2629; color: #fff; }
html[data-theme="dark"] .workflow-guide,
html[data-theme="dark"] .prepared-filter-bar,
html[data-theme="dark"] .product-selection-toolbar,
html[data-theme="dark"] .manual-operation-box,
html[data-theme="dark"] .media-report,
html[data-theme="dark"] .bulk-editor,
html[data-theme="dark"] .price-calculator-controls,
html[data-theme="dark"] .workflow-box {
    border-color: var(--brand-border);
    background: rgba(50, 29, 32, .92);
    color: #e6ebf0;
}
html[data-theme="dark"] .next-step-box,
html[data-theme="dark"] .confirm-operation {
    border-color: #425d73;
    background: #182631;
    color: #c6d7e5;
}
html[data-theme="dark"] .workflow-guide-steps li,
html[data-theme="dark"] .workflow-steps span,
html[data-theme="dark"] .workflow-summary span {
    border-color: #4c3538;
    background: rgba(28, 33, 38, .9);
    color: #d5dce3;
}
html[data-theme="dark"] .scan-note,
html[data-theme="dark"] .selection-help,
html[data-theme="dark"] .new-main-category,
html[data-theme="dark"] .book-profile-box { border-color: #425d73; background: #182631; color: #c6d7e5; }
html[data-theme="dark"] .scan-load-metric { border-color: #237a4b; background: #153725; color: #86efac; }
html[data-theme="dark"] .stats-grid > div,
html[data-theme="dark"] .diff-grid > div,
html[data-theme="dark"] .producer-directory,
html[data-theme="dark"] .category-browser,
html[data-theme="dark"] .gallery-section { border-color: #39434d; background: #171b20; }
html[data-theme="dark"] .media-report span { background: #242a30; color: #d3dae1; }
html[data-theme="dark"] .diff-grid > div { background: #22282e; }
html[data-theme="dark"] .diff-grid > div:last-child { background: #1b3122; }
html[data-theme="dark"] .job-history-row:hover { border-color: var(--brand-border); background: var(--brand-soft); }
html[data-theme="dark"] .category-row { border-bottom-color: #303840; }
html[data-theme="dark"] .category-row:hover,
html[data-theme="dark"] .category-row.active,
html[data-theme="dark"] .category-choice:has(input:checked) { background: var(--brand-soft); color: #f0c4c6; }
html[data-theme="dark"] .product-item.is-selected { border-color: #bd4a4e; background: #321d20; }
html[data-theme="dark"] .product-item.is-prepared { border-color: #34784d; background: #18291f; }
html[data-theme="dark"] .prepared-card:nth-child(odd) { border-color: #34784d; background: #18291f; }
html[data-theme="dark"] .prepared-card:nth-child(even) { border-color: #356a96; background: #172632; }
html[data-theme="dark"] .prepared-card:nth-child(odd) .prepared-topline { background: #203a29; }
html[data-theme="dark"] .prepared-card:nth-child(even) .prepared-topline { background: #20374a; }
html[data-theme="dark"] .prepared-card.is-open { border-left-color: #bd4a4e; box-shadow: 0 11px 30px rgba(0, 0, 0, .35), 0 0 0 2px var(--brand-ring); }
html[data-theme="dark"] .compact-editor[open] > summary { border-bottom-color: #39434d; background: #252b31; }
html[data-theme="dark"] .alert.info { background: #183043; color: #a9d6f5; }
html[data-theme="dark"] .alert.success { background: #183522; color: #9bddad; }
html[data-theme="dark"] .alert.error { background: #3b1d20; color: #f2adb1; }
html[data-theme="dark"] .status-badge { background: #323a42; color: #dce3e9; }
html[data-theme="dark"] .status-generated,
html[data-theme="dark"] .status-ready,
html[data-theme="dark"] .status-review-ready,
html[data-theme="dark"] .status-approved { background: #21442c; color: #a9e3b9; }
html[data-theme="dark"] .status-manual,
html[data-theme="dark"] .status-review-in_review,
html[data-theme="dark"] .status-review { background: #48391d; color: #f3d48a; }
html[data-theme="dark"] .status-source,
html[data-theme="dark"] .status-package { background: #20364b; color: #acd2f4; }
html[data-theme="dark"] .status-issues,
html[data-theme="dark"] .status-missing { background: #4a2024; color: #f4b4b8; }
html[data-theme="dark"] .status-review-hold { background: #323a42; color: #c7d0d8; }
html[data-theme="dark"] .status-variant { background: #4a2d1d; color: #f0bd93; }
html[data-theme="dark"] .status-applied,
html[data-theme="dark"] .status-rolled_back { background: #21442c; color: #a9e3b9; }
html[data-theme="dark"] .status-partial,
html[data-theme="dark"] .status-rollback_partial { background: #48391d; color: #f3d48a; }
html[data-theme="dark"] .status-failed { background: #4a2024; color: #f4b4b8; }
html[data-theme="dark"] .image-warnings { border-color: #765d25; background: #3a301a; color: #f0d28a; }
html[data-theme="dark"] .working-overlay { background: rgba(5, 7, 9, .7); }
html[data-theme="dark"] .brand-logo { box-shadow: 0 2px 12px rgba(0, 0, 0, .4); }

@media (max-width: 640px) {
    header { align-items: flex-start; }
    .header-actions { display: grid; justify-items: stretch; }
    .header-actions button { width: 100%; }
    .theme-toggle [data-theme-label] { display: none; }
}

/* v0.5.3 - wspólny rytm formularzy, odstępów i elementów sterujących */
:root {
    --ui-space-1: 4px;
    --ui-space-2: 8px;
    --ui-space-3: 12px;
    --ui-space-4: 16px;
    --ui-control-height: 38px;
    --ui-control-height-compact: 32px;
    --ui-radius: 9px;
}

.container { width: min(1440px, 100%); padding: var(--ui-space-4) 14px 56px; }
.card { margin-bottom: 14px; padding: var(--ui-space-4); }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin-bottom: var(--ui-space-1); }
h2, h3 { margin-bottom: var(--ui-space-2); }
p { margin: var(--ui-space-2) 0; }
label { margin-bottom: var(--ui-space-1); font-size: 13px; line-height: 1.35; }

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea,
.prepared-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.prepared-card select,
.prepared-card textarea {
    min-height: var(--ui-control-height);
    padding: 8px 10px;
    border-radius: var(--ui-radius);
    font: inherit;
    font-size: 14px;
    line-height: 1.35;
}
textarea,
.prepared-card textarea { min-height: 76px; }
input[type="file"] { padding: 6px 8px; }
input[type="checkbox"], input[type="radio"] {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin: 0;
}

button, .button {
    min-height: var(--ui-control-height);
    padding: 8px 13px;
    border-radius: var(--ui-radius);
    font-size: 14px;
    line-height: 1.2;
}
button.compact, .button.compact {
    min-height: var(--ui-control-height-compact);
    padding: 6px 10px;
    font-size: 13px;
}

.actions,
.product-tools,
.selection-toolbar,
.batch-actions,
.gallery-quick-actions,
.prepared-filter-actions,
.header-actions { gap: var(--ui-space-2); }
.settings-grid,
.prepared-form-grid,
.grid,
.profile-defaults { gap: var(--ui-space-3); }
.prepared-card .prepared-form-grid { gap: var(--ui-space-3); }
.prepared-list { gap: var(--ui-space-3); margin-top: var(--ui-space-3); }
.prepared-card { padding: var(--ui-space-3); }
.prepared-card .prepared-topline {
    margin: calc(-1 * var(--ui-space-3)) calc(-1 * var(--ui-space-3)) var(--ui-space-3);
    padding: var(--ui-space-2) var(--ui-space-3);
}
.prepared-heading { gap: var(--ui-space-2); margin-bottom: var(--ui-space-3); }
.prepared-edit-form { display: grid; gap: var(--ui-space-3); margin-bottom: var(--ui-space-3); }
.prepared-edit-form > p { margin: 0; }
.gallery-section,
.compact-editor-body,
.bulk-editor-body { padding: var(--ui-space-3); }
.gallery-section { margin-bottom: 0; }
.price-calculator-grid { gap: var(--ui-space-2); }
.alert {
    margin: var(--ui-space-3) 0;
    padding: 10px 12px;
    border-radius: var(--ui-radius);
    line-height: 1.4;
}
.alert.warning { border: 1px solid #f1c75b; background: #fff7d6; color: #754c00; }
.identity-check-hint { min-height: 18px; margin-top: var(--ui-space-1); }
.identity-check-hint.is-pending { color: #9a5b00; font-weight: 700; }
.inline-check,
.export-choice,
.gallery-item-footer label { gap: var(--ui-space-2); }
.inline-check { margin-top: var(--ui-space-2); }
.section-heading { gap: var(--ui-space-3); margin-bottom: var(--ui-space-3); }
.inline-form, .subcard form { margin-top: var(--ui-space-3); }

html[data-theme="dark"] .alert.warning {
    border-color: #7a6124;
    background: #3a301a;
    color: #f0d28a;
}
html[data-theme="dark"] .identity-check-hint.is-pending { color: #f0c66b; }

/* v0.6.0 - moduły pobierania i opracowania oraz rodziny matka-córki */
.acquisition-package-box { align-items: center; }
.package-primary-action { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-2); }
.acquisition-filter-bar { margin-top: var(--ui-space-4); }
.acquisition-prepared-list .prepared-card { border-left: 4px solid var(--brand-border); }
.family-workbench { display: grid; gap: var(--ui-space-4); }
.family-workbench > .section-title-row { margin-bottom: 0; }
.family-workbench,
.family-preview,
.family-card,
.family-card-heading,
.family-list { min-width: 0; max-width: 100%; }
.family-creator,
.family-preview,
.family-card {
    border: 1px solid #d8dee6;
    border-radius: 11px;
    background: #fff;
}
.family-creator > summary {
    display: flex;
    justify-content: space-between;
    gap: var(--ui-space-3);
    padding: 12px 14px;
    cursor: pointer;
}
.family-creator-form,
.family-preview,
.family-card { padding: 14px; }
.family-parent-grid {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(190px, 1fr) minmax(190px, 1fr);
    gap: var(--ui-space-3);
    margin-bottom: var(--ui-space-3);
}
.family-parent-grid label { display: grid; align-content: start; gap: 4px; }
.family-parent-grid small,
.family-selection-table td small { display: block; margin-top: 4px; color: var(--muted); }
.family-selection-table input[type="text"],
.family-selection-table input:not([type]) { min-width: 240px; }
.prepared-variant-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px 10px;
    margin-top: 9px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2, #f7f8fa);
}
.prepared-variant-control > div:first-child { display: grid; min-width: 0; gap: 2px; }
.prepared-variant-assignments { display: flex; grid-column: 1 / -1; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.prepared-variant-assignments form { margin: 0; }
.variant-product-dialog {
    width: min(980px, calc(100vw - 24px));
    max-width: 980px;
    max-height: calc(100dvh - 24px);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    color: var(--text);
    overflow: hidden;
}
.variant-product-dialog::backdrop { background: rgba(15, 23, 42, .62); backdrop-filter: blur(2px); }
.variant-product-dialog-panel { max-height: calc(100dvh - 26px); padding: 14px; overflow: auto; overflow-x: hidden; overscroll-behavior: contain; }
.variant-product-dialog-header { display: flex; justify-content: space-between; gap: 10px; align-items: start; margin-bottom: 10px; }
.variant-product-dialog-header h2 { margin: 2px 0; overflow-wrap: anywhere; }
button.variant-product-dialog-close { width: 38px; min-width: 38px; min-height: 38px; padding: 0; border-radius: 999px; font-size: 25px; line-height: 1; }
.variant-mode-select { display: grid; gap: 4px; max-width: 36rem; margin-bottom: 10px; font-weight: 850; }
.variant-mode-panel { min-width: 0; padding-top: 4px; }
.variant-mode-panel[hidden] { display: none; }
.family-member-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.family-member-card { display: grid; min-width: 0; gap: 7px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); overflow-wrap: anywhere; }
.family-member-card.is-current { border-color: var(--brand); background: var(--brand-soft); }
.family-member-card.is-selected { border-color: #248647; box-shadow: 0 0 0 1px rgba(36, 134, 71, .15); }
.family-member-card code { width: fit-content; max-width: 100%; overflow-wrap: anywhere; }
.family-member-card label { display: grid; min-width: 0; gap: 4px; }
.family-member-card .inline-check { display: flex; }
.family-parent-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px 9px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--brand-border);
    border-radius: 9px;
    background: var(--brand-soft);
}
.family-parent-summary strong { min-width: 0; overflow-wrap: anywhere; }
.family-parent-summary code { max-width: 100%; overflow-wrap: anywhere; }
.family-parent-summary p { grid-column: 1 / -1; margin: 0; color: var(--muted); }
.family-axes-field { display: grid; gap: 4px; }
.family-axes-field small { color: var(--muted); }
.stock-variant-rows { display: grid; gap: 9px; margin: 10px 0; }
.stock-variant-row { min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2, #f7f8fa); }
.stock-variant-row > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.stock-variant-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.stock-variant-grid label { display: grid; min-width: 0; gap: 4px; }
.stock-variant-grid input { min-width: 0; width: 100%; }
.stock-variant-grid .stock-variant-image { grid-column: span 3; }
.stock-variant-flags { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; }
.stock-variant-flags .inline-check { min-height: 30px; }
.add-stock-variant { margin-bottom: 10px; }
.family-preview { border-left: 4px solid #c78a19; background: #fffdf6; }
.family-preview.is-valid { border-left-color: #248647; background: #f7fff9; }
.family-parent-row { background: var(--brand-soft); }
.family-preview-actions,
.family-actions,
.family-meta,
.family-card-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ui-space-2);
}
.family-preview-actions { margin-top: var(--ui-space-3); }
.family-list { display: grid; gap: var(--ui-space-3); }
.family-card-heading { justify-content: space-between; margin-bottom: var(--ui-space-3); }
.family-card-heading h4 { margin: 4px 0 0; }
.family-card-heading code { font-size: 13px; }
.family-meta { margin-bottom: var(--ui-space-3); color: var(--muted); }
.family-meta span { padding: 5px 8px; border-radius: 7px; background: #f3f5f7; }
.family-actions { margin-top: var(--ui-space-3); }
.status-draft { background: #fff1c7; color: #755000; }
.status-published,
.status-ready,
.status-imported { background: #dff4e5; color: #12632b; }
.status-exported { background: #e2eef9; color: #205984; }
.status-not_exported { background: #eef0f2; color: #4d5862; }

html[data-theme="dark"] .family-creator,
html[data-theme="dark"] .family-preview,
html[data-theme="dark"] .family-card { border-color: #39434d; background: #20262b; }
html[data-theme="dark"] .family-preview { border-left-color: #c99532; background: #302a1b; }
html[data-theme="dark"] .family-preview.is-valid { border-left-color: #4ba669; background: #18291f; }
html[data-theme="dark"] .family-parent-row { background: #321d20; }
html[data-theme="dark"] .family-meta span { background: #2b333a; }
html[data-theme="dark"] .status-draft { background: #48391d; color: #f3d48a; }
html[data-theme="dark"] .status-published,
html[data-theme="dark"] .status-ready,
html[data-theme="dark"] .status-imported { background: #21442c; color: #a9e3b9; }
html[data-theme="dark"] .status-exported { background: #20364b; color: #acd2f4; }
html[data-theme="dark"] .status-not_exported { background: #323a42; color: #dce3e9; }

@media (max-width: 640px) {
    .container { padding: 10px 9px 44px; }
    .card { padding: var(--ui-space-3); }
    button, .button { width: 100%; }
    .prepared-card { padding: 10px; }
    .prepared-card .prepared-topline { margin: -10px -10px 10px; padding: 8px 10px; }
    .family-parent-grid { grid-template-columns: 1fr; }
    .family-creator > summary,
    .family-card-heading { align-items: flex-start; }
}

/* v0.6.1 - podgląd danych źródłowych */
.source-data-preview {
    display: grid;
    gap: 4px;
    margin: 0 0 var(--ui-space-3);
    padding: 8px 10px;
    border: 1px solid #dce3ea;
    border-radius: 8px;
    background: rgba(248, 250, 252, .82);
    color: #64748b;
    font-size: 10.5px;
    line-height: 1.4;
}
.source-data-preview > summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    list-style: none;
}
.source-data-preview > summary::-webkit-details-marker { display: none; }
.source-data-preview-line { display: flex; flex-wrap: wrap; gap: 3px 10px; }
.source-data-preview-toggle { flex: 0 0 auto; color: var(--brand); font-weight: 800; }
.source-data-preview-toggle::after { content: 'Rozwiń pełne dane'; }
.source-data-preview[open] .source-data-preview-toggle::after { content: 'Zwiń'; }
.source-data-preview-content { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid #dce3ea; }
.source-data-preview-content ul { display: grid; gap: 2px; margin: 3px 0 0; padding-left: 20px; }
.source-data-preview strong { color: #475569; }
.source-data-preview p {
    margin: 3px 0 0;
    color: #687481;
    white-space: normal;
}
.source-data-note,
.ean-omitted-note { color: #9a5b00; font-size: 11px; font-weight: 700; line-height: 1.4; }
.ean-omitted-note { margin-top: 4px; }

html[data-theme="dark"] .source-data-preview {
    border-color: #3d4751;
    background: rgba(23, 27, 32, .78);
}
html[data-theme="dark"] .source-data-preview strong { color: #c1c9d1; }
html[data-theme="dark"] .source-data-preview,
html[data-theme="dark"] .source-data-preview p { color: #98a4af; }
html[data-theme="dark"] .source-data-preview-content { border-top-color: #3d4751; }
html[data-theme="dark"] .source-data-note,
html[data-theme="dark"] .ean-omitted-note { color: #f0c66b; }

/* v0.6.2 - spójny układ wyboru, kod w kroku zdjęć i zwarte działania */
.product-list { align-items: stretch; }
.product-item {
    position: relative;
    min-width: 0;
    align-self: stretch;
    align-content: start;
    overflow: hidden;
}
.product-info,
.product-meta,
.product-wide { min-width: 0; }
.product-meta { align-items: center; }
.product-item .alert { overflow-wrap: anywhere; }
.product-ordinal {
    position: absolute;
    z-index: 2;
    top: 7px;
    right: 7px;
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid var(--border, #d8dee6);
    border-radius: 999px;
    background: var(--surface, #fff);
    color: var(--muted, #64748b);
    font-size: 9.5px;
    font-weight: 850;
}
.product-item .product-info { padding-right: 25px; }

.product-selection-toolbar { gap: 14px; }
.selection-actions,
.selection-submit {
    align-items: center;
    gap: 10px;
}
.selection-submit { margin-left: auto; }
.product-selection-toolbar button { white-space: nowrap; }
.actions > form { display: flex; align-items: center; margin: 0; }

.preparation-error { margin: 6px 0 0; }
.book-edition-choice {
    display: grid;
    gap: 5px;
    margin-top: 6px;
    padding: 9px;
    border: 1px solid var(--state-warning-border);
    border-radius: 8px;
    background: var(--state-warning-bg);
}
.book-edition-choice label { margin: 0; color: var(--state-warning-text); }
.book-edition-choice select { width: 100%; }
.book-edition-choice small { color: var(--state-warning-text); font-size: 10.5px; line-height: 1.35; }
.ean-conflict-override {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 9px 0 0;
    padding: 9px 0 0;
    border-top: 1px solid rgba(153, 27, 27, .22);
    color: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
}
.ean-conflict-override input { flex: 0 0 20px; }

.workflow-box-heading,
.gallery-header { align-items: center; }
.workflow-steps span { display: flex; align-items: center; }
.gallery-quick-actions { align-items: center; gap: 8px; }
.prepared-topline { justify-content: flex-start; }

.package-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.package-primary-action {
    flex: 1 1 650px;
    gap: 10px;
}
.package-primary-action .package-selection-info {
    margin: 0;
    text-align: left;
}
.package-primary-action .package-download-status {
    flex: 1 1 220px;
    margin: 0;
    text-align: left;
}

.acquisition-code-row {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) minmax(190px, .62fr) minmax(260px, .9fr);
    align-items: center;
    gap: 14px;
    padding: 11px 12px;
    border: 1px solid #d7dee7;
    border-radius: var(--ui-radius);
    background: rgba(255, 255, 255, .8);
}
.acquisition-code-row > label { margin: 0; }
.acquisition-code-row > label > span {
    display: block;
    margin-bottom: 5px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}
.acquisition-target-code,
.acquisition-target-ean { font-weight: 750; }
.acquisition-target-code[readonly],
.acquisition-target-ean[readonly] { background: #eef1f4; color: #66717c; }
.acquisition-code-guidance {
    display: flex;
    min-height: var(--ui-control-height);
    flex-direction: column;
    justify-content: center;
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.4;
}
.acquisition-code-guidance .identity-check-hint { margin-top: 3px; }
.generator-notes-field {
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    border: 1px solid #d7dee7;
    border-radius: var(--ui-radius);
    background: rgba(255, 255, 255, .64);
}
.generator-notes-field > span { font-size: 12px; font-weight: 800; color: #475569; }
.generator-notes-field textarea { min-height: 72px; resize: vertical; }
.generator-notes-field small { color: #64748b; line-height: 1.4; }
.prepared-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.status-badge.status-unsaved {
    border-color: #d99b19;
    background: #fff4cf;
    color: #7a4b00;
}
html[data-theme="dark"] .status-badge.status-unsaved {
    border-color: #8c681e;
    background: rgba(130, 91, 10, .28);
    color: #ffd980;
}

html[data-theme="dark"] .acquisition-code-row {
    border-color: #3d4751;
    background: rgba(23, 27, 32, .78);
}
html[data-theme="dark"] .acquisition-code-row > label > span { color: #c1c9d1; }
html[data-theme="dark"] .acquisition-code-guidance { color: #98a4af; }
html[data-theme="dark"] .generator-notes-field { border-color: #3d4751; background: rgba(23, 27, 32, .62); }
html[data-theme="dark"] .generator-notes-field > span { color: #c1c9d1; }
html[data-theme="dark"] .generator-notes-field small { color: #98a4af; }
html[data-theme="dark"] .acquisition-target-code[readonly],
html[data-theme="dark"] .acquisition-target-ean[readonly] { background: #252c32; color: #aab4be; }
html[data-theme="dark"] .ean-conflict-override { border-top-color: rgba(242, 173, 177, .24); }

@media (max-width: 1180px) {
    .product-selection-toolbar { display: grid; }
    .selection-submit { margin-left: 0; justify-content: flex-start; }
}

@media (max-width: 800px) {
    .selection-actions,
    .selection-submit,
    .gallery-quick-actions { flex-wrap: wrap; }
    .acquisition-code-row { grid-template-columns: 1fr; }
    .package-primary-action { flex-basis: 100%; }
}

@media (max-width: 640px) {
    .package-action-row { display: grid; grid-template-columns: 1fr; }
    .package-primary-action { display: grid; grid-template-columns: 1fr; }
    .package-primary-action .package-download-status { min-height: 0; }
    .prepared-form-actions { display: grid; }
}

/* v0.6.3 - automatyczny pakiet i jednoznaczne przekazanie do ChatGPT */
.acquisition-package-box {
    width: 100%;
    margin-top: 24px;
    scroll-margin-top: 16px;
}
.acquisition-package-box .workflow-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chatgpt-handoff {
    width: 100%;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #cbddeb;
}
.chatgpt-handoff-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}
.chatgpt-handoff-heading p { margin: 3px 0 0; color: #64748b; font-size: 12px; }
.chatgpt-handoff-heading button { flex: 0 0 auto; }
.chatgpt-handoff textarea {
    width: 100%;
    min-height: 178px;
    resize: vertical;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.45;
}
#chatgpt-copy-status { min-height: 18px; margin-top: 6px; font-size: 12px; font-weight: 700; }

html[data-theme="dark"] .chatgpt-handoff { border-top-color: #3a5265; }
html[data-theme="dark"] .chatgpt-handoff-heading p { color: #9eabb6; }

@media (max-width: 800px) {
    .acquisition-package-box .workflow-steps { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .chatgpt-handoff-heading { align-items: stretch; flex-direction: column; }
    .chatgpt-handoff-heading button { width: 100%; }
}

/* v0.6.4 - uproszczona paleta, zatwierdzanie produktu i czytelny eksport CSV */
:root {
    --state-warning-bg: #fff7d6;
    --state-warning-border: #e8bd42;
    --state-warning-text: #754c00;
    --state-error-bg: #fff0e6;
    --state-error-border: #f97316;
    --state-error-text: #9a3412;
    --state-ok-bg: #ecfdf3;
    --state-ok-border: #4ade80;
    --state-ok-text: #166534;
    --state-neutral-bg: #f5f6f8;
    --state-neutral-border: #d8dee6;
    --state-neutral-text: #475569;
}

/* v0.6.5 - jeden trwały wybór produktów, walidacja Sanctis i odporny eksport mediów */

button, .button { background: var(--brand); }
button:hover, .button:hover { background: var(--brand-hover); }
button.secondary, .button.secondary { background: #5f6872; }
button.secondary:hover, .button.secondary:hover { background: #4b545d; }
button.danger, .button.danger { background: #ea580c; }
button.danger:hover, .button.danger:hover { background: #c2410c; }
button.ghost, .button.ghost { border-color: var(--state-neutral-border); background: #fff; color: var(--state-neutral-text); }
button.ghost:hover, .button.ghost:hover { border-color: var(--brand-border); background: var(--brand-soft); color: var(--brand-dark); }

.alert.info { border: 1px solid var(--brand-border); background: var(--brand-soft); color: var(--brand-dark); }
.alert.warning { border: 1px solid var(--state-warning-border); background: var(--state-warning-bg); color: var(--state-warning-text); }
.alert.error { border: 1px solid var(--state-error-border); background: var(--state-error-bg); color: var(--state-error-text); }
.alert.success { border: 1px solid var(--state-ok-border); background: var(--state-ok-bg); color: var(--state-ok-text); }

.workflow-box,
.next-step-box,
.workflow-guide,
.bulk-editor,
.family-workbench { border-color: var(--brand-border); background: var(--brand-soft); }
.workflow-steps span,
.workflow-guide-steps li { border-color: var(--state-neutral-border); background: #fff; }
.optional-badge { background: var(--state-warning-bg); color: var(--state-warning-text); }
.step-number,
.workflow-guide-steps li::before,
.main-menu a.active { background: var(--brand); color: #fff; }
.product-name,
.current-scan-source a { color: var(--brand-dark); }

.prepared-card,
.prepared-card:nth-child(odd),
.prepared-card:nth-child(even) {
    border-color: var(--state-neutral-border);
    border-left: 4px solid var(--brand-border);
    background: #fff;
}
.prepared-card:nth-child(odd) .prepared-topline,
.prepared-card:nth-child(even) .prepared-topline,
.prepared-topline { background: var(--brand-soft); }
.prepared-card.is-open { border-left-color: var(--brand); box-shadow: 0 10px 28px rgba(101, 23, 25, .13); }
.bulk-choice { border-color: var(--state-neutral-border); background: #fff; }

.status-badge,
.status-source,
.status-package,
.status-variant,
.status-not_exported,
.status-exported,
.status-draft,
.status-review-hold { background: var(--state-neutral-bg); color: var(--state-neutral-text); }
.status-review-in_review,
.status-review,
.status-manual { background: var(--state-warning-bg); color: var(--state-warning-text); }
.status-issues,
.status-missing,
.status-failed { background: var(--state-error-bg); color: var(--state-error-text); }
.status-ready,
.status-review-ready,
.status-approved,
.status-generated,
.status-imported,
.status-published { background: var(--state-ok-bg); color: var(--state-ok-text); }

.prepared-target-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 9px;
    margin-top: 5px;
    color: var(--state-neutral-text);
    font-size: 12px;
}
.prepared-target-summary strong { color: var(--brand-dark); }
.target-approved { color: var(--state-ok-text); font-weight: 800; }

.category-field-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
}
.category-field-heading > label,
.apply-category-check,
.new-additional-category-toggle,
.snapshot-profile-check { margin: 0; }
.apply-category-check,
.new-additional-category-toggle,
.snapshot-profile-check { font-size: 12px; }
.new-additional-category {
    margin-top: 8px;
    padding: 10px;
    border: 1px dashed var(--state-warning-border);
    border-radius: 8px;
    background: var(--state-warning-bg);
}
.settings-explanation {
    margin: 10px 0;
    padding: 9px 10px;
    border-left: 3px solid var(--brand);
    background: var(--brand-soft);
    color: var(--state-neutral-text);
    font-size: 12px;
    line-height: 1.45;
}
.csv-export-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.csv-export-form .package-download-status { text-align: left; }
.package-download-status.success-text { color: var(--state-ok-text); }
.package-download-status.warning-text { color: var(--state-warning-text); }
.package-download-status.error-text { color: var(--state-error-text); }

.update-upload-form {
    display: grid;
    gap: var(--ui-space-3);
    max-width: 760px;
}
.update-upload-form input[type="file"] { margin-top: var(--ui-space-1); }
.update-upload-form .check-row { align-items: flex-start; }
.update-upload-form button { width: fit-content; }
.update-card .compact-alert { margin-top: var(--ui-space-3); }

.identifier-sources {
    margin-top: var(--ui-space-2);
    padding: 7px 10px;
    border: 1px solid var(--state-neutral-border);
    border-radius: var(--ui-radius);
    background: var(--state-neutral-bg);
    font-size: 12px;
}
.identifier-sources summary { cursor: pointer; font-weight: 700; }
.identifier-sources ul { margin: 7px 0 0; padding-left: 20px; }
.identifier-sources li + li { margin-top: 4px; }

html[data-theme="dark"] {
    --state-warning-bg: #3a301a;
    --state-warning-border: #8a6d28;
    --state-warning-text: #f0d28a;
    --state-error-bg: #42261a;
    --state-error-border: #c25b22;
    --state-error-text: #ffc09a;
    --state-ok-bg: #183522;
    --state-ok-border: #34784d;
    --state-ok-text: #9bddad;
    --state-neutral-bg: #2b3239;
    --state-neutral-border: #46515c;
    --state-neutral-text: #c7d0d8;
}
html[data-theme="dark"] button.ghost,
html[data-theme="dark"] .button.ghost { border-color: var(--state-neutral-border); background: #20262c; color: var(--state-neutral-text); }
html[data-theme="dark"] .prepared-card,
html[data-theme="dark"] .prepared-card:nth-child(odd),
html[data-theme="dark"] .prepared-card:nth-child(even) { border-color: #39434d; border-left-color: var(--brand-border); background: #1c2126; }
html[data-theme="dark"] .prepared-card:nth-child(odd) .prepared-topline,
html[data-theme="dark"] .prepared-card:nth-child(even) .prepared-topline,
html[data-theme="dark"] .prepared-topline { background: var(--brand-soft); }
html[data-theme="dark"] .workflow-steps span,
html[data-theme="dark"] .workflow-guide-steps li { border-color: #39434d; background: #20262c; }
html[data-theme="dark"] .new-additional-category { border-color: var(--state-warning-border); background: var(--state-warning-bg); }
html[data-theme="dark"] .settings-explanation { background: var(--brand-soft); color: #c7d0d8; }
html[data-theme="dark"] .prepared-target-summary { color: #b8c1ca; }
html[data-theme="dark"] .prepared-target-summary strong { color: #f0c4c6; }

@media (max-width: 640px) {
    .category-field-heading { align-items: stretch; flex-direction: column; }
    .csv-export-action { display: grid; grid-template-columns: 1fr; }
}

/* v0.7 - małe miniatury i powiększenie zdjęcia */
.image-preview-dialog {
    width: min(1100px, calc(100vw - 28px));
    max-height: 94vh;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: inherit;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .42);
}
.image-preview-dialog::backdrop { background: rgba(15, 23, 42, .78); backdrop-filter: blur(3px); }
.image-preview-dialog-panel { overflow: hidden; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; }
.image-preview-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid #e2e8f0; }
.image-preview-dialog h2 { margin: 0; font-size: 18px; }
button.image-preview-dialog-close { min-width: 38px; min-height: 38px; padding: 0; border: 1px solid #cbd5e1; border-radius: 50%; background: #fff; color: #475569; font-size: 25px; line-height: 1; }
button.image-preview-dialog-close:hover { background: var(--brand-main); color: #fff; }
.image-preview-dialog figure { display: grid; max-height: calc(94vh - 64px); place-items: center; gap: 8px; margin: 0; padding: 12px; overflow: auto; background: #f8fafc; }
.image-preview-dialog figure img { display: block; max-width: 100%; max-height: calc(94vh - 112px); width: auto; height: auto; object-fit: contain; }
.image-preview-dialog figcaption { color: #64748b; font-size: 12px; text-align: center; }
html[data-theme="dark"] .image-preview-dialog-panel { border-color: #46515c; background: #1c2126; }
html[data-theme="dark"] .image-preview-dialog header { border-color: #39434d; }
html[data-theme="dark"] button.image-preview-dialog-close { border-color: #46515c; background: #20262c; color: #d7dde3; }
html[data-theme="dark"] .image-preview-dialog figure { background: #15191d; }
html[data-theme="dark"] .image-preview-dialog figcaption { color: #aab4be; }

@media (max-width: 640px) {
    .media-comparison-grid { grid-template-columns: minmax(232px, 260px); }
    .image-preview-dialog { width: calc(100vw - 16px); }
}

html[data-theme="dark"] .image-upload-summary { background: #202d3a; color: #c7d0d8; }
html[data-theme="dark"] .image-upload-details summary { color: #c7d0d8; }
html[data-theme="dark"] .image-upload-log-list article { border-color: #39434d; background: #20262c; }
html[data-theme="dark"] .log-error { color: #fca5a5; }
html[data-theme="dark"] .media-comparison-grid article { border: 0; background: transparent; }

/* v0.6.6 - czytelne szczegóły walidacji eksportu */
.validation-dialog {
    width: min(920px, calc(100vw - 28px));
    max-height: min(88vh, 900px);
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: inherit;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .34);
}
.validation-dialog::backdrop { background: rgba(30, 18, 21, .62); backdrop-filter: blur(3px); }
.validation-dialog-panel { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; max-height: min(88vh, 900px); overflow: hidden; border: 1px solid var(--state-error-border); border-radius: 14px; background: #fff; }
.validation-dialog-header,
.validation-product-heading,
.validation-dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.validation-dialog-header { padding: 16px 18px; border-bottom: 1px solid var(--state-error-border); background: var(--state-error-bg); }
.validation-dialog-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.validation-dialog-heading h2 { margin: 1px 0 0; color: var(--state-error-text); font-size: 20px; }
.validation-dialog-icon { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: var(--state-error-border); color: #fff; font-size: 22px; font-weight: 900; }
button.validation-dialog-close { min-width: 38px; min-height: 38px; padding: 0; border: 1px solid var(--state-error-border); border-radius: 50%; background: #fff; color: var(--state-error-text); font-size: 25px; line-height: 1; }
button.validation-dialog-close:hover { background: var(--state-error-border); color: #fff; }
.validation-dialog-summary { padding: 13px 18px; border-bottom: 1px solid var(--state-neutral-border); }
.validation-dialog-summary p { margin: 0; }
.validation-dialog-counts { margin-top: 5px; color: var(--state-error-text); font-size: 12px; font-weight: 800; }
.validation-dialog-products { display: grid; gap: 10px; padding: 14px 18px; overflow-y: auto; overscroll-behavior: contain; background: var(--state-neutral-bg); }
.validation-product-card { padding: 13px 14px; border: 1px solid var(--state-error-border); border-left: 4px solid var(--state-error-border); border-radius: 10px; background: #fff; }
.validation-product-heading { align-items: flex-start; padding-bottom: 9px; border-bottom: 1px solid var(--state-neutral-border); }
.validation-product-heading h3 { margin: 5px 0 0; color: var(--brand-dark); font-size: 14px; line-height: 1.35; }
.validation-product-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
.validation-error-count { padding: 5px 8px; border-radius: 999px; background: var(--state-error-bg); color: var(--state-error-text); font-size: 11px; font-weight: 800; white-space: nowrap; }
.validation-product-card ul { display: grid; gap: 7px; margin: 10px 0 0; padding-left: 20px; }
.validation-product-card li { padding-left: 2px; line-height: 1.45; overflow-wrap: anywhere; }
.validation-product-card li::marker { color: var(--state-error-border); }
.validation-product-card li strong { color: var(--state-error-text); }
.validation-dialog-footer { justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--state-neutral-border); background: #fff; }
.validation-dialog.is-warning .validation-dialog-panel,
.validation-dialog.is-warning .validation-dialog-header { border-color: var(--state-warning-border); }
.validation-dialog.is-warning .validation-dialog-header { background: var(--state-warning-bg); }
.validation-dialog.is-warning .validation-dialog-heading h2,
.validation-dialog.is-warning .validation-dialog-counts { color: var(--state-warning-text); }
.validation-dialog.is-warning .validation-dialog-icon { background: var(--state-warning-border); }
.validation-dialog.is-warning button.validation-dialog-close { border-color: var(--state-warning-border); color: var(--state-warning-text); }
.validation-dialog.is-warning button.validation-dialog-close:hover { background: var(--state-warning-border); color: #fff; }
.validation-product-card.is-warning { border-color: var(--state-warning-border); border-left-color: var(--state-warning-border); }
.validation-error-count.is-warning { background: var(--state-warning-bg); color: var(--state-warning-text); }
.validation-product-card.is-warning li::marker { color: var(--state-warning-border); }
.validation-product-card.is-warning li strong { color: var(--state-warning-text); }
button.warning-action { border-color: var(--state-warning-border); background: var(--state-warning-bg); color: var(--state-warning-text); }
button.warning-action:hover { background: var(--state-warning-border); color: #fff; }
#csv-validation-details-button { margin-top: 6px; }

html[data-theme="dark"] .validation-dialog-panel,
html[data-theme="dark"] .validation-product-card,
html[data-theme="dark"] .validation-dialog-footer { background: #1c2126; }
html[data-theme="dark"] button.validation-dialog-close { background: #20262c; color: var(--state-error-text); }
html[data-theme="dark"] .validation-dialog-products { background: #15191d; }
html[data-theme="dark"] .validation-product-heading h3 { color: #f0c4c6; }

@media (max-width: 640px) {
    .validation-dialog { width: calc(100vw - 16px); max-height: 94vh; }
    .validation-dialog-panel { max-height: 94vh; }
    .validation-dialog-header,
    .validation-dialog-summary,
    .validation-dialog-products,
    .validation-dialog-footer { padding-left: 12px; padding-right: 12px; }
    .validation-dialog-heading h2 { font-size: 17px; }
    .validation-product-heading { align-items: stretch; flex-direction: column; }
    .validation-product-actions { justify-content: flex-start; }
    .validation-product-actions button { flex: 1 1 auto; }
}

/* v0.7.2 - osobne opisy SEO i dostępności dla każdego zdjęcia */
.image-description-editor {
    grid-column: 1 / -1;
    margin-top: 3px;
    padding-top: 6px;
    border-top: 1px solid #e2e8f0;
}

/* v0.7.3 - bezpieczna publikacja produktów przez API */
.shoper-publish-workbench {
    display: grid;
    gap: 1rem;
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, var(--accent) 6%), var(--surface));
}

.publish-safety-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}

.publish-safety-grid article {
    position: relative;
    display: grid;
    gap: .3rem;
    min-height: 7rem;
    padding: 1rem 2.8rem 1rem 1rem;
    border: 1px solid var(--border);
    border-radius: .9rem;
    background: var(--surface);
}

.publish-safety-grid span,
.permission-strip span {
    color: var(--muted);
    line-height: 1.45;
}

.context-hint {
    position: absolute;
    top: .8rem;
    right: .8rem;
    width: 1.65rem;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border-radius: 50%;
    font-weight: 800;
    line-height: 1;
}

.context-hint::after {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 30;
    right: 0;
    bottom: calc(100% + .55rem);
    width: min(19rem, 70vw);
    padding: .7rem .8rem;
    border: 1px solid var(--border);
    border-radius: .65rem;
    background: var(--text);
    color: var(--surface);
    box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.2);
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translateY(.25rem);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
    pointer-events: none;
}

.context-hint:hover::after,
.context-hint:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.permission-strip,
.publish-plan-form,
.publish-job-heading,
.publish-job-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.permission-strip,
.publish-plan-form {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: .9rem;
    background: var(--surface);
}

.permission-strip > div,
.publish-plan-form > div:first-of-type {
    display: grid;
    gap: .25rem;
}

.publish-summary,
.publish-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.publish-summary span {
    padding: .45rem .65rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: .85rem;
}

.permission-results {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.permission-result {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .65rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: .85rem;
    white-space: nowrap;
}

.permission-result strong { font-size: 1rem; line-height: 1; }
.permission-result.ok { border-color: #3a9b68; color: #237448; }
.permission-result.fail { border-color: #c84e55; color: #a32b35; }

.publication-methods {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: .8rem;
}

.publication-method {
    display: grid;
    align-content: start;
    gap: .65rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: .9rem;
    background: var(--surface);
}

.publication-method.is-recommended {
    border: 2px solid var(--brand);
    background: var(--brand-soft);
    background: color-mix(in srgb, var(--brand-muted) 45%, var(--surface));
}

.publication-method h4,
.publication-method p { margin: 0; }
.publication-method .status-badge { justify-self: start; }
.publication-primary { width: 100%; min-height: 44px; }
.csv-fallback summary { cursor: pointer; font-weight: 800; }
.csv-fallback[open] summary { margin-bottom: .75rem; }

@media (max-width: 800px) {
    .publication-methods { grid-template-columns: 1fr; }
}

.publish-plan-action {
    display: flex;
    align-items: center;
    gap: .8rem;
    flex-wrap: wrap;
}

.publish-job {
    display: grid;
    gap: .9rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface);
}

.publish-job-attention_required,
.publish-item-uncertain { border-color: #c84e55; }

.publish-job-heading h4 { margin: .15rem 0 0; }
.publish-item-list { display: grid; gap: .55rem; }

.publish-item {
    border: 1px solid var(--border);
    border-radius: .75rem;
    overflow: clip;
}

.publish-item > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem;
    cursor: pointer;
}

.publish-item > summary span:last-child { color: var(--muted); font-size: .85rem; text-align: right; }
.publish-item > .alert,
.publish-item > .responsive-table { margin: .75rem; }
.publish-job-actions { align-items: flex-end; flex-wrap: wrap; }
.publish-job-actions form:first-child { display: grid; gap: .55rem; }
.confirm-publish { font-weight: 650; }
.publish-family-choice { padding: .35rem .55rem; border-radius: .55rem; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.publish-history { padding: .75rem 0; }
.publish-history-list { padding-top: .7rem; }
.publish-history-list span { padding: .4rem .6rem; border-left: 3px solid var(--border); }

.non-stock-configurator {
    display: grid;
    gap: .85rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--surface) 92%, var(--accent) 8%);
}
.non-stock-configurator h4 { margin: 0; }
.non-stock-configurator p { margin: .25rem 0 0; }
.non-stock-form { display: grid; gap: .8rem; }
.non-stock-selector-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.non-stock-values { display: grid; gap: .55rem; padding: .75rem; border: 1px solid var(--border); border-radius: .75rem; }
.non-stock-values[hidden] { display: none; }
.non-stock-values legend { padding: 0 .4rem; font-weight: 800; }
.non-stock-value-row { display: grid; grid-template-columns: minmax(15rem, 2fr) minmax(10rem, 1fr) minmax(7rem, .6fr) minmax(7rem, .6fr); gap: .55rem; align-items: end; padding: .55rem; border: 1px solid var(--border); border-radius: .65rem; background: var(--surface); }
.non-stock-value-choice { align-self: center; }
.non-stock-value-choice small { color: var(--muted); }
.non-stock-assignment-table { margin-top: .25rem; }
.non-stock-assignment-table tr.is-stale { background: color-mix(in srgb, #c84e55 12%, transparent); }
.non-stock-assignment-value { display: inline-flex; gap: .35rem; margin: .15rem .3rem .15rem 0; padding: .25rem .45rem; border: 1px solid var(--border); border-radius: 999px; }
.non-stock-assignment-value small { color: var(--muted); }
.table-actions { display: flex; gap: .4rem; align-items: center; }
.table-actions form { margin: 0; }

@media (max-width: 860px) {
    .editor-step-body { grid-template-columns: 1fr; }
    .editor-step-summary { align-items: flex-start; }
    .editor-step-title small { white-space: normal; }
    .publish-safety-grid { grid-template-columns: 1fr; }
    .permission-strip,
    .publish-plan-form,
    .publish-job-heading,
    .publish-job-actions,
    .publish-item > summary { align-items: stretch; flex-direction: column; }
    .publish-item > summary span:last-child { text-align: left; }
    .non-stock-selector-grid,
    .non-stock-value-row { grid-template-columns: 1fr; }
}
.image-description-editor > summary {
    cursor: pointer;
    color: var(--brand-main);
    font-size: 11.5px;
    font-weight: 800;
}
.image-description-editor label {
    display: grid;
    gap: 4px;
    margin-top: 7px;
    font-weight: 750;
}
.image-description-editor textarea {
    width: 100%;
    min-height: 56px;
    resize: vertical;
}
.image-description-editor small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 10.5px;
    line-height: 1.35;
}
html[data-theme="dark"] .image-description-editor { border-color: #39434d; }
html[data-theme="dark"] .image-description-editor small { color: #aab4be; }

/* 0.9.0 - osobne centrum konfiguracji, testów i jawny zakres publikacji */
.settings-hub-grid,
.diagnostic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: .65rem;
}
.settings-hub-grid a {
    display: grid;
    gap: .2rem;
    padding: .8rem;
    border: 1px solid var(--border);
    border-radius: .75rem;
    background: var(--surface);
    color: inherit;
    text-decoration: none;
}
.settings-hub-grid a:hover { border-color: var(--accent); }
.settings-hub-grid span { color: var(--muted); font-size: .86rem; }
.configuration-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.log-agent { max-width: 28rem; overflow-wrap: anywhere; font-size: .78rem; color: var(--muted); }
.configuration-shortcut,
.compact-module-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem .85rem;
    border: 1px solid var(--border);
    border-radius: .75rem;
    background: color-mix(in srgb, var(--surface) 94%, var(--accent) 6%);
}
.test-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.diagnostic-result { display: grid; gap: .2rem; padding: .65rem; border: 1px solid var(--border); border-radius: .7rem; }
.diagnostic-result.ok { border-color: color-mix(in srgb, #24915d 55%, var(--border)); background: color-mix(in srgb, #24915d 8%, var(--surface)); }
.diagnostic-result.fail { border-color: color-mix(in srgb, #b4232d 55%, var(--border)); background: color-mix(in srgb, #b4232d 8%, var(--surface)); }
.diagnostic-result span,.diagnostic-result small { color: var(--muted); }
.danger-zone { margin-top: 1rem; padding: .8rem; border: 1px solid #d58a28; border-radius: .75rem; }
.danger-zone > summary { cursor: pointer; font-weight: 750; }
.publication-mode-panel { display: grid; gap: .65rem; min-width: min(100%, 42rem); }
.publication-mode-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .55rem; }
.mode-choice { display: flex; align-items: flex-start; gap: .55rem; padding: .7rem; border: 1px solid var(--border); border-radius: .75rem; cursor: pointer; }
.mode-choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.mode-choice span { display: grid; gap: .15rem; }
.mode-choice small,.publication-scopes small { color: var(--muted); }
.publication-scopes { display: flex; flex-wrap: wrap; gap: .5rem .8rem; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: .75rem; }
.publication-scopes[hidden] { display: none; }
.publication-scopes legend { padding: 0 .35rem; font-weight: 750; }
.scope-choice { display: inline-flex; align-items: center; gap: .35rem; }
.publish-mode-summary { margin: .55rem 0; padding: .5rem .65rem; border-radius: .6rem; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
pre { max-width: 48rem; max-height: 18rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .75rem; }

@media (max-width: 760px) {
    .configuration-columns,
    .publication-mode-options { grid-template-columns: 1fr; }
    .configuration-shortcut,
    .compact-module-intro { align-items: stretch; flex-direction: column; }
}

/* 0.9.1 - zwarty interfejs, stabilny układ mobilny i czytelna publikacja */
body.ui-font-system { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body.ui-font-arial { font-family: Arial, Helvetica, sans-serif; }
body.ui-font-verdana { font-family: Verdana, Geneva, sans-serif; }
body.ui-font-size-small { font-size: 13px; }
body.ui-font-size-normal { font-size: 14px; }
body.ui-font-size-large { font-size: 16px; }
body.ui-density-compact { --ui-card-pad: 10px; --ui-control-height: 34px; }
body.ui-density-comfortable { --ui-card-pad: 15px; --ui-control-height: 40px; }
body.ui-density-compact .card,
body.ui-density-compact .next-step-box { padding: var(--ui-card-pad); }
body.ui-density-compact input,
body.ui-density-compact select,
body.ui-density-compact textarea { min-height: var(--ui-control-height); }

.prepared-card-header,
.prepared-card-body,
.prepared-heading > div,
.prepared-target-summary,
.next-step-box,
.family-workbench,
.shoper-publish-workbench,
.publication-mode-panel,
.publish-plan-form { min-width: 0; max-width: 100%; }
.prepared-heading-unified {
    grid-template-columns: 34px 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}
.prepared-card-selector {
    display: grid;
    width: 34px;
    min-height: 34px;
    place-items: center;
    margin: 0;
    padding: 2px;
    border: 1px solid var(--state-neutral-border);
    border-radius: 7px;
    background: var(--surface);
}
.prepared-card-selector input { margin: 0; }
.prepared-heading-unified .product-thumb,
.prepared-heading-unified .product-thumb-placeholder { width: 58px; height: 58px; }
.prepared-heading-content { min-width: 0; }
.prepared-card-statusline { display: flex; min-width: 0; flex-wrap: wrap; gap: 3px 5px; margin-top: 5px; }
.prepared-card-statusline .status-badge { min-height: 19px; padding: 1px 6px; font-size: 9.5px; line-height: 1.2; }
.prepared-heading-unified .prepared-toggle { width: auto; min-width: 58px; min-height: 32px; padding: 4px 8px; }
.description-fields { grid-template-columns: minmax(0, 1fr); }
.description-html-field {
    min-height: 76px;
    padding: 7px 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.35;
}
.description-fields > div:last-child .description-html-field { min-height: 150px; }
.prepared-card .prepared-topline { gap: 5px; padding: 6px 8px; }
.prepared-topline .status-badge { min-height: 23px; padding: 2px 7px; }
.prepared-toggle { margin-left: auto; }
.prepared-heading { align-items: start; margin-bottom: 7px; }
.prepared-heading .product-name { color: var(--brand-dark); font-size: 14px; font-weight: 850; overflow-wrap: anywhere; }
.prepared-target-summary { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 3px; color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.prepared-source-meta { margin-top: 4px; color: var(--muted); font-size: 11px; }
.prepared-source-meta > summary { cursor: pointer; font-weight: 700; }
.prepared-source-meta > span { display: block; padding-top: 3px; overflow-wrap: anywhere; }

.target-name-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12rem, .35fr); gap: 6px; }
.target-name-controls > input,
.target-name-controls > select { width: 100%; min-width: 0; }
.target-name-suggestions { font-weight: 650; }
.prepared-core-fields-row .active-field { display: flex; align-items: end; grid-column: span 2; }
.target-active-choice { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; margin: 0; padding: 5px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-weight: 800; }
.target-active-choice input { min-height: 0 !important; }
.book-spec-preview { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.book-spec-preview h3 { display: none; }
.book-spec-preview ul { display: flex; flex-wrap: wrap; gap: 3px 18px; margin: 5px 0 0; padding-left: 18px; }
.book-spec-preview li { min-width: 12rem; }
.remove-prepared-control { width: fit-content; max-width: 100%; margin-top: 7px; color: #9f1d24; font-size: 11.5px; }
.remove-prepared-control > summary { cursor: pointer; font-weight: 750; }
.remove-prepared-control form { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 6px; padding: 7px; border: 1px solid #d58a8e; border-radius: 7px; }

.family-selection-table { min-width: 0; }

.publication-permissions { margin-bottom: 8px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; }
.publication-permissions > summary { display: flex; justify-content: space-between; gap: 8px; cursor: pointer; }
.publication-permissions > summary span { color: var(--muted); font-size: 11px; }
.publication-mode-select { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; max-width: 28rem; }
.publication-mode-select strong { font-size: 13px; }
.publication-mode-select small { color: var(--muted); }
.publish-plan-form { display: grid; grid-template-columns: minmax(15rem, 1fr) auto; gap: 10px; align-items: end; padding: 9px; }
.publish-plan-action { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px 10px; }
.publish-plan-action button { white-space: nowrap; }
.publish-plan-action span { color: var(--muted); font-size: 11.5px; }
.publication-scopes { gap: 5px 10px; padding: 7px 9px; }
.scope-choice { margin: 0; }

.toast-stack { position: fixed; z-index: 5000; top: max(12px, env(safe-area-inset-top)); right: 12px; display: grid; gap: 7px; width: min(390px, calc(100vw - 24px)); pointer-events: none; }
.app-toast { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; padding: 10px 11px; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 9px; background: var(--surface); box-shadow: 0 10px 35px rgba(15,23,42,.2); color: var(--text); pointer-events: auto; }
.app-toast.error { border-left-color: #b4232d; }
.app-toast.success { border-left-color: #24875a; }
.app-toast.warning { border-left-color: #d58a28; }
.app-toast button { width: auto; min-width: 28px; min-height: 28px; padding: 2px 7px; }

@media (max-width: 860px) {
    .prepared-card.is-open > .prepared-card-header { position: static; inset: auto; z-index: auto; padding: 0; box-shadow: none; }
    .prepared-card.is-open > .prepared-card-header .prepared-topline { margin: 0 0 7px; }
    .prepared-card.is-open > .prepared-card-header .prepared-heading { margin-bottom: 7px; }
    .prepared-topline .status-label { display: none; }
    .prepared-topline .muted { display: none; }
    .prepared-topline .status-badge { min-width: 24px; justify-content: center; }
    .prepared-heading { grid-template-columns: 52px minmax(0, 1fr); gap: 7px; }
    .prepared-heading-unified { grid-template-columns: 32px 52px minmax(0, 1fr) auto; }
    .prepared-heading-unified .product-thumb,
    .prepared-heading-unified .product-thumb-placeholder { width: 52px; height: 52px; }
    .prepared-heading .product-thumb { width: 52px; height: 66px; }
    .target-name-controls { grid-template-columns: 1fr; }
    .prepared-core-fields-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .prepared-core-fields-row .identity-code-field,
    .prepared-core-fields-row .identity-ean-field,
    .prepared-core-fields-row .active-field { grid-column: 1 / -1; }
    .prepared-core-fields-row .pricing-target-field,
    .prepared-core-fields-row .vat-rate-field,
    .prepared-core-fields-row .priority-field { grid-column: auto; }
    .prepared-core-fields-row .priority-field { grid-column: 1; }
    .publish-plan-form { grid-template-columns: 1fr; }
    .publish-plan-action { justify-content: stretch; }
    .publish-plan-action button { width: auto; flex: 1 1 12rem; }
    .permission-strip { align-items: stretch; }
    .permission-strip button { width: auto; }
    .family-workbench .responsive-table { max-width: 100%; overflow-x: auto; }
}

@media (max-width: 540px) {
    body.ui-font-size-small { font-size: 12.5px; }
    .container { width: 100%; padding: 7px 6px 34px; overflow-x: clip; }
    .card,
    .next-step-box,
    .prepared-card { padding: 8px; border-radius: 8px; }
    .prepared-card .prepared-topline { margin: 0 0 6px; }
    .prepared-topline .export-choice { padding: 3px 5px; }
    .prepared-toggle { width: auto !important; min-height: 28px; padding: 3px 7px; }
    .prepared-heading-unified { grid-template-columns: 30px 48px minmax(0, 1fr) auto; gap: 6px; }
    .prepared-heading-unified .product-thumb,
    .prepared-heading-unified .product-thumb-placeholder { width: 48px; height: 48px; }
    .prepared-card-selector { width: 30px; min-height: 30px; padding: 1px; }
    .prepared-card-selector input { width: 22px; height: 22px; flex-basis: 22px; }
    .prepared-heading-unified .prepared-toggle { min-width: 52px; }
    .description-html-field { font-size: 14px; line-height: 1.3; }
    .prepared-editor-nav { overflow-x: auto; justify-content: flex-start; }
    .editor-step-summary,
    .prepared-flow-heading { padding: 7px 8px; }
    .prepared-flow-heading strong { font-size: 12.5px; }
    .prepared-flow-heading small { font-size: 10px; }
    .prepared-core-fields { gap: 6px; padding: 7px; }
    .prepared-core-fields-row input { min-height: 32px; }
    .prepared-core-fields-meta { padding: 4px 6px; font-size: 10px; }
    .book-profile-box .compact-editor-body { padding: 7px; }
    .book-spec-preview ul { display: block; }
    .publication-scopes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .publication-scopes > small { grid-column: 1 / -1; }
    .scope-choice { min-width: 0; font-size: 11.5px; }
    .scope-choice input { flex: 0 0 auto; }
    .publish-job h4 { overflow-wrap: anywhere; }
    .publish-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
    .publish-plan-action button,
    .prepared-form-actions button,
    .family-creator button { width: 100%; }
    .permission-strip span { overflow-wrap: anywhere; }
    .configuration-columns { grid-template-columns: 1fr; }
}

/* 0.9.1.1 - nawigacja zadaniowa i widok lista + edytor */
.attention-mode-choice { display: inline-flex; width: auto; align-items: center; gap: 6px; margin: 0; padding: 4px 7px; border: 1px solid var(--brand-border); border-radius: 7px; background: var(--brand-soft); color: var(--brand-dark); font-size: 11.5px; font-weight: 800; }
.attention-mode-choice input { min-height: 0 !important; }
.prepared-workbench.attention-mode [data-review-section][data-needs-attention="0"] { display: none !important; }
.prepared-workbench.attention-mode .prepared-card.is-open .prepared-card-body { display: block; }

.prepared-review-layout { min-width: 0; }
.prepared-product-rail { display: none; min-width: 0; }
.prepared-product-rail-heading { display: grid; gap: 2px; padding: 7px 8px; border-bottom: 1px solid var(--border); }
.prepared-product-rail-heading small { color: var(--muted); font-size: 10.5px; }
#prepared-product-rail-list { display: grid; gap: 4px; padding: 6px; }
.prepared-product-rail-item { position: relative; display: grid; width: 100%; min-height: 0; grid-template-columns: 19px minmax(0,1fr); gap: 2px 5px; justify-content: start; padding: 7px; border: 1px solid transparent; background: transparent; color: var(--text); text-align: left; }
.prepared-product-rail-item:hover { border-color: var(--brand-border); background: var(--brand-soft); color: var(--brand-dark); }
.prepared-product-rail-item.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); box-shadow: inset 3px 0 0 var(--brand); }
.prepared-product-rail-item strong { min-width: 0; overflow: hidden; font-size: 11.5px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.prepared-product-rail-item small { grid-column: 2; min-width: 0; overflow: hidden; color: var(--muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.rail-state { display: inline-grid; width: 18px; height: 18px; grid-row: 1 / span 2; place-items: center; border-radius: 50%; font-size: 10px; font-weight: 900; }
.rail-state.needs-attention { background: #fff1cf; color: #8a5900; }
.rail-state.ready { background: #ddf7e8; color: #176b46; }

.publication-scope-preset { display: grid; min-width: min(100%, 15rem); gap: 3px; margin: 0; font-size: 11px; }
.publication-scope-preset select { min-height: 31px; padding: 4px 7px; font-size: 11.5px; }

.mobile-prepared-actions { display: none; }

@media (min-width: 1080px) {
    .prepared-review-layout.is-master-detail { display: grid; grid-template-columns: 245px minmax(0, 1fr); gap: 10px; align-items: start; }
    .prepared-review-layout.is-master-detail .prepared-product-rail { position: sticky; top: 10px; display: block; max-height: calc(100vh - 20px); overflow: auto; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
    .prepared-review-layout.is-master-detail .processing-prepared-list { margin-top: 0; }
    .prepared-review-layout.is-master-detail .processing-prepared-list > .prepared-card:not(.is-master-active) { display: none !important; }
    .prepared-review-layout.is-master-detail .processing-prepared-list > .prepared-card.is-master-active { margin: 0; }
    .prepared-review-layout.is-master-detail .processing-prepared-list .prepared-toggle { display: none; }
}

@media (max-width: 860px) {
    body.has-mobile-prepared-actions { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
    .mobile-prepared-actions:not([hidden]) { position: fixed; z-index: 4200; right: 7px; bottom: calc(7px + env(safe-area-inset-bottom)); left: 7px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px 35px; gap: 5px; align-items: center; padding: 6px; border: 1px solid var(--brand-border); border-radius: 11px; background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 9px 30px rgba(15,23,42,.24); backdrop-filter: blur(12px); }
    .mobile-prepared-actions button { width: 100%; min-height: 38px; padding: 5px 8px; }
    .mobile-prepared-actions > span { color: var(--muted); font-size: 10px; font-weight: 800; text-align: center; }
    .attention-mode-choice { flex: 1 1 100%; justify-content: flex-start; }
}

/* 0.9.2 - kompaktowy menedżer produktów Shopera */
.shoper-manager .card { margin-bottom: 10px; }
.catalog-sync-card .section-heading { margin-bottom: 6px; }
.catalog-stats { display: flex; flex-wrap: wrap; gap: 5px 14px; margin: 6px 0; color: var(--muted); font-size: 12px; }
.catalog-stats strong { color: var(--text); }
.catalog-sync-result { margin: 5px 0; color: var(--muted); font-size: 11.5px; }
.compact-details { margin-top: 6px; border-top: 1px solid var(--border); }
.compact-details > summary { padding: 7px 2px 2px; cursor: pointer; color: var(--text); }
.compact-details[open] > summary { margin-bottom: 7px; }
.compact-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.compact-actions form { margin: 0; }

.selection-count { white-space: nowrap; color: var(--muted); font-size: 12px; }
.catalog-filters { display: grid; grid-template-columns: repeat(6, minmax(105px, 1fr)); gap: 6px; margin: 8px 0; padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.catalog-filters label { min-width: 0; margin: 0; font-size: 10.5px; }
.catalog-filters input,
.catalog-filters select { min-height: 32px; padding: 4px 7px; font-size: 11.5px; }
.catalog-filter-wide { grid-column: span 2; }
.catalog-descendants { align-self: end; min-height: 32px; padding: 4px 0; }
.catalog-descendants input { min-height: 0; }
.catalog-filter-actions { display: flex; align-self: end; gap: 5px; }
.catalog-filter-actions > * { width: auto; flex: 1 1 auto; white-space: nowrap; }
.catalog-selection-toolbar { margin: 6px 0; }
.catalog-product-list { display: grid; gap: 5px; }
.catalog-product-card { display: grid; grid-template-columns: 30px minmax(180px, 1.15fr) minmax(190px, .85fr) minmax(260px, 1.5fr); gap: 8px; align-items: center; padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.catalog-product-card:hover { border-color: var(--brand-border); background: var(--brand-soft); }
.catalog-product-check { display: grid; place-items: center; margin: 0; }
.catalog-product-check input { width: 20px; height: 20px; min-height: 0; }
.catalog-product-identity,
.catalog-product-facts,
.catalog-product-categories { min-width: 0; }
.catalog-product-identity > strong { display: block; line-height: 1.25; }
.catalog-product-identity code { overflow-wrap: anywhere; }
.catalog-product-facts { display: grid; gap: 2px; color: var(--muted); font-size: 10.5px; }
.catalog-product-categories { display: grid; gap: 3px; font-size: 10.5px; line-height: 1.3; overflow-wrap: anywhere; }
.catalog-pagination { display: flex; justify-content: center; align-items: center; gap: 9px; margin: 8px 0; }
.catalog-pagination .disabled { opacity: .45; pointer-events: none; }

.catalog-operation-box { display: grid; grid-template-columns: minmax(180px, .65fr) minmax(280px, 1.35fr); gap: 8px 12px; margin: 10px 0 0; padding: 9px; border: 1px solid var(--brand-border); border-radius: 9px; background: var(--brand-soft); }
.catalog-operation-box legend { padding: 0 5px; color: var(--brand-dark); font-weight: 900; }
.catalog-operation-box > label,
.catalog-operation-box [data-additional-operation] > label,
.catalog-operation-box [data-main-operation] > label { margin: 0; }
.catalog-operation-box [data-additional-operation],
.catalog-operation-box [data-main-operation] { display: grid; gap: 5px; }
.catalog-operation-box [hidden] { display: none !important; }
.catalog-operation-box input,
.catalog-operation-box select { min-height: 34px; padding: 5px 7px; }
.catalog-operation-box select[multiple] { min-height: 142px; }
.catalog-operation-box small { color: var(--muted); }
.catalog-operation-submit { display: flex; grid-column: 1 / -1; justify-content: space-between; align-items: center; gap: 8px; padding-top: 7px; border-top: 1px solid var(--brand-border); }
.catalog-operation-submit button { width: auto; }
.file-operation-body { display: grid; gap: 6px; }

@media (max-width: 980px) {
    .catalog-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .catalog-product-card { grid-template-columns: 28px minmax(0, 1fr) minmax(180px, .8fr); }
    .catalog-product-categories { grid-column: 2 / -1; }
}

/* 0.9.3 - kolejka kartotek Subiekta i ręczny protokół Bridge */
.subiekt-hub .card { margin-bottom: 9px; }
.bridge-flow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; margin: 10px 0; }
.bridge-flow span { padding: 8px 11px; border: 1px solid var(--brand-border); border-radius: 8px; background: var(--brand-soft); font-weight: 900; }
.bridge-flow b { color: var(--muted); font-size: 11px; }
.bridge-stats { padding: 2px 0; }
.bridge-candidate-list { display: grid; gap: 5px; margin: 7px 0; }
.bridge-candidate { display: grid; grid-template-columns: 28px minmax(220px,1fr) minmax(190px,.6fr) minmax(220px,.8fr); align-items: center; gap: 7px; padding: 7px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.bridge-candidate .status-badge { white-space: normal; text-align: center; }
.bridge-product-facts { display: grid; gap: 2px; color: var(--muted); font-size: 10.5px; }
.bridge-job-items { display: grid; gap: 4px; margin: 8px 0; }
.bridge-job-items article { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px 8px; padding: 7px; border: 1px solid var(--border); border-radius: 7px; }
.bridge-job-items small { grid-column: 1 / -1; }
.bridge-next ul { margin: 8px 0 0; padding-left: 20px; }
.status-border-missing { border-left: 3px solid var(--success); }
.status-border-exists { border-left: 3px solid var(--muted); opacity: .78; }
.status-border-conflict { border-left: 3px solid var(--danger); }
.status-border-unverified { border-left: 3px solid var(--warning); opacity: .82; }
.status-missing { color: var(--success); }
.status-exists { color: var(--muted); }
.status-unverified { color: var(--warning); }

@media (max-width: 900px) {
    .bridge-candidate { grid-template-columns: 26px minmax(0,1fr) auto; }
    .bridge-product-facts { grid-column: 2; }
    .bridge-candidate > .status-badge { grid-column: 2 / -1; justify-self: start; text-align: left; }
}

@media (max-width: 620px) {
    .bridge-flow { display: grid; grid-template-columns: 1fr; text-align: center; }
    .bridge-flow b { transform: rotate(90deg); justify-self: center; }
    .bridge-candidate { grid-template-columns: 24px minmax(0,1fr); padding: 6px; }
    .bridge-candidate > .status-badge { grid-column: 2; }
    .subiekt-hub .catalog-operation-submit { align-items: stretch; }
}

@media (max-width: 600px) {
    .shoper-manager .card { margin-bottom: 7px; padding: 8px; }
    .shoper-manager h2 { margin-bottom: 2px; font-size: 15px; }
    .catalog-sync-card .section-heading { align-items: stretch; }
    .catalog-sync-card .section-heading form button { width: 100%; }
    .catalog-stats { gap: 4px 9px; font-size: 10.5px; }
    .catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 6px; }
    .catalog-filter-wide { grid-column: 1 / -1; }
    .catalog-filter-actions { grid-column: 1 / -1; }
    .catalog-selection-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
    .catalog-selection-toolbar [data-clear-selection] { grid-column: 1 / -1; }
    .catalog-product-card { grid-template-columns: 26px minmax(0, 1fr); gap: 4px 7px; padding: 7px; }
    .catalog-product-facts,
    .catalog-product-categories { grid-column: 2; }
    .catalog-product-facts { grid-template-columns: 1fr 1fr; }
    .catalog-operation-box { grid-template-columns: 1fr; padding: 7px; }
    .catalog-operation-submit { grid-column: 1; align-items: stretch; flex-direction: column; }
    .catalog-operation-submit button { width: 100%; }
    .compact-actions { display: grid; grid-template-columns: 1fr; }
    .compact-actions button { width: 100%; }
}

/* 0.9.3.2 - stabilny edytor, nagłówki poza linią i czytelne zdjęcia */
.prepared-review-layout,
.processing-prepared-list,
.processing-prepared-list > .prepared-card,
.prepared-card-body,
.processing-prepared-edit-form {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.processing-prepared-list { overflow: visible; }
.processing-prepared-list > .prepared-card { margin-inline: 0; }

/* Tytuł pozostaje częścią klikalnego nagłówka, a linia zaczyna się dopiero za nim. */
.prepared-flow-heading {
    align-items: flex-start;
    padding-inline: 0;
    border: 0;
    background: transparent;
}
.prepared-flow-heading > div,
.price-calculator-title > span,
.editor-step-title > span:last-child {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    grid-template-columns: max-content minmax(18px, 1fr);
    column-gap: 9px;
    align-items: center;
}
.prepared-flow-heading > div::after,
.price-calculator-title > span::after,
.editor-step-title > span:last-child::after {
    content: "";
    height: 1px;
    background: var(--brand-border);
}
.prepared-flow-heading small,
.price-calculator-title small,
.editor-step-title small {
    grid-column: 1 / -1;
}
.price-calculator-title,
.editor-step-title { flex: 1 1 auto; }
.price-calculator-heading,
.editor-step-summary { width: 100%; }

/* Galeria nie ściska pól opisu do szerokości miniatury. */
.gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 265px), 1fr));
    align-items: start;
    gap: 10px;
}
.gallery-item > a {
    aspect-ratio: 4 / 3;
    max-height: 210px;
}
.image-description-editor > summary { font-size: 11px; }
.image-description-editor label { font-size: 10.75px; }
.image-description-editor textarea {
    min-height: 76px;
    padding: 7px 8px;
    font-size: 11px !important;
    line-height: 1.35 !important;
}
.image-description-editor textarea.image-description-accessibility { min-height: 96px; }
.image-description-editor small { font-size: 9.75px; line-height: 1.32; }

.media-comparison-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 276px), 300px));
    gap: 12px;
    margin-bottom: 14px;
}
.media-comparison-grid article > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
button.media-preview-button {
    width: 100%;
    min-width: 0;
    gap: 5px;
}
.media-preview-button img {
    width: 100%;
    height: 132px;
}
.media-preview-meta {
    display: block;
    min-width: 0;
    color: var(--state-neutral-text);
    font-size: 10px;
    font-weight: 550;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.media-preview-meta b { color: var(--brand-dark); font-weight: 850; }

/* Lista produktów nad edytorem: żadna zapisana pozycja nie znika w lewej kolumnie. */
@media (min-width: 1080px) {
    .prepared-review-layout.is-master-detail {
        display: block;
        width: 100%;
    }
    .prepared-review-layout.is-master-detail .prepared-product-rail {
        position: static;
        display: grid;
        width: 100%;
        max-height: none;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: stretch;
        margin-bottom: 10px;
        overflow: hidden;
        border: 1px solid var(--border);
        border-radius: 9px;
        background: var(--surface);
    }
    .prepared-review-layout.is-master-detail .prepared-product-rail-heading {
        min-width: 120px;
        align-content: center;
        border-right: 1px solid var(--border);
        border-bottom: 0;
    }
    .prepared-review-layout.is-master-detail #prepared-product-rail-list {
        display: flex;
        min-width: 0;
        gap: 5px;
        padding: 6px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }
    .prepared-review-layout.is-master-detail .prepared-product-rail-item {
        flex: 0 0 clamp(220px, 24vw, 320px);
        width: auto;
        scroll-snap-align: start;
    }
    .prepared-review-layout.is-master-detail .processing-prepared-list { margin-top: 0; }
}

@media (max-width: 640px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-item > a { max-height: 190px; }
    .prepared-flow-heading > div,
    .price-calculator-title > span,
    .editor-step-title > span:last-child { grid-template-columns: max-content minmax(10px, 1fr); column-gap: 6px; }
}

html[data-theme="dark"] .prepared-flow-heading > div::after,
html[data-theme="dark"] .price-calculator-title > span::after,
html[data-theme="dark"] .editor-step-title > span:last-child::after { background: #57383b; }
html[data-theme="dark"] .media-preview-meta { color: #b8c0c8; }

/* 0.9.4 - stabilny układ, zwarta publikacja i czytelna konfiguracja */
.workflow-nav { position: static; top: auto; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.main-menu { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }

/* Tylko jedna warstwa nawigacji może być przyklejona. Nagłówek produktu nie zasłania menu. */
.prepared-card.is-open > .prepared-card-header {
    position: static;
    inset: auto;
    z-index: auto;
    margin: 0 0 9px;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}
.prepared-card.is-open > .prepared-card-header .prepared-topline { margin: 0 0 7px; }
.prepared-card.is-open > .prepared-card-header .prepared-heading { margin-bottom: 7px; }

.prepared-product-rail[hidden],
#publish-prepared-fields:empty { display: none !important; }

.book-profile-box > summary { display: flex; align-items: center; gap: 8px; }
.book-profile-box > summary span {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.book-profile-purpose {
    margin-bottom: 8px;
    padding: 7px 9px;
    border-left: 3px solid #4f8fce;
    border-radius: 6px;
    background: color-mix(in srgb, #4f8fce 7%, var(--surface));
    color: var(--muted);
    font-size: 11.5px;
}
.book-spec-preview { padding: 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: 11.5px; }
.book-spec-preview > strong { display: block; margin-bottom: 4px; }
.book-profile-fields { margin-top: 8px; border-top: 1px solid var(--border); }
.book-profile-fields > summary { padding: 8px 1px 2px; cursor: pointer; font-weight: 800; }
.book-profile-fields .prepared-form-grid { margin-top: 8px; }

button.media-preview-button {
    overflow: hidden;
    gap: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}
.media-preview-button img {
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: #fff;
}
.media-preview-meta {
    min-height: 42px;
    padding: 6px 7px;
    background: var(--surface);
    color: var(--text);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.35;
}
.media-preview-meta b { display: block; color: var(--brand-dark); font-size: 12px; }

.shoper-publish-workbench { gap: 8px; padding: 10px; background: var(--brand-soft); }
.publish-plan-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: end;
    gap: 9px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
}
.publish-plan-form > #publish-prepared-fields { display: none !important; }
.publication-mode-panel { grid-column: 1; min-width: 0; }
.publish-plan-action { grid-column: 2; justify-content: flex-end; }
.publish-plan-action span { color: var(--muted); font-size: 11px; }
.publication-methods-single { grid-template-columns: minmax(0, 1fr); }
.csv-export-step { padding: 10px; }

.security-settings-grid { align-items: start; gap: 12px; }
.security-settings-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
}
.security-card-heading h3,
.security-card-heading p,
.security-settings-card p { margin: 0; }
.security-card-heading p { margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.security-password-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.security-password-grid label:first-child { grid-column: 1 / -1; }
.security-card-actions { display: flex; align-items: center; justify-content: flex-start; }
.security-login-history { margin-top: 14px; }
.bridge-config-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 12px; }
.bridge-config-grid .security-card-actions { flex-wrap: wrap; gap: 7px; }
.accounting-fact { color: #1769aa; font-weight: 800; }
.accounting-price-field { color: #1769aa; }
.accounting-price-field input { border-color: #4f9bd3; background: #eef8ff; box-shadow: inset 3px 0 0 #2277b7; }
.accounting-price-field small { display: block; margin-top: 3px; color: #1769aa; font-size: 10px; font-weight: 800; }

html[data-theme="dark"] .media-preview-meta { background: #17212b; color: #d5dde5; }
html[data-theme="dark"] .media-preview-meta b { color: #f0b2b5; }
html[data-theme="dark"] .accounting-price-field { color: #82c8f5; }
html[data-theme="dark"] .accounting-price-field input { border-color: #2f79a9; background: #102738; color: #e6f5ff; }
html[data-theme="dark"] .accounting-price-field small { color: #82c8f5; }
html[data-theme="dark"] .accounting-fact { color: #82c8f5; }

/* 0.9.4.3 - wspólny katalog Shopera dla kart Shoper i Subiekt */
.bridge-sync-form { align-items: center; gap: 8px; margin: 8px 0; }
.bridge-catalog-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.7fr) repeat(4, minmax(125px, 1fr));
    align-items: end;
    gap: 7px;
    margin: 9px 0;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-soft);
}
.bridge-catalog-filters label { min-width: 0; margin: 0; font-size: 10.5px; }
.bridge-catalog-filters input,
.bridge-catalog-filters select { min-height: 34px; padding: 5px 7px; font-size: 11.5px; }
.bridge-catalog-product {
    grid-template-columns: 28px minmax(235px, 1.25fr) minmax(170px, .7fr) minmax(270px, 1fr) minmax(190px, .75fr);
}
.bridge-catalog-identity { min-width: 0; }
.bridge-catalog-identity > strong { display: block; line-height: 1.25; }
.bridge-catalog-identity div,
.bridge-catalog-identity small { display: block; margin-top: 2px; color: var(--muted); overflow-wrap: anywhere; }
.bridge-price-inputs { display: grid; grid-template-columns: repeat(2, minmax(115px, 1fr)); gap: 6px; }
.bridge-price-inputs label { min-width: 0; margin: 0; font-size: 10.5px; }
.bridge-price-inputs input { min-height: 34px; padding: 5px 7px; font-size: 12px; }
.bridge-price-inputs small { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; line-height: 1.25; }
.status-border-queued { border-left: 3px solid #6c7a89; opacity: .82; }
.status-border-variant { border-left: 3px solid #8a5bb7; opacity: .86; }
.status-border-incomplete { border-left: 3px solid var(--warning); opacity: .86; }
.status-ready { color: var(--success); }
.status-needs_values,
.status-incomplete { color: var(--warning); }
.status-variant { color: #7650a4; }
.status-queued { color: var(--muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 9px; margin: 10px 0 0; }
.pagination .disabled { opacity: .45; pointer-events: none; }

@media (max-width: 1180px) {
    .bridge-catalog-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .bridge-filter-search { grid-column: span 2; }
    .bridge-catalog-product { grid-template-columns: 26px minmax(0, 1fr) minmax(220px, .85fr); }
    .bridge-product-facts { grid-column: 2; }
    .bridge-price-inputs { grid-column: 3; grid-row: 1 / span 2; }
    .bridge-catalog-product > .status-badge { grid-column: 2 / -1; justify-self: start; text-align: left; }
}

@media (max-width: 720px) {
    .bridge-catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 7px; }
    .bridge-filter-search { grid-column: 1 / -1; }
    .bridge-catalog-product { grid-template-columns: 24px minmax(0, 1fr); }
    .bridge-product-facts,
    .bridge-price-inputs,
    .bridge-catalog-product > .status-badge { grid-column: 2; grid-row: auto; }
    .bridge-price-inputs { grid-template-columns: 1fr; }
    .bridge-sync-form { align-items: stretch; flex-direction: column; }
    .bridge-sync-form button { width: 100%; }
    .pagination { flex-wrap: wrap; }
}

@media (max-width: 800px) {
    .main-menu,
    .workflow-nav {
        position: static;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }
    .main-menu a { flex: 0 0 auto; min-width: 124px; }
    .workflow-nav a { flex: 0 0 auto; min-width: 104px; }
    .publish-plan-form { grid-template-columns: 1fr; }
    .publication-mode-panel,
    .publish-plan-action { grid-column: 1; }
    .publish-plan-action { align-items: stretch; justify-content: flex-start; }
    .publish-plan-action button { width: 100%; }
}

@media (max-width: 760px) {
    .security-settings-grid,
    .bridge-config-grid,
    .security-password-grid { grid-template-columns: 1fr; }
    .security-password-grid label:first-child { grid-column: 1; }
}

/* 0.9.4.7 - produkt główny z wariantami, lekka synchronizacja i zwarty edytor mobilny */
html,
body { max-width: 100%; }
html { scroll-padding-top: calc(env(safe-area-inset-top) + 10px); }
body { overflow-x: hidden; }
[id] { scroll-margin-top: calc(env(safe-area-inset-top) + 10px); }
.container > *,
.card > *,
.section-heading > *,
.section-title-row > *,
.workflow-guide-heading > *,
.app-brand > div { min-width: 0; }
img,
svg,
video { max-width: 100%; height: auto; }
input,
select,
textarea,
button,
.button { max-width: 100%; }
details > summary { overflow-wrap: anywhere; }
pre { width: 100%; }

/* Tylko bieżąca pozycja menu otrzymuje wyróżnienie aktywnego widoku. */
.main-menu a { min-width: 0; }
.main-menu a:nth-child(n + 5):not(.active) { background: var(--surface-soft); }

.page-section-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 5px;
    margin: 0 0 10px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
}
.page-section-nav a {
    display: grid;
    min-height: 36px;
    place-items: center;
    padding: 6px 9px;
    border-radius: 7px;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}
.page-section-nav a:hover,
.page-section-nav a:focus-visible { background: var(--brand-soft); color: var(--brand-dark); }

/* Komunikat jest jedyną kopią informacji. Na telefonie pozostaje w przepływie
   strony, dzięki czemu nie zasłania nagłówków, formularzy ani paska przeglądarki. */
.toast-stack {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.app-toast { line-height: 1.4; overflow-wrap: anywhere; }
.app-toast-message { min-width: 0; }
.app-toast button { align-self: start; flex: 0 0 auto; }

.responsive-table {
    max-width: 100%;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}
.responsive-table.is-scrollable {
    border-inline: 1px solid var(--border);
    box-shadow: inset -12px 0 14px -16px rgba(15, 23, 42, .7);
}
.responsive-table:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 2px; }

.diagnostic-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 10px; }
.diagnostic-result { min-width: 0; min-height: 0; }
.diagnostic-result.ok { border-color: var(--state-ok-border); background: var(--state-ok-bg); }
.diagnostic-result.fail { border-color: var(--state-error-border); background: var(--state-error-bg); }
.diagnostic-result strong,
.diagnostic-result span,
.diagnostic-result small { overflow-wrap: anywhere; }
html[data-theme="dark"] .diagnostic-result.ok { border-color: #34784d; background: #18291f; }
html[data-theme="dark"] .diagnostic-result.fail { border-color: #7d3a40; background: #3b1d20; }

.section-heading,
.section-title-row { align-items: flex-start; }
.section-heading h2,
.section-title-row h2 { margin-bottom: 3px; }
.test-actions form,
.header-actions form,
.compact-actions form { margin: 0; }
.test-actions button { width: auto; }

.install-section-title { margin-top: 24px; }
.install-submit-row { margin-top: 20px; }
.environment-table { width: 100%; min-width: 0 !important; border-collapse: collapse; }
.mobile-card-table table { min-width: 640px; }
.environment-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.environment-table td:last-child { width: 90px; font-weight: 850; text-align: right; }

@media (max-width: 800px) {
    .main-menu {
        position: static;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        overflow: visible;
    }
    .main-menu a {
        display: grid;
        min-width: 0;
        min-height: 42px;
        place-items: center;
        padding: 6px 4px;
        font-size: 11.5px;
        line-height: 1.15;
        text-align: center;
        white-space: normal;
    }
    .workflow-nav {
        position: static;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        overflow: visible;
    }
    .workflow-nav a {
        min-width: 0;
        min-height: 38px;
        padding: 6px 5px;
        font-size: 11px;
        line-height: 1.2;
        white-space: normal;
    }
    .section-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }
    .section-heading > form,
    .section-heading > .actions { grid-column: 1 / -1; width: 100%; }
    .section-heading > form button { width: 100%; }
}

@media (max-width: 760px) {
    .toast-stack {
        position: static;
        inset: auto;
        width: 100%;
        max-height: none;
        margin: 8px 0 10px;
        overflow: visible;
    }
    .app-toast { width: 100%; box-shadow: 0 5px 18px rgba(15, 23, 42, .12); }

    .diagnostic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .diagnostic-result { padding: 8px; font-size: 11.5px; }

    .mobile-card-table table,
    .mobile-card-table tbody { display: block; min-width: 0; width: 100%; }
    .mobile-card-table thead { display: none; }
    .mobile-card-table tbody { display: grid; gap: 7px; }
    .mobile-card-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px 9px;
        padding: 9px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface);
    }
    .mobile-card-table td {
        display: grid;
        min-width: 0;
        gap: 2px;
        padding: 0;
        border: 0;
        overflow-wrap: anywhere;
    }
    .mobile-card-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 9.5px;
        font-weight: 750;
        text-transform: uppercase;
    }

    .family-parent-grid,
    .family-member-cards { grid-template-columns: minmax(0, 1fr); }
    .family-preview,
    .family-card { overflow: hidden; }

    .settings-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .configuration-shortcut,
    .compact-module-intro { align-items: stretch; }
    .configuration-shortcut .button,
    .compact-module-intro .button { width: 100%; }

    .image-preview-dialog,
    .validation-dialog {
        width: calc(100% - 12px);
        max-height: calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
    .validation-dialog-panel { max-height: inherit; }
}

@media (max-width: 640px) {
    .container {
        width: 100%;
        padding: max(8px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) calc(38px + env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
        overflow: visible;
    }
    header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 7px;
        padding: 7px;
    }
    .app-brand { gap: 7px; }
    .brand-logo { width: 38px; height: auto; }
    .app-brand h1 { font-size: clamp(18px, 5.6vw, 22px); line-height: 1.08; }
    .app-brand .muted { font-size: 10px; line-height: 1.25; }
    .header-actions {
        display: flex;
        width: auto;
        align-items: center;
        justify-content: flex-end;
        gap: 5px;
    }
    .header-actions button,
    .header-actions .button { width: auto; min-width: 36px; }
    .theme-toggle [data-theme-label] { display: none; }

    .prepared-variant-control { grid-template-columns: minmax(0, 1fr); }
    .prepared-variant-control > button { width: 100%; }
    .variant-product-dialog { width: calc(100vw - 10px); max-height: calc(100dvh - 10px); }
    .variant-product-dialog-panel { max-height: calc(100dvh - 12px); padding: 10px; }
    .variant-product-dialog-header { position: sticky; z-index: 2; top: -10px; margin: -10px -10px 10px; padding: 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
    button.variant-product-dialog-close { width: 38px; }
    .family-parent-summary { grid-template-columns: minmax(0, 1fr); }
    .family-parent-summary p { grid-column: auto; }
    .stock-variant-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-variant-grid .stock-variant-image { grid-column: span 2; }

    .card,
    .next-step-box,
    .prepared-card { padding: 9px; }
    .section-title-row {
        display: grid;
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 8px;
    }
    .section-title-row h2 { font-size: 18px; line-height: 1.15; }
    .section-title-row p { font-size: 11.5px; line-height: 1.35; }
    .step-number { width: 32px; height: 32px; flex-basis: 32px; }
    .section-heading { grid-template-columns: 1fr; }
    .section-heading > .status-badge { justify-self: start; }

    .actions,
    .test-actions,
    .compact-actions { align-items: stretch; }
    .test-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
    .test-actions button,
    .test-actions .button { width: 100%; }
    .inline-form { display: grid; grid-template-columns: 1fr; }
    .inline-form button { width: 100%; }

    .responsive-table table { min-width: 680px; }
    .mobile-card-table table { min-width: 0; }
    .pagination .button { width: auto; min-width: 92px; }
    .scan-continuation { display: grid; grid-template-columns: 1fr; }
    .scan-continuation button { width: 100%; }
    .product-result-pagination { display: grid; grid-template-columns: 1fr; text-align: center; }
    .product-result-pagination .button { width: 100%; }
    .page-section-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .page-section-nav a { min-height: 34px; padding: 5px 4px; font-size: 10.5px; }
}

@media (max-width: 430px) {
    .stock-variant-grid { grid-template-columns: minmax(0, 1fr); }
    .stock-variant-grid .stock-variant-image { grid-column: auto; }
    .stock-variant-flags { display: grid; grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 380px) {
    .main-menu { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .workflow-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .diagnostic-grid,
    .settings-hub-grid { grid-template-columns: 1fr; }
    .mobile-card-table tr { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .app-toast { animation: none; }
}
