/* Webhooks app */
#whCard { padding: 0 12px 10px; }
.wh-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; display: grid; gap: 8px; box-shadow: var(--shadow-sm); }
.wh-card.is-empty { gap: 10px; }
.wh-card-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.wh-card-none { color: var(--ink-muted); }
.wh-full { width: 100%; justify-content: center; }
.wh-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wh-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 650; color: var(--ink-muted); }
.wh-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.wh-status[data-s="live"] { color: var(--ok); }
.wh-status[data-s="live"] i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-tint); animation: whPulse 2s infinite; }
.wh-status[data-s="gone"] i { background: var(--danger); }
.wh-switch { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--accent); padding: 2px 6px; border-radius: 6px; max-width: 60%; }
.wh-switch:hover { background: var(--accent-tint); }
.wh-url { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: var(--r); background: var(--surface-sunk); border: 1px dashed var(--line-strong); font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; color: var(--ink); text-align: left; }
.wh-url span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.wh-url .wx-ico { width: 16px; height: 16px; color: var(--accent); flex: none; }
.wh-url:hover { border-color: var(--accent); background: var(--accent-tint); }
.wh-card-foot { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.wh-tools { padding: 0 16px 4px; display: grid; gap: 6px; }
.wh-methods { display: flex; gap: 4px; flex-wrap: wrap; }
.wh-methods:empty { display: none; }
.wh-methods button { font-size: var(--fs-xs); font-weight: 650; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-muted); background: var(--surface); }
.wh-methods button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.wh-list-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 4px; font-size: var(--fs-xs); font-weight: 650; color: var(--ink-faint); min-height: 30px; }
.wh-mini { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--accent); padding: 3px 6px; border-radius: 6px; }
.wh-mini:hover { background: var(--accent-tint); }
.wh-list { list-style: none; padding: 0 8px 8px; display: grid; gap: 2px; }
.wh-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: var(--pad) 10px; border-radius: var(--r); text-align: left; color: var(--ink); }
.wh-item:hover { background: var(--surface-hover); }
.wh-item.is-open { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); }
.wh-item.is-new .wh-path { font-weight: 700; }
.wh-m { flex: none; width: 64px; box-sizing: border-box; text-align: center; font-size: var(--fs-xs); font-weight: 750; letter-spacing: .04em; padding: 3px 6px; border-radius: 6px; background: var(--surface-sunk); color: var(--ink-muted); border: 1px solid var(--line); margin-top: 2px; }
.wh-m[data-m="GET"] { background: color-mix(in srgb, #2563eb 12%, transparent); color: #1d4ed8; border-color: transparent; }
.wh-m[data-m="POST"] { background: color-mix(in srgb, #16a34a 13%, transparent); color: #166534; border-color: transparent; }
.wh-m[data-m="PUT"], .wh-m[data-m="PATCH"] { background: color-mix(in srgb, #d97706 15%, transparent); color: #92400e; border-color: transparent; }
.wh-m[data-m="DELETE"] { background: color-mix(in srgb, #dc2626 12%, transparent); color: #b91c1c; border-color: transparent; }
[data-theme="dark"] .wh-m[data-m="GET"] { color: #60a5fa; } [data-theme="dark"] .wh-m[data-m="POST"] { color: #4ade80; }
[data-theme="dark"] .wh-m[data-m="PUT"], [data-theme="dark"] .wh-m[data-m="PATCH"] { color: #fbbf24; } [data-theme="dark"] .wh-m[data-m="DELETE"] { color: #f87171; }
.wh-m-lg { font-size: var(--fs-xs); min-width: 64px; padding: 5px 8px; margin: 0; }
.wh-item-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.wh-item-top { display: flex; align-items: baseline; gap: 8px; }
.wh-path { flex: 1; min-width: 0; font-size: var(--fs-sm); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-time { font-size: var(--fs-xs); color: var(--ink-faint); white-space: nowrap; }
.wh-item-sub { font-size: var(--fs-xs); color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-list-empty { padding: 28px 20px; text-align: center; color: var(--ink-faint); font-size: var(--fs-sm); display: grid; justify-items: center; gap: 10px; }
.wh-wait { display: inline-flex; gap: 5px; }
.wh-wait i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .3; animation: whDot 1.4s infinite; }
.wh-wait i:nth-child(2) { animation-delay: .2s; } .wh-wait i:nth-child(3) { animation-delay: .4s; }

/* main */
.wh-over { max-width: 760px; margin: 0 auto; padding: 24px 24px 48px; display: grid; gap: 18px; }
.wh-hero { padding: 16px; border-radius: var(--r-lg); background: var(--surface-sunk); border: 1px solid var(--line); display: grid; gap: 8px; }
.wh-hero-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.wh-hero-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wh-hero-row code { flex: 1; min-width: 0; font-size: var(--fs-md); font-weight: 650; overflow-wrap: anywhere; color: var(--ink); }
.wh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wh-stats > div { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; display: grid; gap: 2px; }
.wh-stats span { font-size: var(--fs-xs); color: var(--ink-faint); }
.wh-stats strong { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.wh-sec { display: grid; gap: 10px; }
.wh-sec h3 { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.wh-code { position: relative; border-radius: var(--r-lg); background: var(--surface-sunk); border: 1px solid var(--line); }
.wh-code pre { padding: 14px 16px; padding-right: 92px; font-size: var(--fs-xs); overflow-x: auto; white-space: pre; }
.wh-code .wx-btn { position: absolute; top: 8px; right: 8px; }
.wh-tips { list-style: disc; padding-left: 20px; display: grid; gap: 6px; font-size: var(--fs-sm); color: var(--ink-muted); }
.wh-tips .mono { font-size: var(--fs-sm); color: var(--ink); }
.wh-read { max-width: 900px; margin: 0 auto; padding: 22px 24px 40px; display: grid; gap: 14px; }
.wh-read-title { display: flex; align-items: center; gap: 10px; }
.wh-read-title h2 { font-size: var(--fs-lg); font-weight: 650; overflow-wrap: anywhere; min-width: 0; }
.wh-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: var(--fs-xs); color: var(--ink-faint); }
.wh-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.wh-tabs .wx-seg { display: inline-flex; flex-wrap: wrap; }
.wh-pane { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.wh-pane > .wx-help { padding: 16px; }
.wh-pre { padding: 16px; font-size: var(--fs-xs); white-space: pre; overflow: auto; max-height: 70vh; background: var(--surface-sunk); margin: 0; }
.wh-pre.is-wrap, .wh-pane.is-wrap .wh-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.wh-kv { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
.wh-kv th, .wh-kv td { text-align: left; vertical-align: top; padding: 8px 12px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.wh-kv tr:first-child th, .wh-kv tr:first-child td { border-top: 0; }
.wh-kv th { width: 34%; color: var(--ink-muted); font-weight: 600; }
.wh-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wh-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
textarea.wx-input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.wh-test-btn span { white-space: nowrap; }

@keyframes whPulse { 50% { box-shadow: 0 0 0 5px transparent; } }
@keyframes whDot { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 760px) {
  .wh-app .wx-side { position: static; transform: none; width: 100%; box-shadow: none; border: 0; transition: none; }
  .wh-app .wx-main { display: none; }
  .wh-app.is-reading .wx-side { display: none; }
  .wh-app.is-reading .wx-main { display: flex; }
  .wh-app #wxMenuBtn { display: none; }
  .wh-app .wx-drawer-back { display: none; }
  .wh-app:not(.is-reading) .wx-side-top { border-bottom: 1px solid var(--line); background: var(--surface); }
  .wh-app:not(.is-reading) .wx-side-body { padding-top: 10px; background: var(--surface); }
  .wh-app:not(.is-reading) .wx-side-foot { background: var(--surface); }
  .wh-app .wh-card { box-shadow: none; }
  .wh-read, .wh-over { padding: 16px 14px 32px; }
  .wh-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wh-grid2, .wh-grid3 { grid-template-columns: 1fr; }
  .wh-test-btn span { display: none; }
}
.wh-list > li { min-width: 0; }
.wh-item { overflow: hidden; }
.wh-app.no-hook .wh-tools, .wh-app.no-hook .wh-list-head { display: none; }

/* ---- Clean pass ---- */
.wh-rtools { display: inline-flex; gap: 2px; }
.wh-app:not(.is-req) .wh-rtools { display: none; }
.wh-card { border: 0; box-shadow: none; background: transparent; padding: 4px 4px 0; gap: 6px; }
.wh-url { border: 0; }
.wh-tools .wx-search .wx-input { border-color: transparent; background: var(--surface-sunk); }
@media (min-width: 761px) { .wh-url, .wh-tools .wx-search .wx-input { background: var(--surface); border: 1px solid var(--line); } }
.wh-over { gap: 22px; padding-top: 32px; }
.wh-over-head h2 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.015em; }
.wh-stat-line { color: var(--ink-faint); font-size: var(--fs-sm); margin-top: 4px; }
.wh-code { border: 0; }
.wh-tips { padding-left: 18px; }
.wh-read { gap: 16px; padding-top: 26px; }
.wh-line { font-size: var(--fs-xs); color: var(--ok); }
.wh-line.is-warn { color: var(--warn); }
.wh-tabbar { display: flex; gap: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.wh-tabbar button { padding: 8px 0; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-faint); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.wh-tabbar button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.wh-pane { border: 0; border-radius: var(--r-lg); background: transparent; }
.wh-pane > .wx-help { padding: 4px 0; }
.wh-pre { border-radius: var(--r-lg); }
.wh-kv th, .wh-kv td { padding: 8px 4px; }
@media (max-width: 760px) {
  .wh-app.is-reading .wx-credits, .wh-app.is-reading .wx-avatar { display: none; }
  .wh-read, .wh-over { padding: 18px 18px 40px; }
}
.wh-list { grid-template-columns: minmax(0, 1fr); }
.wh-over, .wh-read { grid-template-columns: minmax(0, 1fr); }
.wh-over > *, .wh-read > *, .wh-sec > * { min-width: 0; }
.wh-tips .mono, .wh-over .wx-help .mono { overflow-wrap: anywhere; }
.wh-read-title h2 { overflow-wrap: anywhere; word-break: break-all; }
.wh-item-main { grid-template-columns: minmax(0, 1fr); }
/* Phase 2: a wider request list; the path gets two lines, IP and type sit under it. */
@media (min-width: 761px) { .wh-app { --side-w: 340px; } [data-sidew="wide"] .wh-app { --side-w: 380px; } [data-sidew="narrow"] .wh-app { --side-w: 300px; } }
.wh-item-top { align-items: flex-start; }
.wh-path { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.wh-time { flex: none; white-space: nowrap; }
