* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #0b1020;
  color: #eef2ff;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px 40px;
  border-bottom: 1px solid #202944;
  background: #0f162b;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  margin: 6px 0 0;
  color: #9aa7c2;
}

.status {
  padding: 8px 14px;
  border-radius: 20px;
  background: #17213b;
  color: #a8f0c6;
  font-size: 14px;
}

.container {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0;
}

.hero {
  margin-bottom: 30px;
}

.hero h2 {
  margin-bottom: 8px;
}

.hero p {
  color: #9aa7c2;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.card {
  padding: 22px;
  border: 1px solid #202944;
  border-radius: 14px;
  background: #111a31;
}

.label {
  display: block;
  color: #8e9bb7;
  font-size: 13px;
  margin-bottom: 10px;
}

.card strong {
  font-size: 28px;
}

.panel {
  margin-bottom: 30px;
  padding: 24px;
  border: 1px solid #202944;
  border-radius: 14px;
  background: #111a31;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.panel h2 {
  margin-top: 0;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  background: #eef2ff;
  color: #0b1020;
  font-weight: 600;
}

input {
  width: min(350px, 100%);
  padding: 11px 13px;
  border: 1px solid #303b58;
  border-radius: 8px;
  background: #0b1020;
  color: #eef2ff;
}

form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
}

th,
td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid #202944;
}

th {
  color: #8e9bb7;
  font-size: 13px;
}

.hash {
  font-family: monospace;
  font-size: 12px;
  color: #aeb9d0;
}

#blocks-loading {
  color: #8e9bb7;
  padding-top: 15px;
}

#block-result {
  margin-top: 20px;
}

.result-grid {
  display: grid;
  gap: 8px;
}

.result-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 15px;
  padding: 10px 0;
  border-bottom: 1px solid #202944;
}

.result-label {
  color: #8e9bb7;
}

.error {
  color: #ff9b9b;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 20px 40px;
  border-top: 1px solid #202944;
  color: #7f8ba5;
  font-size: 13px;
}

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

  .topbar {
    padding: 20px;
  }

  .container {
    width: min(100% - 24px, 1200px);
  }
}

@media (max-width: 500px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .result-row {
    grid-template-columns: 1fr;
  }
}

.explorer-navigation { display:flex; flex-wrap:wrap; gap:1rem; padding:1rem; background:#101a2e; }
.explorer-navigation form { display:flex; gap:.5rem; flex-wrap:wrap; }
.explorer-navigation [aria-current] { font-weight:bold; text-decoration:underline; }
pre { white-space:pre-wrap; overflow-wrap:anywhere; max-width:70vw; }
td,dd { overflow-wrap:anywhere; } dt { font-weight:bold; margin-top:1rem; } dd { margin:0; }
#pagination { margin-top:1rem; } input { max-width:100%; box-sizing:border-box; }
@media(max-width:600px) { .container { padding:12px; } .explorer-navigation { gap:.65rem; } }

/* Shared shell: headings stay in normal flow; wide decoded data scrolls locally. */
a { color:#a8ceff; text-underline-offset:3px; }
a:hover { color:#fff; }
:focus-visible { outline:3px solid #a8f0c6; outline-offset:3px; }
button:disabled { opacity:.5; cursor:default; }
[hidden] { display:none !important; }
.container,.panel,#content { min-width:0; }
h1,h2,h3 { overflow-wrap:anywhere; padding-inline:2px; }
.topbar { flex-wrap:wrap; }
.table-wrapper { max-width:100%; }
td { vertical-align:top; max-width:28rem; min-width:7rem; }
td pre { width:24rem; max-width:100%; }
pre { margin:0; padding:.75rem; background:#0b1020; border-radius:6px; }
summary { cursor:pointer; white-space:nowrap; }
#pagination { display:flex; flex-wrap:wrap; align-items:center; gap:1rem; }
#coverage,#scope { color:#b6c2da; line-height:1.6; }
#search-form label { flex-basis:100%; }
@media(max-width:600px) { .panel { padding:16px; } .topbar h1 { font-size:23px; } }

/* ME-04 core interactions */
.explorer-navigation > a,.breadcrumbs a { display:inline-flex; align-items:center; min-height:44px; }
button,input,select,summary { min-height:44px; }
select { background:#0b1020; color:#eef2ff; border:1px solid #b6c2da; padding:10px; max-width:100%; }
.copy-control { display:block; margin-top:8px; }
.breadcrumbs { overflow-wrap:anywhere; margin-bottom:16px; }
.breadcrumbs a,.filters a { margin-right:12px; }
.filters label { display:flex; flex-direction:column; gap:6px; max-width:100%; }
.skip-link { position:absolute; left:8px; top:-100px; padding:12px; background:#0b1020; z-index:10; }
.skip-link:focus { top:8px; }
#interaction-status { min-height:1.5em; }
#content nav { display:flex; flex-wrap:wrap; gap:16px; margin-block:16px; }

/* Core views: readable summaries with explicitly expandable record evidence. */
.topbar { padding:20px 32px; }
.explorer-navigation { padding:12px 32px; gap:4px 20px; border-bottom:1px solid #303b58; }
.explorer-navigation form { margin-left:auto; align-items:center; }
.container { padding:24px 0; }
#coverage { padding:16px 20px; border:1px solid #303b58; border-radius:10px; background:#0f162b; font-size:14px; }
#status { font-size:14px; color:#b6c2da; }
.entity-details { display:grid; grid-template-columns:minmax(150px,1fr) minmax(0,3fr); gap:0 24px; margin:20px 0; }
.entity-details dt,.entity-details dd { margin:0; padding:12px 0; border-bottom:1px solid #303b58; }
.entity-details dt { color:#b6c2da; font-size:14px; }
.record-evidence { margin:20px 0; padding:12px 16px; border:1px solid #303b58; border-radius:8px; }
.record-evidence summary { display:flex; align-items:center; }
.table-wrapper { border:1px solid #303b58; border-radius:8px; margin:16px 0; }
table { margin-top:0; font-size:14px; }
th { white-space:nowrap; background:#0f162b; }
td { min-width:5rem; max-width:20rem; }
td > a { display:block; max-width:15rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
td .copy-control { font-size:12px; padding:8px 10px; }
pre { max-width:100%; font-size:13px; line-height:1.5; }
#content > h3 { margin-top:28px; }
.filters { padding:16px; margin:16px 0; background:#0f162b; border-radius:8px; align-items:flex-end; }
@media(max-width:600px) {
 .topbar,.explorer-navigation { padding:16px; }
 .explorer-navigation form { margin-left:0; flex-basis:100%; }
 .entity-details { grid-template-columns:minmax(0,1fr); gap:0; }
 .entity-details dt { border-bottom:0; padding-bottom:4px; }
 .entity-details dd { padding-top:0; padding-bottom:16px; }
 #coverage { padding:12px; }
 td > a { max-width:12rem; }
}
#content > a { display:inline-flex; align-items:center; min-height:44px; margin:4px 16px 4px 0; }
.breadcrumbs [aria-current] { overflow-wrap:normal; }
