/* WAM 2.6.2 — Bulk migration queue UI */

.wam-bulk-queue {
    --wam-bq-border: #dcdcde;
    --wam-bq-bg: #f6f7f7;
    --wam-bq-accent: #2271b1;
    --wam-bq-ok: #0f5132;
    --wam-bq-warn-bg: #fff8e5;
    max-width: 1100px;
    margin: 16px 0 24px;
    font-size: 14px;
}

.wam-bq-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
    gap: 16px;
    align-items: start;
}

@media (max-width: 860px) {
    .wam-bq-layout {
        grid-template-columns: 1fr;
    }
}

.wam-bq-categories,
.wam-bq-queue {
    background: #fff;
    border: 1px solid var(--wam-bq-border);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.wam-bq-mode-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.wam-bq-mode-tab {
    flex: 1;
    border: 1px solid var(--wam-bq-border);
    background: var(--wam-bq-bg);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
    color: #1d2327;
}

.wam-bq-mode-tab.is-active {
    background: #fff;
    border-color: var(--wam-bq-accent);
    box-shadow: inset 0 0 0 1px var(--wam-bq-accent);
    font-weight: 600;
}

.wam-bq-hint-compact {
    margin: 0 0 8px;
    font-size: 12px;
    color: #646970;
}

.wam-bq-product-item .wam-bq-cat-name {
    white-space: normal;
    line-height: 1.35;
}

.wam-bq-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.wam-bq-section-head h3 {
    margin: 0;
    font-size: 15px;
}

.wam-bq-filter {
    width: 140px;
    max-width: 45%;
    padding: 4px 8px;
    border: 1px solid var(--wam-bq-border);
    border-radius: 4px;
}

#wam-bq-panel-products .wam-bq-filter {
    width: 100%;
    max-width: none;
}

.wam-bq-cat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #646970;
    flex-wrap: wrap;
}

.wam-bq-add-product-btn {
    font-size: 12px !important;
    padding: 4px 10px !important;
    line-height: 1.4 !important;
}

.wam-bq-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--wam-bq-border);
    border-radius: 6px;
    background: var(--wam-bq-bg);
}

.wam-bq-cat-list li {
    margin: 0;
    border-bottom: 1px solid #ececec;
}

.wam-bq-cat-list li:last-child {
    border-bottom: none;
}

.wam-bq-cat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    cursor: pointer;
}

.wam-bq-cat-item:hover {
    background: #eef3f8;
}

.wam-bq-cat-item.is-in-queue {
    opacity: 0.55;
}

.wam-bq-cat-item.is-in-queue input {
    pointer-events: none;
}

.wam-bq-cat-item.is-product-cat {
    background: #eef6ff;
    border-left: 3px solid var(--wam-bq-accent);
}

.wam-bq-cat-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wam-bq-cat-count {
    font-size: 12px;
    color: #646970;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 1px 8px;
    white-space: nowrap;
}

.wam-bq-queue-list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    counter-reset: wam-bq;
}

.wam-bq-queue-list li {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--wam-bq-bg);
    border: 1px solid var(--wam-bq-border);
    border-radius: 6px;
}

.wam-bq-queue-list li::before {
    counter-increment: wam-bq;
    content: counter(wam-bq);
    font-weight: 700;
    color: var(--wam-bq-accent);
    min-width: 1.5em;
}

.wam-bq-queue-name {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wam-bq-queue-meta {
    font-size: 12px;
    color: #646970;
    white-space: nowrap;
}

.wam-bq-queue-migr {
    font-weight: 600;
    color: #1d2327;
}

.wam-bq-queue-move {
    display: flex;
    gap: 2px;
    align-items: center;
}

a.wam-bq-queue-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 13px;
    line-height: 1;
}

.wam-bq-queue-view.is-loading {
    opacity: 0.45;
    cursor: wait;
}

