:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #607089;
  --line: #dce3ee;
  --accent: #2563eb;
  --accent-soft: #e8f4fd;
  --shadow: 0 10px 30px rgba(23, 32, 51, 0.08);
  --ui-zoom: 1;
  --method-get: #059669;
  --method-post: #2563eb;
  --method-patch: #d97706;
  --method-delete: #dc2626;
  --method-put: #7c3aed;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1318;
  --panel: #171d24;
  --text: #edf2f7;
  --muted: #9aa8b8;
  --line: #303946;
  --accent: #3b82f6;
  --accent-soft: #1e3a5f;
  --shadow: none;
  --method-get: #10b981;
  --method-post: #60a5fa;
  --method-patch: #fbbf24;
  --method-delete: #f87171;
  --method-put: #a78bfa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  zoom: var(--ui-zoom);
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(20px, 4vw, 56px) 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.header-actions .status {
  margin-left: auto;
}

.zoom-control {
  display: inline-flex;
  gap: 6px;
}

.zoom-control button {
  min-width: 34px;
  padding-inline: 8px;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 11px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.rss-button,
.json-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 11px;
  cursor: pointer;
  text-decoration: none;
}

.rss-button:hover,
.json-link:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

.disclaimer {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.disclaimer a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.disclaimer a:hover {
  text-decoration: underline;
}

.status {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px clamp(20px, 4vw, 56px) 48px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(120px, 0.6fr) minmax(170px, 1fr) minmax(260px, 1.8fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

select,
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  padding: 9px 11px;
}

select:focus,
input:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.summary > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.summary span {
  display: block;
  font-size: 28px;
  font-weight: 800;
}

.summary small {
  color: var(--muted);
}

.table-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.table-head,
.record {
  display: grid;
  grid-template-columns: minmax(420px, 1.3fr) 84px minmax(220px, 0.9fr) minmax(150px, 0.6fr) minmax(150px, 0.6fr);
  align-items: center;
  gap: 10px;
}

.table-head {
  min-height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 88%, var(--accent-soft));
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.record {
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.record:last-child {
  border-bottom: 0;
}

.record:nth-child(even) {
  background: color-mix(in srgb, var(--bg) 50%, var(--panel) 50%);
}

.record:hover {
  background: color-mix(in srgb, var(--panel) 80%, var(--accent) 20%);
}

[data-density="expanded"] .record {
  align-items: start;
  min-height: 72px;
  padding-block: 11px;
}

[data-density="expanded"] .path-cell,
[data-density="expanded"] .description-cell {
  white-space: normal;
}

.path-cell {
  font-family: "Consolas", "Monaco", monospace;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}

.path-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.copy-path-btn {
  opacity: 0;
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 14px;
  border-radius: 4px;
  min-height: auto;
  line-height: 1;
}

.record:hover .copy-path-btn {
  opacity: 1;
}

.copy-path-btn:hover {
  background: var(--accent-soft);
}

.method-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  text-transform: uppercase;
}

.method-badge.get { background: var(--method-get); }
.method-badge.post { background: var(--method-post); }
.method-badge.patch { background: var(--method-patch); }
.method-badge.delete { background: var(--method-delete); }
.method-badge.put { background: var(--method-put); }

.deprecated-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  background: #6b7280;
  text-transform: uppercase;
  margin-left: 8px;
}

.description-cell {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.description-cell strong {
  color: var(--text);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.permissions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.permissions-list li {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

[data-theme="dark"] .permissions-list li {
  background: #2e2140;
  color: #eadcff;
}

.permissions-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 12px;
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 920px) {
  :root {
    --ui-zoom: 0.92;
  }

  .app-header {
    display: block;
  }

  .header-actions {
    justify-items: start;
    margin-top: 12px;
  }

  .status {
    text-align: left;
  }

  .filters,
  .summary {
    grid-template-columns: 1fr;
  }

  .table-shell {
    overflow-x: auto;
  }

  .table-head,
  .record {
    min-width: 900px;
  }
}
