:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090b0c;
  color: #f1eee6;
  font-synthesis: none;
  --bg: #090b0c;
  --panel: #0e1213;
  --panel-2: #121718;
  --line: #2b3435;
  --line-strong: #556263;
  --muted: #9aa5a4;
  --teal: #62d6c4;
  --amber: #f0b44b;
  --red: #ec624f;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 28px 28px; }
button, input, select, textarea { font: inherit; }

.topbar { min-height: 88px; padding: 18px 24px; border-bottom: 1px solid var(--line-strong); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: center; background: rgba(9,11,12,.96); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: clamp(1.35rem, 2.2vw, 2rem); letter-spacing: -.04em; }
.eyebrow { margin-bottom: 5px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--teal); font-size: .7rem; letter-spacing: .14em; }
.runtime-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.runtime-badges span, .status-badge { border: 1px solid var(--line-strong); padding: 6px 8px; color: var(--teal); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .66rem; letter-spacing: .06em; }

.app-shell { display: grid; grid-template-columns: minmax(250px, 310px) minmax(360px, .9fr) minmax(470px, 1.25fr); min-height: calc(100vh - 129px); }
.app-shell > * { min-width: 0; padding: 20px; border-right: 1px solid var(--line); }
.app-shell > *:last-child { border-right: 0; }
.section-heading { display: flex; gap: 10px; align-items: baseline; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.section-heading span { color: var(--teal); font: 700 .7rem ui-monospace, monospace; }
.section-heading h2 { margin: 0; font: 700 .8rem ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }

.search-rail { background: rgba(9, 12, 13, .92); }
form { display: grid; gap: 8px; }
label { margin-top: 8px; color: var(--muted); font: .73rem ui-monospace, monospace; }
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 0; background: #0a0e0f; color: #f1eee6; padding: 11px 12px; outline: none; }
textarea { resize: vertical; font: .72rem/1.45 ui-monospace, monospace; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
button { margin-top: 10px; min-height: 44px; border: 1px solid var(--teal); border-radius: 0; background: transparent; color: var(--teal); font: 700 .72rem ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
button:hover { background: rgba(98,214,196,.09); }
.form-error { color: var(--red); font-size: .78rem; }
.rail-note { margin-top: 28px; padding: 14px; border: 1px solid var(--line); color: var(--muted); font-size: .78rem; line-height: 1.6; }
.rail-note strong { display: block; color: #f1eee6; margin-bottom: 6px; }
.rail-note p { margin: 0; }
.coverage-note { border-color: rgba(240,180,75,.45); }
.coverage-note strong { color: var(--amber); }
.classification-summary { margin: 0; display: grid; gap: 5px; }
.classification-summary > div { display: flex; justify-content: space-between; gap: 12px; }
.classification-summary dt { margin: 0; overflow-wrap: anywhere; }
.classification-summary dd { color: #f1eee6; font: 700 .78rem ui-monospace, monospace; }
.verification-definition { border-color: rgba(98,214,196,.45); }
.verification-definition strong { color: var(--teal); }

.record-stage { background: rgba(12,15,16,.92); }
.artwork-frame { position: relative; aspect-ratio: 1; max-height: 54vh; border: 1px solid var(--line-strong); display: grid; place-items: center; background: #0b0e0f; overflow: hidden; }
.artwork-frame::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px); background-size: 16px 16px; }
.artwork-frame img { position: relative; width: min(72%, 380px); height: min(72%, 380px); object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 18px 28px rgba(0,0,0,.55)); }
.image-corner { position: absolute; width: 26px; height: 26px; border-color: var(--teal); opacity: .65; }
.top-left { top: 9px; left: 9px; border-top: 1px solid; border-left: 1px solid; }
.bottom-right { bottom: 9px; right: 9px; border-bottom: 1px solid; border-right: 1px solid; }
.record-title-row { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-top: 18px; }
.record-title-row h2 { margin: 0; font-size: clamp(1.3rem, 2vw, 2rem); }
.asset-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.asset-grid > div { min-width: 0; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: .68rem; margin-bottom: 5px; }
dd { margin: 0; font-size: .78rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.break-all { overflow-wrap: anywhere; }

.evidence-panel { background: rgba(10,13,14,.94); }
.evidence-card { border: 1px solid var(--line); margin-bottom: 10px; background: rgba(16,21,22,.86); }
.evidence-card h3 { margin: 0; padding: 9px 11px; border-bottom: 1px solid var(--line); color: var(--teal); font: 700 .72rem ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.evidence-card dl { margin: 0; }
.evidence-card dl > div { display: grid; grid-template-columns: minmax(125px, .42fr) 1fr; gap: 12px; padding: 8px 11px; border-bottom: 1px solid rgba(43,52,53,.65); }
.evidence-card dl > div:last-child { border-bottom: 0; }
.owner-card { border-color: rgba(240,180,75,.6); }
.owner-card h3 { color: var(--amber); }
.owner-card dd { color: var(--amber); }
.lineage-step { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: 9px 11px; border-bottom: 1px solid rgba(43,52,53,.65); }
.lineage-step:last-child { border-bottom: 0; }
.lineage-mark { width: 18px; height: 18px; border: 1px solid var(--teal); display: grid; place-items: center; color: var(--teal); font: .65rem ui-monospace, monospace; }
.lineage-step strong { display: block; font-size: .77rem; margin-bottom: 3px; }
.lineage-step span { color: var(--muted); font: .7rem/1.45 ui-monospace, monospace; overflow-wrap: anywhere; }
.tx-toggle { width: 100%; min-height: 0; margin: 0; padding: 0; border: 0; color: var(--teal); text-align: left; text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
.tx-toggle:hover { background: transparent; text-decoration: underline; }
.tx-toggle:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.tx-text { font: .75rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.transaction-lineage-card dd { min-width: 0; overflow-wrap: anywhere; }
.adapter-card ul { list-style: none; padding: 8px 11px; margin: 0; display: grid; gap: 7px; }
.adapter-card li { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font: .7rem ui-monospace, monospace; }
.adapter-card li span:last-child { color: var(--teal); text-align: right; }

footer { min-height: 41px; border-top: 1px solid var(--line-strong); padding: 11px 20px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font: .68rem ui-monospace, monospace; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 280px 1fr; }
  .evidence-panel { grid-column: 1 / -1; border-top: 1px solid var(--line); }
}

@media (max-width: 680px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 16px; }
  .runtime-badges { justify-content: flex-start; }
  .app-shell { display: block; }
  .app-shell > * { padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .artwork-frame { max-height: none; }
  .asset-grid { grid-template-columns: 1fr; }
  .evidence-card dl > div { grid-template-columns: 1fr; gap: 3px; }
  .record-title-row { flex-direction: column; }
  footer { flex-direction: column; }
}