.wam-bq-icon-btn {
    border: 1px solid var(--wam-bq-border);
    background: #fff;
    border-radius: 4px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.wam-bq-icon-btn:hover:not(:disabled) {
    border-color: var(--wam-bq-accent);
    color: var(--wam-bq-accent);
}

.wam-bq-icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.wam-bq-hint,
.wam-bq-footnote,
.wam-bq-muted {
    color: #646970;
    font-size: 12px;
    margin: 6px 0;
}

.wam-bq-stats {
    display: flex;
    gap: 16px;
    margin: 12px 0;
    padding: 10px 12px;
    background: #eef6ff;
    border-radius: 6px;
    border: 1px solid #c5d9ed;
}

.wam-bq-batch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 10px 0;
    font-size: 13px;
}

.wam-bq-batch-opt {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.wam-bq-batch-num {
    width: 64px;
    padding: 2px 6px;
}

.wam-bq-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.wam-bq-btn {
    border-radius: 4px;
    border: 1px solid var(--wam-bq-border);
    background: #f0f0f1;
    color: #1d2327;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13px;
}

.wam-bq-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.wam-bq-btn-primary {
    background: var(--wam-bq-accent);
    border-color: #135e96;
    color: #fff;
}

.wam-bq-btn-accent {
    background: #f0f6fc;
    border-color: #72aee6;
    color: #135e96;
}

.wam-bq-btn-repair {
    background: #fff4e5;
    border-color: #dba617;
    color: #6f4e00;
}

.wam-bq-btn-repair-sm {
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1.4;
    min-width: 2.2em;
}

.wam-bq-audit-fix-all {
    margin-left: 4px;
    vertical-align: middle;
}

.wam-bq-fix-cell {
    text-align: center;
    white-space: nowrap;
}

.wam-bq-inline-fix {
    margin-left: 6px;
    vertical-align: middle;
}

.wam-bq-btn-migrate {
    background: #f3f0ff;
    border-color: #7c5cdb;
    color: #4a2f9e;
}

.wam-bq-btn-pipeline {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    font-weight: 600;
}

.wam-bq-btn-pipeline:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
    color: #fff;
}

.wam-bq-btn-stop {
    background: #fcf0f1;
    border-color: #d63638;
    color: #8a2424;
}

.wam-bq-job-summary {
    margin-top: 10px;
    padding: 10px 14px;
    background: #e8f4fd;
    border: 1px solid #9ec5e8;
    border-radius: 6px;
    font-size: 14px;
}

.wam-bq-job-time {
    padding: 8px 10px;
    margin-bottom: 6px;
    background: #e8f4fd;
    border-radius: 4px;
    font-size: 13px;
}

.wam-bq-view-title-lv {
    color: #b45309;
}

.wam-bq-diff-link {
    font-weight: 600;
    white-space: nowrap;
}

.wam-bq-repair-progress {
    margin-top: 12px;
}

.wam-bq-progress-bar {
    height: 8px;
    background: #ececec;
    border-radius: 4px;
    overflow: hidden;
}

.wam-bq-progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #dba617, #2271b1);
    transition: width 0.3s ease;
}

/* 2.10.1 — parallel worker lanes (2 products in flight). */
.wam-bq-workers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.wam-bq-worker-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: #f0f6fc;
    border: 1px solid #c5d9ed;
    color: #1d2327;
}

.wam-bq-worker-chip.is-busy {
    background: #fff8e5;
    border-color: #dba617;
}

.wam-bq-worker-time {
    margin-left: 4px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: #646970;
}

.wam-bq-worker-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dba617;
    animation: wam-bq-pulse 1.1s ease-in-out infinite;
}

@keyframes wam-bq-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1); }
}

.wam-bq-workers-meta {
    font-size: 12px;
    color: #646970;
}

.wam-bq-repair-log {
    margin-top: 14px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--wam-bq-border);
    border-radius: 6px;
    max-height: 200px;
    overflow: auto;
    font-size: 13px;
}

.wam-bq-repair-line {
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}

.wam-bq-log-links {
    display: inline;
    white-space: normal;
}

.wam-bq-log-links .wam-bq-view-link {
    position: relative;
    z-index: 1;
}

