:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #eef3f8;
  --border: #d9e1ea;
  --text: #17202a;
  --muted: #627083;
  --accent: #146c6c;
  --accent-soft: #dff3f1;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(24, 39, 75, 0.08);
  --code-bg: #101820;
  --code-text: #e8f1f2;
  --hover: #f6fafc;
  --button-hover-border: #9daec0;
  --active-border: #b9c8d6;
  --get-bg: #dff3f1;
  --get-text: #146c6c;
  --post-bg: #e6f0ff;
  --post-text: #1d4ed8;
  --put-bg: #fff4cc;
  --put-text: #8a5a00;
  --patch-bg: #f0e7ff;
  --patch-text: #6d28d9;
  --delete-bg: #ffe5e1;
  --delete-text: #b42318;
  --other-bg: #e9eef4;
  --other-text: #405165;
  --status-success-bg: #e0f6e8;
  --status-success-text: #197245;
  --status-client-bg: #fff4cc;
  --status-client-text: #8a5a00;
  --status-server-bg: #ffe5e1;
  --status-server-text: #b42318;
  --new-bg: #101820;
  --new-text: #ffffff;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101316;
  --surface: #171c20;
  --surface-strong: #222a30;
  --border: #303a42;
  --text: #edf2f5;
  --muted: #9ba8b4;
  --accent: #50c8b5;
  --accent-soft: #173b39;
  --danger: #ff8a80;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  --code-bg: #090d10;
  --code-text: #edf7f8;
  --hover: #1d252b;
  --button-hover-border: #5c6a74;
  --active-border: #52636d;
  --get-bg: #173b39;
  --get-text: #80e0d1;
  --post-bg: #172b52;
  --post-text: #93c5fd;
  --put-bg: #3b310f;
  --put-text: #facc15;
  --patch-bg: #2f2148;
  --patch-text: #c4b5fd;
  --delete-bg: #461b18;
  --delete-text: #ffaaa1;
  --other-bg: #26313a;
  --other-text: #c3ced8;
  --status-success-bg: #143823;
  --status-success-text: #86efac;
  --status-client-bg: #3b310f;
  --status-client-text: #facc15;
  --status-server-bg: #461b18;
  --status-server-text: #ffaaa1;
  --new-bg: #f8fafc;
  --new-text: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  width: min(1360px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.top-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.project-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.project-mark,
.project-mark img {
  display: block;
  width: 56px;
  height: 56px;
}

.project-mark {
  flex: 0 0 auto;
}

.project-mark img {
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.05;
}

button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  border-color: var(--button-hover-border);
}

.button-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover {
  border-color: var(--button-hover-border);
}

.postman-panel {
  display: grid;
  gap: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.postman-intro,
.postman-card p {
  color: var(--muted);
  line-height: 1.6;
}

.postman-intro {
  max-width: 72ch;
  margin: 0;
}

.postman-downloads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.postman-card {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-strong);
}

.postman-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.postman-card p {
  margin: 0;
}

.postman-guide {
  padding-top: 4px;
}

.postman-guide h2 {
  font-size: 1.1rem;
}

.postman-guide ol {
  display: grid;
  gap: 9px;
  padding-left: 22px;
  line-height: 1.55;
}

.postman-guide li span {
  color: var(--muted);
}

button.danger {
  color: var(--danger);
}

.endpoint-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
}

.mini-panel,
.advanced-panel,
.backup-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mini-panel,
.backup-panel {
  padding: 14px;
}

.mini-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mini-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metrics-grid div,
.backup-list div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-strong);
}

.metrics-grid strong {
  font-size: 1.35rem;
}

.metrics-grid span,
.backup-list span {
  color: var(--muted);
  font-size: 0.82rem;
}

.plain-pre {
  min-height: 132px;
  max-height: 180px;
  background: var(--surface-strong);
  color: var(--text);
}

.advanced-panel,
.backup-panel {
  margin-bottom: 18px;
  padding: 0;
}

.advanced-panel summary,
.backup-panel summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 16px 16px;
}

.advanced-grid label {
  display: grid;
  gap: 7px;
}

.advanced-grid span,
.replay-panel label > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.wide-field {
  grid-column: 1 / -1;
}

textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 10px;
}

.backup-panel button,
.replay-panel button {
  min-height: 36px;
  padding: 0 12px;
}

.backup-content {
  padding: 0 16px 16px;
}

#backupSummary,
#replayStatus {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.backup-list {
  display: grid;
  gap: 8px;
}

