@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=Space+Mono:wght@400;700&display=swap');

/* ============================================================
   CSS VARIABLES — Inherit from parent
   ============================================================ */
.wdm-container {
    --wdm-accent: #e74c3c;
    --wdm-accent-2: #ff6b6b;
    --wdm-purple: #a855f7;
    --wdm-purple-deep: #6c3fc5;
    --wdm-success: #27ae60;
    --wdm-shadow: 0 8px 32px rgba(0,0,0,0.5);
    --wdm-shadow-soft: 0 10px 30px rgba(0,0,0,0.25);
    --wdm-radius: 16px;
    --wdm-radius-sm: 10px;
    --wdm-transition: all 0.3s ease;
    --wdm-font-head: 'Outfit', sans-serif;
    --wdm-font-mono: 'Space Mono', monospace;
}

/* ============================================================
   CONTAINER
   ============================================================ */
.wdm-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.wdm-container .tool-wrapper {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    min-height: 0;
    overflow: hidden;
    position: relative;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.wdm-container .tool-wrapper {
    visibility: visible !important;
    opacity: 1 !important;
}

/* ============================================================
   CONTROLS PANEL
   ============================================================ */
.wdm-controls {
    flex: 0 0 380px;
    width: 380px;
    min-width: 380px;
    background: var(--panel-bg);
    border-left: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 20px 30px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    z-index: 10;
    gap: 20px;
}

.wdm-controls::-webkit-scrollbar { width: 4px; }
.wdm-controls::-webkit-scrollbar-track { background: transparent; }
.wdm-controls::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Header */
.wdm-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--panel-border);
}

.wdm-title {
    font-family: var(--wdm-font-head);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 4px;
    letter-spacing: -0.3px;
}

.wdm-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Sections */
.wdm-section {
    background: var(--card-bg);
    border-radius: var(--wdm-radius);
    border: 1px solid var(--panel-border);
    padding: 16px;
    transition: var(--wdm-transition);
}

.wdm-section:hover {
    border-color: rgba(168, 85, 247, 0.3);
}

.wdm-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-family: var(--wdm-font-head);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}

.wdm-section-icon {
    font-size: 1.1rem;
}

.wdm-section-label {
    flex: 1;
}

.wdm-badge {
    background: var(--wdm-purple);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 20px;
    min-width: 24px;
    text-align: center;
}

/* Input Rows */
.wdm-input-group {
    margin-bottom: 12px;
}

.wdm-add-row {
    display: flex;
    gap: 8px;
}

.wdm-add-row input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--wdm-radius-sm);
    font-family: var(--wdm-font-head);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    transition: var(--wdm-transition);
    min-width: 0;
}

.wdm-add-row input[type="text"]:focus {
    outline: none;
    border-color: var(--wdm-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.wdm-add-row input[type="text"]::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.wdm-add-row .spin-btn {
    width: auto;
    padding: 10px 18px;
    font-size: 0.85rem;
    min-height: 42px;
    flex-shrink: 0;
    border-radius: var(--wdm-radius-sm);
    margin: 0;
}

/* Lists */
.wdm-options-list,
.wdm-criteria-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    min-height: 40px;
}

.wdm-options-list::-webkit-scrollbar,
.wdm-criteria-list::-webkit-scrollbar {
    width: 3px;
}
.wdm-options-list::-webkit-scrollbar-thumb,
.wdm-criteria-list::-webkit-scrollbar-thumb {
    background: var(--wdm-purple);
    border-radius: 3px;
}

/* Empty State */
.wdm-empty-state {
    text-align: center;
    padding: 16px 10px;
    color: var(--text-muted);
}

.wdm-empty-icon {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 6px;
    opacity: 0.5;
}

.wdm-empty-state p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    opacity: 0.6;
}

.wdm-empty-hint {
    font-size: 0.75rem;
    opacity: 0.4;
}

/* Items */
.wdm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--wdm-radius-sm);
    border: 1px solid var(--panel-border);
    transition: var(--wdm-transition);
    animation: wdmSlideIn 0.25s ease;
}

.wdm-item:hover {
    border-color: rgba(168, 85, 247, 0.3);
    transform: translateX(4px);
}

@keyframes wdmSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.wdm-item-label {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wdm-item-weight {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.wdm-item-weight input[type="range"] {
    width: 60px;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 3px;
    cursor: pointer;
}

.wdm-item-weight input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--wdm-purple);
    cursor: pointer;
}

.wdm-item-weight input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--wdm-purple);
    cursor: pointer;
    border: none;
}

.wdm-item-weight-value {
    min-width: 24px;
    font-family: var(--wdm-font-mono);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--wdm-purple);
}

.wdm-item-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--wdm-transition);
    line-height: 1;
    opacity: 0.4;
}

