/* Mayla's webhooks (OP-014, js/onix-mayla-webhooks.js, Components/Layout/MaylaWebhooks.razor): the "From another system" card in
   a drawer of the panel (it reuses the History drawer's frame, css/onix-mayla-history.css), the New webhook form, the secret shown
   once and a webhook's deliveries. Tokens only (css/onix-theme.css), so both themes come for free. */

.mayla-hooks-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.mayla-hooks .mayla-drawer-list { flex: none; overflow: visible; }
.mayla-hooks-bar { display: flex; justify-content: flex-end; padding: 8px 16px; border-bottom: 1px solid var(--hairline, var(--line)); }
.mayla-hooks-formhost, .mayla-hooks-secrethost { padding: 10px 16px 4px; border-bottom: 1px solid var(--hairline, var(--line)); }
.mayla-hooks-formhost[hidden], .mayla-hooks-secrethost[hidden] { display: none; }

/* ── a webhook ──────────────────────────────────────────────────────── */

.mayla-hooks-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 8px; border-radius: 10px; }
.mayla-hooks-row + .mayla-hooks-row { border-top: 1px solid var(--hairline, var(--line)); border-radius: 0; }
.mayla-hooks-row.is-paused .mayla-hooks-main { opacity: .75; }
.mayla-hooks-line { display: flex; align-items: flex-start; gap: 8px; }
.mayla-hooks-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mayla-hooks-title { font: 600 14px/1.3 var(--font-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mayla-hooks-request { color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.mayla-hooks-what, .mayla-hooks-last, .mayla-hooks-signed { color: var(--muted); font-size: 12px; }
.mayla-hooks-last b { color: var(--ink); font-weight: 600; }
.mayla-hooks-why { color: var(--warn); font-size: 12px; }
.mayla-hooks-last[hidden], .mayla-hooks-why[hidden] { display: none; }
.mayla-hooks-state { flex: none; font-size: 11px; padding: 2px 8px; }
.mayla-hooks-state.is-active { background: var(--good-soft); color: var(--good); }
.mayla-hooks-state.is-paused { background: var(--warn-soft); color: var(--warn); }

.mayla-hooks-url { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.mayla-hooks-copyline { display: flex; align-items: center; gap: 6px; }
.mayla-hooks-url-input, .mayla-hooks-secret-input {
    flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--bg-soft, var(--panel-2)); color: var(--ink); font: 12px/1.3 var(--font-code);
}

.mayla-hooks-actions, .mayla-hooks-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mayla-hooks-actions [hidden], .mayla-hooks-confirm[hidden], .mayla-hooks-deliveries[hidden] { display: none; }
.mayla-hooks-confirm span { flex-basis: 100%; font-size: 13px; }

/* ── the secret, shown once ─────────────────────────────────────────── */

.mayla-hooks-secret { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px;
    background: var(--warn-soft); color: var(--ink); }
.mayla-hooks-secret strong { font: 600 14px/1.3 var(--font-text); }
.mayla-hooks-secret small { font-size: 12px; }
.mayla-hooks-howto { color: var(--muted); overflow-wrap: anywhere; }
.mayla-hooks-secret-done { align-self: flex-start; }
.mayla-hooks-secretslot:empty { display: none; }

/* ── the deliveries ─────────────────────────────────────────────────── */

.mayla-hooks-deliveries { padding: 8px 10px; border-radius: 10px; background: var(--bg-soft, var(--panel-2)); }
.mayla-hooks-delivery-list { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.mayla-hooks-delivery { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; }
.mayla-hooks-delivery-when { font-variant-numeric: tabular-nums; color: var(--muted); }
.mayla-hooks-delivery-meta { color: var(--muted); font-variant-numeric: tabular-nums; }
.mayla-hooks-delivery-status { font-size: 11px; padding: 1px 7px; }
.mayla-hooks-delivery-status.is-done { background: var(--good-soft); color: var(--good); }
.mayla-hooks-delivery-status.is-failed, .mayla-hooks-delivery-status.is-rejected, .mayla-hooks-delivery-status.is-too_large,
.mayla-hooks-delivery-status.is-unsupported { background: var(--danger-soft); color: var(--danger); }
.mayla-hooks-delivery-status.is-running, .mayla-hooks-delivery-status.is-waiting, .mayla-hooks-delivery-status.is-skipped,
.mayla-hooks-delivery-status.is-paused, .mayla-hooks-delivery-status.is-rate_limited { background: var(--warn-soft); color: var(--warn); }
.mayla-hooks-delivery-status.is-duplicate { background: var(--panel-hover); color: var(--muted); }
.mayla-hooks-delivery-text { flex-basis: 100%; color: var(--ink); }
.mayla-hooks-delivery-text:empty { display: none; }
.mayla-hooks-delivery-open[hidden] { display: none; }
.mayla-hooks-deliveries .mayla-note { margin: 4px 0 0; }
.mayla-hooks-deliveries .mayla-note[hidden] { display: none; }

/* ── New webhook ────────────────────────────────────────────────────── */

.mayla-hooks-form { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.mayla-hooks-form-title { font: 700 14px/1.3 var(--font-display); }
.mayla-hooks-form [hidden] { display: none; }
.mayla-hooks-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.mayla-hooks-field input, .mayla-hooks-field select, .mayla-hooks-field textarea {
    padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--panel); color: var(--ink); font: 14px/1.3 var(--font-text);
}
.mayla-hooks-field input:focus, .mayla-hooks-field select:focus, .mayla-hooks-field textarea:focus,
.mayla-hooks-url-input:focus, .mayla-hooks-secret-input:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring);
}
.mayla-hooks-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.mayla-hooks-check-hint { color: var(--muted); font-size: 12px; }
.mayla-hooks-error { margin: 0; color: var(--danger); font-size: 13px; }
.mayla-hooks-form-actions { display: flex; gap: 6px; }
