/* ==========================================================================
   LocalConverter — design system + application shell
   Dark-first. Light theme is a token override, not a separate stylesheet.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Surfaces, from deepest to most raised */
  --bg: #0b0d11;
  --surface-1: #12151b;
  --surface-2: #171b22;
  --surface-3: #1e232c;
  --surface-inset: #0d1014;

  /* Lines */
  --border: #242a34;
  --border-strong: #323a47;
  --border-subtle: #1b2027;

  /* Text */
  --text: #e7eaf0;
  --text-secondary: #9ba5b4;
  --text-muted: #6d7684;
  --text-inverse: #0b0d11;

  /* One accent for interaction; semantic colours are reserved for meaning. */
  --accent: #5b9cf8;
  --accent-hover: #7db2fa;
  --accent-dim: rgba(91, 156, 248, 0.14);
  --accent-line: rgba(91, 156, 248, 0.38);

  --ok: #3fb950;
  --ok-dim: rgba(63, 185, 80, 0.13);
  --warn: #d6a232;
  --warn-dim: rgba(214, 162, 50, 0.13);
  --danger: #f06a5f;
  --danger-dim: rgba(240, 106, 95, 0.13);
  --info: #58a6ff;
  --info-dim: rgba(88, 166, 255, 0.13);

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius-sm: 5px;
  --radius: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);

  --header-height: 56px;
  --max-width: 1440px;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f6f7f9;
  --surface-1: #ffffff;
  --surface-2: #fbfcfd;
  --surface-3: #f0f2f5;
  --surface-inset: #f4f6f8;

  --border: #dde1e7;
  --border-strong: #c3cad4;
  --border-subtle: #e8ebef;

  --text: #12161c;
  --text-secondary: #515b68;
  --text-muted: #77818f;
  --text-inverse: #ffffff;

  --accent: #1f6feb;
  --accent-hover: #1856b8;
  --accent-dim: rgba(31, 111, 235, 0.09);
  --accent-line: rgba(31, 111, 235, 0.3);

  --ok: #1a7f37;
  --ok-dim: rgba(26, 127, 55, 0.1);
  --warn: #9a6700;
  --warn-dim: rgba(154, 103, 0, 0.1);
  --danger: #cf222e;
  --danger-dim: rgba(207, 34, 46, 0.09);
  --info: #0969da;
  --info-dim: rgba(9, 105, 218, 0.09);

  --shadow-sm: 0 1px 2px rgba(16, 22, 30, 0.06);
  --shadow: 0 4px 14px rgba(16, 22, 30, 0.08);
  --shadow-lg: 0 12px 28px rgba(16, 22, 30, 0.12);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -0.011em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

code, kbd, pre, .mono { font-family: var(--font-mono); font-size: 0.92em; }

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

::selection { background: var(--accent-dim); color: var(--text); }

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

/* Custom scrollbars keep dense panes from looking noisy. */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: content-box; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15px; letter-spacing: -0.02em; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(140deg, var(--accent), #8b5cf6);
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.brand-sub { color: var(--text-muted); font-weight: 400; font-size: 12px; }

.header-spacer { flex: 1; }

/* Tool navigation — also the site's internal linking between landing pages. */
.tool-nav { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tool-nav::-webkit-scrollbar { display: none; }
.tool-nav-link {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 550;
  color: var(--text-muted);
  white-space: nowrap;
}
.tool-nav-link:hover { color: var(--text); background: var(--surface-3); text-decoration: none; }
.tool-nav-link.is-current { color: var(--accent); background: var(--accent-dim); }

.header-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--ok-dim); color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 26%, transparent);
  font-size: 12px; font-weight: 550;
}
.header-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 13px;
  font: inherit; font-size: 13.5px; font-weight: 550;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: color-mix(in srgb, var(--surface-3) 70%, var(--border-strong)); border-color: var(--text-muted); }
.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); border-color: transparent; }

.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn-icon { padding: 6px; width: 30px; height: 30px; }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.app-main { max-width: var(--max-width); margin: 0 auto; padding: 28px 20px 40px; }

.app-intro { margin-bottom: 22px; }
.app-intro h1 { font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -0.026em; margin-bottom: 8px; }
.app-intro p { color: var(--text-secondary); font-size: 15.5px; max-width: 74ch; }

/* --------------------------------------------------------------------------
   Drop zone
   -------------------------------------------------------------------------- */

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 38px 24px;
  text-align: center;
  background:
    radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--accent) 5%, transparent), transparent 62%),
    var(--surface-1);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover { border-color: var(--accent-line); }