.wdm-item-delete:hover {
    opacity: 1;
    color: var(--wdm-accent);
    background: rgba(231, 76, 60, 0.1);
}

/* Criteria weight label */
.wdm-criteria-weight-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Actions */
.wdm-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}

.wdm-actions .spin-btn {
    min-height: 48px;
    font-size: 0.95rem;
    margin: 0;
}

.wdm-actions .spin-btn--ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-color);
    box-shadow: none;
    opacity: 0.6;
    padding: 10px;
    font-size: 0.85rem;
    min-height: 40px;
}

.wdm-actions .spin-btn--ghost:hover {
    opacity: 1;
    background: var(--card-bg);
    transform: none;
}

.wdm-actions .spin-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Context Help */
.wdm-counter-context {
    padding: 12px 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid var(--panel-border);
    margin-top: auto;
    background: rgba(168, 85, 247, 0.04);
    border-radius: var(--wdm-radius-sm);
}

.wdm-counter-context p {
    margin: 0;
}

.wdm-counter-context strong {
    color: var(--text);
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.wdm-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 24px 32px;
    min-height: 0;
    position: relative;
    background: var(--bg);
    overflow-y: auto;
    gap: 24px;
}

/* Empty Main State */
.wdm-empty-main {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.wdm-empty-main-content {
    text-align: center;
    max-width: 560px;
    padding: 40px;
}

.wdm-empty-main-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.6;
}

.wdm-empty-main-content h3 {
    font-family: var(--wdm-font-head);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 8px;
}

.wdm-empty-main-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0 0 24px;
}

.wdm-empty-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    text-align: left;
}

.wdm-empty-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--card-bg);
    border-radius: var(--wdm-radius-sm);
    border: 1px solid var(--panel-border);
}

.wdm-empty-step-num {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: var(--wdm-purple);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.wdm-empty-step span:last-child {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

/* ============================================================
   MATRIX PANEL
   ============================================================ */
.wdm-matrix-panel {
    width: 100%;
    max-width: 100%;
    background: var(--panel-bg);
    border-radius: var(--wdm-radius);
    border: 1px solid var(--panel-border);
    overflow: hidden;
}

.wdm-matrix-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--panel-border);
}

.wdm-matrix-title {
    font-family: var(--wdm-font-head);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 4px;
}

.wdm-matrix-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.wdm-matrix-scroll {
    overflow-x: auto;
    padding: 4px;
}

.wdm-matrix-wrapper {
    padding: 16px 20px 20px;
    min-width: 300px;
}

/* Matrix Table */
.wdm-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--wdm-font-head);
    font-size: 0.9rem;
}

.wdm-matrix-table th,
.wdm-matrix-table td {
    padding: 10px 14px;
    text-align: center;
    border: 1px solid var(--border-color);
    min-width: 60px;
}

.wdm-matrix-table th {
    background: var(--card-bg);
    color: var(--text);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.wdm-matrix-corner {
    min-width: 120px !important;
    text-align: left !important;
    background: var(--panel-bg) !important;
}

.wdm-matrix-table .wdm-option-label {
    text-align: left;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.wdm-matrix-table .wdm-criteria-label {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    font-size: 0.8rem;
}

.wdm-matrix-table .wdm-criteria-weight {
    display: block;
    font-size: 0.65rem;
    color: var(--wdm-purple);
    font-weight: 700;
    margin-top: 2px;
}

.wdm-matrix-table input[type="number"] {
    width: 56px;
    padding: 6px 4px;
    text-align: center;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--wdm-font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    transition: var(--wdm-transition);
}

.wdm-matrix-table input[type="number"]:focus {
    outline: none;
    border-color: var(--wdm-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.wdm-matrix-table input[type="number"]:hover {
    border-color: var(--wdm-purple);
}

.wdm-matrix-table input[type="number"]::-webkit-inner-spin-button,
.wdm-matrix-table input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}
.wdm-matrix-table input[type="number"] {
    -moz-appearance: textfield;
}

.wdm-matrix-table td:has(input[type="number"]) {
    padding: 6px 8px;
}

.wdm-matrix-table .wdm-row-total {
    font-weight: 800;
    color: var(--wdm-purple);
    font-family: var(--wdm-font-mono);
    font-size: 0.9rem;
    min-width: 70px;
}

.wdm-matrix-table .wdm-row-delete-option {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--wdm-transition);
    opacity: 0.3;
}

.wdm-matrix-table .wdm-row-delete-option:hover {
    opacity: 1;
    color: var(--wdm-accent);
    background: rgba(231, 76, 60, 0.1);
}

/* Row hover */
.wdm-matrix-table tbody tr:hover {
    background: rgba(168, 85, 247, 0.04);
}

/* ============================================================
   RESULTS PANEL
   ============================================================ */
.wdm-results-panel {
    width: 100%;
    max-width: 100%;
    background: var(--panel-bg);
    border-radius: var(--wdm-radius);
    border: 1px solid var(--panel-border);
    overflow: hidden;
    animation: wdmFadeUp 0.4s ease;
}

@keyframes wdmFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wdm-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--panel-border);
    flex-wrap: wrap;
    gap: 12px;
}

