:root {
  color-scheme: light dark;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0 auto;
  max-width: 1400px;
  padding: 1rem;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

h1 {
  font-size: 1.4rem;
}

h2 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

button {
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}

.error {
  background: #b00020;
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  margin: 0.5rem 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.card {
  border: 1px solid rgba(128, 128, 128, 0.4);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  opacity: 0.7;
}

.card-value {
  font-size: 1.05rem;
  font-weight: 600;
  word-break: break-all;
}

#content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

#content.with-panel {
  grid-template-columns: minmax(0, 1fr) 480px;
}

@media (max-width: 1000px) {
  #content.with-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

#panel {
  border: 1px solid rgba(128, 128, 128, 0.4);
  border-radius: 6px;
  padding: 0.75rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-head h2 {
  margin: 0;
}

#panel-close {
  border: none;
  background: none;
  font-size: 1.3rem;
  line-height: 1;
}

.panel-bodies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.panel-part h3 {
  font-size: 0.95rem;
  margin: 0.7rem 0 0.3rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5rem 0 1.5rem;
}

th,
td {
  border: 1px solid rgba(128, 128, 128, 0.35);
  padding: 0.35rem 0.5rem;
  text-align: left;
  font-size: 0.9rem;
}

.group-row th {
  text-align: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  opacity: 0.75;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(128, 128, 128, 0.12);
}

tbody tr.selected {
  background: rgba(70, 130, 220, 0.22);
}

th.sep,
td.sep {
  border-left: 2px solid rgba(128, 128, 128, 0.55);
}

pre {
  background: rgba(128, 128, 128, 0.12);
  padding: 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.85rem;
  margin: 0;
}

.panel-part pre {
  max-height: 60vh;
  overflow: auto;
  white-space: pre;
  word-break: normal;
}