.bot-matching-page {
    padding: 28px;
    color: #263238;
}

.bot-matching-card {
    max-width: 1120px;
    margin: 0 auto 22px;
    padding: 28px;
    background: #fff;
    border: 1px solid #e5eaf0;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(55, 71, 79, .08);
}

.bot-matching-header,
.bot-setting-row,
.bot-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.bot-matching-header h3 {
    margin: 0 0 7px;
    color: #315f89;
    font-weight: 700;
}

.bot-matching-header p,
.bot-setting-row small,
.bot-audience-option small,
.bot-threshold small {
    display: block;
    margin: 4px 0 0;
    color: #718096;
}

.bot-api-state {
    flex: 0 0 auto;
    padding: 8px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.bot-api-state.is-ready { background: #e6fffa; color: #16765e; }
.bot-api-state.is-missing { background: #fff5f5; color: #c53030; }

.bot-setting-row {
    margin: 24px 0;
    padding: 18px;
    background: #f7fafc;
    border-radius: 12px;
}

.bot-switch input { display: none; }
.bot-switch span {
    display: block;
    position: relative;
    width: 58px;
    height: 30px;
    background: #cbd5e0;
    border-radius: 99px;
    cursor: pointer;
    transition: .2s;
}
.bot-switch span:after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
    box-shadow: 0 2px 5px rgba(0,0,0,.15);
}
.bot-switch input:checked + span { background: #38a169; }
.bot-switch input:checked + span:after { transform: translateX(-28px); }

.bot-form-grid { margin-bottom: 20px; }
.bot-form-grid label,
.bot-days > label,
.bot-audience-section > label,
.bot-threshold > label {
    display: block;
    margin-bottom: 9px;
    font-weight: 700;
}

.bot-choice-list {
    display: flex;
    min-height: 45px;
    align-items: center;
    gap: 24px;
}

.bot-choice-list label { margin: 0; cursor: pointer; }
.bot-choice-list input { margin-left: 6px; }

.bot-days { margin-bottom: 25px; }
.bot-day-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.bot-day-grid input { display: none; }
.bot-day-grid span {
    display: block;
    padding: 10px 5px;
    text-align: center;
    border: 1px solid #d9e2ec;
    border-radius: 9px;
    cursor: pointer;
    transition: .15s;
}
.bot-day-grid input:checked + span {
    background: #315f89;
    border-color: #315f89;
    color: #fff;
}

.bot-audience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 13px;
}
.bot-audience-option { position: relative; cursor: pointer; }
.bot-audience-option input {
    position: absolute;
    opacity: 0;
}
.bot-audience-option > span {
    display: block;
    height: 100%;
    padding: 18px;
    border: 2px solid #e5eaf0;
    border-radius: 12px;
    transition: .15s;
}
.bot-audience-option input:checked + span {
    border-color: #315f89;
    background: #f0f7ff;
}
.bot-audience-option i { margin-left: 8px; color: #315f89; }
.bot-audience-option strong { display: inline-block; }

.bot-threshold {
    max-width: 460px;
    margin-top: 18px;
    padding: 16px;
    background: #fffaf0;
    border: 1px solid #f6d99c;
    border-radius: 10px;
}

.bot-form-actions {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid #edf2f7;
}
.bot-next-run { color: #315f89; font-weight: 700; }
.bot-next-run.is-paused { color: #718096; }

.bot-run-card h4 { margin: 0 0 18px; color: #315f89; }
.bot-run-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.bot-run-grid > div {
    padding: 14px;
    background: #f7fafc;
    border-radius: 10px;
}
.bot-run-grid span { display: block; margin-bottom: 5px; color: #718096; font-size: 12px; }
.bot-run-grid strong { display: block; }
.bot-last-error { margin-top: 15px; margin-bottom: 0; }

@media (max-width: 850px) {
    .bot-matching-page { padding: 12px; }
    .bot-matching-card { padding: 18px; }
    .bot-matching-header,
    .bot-form-actions { align-items: flex-start; flex-direction: column; }
    .bot-day-grid { grid-template-columns: repeat(2, 1fr); }
    .bot-audience-grid,
    .bot-run-grid { grid-template-columns: 1fr; }
}