.settings-panel label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-panel label span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.settings-panel select {
  width: auto;
  min-width: 220px;
}

#settingsStatus {
  min-width: 84px;
  margin: 0;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 800;
}

.endpoint-panel code {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-panel span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

code {
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--text);
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 0.9em;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 128px);
  margin-bottom: 18px;
}

.list-panel,
.detail-panel {
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.list-panel {
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.panel-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.list-tools {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.search-control,
.filter-row label:not(.follow-control) {
  display: grid;
  gap: 6px;
}

.search-control span,
.filter-row label:not(.follow-control) > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

input[type="search"],
input[type="password"],
input[type="url"],
input[type="number"],
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 390px);
}

.login-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 2rem;
}

.login-card label {
  display: grid;
  gap: 7px;
}

.login-card label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-card button {
  min-height: 42px;
  background: var(--accent);
  color: var(--surface);
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.follow-control,
.select-visible-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.follow-control span,
.select-visible-control span {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.follow-control input,
.select-visible-control input,
.item-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.bulk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-actions button,
.bulk-confirm button {
  min-height: 34px;
  padding: 0 10px;
}

.bulk-actions > button,
.confirm-delete,
#confirmBulkDeleteButton {
  color: var(--danger);
}

.bulk-confirm {
  display: flex;
  align-items: center;
  gap: 6px;
}

#countBadge {
  min-width: 32px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.copy-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
}

.icon-button svg,
.copy-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button {
  color: var(--muted);
}

.icon-button.copied {
  color: var(--accent);
}

.webhook-list {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 370px);
  overflow: auto;
  padding: 8px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

.pagination-bar button {
  min-height: 34px;
  padding: 0 10px;
}

.pagination-bar button:disabled {
  cursor: default;
  opacity: 0.48;
}

.pagination-bar span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.webhook-item {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 96px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
}

.item-check {
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  border-right: 1px solid var(--border);
}

.webhook-item:hover,
.webhook-item.active {
  border-color: var(--active-border);
  background: var(--hover);
}

.webhook-item.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.webhook-select {
  display: grid;
  flex: 1 1 auto;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.item-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.item-main strong,
.method-pill {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--other-bg);
  color: var(--other-text);
  font-size: 0.72rem;
  line-height: 1;
}

.status-mini,
.status-pill,
.new-badge {
  flex: 0 0 auto;
  border-radius: 6px;
  font-weight: 800;
}

.status-mini,
.new-badge {
  padding: 4px 7px;
  font-size: 0.72rem;
  line-height: 1;
}

.new-badge {
  background: var(--new-bg);
  color: var(--new-text);
}

.status-pill {
  display: inline-flex;
  margin: 10px 0 0;
  padding: 6px 9px;
  font-size: 0.82rem;
}

.status-success {
  background: var(--status-success-bg);
  color: var(--status-success-text);
}

.status-client-error {
  background: var(--status-client-bg);
  color: var(--status-client-text);
}

.status-server-error {
  background: var(--status-server-bg);
  color: var(--status-server-text);
}

.status-other {
  background: var(--other-bg);
  color: var(--other-text);
}

.method-get {
  background: var(--get-bg) !important;
  color: var(--get-text) !important;
}

.method-post {
  background: var(--post-bg) !important;
  color: var(--post-text) !important;
}

.method-put {
  background: var(--put-bg) !important;
  color: var(--put-text) !important;
}

.method-patch {
  background: var(--patch-bg) !important;
  color: var(--patch-text) !important;
}

.method-delete {
  background: var(--delete-bg) !important;
  color: var(--delete-text) !important;
}

.item-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 700;
}

