/* ============================================
   Parts Catalog — Dark Industrial Theme
============================================ */
:root {
    /* Dark industrial backgrounds */
    --cat-bg: #000000;
    --cat-surface: #1f2937;
    --cat-surface-alt: #374151;
    --cat-surface-hover: #374151;
    --cat-surface-elevated: #1f2937;
    /* Borders */
    --cat-border: #374151;
    --cat-border-light: #374151;
    --cat-border-accent: rgba(255, 193, 7, 0.4);
    /* Text hierarchy */
    --cat-text: #e8ecf1;
    --cat-text-muted: #9ca3af;
    --cat-text-light: #4b5563;
    --cat-text-bright: #ffffff;
    /* Brand colors */
    --cat-accent: #ffc107;
    --cat-accent-hover: #e6ac00;
    --cat-accent-glow: rgba(255, 193, 7, 0.2);
    --cat-accent-soft: rgba(255, 193, 7, 0.08);
    --cat-highlight: #ffc107;
    --cat-highlight-soft: rgba(255, 193, 7, 0.08);
    --cat-highlight-glow: rgba(255, 193, 7, 0.15);
    /* Selection states */
    --cat-selected-bg: rgba(255, 193, 7, 0.12);
    --cat-selected-border: #ffc107;
    --cat-active-row-bg: rgba(255, 193, 7, 0.15);
    /* Geometry */
    --cat-radius: 4px;
    --cat-radius-lg: 6px;
    /* Shadows */
    --cat-shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --cat-shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
    --cat-shadow-lg: 0 8px 24px rgba(0,0,0,0.5), 0 4px 8px rgba(0,0,0,0.3);
    --cat-shadow-glow-green: 0 0 15px rgba(255, 193, 7, 0.15);
    --cat-shadow-glow-yellow: 0 0 10px rgba(255, 193, 7, 0.1);
    --cat-shadow-inset: inset 0 1px 0 rgba(255,255,255,0.03);
}

/* ---- Equipment info bar ---- */
.cat-equipment-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--cat-surface-alt);
    color: #fff;
    padding: 0 1rem;
    height: 44px;
    font-size: 0.88rem;
    border-bottom: 2px solid var(--cat-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.cat-equip-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cat-equip-info i { opacity: 0.8; }
.cat-equip-info strong { color: var(--cat-highlight); }

.cat-equip-change {
    background: var(--cat-bg);
    color: var(--cat-accent);
    border: 1px solid var(--cat-accent);
    border-radius: var(--cat-radius);
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
}

.cat-equip-change:hover { background: var(--cat-accent); color: #000; }

/* ---- 3-panel container ---- */
.cat-container {
    display: flex;
    height: calc(100vh - 200px);
    min-height: 500px;
    background: var(--cat-bg);
    border-top: 1px solid var(--cat-border);
}

/* ---- Component sidebar (left, 240px) ---- */
.cat-comp-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--cat-surface);
    border-right: 2px solid var(--cat-accent);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cat-sidebar-header {
    padding: 0.75rem 1rem;
    background: var(--cat-surface-alt);
    border-bottom: 1px solid var(--cat-accent);
    flex-shrink: 0;
}

.cat-sidebar-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0;
}

.cat-sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--cat-accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cat-sidebar-icon { color: var(--cat-accent); font-size: 0.75rem; }

.cat-sidebar-count {
    background: var(--cat-accent);
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    min-width: 22px;
    text-align: center;
    line-height: 1.3;
}

.cat-sidebar-accent-line {
    display: none;
}

.cat-comp-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem 0;
    margin: 0;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: #475569 var(--cat-bg);
}

.cat-comp-list::-webkit-scrollbar { width: 8px; }
.cat-comp-list::-webkit-scrollbar-track { background: var(--cat-bg); }
.cat-comp-list::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
.cat-comp-list::-webkit-scrollbar-thumb:hover { background: var(--cat-accent); }

