/* Cutting Board Designer Frontend Styles */

.cbd-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Step Container */
.cbd-step {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.cbd-step-container {
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.cbd-step-content {
    flex: 1;
    padding: 40px;
}

.cbd-step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* Welcome Step */
.cbd-welcome-hero {
    text-align: center;
    margin-bottom: 60px;
}

.cbd-welcome-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #1d1a16;
    margin-bottom: 20px;
}

.cbd-welcome-hero p {
    font-size: 1.2rem;
    color: #6d655c;
    max-width: 600px;
    margin: 0 auto 30px;
}

.cbd-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.cbd-feature-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: 8px;
    background: #fbf7f2;
    border: 1px solid #e6ddd3;
    transition: transform 0.3s ease;
}

.cbd-feature-card:hover {
    transform: translateY(-5px);
}

.cbd-feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.cbd-feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1d1a16;
}

.cbd-feature-card p {
    color: #6d655c;
    line-height: 1.6;
}

/* Choose Design Step */
.cbd-section-header {
    text-align: center;
    margin-bottom: 40px;
}

.cbd-section-header h2 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #1d1a16;
    margin-bottom: 10px;
}

.cbd-section-header p {
    font-size: 1.1rem;
    color: #6d655c;
}

/* Customize Step */
.cbd-customize-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
}

