.results-workspace :where(h1, h2, p) {
  margin-block: 0;
}

.result-lookup,
.history-privacy,
.result-history {
  display: grid;
  gap: 0.75rem;
}

.result-lookup label {
  color: var(--navy);
  font-weight: 800;
}

.lookup-controls {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) auto;
  gap: 0.75rem;
}

.lookup-controls input {
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.lookup-controls input[aria-invalid="true"] {
  border-color: var(--error);
}

.lookup-controls button,
.history-heading button,
.history-actions button {
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 0.3rem;
  background: var(--navy);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.lookup-controls button:disabled,
.history-heading button:disabled,
.history-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.help-text {
  color: var(--muted);
}

.field-error {
  min-height: 1.5rem;
  color: var(--error);
  font-weight: 650;
}

.history-privacy {
  padding: 1rem;
  border-left: 0.3rem solid var(--teal);
  background: var(--soft);
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.history-heading button,
.history-actions button {
  min-height: 2.25rem;
  padding: 0.4rem 0.7rem;
}

.history-table-wrap {
  overflow-x: auto;
}

.history-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.history-table-wrap :where(th, td) {
  padding: 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.history-table-wrap code {
  white-space: nowrap;
}

.history-status {
  font-weight: 750;
}

.history-refresh-note {
  display: block;
  color: var(--warning);
  font-size: 0.85rem;
  font-weight: 500;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.history-actions a {
  font-weight: 700;
}

.history-actions button {
  background: transparent;
  color: var(--error);
  text-decoration: underline;
}

#history-storage-status {
  padding: 0.75rem;
  border-left: 0.3rem solid var(--warning);
  background: #fff5dc;
}

@media (max-width: 40rem) {
  .lookup-controls {
    grid-template-columns: 1fr;
  }

  .history-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