.dropzone.is-dragover {
  border-color: var(--accent);
  border-style: solid;
  background: radial-gradient(120% 140% at 50% 0%, var(--accent-dim), transparent 65%), var(--surface-1);
}
.dropzone-icon { font-size: 30px; line-height: 1; margin-bottom: 6px; opacity: 0.85; }
.dropzone-title { font-size: 16px; font-weight: 600; }
.dropzone-hint { color: var(--text-muted); font-size: 13px; }
.dropzone-formats { color: var(--text-muted); font-size: 12px; margin-top: 8px; max-width: 62ch; }
.dropzone input[type="file"] { display: none; }

.dropzone-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }

/* Compact state: once files are loaded the results matter more than the
   invitation to add more, so the zone collapses to a single row. */
.dropzone.is-compact {
  grid-template-columns: auto 1fr auto;
  grid-auto-flow: column;
  justify-items: start;
  place-items: center;
  gap: 12px;
  padding: 12px 18px;
  text-align: left;
}
.dropzone.is-compact .dropzone-icon { font-size: 20px; margin: 0; }
.dropzone.is-compact .dropzone-title { font-size: 14px; }
.dropzone.is-compact .dropzone-hint,
.dropzone.is-compact .dropzone-formats { display: none; }
.dropzone.is-compact .dropzone-actions { margin: 0; }

@media (max-width: 620px) {
  .dropzone.is-compact { grid-auto-flow: row; grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .dropzone.is-compact .dropzone-icon { display: none; }
}

/* --------------------------------------------------------------------------
   Workspace
   -------------------------------------------------------------------------- */

.workspace { display: none; margin-top: 22px; }
.workspace.is-active { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }

.file-rail {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-height) + 16px);
  max-height: calc(100vh - var(--header-height) - 34px);
  display: flex;
  flex-direction: column;
}

.rail-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.rail-title { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.055em; color: var(--text-muted); }
.rail-count {
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  background: var(--surface-3); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 999px;
}
.rail-list { overflow-y: auto; flex: 1; padding: 6px; }

.rail-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s ease;
}
.rail-item:hover { background: var(--surface-3); }
.rail-item.is-selected { background: var(--accent-dim); border-color: var(--accent-line); }
.rail-item + .rail-item { margin-top: 2px; }