/* Tabbed Interface */
.cbd-tabbed-interface {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.cbd-tab-header {
    display: flex;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.cbd-tab-button {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 500;
    color: #6d655c;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cbd-tab-button:hover {
    background: rgba(176, 141, 87, 0.1);
    color: #495057;
}

.cbd-tab-button.active {
    background: white;
    color: #b08d57;
    border-bottom-color: #b08d57;
}

.cbd-tab-pane {
    display: none;
    padding: 20px;
    background: white;
    min-height: 500px;
}

.cbd-tab-pane.active {
    display: block;
}

/* 3D Preview Controls */
.cbd-preview-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.cbd-view-controls {
    display: flex;
    align-items: center;
}

/* Canvas Zoom Controls */
.cbd-canvas-zoom-controls {
    position: absolute;
    top: 18px;
    right: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
    pointer-events: auto;
}

.cbd-canvas-zoom-button {
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(230, 221, 211, 0.9);
    border-radius: 14px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    color: #1d1a16;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.cbd-canvas-zoom-button:hover {
    background: #1d1a16;
    color: #ffffff;
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.cbd-canvas-zoom-button:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.cbd-view-button {
    padding: 10px 18px;
    margin: 0 6px;
    background: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cbd-view-button:hover {
    background: #f8f9fa;
    border-color: #b08d57;
    color: #b08d57;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.cbd-view-button.active {
    background: #b08d57;
    color: white;
    border-color: #b08d57;
    box-shadow: 0 4px 12px rgba(176, 141, 87, 0.3);
    transform: translateY(-1px);
}

/* 3D Canvas Container */
.cbd-canvas-container {
    background: #34495e;
    border-radius: 8px;
    overflow: visible;
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.cbd-canvas-container canvas {
    display: block;
    width: 100%;
    height: 400px;
}

.cbd-canvas-fallback {
    color: white;
    text-align: center;
    padding: 40px;
}

.cbd-canvas-loading {
    color: white;
    text-align: center;
    padding: 40px;
}

.cbd-2d-preview {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cbd-2d-board {
    display: flex;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #333;
    margin: 0 auto;
    max-width: 400px;
}

.cbd-2d-strip {
    height: 100%;
    transition: all 0.3s ease;
}

.cbd-2d-info {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

/* Strip Editor Styles */
.cbd-strips-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.cbd-strips-header h3 {
    margin: 0;
    color: #1d1a16;
}

.cbd-strips-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    min-height: 200px;
}

.cbd-strip-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    cursor: move;
}

.cbd-strip-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.cbd-strip-item.cbd-selected {
    border-color: #FF6B6B;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.25);
    background: #fff5f5;
}

.cbd-strip-item.cbd-dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.cbd-strip-handle {
    color: #6d655c;
    font-size: 18px;
    cursor: grab;
    user-select: none;
}

.cbd-strip-handle:active {
    cursor: grabbing;
}

.cbd-strip-preview {
    height: 30px;
    min-width: 20px;
    max-width: 100px;
    border-radius: 3px;
    border: 1px solid #ccc;
    background: #ddd;
}

.cbd-strip-wood {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.cbd-strip-width {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.cbd-strip-width-label {
    font-weight: 500;
    color: #6d655c;
    margin-left: -8px;
}

.cbd-remove-strip {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.cbd-remove-strip:hover {
    background: #c82333;
}

.cbd-empty-strips {
    text-align: center;
    padding: 40px 20px;
    color: #6d655c;
    font-style: italic;
}

/* Strip Summary */
.cbd-strip-summary {
    background: #e9ecef;
    border-radius: 6px;
    padding: 15px;
}

.cbd-strip-summary h4 {
    margin: 0 0 10px 0;
    color: #1d1a16;
}

.cbd-summary-list {
    margin-bottom: 10px;
}

.cbd-summary-item {
    padding: 4px 0;
    color: #495057;
    font-size: 14px;
}

.cbd-summary-total {
    font-weight: 600;
    color: #1d1a16;
    border-top: 1px solid #ced4da;
    padding-top: 8px;
}

.cbd-empty-state {
    text-align: center;
    color: #6d655c;
    font-style: italic;
    padding: 20px;
}

.cbd-customize-sidebar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.cbd-control-section {
    margin-bottom: 30px;
}

.cbd-control-section:last-child {
    margin-bottom: 0;
}

.cbd-control-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1d1a16;
}

.cbd-control-group {
    margin-bottom: 11px;
}

.cbd-control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.cbd-control-group input,
.cbd-control-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.cbd-control-group input:focus,
.cbd-control-group select:focus {
    outline: none;
    border-color: #b08d57;
    box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.1);
}

.cbd-checkbox-group {
    margin-bottom: 10px;
}

.cbd-checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.cbd-checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.cbd-cost-display {
    background: white;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.cbd-cost-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #6d655c;
}

.cbd-cost-total {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
    font-weight: 600;
    color: #1d1a16;
    font-size: 1.1rem;
}

.cbd-customize-main {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 30px;
}

.cbd-design-preview h3,
.cbd-strips-editor h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1d1a16;
}

.cbd-preview-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cbd-strips-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

/* Buttons */
.cbd-nav-button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cbd-nav-button.cbd-primary {
    background: linear-gradient(135deg, #b08d57 0%, #8a6a3f 100%);
    color: white;
}

.cbd-nav-button.cbd-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(176, 141, 87, 0.3);
}

.cbd-nav-button.cbd-primary:disabled {
    background: #6d655c;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cbd-nav-button.cbd-secondary {
    background: #f8f9fa;
    color: #6d655c;
    border: 1px solid #e9ecef;
}

.cbd-nav-button.cbd-secondary:hover {
    background: #e9ecef;
    color: #495057;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cbd-container {
        padding: 10px;
    }
    
    .cbd-step-content {
        padding: 20px;
    }
    
    .cbd-step-navigation {
        padding: 15px 20px;
    }
    
    .cbd-welcome-hero h1 {
        font-size: 2rem;
    }
    
    .cbd-feature-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cbd-customize-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    
    /* Mobile preview controls */
    .cbd-preview-controls {
        padding: 10px;
    }
    
    .cbd-view-controls {
        justify-content: center;
    }
    
    .cbd-view-button {
        padding: 8px 12px;
        font-size: 12px;
        margin: 0 3px;
    }
    
    .cbd-canvas-zoom-controls {
        top: 10px;
        right: 10px;
        gap: 6px;
    }
    
    .cbd-canvas-zoom-button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .cbd-canvas-container {
        min-height: 300px;
    }
}

/* ============================================================
   Texas Wood Goods-inspired theme overrides
   Reference: https://texaswoodgoods.com/
   Placed at end of file so it wins specificity/order.
   ============================================================ */

.cbd-container {
    --cbd-bg: #f6f1ea;            /* warm paper */
    --cbd-surface: #ffffff;       /* cards */
    --cbd-ink: #1d1a16;           /* near-black */
    --cbd-muted: #6d655c;         /* warm gray */
    --cbd-border: #e6ddd3;        /* warm border */
    --cbd-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
    --cbd-shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.06);

    --cbd-accent: #b08d57;        /* brass */
    --cbd-accent-2: #234235;      /* forest */

    --cbd-radius: 16px;
    --cbd-radius-sm: 12px;

    --cbd-serif: "Cormorant Garamond", ui-serif, Georgia, "Times New Roman", Times, serif;
    --cbd-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

    max-width: 1200px;
    padding: 0 20px 28px;
    margin-top: 0;
    font-family: var(--cbd-sans);
    color: var(--cbd-ink);
    background: var(--cbd-bg);
    border-radius: var(--cbd-radius);
}

/* Stronger font enforcement against theme CSS */
.cbd-container,
.cbd-container button,
.cbd-container input,
.cbd-container select,
.cbd-container textarea {
    font-family: var(--cbd-sans) !important;
}

.cbd-container h1,
.cbd-container h2,
.cbd-container h3,
.cbd-container h4 {
    font-family: var(--cbd-serif) !important;
}

/* Welcome hero closer to Texas Wood Goods: dark, centered, framed title */
.cbd-welcome-hero {
    background:
        radial-gradient(900px 360px at 50% 10%, rgba(176, 141, 87, 0.22), rgba(0,0,0,0) 60%),
        linear-gradient(180deg, #2a241d 0%, #1d1a16 100%);
    border: 1px solid rgba(230, 221, 211, 0.18);
    border-radius: var(--cbd-radius);
    padding: clamp(40px, 5vw, 60px) 20px clamp(44px, 5.5vw, 66px);
    margin-bottom: 30px;
    box-shadow: var(--cbd-shadow);
    position: relative;
    overflow: hidden;
}

.cbd-welcome-hero h1 {
    color: #f3efe7 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

.cbd-welcome-hero p {
    color: rgba(243, 239, 231, 0.72) !important;
    max-width: 720px;
}

/* Cards inside the dark welcome hero — translucent over walnut instead of
   stock Gutenberg gray, which clashes and fails contrast. Catches the
   plugin's default feature cards plus admin-authored blocks regardless of
   how the background was applied: preset color class, generic has-background,
   inline style attribute, or common block-library wrappers. */
.cbd-welcome-hero .cbd-feature-card,
.cbd-welcome-hero .wp-block-column,
.cbd-welcome-hero .wp-block-column.has-background,
.cbd-welcome-hero .wp-block-column[class*="-background-color"],
.cbd-welcome-hero .wp-block-column[style*="background"],
.cbd-welcome-hero .wp-block-group.has-background,
.cbd-welcome-hero .wp-block-group[class*="-background-color"],
.cbd-welcome-hero .wp-block-group[style*="background"],
.cbd-welcome-hero [class*="has-background"],
.cbd-welcome-hero .kt-inside-inner-col,
.cbd-welcome-hero .gb-container,
.cbd-welcome-hero .uagb-container {
    background: rgba(251, 247, 242, 0.06) !important;
    border: 1px solid rgba(212, 165, 116, 0.28) !important;
    border-radius: var(--cbd-radius-sm);
}

.cbd-welcome-hero .cbd-feature-card h3,
.cbd-welcome-hero .wp-block-column :where(h2, h3, h4),
.cbd-welcome-hero .wp-block-group :where(h2, h3, h4),
.cbd-welcome-hero [class*="has-background"] :where(h2, h3, h4),
.cbd-welcome-hero .kt-inside-inner-col :where(h2, h3, h4),
.cbd-welcome-hero .gb-container :where(h2, h3, h4),
.cbd-welcome-hero .uagb-container :where(h2, h3, h4) {
    color: #f3efe7 !important;
}

.cbd-welcome-hero .cbd-feature-card p,
.cbd-welcome-hero .wp-block-column p,
.cbd-welcome-hero .wp-block-group p,
.cbd-welcome-hero [class*="has-background"] p,
.cbd-welcome-hero .kt-inside-inner-col p,
.cbd-welcome-hero .gb-container p,
.cbd-welcome-hero .uagb-container p {
    color: rgba(243, 239, 231, 0.78) !important;
}

/* Gutenberg buttons placed in the hero get the brass primary treatment */
.cbd-welcome-hero .wp-block-button__link {
    background: linear-gradient(135deg, #b08d57 0%, #d4a574 100%) !important;
    color: #2c1810 !important;
    border: 1px solid rgba(176, 141, 87, 0.8) !important;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 3px 10px rgba(176, 141, 87, 0.3);
    transition: all 0.2s ease;
}

.cbd-welcome-hero .wp-block-button__link:hover {
    background: linear-gradient(135deg, #c49a65 0%, #e0b888 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(176, 141, 87, 0.4);
}

.cbd-welcome-hero .cbd-nav-button.cbd-primary {
    background: linear-gradient(135deg, #b08d57 0%, #d4a574 100%);
    color: #2c1810;
    border: 1px solid rgba(176, 141, 87, 0.8);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 14px 34px;
    box-shadow: 0 3px 10px rgba(176, 141, 87, 0.3);
}

.cbd-welcome-hero .cbd-nav-button.cbd-primary:hover {
    background: linear-gradient(135deg, #c49a65 0%, #e0b888 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(176, 141, 87, 0.4);
}

.cbd-step {
    background: var(--cbd-surface);
    border-radius: var(--cbd-radius);
    border: 1px solid var(--cbd-border);
    box-shadow: var(--cbd-shadow);
}

.cbd-step-navigation {
    background: linear-gradient(180deg, rgba(246, 241, 234, 0.25), rgba(246, 241, 234, 0.9));
    border-top: 1px solid var(--cbd-border);
}

.cbd-back-top {
    align-self: flex-start;
    margin-bottom: 8px;
}

.cbd-unified-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.cbd-unified-title,
.cbd-callout h4 {
    font-family: var(--cbd-serif);
    color: var(--cbd-ink);
    letter-spacing: -0.02em;
}

.cbd-welcome-hero h1 {
    font-size: clamp(2.2rem, 3.8vw, 3.2rem);
}

.cbd-feature-card {
    border-radius: var(--cbd-radius-sm);
    background: linear-gradient(180deg, #ffffff, #fbf7f2);
    border: 1px solid var(--cbd-border);
    box-shadow: 0 0 0 rgba(0,0,0,0);
}

.cbd-feature-icon {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(176, 141, 87, 0.14);
    color: var(--cbd-ink);
}

.cbd-customize-layout {
    grid-template-columns: 320px 1fr;
}

.cbd-customize-sidebar {
    background: linear-gradient(180deg, #fbf7f2, #ffffff);
    border-radius: var(--cbd-radius);
    border: 1px solid var(--cbd-border);
    box-shadow: var(--cbd-shadow-soft);
}

.cbd-control-group label {
    color: var(--cbd-muted);
}

.cbd-control-group input,
.cbd-control-group select {
    border-radius: 10px;
    border: 1px solid var(--cbd-border);
}

.cbd-control-group input:focus,
.cbd-control-group select:focus {
    border-color: rgba(176, 141, 87, 0.75);
    box-shadow: 0 0 0 4px rgba(176, 141, 87, 0.18);
}

.cbd-cost-display {
    border: 1px solid var(--cbd-border);
}

.cbd-unified-title {
    margin-bottom: 18px;
}

.cbd-unified-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 24px;
    align-items: start;
}

/* New layout: stack summary below preview */
.cbd-unified-grid.cbd-unified-grid--stacked {
    grid-template-columns: 1fr;
}

.cbd-preview-wrap {
    width: 100%;
}

.cbd-below-preview {
    width: 100%;
}

.cbd-below-preview .cbd-panel {
    margin-bottom: 14px;
}

.cbd-below-preview .cbd-strips-list--scroll {
    max-height: 220px;
}

.cbd-preview-controls {
    background: linear-gradient(180deg, #fbf7f2, #ffffff);
    border: 1px solid var(--cbd-border);
    border-radius: var(--cbd-radius-sm);
}

.cbd-view-button {
    border: 1px solid var(--cbd-border);
    color: var(--cbd-ink);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.cbd-view-button:hover {
    background: #fbf7f2;
    border-color: rgba(176, 141, 87, 0.6);
    color: var(--cbd-ink);
    box-shadow: 0 8px 18px rgba(0,0,0,0.10);
}

.cbd-view-button.active {
    background: var(--cbd-ink);
    border-color: rgba(0,0,0,0.2);
    box-shadow: 0 10px 20px rgba(0,0,0,0.18);
}

.cbd-canvas-container {
    background: radial-gradient(1200px 400px at 50% 0%, rgba(176, 141, 87, 0.14), rgba(0,0,0,0) 55%),
                linear-gradient(180deg, #1d1a16, #15120f);
    border-radius: var(--cbd-radius);
    border: 1px solid rgba(230, 221, 211, 0.25);
    min-height: 620px;
    position: relative;
}

.cbd-canvas-stage {
    width: 100%;
    height: 100%;
    min-height: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cbd-canvas-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.cbd-preview-help {
    text-align: center;
    margin-bottom: 12px;
    color: var(--cbd-muted);
    font-size: 0.95rem;
}

.cbd-canvas-zoom-button {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(230, 221, 211, 0.9);
    color: var(--cbd-ink);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.cbd-canvas-zoom-button:hover {
    background: var(--cbd-ink);
    color: #ffffff;
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.cbd-nav-button {
    border-radius: 999px;
    font-weight: 700;
}

.cbd-nav-button.cbd-primary {
    background: var(--cbd-ink);
    border-color: rgba(0,0,0,0.15);
}

.cbd-nav-button.cbd-primary:hover {
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.cbd-nav-button.cbd-secondary {
    background: transparent;
    color: var(--cbd-ink);
    border: 1px solid var(--cbd-border);
}

.cbd-nav-button.cbd-secondary:hover {
    background: #fbf7f2;
    border-color: rgba(176, 141, 87, 0.55);
}

.cbd-muted {
    color: var(--cbd-muted);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.cbd-panel {
    background: linear-gradient(180deg, #fbf7f2, #ffffff);
    border-radius: var(--cbd-radius);
    border: 1px solid var(--cbd-border);
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: var(--cbd-shadow-soft);
}

.cbd-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(176, 141, 87, 0.22);
    color: var(--cbd-ink);
    border: 1px solid rgba(176, 141, 87, 0.38);
}

.cbd-add-strip {
    margin-bottom: 12px;
}

.cbd-strips-list--scroll {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 6px;
}

.cbd-callout {
    background: rgba(35, 66, 53, 0.08);
    border-radius: var(--cbd-radius);
    padding: 14px 16px;
    border: 1px solid rgba(35, 66, 53, 0.22);
}

.cbd-callout ul {
    margin: 0;
    padding-left: 18px;
    color: var(--cbd-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .cbd-unified-grid {
        grid-template-columns: 1fr;
    }

    .cbd-canvas-container {
        min-height: 320px;
    }
}

/* ===== 3D HOVER PREVIEW POPUP ===== */
.cbd-hover-preview {
    position: fixed;
    z-index: 10000;
    width: 420px;
    background: linear-gradient(180deg, #1e1e2f 0%, #151521 100%);
    border-radius: 16px;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 80px rgba(176, 141, 87, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    overflow: hidden;
}

.cbd-hover-preview.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
}

.cbd-hover-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cbd-hover-preview-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.cbd-hover-preview-difficulty {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(176, 141, 87, 0.3);
    color: #a5b4fc;
}

.cbd-hover-preview-difficulty.simple {
    background: rgba(76, 175, 80, 0.3);
    color: #81c784;
}

.cbd-hover-preview-difficulty.intermediate {
    background: rgba(255, 193, 7, 0.3);
    color: #ffd54f;
}

.cbd-hover-preview-difficulty.advanced {
    background: rgba(244, 67, 54, 0.3);
    color: #ef9a9a;
}

.cbd-hover-preview-canvas {
    width: 100%;
    height: 280px;
    background: linear-gradient(180deg, #252538 0%, #1a1a2e 100%);
    position: relative;
    overflow: hidden;
}

.cbd-hover-preview-canvas canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.cbd-hover-preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    text-align: center;
}

.cbd-hover-preview-loading::before {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 auto 10px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #b08d57;
    border-radius: 50%;
    animation: cbd-spin 0.7s linear infinite;
}

@keyframes cbd-spin {
    to { transform: rotate(360deg); }
}

.cbd-hover-preview-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cbd-hover-preview-dimensions {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.cbd-hover-preview-cost {
    font-size: 18px;
    font-weight: 700;
    color: #4ade80;
}

.cbd-hover-preview-footer {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.cbd-hover-preview-select {
    display: inline-block;
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #b08d57 0%, #8a6a3f 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(176, 141, 87, 0.4);
}

.cbd-hover-preview-select:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(176, 141, 87, 0.5);
}

.cbd-hover-preview-select:active {
    transform: translateY(0);
}

/* Hide hover preview on mobile/touch devices */
@media (hover: none), (max-width: 768px) {
    .cbd-hover-preview {
        display: none !important;
    }
}

/* ===== MOBILE OPTIMIZATION ===== */
@media (max-width: 900px) {
    /* Customize layout - stack vertically */
    .cbd-customize-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    /* Sidebar goes below preview on mobile */
    .cbd-customize-sidebar {
        order: 2;
        width: 100% !important;
        max-width: none !important;
        padding: 15px !important;
    }
    
    /* Main content (preview) goes first */
    .cbd-customize-main {
        order: 1;
        width: 100% !important;
    }
    
    /* Ensure canvas is visible and properly sized */
    .cbd-canvas-container {
        min-height: 280px !important;
        height: 280px !important;
        margin-bottom: 10px;
    }
    
    .cbd-canvas-stage {
        min-height: 280px !important;
        height: 280px !important;
    }
    
    .cbd-canvas-stage canvas {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Preview wrapper */
    .cbd-preview-wrap {
        margin-bottom: 15px;
    }
    
    .cbd-preview-help {
        font-size: 11px !important;
        padding: 8px !important;
        line-height: 1.4;
    }
    
    /* Unified interface title */
    .cbd-unified-title {
        font-size: 1.1rem !important;
        margin-bottom: 12px !important;
    }
    
    /* Below preview section */
    .cbd-below-preview {
        margin-top: 15px;
    }
    
    /* Panel styling */
    .cbd-panel {
        padding: 12px !important;
    }
    
    .cbd-strips-header h3 {
        font-size: 1rem;
    }
    
    .cbd-strips-list--scroll {
        max-height: 200px !important;
    }
    
    /* Strip items in list */
    .cbd-strip-item {
        padding: 8px !important;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .cbd-strip-wood {
        flex: 1;
        min-width: 100px;
    }
    
    .cbd-strip-width {
        width: 60px !important;
    }
    
    /* Control sections in sidebar */
    .cbd-control-section {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }
    
    .cbd-control-section h3 {
        font-size: 0.95rem !important;
        margin-bottom: 10px !important;
    }
    
    .cbd-control-group {
        margin-bottom: 10px !important;
    }
    
    .cbd-control-group label {
        font-size: 0.85rem !important;
    }
    
    .cbd-control-group input,
    .cbd-control-group select {
        padding: 8px !important;
        font-size: 14px !important;
    }
    
    /* Checkbox groups */
    .cbd-checkbox-group {
        margin-bottom: 8px !important;
    }
    
    .cbd-checkbox-group label {
        font-size: 0.9rem !important;
    }
    
    /* Cost display */
    .cbd-cost-display {
        padding: 10px !important;
    }
    
    .cbd-cost-item {
        padding: 6px 0 !important;
        font-size: 0.9rem !important;
    }
    
    .cbd-cost-total {
        font-size: 1.1rem !important;
        padding-top: 8px !important;
    }
    
    /* Callout box */
    .cbd-callout {
        padding: 10px 12px !important;
        margin-top: 12px;
    }
    
    .cbd-callout h4 {
        font-size: 0.9rem !important;
    }
    
    .cbd-callout ul {
        font-size: 0.8rem !important;
        padding-left: 15px !important;
    }
    
    /* Navigation buttons */
    .cbd-step-navigation {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 15px !important;
    }
    
    .cbd-nav-button {
        width: 100% !important;
        justify-content: center !important;
        padding: 12px 20px !important;
    }
    
    /* Zoom controls positioning */
    .cbd-canvas-zoom-controls {
        bottom: 10px !important;
        top: auto !important;
        right: 10px !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .cbd-container {
        padding: 8px !important;
    }
    
    .cbd-step-content {
        padding: 12px !important;
    }
    
    .cbd-canvas-container {
        min-height: 220px !important;
        height: 220px !important;
    }
    
    .cbd-canvas-stage {
        min-height: 220px !important;
        height: 220px !important;
    }
    
    .cbd-preview-controls {
        padding: 8px !important;
    }
    
    .cbd-view-button {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }
    
}

/* ============================================
   SINGLE-SCREEN BUILD OVERLAY STYLES
   ============================================ */

.cbd-build-screen-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.85) !important;
    z-index: 999999 !important;
    display: none;
    align-items: stretch;
    justify-content: stretch;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    width: 100vw !important;
    height: 100vh !important;
    transform: none !important;
}

.cbd-build-screen-overlay[style*="display: flex"],
.cbd-build-screen-overlay.cbd-active {
    display: flex !important;
}

.cbd-build-screen-container {
    background: var(--cbd-surface, #fbf7f2) !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: none !important;
    overflow: hidden !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

/* Build Screen Header */
.cbd-build-header {
    padding: 15px 25px !important;
    border-bottom: 3px solid var(--cbd-accent, #b08d57) !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    background: linear-gradient(180deg, #3d2418, #2c1810) !important;
    flex: 0 0 auto !important;
    min-height: 50px !important;
    max-height: 70px !important;
}

.cbd-build-header h2 {
    margin: 0;
    color: #fbf7f2 !important;
    font-size: 1.8rem;
    font-family: var(--cbd-serif);
    flex-shrink: 0;
}

.cbd-build-close {
    background: none;
    border: none;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.7) !important;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1;
}

.cbd-build-close:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Build Screen Palette Section (Top) */
.cbd-build-palette-section {
    padding: 12px 25px !important;
    background: linear-gradient(180deg, #f8f4ef, #f0ebe3) !important;
    border-bottom: 2px solid var(--cbd-border) !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 24px !important;
}

.cbd-palette-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Live total occupying the previously-empty right side of the palette bar */
.cbd-palette-total {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    padding: 8px 22px;
    border-left: 2px solid var(--cbd-border);
    min-width: 150px;
}

.cbd-palette-total-dims {
    font-size: 0.82rem;
    color: var(--cbd-muted);
    margin-bottom: 2px;
}

.cbd-palette-total-amount {
    font-size: 1.7rem;
    font-weight: 700;
    color: #8a6a3f;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.cbd-palette-total-label {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cbd-muted);
}

.cbd-build-palette-section h3 {
    margin: 0 0 10px 0;
    color: var(--cbd-ink);
    font-size: 1.15rem;
    font-family: var(--cbd-serif);
}

.cbd-build-palette {
    width: 100%;
}

.cbd-build-palette-hint {
    margin: 15px 0 0 0;
    color: var(--cbd-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Build screen "How to use" info box */
.cbd-build-how-to {
    flex-shrink: 0;
    padding: 12px 20px;
    background: rgba(176, 141, 87, 0.08);
    border-bottom: 1px solid var(--cbd-border);
    max-height: 140px;
    overflow: hidden;
}

.cbd-build-how-to.cbd-how-to-hidden {
    display: none !important;
}

.cbd-build-how-to-inner {
    position: relative;
    padding-right: 28px;
}

.cbd-build-how-to-close {
    position: absolute;
    top: -4px;
    right: 0;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--cbd-muted);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.cbd-build-how-to-close:hover {
    color: var(--cbd-ink);
    background: rgba(0, 0, 0, 0.05);
}

.cbd-build-how-to-title {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-family: var(--cbd-serif);
    color: var(--cbd-ink);
}

.cbd-build-how-to-list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9rem;
    color: var(--cbd-muted);
    line-height: 1.5;
}

.cbd-build-how-to-list li {
    margin-bottom: 4px;
}

.cbd-build-how-to-list li:last-child {
    margin-bottom: 0;
}

.cbd-build-how-to-dismiss {
    display: block;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--cbd-muted);
    cursor: pointer;
}

.cbd-build-how-to-dismiss input {
    margin-right: 6px;
}

/* One-time highlight for palette and drop zone (when How to use is shown) */
.cbd-build-palette-section.cbd-highlight {
    animation: cbdHighlightPulse 2s ease-in-out 2;
}

.cbd-build-canvas-container.cbd-highlight {
    animation: cbdHighlightPulse 2s ease-in-out 2;
}

@keyframes cbdHighlightPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(176, 141, 87, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(176, 141, 87, 0.15);
    }
}

/* ===== INLINE CONTEXTUAL HINTS ===== */

/* Base hint bar style */
.cbd-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: cbdHintFadeIn 0.5s ease both;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.cbd-hint.cbd-hint-hidden {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

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

/* Palette hint (below the wood strips) */
.cbd-hint-palette {
    margin-top: 12px;
    background: linear-gradient(135deg, rgba(176, 141, 87, 0.15), rgba(176, 141, 87, 0.08));
    border: 1px solid rgba(176, 141, 87, 0.3);
    color: var(--cbd-ink, #1d1a16);
}

.cbd-hint-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--cbd-accent, #b08d57);
    color: #fff;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    animation: cbdHintBounce 2s ease-in-out infinite;
}

@keyframes cbdHintBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(4px); }
}

.cbd-hint-text {
    flex: 1;
    font-weight: 500;
    color: var(--cbd-ink, #1d1a16);
}

.cbd-hint-dismiss {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--cbd-muted, #6d655c);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.cbd-hint-dismiss:hover {
    color: var(--cbd-ink, #1d1a16);
    background: rgba(0, 0, 0, 0.08);
}

/* Drop zone hint (centered over empty 3D canvas) */
.cbd-hint-drop-zone {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
    z-index: 50;
    animation: cbdHintFadeIn 0.6s ease both 0.3s;
    transition: opacity 0.4s ease;
}

.cbd-hint-drop-zone.cbd-hint-hidden {
    opacity: 0 !important;
    visibility: hidden;
}

.cbd-hint-drop-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px dashed rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.45);
    animation: cbdDropPulse 2.5s ease-in-out infinite;
}

@keyframes cbdDropPulse {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.25);
        color: rgba(255, 255, 255, 0.35);
        transform: scale(1);
    }
    50% {
        border-color: rgba(176, 141, 87, 0.6);
        color: rgba(176, 141, 87, 0.7);
        transform: scale(1.08);
    }
}

.cbd-hint-drop-text {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.02em;
}

/* Interaction tips (bottom bar inside 3D canvas, shown after first strip) */
.cbd-hint-interactions {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 8px 20px;
    z-index: 60;
    white-space: nowrap;
}

.cbd-hint-interactions .cbd-hint-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-weight: 500;
}

.cbd-hint-interactions .cbd-hint-dismiss {
    color: rgba(255, 255, 255, 0.5);
    margin-left: 4px;
}

.cbd-hint-interactions .cbd-hint-dismiss:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* Palette strip "first-time" drag badge */
.cbd-palette-strip .cbd-hint-drag-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--cbd-accent, #b08d57);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(176, 141, 87, 0.4);
    animation: cbdBadgePulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes cbdBadgePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.1); opacity: 0.85; }
}

.cbd-palette-strip {
    position: relative;
}

/* Floating drag-to-reorder tooltip (appears near selected strip) */
.cbd-hint-drag-tooltip {
    position: absolute;
    z-index: 200;
    background: rgba(176, 141, 87, 0.92);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 7px 16px;
    border-radius: 999px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    gap: 6px;
    animation: cbdDragTooltipIn 0.35s ease both;
}

.cbd-hint-drag-tooltip.cbd-tooltip-fade-out {
    animation: cbdDragTooltipOut 0.4s ease forwards;
}

.cbd-hint-drag-tooltip-arrow {
    font-size: 0.9rem;
    opacity: 0.7;
    animation: cbdArrowNudge 1.2s ease-in-out infinite alternate;
}

.cbd-hint-drag-tooltip-arrow:first-child {
    animation-direction: alternate-reverse;
}

@keyframes cbdArrowNudge {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-3px); }
}

.cbd-hint-drag-tooltip-arrow:last-child {
    animation-name: cbdArrowNudgeRight;
}

@keyframes cbdArrowNudgeRight {
    0%   { transform: translateX(0); }
    100% { transform: translateX(3px); }
}

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

@keyframes cbdDragTooltipOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(-6px) scale(0.95); }
}

/* Double-click-to-delete tooltip variant */
.cbd-hint-dblclick-tooltip {
    background: rgba(180, 60, 50, 0.88);
}

.cbd-hint-dblclick-icon {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Responsive hints */
@media (max-width: 768px) {
    .cbd-hint {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    .cbd-hint-drop-icon {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    .cbd-hint-drop-text {
        font-size: 0.8rem;
    }

    .cbd-hint-interactions {
        white-space: normal;
        text-align: center;
        border-radius: 12px;
        left: 10px;
        right: 10px;
        transform: none;
        width: auto;
    }
}

@media (max-width: 480px) {
    .cbd-hint-palette {
        flex-direction: column;
        text-align: center;
        gap: 6px;
    }

    .cbd-hint-interactions .cbd-hint-text {
        font-size: 0.75rem;
    }
}

.cbd-palette-strips {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--cbd-accent) transparent;
}

.cbd-palette-strips::-webkit-scrollbar {
    height: 8px;
}

.cbd-palette-strips::-webkit-scrollbar-track {
    background: transparent;
}

.cbd-palette-strips::-webkit-scrollbar-thumb {
    background: var(--cbd-accent);
    border-radius: 4px;
}

.cbd-palette-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border: 2px solid var(--cbd-border);
    border-radius: var(--cbd-radius-sm);
    padding: 14px 18px;
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    flex-shrink: 0;
    min-width: 140px;
    box-shadow: var(--cbd-shadow-soft);
}

.cbd-palette-strip:hover {
    border-color: var(--cbd-accent);
    box-shadow: 0 4px 12px rgba(176, 141, 87, 0.25);
    transform: translateY(-3px);
}

.cbd-palette-strip:active {
    cursor: grabbing;
}

.cbd-palette-strip.cbd-dragging {
    opacity: 0.6;
    transform: rotate(3deg) scale(1.05);
    z-index: 1000;
}

.cbd-palette-strip.cbd-touch-active {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(176, 141, 87, 0.35);
}

.cbd-palette-strip-color {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--cbd-border);
    flex-shrink: 0;
}

.cbd-palette-strip-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cbd-palette-strip-info strong {
    color: var(--cbd-ink);
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cbd-palette-strip-info span {
    color: var(--cbd-muted);
    font-size: 0.85rem;
}

/* Build Screen Main Content Area */
.cbd-build-main {
    display: flex !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    min-height: 0 !important;
}

/* Build Screen Preview Section (Large, Center) */
.cbd-build-preview-section {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 15px !important;
    min-width: 0 !important;
    overflow: hidden !important;
    min-height: 0 !important;
    background: #1d1a16 !important;
}

.cbd-build-canvas-container {
    position: relative !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 200px !important;
    background: #34495e !important;
    border-radius: var(--cbd-radius-sm) !important;
    overflow: hidden !important;
    box-shadow: var(--cbd-shadow) !important;
    transition: all 0.3s ease !important;
}

.cbd-build-canvas-container.cbd-drop-zone-active {
    border: 3px dashed var(--cbd-accent);
    background: rgba(176, 141, 87, 0.15);
    box-shadow: 0 0 0 4px rgba(176, 141, 87, 0.1);
}

.cbd-build-canvas-stage {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* Build Screen Controls Sidebar (Right) */
.cbd-build-controls-sidebar {
    width: 380px !important;
    flex: 0 0 380px !important;
    background: linear-gradient(180deg, #ffffff, #f9f6f2) !important;
    border-left: 3px solid var(--cbd-border) !important;
    padding: 15px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: block !important;
    min-height: 0 !important;
}

/* Custom scrollbar for sidebar */
.cbd-build-controls-sidebar::-webkit-scrollbar {
    width: 8px;
}

.cbd-build-controls-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.cbd-build-controls-sidebar::-webkit-scrollbar-thumb {
    background: var(--cbd-border, #d4c4b0);
    border-radius: 4px;
}

.cbd-build-controls-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--cbd-accent, #b08d57);
}

.cbd-build-control-section {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--cbd-border);
}

.cbd-build-control-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cbd-build-control-section:last-child {
    border-bottom: none;
}

.cbd-build-control-section h3 {
    margin: 0 0 18px 0;
    color: var(--cbd-ink);
    font-size: 1.2rem;
    font-family: var(--cbd-serif);
}

.cbd-build-strips-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 320px;
    overflow-y: auto;
}

.cbd-build-strip-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border: 1px solid var(--cbd-border);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: grab;
}

.cbd-build-strip-item:active {
    cursor: grabbing;
}

.cbd-build-strip-item.cbd-dragging {
    opacity: 0.7;
}

.cbd-build-strip-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--cbd-border);
    flex-shrink: 0;
}

/* Build Header Action Buttons */
.cbd-build-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 12px;
}

.cbd-header-btn {
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--cbd-sans);
    white-space: nowrap;
    transition: all 0.2s ease;
    line-height: 1;
}

.cbd-header-btn--quote {
    background: var(--cbd-accent, #b08d57);
    color: #fff;
    padding: 9px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(176, 141, 87, 0.35);
}

.cbd-header-btn--quote:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 14px rgba(176, 141, 87, 0.5);
    transform: translateY(-1px);
}

.cbd-header-btn--cancel {
    background: transparent;
    color: rgba(251, 247, 242, 0.6);
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 400;
}

.cbd-header-btn--cancel:hover {
    color: #fbf7f2;
    background: rgba(255, 255, 255, 0.1);
}

/* Smooth animations for build screen */
.cbd-build-screen-overlay {
    animation: fadeInOverlay 0.3s ease;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cbd-build-screen-container {
    animation: slideInContainer 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInContainer {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cbd-palette-strip {
    animation: fadeInStrip 0.3s ease;
    animation-fill-mode: both;
}

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

/* Stagger animation for palette strips */
.cbd-palette-strip:nth-child(1) { animation-delay: 0.05s; }
.cbd-palette-strip:nth-child(2) { animation-delay: 0.1s; }
.cbd-palette-strip:nth-child(3) { animation-delay: 0.15s; }
.cbd-palette-strip:nth-child(4) { animation-delay: 0.2s; }
.cbd-palette-strip:nth-child(5) { animation-delay: 0.25s; }
.cbd-palette-strip:nth-child(n+6) { animation-delay: 0.3s; }

/* Build Screen Mobile Responsive */
@media (max-width: 1024px) {
    .cbd-build-main {
        flex-direction: column !important;
    }
    
    .cbd-build-controls-sidebar {
        width: 100% !important;
        flex: 0 0 auto !important;
        border-left: none !important;
        border-top: 2px solid var(--cbd-border) !important;
        max-height: 35vh !important;
        min-height: 0 !important;
        overflow-y: auto !important;
    }
    
    .cbd-build-preview-section {
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }
    
    .cbd-build-canvas-container {
        min-height: 150px !important;
        flex: 1 1 auto !important;
    }
    
    .cbd-build-palette-section {
        overflow: visible !important;
        padding: 12px 15px !important;
    }
}

@media (max-width: 768px) {
    .cbd-build-screen-overlay {
        padding: 0 !important;
    }
    
    .cbd-build-screen-container {
        border-radius: 0 !important;
    }
    
    .cbd-build-header {
        padding: 10px 15px !important;
        min-height: 45px !important;
        max-height: 60px !important;
    }
    
    .cbd-build-header h2 {
        font-size: 1.1rem !important;
    }

    .cbd-build-header-actions {
        gap: 6px;
    }

    .cbd-header-btn--quote {
        padding: 7px 14px;
        font-size: 0.82rem;
    }

    .cbd-header-btn--cancel {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .cbd-build-palette-section {
        padding: 10px 12px !important;
        overflow: visible !important;
    }
    
    .cbd-build-palette-section h3 {
        font-size: 1rem !important;
        margin-bottom: 8px !important;
    }
    
    .cbd-palette-strip {
        min-width: 100px !important;
        padding: 8px 10px !important;
    }
    
    .cbd-palette-strip-color {
        width: 32px !important;
        height: 32px !important;
    }
    
    .cbd-palette-strip-info strong {
        font-size: 0.8rem !important;
    }
    
    .cbd-palette-strip-info span {
        font-size: 0.75rem !important;
    }
    
    .cbd-build-preview-section {
        padding: 10px !important;
        min-height: 0 !important;
    }
    
    .cbd-build-canvas-container {
        min-height: 150px !important;
    }
    
    .cbd-build-controls-sidebar {
        padding: 12px !important;
        max-height: 40vh !important;
    }
    
    .cbd-build-control-section {
        padding-bottom: 12px !important;
    }
    
    .cbd-build-control-section h3 {
        font-size: 1rem !important;
        margin-bottom: 10px !important;
    }
    
    .cbd-build-strips-list {
        max-height: none !important;
        overflow-y: visible;
    }
}

@media (max-width: 480px) {
    .cbd-build-header {
        padding: 8px 10px !important;
        min-height: 40px !important;
        max-height: 50px !important;
        flex-wrap: nowrap !important;
    }
    
    .cbd-build-header h2 {
        font-size: 0.9rem !important;
    }

    .cbd-build-header-actions {
        gap: 4px;
    }

    .cbd-header-btn--quote {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .cbd-header-btn--cancel {
        padding: 5px 8px;
        font-size: 0.7rem;
    }
    
    .cbd-build-close {
        width: 30px !important;
        height: 30px !important;
        font-size: 1.6rem !important;
    }
    
    .cbd-build-palette-section {
        padding: 8px 10px !important;
        overflow: visible !important;
    }
    
    .cbd-build-palette-section h3 {
        font-size: 0.9rem !important;
        margin-bottom: 5px !important;
    }
    
    .cbd-build-palette-hint {
        font-size: 0.7rem !important;
        margin-top: 5px !important;
        display: none !important; /* Hide on very small screens */
    }
    
    .cbd-palette-strip {
        min-width: 80px !important;
        padding: 6px 8px !important;
        gap: 5px !important;
    }
    
    .cbd-palette-strip-color {
        width: 28px !important;
        height: 28px !important;
    }
    
    .cbd-palette-strip-info strong {
        font-size: 0.7rem !important;
    }
    
    .cbd-palette-strip-info span {
        font-size: 0.65rem !important;
    }
    
    .cbd-build-preview-section {
        padding: 6px !important;
        min-height: 0 !important;
    }
    
    .cbd-build-canvas-container {
        min-height: 120px !important;
        flex: 1 1 auto !important;
    }
    
    .cbd-build-controls-sidebar {
        padding: 10px 8px !important;
        max-height: 45vh !important;
        min-height: 0 !important;
    }
    
    .cbd-build-control-section {
        padding-bottom: 12px;
        gap: 12px;
    }
    
    .cbd-build-control-section h3 {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    
    .cbd-build-strips-list {
        max-height: none;
        overflow-y: visible;
    }
    
    .cbd-build-header-actions {
        gap: 6px;
    }

    .cbd-header-btn--quote {
        padding: 7px 14px;
        font-size: 0.85rem;
    }

    .cbd-header-btn--cancel {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
}

/* Drop Zone Styles */
.cbd-drop-zone {
    position: relative;
}

.cbd-drop-zone-active {
    border: 3px dashed #b08d57 !important;
    background: rgba(176, 141, 87, 0.1) !important;
}

.cbd-drop-success {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #28a745;
    color: white;
    padding: 15px 30px;
    border-radius: var(--cbd-radius-sm);
    font-weight: 600;
    z-index: 1000;
    box-shadow: var(--cbd-shadow);
    animation: dropSuccess 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

@keyframes dropSuccess {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Wizard Dimensions Step */
.cbd-wizard-dimensions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Wizard Features Step */
.cbd-wizard-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.cbd-wizard-feature-option {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.cbd-wizard-feature-option:hover {
    border-color: #b08d57;
    background: rgba(176, 141, 87, 0.02);
}

.cbd-wizard-feature-option input[type="checkbox"] {
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.cbd-wizard-feature-content {
    flex: 1;
}

.cbd-wizard-feature-content strong {
    display: block;
    color: #1d1a16;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.cbd-wizard-feature-price {
    color: #b08d57;
    font-weight: 600;
    margin-left: 10px;
}

.cbd-wizard-feature-content p {
    color: #6d655c;
    margin: 5px 0 0 0;
    font-size: 0.9rem;
}

/* Wizard Review Step */
.cbd-wizard-review {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.cbd-wizard-review-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.cbd-wizard-review-section h4 {
    margin: 0 0 15px 0;
    color: #1d1a16;
    font-size: 1.1rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.cbd-wizard-review-strips {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cbd-wizard-review-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: white;
    border-radius: 6px;
}

.cbd-wizard-review-strip-color {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e9ecef;
}

.cbd-wizard-review-details p {
    margin: 8px 0;
    color: #495057;
}

.cbd-wizard-review-cost {
    font-size: 1.1rem;
}

.cbd-wizard-review-total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #e9ecef;
    font-size: 1.3rem;
    color: #1d1a16;
}

/* Wizard Navigation */
.cbd-wizard-navigation {
    padding: 20px 30px;
    border-top: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    background: #f8f9fa;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cbd-wizard-overlay {
        padding: 10px;
    }
    
    .cbd-wizard-container {
        max-height: 95vh;
    }
    
    .cbd-wizard-step {
        padding: 20px;
    }
    
    .cbd-wizard-wood-selection {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .cbd-wizard-canvas-container {
        height: 300px;
    }
    
    .cbd-wizard-navigation {
        flex-direction: column;
    }
    
    .cbd-wizard-navigation button {
        width: 100%;
    }
    
    .cbd-palette-strips {
        flex-direction: column;
    }
    
    .cbd-palette-strip {
        width: 100%;
    }

    .cbd-palette-strip-info strong {
        font-size: 12px !important;
    }
    
    /* Welcome hero */
    .cbd-welcome-hero h1 {
        font-size: 1.5rem !important;
    }
    
    .cbd-welcome-hero p {
        font-size: 0.9rem !important;
    }
    
    .cbd-feature-card {
        padding: 15px !important;
    }
    
    .cbd-feature-icon {
        font-size: 1.5rem !important;
    }
    
    .cbd-feature-card h3 {
        font-size: 1rem !important;
    }
}

/* ───────────────────────────────────────────────
   Gutenberg Block Section Compatibility
   ─────────────────────────────────────────────── */
.cbd-block-section {
    font-family: var(--cbd-sans);
    color: var(--cbd-ink);
    line-height: 1.6;
}

.cbd-block-section h1,
.cbd-block-section h2,
.cbd-block-section h3,
.cbd-block-section h4 {
    font-family: var(--cbd-serif);
    color: var(--cbd-ink);
}

.cbd-block-section .wp-block-heading {
    margin-top: 0;
}

.cbd-block-section .wp-block-columns {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    gap: 2rem;
}

.cbd-block-section .wp-block-column {
    background: var(--cbd-cream, rgba(255,255,255,0.7));
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cbd-block-section .wp-block-column:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.cbd-block-section .wp-block-buttons {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.cbd-block-section .wp-block-button__link {
    font-family: var(--cbd-sans);
    font-weight: 600;
    padding: 0.85rem 2.5rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.cbd-welcome-hero.cbd-block-section .wp-block-button__link {
    background: var(--cbd-ink, #1d1a16);
    color: #fff;
}

.cbd-welcome-hero.cbd-block-section .wp-block-button__link:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.cbd-block-section p {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.cbd-welcome-hero.cbd-block-section {
    text-align: center;
}

.cbd-welcome-hero.cbd-block-section > h1,
.cbd-welcome-hero.cbd-block-section > .wp-block-heading:first-child {
    font-size: clamp(2.2rem, 3.8vw, 3.2rem);
    margin-bottom: 1rem;
}

/* Sidebar quote/review button */
.cbd-sidebar-quote-btn {
    width: 100%;
    padding: 14px 20px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin-top: 8px;
    background: var(--cbd-accent, #b08d57) !important;
    color: #fff !important;
    border: none;
    text-align: center;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(176, 141, 87, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

.cbd-sidebar-quote-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(176, 141, 87, 0.4);
}

/* ===================================================================
   REVIEW & ORDER STEP
   =================================================================== */

.cbd-review-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 28px;
    align-items: start;
}

.cbd-review-form-col {
    position: sticky;
    top: 20px;
}

.cbd-review-card {
    background: var(--cbd-surface, #ffffff);
    border: 1px solid var(--cbd-border, #e6ddd3);
    border-radius: var(--cbd-radius, 16px);
    padding: 24px;
    margin-bottom: 20px;
}

.cbd-review-card h3 {
    margin: 0 0 16px;
    font-family: var(--cbd-serif);
    font-size: 1.2rem;
    color: var(--cbd-ink, #1d1a16);
}

.cbd-review-card h4 {
    margin: 16px 0 8px;
    font-size: 0.95rem;
    color: var(--cbd-muted, #6d655c);
}

/* Preview image */
.cbd-review-preview-wrap {
    position: relative;
    min-height: 200px;
    background: linear-gradient(180deg, #1d1a16, #15120f);
    border-radius: calc(var(--cbd-radius, 16px) - 4px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cbd-review-preview-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

.cbd-review-preview-placeholder {
    color: rgba(255,255,255,0.4);
    font-size: 0.9rem;
    padding: 40px;
    text-align: center;
}

/* Specs table */
.cbd-review-specs {
    width: 100%;
    border-collapse: collapse;
}

.cbd-review-specs th,
.cbd-review-specs td {
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--cbd-border, #e6ddd3);
}

.cbd-review-specs th {
    text-align: left;
    font-weight: 600;
    color: var(--cbd-muted, #6d655c);
    width: 140px;
}

.cbd-review-specs td {
    color: var(--cbd-ink, #1d1a16);
}

/* Wood type list */
.cbd-review-wood-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.cbd-review-wood-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.cbd-review-wood-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--cbd-ink, #1d1a16);
}

.cbd-review-wood-width {
    font-size: 0.85rem;
    color: var(--cbd-muted, #6d655c);
    font-weight: 500;
}

/* Costs table */
.cbd-review-costs {
    width: 100%;
    border-collapse: collapse;
}

.cbd-review-costs td {
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--cbd-border, #e6ddd3);
}

.cbd-review-costs td:first-child {
    color: var(--cbd-muted, #6d655c);
}

.cbd-review-costs td:last-child {
    text-align: right;
    font-weight: 500;
    color: var(--cbd-ink, #1d1a16);
}

.cbd-review-cost-total td {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    border-bottom: none;
    padding-top: 12px;
}

.cbd-review-cost-total td:first-child {
    color: var(--cbd-ink, #1d1a16) !important;
}

/* Contact form */
.cbd-form-group {
    margin-bottom: 16px;
}

.cbd-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cbd-ink, #1d1a16);
    margin-bottom: 4px;
}

.cbd-required {
    color: #dc3232;
}

.cbd-optional {
    font-weight: 400;
    color: var(--cbd-muted, #6d655c);
    font-size: 0.8rem;
}

.cbd-form-group input[type="text"],
.cbd-form-group input[type="email"],
.cbd-form-group input[type="tel"],
.cbd-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--cbd-border, #d1cac0);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: var(--cbd-sans, inherit);
    color: var(--cbd-ink, #1d1a16);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.cbd-form-group input:focus,
.cbd-form-group textarea:focus {
    outline: none;
    border-color: var(--cbd-accent, #b08d57);
    box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.18);
}

.cbd-form-group textarea {
    resize: vertical;
}

.cbd-field-error {
    display: block;
    font-size: 0.8rem;
    color: #dc3232;
    margin-top: 3px;
    min-height: 1em;
}

.cbd-has-error input,
.cbd-has-error textarea {
    border-color: #dc3232 !important;
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.12) !important;
}

.cbd-form-row {
    display: grid;
    grid-template-columns: 1fr 0.6fr 0.5fr;
    gap: 12px;
}

/* Submit button */
.cbd-submit-order {
    width: 100%;
    padding: 16px 24px;
    margin-top: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--cbd-accent, #b08d57) !important;
    color: #fff !important;
    border: none;
    box-shadow: 0 3px 12px rgba(176, 141, 87, 0.35);
    letter-spacing: 0.02em;
    transition: transform 0.15s, box-shadow 0.15s;
}

.cbd-submit-order:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(176, 141, 87, 0.45);
}

.cbd-submit-order:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

/* Error message */
.cbd-order-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.cbd-order-error {
    background: #fef2f2;
    color: #dc3232;
    border: 1px solid #fecaca;
}

/* Success state */
.cbd-order-success {
    text-align: center;
    padding: 48px 32px;
}

.cbd-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #00a32a;
    color: #fff;
    font-size: 32px;
    line-height: 64px;
    margin: 0 auto 20px;
}

.cbd-order-success h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.cbd-order-success p {
    color: var(--cbd-muted, #6d655c);
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto 8px;
}

.cbd-success-order-number {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cbd-accent, #b08d57) !important;
    margin-top: 16px !important;
}

/* Responsive */
@media (max-width: 768px) {
    .cbd-review-layout {
        grid-template-columns: 1fr;
    }

    .cbd-review-form-col {
        position: static;
    }

    .cbd-form-row {
        grid-template-columns: 1fr;
    }
}
/* ── Welcome preset showcase ─────────────────────────────────────────────────
   Real preset thumbnails on the welcome step, rendered from live preset +
   wood-price data. Clicking a tile selects that preset and opens the builder. */
.cbd-welcome-showcase {
    max-width: 1000px;
    margin: 0 auto 10px;
}

.cbd-showcase-eyebrow {
    display: block;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cbd-muted);
    margin-bottom: 18px;
}

.cbd-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 18px;
}

.cbd-showcase-tile {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    background: var(--cbd-surface);
    border: 1px solid var(--cbd-border);
    border-radius: var(--cbd-radius-sm);
    padding: 14px 14px 16px;
    cursor: pointer;
    text-align: center;
    font-family: var(--cbd-sans);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cbd-showcase-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(176, 141, 87, 0.55);
    box-shadow: var(--cbd-shadow-soft);
}

.cbd-showcase-tile:focus-visible {
    outline: 2px solid var(--cbd-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .cbd-showcase-tile,
    .cbd-showcase-tile:hover {
        transition: none;
        transform: none;
    }
}

.cbd-showcase-board {
    display: flex;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15), 0 4px 10px rgba(0, 0, 0, 0.12);
    margin-bottom: 12px;
}

.cbd-showcase-strip {
    display: block;
    height: 100%;
}

.cbd-showcase-board--custom {
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--cbd-accent);
    background: repeating-linear-gradient(45deg, #fbf7f2, #fbf7f2 8px, #f3ece1 8px, #f3ece1 16px);
    border: 1px dashed rgba(176, 141, 87, 0.5);
    box-shadow: none;
}

.cbd-showcase-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--cbd-ink);
}

.cbd-showcase-cost {
    display: block;
    font-size: 0.8rem;
    color: var(--cbd-muted);
    margin-top: 2px;
}

/* ── Showcase loading state ──────────────────────────────────────────────────
   Animated wood-strip loader shown while preset and pricing data fetch. */
.cbd-showcase-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 38px 0 46px;
}

.cbd-loading-board {
    display: flex;
    gap: 5px;
    height: 44px;
    align-items: center;
}

.cbd-loading-strip {
    display: block;
    width: 11px;
    height: 30px;
    border-radius: 3px;
    background: #b08d57;
    animation: cbd-strip-pulse 1.1s ease-in-out infinite;
}

.cbd-loading-strip:nth-child(1) { background: #e8d5ae; animation-delay: 0s; }
.cbd-loading-strip:nth-child(2) { background: #4a3c32; animation-delay: 0.12s; }
.cbd-loading-strip:nth-child(3) { background: #9e4f3c; animation-delay: 0.24s; }
.cbd-loading-strip:nth-child(4) { background: #4a3c32; animation-delay: 0.36s; }
.cbd-loading-strip:nth-child(5) { background: #e8d5ae; animation-delay: 0.48s; }

@keyframes cbd-strip-pulse {
    0%, 100% { transform: scaleY(0.55); opacity: 0.55; }
    40%      { transform: scaleY(1.45); opacity: 1; }
}

.cbd-loading-text {
    font-family: var(--cbd-sans);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: var(--cbd-muted);
}

/* Under reduced motion, swap the scaling pulse for a gentle opacity fade —
   still communicates activity without movement. */
@keyframes cbd-strip-fade {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .cbd-loading-strip {
        animation: cbd-strip-fade 2s ease-in-out infinite;
        transform: none !important;
    }
}

/* ── Build sidebar usability (v1.3.0) ────────────────────────────────────────
   Size presets, editable strip rows, tap-to-add picker, sticky cost bar. */

/* Standard size chips */
.cbd-size-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.cbd-size-chip {
    appearance: none;
    background: var(--cbd-surface, #fff);
    border: 1px solid var(--cbd-border, #e6ddd3);
    border-radius: 8px;
    padding: 8px 4px;
    cursor: pointer;
    text-align: center;
    font-family: var(--cbd-sans);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.cbd-size-chip strong {
    display: block;
    font-size: 0.82rem;
    color: var(--cbd-ink, #1d1a16);
}

.cbd-size-chip span {
    display: block;
    font-size: 0.72rem;
    color: var(--cbd-muted, #6d655c);
    margin-top: 1px;
}

.cbd-size-chip:hover {
    border-color: rgba(176, 141, 87, 0.55);
}

.cbd-size-chip.active {
    border-color: #b08d57;
    background: rgba(176, 141, 87, 0.10);
    box-shadow: inset 0 0 0 1px #b08d57;
}

/* Width summary line (replaces the faux readonly input) */
.cbd-width-summary {
    margin: -4px 0 10px;
    font-size: 0.85rem;
    color: var(--cbd-muted, #6d655c);
}

/* Editable strip rows */
.cbd-build-strip-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cbd-strip-handle {
    cursor: grab;
    color: var(--cbd-muted, #6d655c);
    font-size: 1rem;
    line-height: 1;
    padding: 4px 2px;
    user-select: none;
}

.cbd-strip-arrows {
    display: none;
    flex-direction: column;
    gap: 2px;
}

.cbd-strip-arrow {
    appearance: none;
    background: none;
    border: 1px solid var(--cbd-border, #e6ddd3);
    border-radius: 4px;
    color: var(--cbd-muted, #6d655c);
    font-size: 0.55rem;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
}

.cbd-strip-arrow:active {
    background: rgba(176, 141, 87, 0.15);
}

/* Touch devices: hide the drag handle (HTML5 drag doesn't fire), show arrows */
@media (hover: none) and (pointer: coarse) {
    .cbd-strip-handle { display: none; }
    .cbd-strip-arrows { display: flex; }
}

.cbd-strip-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--cbd-ink, #1d1a16);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cbd-strip-width-fixed {
    font-size: 0.85rem;
    color: var(--cbd-muted, #6d655c);
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}

/* Board width control — one step per 3/4" strip */
.cbd-width-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--cbd-border, #e6ddd3);
    border-radius: 999px;
    padding: 3px;
    background: var(--cbd-surface, #fff);
}

.cbd-width-step {
    appearance: none;
    background: none;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    color: #8a6a3f;
    cursor: pointer;
    transition: background 0.15s ease;
}

.cbd-width-step:hover {
    background: rgba(176, 141, 87, 0.14);
}

.cbd-width-display {
    min-width: 64px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--cbd-ink, #1d1a16);
}

.cbd-control-hint {
    margin: 6px 0 0;
    font-size: 0.75rem;
    color: var(--cbd-muted, #6d655c);
}

/* Quiet, deliberate delete */
.cbd-build-strip-item .cbd-remove-strip {
    appearance: none;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.05rem;
    line-height: 1;
    color: var(--cbd-muted, #6d655c);
    cursor: pointer;
    flex: 0 0 auto;
    transition: color 0.15s ease, background 0.15s ease;
}

.cbd-build-strip-item .cbd-remove-strip:hover,
.cbd-build-strip-item .cbd-remove-strip:active {
    color: #b3372f;
    background: rgba(179, 55, 47, 0.10);
}

/* Add Strip + wood picker */
.cbd-add-strip-btn {
    appearance: none;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: rgba(176, 141, 87, 0.10);
    border: 1px dashed rgba(176, 141, 87, 0.6);
    border-radius: 8px;
    color: #8a6a3f;
    font-family: var(--cbd-sans);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.cbd-add-strip-btn:hover {
    background: rgba(176, 141, 87, 0.18);
}

.cbd-wood-picker {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--cbd-border, #e6ddd3);
    border-radius: 8px;
    background: var(--cbd-surface, #fff);
}

.cbd-wood-picker-label {
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: var(--cbd-muted, #6d655c);
}

.cbd-wood-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.cbd-wood-picker-item {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: none;
    border: 1px solid var(--cbd-border, #e6ddd3);
    border-radius: 8px;
    font-family: var(--cbd-sans);
    font-size: 0.85rem;
    color: var(--cbd-ink, #1d1a16);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.cbd-wood-picker-item:hover {
    border-color: rgba(176, 141, 87, 0.6);
}

.cbd-wood-picker-chip {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    flex: 0 0 auto;
}

/* ── Saved designs (v1.4.0) ──────────────────────────────────────────────── */
.cbd-saved-designs {
    max-width: 1000px;
    margin: 0 auto 26px;
}

.cbd-saved-tile {
    position: relative;
}

.cbd-tile-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.9rem;
    line-height: 1;
    color: var(--cbd-muted, #6d655c);
    background: rgba(251, 247, 242, 0.9);
    border: 1px solid var(--cbd-border, #e6ddd3);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.cbd-saved-tile:hover .cbd-tile-delete,
.cbd-tile-delete:focus-visible {
    opacity: 1;
}

@media (hover: none) and (pointer: coarse) {
    .cbd-tile-delete { opacity: 1; }
}

.cbd-tile-delete:hover,
.cbd-tile-delete:active {
    color: #b3372f;
    border-color: rgba(179, 55, 47, 0.4);
}

/* Save button in the builder header */
.cbd-header-btn--save {
    background: transparent;
    border: 1.5px solid #d4a574;
    color: #f0e3cf;
    font-weight: 600;
}

.cbd-header-btn--save:hover {
    background: rgba(212, 165, 116, 0.18);
    color: #fff;
    border-color: #e0b888;
}

/* Five chips: allow tighter packing */
.cbd-size-presets {
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
}

/* Saved tiles keep their size even when there are only one or two */
.cbd-saved-designs .cbd-showcase-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

/* ── Save-with-account modal (v1.5.0) ────────────────────────────────────── */
.cbd-account-modal {
    position: fixed;
    inset: 0;
    z-index: 1000001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cbd-account-modal[hidden] {
    display: none;
}

.cbd-account-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 12, 0.65);
}

.cbd-account-modal-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: #fbf7f2;
    border: 1px solid rgba(212, 165, 116, 0.4);
    border-radius: 14px;
    padding: 26px 24px 20px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    font-family: var(--cbd-sans);
}

.cbd-account-modal-card h3 {
    margin: 0 0 6px;
    font-size: 1.25rem;
    color: var(--cbd-ink, #1d1a16);
}

.cbd-account-modal-sub {
    margin: 0 0 16px;
    font-size: 0.88rem;
    color: var(--cbd-muted, #6d655c);
}

.cbd-account-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    appearance: none;
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--cbd-muted, #6d655c);
    cursor: pointer;
}

.cbd-account-modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
}

.cbd-account-field {
    margin-bottom: 12px;
}

.cbd-account-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cbd-ink, #1d1a16);
    margin-bottom: 4px;
}

.cbd-account-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--cbd-border, #e6ddd3);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
}

.cbd-account-field input:focus {
    outline: 2px solid rgba(176, 141, 87, 0.5);
    outline-offset: 1px;
}

.cbd-account-lost {
    display: inline-block;
    margin-top: 5px;
    font-size: 0.78rem;
    color: #8a6a3f;
}

.cbd-hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.cbd-account-error {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: #b3372f;
}

.cbd-account-submit {
    appearance: none;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #b08d57 0%, #d4a574 100%);
    border: 1px solid rgba(176, 141, 87, 0.8);
    border-radius: 999px;
    color: #2c1810;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cbd-account-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #c49a65 0%, #e0b888 100%);
    transform: translateY(-1px);
}

.cbd-account-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.cbd-account-note {
    margin: 12px 0 0;
    font-size: 0.76rem;
    color: var(--cbd-muted, #6d655c);
    text-align: center;
}

/* ── Matched Length/Width steppers (v2.2.0) ──────────────────────────────── */
.cbd-stepper-control {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--cbd-border, #e6ddd3);
    border-radius: 999px;
    padding: 3px;
    background: var(--cbd-surface, #fff);
    max-width: 220px;
}

.cbd-step-btn {
    appearance: none;
    background: none;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    color: #8a6a3f;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background 0.15s ease;
}

.cbd-step-btn:hover {
    background: rgba(176, 141, 87, 0.14);
}

.cbd-stepper-input {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--cbd-ink, #1d1a16);
    border: none;
    background: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Hide the native number spinner so Length matches Width visually */
.cbd-stepper-input::-webkit-outer-spin-button,
.cbd-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cbd-stepper-input:focus {
    outline: none;
}

/* Desktop: surface the running cost as a sticky bar inside the builder */


/* ── Visual strip stack (v2.5.0) ─────────────────────────────────────────────
   Replaces the tall per-strip row list with a compact board cross-section.
   Tap a segment to select it; one editor row handles recolor/move/delete. */
.cbd-strip-stack-wrap {
    margin-bottom: 12px;
}

.cbd-strip-stack {
    display: flex;
    width: 100%;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 3px 8px rgba(0, 0, 0, 0.12);
    background: #efe7da;
}

.cbd-stack-seg {
    appearance: none;
    border: none;
    padding: 0;
    margin: 0;
    min-width: 8px;
    height: 100%;
    cursor: pointer;
    position: relative;
    transition: filter 0.12s ease, box-shadow 0.12s ease;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.cbd-stack-seg:last-child {
    border-right: none;
}

.cbd-stack-seg:hover {
    filter: brightness(1.08);
}

.cbd-stack-seg.selected {
    z-index: 2;
    box-shadow: inset 0 0 0 3px #b08d57, 0 0 0 1px #b08d57;
    filter: brightness(1.05);
}

.cbd-stack-seg:focus-visible {
    outline: 2px solid #1d1a16;
    outline-offset: -2px;
}

.cbd-stack-empty {
    margin: 0;
    padding: 16px 12px;
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    color: var(--cbd-muted, #6d655c);
    background: repeating-linear-gradient(45deg, #fbf7f2, #fbf7f2 8px, #f3ece1 8px, #f3ece1 16px);
}

/* Selection editor — fixed height regardless of strip count */
.cbd-strip-editor {
    background: var(--cbd-surface, #fff);
    border: 1px solid var(--cbd-border, #e6ddd3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.cbd-strip-editor[hidden] {
    display: none;
}

.cbd-strip-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.cbd-strip-editor-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cbd-ink, #1d1a16);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cbd-strip-editor-actions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.cbd-strip-move,
.cbd-strip-delete {
    appearance: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--cbd-border, #e6ddd3);
    background: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    color: var(--cbd-ink, #1d1a16);
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.cbd-strip-move:hover:not(:disabled) {
    background: rgba(176, 141, 87, 0.12);
    border-color: rgba(176, 141, 87, 0.5);
}

.cbd-strip-move:disabled {
    opacity: 0.35;
    cursor: default;
}

.cbd-strip-delete {
    color: var(--cbd-muted, #6d655c);
}

.cbd-strip-delete:hover {
    background: rgba(179, 55, 47, 0.1);
    border-color: rgba(179, 55, 47, 0.4);
    color: #b3372f;
}

.cbd-strip-editor-label {
    margin: 0 0 8px;
    font-size: 0.8rem;
    color: var(--cbd-muted, #6d655c);
}

.cbd-strip-wood-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cbd-strip-wood-opt {
    appearance: none;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.cbd-strip-wood-opt:hover {
    transform: translateY(-2px);
}

.cbd-strip-wood-opt.active {
    border-color: #1d1a16;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #b08d57;
}

/* Hint pill at the bottom of the canvas */
.cbd-canvas-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    color: rgba(240, 227, 207, 0.85);
    font-size: 0.78rem;
    font-family: var(--cbd-sans);
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 16px;
    border-radius: 999px;
    pointer-events: none;
    white-space: nowrap;
}

.cbd-canvas-hint[hidden] {
    display: none;
}

/* ── Board tray under the canvas (v2.7.0) ───────────────────────────────────
   The board's cross-section as tappable segments, with one editor row.
   Aggressive resets so site themes can't restyle the segments. */
.cbd-board-tray {
    margin-top: 12px;
    background: #26211b;
    border-radius: 10px;
    padding: 12px 14px;
    flex: 0 0 auto;
}

.cbd-tray-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.cbd-tray-title {
    color: #f0e3cf;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: var(--cbd-sans);
}

.cbd-tray-meta {
    color: rgba(240, 227, 207, 0.55);
    font-size: 0.72rem;
    font-family: var(--cbd-sans);
    white-space: nowrap;
}

.cbd-tray-stack {
    display: flex !important;
    width: 100% !important;
    height: 46px !important;
    border-radius: 7px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.cbd-tray-seg {
    all: unset;
    -webkit-appearance: none !important;
    appearance: none !important;
    flex: 1 1 0 !important;
    min-width: 6px !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-right: 1px solid rgba(0, 0, 0, 0.18) !important;
    border-radius: 0 !important;
    box-shadow: none;
    cursor: pointer;
    box-sizing: border-box !important;
    transition: filter 0.12s ease;
}

.cbd-tray-seg:last-child {
    border-right: none !important;
}

.cbd-tray-seg:hover {
    filter: brightness(1.1);
}

.cbd-tray-seg.selected {
    box-shadow: inset 0 0 0 3px #d4a574 !important;
    filter: brightness(1.06);
}

.cbd-tray-seg:focus-visible {
    outline: 2px solid #fff !important;
    outline-offset: -2px !important;
}

.cbd-tray-empty {
    margin: 0 !important;
    width: 100%;
    text-align: center;
    align-self: center;
    font-size: 0.8rem;
    color: rgba(240, 227, 207, 0.6);
    font-family: var(--cbd-sans);
}

/* Editor row: fixed height regardless of strip count */
.cbd-tray-editor {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(212, 165, 116, 0.35);
    border-radius: 8px;
    padding: 8px 12px;
}

.cbd-tray-editor[hidden] {
    display: none;
}

.cbd-tray-editor-title {
    color: #f0e3cf;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--cbd-sans);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 1 auto;
}

.cbd-tray-woods {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.cbd-tray-wood-opt {
    all: unset;
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 7px !important;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
    box-sizing: border-box !important;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.cbd-tray-wood-opt:hover {
    transform: translateY(-2px);
}

.cbd-tray-wood-opt.active {
    border-color: #fff !important;
    box-shadow: 0 0 0 2px #d4a574 !important;
}

.cbd-tray-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex: 0 0 auto;
}

.cbd-tray-btn {
    all: unset;
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 7px !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f0e3cf !important;
    font-size: 0.85rem;
    text-align: center;
    line-height: 28px !important;
    cursor: pointer;
    box-sizing: border-box !important;
    font-family: var(--cbd-sans);
    transition: background 0.12s ease;
}

.cbd-tray-btn:hover:not(:disabled) {
    background: rgba(212, 165, 116, 0.25) !important;
}

.cbd-tray-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.cbd-tray-btn-del:hover {
    background: rgba(179, 55, 47, 0.35) !important;
}

/* On small screens the tray stays below the canvas, full width */
@media (max-width: 768px) {
    .cbd-board-tray {
        margin-top: 10px;
        padding: 10px;
    }

    .cbd-tray-editor {
        flex-wrap: wrap;
        gap: 8px;
    }

    .cbd-tray-editor-title {
        flex: 1 1 100%;
    }
}

/* ── Tray drag-reorder + add button (v2.8.0) ─────────────────────────────── */
.cbd-tray-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.cbd-tray-row .cbd-tray-stack {
    flex: 1 1 auto;
}

.cbd-tray-add {
    all: unset;
    -webkit-appearance: none !important;
    appearance: none !important;
    flex: 0 0 auto !important;
    width: 40px !important;
    border-radius: 7px !important;
    border: 1px dashed rgba(212, 165, 116, 0.6) !important;
    background: rgba(212, 165, 116, 0.08) !important;
    color: #d4a574 !important;
    font-size: 1.3rem;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease;
}

.cbd-tray-add:hover {
    background: rgba(212, 165, 116, 0.2) !important;
}

/* Segments are draggable: stop touch scrolling from hijacking the gesture */
.cbd-tray-seg {
    touch-action: none !important;
    cursor: grab;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-user-drag: none !important;
}

.cbd-tray-stack {
    user-select: none !important;
    -webkit-user-select: none !important;
}

.cbd-tray-stack.cbd-tray-dragging .cbd-tray-seg {
    cursor: grabbing;
}

.cbd-tray-adder .cbd-tray-editor-title {
    flex: 0 0 auto;
}

/* ── Welcome page: slim banner, no wrapper boxes (v2.9.0) ───────────────────
   The hero shrinks to a compact left-aligned strip and the cream/white
   wrapper cards are removed so presets are visible without scrolling. */
.cbd-container {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

#cbd-step-welcome.cbd-step {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

#cbd-step-welcome .cbd-step-content {
    padding: 0;
}

/* The welcome step's nav strip is empty — don't paint its bar */
#cbd-step-welcome .cbd-step-navigation {
    display: none;
}

.cbd-welcome-hero,
.cbd-welcome-hero.cbd-block-section {
    text-align: left;
    padding: 24px 32px 26px;
    margin-bottom: 26px;
}

.cbd-welcome-hero h1,
.cbd-welcome-hero.cbd-block-section > h1,
.cbd-welcome-hero.cbd-block-section > .wp-block-heading:first-child {
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
    margin-bottom: 6px;
}

.cbd-welcome-hero p {
    margin: 0;
    max-width: 680px;
    font-size: 0.98rem;
}

/* ── Welcome banner = build header (v2.9.1) ─────────────────────────────────
   Consistency pass: the welcome banner now clones the builder header's
   treatment — same gradient, brass underline, square corners, same serif
   title (no uppercase/letter-spacing) — and breaks out to full viewport
   width just like the builder's full-screen header. */
.cbd-welcome-hero,
.cbd-welcome-hero.cbd-block-section {
    width: auto;
    max-width: none;
    margin: 0 calc(50% - 50vw) 26px;
    border: none;
    border-bottom: 3px solid var(--cbd-accent, #b08d57);
    border-radius: 0;
    background: linear-gradient(180deg, #3d2418, #2c1810);
    box-shadow: none;
    padding: 18px 25px 20px;
    overflow: visible;
}

.cbd-welcome-hero h1,
.cbd-welcome-hero.cbd-block-section > h1,
.cbd-welcome-hero.cbd-block-section > .wp-block-heading:first-child {
    font-family: var(--cbd-serif);
    color: #fbf7f2 !important;
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    margin: 0 0 4px;
}

.cbd-welcome-hero p {
    font-family: var(--cbd-sans);
    color: rgba(243, 239, 231, 0.75) !important;
    font-size: 0.95rem;
    margin: 0;
    max-width: 680px;
}

/* ── Design tokens for the portaled builder overlay (v2.9.2) ────────────────
   The overlay is moved to <body> when it opens, outside .cbd-container, so it
   needs the custom properties too — but ONLY the properties. (Sharing the
   container's whole rule in 2.9.1 leaked max-width/padding onto the overlay
   and broke its full-screen coverage.) */
.cbd-build-screen-overlay {
    --cbd-bg: #f6f1ea;
    --cbd-surface: #ffffff;
    --cbd-ink: #1d1a16;
    --cbd-muted: #6d655c;
    --cbd-border: #e6ddd3;
    --cbd-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
    --cbd-shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.06);
    --cbd-accent: #b08d57;
    --cbd-accent-2: #234235;
    --cbd-radius: 16px;
    --cbd-radius-sm: 12px;
    --cbd-serif: "Cormorant Garamond", ui-serif, Georgia, "Times New Roman", Times, serif;
    --cbd-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ── Flush banner: remove page-top spacing above the designer (v2.9.3) ─────
   Scoped with :has() so only pages containing the designer are affected. */
:where(.entry-content, .site-main, .content-area, .site-content, .wp-block-post-content, .page-content, main):has(.cbd-container) {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

:where(.entry-content, .wp-block-post-content):has(.cbd-container) > p:empty {
    display: none;
}

.cbd-container {
    margin-top: 0 !important;
}

/* ── Mobile builder fixes (v2.9.4) ──────────────────────────────────────── */
@media (max-width: 768px) {
    /* Sidebar was content-box: width 100% + padding overflowed the viewport */
    .cbd-build-controls-sidebar {
        box-sizing: border-box !important;
    }

    /* Header: title truncates so the action buttons always fit on-screen */
    .cbd-build-header {
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }

    .cbd-build-header h2 {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 1rem !important;
    }

    .cbd-build-header-actions {
        flex: 0 0 auto !important;
        gap: 6px !important;
    }

    .cbd-build-header-actions .cbd-header-btn {
        padding: 6px 10px !important;
        font-size: 0.68rem !important;
        letter-spacing: 0.02em !important;
        white-space: nowrap !important;
    }

    .cbd-build-close {
        font-size: 1.6rem !important;
        padding: 0 2px !important;
    }
}

@media (max-width: 520px) {
    /* Palette: let the total drop to its own right-aligned line when tight */
    .cbd-build-palette-section {
        flex-wrap: wrap !important;
        gap: 8px 16px !important;
    }

    .cbd-palette-total {
        flex-direction: row !important;
        align-items: baseline !important;
        gap: 8px !important;
        margin-left: auto !important;
        border-left: none !important;
        padding: 0 !important;
        min-width: 0 !important;
    }

    .cbd-palette-total-amount {
        font-size: 1.35rem !important;
    }
}

/* ── Mobile builder: single scrolling column (v2.9.4) ───────────────────────
   The desktop budget (fixed canvas + capped scrolling sidebar) can't fit on
   phones — the tray overflowed and the sidebar painted over it. On mobile the
   builder becomes one naturally-sized scrolling column instead. */
@media (max-width: 768px) {
    .cbd-build-main {
        flex-direction: column !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }

    .cbd-build-preview-section {
        flex: 0 0 auto !important;
        overflow: visible !important;
        min-height: 0 !important;
    }

    .cbd-build-canvas-container {
        height: 42vh !important;
        min-height: 180px !important;
        flex: 0 0 auto !important;
    }

    .cbd-build-controls-sidebar {
        width: 100% !important;
        max-height: none !important;
        overflow: visible !important;
        flex: 0 0 auto !important;
        border-left: none !important;
        border-top: 3px solid var(--cbd-border) !important;
    }
}

/* Mobile: keep the banner flush (the legacy mobile rule re-added top padding) */
@media (max-width: 768px) {
    .cbd-container {
        padding: 0 10px 10px;
    }
}

/* Small screens: the legacy 480px block re-added top padding with !important */
@media (max-width: 480px) {
    .cbd-container {
        padding: 0 8px 8px !important;
    }

    #cbd-step-welcome .cbd-step-content {
        padding: 0 !important;
    }
}

/* ── Mobile: hide the woods palette, keep the total (v2.9.5) ────────────────
   Palette drag-to-add is a mouse-only interaction; on phones strips are
   added via the tray's "+" button. The section collapses to a slim strip
   holding just the running total. */
@media (max-width: 768px) {
    .cbd-palette-main {
        display: none !important;
    }

    .cbd-build-palette-section {
        padding: 8px 16px !important;
        gap: 0 !important;
    }

    .cbd-palette-total {
        flex-direction: row !important;
        align-items: baseline !important;
        gap: 8px !important;
        margin-left: auto !important;
        border-left: none !important;
        padding: 0 !important;
        min-width: 0 !important;
    }

    .cbd-palette-total-amount {
        font-size: 1.3rem !important;
    }
}

/* ── Dimension row, bottom CTA, and mobile bottom clearance (v2.9.6) ─────── */
.cbd-dim-row {
    display: flex;
    gap: 12px;
}

.cbd-dim-row .cbd-control-group {
    flex: 1 1 0;
    min-width: 0;
}

.cbd-dim-row .cbd-stepper-control {
    max-width: none;
}

.cbd-dim-row .cbd-control-hint {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bottom Request Order button — mirrors the header CTA */
.cbd-build-bottom-cta {
    padding: 4px 0 8px;
}

.cbd-bottom-order-btn {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    padding: 13px 18px;
    border: 1px solid rgba(176, 141, 87, 0.8);
    border-radius: 999px;
    background: linear-gradient(135deg, #b08d57, #d4a574);
    color: #2c1810;
    font-family: var(--cbd-sans);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.cbd-bottom-order-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

/* Mobile: clear the browser's bottom address bar */
@media (max-width: 768px) {
    .cbd-build-main {
        padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ── Builder canvas: touch gestures rotate/zoom instead of scrolling (v2.12.0) ── */
.cbd-build-canvas-stage canvas {
    touch-action: none;
}

/* ── Product picker (v2.13.0) ── */
.cbd-product-picker {
    margin: 26px 0 6px;
    text-align: center;
}
.cbd-product-picker-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.cbd-product-tile {
    all: unset;
    cursor: pointer;
    box-sizing: border-box;
    padding: 12px 22px;
    border: 1.5px solid var(--cbd-border, #e2d8c8);
    border-radius: 12px;
    background: var(--cbd-card, #ffffff);
    font-family: var(--cbd-sans, sans-serif);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: var(--cbd-ink, #2c1810);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cbd-product-tile:hover {
    border-color: var(--cbd-accent, #b08d57);
}
.cbd-product-tile--active {
    border-color: var(--cbd-accent, #b08d57);
    box-shadow: 0 0 0 1.5px var(--cbd-accent, #b08d57) inset;
}
@media (max-width: 480px) {
    .cbd-product-tile { padding: 10px 14px; font-size: 0.85rem; }
}

/* Fixed-size products: strip count is locked — hide add/delete (v2.13.0).
   !important needed because the tray theme-proofing forces display. */
#cbd-board-tray.cbd-tray--locked #cbd-tray-add,
#cbd-board-tray.cbd-tray--locked #cbd-tray-delete {
    display: none !important;
}

/* ── Per-order shape chooser (v2.18.0) ── */
.cbd-shape-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0 2px;
}
.cbd-shape-label {
    font-family: var(--cbd-sans, sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cbd-ink, #2c1810);
}
.cbd-shape-options {
    display: inline-flex;
    border: 1.5px solid var(--cbd-border, #e2d8c8);
    border-radius: 10px;
    overflow: hidden;
}
.cbd-shape-btn {
    all: unset;
    cursor: pointer;
    box-sizing: border-box;
    padding: 8px 20px;
    font-family: var(--cbd-sans, sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cbd-ink, #2c1810);
    background: var(--cbd-card, #fff);
    transition: background 0.15s ease, color 0.15s ease;
}
.cbd-shape-btn + .cbd-shape-btn {
    border-left: 1.5px solid var(--cbd-border, #e2d8c8);
}
.cbd-shape-btn--active {
    background: var(--cbd-accent, #b08d57);
    color: #fff;
}
