.integrations-page .page-title { margin-bottom: 8px; }

.status-line { margin-bottom: 12px; color: var(--gray-700); }

.inline-heading { display: inline; font-size: 1.05rem; }

.integrations-page summary { cursor: pointer; padding: 4px 0; }

.grid-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
    margin-top: 12px;
}

.grid-form .span-2 { grid-column: 1 / -1; }

@media (max-width: 480px) {
    .grid-form { grid-template-columns: 1fr; }
}

.channel-choice, .sub-fieldset {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 8px 12px 12px;
    margin-bottom: 12px;
}

.channel-choice legend, .sub-fieldset legend { font-weight: 600; font-size: 0.9rem; padding: 0 4px; }

.radio, .checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 6px 16px 6px 0;
    font-size: 0.95rem;
}

.channel-panel { margin-bottom: 12px; }
.channel-panel h4 { margin: 8px 0; }

.secret-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.generated {
    background: #fff3cd;
    color: #533f03;
    border-radius: var(--radius);
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.copy-row code { word-break: break-all; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.form-msg { font-size: 0.9rem; font-weight: 600; }
.form-msg.ok { color: #155724; }
.form-msg.error { color: #721c24; }

.test-results { list-style: none; margin-top: 12px; }
.test-results li { padding: 6px 10px; border-radius: var(--radius); margin-bottom: 4px; font-size: 0.9rem; }
.test-results li.ok { background: #d4edda; color: #155724; }
.test-results li.error { background: #f8d7da; color: #721c24; }

.log-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.log-filters .form-group { flex: 1; min-width: 140px; }
.log-filters .btn { margin-bottom: 12px; }

.table-wrap { overflow-x: auto; }
.log-table td { vertical-align: top; }
.error-cell { max-width: 220px; word-break: break-word; color: #721c24; font-size: 0.85rem; }

.log-pages { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }

.order-detail {
    margin-top: 16px;
    border-top: 2px solid var(--gray-200);
    padding-top: 12px;
}

.order-detail h4 { margin-bottom: 4px; }
.order-detail table { margin: 8px 0; }

pre.json {
    background: var(--gray-100);
    padding: 8px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.8rem;
    max-height: 320px;
}

code { font-size: 0.85em; }

/* --- Facelift / phones --- */
.integrations-page .card > h3 { font-size: 1.08rem; }
.channel-choice { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.channel-choice legend { width: 100%; }

.radio {
    padding: 8px 14px;
    margin: 4px 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: border-color 0.2s, background 0.2s;
}

.radio:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.radio input { accent-color: var(--primary); }

.channel-panel { padding: 4px 0; animation: page-in 0.25s ease both; }
.sub-fieldset { background: var(--surface-2); border-color: var(--line); }

.order-detail { animation: page-in 0.25s ease both; }

@media (max-width: 720px) {
    .grid-form { grid-template-columns: 1fr; }
    .radio { flex: 1 1 calc(50% - 8px); justify-content: center; }
    .log-filters .form-group { min-width: calc(50% - 8px); }
    .form-actions .btn { flex: 1; }
    .secret-row .btn { flex: 1; }
    .copy-row code { font-size: 0.8rem; }
    .log-table { font-size: 0.82rem; }
    .log-table td, .log-table th { padding: 8px; }
    .table-actions { flex-direction: column; }
}
