/* public/app-webhook-settings.css -- Settings > Integrations > "Paid-invoice webhook" (see app-webhook-settings.js).
 *
 * Own tokens (--whk-*), light and dark. Same palette and type scale as the Dropbox card next to it:
 * 11 chips, 12 helper and labels, 13 body, 15 card and section heads. Body copy is --whk-strong or --whk-ink at full contrast;
 * colour and weight carry state only, never prose.
 *
 * Contrast (same pairs as app-dropbox-sync.css, which measures them on every text node, >= 4.5:1):
 *   light: strong on card 16.4, ink on card 11.6, mut on card 7.5, white on primary 7.6, bad on bad-bg 6.4, warn on warn-bg 6.6, ok on ok-bg 6.0
 *   dark:  strong on card 13.8, ink on card 10.3, mut on card 6.9, dark on primary 8.9, bad on bad-bg 6.1, warn on warn-bg 8.3, ok on ok-bg 7.4
 */
.whk-mount { display: block; margin-top: 12px; min-width: 0; }
.whk-mount:empty { display: none; }
.whk, .whk * { box-sizing: border-box; text-transform: none; letter-spacing: normal; }
.whk {
  --whk-card: #ffffff; --whk-paper: #f6f7fb; --whk-line: #dadde8; --whk-line-soft: #eceef4;
  --whk-strong: #161e2e; --whk-ink: #2b3347; --whk-mut: #4d5569;
  --whk-btn: #3b556f; --whk-btn-ink: #ffffff;
  --whk-ok: #17694a; --whk-ok-bg: #e6f2ec;
  --whk-busy: #2a5585; --whk-busy-bg: #e8f0f9;
  --whk-warn: #7a4a00; --whk-warn-bg: #fdf3dc; --whk-warn-line: #e3c071;
  --whk-bad: #a33425; --whk-bad-bg: #fbefec; --whk-bad-line: #e3b4ad;
  --whk-track: #c3c9d8;
  display: flex; flex-direction: column; gap: 18px; min-width: 0;
  padding: 20px; border: 1px solid var(--whk-line); border-radius: 16px; background: var(--whk-card);
  font-family: 'Montserrat', sans-serif; color: var(--whk-ink); font-size: 13px; line-height: 1.5; text-align: left;
}
body.hl-dark .whk {
  --whk-card: #171f30; --whk-paper: #121a2a; --whk-line: #26304a; --whk-line-soft: #202a40;
  --whk-strong: #e8edf6; --whk-ink: #c9d3e4; --whk-mut: #9cabc6;
  --whk-btn: #a9bdd3; --whk-btn-ink: #0f1727;
  --whk-ok: #5ccf9b; --whk-ok-bg: #1b3129;
  --whk-busy: #8db4ff; --whk-busy-bg: #1c2a45;
  --whk-warn: #f0c15a; --whk-warn-bg: #2e2714; --whk-warn-line: #6b5420;
  --whk-bad: #f0836b; --whk-bad-bg: #3a2521; --whk-bad-line: #6a3a33;
  --whk-track: #4a5778;
}
.whk p, .whk h3, .whk h4, .whk ul { margin: 0; padding: 0; }
.whk [hidden] { display: none !important; }

/* head */
.whk-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.whk-title { font-size: 15px; font-weight: 800; line-height: 1.3; color: var(--whk-strong); }
.whk-lede { color: var(--whk-ink); font-size: 13px; max-width: 62ch; }
.whk-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 99px; font-size: 11px; font-weight: 800; line-height: 1; border: 1px solid currentColor; background: var(--whk-card); }
.whk-pill-on { color: var(--whk-ok); background: var(--whk-ok-bg); }
.whk-pill-off { color: var(--whk-mut); }
.whk-pill-idle { color: var(--whk-mut); }

