/* ELF explorer — a riso-printed field guide to binaries.
 *
 * Flat spot inks on paper, navy ink for all text, overprint (multiply) where
 * layers meet. One family: Recursive (casual for words, mono for bytes).
 */

:root {
  /* paper & ink */
  --paper: #fcfcfa;
  --ink: #1f2a55;
  --ink-soft: #5b6488;
  --rule: #dfe2ec;
  --tint: #eef1fa;
  --on-ink: #1f2a55; /* text printed on top of a coloured ink */
  --blend: multiply;
  --hex-bg: #1f2a55;
  --hex-ink: #e9edfb;
  --mark-2: var(--blue);
  --mark-blend: multiply;
  --highlight: var(--yellow);

  /* riso inks */
  --pink: #ff48b0;
  --blue: #0078bf;
  --yellow: #ffe800;
  --green: #2bc57a;
  --aqua: #5ec8e5;

  /* section kinds */
  --c-ehdr: var(--pink);
  --c-pht: #ff7a3d;
  --c-sht: #a98be0;
  --c-code: var(--green);
  --c-rodata: var(--aqua);
  --c-data: var(--yellow);
  --c-bss: #cfd3df;
  --c-symbols: #ff7b72;
  --c-strings: #b4dd5c;
  --c-reloc: #ffa3cf;
  --c-dynamic: #7f9cf5;
  --c-notes: #9ee6cf;
  --c-init: #d9a3f0;
  --c-debug: #b3bdd2;
  --c-other: #ddd8cb;
  --c-stub: #ffc2df;
  --c-overlay: #bfb9a8;
  --c-resource: #f2b880;
  --c-packed: #ff5c6c;

  --r-sm: 4px;
  --r-md: 10px;
  --r-lg: 18px;

  /* type scale (≈1.25) */
  --t-xs: 0.8rem;
  --t-sm: 0.9rem;
  --t-md: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.56rem;
  --t-2xl: 1.95rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141a31;
    --ink: #eceffa;
    --ink-soft: #a3abcb;
    --rule: #2c3456;
    --tint: #1c2342;
    --blend: normal;
    --hex-bg: #0d1226;
    --hex-ink: #dfe5fb;
    --mark-2: var(--aqua);
    --mark-blend: screen;
    --highlight: color-mix(in srgb, var(--blue) 75%, transparent);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Recursive", system-ui, sans-serif;
  font-variation-settings: "CASL" 0.6, "MONO" 0;
  font-size: var(--t-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 800;
  font-variation-settings: "CASL" 1, "MONO" 0;
  line-height: 1.15;
}

p {
  margin: 0;
}

code,
pre,
.hex {
  font-family: "Recursive", ui-monospace, monospace;
  font-variation-settings: "MONO" 1, "CASL" 0;
  font-size: 0.92em;
}

.soft {
  color: var(--ink-soft);
}

.fine {
  font-size: var(--t-sm);
  color: var(--ink-soft);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 2px;
}

button {
  font: inherit;
  color: inherit;
}

.app {
  min-height: 100vh;
}

/* Wordmark: two inks, out of register -------------------------------- */

.mark {
  position: relative;
  display: inline-block;
  font-weight: 1000;
  font-variation-settings: "CASL" 1, "MONO" 0;
  line-height: 0.85;
  letter-spacing: -0.02em;
}

.mark-ink {
  display: block;
}

.mark-a {
  color: var(--pink);
}

.mark-b {
  position: absolute;
  inset: 0;
  color: var(--mark-2);
  mix-blend-mode: var(--mark-blend);
  transform: translate(0.045em, 0.035em);
}

.mark-small {
  font-size: 1.6rem;
}

.mark-huge {
  font-size: clamp(5rem, 15vw, 11.5rem);
}

/* Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  border-radius: 999px;
  white-space: nowrap;
  transition: transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-within {
  outline: 3px solid var(--pink);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  padding: 14px 26px;
  font-size: var(--t-lg);
  box-shadow: 4px 4px 0 var(--pink);
}

.btn-primary:hover {
  box-shadow: 6px 6px 0 var(--pink);
  transform: translate(-1px, -1px);
}

.btn-quiet {
  border: 2px solid var(--ink);
  padding: 7px 16px;
  font-size: var(--t-sm);
}

.btn-quiet:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Segmented switches */

.switch {
  display: inline-flex;
  flex-wrap: wrap;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.switch-btn {
  border: 0;
  background: transparent;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: var(--t-sm);
  font-weight: 650;
  cursor: pointer;
}

.switch-btn:hover {
  background: var(--tint);
}

.switch-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* Landing ------------------------------------------------------------- */

.landing {
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.landing-mark {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.magic {
  position: relative;
  padding-top: 2.4rem;
}

.magic-pe {
  margin-left: clamp(2rem, 12vw, 9rem);
}

.magic-pe .mark-a {
  color: var(--blue);
}

.magic-pe .mark-b {
  color: var(--yellow);
}

.magic-pe .landing-byte {
  background: var(--pink);
  transform: rotate(3deg);
}

.landing-byte {
  position: absolute;
  top: 0;
  left: 0.3rem;
  font-family: "Recursive", monospace;
  font-variation-settings: "MONO" 1;
  font-weight: 800;
  font-size: var(--t-lg);
  color: var(--ink);
  background: var(--yellow);
  color: var(--on-ink);
  padding: 0 10px;
  border-radius: var(--r-sm);
  transform: rotate(-4deg);
}

.landing-copy {
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.landing-copy h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.lede {
  font-size: var(--t-lg);
  line-height: 1.5;
}

.landing-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.fine code,
.lede code {
  background: var(--tint);
  padding: 1px 6px;
  border-radius: var(--r-sm);
}

.error {
  border-left: 6px solid var(--pink);
  background: var(--tint);
  padding: 12px 16px;
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

.error p {
  margin-top: 2px;
}

@media (max-width: 820px) {
  .landing {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 32px 16px;
    align-content: start;
  }
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--yellow) 82%, transparent);
  border: 10px dashed var(--blue);
}

.drop-text {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 1000;
  font-variation-settings: "CASL" 1;
  color: var(--on-ink);
}

/* Explorer shell ------------------------------------------------------ */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 2px solid var(--ink);
}

.bar-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.bar-title {
  font-weight: 700;
  font-size: var(--t-lg);
  font-variation-settings: "CASL" 1;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

@media (max-width: 600px) {
  .summary-text {
    font-size: var(--t-lg);
  }
  .bar,
  .page {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Summary ------------------------------------------------------------- */

.summary-text {
  font-size: var(--t-xl);
  line-height: 1.4;
  max-width: 46rem;
  font-variation-settings: "CASL" 1;
}

.summary-text .file-name {
  font-weight: 800;
  background: linear-gradient(transparent 58%, var(--highlight) 58%);
  color: inherit;
}

.facts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin: 20px 0 0;
}

.fact dt {
  font-size: var(--t-xs);
  color: var(--ink-soft);
  font-weight: 600;
}

.fact dd {
  margin: 2px 0 0;
  font-weight: 650;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lib {
  background: var(--tint);
  padding: 1px 8px;
  border-radius: var(--r-sm);
  font-weight: 500;
}

/* Section heads */

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: var(--t-2xl);
}

.section-head p {
  margin-top: 4px;
  max-width: 44rem;
}

/* Strip --------------------------------------------------------------- */

.strip {
  position: relative;
  height: 128px;
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--paper);
}

.block {
  position: absolute;
  top: 0;
  bottom: 0;
  margin: 0;
  padding: 10px 6px;
  border: 0;
  border-right: 1px solid var(--paper);
  background: var(--c);
  color: var(--on-ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 2px;
  overflow: hidden;
  text-align: left;
  animation: print 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--delay, 0ms);
  transform-origin: left center;
}

.block:focus-visible {
  outline-offset: -4px;
  outline-color: var(--ink);
  z-index: 4;
}

.block-icon {
  display: inline-flex;
  font-size: 1.3rem;
  line-height: 1;
}

.block-label {
  font-family: "Recursive", monospace;
  font-variation-settings: "MONO" 1, "CASL" 0;
  font-size: var(--t-xs);
  font-weight: 700;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block.k-gap {
  background: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--ink) 22%, transparent) 0 1.5px,
    transparent 1.5px 6px
  );
}

/* Hover/focus: the block lifts out of the strip; the rest dims a little */
.strip:has(.block.hl) .block:not(.hl):not(.sel) {
  filter: saturate(0.35) opacity(0.55);
}

.block.hl {
  z-index: 2;
}

.block.sel {
  z-index: 3;
  box-shadow: inset 0 0 0 3px var(--ink);
}

/* Overprinted segment band */
.band {
  position: absolute;
  top: 0;
  height: 22px;
  pointer-events: none;
  z-index: 5;
  background: var(--c);
  mix-blend-mode: var(--blend);
  border-bottom: 2px solid var(--ink);
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 6px,
    color-mix(in srgb, var(--ink) 30%, transparent) 6px 7px
  );
}

.band.lane-info {
  background-color: var(--ink);
  opacity: 0.4;
}

.strip-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: var(--t-xs);
  color: var(--ink-soft);
}