.cat-comp-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    color: var(--cat-text-muted);
    font-size: 0.8125rem;
    font-family: Consolas, Monaco, monospace;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--cat-border);
    background: var(--cat-bg);
}

.cat-comp-link:hover {
    color: var(--cat-text);
    background: var(--cat-surface);
    border-left-color: rgba(255,193,7,0.3);
}

.cat-comp-link:hover .cat-comp-arrow {
    opacity: 1;
    transform: translateX(0);
}

.cat-comp-link.active {
    color: var(--cat-text-bright);
    background: var(--cat-selected-bg);
    border-left-color: var(--cat-accent);
    font-weight: 600;
}

.cat-comp-link.active .cat-comp-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--cat-highlight);
}

.cat-comp-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-comp-arrow {
    font-size: 0.6rem;
    color: var(--cat-text-light);
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* ---- Canvas panel (center, fills remaining) ---- */
.cat-canvas-panel {
    flex: 1;
    position: relative;
    min-width: 0;
    background: #1e1e1e;
    border-right: 2px solid var(--cat-accent);
    border-left: 2px solid var(--cat-accent);
}

.cat-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.cat-canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    touch-action: none;
    background: #1e1e1e;
}

.cat-angle-bar {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cat-surface-alt);
    color: var(--cat-accent);
    border: 2px solid var(--cat-accent);
    border-radius: var(--cat-radius);
    padding: 6px 18px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: var(--cat-shadow-md);
}

.cat-angle-bar:hover {
    background: var(--cat-accent);
    color: #000;
    box-shadow: 0 0 10px rgba(255,193,7,0.3), var(--cat-shadow-md);
    transform: translateX(-50%) scale(1.03);
}

.cat-angle-bar:active {
    transform: translateX(-50%) scale(0.97);
}


/* SVG leader lines */
.cat-canvas-wrapper svg.leader-lines {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 50;
    overflow: visible;
}

/* Loading */
.cat-loading {
    position: absolute;
    inset: 0;
    background: rgba(15,18,21,0.92);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 10;
    color: var(--cat-text-muted);
    font-size: 0.85rem;
}

.cat-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--cat-border);
    border-top: 3px solid var(--cat-accent);
    border-radius: 50%;
    animation: catSpin 0.8s linear infinite;
}

@keyframes catSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading progress bar */
.cat-progress-bar {
    width: 200px;
    height: 4px;
    background: var(--cat-border);
    border-radius: 2px;
    overflow: hidden;
}

.cat-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--cat-accent), var(--cat-highlight));
    border-radius: 2px;
    transition: width 0.2s ease;
}

/* Placeholder */
.cat-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--cat-text-light);
    font-size: 1rem;
    gap: 0.75rem;
}

.cat-placeholder i { font-size: 2.5rem; opacity: 0.4; }

