:root {
  color-scheme: dark;
  --navy: #071423;
  --panel: #102b3f;
  --panel-deep: #0b2031;
  --aqua: #3ddad8;
  --white: #ffffff;
  --muted: #d1d9e0;
  --muted-strong: #9fb0bd;
  --line: rgba(209, 217, 224, 0.18);
  --danger: #ffaaa5;
  --radius: 0.75rem;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  background: var(--navy);
  color: var(--white);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--navy);
  color: var(--white);
}

.sign-out-form {
  position: absolute;
  right: 0;
}

.sign-out-form button {
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  padding: 0.45rem 0;
}

.sign-out-form button:hover,
.sign-out-form button:focus-visible {
  color: var(--aqua);
}

.login-shell {
  align-items: center;
  display: flex;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  margin: 0 auto;
  max-width: 31rem;
  padding: clamp(1.5rem, 5vw, 2.5rem);
  width: 100%;
}

.login-card-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
}

.login-card-header .prototype-badge {
  white-space: nowrap;
}

.login-card h1 {
  color: var(--white);
  font-family: Montserrat, Inter, ui-sans-serif, sans-serif;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  margin: 2rem 0 0.75rem;
}

.login-card > p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.google-sign-in {
  align-items: center;
  background: var(--aqua);
  border-radius: 0.65rem;
  color: var(--navy);
  display: flex;
  font-weight: 700;
  justify-content: center;
  margin-top: 1.75rem;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
}

.google-sign-in:hover,
.google-sign-in:focus-visible {
  background: #80efed;
}

.login-card .login-error {
  background: rgba(255, 170, 165, 0.08);
  border: 1px solid rgba(255, 170, 165, 0.35);
  border-radius: 0.65rem;
  color: var(--danger);
  margin-top: 1rem;
  padding: 0.75rem;
}

button,
input {
  font: inherit;
}

button,
summary,
input[type='checkbox'] {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--aqua);
  outline-offset: 3px;
}

.page-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

.hero {
  max-width: 1160px;
  margin: 0 auto;
  text-align: center;
}

.brand-lockup {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-align: left;
  text-decoration: none;
}

.prototype-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand img {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.brand strong,
h2,
.section-summary strong {
  font-family: Montserrat, Inter, ui-sans-serif, system-ui, sans-serif;
}

.brand strong {
  font-size: 1.45rem;
  letter-spacing: 0.01em;
}

.brand small {
  color: var(--muted-strong);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.search-form {
  position: relative;
  text-align: left;
}

.search-form > label {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 26px;
  color: var(--muted);
  font-size: 0.78rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.search-row {
  display: flex;
  min-height: 96px;
  align-items: end;
  gap: 14px;
  padding: 26px 18px 18px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: rgba(16, 43, 63, 0.88);
  box-shadow: var(--shadow);
}

.search-row:focus-within {
  border-color: rgba(61, 218, 216, 0.65);
}

#address {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: transparent;
  color: var(--white);
  font-size: 1rem;
}

#address::placeholder {
  color: #8195a4;
}

#address:focus {
  border-color: rgba(61, 218, 216, 0.65);
  outline: 0;
}

#go {
  position: relative;
  min-width: 154px;
  border: 0;
  border-radius: 8px;
  padding: 15px 18px;
  background: var(--aqua);
  color: #04151d;
  font-weight: 750;
  transition:
    transform 150ms ease,
    background 150ms ease;
}

#go:hover:not(:disabled) {
  background: #68e6e3;
  transform: translateY(-1px);
}

#go:disabled {
  cursor: wait;
  opacity: 0.78;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.feedback {
  min-height: 28px;
  margin: 24px auto 0;
  color: var(--muted-strong);
  text-align: center;
}

.feedback p {
  margin: 0;
}

.feedback[data-state='error'] {
  color: var(--danger);
}

.feedback[data-state='success'] {
  height: 0;
  min-height: 0;
  margin-top: 0;
  overflow: hidden;
}

.results {
  margin-top: 24px;
}