.wdm-results-title {
    font-family: var(--wdm-font-head);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}

.wdm-results-actions {
    display: flex;
    gap: 8px;
}

.wdm-results-actions .spin-btn {
    min-height: 36px;
    padding: 6px 16px;
    font-size: 0.8rem;
    margin: 0;
}

/* Ranking */
.wdm-results-ranking {
    padding: 20px 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wdm-ranking-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: var(--wdm-radius-sm);
    border: 1px solid var(--panel-border);
    transition: var(--wdm-transition);
    animation: wdmSlideIn 0.3s ease;
}

.wdm-ranking-item:hover {
    transform: translateX(4px);
    border-color: rgba(168, 85, 247, 0.3);
}

.wdm-ranking-position {
    font-family: var(--wdm-font-mono);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--wdm-purple);
    min-width: 40px;
}

.wdm-ranking-name {
    flex: 1;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.wdm-ranking-score {
    font-family: var(--wdm-font-mono);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--wdm-accent-2);
    min-width: 60px;
    text-align: right;
}

.wdm-ranking-bar {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    min-width: 80px;
}

.wdm-ranking-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--wdm-purple-deep), var(--wdm-purple));
    transition: width 0.8s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.wdm-ranking-item:first-child .wdm-ranking-bar-fill {
    background: linear-gradient(90deg, var(--wdm-accent-2), #ff8a65);
}

/* Results Matrix */
.wdm-results-matrix {
    padding: 0 24px 24px;
    overflow-x: auto;
}

.wdm-results-matrix table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.wdm-results-matrix th,
.wdm-results-matrix td {
    padding: 8px 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.wdm-results-matrix th {
    background: var(--card-bg);
    color: var(--text);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wdm-results-matrix .wdm-result-option {
    text-align: left;
    font-weight: 600;
    color: var(--text);
}

.wdm-results-matrix .wdm-result-total {
    font-weight: 800;
    color: var(--wdm-purple);
}

/* ============================================================
   SENSITIVITY ANALYSIS
   ============================================================ */
.wdm-sensitivity-panel {
    width: 100%;
    max-width: 100%;
    background: var(--panel-bg);
    border-radius: var(--wdm-radius);
    border: 1px solid var(--panel-border);
    overflow: hidden;
    animation: wdmFadeUp 0.4s ease;
}

.wdm-sensitivity-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--panel-border);
}

.wdm-sensitivity-header h4 {
    font-family: var(--wdm-font-head);
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 4px;
}

.wdm-sensitivity-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

#wdmSensitivityContent {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wdm-sensitivity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--card-bg);
    border-radius: var(--wdm-radius-sm);
    border: 1px solid var(--panel-border);
}

.wdm-sensitivity-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    min-width: 120px;
}