/* ---- Drill-down breadcrumbs ---- */
.cat-drill-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--cat-surface);
    border-bottom: 1px solid var(--cat-border);
    z-index: 10;
    min-height: 36px;
    flex-shrink: 0;
}
.cat-drill-back-btn {
    width: 28px; height: 28px;
    background: var(--cat-bg);
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    color: var(--cat-accent);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.cat-drill-back-btn:hover {
    background: var(--cat-accent);
    color: #000;
}
.drill-breadcrumb-trail {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    flex: 1;
}
.drill-breadcrumb-item {
    background: none;
    border: none;
    color: var(--cat-text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    transition: all 0.15s;
}
.drill-breadcrumb-item:hover:not(.drill-breadcrumb-active) {
    background: var(--cat-surface-hover);
    color: var(--cat-accent);
}
.drill-breadcrumb-active {
    color: var(--cat-accent);
    font-weight: 600;
    cursor: default;
}
.drill-breadcrumb-sep {
    color: var(--cat-text-light);
    font-size: 0.6rem;
    opacity: 0.5;
}
.cat-drill-icon {
    color: var(--cat-accent);
    margin-left: 6px;
    font-size: 0.7rem;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.15s;
}
tr:hover .cat-drill-icon {
    opacity: 1;
}

/* ---- View controls ---- */
.cat-view-controls {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10001;
}

.cat-vc-btn {
    width: 34px; height: 34px;
    background: var(--cat-surface);
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    color: var(--cat-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--cat-shadow-md);
}

.cat-vc-btn:hover {
    background: var(--cat-surface-hover);
    color: var(--cat-accent);
    border-color: var(--cat-accent);
    box-shadow: 0 0 10px rgba(255,193,7,0.2);
}

.cat-vc-btn.active {
    background: var(--cat-accent);
    color: #000;
    border-color: var(--cat-accent);
}

/* ---- Numbered callouts ---- */
.catalog-callout {
    position: absolute;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: #fff;
    color: #222;
    border: 2px solid #444;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    z-index: 100;
    transform: translate(-50%, -50%);
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.catalog-callout:hover,
.catalog-callout.hovered {
    background: var(--cat-highlight);
    border-color: #333;
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 2px 12px rgba(243,225,0,0.4);
}

.catalog-callout.active {
    background: var(--cat-highlight);
    border-color: var(--cat-accent);
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 0 4px rgba(255,193,7,0.3), 0 2px 12px rgba(255,193,7,0.3);
    z-index: 200;
}

/* Callout tooltip */
.cat-callout-tip {
    position: absolute;
    background: rgba(33,37,41,0.92);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 110;
    display: none;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: var(--cat-shadow-md);
}

.cat-callout-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(33,37,41,0.92);
}

/* ---- Parts panel (right, 370px) ---- */
.cat-parts-panel {
    width: 370px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--cat-bg);
    overflow: hidden;
}

.cat-parts-header {
    padding: 0.75rem 1rem;
    background: var(--cat-surface-alt);
    border-bottom: 1px solid var(--cat-accent);
    flex-shrink: 0;
}

.cat-parts-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0;
}

.cat-parts-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--cat-accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cat-parts-icon { color: var(--cat-highlight); font-size: 0.75rem; }

.cat-parts-count {
    background: var(--cat-highlight);
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    min-width: 22px;
    text-align: center;
    line-height: 1.3;
}

.cat-parts-accent-line {
    display: none;
}

/* Search box */
.cat-search-box {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--cat-border);
    background: var(--cat-surface);
}

.cat-search-wrap {
    position: relative;
    flex: 1;
}

.cat-search-wrap i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cat-text-light);
    font-size: 0.78rem;
    transition: color 0.2s;
    pointer-events: none;
    z-index: 1;
}

.cat-search-wrap input {
    width: 100%;
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    padding: 7px 10px 7px 32px;
    font-size: 0.82rem;
    outline: none;
    transition: all 0.25s ease;
    color: var(--cat-text);
    background: var(--cat-bg);
    box-sizing: border-box;
}

.cat-search-wrap input:focus {
    border-color: var(--cat-accent);
    background: var(--cat-bg);
}

.cat-search-wrap:focus-within i { color: var(--cat-accent); }

.cat-search-wrap input::placeholder { color: var(--cat-text-light); }

/* Parts list */
.cat-parts-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #475569 var(--cat-bg);
}

.cat-parts-list::-webkit-scrollbar { width: 8px; }
.cat-parts-list::-webkit-scrollbar-track { background: var(--cat-bg); }
.cat-parts-list::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
.cat-parts-list::-webkit-scrollbar-thumb:hover { background: var(--cat-accent); }

.cat-empty-msg {
    color: var(--cat-text-light);
    font-size: 0.88rem;
    text-align: center;
    padding: 2.5rem 1rem;
    margin: 0;
}

.cat-empty-msg i {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.3;
}

/* Parts table */
.cat-parts-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
}

.cat-parts-table thead th {
    position: sticky;
    top: 0;
    background: var(--cat-surface-alt);
    color: var(--cat-text-muted);
    padding: 0.55rem 0.85rem;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid var(--cat-accent);
    z-index: 2;
    box-shadow: var(--cat-shadow-inset);
}