@keyframes print {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

/* Legend */

.legend {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid transparent;
  background: transparent;
  border-radius: 999px;
  padding: 3px 10px 3px 6px;
  font-size: var(--t-sm);
  cursor: default;
}

.legend-item:hover,
.legend-item.on {
  border-color: var(--ink);
}

/* Swatches carry the ink colour of a kind */

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--c);
  flex-shrink: 0;
  vertical-align: -2px;
}

.swatch-lg {
  width: 18px;
  height: 18px;
}

.swatch.k-gap {
  background: repeating-linear-gradient(-45deg, var(--ink-soft) 0 1.5px, transparent 1.5px 4px);
}

.k-ehdr { --c: var(--c-ehdr); }
.k-pht { --c: var(--c-pht); }
.k-sht { --c: var(--c-sht); }
.k-code { --c: var(--c-code); }
.k-rodata { --c: var(--c-rodata); }
.k-data { --c: var(--c-data); }
.k-bss { --c: var(--c-bss); }
.k-symbols { --c: var(--c-symbols); }
.k-strings { --c: var(--c-strings); }
.k-reloc { --c: var(--c-reloc); }
.k-dynamic { --c: var(--c-dynamic); }
.k-notes { --c: var(--c-notes); }
.k-init { --c: var(--c-init); }
.k-debug { --c: var(--c-debug); }
.k-other { --c: var(--c-other); }
.k-gap { --c: transparent; }
.k-dos { --c: var(--c-ehdr); }
.k-stub { --c: var(--c-stub); }
.k-nt { --c: var(--c-pht); }
.k-overlay { --c: var(--c-overlay); }
.k-resource { --c: var(--c-resource); }
.k-packed { --c: var(--c-packed); }

