:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #18201f;
  background: #f1f4f1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

main {
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: 64px 0;
}

header {
  margin-bottom: 28px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: -0.05em;
}

h2 {
  margin-bottom: 0;
}

.eyebrow {
  margin-bottom: 6px;
  color: #24705f;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro,
#status {
  color: #5e6865;
}

form,
#result,
.debug-panel,
.date-search {
  border: 1px solid #d9dfdc;
  border-radius: 14px;
  background: white;
  box-shadow: 0 12px 40px rgb(24 32 31 / 6%);
}

form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
  padding: 20px;
}

label {
  display: grid;
  gap: 7px;
  color: #46504d;
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
button {
  min-height: 44px;
  border-radius: 8px;
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid #cbd3d0;
  padding: 0 12px;
  background: #fbfcfb;
}

input:focus,
select:focus {
  outline: 3px solid rgb(36 112 95 / 14%);
  border-color: #24705f;
}

button {
  border: 0;
  padding: 0 18px;
  color: white;
  background: #24705f;
  font-weight: 750;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

button.secondary {
  min-height: 36px;
  color: #24705f;
  background: #eaf3f0;
  font-size: 0.82rem;
}

#status {
  min-height: 24px;
  margin: 16px 4px;
}

#status.success {
  color: #24705f;
}

#status.error {
  color: #a33a35;
}

.debug-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px;
}

.date-search {
  margin-bottom: 18px;
  padding: 20px;
}

.date-search > div:first-child {
  margin-bottom: 16px;
}

.date-search form {
  grid-template-columns: 1fr 1fr auto;
  padding: 0;
  border: 0;
  box-shadow: none;
}

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

#date-search-status {
  min-height: 24px;
  margin: 0;
  color: #69736f;
}

#date-search-status.success {
  color: #24705f;
}

#date-search-status.error {
  color: #a33a35;
}

.table-wrapper {
  margin-top: 8px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  border-bottom: 1px solid #e3e7e5;
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #69736f;
  font-size: 0.72rem;
  text-transform: uppercase;
}

td:nth-child(2) {
  width: 100%;
  white-space: normal;
}

.debug-panel p {
  margin-bottom: 0;
  color: #69736f;
}

.debug-panel dl {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.debug-panel dl div {
  border-radius: 9px;
  padding: 12px;
  background: #f4f7f5;
}

.debug-panel dt {
  margin-bottom: 5px;
  color: #69736f;
  font-size: 0.72rem;
}

.debug-panel dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 700;
}

.debug-panel .error {
  grid-column: 1 / -1;
  margin: 0;
  color: #a33a35;
}

#result {
  overflow: hidden;
}

#summary,
.json-heading {
  padding: 22px;
}

.title-row,
.json-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.id {
  border-radius: 999px;
  padding: 6px 10px;
  color: #53605c;
  background: #eef1ef;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.facts div {
  border-radius: 9px;
  padding: 12px;
  background: #f4f7f5;
}

.facts span,
.facts strong {
  display: block;
}

.facts span {
  margin-bottom: 4px;
  color: #69736f;
  font-size: 0.72rem;
}

.json-heading {
  border-top: 1px solid #e3e7e5;
  border-bottom: 1px solid #e3e7e5;
}

pre {
  max-height: 65vh;
  margin: 0;
  overflow: auto;
  padding: 22px;
  color: #d8ebe5;
  background: #18201f;
  font-size: 0.8rem;
  line-height: 1.55;
}

@media (max-width: 720px) {
  main {
    padding: 32px 0;
  }

  form {
    grid-template-columns: 1fr;
  }

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

  .search-result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .debug-panel,
  .debug-panel dl {
    grid-template-columns: 1fr;
  }

  .facts {
    grid-template-columns: repeat(2, 1fr);
  }
}
