/* Webhooks. Only what is particular to this page — surfaces come from
   platform-kit.css.

   The signing secret gets a panel rather than a toast: it is the one moment it
   exists, and a message that fades is the wrong place for something a server
   configuration depends on. */

.pw-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.pw-dismiss { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 12px; opacity: .75; text-decoration: underline; }
.pw-err { display: block; color: #b32020; font-size: 11.5px; margin-top: 3px; }

.pw-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pw-detail-head h3 { margin: 0 0 5px; font-size: 18px; letter-spacing: -.01em; }
.pw-detail-head p { margin: 0; color: var(--sd-mut); font-size: 12.5px; }

/* the endpoint list */
.pw-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 20px; }
.pw-card-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 420px; }
.pw-card-main b { font-size: 15.5px; letter-spacing: -.01em; }
.pw-card-main > .pw-tag { align-self: flex-start; }
.pw-card-main code { font-size: 12px; color: var(--sd-mut); word-break: break-all; }
.pw-card-main small { font-size: 11.5px; color: var(--sd-mut); display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.pw-card-acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* the secret, shown once */
.pw-secret {
  border: 1px solid rgba(22, 163, 74, .35); background: #f2fbf5; border-radius: 18px;
  box-shadow: var(--sd-shadow-sm); padding: 20px 22px; margin-bottom: 18px;
}
.pw-secret h3 { margin: 0 0 6px; font-size: 17px; color: #146c37; }
.pw-secret p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; color: #1a5c33; max-width: 78ch; }
.pw-secret-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #146c37;
  margin: 0 0 6px;
}
.pw-secret-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.pw-secret-row code {
  flex: 1 1 380px; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; padding: 12px 14px; border-radius: 10px; background:var(--paper,#fff);
  border: 1px solid rgba(22, 163, 74, .3); word-break: break-all; line-height: 1.5;
}

/* the form */
.pw-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.pw-field > span { font-size: 12.5px; font-weight: 700; color: var(--sd-ink); }
.pw-field > small { font-size: 12px; color: var(--sd-mut); line-height: 1.5; }
.pw-field input {
  padding: 10px 12px; border-radius: 10px; font: inherit; font-size: 13.5px;
  border: 1px solid var(--sd-line); background:var(--paper,#fff); color: var(--sd-ink); max-width: 520px;
}
.pw-field input:focus { outline: none; border-color: var(--sd-blue); box-shadow: 0 0 0 3px rgba(54,126,245,.15); }

.pw-events { border: 1px solid var(--sd-line); border-radius: 12px; padding: 12px 14px 6px; margin: 8px 0 0; }
.pw-events legend { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--sd-mut); padding: 0 6px; }
.pw-events legend { display: flex; align-items: center; gap: 10px; }
.pw-event-all { border: 0; background: transparent; color: var(--sd-blue, #367ef5); font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; padding: 0; }
.pw-event-all:hover { text-decoration: underline; }
.pw-event-master { margin: 10px 0 2px; border: 1px solid var(--sd-line); background: var(--sd-card); }
.pw-event { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; margin: 2px 0; border-radius: 10px; transition: background .15s ease, box-shadow .15s ease; }
.pw-event:hover { background: var(--sd-sunk, #eef2f8); }
.pw-event.on { background: rgba(54, 126, 245, .08); box-shadow: inset 0 0 0 1px rgba(54, 126, 245, .28); }
.pw-event > span { flex: 1; min-width: 0; }
.pw-switch { flex: none; width: 42px; height: 24px; padding: 0; cursor: pointer; border: 0; border-radius: 999px; background: var(--sd-sunk, #e8edf5); }
.pw-switch i { display: block; width: 18px; height: 18px; margin: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(10, 22, 51, .25); }
.pw-event.on .pw-switch { background: var(--sd-blue, #367ef5); }
.pw-event.on .pw-switch i { transform: translateX(18px); }
.pw-switch:focus-visible { outline: 2px solid var(--sd-blue, #367ef5); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .pw-switch i { transition: transform .16s ease; } }
html[data-theme="dark"] .pw-event:hover { background: rgba(77, 127, 255, .1); }
html[data-theme="dark"] .pw-event.on { background: rgba(77, 127, 255, .18); box-shadow: inset 0 0 0 1px rgba(77, 127, 255, .4); }
.pw-event b { display: block; font-size: 12.5px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pw-event small { display: block; font-size: 12px; color: var(--sd-mut); margin-top: 1px; }
.pw-form-actions { display: flex; justify-content: flex-end; }

/* how to verify */
.pw-help {
  background: var(--sd-card); border: 1px solid var(--sd-line); border-radius: 18px;
  box-shadow: var(--sd-shadow-sm); padding: 18px 20px; margin-top: 18px;
}
.pw-help h3 { margin: 0 0 10px; font-size: 15px; }
.pw-code {
  margin: 0 0 10px; padding: 14px 16px; border-radius: 12px; background: #0f172a; color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.65; overflow-x: auto;
}
.pw-help code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background:var(--sd-sunk,#eef2f8); padding: 1px 5px; border-radius: 5px; }

.pw-page { display: flex; flex-direction: column; gap: 20px; }
.pw-page .pw-head, .pw-page .pw-help, .pw-page .pw-secret { margin: 0; }
.pw-event.on { background: rgba(54, 126, 245, .08); border-radius: 10px; padding: 8px 10px; }
.pw-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 80; max-width: min(440px, 92vw); padding: 11px 16px; border-radius: 999px;
  background: #0f172a; color: #f8fafc; font: 600 13px/1.4 system-ui, sans-serif;
  box-shadow: 0 10px 30px rgba(8, 16, 32, .28);
}

@media (max-width: 760px) { .pw-card { flex-direction: column; } }
