/*
 * EMS Validation Cleanup #10 R2
 * Bot Request controls live at the bottom of Pilot Roster.
 */

#pilotRosterPanel > .panel-footer {
    gap: 8px;
    align-items: center;
}

#pilotRosterPanel > .panel-footer .ems-bot-request {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 4px 6px;
    border: 1px solid var(--panel-border, #555);
    background: rgba(0, 0, 0, 0.16);
}

#pilotRosterPanel .ems-bot-request h4 {
    margin: 0;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

#pilotRosterPanel .ems-bot-involved-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

#pilotRosterPanel .ems-bot-involved-control input {
    margin: 0;
    flex: 0 0 auto;
}

#pilotRosterPanel .ems-bot-request-details {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
}

#pilotRosterPanel .ems-bot-request-details[hidden] {
    display: none !important;
}

#pilotRosterPanel .ems-bot-request-field {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    margin: 0;
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

#pilotRosterPanel .ems-bot-request-field select {
    box-sizing: border-box;
    width: 52px;
    min-width: 52px;
    height: 28px;
    min-height: 28px;
    margin: 0;
    padding: 1px 3px;
    font-size: 0.68rem;
}

#pilotRosterPanel .ems-bot-match-player-mechs {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 3px;
    min-width: 120px;
    min-height: 28px;
    margin: 0;
    padding: 0;
}

#pilotRosterPanel .ems-bot-match-player-mechs .vertical-toggle-text {
    font-size: 0.62rem;
    line-height: 1.05;
    white-space: normal;
}

#pilotRosterPanel .ems-bot-match-player-mechs .vertical-toggle-switch {
    transform: scale(0.68);
    transform-origin: center;
}

#pilotRosterPanel .ems-bot-request-limit {
    flex: 0 1 190px;
    min-width: 0;
    margin: 0;
    font-size: 0.58rem;
    line-height: 1.05;
    opacity: 0.85;
}

#pilotRosterPanel > .panel-footer > #commitMissionBtn {
    flex: 0 0 auto;
    margin-left: auto;
}

@media (max-width: 1100px) {
    #pilotRosterPanel > .panel-footer {
        flex-wrap: nowrap;
    }

    #pilotRosterPanel > .panel-footer .ems-bot-request {
        gap: 5px;
        padding: 3px 4px;
    }

    #pilotRosterPanel .ems-bot-request h4 {
        display: none;
    }

    #pilotRosterPanel .ems-bot-involved-control {
        font-size: 0.61rem;
    }

    #pilotRosterPanel .ems-bot-request-field {
        gap: 2px;
        font-size: 0.58rem;
    }

    #pilotRosterPanel .ems-bot-request-field select {
        width: 44px;
        min-width: 44px;
        height: 26px;
        min-height: 26px;
        padding: 1px 2px;
        font-size: 0.62rem;
    }

    #pilotRosterPanel .ems-bot-match-player-mechs {
        min-width: 104px;
    }

    #pilotRosterPanel .ems-bot-match-player-mechs .vertical-toggle-text {
        font-size: 0.57rem;
    }

    #pilotRosterPanel .ems-bot-request-limit {
        display: none;
    }
}

@media (max-width: 760px) {
    #pilotRosterPanel > .panel-footer {
        flex-wrap: wrap;
    }

    #pilotRosterPanel > .panel-footer .ems-bot-request {
        flex: 1 0 100%;
        flex-wrap: wrap;
    }

    #pilotRosterPanel .ems-bot-request-details {
        flex-wrap: wrap;
    }

    #pilotRosterPanel > .panel-footer > #commitMissionBtn {
        margin-left: auto;
    }
}


/* EMS_BOT_REQUEST_LAYOUT_READABLE_20260826 */
#pilotRosterPanel > .panel-footer .ems-bot-request {
    flex-wrap: wrap;
    row-gap: 6px;
    overflow: visible;
}

#pilotRosterPanel .ems-bot-involved-control {
    flex: 0 0 auto;
}

#pilotRosterPanel .ems-bot-request-details {
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 8px 10px;
    overflow: visible;
}

#pilotRosterPanel .ems-bot-request-field {
    flex: 0 0 auto;
    min-width: max-content;
    gap: 5px;
    font-size: 0.68rem;
    line-height: 1.15;
}

#pilotRosterPanel .ems-bot-request-field > span {
    display: inline-block;
    position: static;
    width: auto;
    min-width: max-content;
    overflow: visible;
}

#pilotRosterPanel .ems-bot-request-field select {
    flex: 0 0 52px;
}

#pilotRosterPanel .ems-bot-match-player-mechs {
    flex: 0 0 auto;
    min-width: 132px;
}

#pilotRosterPanel .ems-bot-request-limit {
    flex: 0 1 auto;
    margin-left: auto;
    white-space: normal;
}

@media (max-width: 1250px) {
    #pilotRosterPanel .ems-bot-request h4 {
        display: none;
    }

    #pilotRosterPanel .ems-bot-request-limit {
        display: none;
    }
}

/* EMS_BOT_HEADING_TABLET_VISIBLE_20260827
 * Keep "Do you want Bots Involved?" visible on tablet/iPad widths.
 * Put it on its own line when space is constrained instead of hiding it.
 */
@media (max-width: 1250px) {
    #pilotRosterPanel .ems-bot-request h4 {
        display: block;
        flex: 1 0 100%;
        width: 100%;
        margin: 0 0 2px;
        line-height: 1.15;
        white-space: normal;
    }

    #pilotRosterPanel .ems-bot-request-limit {
        display: none;
    }
}