.property-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.property-heading h2 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.55rem);
  letter-spacing: -0.035em;
  line-height: 1.16;
}

.property-summary {
  margin: 10px 0 0;
  color: var(--muted-strong);
  line-height: 1.5;
}

.raw-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.82rem;
}

.raw-toggle input {
  width: 17px;
  height: 17px;
  accent-color: var(--aqua);
}

.notices {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.notice {
  margin: 0;
  border-left: 3px solid var(--aqua);
  padding: 12px 15px;
  border-radius: 0 8px 8px 0;
  background: rgba(61, 218, 216, 0.08);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.continuation-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.continuation-notice p {
  margin: 0;
}

.resume-button {
  flex: 0 0 auto;
  border: 1px solid rgba(61, 218, 216, 0.48);
  border-radius: 8px;
  padding: 9px 12px;
  background: transparent;
  color: var(--aqua);
  font-size: 0.78rem;
  font-weight: 700;
}

.resume-button:hover:not(:disabled) {
  background: rgba(61, 218, 216, 0.1);
}

.resume-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.section-list {
  display: grid;
  gap: 12px;
}

.data-section,
.record-details {
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 43, 63, 0.76);
}

.section-summary,
.record-details > summary {
  min-height: 68px;
  padding: 18px 22px;
  user-select: none;
}

.section-summary {
  display: list-item;
  padding-left: 26px;
}

.section-summary strong {
  margin-left: 10px;
}

.section-summary strong {
  font-size: 1rem;
}

.count {
  float: right;
  min-width: 29px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--muted-strong);
  font-size: 0.74rem;
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

th:nth-child(1) {
  width: 31%;
}

th:nth-child(2) {
  width: 29%;
}

th:nth-child(3) {
  width: 25%;
}

th:nth-child(4) {
  width: 15%;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.field-label {
  display: block;
  color: var(--white);
  font-weight: 650;
  line-height: 1.35;
}

.field-meaning {
  display: block;
  margin-top: 4px;
  color: var(--muted-strong);
  font-size: 0.77rem;
  line-height: 1.45;
}

.raw-key {
  display: none;
  margin-top: 7px;
  color: var(--aqua);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.show-raw-keys .raw-key {
  display: block;
}

.value-cell {
  color: var(--white);
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.source-cell,
.date-cell {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.source-line {
  display: block;
}

.source-line + .source-line {
  margin-top: 5px;
}

.source-line a {
  color: var(--aqua);
  text-underline-offset: 3px;
}

.disclosure-content {
  padding: 4px 18px 20px;
}

.metadata-tree {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.metadata-pair {
  display: grid;
  grid-template-columns: minmax(130px, 0.28fr) minmax(0, 1fr);
  gap: 14px;
}

.metadata-pair dt {
  color: var(--muted-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.metadata-pair dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.nested-metadata {
  margin-top: 4px;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.nested-metadata > summary {
  padding: 4px 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.empty-section {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 18px 22px;
  color: var(--muted-strong);
  font-size: 0.86rem;
}

.record-details {
  margin-top: 18px;
  background: rgba(11, 32, 49, 0.7);
}

.record-details > summary {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.metadata-scope {
  margin: 0 0 18px;
  color: var(--muted-strong);
  font-size: 0.78rem;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 28px, 1160px);
    padding-top: 24px;
  }

  .brand-lockup {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .sign-out-form {
    margin-left: auto;
    position: static;
  }

  .search-row {
    display: grid;
    padding-top: 34px;
  }

  #go {
    width: 100%;
  }

  .results {
    margin-top: 24px;
  }

  .property-heading {
    align-items: start;
    flex-direction: column;
    gap: 18px;
  }

  .continuation-notice {
    align-items: flex-start;
    flex-direction: column;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .fact-row {
    display: grid;
    grid-template-columns: 1fr;
    padding: 5px 0;
    border-bottom: 1px solid var(--line);
  }

  .fact-row td {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    border: 0;
    padding: 9px 16px;
  }

  .fact-row td::before {
    color: var(--muted-strong);
    content: attr(data-label);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .metadata-pair {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