.lane-x { --c: var(--green); }
.lane-w { --c: var(--yellow); }
.lane-r { --c: var(--aqua); }
.lane-info { --c: transparent; }
.lane-ghost { --c: transparent; }

.swatch.lane-info,
.swatch.lane-ghost {
  border: 1.5px solid var(--ink);
}

.swatch.lane-info,
.ink-key.lane-info {
  background: repeating-linear-gradient(-45deg, var(--ink) 0 1.5px, transparent 1.5px 4px);
}

.swatch.lane-ghost {
  border-style: dashed;
}

/* Lanes --------------------------------------------------------------- */

.lanes {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lanes-head {
  margin-bottom: 10px;
}

.lanes-head h3 {
  font-size: var(--t-lg);
}

.lanes-head p {
  margin-top: 4px;
  max-width: 52rem;
}

.ink-key {
  display: inline-block;
  width: 22px;
  height: 10px;
  border-radius: 3px;
  background: var(--c);
  vertical-align: 1px;
}

.lanes-none {
  margin-top: 24px;
}

.lane {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-radius: var(--r-sm);
}

.lane-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: left;
}

.lane-name {
  font-family: "Recursive", monospace;
  font-variation-settings: "MONO" 1;
  font-size: var(--t-sm);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lane-track {
  position: relative;
  height: 22px;
  border-bottom: 1px dotted var(--rule);
}

.lane-bar {
  position: absolute;
  top: 2px;
  bottom: 2px;
  min-width: 6px;
  background: var(--c);
  border-radius: 3px;
  cursor: pointer;
  mix-blend-mode: var(--blend);
}

.lane-bar.lane-info {
  min-width: 8px;
  border-radius: 2px;
  border: 1.5px solid var(--ink);
  background: repeating-linear-gradient(
    -45deg,
    var(--ink) 0 1.5px,
    transparent 1.5px 4px
  );
  mix-blend-mode: normal;
}

.lane-bar.lane-ghost {
  border: 1.5px dashed var(--ink-soft);
  display: flex;
  align-items: center;
  line-height: 1;
  padding: 0 8px;
  font-size: var(--t-xs);
  color: var(--ink-soft);
  white-space: nowrap;
}

.lane.hl .lane-label,
.lane.sel .lane-label {
  background: var(--tint);
}

.lane.sel .lane-name {
  text-decoration: underline 2px var(--pink);
  text-underline-offset: 3px;
}

.lane.hl .lane-bar,
.lane.sel .lane-bar {
  box-shadow: 0 0 0 2px var(--ink);
}

.perms {
  display: inline-flex;
  gap: 1px;
  font-family: "Recursive", monospace;
  font-variation-settings: "MONO" 1;
  font-size: var(--t-xs);
}

.perm {
  width: 1.3em;
  text-align: center;
  color: var(--ink-soft);
  opacity: 0.6;
}

.perm.on {
  color: var(--ink);
  opacity: 1;
  font-weight: 800;
}

@media (max-width: 600px) {
  .lane {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 6px;
  }
  .lane .perms {
    display: none;
  }
  .strip {
    height: 96px;
  }
}

/* Workspace: map + lists on the left, inspector always in view ------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: 32px;
  align-items: start;
}

.work-main {
  display: flex;
  flex-direction: column;
  gap: 56px;
  min-width: 0;
}

.side {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: var(--r-lg);
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    position: static;
    max-height: none;
  }
}

/* Tabs */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--ink);
  overflow-x: auto;
}