.wam-bq-copy-json,
.wam-bq-copy-json-all {
    font-size: 12px;
    padding: 2px 8px;
    margin-left: 4px;
    vertical-align: middle;
}

.wam-bq-inline-head .wam-bq-copy-json {
    margin-left: 8px;
}

.wam-bq-view-link {
    display: inline-block;
    margin-right: 4px;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}

.wam-bq-lang-chip {
    font-size: 11px;
    letter-spacing: 0.02em;
}

.wam-bq-view-link:hover {
    text-decoration: underline;
}

.wam-bq-view-edit {
    color: #646970;
}

.wam-bq-links-cell {
    white-space: nowrap;
    font-size: 12px;
}

.wam-bq-btn-secondary {
    background: #fff;
}

.wam-bq-notice {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #c5d9ed;
    background: #eef6ff;
    font-size: 14px;
    line-height: 1.45;
}

.wam-bq-notice.is-ok {
    border-color: #badbcc;
    background: #d1e7dd;
    color: #0f5132;
}

.wam-bq-notice.is-err {
    border-color: #f5c2c7;
    background: #f8d7da;
    color: #842029;
}

.wam-bq-notice.is-info {
    border-color: #c5d9ed;
    background: #eef6ff;
    color: #135e96;
}

.wam-bq-audit-wrap {
    margin-top: 16px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--wam-bq-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.wam-bq-audit-top {
    margin-bottom: 10px;
    font-size: 14px;
}

.wam-bq-audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.wam-bq-audit-table th,
.wam-bq-audit-table td {
    border: 1px solid var(--wam-bq-border);
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}

.wam-bq-audit-table th {
    background: var(--wam-bq-bg);
    font-weight: 600;
}

.wam-bq-audit-table tr.wam-bq-row-repair {
    background: #fff8e5;
}

.wam-bq-audit-table tr.wam-bq-row-missing {
    background: #f8d7da;
}

.wam-bq-audit-table tr.wam-bq-row-fixed {
    background: #eef9f0;
}

.wam-bq-ba-cell {
    min-width: 108px;
    font-size: 12px;
    line-height: 1.35;
}

.wam-bq-ba-migr {
    color: #555;
    font-size: 11px;
}

.wam-bq-ba-pending {
    color: #999;
}

.wam-bq-ba-improved {
    color: #0a6b2d;
}

.wam-bq-ba-worse {
    color: #b02a37;
}

.wam-mcd-gate-pass {
    color: #0a6b2d;
    font-weight: 600;
}

.wam-mcd-pct-muted {
    color: #888;
    font-size: 11px;
}

.wam-bq-repair-note {
    color: #856404;
    font-size: 11px;
}

.wam-bq-btn.is-busy {
    opacity: 0.7;
    pointer-events: none;
}

.wam-bq-btn.is-synced {
    background: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.wam-bq-status {
    margin-top: 10px;
    min-height: 1.2em;
    font-size: 13px;
}

.wam-bq-status.is-ok {
    color: var(--wam-bq-ok);
}

.wam-bq-status.is-err {
    color: #b32d2e;
}

.wam-checklist-wrap .wam-bq-categories,
.wam-checklist-wrap .wam-bq-queue {
    background: #fafafa;
}

.wam-checklist-wrap #wam-bulk-queue-wrap {
    margin-top: 12px;
}

.wam-bq-admin-wrap .wam-bulk-queue {
    max-width: none;
}

.wam-bq-admin-wrap .wam-bq-cat-list {
    max-height: 520px;
}

/* 2.7.4 — inline content diff (lazy) */
.wam-bq-content-toggle {
    border: 1px solid var(--wam-bq-border);
    background: #fff;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.4;
}

.wam-bq-content-toggle:hover {
    border-color: var(--wam-bq-accent);
    color: var(--wam-bq-accent);
}

.wam-bq-content-toggle:disabled {
    opacity: 0.6;
    cursor: wait;
}

.wam-bq-content-detail td {
    background: #f8fafc;
    padding: 12px 14px !important;
    border-top: none;
}

.wam-bq-content-inline {
    max-width: 100%;
    overflow-x: auto;
}

.wam-bq-inline-head {
    margin-bottom: 10px;
    font-size: 13px;
}

.wam-bq-inline-h4 {
    margin: 14px 0 6px;
    font-size: 13px;
}

.wam-bq-inline-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 8px;
}