.rail-item-icon { font-size: 17px; text-align: center; line-height: 1; }
.rail-item-body { min-width: 0; }
.rail-item-name {
  font-size: 13px; font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rail-item-meta {
  font-size: 11.5px; color: var(--text-muted);
  font-family: var(--font-mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rail-item-remove {
  opacity: 0; border: 0; background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 4px; border-radius: 4px;
}
.rail-item:hover .rail-item-remove, .rail-item.is-selected .rail-item-remove { opacity: 1; }
.rail-item-remove:hover { color: var(--danger); background: var(--danger-dim); }

/* Thin progress line under a file that is still being scanned. */
.rail-item-progress { grid-column: 1 / -1; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 2px; }
.rail-item-progress span { display: block; height: 100%; background: var(--accent); transition: width 0.15s ease; }

.rail-foot { padding: 8px; border-top: 1px solid var(--border); background: var(--surface-2); display: flex; gap: 6px; }

/* --------------------------------------------------------------------------
   Detail pane + tabs
   -------------------------------------------------------------------------- */

.detail { min-width: 0; }

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  padding: 9px 13px;
  font: inherit; font-size: 13.5px; font-weight: 550;
  color: var(--text-muted);
  background: none; border: 0; border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: color 0.12s ease;
}
.tab:hover:not(:disabled) { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.tab:disabled { opacity: 0.4; cursor: not-allowed; }
.tab-soon {
  margin-left: 6px; font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); background: var(--surface-3);
  border: 1px solid var(--border); border-radius: 3px; padding: 1px 4px;
  vertical-align: 1px;
}

.pane { display: none; }
.pane.is-active { display: block; animation: pane-in 0.16s ease; }
@keyframes pane-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.card-title { font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
.card-head .header-spacer { flex: 1; }
.card-body { padding: 15px; }
.card-body.is-flush { padding: 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.card-grid > .card { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Key/value data rows — the workhorse for inspection output
   -------------------------------------------------------------------------- */

.kv { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); }
.kv > dt, .kv > dd {
  padding: 7px 15px;
  margin: 0;
  border-top: 1px solid var(--border-subtle);
  min-width: 0;
}
.kv > dt:first-of-type, .kv > dt:first-of-type + dd { border-top: 0; }
.kv > dt { color: var(--text-muted); font-size: 12.5px; font-weight: 500; }
.kv > dd { font-size: 13.5px; overflow-wrap: anywhere; }
.kv > dd.mono { font-family: var(--font-mono); font-size: 12.5px; }
.kv-row:hover { background: var(--surface-2); }

.value-muted { color: var(--text-muted); }
.value-strong { font-weight: 600; }

/* Click-to-copy affordance on hashes and other long values */
.copyable {
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 100%;
  cursor: pointer;
  border: 0; background: none; padding: 0;
  color: inherit; font: inherit; text-align: left;
}
.copyable .copy-text { overflow-wrap: anywhere; }
.copyable .copy-icon {
  flex-shrink: 0; opacity: 0; transition: opacity 0.12s ease;
  color: var(--text-muted); font-size: 11px;
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px;
}
.copyable:hover .copy-icon, .copyable:focus-visible .copy-icon { opacity: 1; }
.copyable.is-copied .copy-icon { opacity: 1; color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }

/* --------------------------------------------------------------------------
   Status pills and banners
   -------------------------------------------------------------------------- */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill-ok { background: var(--ok-dim); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 26%, transparent); }
.pill-warn { background: var(--warn-dim); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 26%, transparent); }
.pill-danger { background: var(--danger-dim); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 26%, transparent); }
.pill-info { background: var(--info-dim); color: var(--info); border-color: color-mix(in srgb, var(--info) 26%, transparent); }
.pill-neutral { background: var(--surface-3); color: var(--text-secondary); border-color: var(--border); }

.banner {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.banner-icon { font-size: 17px; line-height: 1.3; flex-shrink: 0; }
.banner-title { font-weight: 620; font-size: 14px; margin-bottom: 2px; }
.banner-detail { color: var(--text-secondary); font-size: 13px; }
.banner-ok { background: var(--ok-dim); border-color: color-mix(in srgb, var(--ok) 24%, transparent); }
.banner-ok .banner-title { color: var(--ok); }
.banner-warn { background: var(--warn-dim); border-color: color-mix(in srgb, var(--warn) 24%, transparent); }
.banner-warn .banner-title { color: var(--warn); }
.banner-danger { background: var(--danger-dim); border-color: color-mix(in srgb, var(--danger) 24%, transparent); }
.banner-danger .banner-title { color: var(--danger); }

/* --------------------------------------------------------------------------
   Validation checklist
   -------------------------------------------------------------------------- */

.checks { list-style: none; margin: 0; padding: 0; }
.checks li {
  display: grid; grid-template-columns: 18px minmax(90px, auto) minmax(0, 1fr);
  gap: 10px; align-items: baseline;
  padding: 8px 15px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
}
.checks li:first-child { border-top: 0; }
.check-mark { font-size: 12px; text-align: center; }
.check-ok .check-mark { color: var(--ok); }
.check-fail .check-mark { color: var(--danger); }
.check-warn .check-mark { color: var(--warn); }
.check-unknown .check-mark { color: var(--text-muted); }
.check-name { color: var(--text-secondary); font-weight: 550; }
.check-detail { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Entropy visualisation
   -------------------------------------------------------------------------- */

.entropy-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.entropy-value { font-family: var(--font-mono); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.entropy-unit { color: var(--text-muted); font-size: 13px; }
.entropy-verdict { margin-left: auto; }

/* Scale reference: 0 = uniform, 8 = indistinguishable from random */
.entropy-scale { position: relative; height: 7px; border-radius: 4px; margin: 14px 0 6px; background: linear-gradient(90deg, #3fb950 0%, #d6a232 55%, #f06a5f 100%); opacity: 0.85; }
.entropy-needle {
  position: absolute; top: -4px; width: 2px; height: 15px;
  background: var(--text); border-radius: 1px;
  box-shadow: 0 0 0 2px var(--surface-1);
  transition: left 0.3s ease;
}
.entropy-ticks { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); }

.sparkline { display: block; width: 100%; height: 74px; background: var(--surface-inset); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
.sparkline-caption { color: var(--text-muted); font-size: 11.5px; margin-top: 7px; }

.histogram { display: block; width: 100%; height: 108px; background: var(--surface-inset); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }

/* --------------------------------------------------------------------------
   Hex viewer
   -------------------------------------------------------------------------- */

.hex-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.hex-input {
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 5px 9px; width: 130px;
  color: var(--text); background: var(--surface-inset);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.hex-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.hex-status { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }

.hex-scroll { height: 420px; overflow-y: auto; background: var(--surface-inset); position: relative; }
.hex-sizer { position: relative; width: 100%; }
.hex-rows { position: absolute; top: 0; left: 0; right: 0; font-family: var(--font-mono); font-size: 12.5px; line-height: 20px; }

.hex-row { display: flex; gap: 16px; padding: 0 12px; white-space: pre; height: 20px; }
.hex-row:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.hex-offset { color: var(--text-muted); flex-shrink: 0; user-select: none; }
.hex-bytes { color: var(--text); flex-shrink: 0; }
.hex-ascii { color: var(--text-secondary); flex-shrink: 0; }

/* Bytes belonging to the detected file signature */
.hex-sig { color: var(--accent); font-weight: 700; background: var(--accent-dim); border-radius: 2px; }
.hex-null { color: var(--text-muted); opacity: 0.5; }
.hex-match { background: var(--warn-dim); color: var(--warn); font-weight: 700; border-radius: 2px; }

.hex-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; color: var(--text-muted); }
.hex-legend span { display: inline-flex; align-items: center; gap: 5px; }
.hex-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; font-style: normal; }

/* --------------------------------------------------------------------------
   Annotated header
   -------------------------------------------------------------------------- */

.annotations { list-style: none; margin: 0; padding: 0; }
.annotation {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 9px 15px;
  border-top: 1px solid var(--border-subtle);
  align-items: start;
}
.annotation:first-child { border-top: 0; }
.annotation-offset { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); padding-top: 1px; }
.annotation-name { font-size: 13px; font-weight: 600; margin-bottom: 1px; }
.annotation-value { font-family: var(--font-mono); font-size: 12px; color: var(--accent); overflow-wrap: anywhere; }
.annotation-note { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* --------------------------------------------------------------------------
   Empty / loading states
   -------------------------------------------------------------------------- */

.empty-state { text-align: center; padding: 54px 24px; color: var(--text-muted); }
.empty-state-icon { font-size: 34px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.empty-state p { font-size: 13.5px; max-width: 46ch; margin: 0 auto; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.3s ease-in-out infinite;
  border-radius: 4px;
  color: transparent !important;
  display: inline-block;
  min-width: 90px;
}
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.scan-progress { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-muted); }
.scan-bar { flex: 1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; max-width: 190px; }
.scan-bar span { display: block; height: 100%; background: var(--accent); transition: width 0.15s ease; }

/* --------------------------------------------------------------------------
   Hash verification
   -------------------------------------------------------------------------- */

.verify {
  padding: 15px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.verify-label { display: block; font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 9px; }
.verify-row { display: flex; gap: 8px; }
.verify-input {
  flex: 1; min-width: 0;
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 8px 11px;
  color: var(--text);
  background: var(--surface-inset);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.verify-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.verify-input.is-match { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok-dim); }
.verify-input.is-mismatch { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-dim); }
.verify-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 7px; }
.verify-result { margin-top: 12px; }
.verify-diff { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; grid-template-columns: 84px minmax(0, 1fr); }
.verify-diff > dt, .verify-diff > dd { padding: 5px 10px; font-size: 12px; }

/* --------------------------------------------------------------------------
   Reference tables (file signature list)
   -------------------------------------------------------------------------- */

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 9px 13px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}
.data-table td { padding: 7px 13px; border-top: 1px solid var(--border-subtle); vertical-align: top; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table td.mono { font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Prose lists used in landing page copy
   -------------------------------------------------------------------------- */

.prose-list, .steps-list { margin: 0 0 16px; padding-left: 22px; color: var(--text-secondary); font-size: 14px; }
.prose-list li, .steps-list li { margin-bottom: 8px; }
.prose-list strong, .steps-list strong { color: var(--text); }

.section code {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast-host {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 9px 15px; font-size: 13px; font-weight: 550;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.18s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.2s ease; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  .workspace.is-active { grid-template-columns: 1fr; }
  .file-rail { position: static; max-height: 320px; }
}

/* The header cannot hold the brand, six tool links and the controls at this
   width. The footer navigation covers the same links on small screens. */
@media (max-width: 900px) {
  .tool-nav { display: none; }
}

@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .app-main { padding: 20px 14px 32px; }
  .app-header { padding: 0 14px; gap: 10px; }
  .brand-sub { display: none; }
  .dropzone { padding: 28px 16px; }
  .kv { grid-template-columns: 1fr; }
  .kv > dt { padding-bottom: 0; border-top: 1px solid var(--border-subtle); }
  .kv > dd { padding-top: 2px; border-top: 0; }
  .kv > dt:first-of-type + dd { border-top: 0; }
  .checks li { grid-template-columns: 18px 1fr; }
  .check-detail { grid-column: 2; }
  .hex-scroll { height: 320px; font-size: 11px; }
  .hex-row { gap: 10px; padding: 0 8px; }
  .annotation { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .app-header, .dropzone, .file-rail, .tabs, .toast-host, .rail-foot { display: none !important; }
  .workspace.is-active { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; }
  .card { break-inside: avoid; border-color: #ccc; }
}