.tab {
  border: 0;
  background: transparent;
  padding: 10px 16px 8px;
  font-size: var(--t-lg);
  font-weight: 800;
  font-variation-settings: "CASL" 1;
  cursor: pointer;
  border-radius: var(--r-md) var(--r-md) 0 0;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink);
}

.tab[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}

.tab-count {
  font-size: var(--t-xs);
  font-weight: 600;
  font-variation-settings: "MONO" 1;
}

.panel-intro {
  margin: 16px 0;
  max-width: 44rem;
}

/* Tables */

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

.sym-wrap {
  max-height: 520px;
  overflow-y: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
}

.table th {
  text-align: left;
  font-weight: 650;
  font-size: var(--t-xs);
  color: var(--ink-soft);
  padding: 6px 10px;
  border-bottom: 1.5px solid var(--ink);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

.table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.table .num {
  text-align: right;
}

.name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row {
  cursor: pointer;
}

.row:hover,
.row.hl {
  background: var(--tint);
}

.row.sel {
  background: var(--tint);
  box-shadow: inset 4px 0 0 var(--pink);
}

.row:focus-visible {
  outline-offset: -3px;
}

.row-static {
  cursor: default;
}

.sym-name code {
  display: inline-block;
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.tag {
  font-size: var(--t-xs);
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
}

.tag-import {
  background: var(--yellow);
  color: var(--on-ink);
}

.sym-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.search {
  flex: 1;
  min-width: 220px;
}

.search input {
  width: 100%;
  font: inherit;
  padding: 9px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
}

.search input:focus-visible {
  outline-offset: 1px;
}

.empty {
  padding: 24px 0;
}

/* Inspector ----------------------------------------------------------- */

.inspector {
  background: var(--tint);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inspector-empty {
  color: var(--ink-soft);
  padding: 40px 24px;
}

.insp-kind {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: var(--t-sm);
  color: var(--ink-soft);
}

.insp-title {
  font-size: var(--t-2xl);
  word-break: break-word;
  font-variation-settings: "CASL" 1, "MONO" 0;
}

.insp-blurb {
  font-size: var(--t-md);
  line-height: 1.55;
}

.where-label {
  font-size: var(--t-xs);
  margin-bottom: 4px;
}

.where-strip {
  position: relative;
  height: 14px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  overflow: hidden;
}

.where-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 3px;
  background: var(--c);
  box-shadow: 0 0 0 1px var(--ink);
}

.where-mark.k-gap,
.where-mark.lane-info,
.where-mark.lane-ghost {
  background: var(--ink);
}

.insp-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 16px;
  margin: 0;
  font-size: var(--t-sm);
}

.insp-facts dt {
  color: var(--ink-soft);
}

.insp-facts dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

.insp-group h3 {
  font-size: var(--t-sm);
  font-weight: 750;
  margin-bottom: 8px;
}

.insp-note {
  font-size: var(--t-sm);
  border-left: 4px solid var(--yellow);
  padding-left: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  border-radius: 999px;
  padding: 3px 10px 3px 6px;
  font-family: "Recursive", monospace;
  font-variation-settings: "MONO" 1;
  font-size: var(--t-xs);
  cursor: pointer;
}

.chip:hover {
  background: var(--ink);
  color: var(--paper);
}

.str {
  background: var(--paper);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  font-size: var(--t-xs);
  word-break: break-all;
}

.hexdump {
  margin: 0;
  background: var(--hex-bg);
  color: var(--hex-ink);
  font-size: 0.78rem;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: var(--r-md);
  overflow-x: auto;
}

/* Motion -------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Format-specific bits ------------------------------------------------ */

.format-tag {
  align-self: center;
  margin-left: 6px;
  font-weight: 800;
  font-size: var(--t-xs);
  font-variation-settings: "MONO" 1;
  background: var(--yellow);
  color: var(--on-ink);
  padding: 1px 8px;
  border-radius: var(--r-sm);
  transform: rotate(-3deg);
}

.protect {
  font-weight: 700;
  font-size: var(--t-sm);
  padding: 0 8px;
  border-radius: 999px;
  border: 1.5px solid var(--ink-soft);
  color: var(--ink-soft);
}

.protect.on {
  border-color: transparent;
  background: var(--green);
  color: var(--on-ink);
}

.lane-aside {
  font-size: var(--t-xs);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.memory {
  margin-top: 32px;
}

.memory .lanes-head {
  margin-bottom: 10px;
}

.strip-memory {
  height: 84px;
}

.strip-memory .block.lane-info {
  background: repeating-linear-gradient(-45deg, var(--ink) 0 1.5px, var(--paper) 1.5px 5px);
}

.where-mark.lane-x,
.where-mark.lane-w,
.where-mark.lane-r {
  box-shadow: 0 0 0 1px var(--ink);
}

.dll-chips {
  margin-bottom: 12px;
}

.dll-chips .chip {
  padding-left: 10px;
}

.dll-chips .chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.chip-count {
  font-size: 0.9em;
  opacity: 0.7;
}

/* Icons (Phosphor bold) --------------------------------------------- */

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -0.14em;
}

/* Tiles: the icon printed on its kind's ink. */
.tile {
  display: inline-grid;
  place-items: center;
  width: 1.55em;
  height: 1.55em;
  border-radius: 6px;
  background: var(--c);
  color: var(--on-ink);
  flex-shrink: 0;
}

.tile .icon {
  width: 1.05em;
  height: 1.05em;
}

.tile-lg {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 10px;
}

.tile-lg .icon {
  width: 1.7rem;
  height: 1.7rem;
}

/* Kinds without an ink of their own: outline tile, ink-coloured icon. */
.tile.k-gap,
.tile.lane-info,
.tile.lane-ghost {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  color: var(--ink);
}

.legend-item {
  gap: 8px;
  padding-left: 3px;
}

.insp-kind {
  gap: 10px;
}

/* Lane labels: a small icon before the name. */
.lane-icon {
  display: inline-flex;
  font-size: 1.1rem;
  color: var(--ink);
}

.lane-label {
  justify-content: flex-start;
}

.lane-label .lane-name {
  flex: 1;
}

.protect {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


/* Memory strip + the rows under it share one grid ---------------------- */

.memory .lane-strip {
  align-items: start;
  margin-bottom: 4px;
}

.strip-label {
  font-weight: 750;
  font-size: var(--t-sm);
  padding: 10px 8px 0;
  font-variation-settings: "CASL" 1;
}

.lanes-under {
  margin-top: 20px;
}

/* Faint continuations of the memory blocks behind each row. */
.lane-col {
  position: absolute;
  top: 0;
  bottom: -5px;
  background: var(--c);
  opacity: 0.16;
  pointer-events: none;
}

.lane-col.lane-info {
  background: transparent;
}

.lanes-under .lane-track {
  border-bottom: 0;
}

.lanes-under .lane-bar {
  z-index: 1;
}

.btn-download {
  align-self: flex-start;
  gap: 8px;
}

.btn-download .icon {
  font-size: 1.1em;
}

/* "Move cursor to" box ------------------------------------------------------------ */

.goto {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 14px;
}

.goto-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 260px;
}

.goto-label {
  font-weight: 750;
  font-variation-settings: "CASL" 1;
  white-space: nowrap;
}

.goto-field input {
  flex: 1;
  font: inherit;
  font-family: "Recursive", monospace;
  font-variation-settings: "MONO" 1;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  min-width: 0;
}

.goto-note {
  flex-basis: 100%;
  margin: 0;
  font-size: var(--t-sm);
}

.goto-note .icon {
  color: var(--pink);
}

/* Pins: flags standing on a strip --------------------------------------- */

.pin {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-left: 2px dotted var(--ink);
  background: transparent;
  z-index: 6;
  cursor: pointer;
}

.pin-flag {
  position: absolute;
  top: 3px;
  left: -1px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 18px;
  border-radius: 0 5px 5px 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
}

.pin-cursor {
  border-left-color: var(--pink);
  border-left-style: dashed;
}

.pin-cursor .pin-flag {
  background: var(--pink);
  color: #fff;
  top: auto;
  bottom: 3px;
}

.pin:hover .pin-flag,
.pin:focus-visible .pin-flag {
  transform: scale(1.15);
}

/* A selected part that isn't a block of this strip */
.band-selected {
  top: auto;
  bottom: 0;
  height: 10px;
  border-bottom: 0;
  border-top: 2px solid var(--ink);
  background-image: none;
}

/* Findings ------------------------------------------------------------- */

.findings h2 {
  font-size: var(--t-lg);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.findings h2 .icon {
  color: var(--pink);
}

.findings ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.finding {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--ink);
  background: var(--paper);
  border-radius: 999px;
  padding: 4px 14px 4px 5px;
  cursor: pointer;
  font-size: var(--t-sm);
  text-align: left;
}

.finding:hover,
.finding.on {
  background: var(--tint);
  box-shadow: 3px 3px 0 var(--pink);
}

/* A small pink notch on blocks that have something worth a look. */
.block.has-finding::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 14px 14px 0;
  border-color: transparent var(--pink) transparent transparent;
}

.insp-finding {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--paper);
  border-left: 4px solid var(--pink);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 10px 12px;
  font-size: var(--t-sm);
}

.insp-finding .icon {
  color: var(--pink);
  font-size: 1.2em;
  margin-top: 1px;
}

.insp-finding p {
  margin-top: 2px;
}

.text-preview {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 0.75rem;
  line-height: 1.5;
}

.table td.wrap {
  white-space: normal;
  word-break: break-word;
}

.protect.half {
  border-color: transparent;
  background: var(--yellow);
  color: var(--on-ink);
}

/* Base address control (uses the "Move cursor to" field styles) -------- */

.rebase {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 4px 0 14px;
}

.rebase-fixed {
  display: block;
  font-size: var(--t-sm);
}