.wam-bq-inline-table th,
.wam-bq-inline-table td {
    border: 1px solid var(--wam-bq-border);
    padding: 6px 8px;
    vertical-align: top;
}

.wam-bq-inline-table th {
    background: #fff;
    text-align: left;
}

.wam-bq-inline-title {
    max-width: 280px;
    word-break: break-word;
}

.wam-bq-inline-title-link {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 6px;
    color: var(--wam-bq-accent);
    text-decoration: none;
    max-width: 100%;
}

.wam-bq-inline-title-text {
    color: inherit;
    word-break: break-word;
}

.wam-bq-lang-badge {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.wam-bq-inline-title-link:hover {
    text-decoration: underline;
}

.wam-bq-inline-hint,
.wam-bq-inline-err {
    font-size: 12px;
    color: #646970;
    margin: 8px 0 0;
}

.wam-bq-inline-err {
    color: #b32d2e;
}

.wam-mcd-preview {
    max-width: 280px;
    font-size: 11px;
}

.wam-mcd-details {
    margin: 0;
}

.wam-mcd-details summary {
    cursor: pointer;
    color: var(--wam-bq-accent);
    font-size: 11px;
}

.wam-mcd-details summary:hover {
    text-decoration: underline;
}

.wam-mcd-full {
    margin: 6px 0 0;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--wam-bq-border);
    border-radius: 4px;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 11px;
    line-height: 1.45;
}

.wam-mcd-lang-table td {
    font-size: 11px;
}

.wam-mcd-pass { background: #f0fdf4; }
.wam-mcd-warn { background: #fefce8; }
.wam-mcd-fail { background: #fef2f2; }
.wam-mcd-ai { background: #f8fafc; }

.wam-bq-inline-group td {
    background: #eef2f7 !important;
    font-size: 11px;
    font-weight: 600;
    color: #50575e;
    padding: 5px 8px !important;
}

.wam-bq-ai-timing {
    white-space: nowrap;
}

.wam-bq-ai-time {
    font-weight: 600;
    color: #0f5132;
}

.wam-bq-ai-err {
    color: #b32d2e;
}

.wam-bq-log-api-time {
    color: #50575e;
    font-size: 11px;
}

.wam-bq-timing {
    margin: 12px 0;
    padding: 10px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
}

.wam-bq-timing-table td,
.wam-bq-timing-table th {
    font-size: 12px;
}

.wam-bq-timing-total td,
.wam-bq-timing-wall td {
    background: #ecfdf5;
}

.wam-bq-timing-errors {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 12px;
}

.wam-bq-timing-err {
    color: #b32d2e;
    margin-bottom: 4px;
}

.wam-bq-verify {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid var(--wam-bq-border);
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
}

.wam-bq-verify-ok {
    background: #f0fdf4;
    border-color: #badbcc;
    color: var(--wam-bq-ok);
}

.wam-bq-verify-list {
    margin: 8px 0 0;
    padding-left: 18px;
}

.wam-bq-verify-list li {
    margin-bottom: 6px;
}

.wam-bq-verify-fail {
    color: #b32d2e;
}

.wam-bq-verify-warn {
    color: #856404;
}

.wam-bq-verify-btn {
    margin-left: 6px;
    border: 1px solid var(--wam-bq-accent);
    background: #fff;
    color: var(--wam-bq-accent);
    border-radius: 4px;
    padding: 1px 8px;
    font-size: 11px;
    cursor: pointer;
}

.wam-bq-verify-btn:hover {
    background: var(--wam-bq-accent);
    color: #fff;
}