.cat-parts-table thead th:first-child {
    text-align: center;
    width: 48px;
}

.cat-parts-table tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--cat-border-light);
    border-left: 3px solid transparent;
    position: relative;
}

.cat-parts-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.015);
}

.cat-parts-table tbody tr:hover,
.cat-parts-table tbody tr.hovered {
    background: var(--cat-surface-hover);
    border-left-color: rgba(255,193,7,0.3);
}

.cat-parts-table tbody tr:hover .cat-num-badge,
.cat-parts-table tbody tr.hovered .cat-num-badge {
    border-color: var(--cat-accent);
    box-shadow: 0 0 6px rgba(255,193,7,0.2);
}

.cat-parts-table tbody tr:hover .cat-desc-cell,
.cat-parts-table tbody tr.hovered .cat-desc-cell {
    color: var(--cat-text);
}

.cat-parts-table tbody tr.active {
    background: var(--cat-active-row-bg);
    border-left-color: var(--cat-highlight);
}

.cat-parts-table tbody tr.active td {
    font-weight: 600;
    color: var(--cat-text-bright);
}

.cat-parts-table tbody tr.filter-hidden { display: none; }

.cat-parts-table td {
    padding: 0.55rem 0.85rem;
    vertical-align: middle;
    transition: color 0.15s;
}

.cat-num-cell {
    width: 48px;
    text-align: center;
}

.cat-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid #555;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--cat-surface-alt);
    color: var(--cat-text);
    transition: all 0.2s ease;
    box-shadow: var(--cat-shadow-sm);
}

.cat-parts-table tbody tr.active .cat-num-badge {
    background: var(--cat-highlight);
    border-color: var(--cat-accent);
    color: #1a1e23;
    box-shadow: 0 0 10px rgba(243,225,0,0.3), var(--cat-shadow-sm);
    transform: scale(1.1);
}

.cat-pn-cell {
    font-family: Consolas, Monaco, monospace;
    font-size: 0.8rem;
    color: var(--cat-highlight);
    letter-spacing: 0.3px;
}

.cat-pn-empty { color: var(--cat-text-light); }

.cat-qty-cell {
    text-align: center;
    width: 48px;
    vertical-align: middle;
}

.cat-multiplier {
    color: var(--cat-accent);
    background: rgba(255,193,7,0.15);
    border: 1px solid rgba(255,193,7,0.3);
    padding: 0 0.375rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
    margin-left: 0.35rem;
}

.cat-desc-cell {
    color: var(--cat-text-muted);
    word-break: break-word;
    line-height: 1.3;
}

/* Catalog footer note for uncataloged parts */
.cat-parts-footer-note {
    padding: 0.5rem 0.85rem;
    font-size: 0.72rem;
    color: var(--cat-text-light);
    border-top: 1px solid var(--cat-border-light);
    text-align: center;
}

/* ---- Detail overlay (floating on canvas, compact bottom-right) ---- */
.cat-detail-card {
    display: none;
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: auto;
    max-width: 280px;
    background: linear-gradient(135deg, rgba(46,139,87,0.8), rgba(243,225,0,0.2));
    border: 2px solid var(--cat-accent);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
    box-sizing: border-box;
    padding: 10px;
}

.cat-detail-card.visible {
    display: block;
    animation: detailFadeIn 0.25s ease-out;
}

@keyframes detailFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.cat-detail-close {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #267348;
    color: #fff;
    border: none;
    border-radius: 3px;
    width: 28px;
    height: 28px;
    font-size: 14px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    z-index: 99999;
}

.cat-detail-close:hover {
    background: #36a368;
}

.cat-detail-close i { pointer-events: none; }

#catalogHoloCanvas {
    width: 100% !important;
    height: 140px !important;
    display: block;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
}

.cat-detail-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    padding: 0 5px;
}

.cat-detail-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(243, 225, 0, 0.3);
}

.cat-detail-info {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.85);
    display: flex;
    gap: 0.8rem;
    padding: 2px 8px;
    flex-wrap: wrap;
}