.item-preview {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webhook-item time {
  color: var(--muted);
  font-size: 0.78rem;
}

.delete-webhook,
.delete-confirm {
  flex: 0 0 auto;
  width: 0;
  min-height: 100%;
  border: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  opacity: 0;
  transition: width 140ms ease, opacity 140ms ease, border-color 140ms ease, padding 140ms ease;
}

.delete-webhook {
  padding: 0;
  color: var(--danger);
  font-weight: 800;
  line-height: 1.2;
}

.webhook-item:hover .delete-webhook,
.webhook-item:focus-within .delete-webhook {
  width: 72px;
  padding: 0 8px;
  border-left: 1px solid var(--border);
  opacity: 1;
}

.delete-webhook:hover,
.delete-webhook:focus-visible {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  outline: none;
}

.delete-confirm {
  display: grid;
  width: 112px;
  border-left: 1px solid var(--border);
  opacity: 1;
}

.confirm-delete,
.cancel-delete {
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 800;
}

.confirm-delete {
  color: var(--danger);
}

.cancel-delete {
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.confirm-delete:hover,
.cancel-delete:hover,
.confirm-delete:focus-visible,
.cancel-delete:focus-visible {
  background: var(--hover);
  outline: none;
}

.list-empty,
.empty-state {
  margin: 0;
  color: var(--muted);
}

.list-empty {
  padding: 16px 10px;
}

.detail-panel {
  position: relative;
  overflow: hidden;
}

.empty-state {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.detail-view {
  height: 100%;
  overflow: auto;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
}

.replay-panel {
  display: block;
  border-bottom: 1px solid var(--border);
}

.replay-panel label {
  display: grid;
  gap: 6px;
}

.detail-header h2 {
  max-width: 860px;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  font-size: 1.3rem;
}

.detail-header time {
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.method-pill {
  display: inline-flex;
  font-weight: 800;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
}

.detail-grid section {
  min-width: 0;
}

.block-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  margin-bottom: 8px;
}

.detail-grid h3 {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.copy-button {
  color: var(--muted);
}

.copy-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.copy-button.copied {
  color: var(--accent);
}

pre {
  min-height: 220px;
  max-height: 420px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-highlight {
  white-space: pre;
}

.json-key {
  color: #8bd3ff;
}

.json-string {
  color: #a7f3d0;
}

.json-number {
  color: #fde68a;
}

.json-literal {
  color: #f0abfc;
}

[data-theme="dark"] .json-key {
  color: #93c5fd;
}

[data-theme="dark"] .json-string {
  color: #86efac;
}

[data-theme="dark"] .json-number {
  color: #fde68a;
}

[data-theme="dark"] .json-literal {
  color: #f0abfc;
}

/* Dashboard type and surface system */
:root {
  --font-sans: "Segoe UI", "Segoe UI Variable", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

.app-shell {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

.app-shell button,
.app-shell input,
.app-shell textarea,
.app-shell select {
  font-size: 14px;
}

.app-shell button,
.app-shell .button-link,
.app-shell input[type="search"],
.app-shell input[type="password"],
.app-shell input[type="url"],
.app-shell input[type="number"],
.app-shell select,
.app-shell textarea,
.app-shell .follow-control,
.app-shell .select-visible-control,
.app-shell .list-panel,
.app-shell .detail-panel,
.app-shell .endpoint-panel,
.app-shell .settings-panel,
.app-shell .mini-panel,
.app-shell .response-settings-disclosure,
.app-shell .advanced-panel,
.app-shell .backup-panel {
  border-radius: 5px;
  box-shadow: none;
}

.app-shell {
  padding-top: 24px;
}

.topbar {
  margin-bottom: 16px;
}

.app-shell h1 {
  font-size: clamp(1.75rem, 3vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.app-shell h2 {
  font-size: 18px;
  font-weight: 650;
  line-height: 1.3;
}

.app-shell h3 {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
}

.workspace {
  gap: 14px;
}

.list-panel,
.detail-panel {
  border-radius: 5px;
  box-shadow: none;
}

.panel-heading {
  min-height: 64px;
  padding: 10px 16px;
}

.panel-heading h2,
.mini-heading h2 {
  font-size: 18px;
}

.list-tools {
  gap: 11px;
}

.search-control span,
.filter-row label:not(.follow-control) > span,
.advanced-grid span,
.replay-panel label > span,
.detail-grid h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.follow-control span,
.select-visible-control span,
.settings-panel label span,
.endpoint-panel span,
.endpoint-panel code,
.button-link {
  font-size: 14px;
}

.app-shell input[type="search"],
.app-shell input[type="password"],
.app-shell input[type="url"],
.app-shell input[type="number"],
.app-shell select {
  min-height: 40px;
  border-radius: 4px;
}

.app-shell button,
.app-shell .button-link {
  border-radius: 4px;
}

.follow-control,
.select-visible-control {
  border-radius: 4px;
}

.webhook-list {
  padding: 6px;
}

.webhook-item {
  min-height: 92px;
  border-radius: 4px;
}

.webhook-item.active {
  box-shadow: inset 2px 0 0 var(--accent);
}

.item-main strong,
.method-pill,
.status-mini,
.status-pill,
.new-badge {
  font-size: 13px;
}

.item-preview,
.webhook-item time,
.pagination-bar span,
.pagination-bar button,
.metrics-grid span,
.backup-list span,
.detail-header time,
#settingsStatus,
#backupSummary,
#replayStatus {
  font-size: 13px;
}

.item-preview,
.webhook-item time,
.detail-header time,
.metrics-grid strong,
.pagination-bar span,
#countBadge {
  font-variant-numeric: tabular-nums;
}

.detail-header {
  padding: 20px;
}

.detail-header h2 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.replay-panel > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 18px;
  cursor: pointer;
  list-style: none;
}

.replay-panel > summary::-webkit-details-marker {
  display: none;
}

.replay-panel > summary:hover {
  background: var(--hover);
}

.replay-panel > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.replay-summary-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.replay-summary-hint {
  color: var(--muted);
  font-size: 13px;
}

.replay-panel > summary svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.replay-chevron {
  color: var(--muted);
}

.replay-panel[open] .replay-chevron {
  transform: rotate(180deg);
}

.replay-content {
  display: grid;
  gap: 10px;
  padding: 12px 18px 16px;
}

.replay-main-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.replay-main-row label {
  align-content: start;
  gap: 5px;
}

.replay-main-row button {
  min-height: 40px;
  align-self: end;
}

.replay-help {
  max-width: 68ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

#replayStatus {
  grid-column: 1 / -1;
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

#replayStatus:empty {
  display: none;
}

#replayStatus[data-state="sending"] {
  color: var(--accent);
}

#replayStatus[data-state="success"] {
  color: var(--status-success-text);
}

#replayStatus[data-state="error"] {
  color: var(--danger);
}

#replayStatus[data-state="cancelled"] {
  color: var(--muted);
}

.detail-grid {
  gap: 14px;
  padding: 16px 18px 20px;
}

.detail-grid h3 {
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

.detail-grid pre {
  font-size: 11.34px;
}

.copy-button {
  width: 34px;
  height: 34px;
  border-radius: 4px;
}

pre,
code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

pre {
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.55;
}

.admin-disclosure {
  margin: 0 0 16px;
  border-bottom: 1px solid var(--border);
}

.response-settings-disclosure {
  margin: 0 0 16px;
  border-bottom: 1px solid var(--border);
}

.response-settings-disclosure > summary,
.admin-disclosure > summary {
  width: fit-content;
  padding: 8px 2px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.admin-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 8px 0 16px;
}

.mini-panel {
  padding: 12px;
}

.metrics-grid {
  gap: 8px;
}

.metrics-grid div,
.backup-list div {
  padding: 9px;
  border-radius: 4px;
}

.metrics-grid strong {
  font-size: 20px;
  font-weight: 650;
}

.plain-pre {
  min-height: 100px;
  max-height: 160px;
}

.advanced-panel,
.backup-panel {
  border-radius: 5px;
}

.advanced-panel summary,
.backup-panel summary {
  padding: 13px 15px;
  font-size: 15px;
}

.advanced-grid label,
.settings-panel label {
  gap: 7px;
}

.advanced-grid span {
  color: var(--muted);
}

.settings-panel {
  min-height: 60px;
  gap: 16px;
  padding: 10px 14px;
}

.settings-panel label span {
  font-weight: 600;
}

.settings-panel select,
.settings-panel input {
  min-height: 38px;
}

.endpoint-panel {
  min-height: 50px;
  margin-bottom: 16px;
}

.new-arrivals-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0 0 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell :where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.delete-webhook:focus-visible,
.confirm-delete:focus-visible,
.cancel-delete:focus-visible {
  position: relative;
  z-index: 1;
  outline-offset: -3px;
}

::selection {
  background: var(--accent);
  color: var(--surface);
}

.app-shell ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.app-shell ::-webkit-scrollbar-thumb {
  border: 2px solid var(--surface);
  background: var(--active-border);
}

.app-shell ::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100vw - 20px, 680px);
    padding: 18px 0;
  }

  .endpoint-panel,
  .settings-panel,
  .topbar,
  .detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-panel label,
  .bulk-row {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-panel select {
    width: 100%;
  }

  .top-actions {
    align-self: flex-end;
  }

  .project-mark,
  .project-mark img {
    width: 48px;
    height: 48px;
  }

  .actions {
    width: 100%;
  }

  .actions button {
    flex: 1;
  }

  .workspace,
  .detail-grid,
  .admin-grid,
  .advanced-grid,
  .metrics-grid,
  .postman-downloads {
    grid-template-columns: 1fr;
  }

  .webhook-list {
    max-height: 42vh;
  }

  .detail-header time {
    flex: auto;
  }
}
