.simulator-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sim-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sim-top-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
}

.sim-weapon-select {
    margin: 0;
}

.sim-builder {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sim-builder > label {
    font-weight: 700;
    color: #1c2533;
}

.sim-search-wrap {
    position: relative;
}

.sim-search-input {
    width: 100%;
    border: 1px solid #ccd7e5;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    color: #1c2533;
}

.sim-skill-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 30;
    border: 1px solid #ccd7e5;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    max-height: 260px;
    overflow: auto;
}

.sim-skill-dropdown__list {
    display: flex;
    flex-direction: column;
}

.sim-skill-dropdown__item {
    border: 0;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
    text-align: left;
    padding: 10px 12px;
    font-size: 14px;
    color: #1c2533;
    cursor: pointer;
}

.sim-skill-dropdown__item:last-child {
    border-bottom: 0;
}

.sim-skill-dropdown__item:hover,
.sim-skill-dropdown__item.is-active {
    background: #eef2ff;
}

.sim-builder-actions {
    display: flex;
    justify-content: flex-start;
}

.btn-secondary {
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    background: #eef2ff;
    color: #1e3a8a;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #e0e7ff;
}

.sim-required-config {
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    padding: 12px;
    background: #f9fbff;
}

.sim-required-config h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.sim-required-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sim-required-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-link {
    border: 0;
    background: transparent;
    color: #b91c1c;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.btn-link:hover {
    text-decoration: underline;
}

.sim-actions {
    margin-top: 4px;
}

.btn-primary {
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.sim-messages {
    margin-top: 10px;
}

.sim-warning {
    margin: 0;
    color: #b45309;
    font-weight: 700;
}

.sim-result-table.result-table {
    min-width: 1040px;
}

.sim-result-table .result-table__head,
.sim-result-table .result-table__row {
    grid-template-columns: 250px minmax(340px, 1.1fr) minmax(420px, 1.7fr);
}

.sim-result-table .result-cell--build {
    width: 250px;
    max-width: 250px;
}

.sim-result-table .result-cell--drifts .result-skill-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 6px;
    width: 100%;
}

.sim-result-table .result-cell--skills .result-skill-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 6px;
    width: 100%;
}

.sim-result-table .result-cell--drifts .result-skill-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.sim-result-table .result-cell--skills .result-skill-card {
    width: auto;
    max-width: none;
    flex: 0 1 170px;
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 980px) {
    .sim-result-table.result-table {
        min-width: 940px;
    }

    .sim-result-table .result-table__head,
    .sim-result-table .result-table__row {
        grid-template-columns: 230px minmax(260px, 1fr) minmax(360px, 1.5fr);
    }

    .sim-result-table .result-cell--build {
        width: 230px;
        max-width: 230px;
    }

    .sim-result-table .result-cell--drifts .result-skill-grid {
        grid-template-columns: 1fr;
    }

    .sim-result-table .result-cell--skills .result-skill-card {
        flex-basis: 150px;
    }
}