/* fields */
.whk-body-stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.whk-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.whk-label { font-size: 12px; font-weight: 700; color: var(--whk-strong); }
.whk-inputrow { display: flex; gap: 8px; flex-wrap: wrap; }
.whk-input {
  flex: 1 1 240px; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--whk-line); border-radius: 10px;
  background: var(--whk-card); color: var(--whk-strong); font-family: inherit; font-size: 13px; font-weight: 600; margin: 0; box-shadow: none;
}
.whk-input::placeholder { color: var(--whk-mut); font-weight: 500; }
.whk-input[aria-invalid="true"] { border-color: var(--whk-bad); }
.whk-hint { font-size: 12px; color: var(--whk-mut); }
.whk-error { font-size: 12px; font-weight: 700; color: var(--whk-bad); }
.whk-body { font-size: 13px; color: var(--whk-strong); }

/* buttons */
.whk-btn {
  min-height: 40px; padding: 0 16px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--whk-line); background: var(--whk-card); color: var(--whk-strong);
  font-family: inherit; font-size: 13px; font-weight: 700; line-height: 1.2; box-shadow: none; text-shadow: none;
}
.whk-btn:hover:not(:disabled) { border-color: var(--whk-btn); }
.whk-btn:disabled { opacity: .55; cursor: default; }
.whk-btn.whk-primary { background: var(--whk-btn); border-color: var(--whk-btn); color: var(--whk-btn-ink); }
.whk-btn.whk-danger { color: var(--whk-bad); border-color: var(--whk-bad); }
.whk-btn.whk-danger.whk-solid { background: var(--whk-bad); border-color: var(--whk-bad); color: #ffffff; }
body.hl-dark .whk-btn.whk-danger.whk-solid { color: #2a1411; }
.whk-btn.whk-quiet { border-color: transparent; background: transparent; color: var(--whk-ink); }
.whk-btn.whk-quiet:hover:not(:disabled) { border-color: var(--whk-line); }
.whk-btn.whk-small { min-height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.whk-btn:focus-visible, .whk-input:focus-visible, .whk-switch:focus-visible, .whk-code:focus-visible { outline: 2px solid var(--whk-btn); outline-offset: 2px; }

/* a row of label + control */
.whk-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-width: 0; }
.whk-switchrow { flex-wrap: nowrap; }
.whk-rowtx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.whk-rowt { font-size: 13px; font-weight: 800; color: var(--whk-strong); }
.whk-rows { font-size: 12px; color: var(--whk-ink); }
.whk-mask { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; font-weight: 600; color: var(--whk-strong); overflow-wrap: anywhere; }
.whk-note { font-size: 12px; font-weight: 700; padding: 8px 12px; border-radius: 8px; }
.whk-note-ok { color: var(--whk-ok); background: var(--whk-ok-bg); }
.whk-note-bad { color: var(--whk-bad); background: var(--whk-bad-bg); }

/* the switch */
.whk-switch { position: relative; flex: 0 0 auto; width: 48px; height: 28px; padding: 0; border-radius: 99px; border: 1px solid var(--whk-track); background: var(--whk-track); cursor: pointer; }
.whk-switch-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #ffffff; transition: transform .15s ease; box-shadow: 0 1px 2px rgba(15, 23, 39, .35); }
.whk-switch-on { background: var(--whk-btn); border-color: var(--whk-btn); }
.whk-switch-on .whk-switch-knob { transform: translateX(20px); background: var(--whk-btn-ink); }
.whk-switch:disabled { opacity: .55; cursor: default; }
@media (prefers-reduced-motion: reduce) { .whk-switch-knob { transition: none; } }

/* the one-time secret, and the "are you sure" */
.whk-reveal { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--whk-warn-line); border-radius: 12px; background: var(--whk-warn-bg); }
.whk-reveal-title { font-size: 15px; font-weight: 800; color: var(--whk-strong); }
.whk-code {
  display: block; padding: 12px; border: 1px solid var(--whk-line); border-radius: 8px; background: var(--whk-card); color: var(--whk-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; user-select: all;
}
.whk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.whk-confirm { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border: 1px solid var(--whk-bad-line); border-radius: 12px; background: var(--whk-bad-bg); }

/* recent deliveries */
.whk-sec { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--whk-line-soft); min-width: 0; }
.whk-sechead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.whk-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.whk-h { font-size: 15px; font-weight: 800; color: var(--whk-strong); }
.whk-list { list-style: none; display: flex; flex-direction: column; border: 1px solid var(--whk-line); border-radius: 12px; overflow: hidden; }
.whk-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--whk-card); }
.whk-item + .whk-item { border-top: 1px solid var(--whk-line-soft); }
.whk-itemtop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.whk-itemwhat { font-size: 13px; font-weight: 800; color: var(--whk-strong); min-width: 0; overflow-wrap: anywhere; }
.whk-itemtime { margin-left: auto; font-size: 12px; color: var(--whk-mut); white-space: nowrap; }
.whk-itembot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.whk-itemdetail { font-size: 12px; color: var(--whk-ink); flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.whk-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11px; font-weight: 800; line-height: 1; white-space: nowrap; border: 1px solid currentColor; }
.whk-chip-ok { color: var(--whk-ok); background: var(--whk-ok-bg); }
.whk-chip-bad { color: var(--whk-bad); background: var(--whk-bad-bg); }
.whk-chip-warn { color: var(--whk-warn); background: var(--whk-warn-bg); }
.whk-chip-busy { color: var(--whk-busy); background: var(--whk-busy-bg); }
.whk-empty { display: flex; flex-direction: column; gap: 2px; padding: 18px 16px; border: 1px dashed var(--whk-line); border-radius: 12px; background: var(--whk-paper); }

