*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    color: #d8dee9;
    background: #0b0e12;
    line-height: 1.45;
}

.setup_header {
    background: #151a22;
    border-bottom: 1px solid #2a3344;
    padding: 20px 24px 18px;
}

.setup_header_inner {
    max-width: 920px;
    margin: 0 auto;
}

.setup_header h1 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    color: #e8c87a;
    font-weight: 600;
}

.setup_lead {
    margin: 0 0 12px;
    color: #8fa0b8;
    font-size: 0.92rem;
    max-width: 720px;
}

.setup_nav a {
    color: #3d9bff;
    text-decoration: none;
    font-size: 0.88rem;
}

.setup_nav a:hover {
    text-decoration: underline;
}

.setup_main {
    max-width: 920px;
    margin: 0 auto;
    padding: 24px;
}

.setup_section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #252d3a;
}

.setup_section h2 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: #e8c87a;
    font-weight: 600;
}

.setup_hint,
.field_help {
    margin: 0 0 14px;
    font-size: 0.85rem;
    color: #7d8aa0;
}

.field_help.inline_help {
    display: inline;
    margin: 0 0 0 6px;
    font-size: 0.78rem;
}

.attractiveness_table input[type="number"] {
    width: 100%;
    max-width: 120px;
}

.field_help {
    margin-top: 4px;
    margin-bottom: 8px;
}

.setup_table_wrap {
    overflow-x: auto;
}

.setup_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.setup_table th,
.setup_table td {
    border: 1px solid #354055;
    padding: 10px 12px;
    text-align: left;
}

.setup_table thead th {
    background: #1a2230;
    color: #a8b4c8;
    font-weight: 600;
}

.setup_table tbody th {
    background: #12171f;
    color: #c5d0e0;
    font-weight: 500;
}

.setup_table tfoot th,
.setup_table tfoot td {
    background: #1a2230;
    font-weight: 600;
}

.setup_table input[type="number"] {
    width: 100%;
    max-width: 120px;
    padding: 6px 8px;
    border: 1px solid #455268;
    border-radius: 4px;
    background: #0f1319;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
}

.col_symbol {
    font-weight: bold;
}

.female_sym {
    color: #ff6eb0;
}

.male_sym {
    color: #3d9bff;
}

.total_cell {
    font-variant-numeric: tabular-nums;
    color: #e8c87a;
}

.total_cell.warn {
    color: #e88a7a;
}

.total_cell.ok {
    color: #7dcea0;
}

.setup_field_grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.setup_field_grid.three_col {
    grid-template-columns: 1fr 1fr 1fr;
}

.sim_params_grid {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
    .setup_field_grid,
    .setup_field_grid.three_col,
    .sim_params_grid {
        grid-template-columns: 1fr;
    }
}

.computed_value {
    margin: 8px 0 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #e8c87a;
    font-variant-numeric: tabular-nums;
}

.computed_value.ok {
    color: #7dcea0;
}

.computed_value.warn {
    color: #e88a7a;
}

.count_hint {
    display: block;
    font-size: 0.72rem;
    color: #6d7a90;
    margin-top: 2px;
}

.pct_total_cell {
    font-variant-numeric: tabular-nums;
    color: #c5d0e0;
    font-weight: 500;
}

.range_val {
    float: right;
    font-size: 0.85rem;
    color: #8fa0b8;
    font-variant-numeric: tabular-nums;
}

.setup_field input[type="range"] {
    width: 100%;
    margin-top: 6px;
}

.setup_launch_section {
    border-bottom: none;
}

.btn_launch {
    background: #2d6a4f !important;
    border-color: #40916c !important;
    font-weight: 600;
    padding: 11px 22px !important;
}

.btn_launch:hover {
    background: #40916c !important;
    color: #fff;
    text-decoration: none;
}

a.btn_launch {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    color: #fff;
}

.setup_field label {
    display: block;
    font-weight: 500;
    color: #c5d0e0;
    margin-bottom: 4px;
}

.setup_field input[type="number"] {
    width: 100%;
    max-width: 200px;
    padding: 8px 10px;
    border: 1px solid #455268;
    border-radius: 4px;
    background: #0f1319;
    color: #e2e8f0;
}

.setup_actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.setup_actions button {
    padding: 9px 16px;
    border: 1px solid #3d4d66;
    border-radius: 4px;
    background: #243044;
    color: #e8edf5;
    cursor: pointer;
    font-size: 0.9rem;
}

.setup_actions button:hover {
    background: #2f3f58;
}

.setup_actions .btn_primary {
    background: #3a5a8a;
    border-color: #5a7aa8;
}

.setup_status {
    min-height: 1.4em;
    font-size: 0.88rem;
    color: #8fa0b8;
}

.setup_status.ok {
    color: #7dcea0;
}

.setup_status.error {
    color: #e88a7a;
}

.setup_summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 0;
}

.setup_summary div {
    background: #12171f;
    border: 1px solid #252d3a;
    border-radius: 4px;
    padding: 12px 14px;
}

.setup_summary dt {
    margin: 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7d8aa0;
}

.setup_summary dd {
    margin: 4px 0 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #e8c87a;
    font-variant-numeric: tabular-nums;
}