.wdm-sensitivity-options {
    flex: 1;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wdm-sensitivity-option {
    font-size: 0.8rem;
    padding: 4px 10px;
    background: var(--bg);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 500;
}

.wdm-sensitivity-option.high {
    border-color: var(--wdm-accent-2);
    color: var(--wdm-accent-2);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet / Small Desktop */
@media (max-width: 1024px) {
    .wdm-controls {
        flex: 0 0 340px;
        width: 340px;
        min-width: 340px;
        padding: 16px;
    }
    
    .wdm-main {
        padding: 16px 20px;
    }
}

/* Mobile */
@media (max-width: 899px) {
    .wdm-container .tool-wrapper {
        flex-direction: column;
        overflow: visible;
    }
    
    .wdm-controls {
        order: -1;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        border-left: none;
        border-bottom: 1px solid var(--panel-border);
        overflow: visible;
        padding: 16px;
        max-height: none;
        flex: 0 0 auto;
    }
    
    .wdm-main {
        padding: 16px 12px;
        overflow: visible;
        min-height: auto;
    }
    
    .wdm-empty-main {
        min-height: 300px;
    }
    
    .wdm-empty-steps {
        grid-template-columns: 1fr;
    }
    
    .wdm-matrix-wrapper {
        padding: 12px 12px 16px;
        min-width: auto;
    }
    
    .wdm-matrix-table th,
    .wdm-matrix-table td {
        padding: 6px 8px;
        font-size: 0.8rem;
        min-width: 40px;
    }
    
    .wdm-matrix-table input[type="number"] {
        width: 44px;
        padding: 4px 2px;
        font-size: 0.8rem;
    }
    
    .wdm-matrix-corner {
        min-width: 80px !important;
    }
    
    .wdm-results-ranking {
        padding: 16px;
    }
    
    .wdm-ranking-item {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }
    
    .wdm-ranking-bar {
        min-width: 100%;
        order: 10;
    }
    
    .wdm-ranking-position {
        min-width: 30px;
        font-size: 0.9rem;
    }
    
    .wdm-ranking-score {
        min-width: 50px;
        font-size: 1rem;
    }
    
    .wdm-results-header {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 16px;
    }
    
    .wdm-results-actions {
        justify-content: stretch;
    }
    
    .wdm-results-actions .spin-btn {
        flex: 1;
        justify-content: center;
    }
    
    .wdm-results-matrix {
        padding: 0 16px 16px;
    }
    
    .wdm-results-matrix table {
        font-size: 0.75rem;
    }
    
    .wdm-results-matrix th,
    .wdm-results-matrix td {
        padding: 6px 8px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .wdm-controls {
        padding: 12px;
    }
    
    .wdm-title {
        font-size: 1.2rem;
    }
    
    .wdm-section {
        padding: 12px;
    }
    
    .wdm-add-row {
        flex-direction: column;
    }
    
    .wdm-add-row .spin-btn {
        width: 100%;
    }
    
    .wdm-add-row input[type="text"] {
        width: 100%;
    }
    
    .wdm-main {
        padding: 12px 8px;
    }
    
    .wdm-matrix-table th,
    .wdm-matrix-table td {
        padding: 4px 6px;
        font-size: 0.7rem;
        min-width: 32px;
    }
    
    .wdm-matrix-table input[type="number"] {
        width: 36px;
        padding: 3px 2px;
        font-size: 0.7rem;
    }
    
    .wdm-matrix-corner {
        min-width: 60px !important;
    }
    
    .wdm-results-ranking {
        padding: 12px;
    }
    
    .wdm-ranking-item {
        padding: 8px 10px;
        gap: 6px;
    }
    
    .wdm-ranking-name {
        font-size: 0.85rem;
    }
    
    .wdm-ranking-score {
        font-size: 0.9rem;
        min-width: 40px;
    }
    
    .wdm-empty-main-content {
        padding: 20px;
    }
    
    .wdm-empty-main-icon {
        font-size: 3rem;
    }
    
    .wdm-empty-main-content h3 {
        font-size: 1.2rem;
    }
}

/* Large Desktop */
@media (min-width: 1400px) {
    .wdm-controls {
        flex: 0 0 420px;
        width: 420px;
        min-width: 420px;
    }
}

/* ============================================================
   UTILITY — Hidden / Visible
   ============================================================ */
.wdm-hidden {
    display: none !important;
}

/* Tooltip for ratings */
.wdm-rating-tooltip {
    position: relative;
}

.wdm-rating-tooltip:hover::after {
    content: "Rate 1-10";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    color: var(--text);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    border: 1px solid var(--border-color);
    margin-bottom: 4px;
}

/* Print styles */
@media print {
    .wdm-controls,
    .wdm-results-actions,
    .wdm-sensitivity-panel {
        display: none !important;
    }
    
    .wdm-main {
        padding: 0 !important;
    }
    
    .wdm-results-panel {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    
    .wdm-matrix-panel {
        page-break-after: always;
    }
}


***********

/* UX: remove redundant in-tool steps (content lives below the tool) */
.wdm-empty-steps { display: none !important; }


/* ============================================================
   LAYOUT V2 — horizontal controls on top, results full-width
   below, empty-state void removed. Overrides the two-column
   layout. (Appended last so it wins.)
   ============================================================ */
.wdm-container { min-height: auto !important; overflow: visible !important; }

.wdm-container .tool-wrapper {
    flex-direction: column !important;
    overflow: visible !important;
    min-height: 0 !important;
    gap: 24px;
}

/* Controls become a full-width horizontal block: Options | Criteria */
.wdm-container .wdm-controls {
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
    height: auto !important;
    overflow: visible !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    align-items: start !important;
    border-right: none !important;
}
/* Header, Calculate button and context span the full width */
.wdm-container .wdm-header,
.wdm-container .wdm-actions,
.wdm-container .wdm-counter-context { grid-column: 1 / -1 !important; }

/* Results / matrix / sensitivity: full width, below the controls */
.wdm-container .wdm-main {
    width: 100% !important;
    flex: none !important;
    height: auto !important;
    overflow: visible !important;
}

/* Remove the empty-state void entirely */
.wdm-container .wdm-empty-main { display: none !important; }

/* Stack the two control cards on small screens */
@media (max-width: 768px) {
    .wdm-container .wdm-controls { grid-template-columns: 1fr !important; }
}