.noiz-deckplaner {
    width: min(96vw, 1850px);
    max-width: none;
    margin: 30px auto 40px;
    padding: 0 16px;
    font-family: inherit;
}

.ndp-header-card,
.ndp-card {
    background: #ffffff;
    border: 1px solid #ece7f3;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(44, 24, 74, 0.06);
    padding: 20px;
    margin-bottom: 20px;
}

.ndp-header-card h1 {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.2;
    color: #2e2340;
}

.ndp-header-card p {
    margin: 0;
    color: #6d6480;
    line-height: 1.5;
}

.ndp-card h2 {
    margin-top: 0;
    margin-bottom: 14px;
    color: #2e2340;
    font-size: 1.2rem;
    line-height: 1.25;
}

.noiz-deckplaner label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #493a63;
    line-height: 1.4;
}

.noiz-deckplaner select,
.noiz-deckplaner .ndp-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #d9cfea;
    border-radius: 12px;
    background: #fcfbfe;
    color: #2e2340;
    font-size: 14px;
    line-height: 44px;
    box-sizing: border-box;
}

.noiz-deckplaner select {
    appearance: auto;
    -webkit-appearance: menulist;
}

.noiz-deckplaner .ndp-input:focus,
.noiz-deckplaner select:focus {
    outline: none;
    border-color: #a67bd6;
    box-shadow: 0 0 0 3px rgba(166, 123, 214, 0.12);
}

.ndp-filter-card {
    padding: 18px 20px;
}

.ndp-filter-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.ndp-filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ndp-filter-toggle,
.ndp-filter-reset-small,
.ndp-filter-reset-big {
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.ndp-filter-toggle {
    border: 1px solid #d8c8f0;
    background: #f7f1ff;
    color: #5a417f;
}

.ndp-filter-toggle:hover {
    background: #efe4ff;
    border-color: #cdb4ef;
}

.ndp-filter-reset-small {
    border: 1px solid #d8c8f0;
    background: #fff;
    color: #6b557f;
}

.ndp-filter-reset-small:hover {
    background: #faf6ff;
    border-color: #cdb4ef;
}

.ndp-filter-reset-big {
    border: 1px solid #efc1c1;
    background: #fff5f5;
    color: #a23636;
}

.ndp-filter-reset-big:hover {
    background: #ffecec;
    border-color: #e8a8a8;
}

.ndp-quick-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.ndp-advanced-filters {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e3d9f2;
}

.ndp-filter-grid.ndp-filter-grid-advanced {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.ndp-filter-field {
    min-width: 0;
}

.ndp-filter-checkbox-wrap {
    display: flex;
    align-items: flex-end;
}

.ndp-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    margin-bottom: 0 !important;
    padding: 0 2px;
    cursor: pointer;
}

.ndp-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #8d6bc6;
}

.ndp-active-filters {
    margin-top: 14px;
}

.ndp-active-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ndp-filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: #f3ecff;
    border: 1px solid #ddcef7;
    color: #5c457d;
    font-size: 12px;
    font-weight: 700;
}

.ndp-selection-card {
    padding: 18px 20px;
}

.ndp-selection-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.ndp-selection-field label {
    margin-bottom: 6px;
}

.ndp-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.ndp-horse-card {
    min-width: 0;
}

.ndp-preview-box {
    background: linear-gradient(180deg, #faf7ff 0%, #f7f4fc 100%);
    border: 1px dashed #d8cceb;
    border-radius: 14px;
    padding: 14px 14px 16px;
    color: #6a5f7b;
    line-height: 1.45;
    box-sizing: border-box;
    min-height: 860px;
    max-height: 860px;
    overflow: auto;
}

.ndp-preview-box p {
    margin: 0;
    line-height: 1.5;
}

.ndp-preview-head {
    margin-bottom: 12px;
}

.ndp-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
    margin-bottom: 12px;
}

.ndp-meta-lines {
    margin-bottom: 14px;
}

.ndp-meta-lines div {
    margin-bottom: 4px;
}

.ndp-subblock {
    margin-top: 14px;
}

.ndp-subblock h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: #2e2340;
}

.ndp-table-wrap {
    overflow-x: auto;
}

.ndp-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: #fff;
    border: 1px solid #ece7f3;
    border-radius: 10px;
    overflow: hidden;
}

.ndp-mini-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f0ebf8;
    vertical-align: top;
}

.ndp-mini-table tr:last-child td {
    border-bottom: none;
}

.ndp-mini-table td:first-child {
    width: 40%;
    font-weight: 600;
    color: #493a63;
}

.ndp-value-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ndp-inline-icon {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
}

.ndp-value-good {
    color: #4c9c5a;
    font-weight: 600;
}

.ndp-value-medium {
    color: #d08a1d;
    font-weight: 600;
}

.ndp-value-bad {
    color: #d63939;
    font-weight: 700;
}

.ndp-value-neutral {
    color: #6a5f7b;
}

.ndp-row-top td {
    background: #e9fff0;
}

.ndp-row-fix td {
    background: #eef8ff;
}

.ndp-row-stable td {
    background: #f2fff5;
}

.ndp-row-worse td {
    background: #fff1f1;
}

.ndp-results-card {
    margin-top: 20px;
}

.ndp-results-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.ndp-result-card {
    padding: 16px;
    border-radius: 14px;
    border: 2px solid #e0d7ef;
    background: #faf7ff;
}

.ndp-result-best {
    border-color: #6bcf8f;
    background: #f3fff7;
}

.ndp-result-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;
    color: #2e2340;
}

.ndp-best-badge {
    display: inline-block;
    background: #e9fff0;
    color: #207245;
    border: 1px solid #bce7ca;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.ndp-result-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.65);
    border: 1px solid #ece7f3;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.ndp-result-score strong {
    font-size: 1.2rem;
    color: #2e2340;
}

.ndp-compare-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ndp-compare-line {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    border: 1px solid #ece7f3;
    background: #fff;
}

.ndp-compare-left {
    font-weight: 700;
    color: #493a63;
}

.ndp-compare-mid {
    color: #6a5f7b;
}

.ndp-compare-right {
    font-weight: 700;
    white-space: nowrap;
}

.ndp-compare-better {
    border-color: #bfe6cb;
    background: #f3fff7;
}

.ndp-compare-better .ndp-compare-right {
    color: #207245;
}

.ndp-compare-worse {
    border-color: #f1c7c7;
    background: #fff5f5;
}

.ndp-compare-worse .ndp-compare-right {
    color: #b02a2a;
}

.ndp-compare-neutral {
    border-color: #ddd7ea;
    background: #faf7ff;
}

.ndp-compare-neutral .ndp-compare-right {
    color: #6a5f7b;
}

@media (max-width: 1500px) {
    .ndp-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ndp-selection-grid,
    .ndp-quick-filter-grid,
    .ndp-filter-grid.ndp-filter-grid-advanced {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ndp-preview-box {
        min-height: 680px;
        max-height: 680px;
    }

    .ndp-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .ndp-preview-grid,
    .ndp-selection-grid,
    .ndp-quick-filter-grid,
    .ndp-filter-grid.ndp-filter-grid-advanced {
        grid-template-columns: 1fr;
    }

    .ndp-preview-box {
        min-height: auto;
        max-height: none;
    }

    .ndp-compare-line {
        grid-template-columns: 1fr;
    }

    .ndp-result-head,
    .ndp-result-score,
    .ndp-filter-topbar,
    .ndp-filter-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}