/* loading and error */
.whk-skel-wrap { display: flex; flex-direction: column; gap: 10px; }
.whk-skel { height: 14px; border-radius: 6px; background: var(--whk-line-soft); animation: whk-pulse 1.3s ease-in-out infinite; }
.whk-skel-l { width: 100%; height: 40px; border-radius: 10px; } .whk-skel-m { width: 70%; } .whk-skel-s { width: 40%; }
@keyframes whk-pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .whk-skel { animation: none; } }
.whk-errblock { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; border: 1px solid var(--whk-bad-line); border-radius: 12px; background: var(--whk-bad-bg); }
.whk-errblock .whk-btn { margin-top: 6px; }

@media (max-width: 520px) {
  .whk { padding: 16px; gap: 16px; }
  .whk-btn { width: 100%; }
  .whk-btn.whk-small { width: auto; }
  .whk-switchrow .whk-switch { width: 48px; }
  .whk-itemtime { margin-left: 0; flex-basis: 100%; }
}

/* the Settings modal restyles buttons and uppercases labels; this card opts out */
#hlmodal.hlset-modal .whk .whk-btn { font-family: inherit; text-transform: none; letter-spacing: normal; }
#hlmodal.hlset-modal .whk p, #hlmodal.hlset-modal .whk span, #hlmodal.hlset-modal .whk b { text-transform: none; letter-spacing: normal; }
/* ... and puts its own colours back: the modal paints every <p> muted and every input its own ink, which would drop the
   explanation and the address below body-copy contrast. */
#hlmodal.hlset-modal .whk p.whk-lede { color: var(--whk-ink); }
#hlmodal.hlset-modal .whk p.whk-body { color: var(--whk-strong); }
#hlmodal.hlset-modal .whk p.whk-hint { color: var(--whk-mut); }
#hlmodal.hlset-modal .whk p.whk-error { color: var(--whk-bad); }
#hlmodal.hlset-modal .whk p.whk-note-ok { color: var(--whk-ok); }
#hlmodal.hlset-modal .whk p.whk-note-bad { color: var(--whk-bad); }
#hlmodal.hlset-modal .whk input.whk-input { background: var(--whk-card) !important; color: var(--whk-strong) !important; border-color: var(--whk-line) !important; }
#hlmodal.hlset-modal .whk input.whk-input[aria-invalid="true"] { border-color: var(--whk-bad) !important; }

/* Phones and tablets: the URL box and its buttons are 44px taps (docs/ua/mobile-audit.md). */
@media (max-width: 900px), (pointer: coarse) {
  .whk-btn, .whk-input { min-height: 44px; }
}
