/* OWNER: dispatch agent. Settings page (.set-*) and the dispatch panel / signer message log (.dsp-*). */

/* ---------- Settings page ---------- */
.set h1 { margin-bottom: 16px; }
.set-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.set-cols + .set-cols { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 16px; }
@media (max-width: 820px) { .set-cols { grid-template-columns: 1fr; } }
.set-group h3 { margin-top: 4px; }
.set textarea { font-size: 14px; line-height: 1.5; }
.set input[readonly], .set textarea[readonly] { background: var(--surface-2); }

.set-provs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 8px; }
.set-prov { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.set-prov .row { margin-bottom: 6px; }
.set-prov p { margin: 0 0 4px; overflow-wrap: anywhere; }

.set-chips { gap: 6px; margin-bottom: 14px; }
.set-chips button { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 500; }

.set-counter { margin: 6px 0 0; color: var(--muted); }
.set-counter.over { color: var(--danger); font-weight: 600; }

.set-sms-bubble {
  max-width: 340px; padding: 10px 14px; border-radius: 16px 16px 16px 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45;
}

/* Approximation of the branded email (the real one is table-based HTML built on the server). */
.set-email { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #f2f4f7; font-family: Arial, Helvetica, sans-serif; color: #1a1a1a; }
.set-email-subject { padding: 8px 12px; background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); font-size: 13px; overflow-wrap: anywhere; }
.set-email-band { background: #002664; color: #fff; font-weight: bold; padding: 14px 18px; font-size: 16px; }
.set-email-body { background: #fff; padding: 18px; }
.set-email-body h3 { color: #002664; font-family: Arial, Helvetica, sans-serif; font-size: 18px; margin-bottom: 12px; }
.set-email-body p { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.set-email-body .muted { color: #444; }
.set-email-btn { display: inline-block; background: #002664; color: #fff; font-weight: bold; padding: 10px 20px; border-radius: 6px; margin: 4px 0 14px; }
.set-email-footer { background: #fff; border-top: 1px solid #e1e4ea; padding: 12px 18px; font-size: 12.5px; color: #444; white-space: pre-wrap; }

.set-actions {
  position: sticky; bottom: 0; z-index: 5; margin-top: 16px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.set-actions .alert { margin-bottom: 10px; }
.set-actions + .card { margin-top: 16px; }
.set-test { align-items: flex-end; }
.set-test .field { min-width: 160px; }

/* ---------- Dispatch panel ---------- */
.dsp-provs { gap: 16px; margin-bottom: 14px; }
.dsp-prov { font-weight: 600; font-size: 14px; }
.dsp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.dsp-tile { border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--radius); padding: 8px 10px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.dsp-tile.warn { border-left-color: var(--warn); }
.dsp-tile.bad { border-left-color: var(--danger); }
.dsp-tile.good { border-left-color: var(--ok); }
.dsp-num { font-family: var(--font-head); font-size: 22px; font-weight: 600; line-height: 1.1; }
.dsp-section { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.dsp-modes { border: none; padding: 0; margin: 0 0 12px; }
.dsp-modes legend { font-weight: 600; font-size: 13px; margin-bottom: 6px; padding: 0; }
.dsp-mode { margin-bottom: 6px; cursor: pointer; }
.dsp-mode-title { font-weight: 600; }
.dsp-est { font-weight: 600; }
.dsp-remind-opts { align-items: flex-end; }
.dsp-remind-opts .field { margin-bottom: 8px; }
.dsp-remind-opts select { min-width: 280px; }
.dsp-remind-opts input[type=number] { padding: 9px 11px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.dsp-progress { margin-top: 14px; }
.dsp-bar { width: 100%; height: 14px; accent-color: var(--accent); }
.dsp-progress-label { margin: 6px 0 2px; }
.dsp-errbox { margin-top: 8px; }
.dsp-errbox summary { cursor: pointer; font-weight: 600; color: var(--danger); }
.dsp-errors { max-height: 260px; overflow-y: auto; margin: 8px 0 0; padding-left: 20px; font-size: 13px; }
.dsp-errors li { margin-bottom: 4px; }
.dsp-resend { gap: 8px; margin-bottom: 8px; }
.dsp-log td { font-size: 13px; }

/* ---------- Settings page tabs and Integrations (#/settings/integrations) ---------- */
.set-pagetabs { display: flex; gap: 4px; flex-wrap: wrap; margin: -6px 0 18px; border-bottom: 1px solid var(--border); }
.set-pagetab { padding: 8px 14px; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.set-pagetab:hover { color: var(--text); }
.set-pagetab.active { color: var(--text); border-bottom-color: var(--primary); }

.int-intro { max-width: 860px; }
.int-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; }
.int-cards .card { margin: 0; }
.int input[type=tel] { width: 100%; padding: 9px 11px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.int-head h2 { margin: 0; }
.int-status { margin: 6px 0 4px; font-weight: 600; overflow-wrap: anywhere; }
.int-test { margin: 0 0 10px; overflow-wrap: anywhere; }
.int-test.ok { color: var(--ok); }
.int-test.bad { color: var(--danger); }
.int-switch { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); margin: 12px 0 14px; }
.int-switch .check { margin: 0; }
.int-switch input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--primary); }
.int-pause { margin-top: 16px; }
.int-pause input[type=checkbox] { accent-color: var(--danger); }
.int-fields .field { margin-bottom: 12px; }
.int-help { margin: 4px 0 0; }
.int-hint { font-weight: 400; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.int-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; }
.int-clear { margin-top: 6px; }
.int-gen { margin-top: 8px; }
.int-actions { margin-top: 4px; }
.int-url { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 12px; }
.int-url-label { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.int-url-row { flex-wrap: nowrap; align-items: flex-start; }
.int-url-val { flex: 1; min-width: 0; padding: 7px 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.int-url p { margin: 6px 0 0; }
.int-send { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--border); margin-top: 16px; padding-top: 12px; }
.int-send .field { margin-bottom: 0; }
.int-out .alert { margin: 12px 0 0; }
.int-help summary { cursor: pointer; font-weight: 600; margin-top: 14px; }
.int-help ol { margin: 8px 0 0; padding-left: 20px; }
.int-help li { margin-bottom: 4px; }
@media (max-width: 520px) { .int-send { flex-direction: column; align-items: stretch; } .int-url-row { flex-wrap: wrap; } }
