:root {
  --sc-blue-900: #0b2f5f;
  --sc-blue-700: #155b9f;
  --sc-blue-600: #1d6fb8;
  --sc-blue-100: #e8f2fb;
  --sc-cyan-100: #e7f8fb;
  --sc-ink: #172033;
  --sc-muted: #64748b;
  --sc-line: #d7e1ee;
  --sc-page: #f6f9fc;
  --sc-white: #ffffff;
  --sc-danger: #b42318;
  --sc-success: #157347;
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--sc-page);
  color: var(--sc-ink);
  font-size: 16px;
  line-height: 1.45;
}

.registry-shell button,
.registry-shell input,
.registry-shell select,
.detail-panel button {
  font: inherit;
}

.registry-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.registry-search {
  background: var(--sc-white);
  border: 1px solid var(--sc-line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 12px 34px rgba(15, 53, 93, 0.08);
}

.registry-head,
.results-head,
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.registry-kicker {
  margin: 0 0 6px;
  color: var(--sc-blue-700);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.registry-shell h1,
.registry-shell h2,
.registry-shell h3,
.detail-panel h2,
.detail-panel h3 {
  margin: 0;
  color: var(--sc-blue-900);
  letter-spacing: 0;
}

.registry-shell h1 {
  font-size: 30px;
  line-height: 1.15;
}

.registry-shell h2,
.detail-panel h2 {
  font-size: 20px;
}

.registry-status,
.results-total {
  min-height: 28px;
  color: var(--sc-muted);
  font-size: 14px;
  text-align: right;
}

.search-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.field {
  min-width: 0;
}

.field-wide {
  grid-column: span 2;
}

.field.compact {
  max-width: 160px;
}

.search-form label {
  display: block;
  margin-bottom: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.search-form input,
.search-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c6d4e2;
  border-radius: 6px;
  background: var(--sc-white);
  color: var(--sc-ink);
  padding: 9px 11px;
  outline: none;
}

.search-form input:focus,
.search-form select:focus {
  border-color: var(--sc-blue-600);
  box-shadow: 0 0 0 3px rgba(29, 111, 184, 0.16);
}

.form-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.primary-button,
.secondary-button,
.detail-button,
.icon-button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.primary-button {
  min-height: 44px;
  background: var(--sc-blue-700);
  color: var(--sc-white);
  padding: 10px 18px;
}

.primary-button:hover {
  background: var(--sc-blue-900);
}

.secondary-button,
.detail-button {
  min-height: 44px;
  border: 1px solid #bdd0e4;
  background: #f8fbff;
  color: var(--sc-blue-900);
  padding: 9px 16px;
}

.secondary-button:hover,
.detail-button:hover {
  border-color: var(--sc-blue-600);
  color: var(--sc-blue-700);
}

.icon-button {
  width: 40px;
  height: 40px;
  background: var(--sc-blue-100);
  color: var(--sc-blue-900);
  font-size: 26px;
  line-height: 1;
}

.results-band {
  margin-top: 22px;
}

.empty-state,
.loading-state,
.error-state {
  margin-top: 16px;
  border: 1px solid var(--sc-line);
  border-radius: 8px;
  background: var(--sc-white);
  padding: 20px;
  color: var(--sc-muted);
}

.error-state {
  border-color: #f0b8b3;
  color: var(--sc-danger);
  background: #fff8f7;
}

.results-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.result-card {
  border: 1px solid var(--sc-line);
  border-radius: 8px;
  background: var(--sc-white);
  padding: 18px;
  box-shadow: 0 8px 22px rgba(15, 53, 93, 0.05);
}

.result-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.result-title {
  margin: 4px 0 0;
  font-size: 18px;
}

.result-reg {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 6px;
  background: var(--sc-cyan-100);
  color: #075985;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 800;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.meta-chip {
  border: 1px solid #d3e0ed;
  border-radius: 6px;
  background: #fbfdff;
  color: #31445f;
  padding: 4px 8px;
  font-size: 13px;
}

.snippet,
.address {
  margin: 8px 0 0;
  color: #475569;
  font-size: 14px;
}

.result-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--sc-muted);
  font-size: 14px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}

.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(8, 25, 48, 0.38);
}

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 21;
  width: min(720px, 100%);
  height: 100vh;
  overflow-y: auto;
  background: var(--sc-white);
  border-left: 1px solid var(--sc-line);
  box-shadow: -18px 0 40px rgba(15, 53, 93, 0.18);
  transform: translateX(104%);
  transition: transform 0.2s ease;
}

.detail-panel.open {
  transform: translateX(0);
}

.detail-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--sc-white);
  border-bottom: 1px solid var(--sc-line);
  padding: 20px;
}

.detail-body {
  padding: 20px;
}

.detail-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--sc-line);
}

.detail-section:last-child {
  border-bottom: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

.detail-label {
  color: var(--sc-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-value {
  margin-top: 3px;
  color: var(--sc-ink);
}

.scope-row {
  border: 1px solid var(--sc-line);
  border-radius: 8px;
  padding: 14px;
  margin-top: 10px;
}

.scope-row h3 {
  font-size: 15px;
}

.standard-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.standard-pill {
  border-radius: 6px;
  background: var(--sc-blue-100);
  color: var(--sc-blue-900);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 920px) {
  .search-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-wide {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .registry-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .registry-search {
    padding: 18px;
  }

  .registry-head,
  .results-head,
  .result-top,
  .result-footer {
    display: block;
  }

  .registry-status,
  .results-total {
    margin-top: 8px;
    text-align: left;
  }

  .search-form,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: span 1;
  }

  .form-actions {
    align-items: stretch;
  }

  .form-actions button {
    flex: 1;
  }

  .detail-button {
    width: 100%;
    margin-top: 12px;
  }
}