.cat-detail-info strong { color: var(--cat-highlight); font-weight: 600; }

/* ============================================
   Wizard Overlay
============================================ */
.wizard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}

.wizard-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.wizard-box {
    background: #2e8b57;
    border: 3px solid var(--cat-highlight);
    border-radius: 12px;
    width: 90%;
    max-width: 560px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    text-align: center;
    color: #fff;
}

.wizard-title {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--cat-highlight);
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}

.wizard-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1.2rem;
}

.wiz-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.wiz-step-item.active,
.wiz-step-item.completed { opacity: 1; }

.wiz-step-num {
    width: 34px; height: 34px;
    border: 2px solid var(--cat-highlight);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--cat-highlight);
    background: transparent;
    margin-bottom: 6px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.wiz-step-item.active .wiz-step-num,
.wiz-step-item.completed .wiz-step-num {
    background: var(--cat-highlight);
    color: #2e8b57;
}

.wiz-step-label {
    font-size: 0.72rem;
    color: var(--cat-highlight);
    text-align: center;
}

.wizard-instruction {
    font-size: 1rem;
    font-weight: bold;
    color: var(--cat-highlight);
    margin-bottom: 1.2rem;
}

.wiz-panel { display: none; animation: wizFadeIn 0.3s ease; }
.wiz-panel.active { display: block; }

@keyframes wizFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wiz-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 1.2rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.wiz-option-card {
    background: #fff;
    border: 2px solid var(--cat-highlight);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    color: #333;
}

.wiz-option-card:hover {
    background: #fffacd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.wiz-option-card.selected {
    background: var(--cat-highlight);
    color: #2e8b57;
    border-color: #2e8b57;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.wiz-option-card h3 { margin: 0; font-size: 1rem; }
.wiz-option-card p { margin: 0.3rem 0 0; font-size: 0.8rem; opacity: 0.7; }
.wiz-option-card.selected p { opacity: 1; color: #2e8b57; }

.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.wiz-btn {
    background: rgba(255,255,255,0.15);
    color: var(--cat-highlight);
    border: 2px solid var(--cat-highlight);
    border-radius: 6px;
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wiz-btn:not(:disabled):hover { background: rgba(255,255,255,0.25); }
.wiz-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.wiz-btn-primary {
    background: var(--cat-highlight);
    color: var(--cat-accent);
    border-color: var(--cat-highlight);
}

.wiz-btn-primary:not(:disabled):hover { background: #ddd000; }

/* ---- Mobile component dropdown ---- */
.cat-mobile-comp {
    display: none;
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid var(--cat-border);
    background: var(--cat-surface);
}

.cat-mobile-comp select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--cat-border);
    border-radius: var(--cat-radius);
    font-size: 0.85rem;
    color: var(--cat-text);
    background: var(--cat-surface-alt);
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
    .cat-comp-sidebar { width: 200px; }
    .cat-parts-panel { width: 320px; }
}

@media (max-width: 900px) {
    .cat-comp-sidebar { width: 180px; }
    .cat-parts-panel { width: 280px; }
    .cat-comp-arrow { display: none; }
}

@media (max-width: 768px) {
    .cat-container {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }

    .cat-comp-sidebar { display: none; }
    .cat-mobile-comp { display: block; }

    .cat-canvas-panel {
        height: 50vh;
        min-height: 300px;
        border-right: none;
        border-left: none;
        border-bottom: 1px dashed var(--cat-border);
    }

    .cat-parts-panel {
        width: 100%;
        height: 50vh;
        min-height: 300px;
        border-left: none;
    }

    .cat-detail-card {
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100% !important;
        border-radius: 0;
    }

    .cat-view-controls {
        bottom: 8px;
        left: 8px;
    }

    .cat-vc-btn { width: 30px; height: 30px; font-size: 0.75rem; }

    .wizard-box { padding: 1.2rem; }
    .wiz-option-grid { grid-template-columns: 1fr; max-height: 200px; }

    .cat-equipment-bar { font-size: 0.8rem; height: 40px; }
}
