:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #102a43;
  --muted: #52667a;
  --line: #d9e2ec;
  --brand: #0b6e99;
  --brand-dark: #084c69;
  --accent: #f0b429;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(16, 42, 67, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--brand-dark); }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  background: linear-gradient(135deg, #102a43 0%, #0b4f6c 65%, #0b6e99 100%);
  color: #fff;
  padding: 38px 0 30px;
}

.header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: #b8e0f2;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.lede {
  margin: 12px 0 0;
  max-width: 62ch;
  color: #d9eef8;
}

.downloads {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 190px;
}

.downloads a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.08);
}

.downloads a:hover { background: rgba(255, 255, 255, 0.16); }
.downloads span { color: #b8e0f2; font-weight: 500; }

main { padding: 24px 0 40px; }

.tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  padding: 9px 14px;
  font-size: 0.86rem;
  font-weight: 750;
  white-space: nowrap;
}

.tab:hover { border-color: var(--brand); color: var(--brand-dark); }
.tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.tab-subtitle {
  margin: 2px 2px 12px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.search-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-box { flex: 1; }

.search-box input {
  width: 100%;
  height: 50px;
  border: 1px solid #bcccdc;
  border-radius: 10px;
  padding: 0 15px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.search-box input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(11, 110, 153, 0.12);
}

button {
  font: inherit;
  cursor: pointer;
}

.primary, .ghost, .pager button, .copy {
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.primary {
  min-width: 112px;
  background: var(--brand);
  color: #fff;
  padding: 0 20px;
}

.primary:hover { background: var(--brand-dark); }
.primary:active, .copy:active { transform: translateY(1px); }
.primary:disabled, .pager button:disabled { opacity: 0.5; cursor: wait; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  margin-top: 12px;
}

.filter-row label {
  display: grid;
  gap: 5px;
  min-width: 210px;
  flex: 1;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.filter-row select {
  height: 43px;
  border: 1px solid #bcccdc;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 0.95rem;
}

.ghost {
  height: 43px;
  padding: 0 16px;
  background: #fff;
  color: var(--muted);
  border-color: #bcccdc;
}

.ghost:hover { border-color: var(--brand); color: var(--brand-dark); }

.search-hint {
  margin: 9px 3px 0;
  color: #627d98;
  font-size: 0.8rem;
}

.status {
  min-height: 24px;
  margin: 16px 2px 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.status.error { color: var(--danger); font-weight: 650; }

.summary {
  margin: 6px 2px 12px;
  font-weight: 700;
  color: var(--ink);
}

.results {
  display: grid;
  gap: 12px;
}

.result {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(16, 42, 67, 0.05);
  padding: 15px 16px;
}

.result-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.result h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #e6f6fb;
  color: #075985;
}

.badge.type { background: #fff4d6; color: #7a4b00; }
.badge.id { background: #eef2f6; color: #52667a; }

.problem {
  margin: 9px 0 10px;
  font-size: 1rem;
  color: #243b53;
}

details {
  margin-top: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}

summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.9rem;
  user-select: none;
}

.detail-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.detail h3 {
  margin: 0 0 3px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
}

.detail p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #243b53;
  font-size: 0.94rem;
}

.result-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.copy {
  background: #e6f6fb;
  color: #075985;
  border-color: #b8e0f2;
  padding: 7px 13px;
  font-size: 0.83rem;
}

.copy:hover { background: #d3edf7; }
.copy.copied { background: #d9f5e5; color: #166534; border-color: #a7e3c1; }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 22px 0 4px;
}

.pager button {
  background: #fff;
  color: var(--brand-dark);
  border-color: #bcccdc;
  padding: 9px 15px;
}

.pager button:hover:not(:disabled) { border-color: var(--brand); }
.pager span { color: var(--muted); font-size: 0.9rem; }

.empty,
.empty-prompt {
  background: var(--panel);
  border: 1px dashed #bcccdc;
  border-radius: 12px;
  padding: 26px;
  color: var(--muted);
}

.empty { text-align: center; }
.empty-prompt h2 { margin: 0 0 7px; color: var(--ink); font-size: 1.15rem; }
.empty-prompt p { margin: 0; }
.examples { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: 0.86rem; }
.example {
  border: 1px solid #b8e0f2;
  border-radius: 999px;
  background: #e6f6fb;
  color: #075985;
  padding: 5px 11px;
  font-size: 0.82rem;
  font-weight: 700;
}
.example:hover { background: #d3edf7; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px 0 30px;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer p { margin: 0; }
.archive-links { flex-basis: 100%; line-height: 1.8; }
.small { color: #829ab1; }
.noscript { padding: 20px; color: var(--danger); }

@media (max-width: 760px) {
  .header-inner { align-items: flex-start; flex-direction: column; }
  .downloads { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .downloads a { flex: 1; min-width: 150px; }
  .search-row { flex-direction: column; }
  .primary { height: 47px; }
  .filter-row label { min-width: 100%; }
  .ghost { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
