/* ============================================================
   PermaIndex — permaweb torrent index
   Dark, dense, professional public-index look (1337x/TPB DNA)
   fused with explicit "this data lives forever on Arweave" trust signals.
   Vanilla CSS, no build step, no external deps.
   ============================================================ */

:root {
  color-scheme: dark;

  /* palette */
  --bg: #0b0f14;
  --bg-2: #0e141b;
  --surface: #141b24;
  --surface-2: #1a232e;
  --surface-3: #202b38;
  --text: #e6edf3;
  --muted: #8b97a7;
  --faint: #5f6b7a;
  --accent: #4f9cf9;
  --accent-2: #38bec9;
  --accent-ink: #06121f;
  --seeders: #3fb950;
  --leechers: #e3a008;
  --dead: #6b7685;
  --danger: #f0616d;

  /* derived rgba */
  --accent-rgb: 79, 156, 249;
  --seeders-rgb: 63, 185, 80;
  --leechers-rgb: 227, 160, 8;
  --danger-rgb: 240, 97, 109;

  --border: #232c38;
  --border-2: #2c3744;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --header-h: 60px;

  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 12px 40px -16px rgba(0,0,0,.7);

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

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1100px 520px at 50% -8%, rgba(var(--accent-rgb), .07), transparent 70%),
    var(--bg);
  display: flex;
  flex-direction: column;
}

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

::selection { background: rgba(var(--accent-rgb), .3); color: #fff; }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .45);
  border-radius: var(--radius-sm);
}

/* Programmatic focus targets (route headings) get a tidy ring but no permanent
   outline, so SR users land on new content without a distracting border. */
[tabindex="-1"]:focus { outline: none; }
[tabindex="-1"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .35);
  border-radius: var(--radius-sm);
}

/* Visually-hidden, still announced by screen readers. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; fill: currentColor; }

/* ===================== Header ===================== */

#header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 20, .82);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease, backdrop-filter .2s ease;
}
#header.scrolled {
  border-bottom-color: var(--border);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  background: rgba(11, 15, 20, .72);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-glyph {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: linear-gradient(160deg, rgba(var(--accent-rgb), .22), rgba(var(--accent-rgb), .06));
  border: 1px solid rgba(var(--accent-rgb), .35);
  font-size: 20px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; }
.brand-sub { font-size: .62rem; text-transform: uppercase; letter-spacing: .18em; color: var(--faint); }

.header-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  padding: 0 14px;
  height: 38px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.header-search[hidden] { display: none; }
.header-search:focus-within {
  border-color: rgba(var(--accent-rgb), .7);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18);
}
.header-search-icon { color: var(--muted); font-size: 16px; flex-shrink: 0; }
.header-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .92rem;
  font-family: inherit;
  min-width: 0;
}
.header-search input::placeholder { color: var(--faint); }

.header-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }

.stat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-size: .8rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stat-chip:hover { text-decoration: none; border-color: var(--border-2); }
.stat-chip-sub { color: var(--muted); }

.arweave-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
}
.arweave-dot:hover { text-decoration: none; color: var(--text); }
.arweave-dot .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--seeders);
  box-shadow: 0 0 0 3px rgba(var(--seeders-rgb), .18);
}

/* ===================== Layout ===================== */

main { flex: 1 0 auto; width: 100%; }

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 18px 40px;
}

footer {
  flex-shrink: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 18px 30px;
  color: var(--faint);
  font-size: .78rem;
  text-align: center;
  line-height: 1.7;
}
footer a { color: var(--muted); }

/* ===================== Buttons ===================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, transform .08s ease, color .15s ease;
}
.btn:hover { border-color: var(--border-2); background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .icon { font-size: 1.05rem; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent), #3a86ee);
  border-color: rgba(var(--accent-rgb), .6);
  color: #06121f;
}
.btn-primary:hover { background: linear-gradient(180deg, #5ba6fb, var(--accent)); border-color: var(--accent); }

.btn-outline { background: transparent; }
.btn-outline:hover { background: rgba(var(--accent-rgb), .08); border-color: rgba(var(--accent-rgb), .5); }

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .4; cursor: not-allowed; pointer-events: none;
}

/* ===================== HOME ===================== */

.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(28px, 9vh, 84px) 4px 8px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--muted);
  background: rgba(var(--accent-rgb), .07);
  border: 1px solid rgba(var(--accent-rgb), .28);
  padding: 6px 13px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.eyebrow .icon { color: var(--accent); font-size: 1rem; }

.hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 14px;
}
.hero .sub {
  color: var(--muted);
  font-size: clamp(.95rem, 2.2vw, 1.06rem);
  margin: 0 auto 30px;
  max-width: 560px;
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 7px 7px 7px 16px;
  box-shadow: var(--shadow);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.searchbar:focus-within {
  border-color: rgba(var(--accent-rgb), .7);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .18), var(--shadow);
}
/* The search containers already show focus via :focus-within, so suppress the
   global :focus-visible ring on the inner input — otherwise it's a doubled glow. */
.searchbar input:focus-visible,
.header-search input:focus-visible { box-shadow: none; }
.searchbar .search-icon { color: var(--muted); font-size: 20px; flex-shrink: 0; }
.searchbar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1.05rem;
  font-family: inherit;
  padding: 12px 0;
  min-width: 0;
}
.searchbar input::placeholder { color: var(--faint); }
.searchbar button {
  flex-shrink: 0;
  padding: 0 22px;
  height: 46px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--accent), #3a86ee);
  color: #06121f;
  font-weight: 700;
  font-size: .98rem;
  font-family: inherit;
  cursor: pointer;
  transition: filter .15s ease, transform .08s ease;
}
.searchbar button:hover { filter: brightness(1.08); }
.searchbar button:active { transform: translateY(1px); }

.examples {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: .85rem;
}
.examples .label { color: var(--faint); }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  min-height: 32px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.chip:hover { color: var(--text); border-color: rgba(var(--accent-rgb), .5); background: var(--surface-2); text-decoration: none; }

/* trust strip */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 880px;
  margin: 44px auto 0;
}
.trust-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.015), transparent),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 118px;
}
.trust-card .tc-icon { color: var(--accent); font-size: 22px; margin-bottom: 4px; }
.trust-card .tc-big {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.trust-card .tc-label { color: var(--muted); font-size: .85rem; }
.trust-card .tc-value-prop { font-size: .92rem; color: var(--text); line-height: 1.45; }

/* ===================== Results view ===================== */

.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.results-head .title { font-size: 1.2rem; font-weight: 700; margin: 0; line-height: 1.3; }
.results-head .title .q { color: var(--accent); }
.results-head .meta { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 4px 12px;
  font-size: .8rem;
}
.legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.legend .item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend .swatch.se { background: var(--seeders); }
.legend .swatch.le { background: var(--leechers); }
.legend .swatch.dead { background: var(--dead); }
.toolbar .sortnote { color: var(--faint); }

/* ===================== TABLE ===================== */

/* NOTE: no `overflow: hidden` here — that would make .table-wrap the scroll
   container and break `position: sticky` on the thead (it would resolve against
   a never-scrolling box). The page itself scrolls, so the sticky header pins
   under the fixed site header. Corner rounding is applied to the edge cells. */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table.torrents {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

table.torrents thead th {
  position: sticky;
  top: var(--header-h);
  z-index: 5;
  background: var(--surface-2);
  color: var(--muted);
  text-transform: uppercase;
  font-size: .68rem;
  letter-spacing: .08em;
  font-weight: 600;
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-2);
  white-space: nowrap;
}
/* Round the table's outer corners via the edge cells, since the wrapper no
   longer clips with overflow:hidden. */
table.torrents thead th:first-child { border-top-left-radius: var(--radius); }
table.torrents thead th:last-child  { border-top-right-radius: var(--radius); }
table.torrents tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
table.torrents tbody tr:last-child td:last-child  { border-bottom-right-radius: var(--radius); }

/* column widths */
.col-type   { width: 40px; text-align: center; padding-left: 14px !important; padding-right: 0 !important; }
.col-name   { width: auto; }
.col-size   { width: 96px;  text-align: right; }
.col-se     { width: 74px;  text-align: right; }
.col-le     { width: 74px;  text-align: right; }
.col-age    { width: 132px; text-align: right; }
.col-magnet { width: 52px;  text-align: center; padding-right: 14px !important; }

table.torrents tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: .9rem;
}
table.torrents tbody tr:last-child td { border-bottom: none; }
table.torrents tbody tr {
  transition: background .12s ease, box-shadow .12s ease;
}
table.torrents tbody tr:nth-child(even) { background: rgba(255, 255, 255, .018); }
table.torrents tbody tr:hover {
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--accent);
}

.cell-type { color: var(--muted); text-align: center; }
.cell-type .icon { font-size: 18px; }

.cell-name { min-width: 0; }
.name-line {
  display: block;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.name-line:hover { color: var(--accent); text-decoration: none; }
.micro {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: .72rem;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--muted);
  background: rgba(var(--accent-rgb), .07);
  border: 1px solid rgba(var(--accent-rgb), .18);
  padding: 1px 7px;
  border-radius: 5px;
}
.uploader-pill { font-family: var(--mono); color: var(--faint); }
.micro .mobile-only-meta { display: none; }

.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: .86rem; white-space: nowrap; }
.cell-size { color: var(--text); }
.cell-size.zero { color: var(--faint); }

.swarm { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.swarm .icon { font-size: 9px; }
.se-on { color: var(--seeders); }
.le-on { color: var(--leechers); }
.swarm-off { color: var(--dead); }

.cell-age { color: var(--muted); }
.age { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; font-family: var(--mono); font-size: .82rem; white-space: nowrap; }
.age .fdot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.fdot.fresh  { background: var(--seeders); }
.fdot.warm   { background: var(--leechers); }
.fdot.cold   { background: var(--danger); }
.fdot.none   { background: transparent; border: 1.5px solid var(--dead); }
.age.no-data { color: var(--faint); font-style: italic; }

.magnet-btn {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  color: var(--accent);
  border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.magnet-btn .icon { font-size: 18px; }
.magnet-btn:hover { background: rgba(var(--accent-rgb), .12); border-color: rgba(var(--accent-rgb), .4); text-decoration: none; }

/* ===================== Pagination ===================== */

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}
.pager .page-label { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.pager .btn { min-height: 38px; padding: 8px 16px; }

/* ===================== States ===================== */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.state {
  text-align: center;
  padding: 54px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}
.state .state-icon { font-size: 40px; color: var(--faint); margin-bottom: 14px; }
.state h3 { margin: 0 0 8px; color: var(--text); font-size: 1.1rem; font-weight: 600; }
.state p { margin: 0 0 16px; color: var(--muted); }
.state.error { border-color: rgba(var(--danger-rgb), .5); background: rgba(var(--danger-rgb), .06); }
.state.error .state-icon, .state.error h3 { color: var(--danger); }
.state .examples { margin-top: 10px; }

/* skeleton shimmer */
.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 6px;
  height: 12px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-row td { padding: 13px 12px; }
.skel.w-name { width: 70%; height: 13px; }
.skel.w-micro { width: 40%; height: 9px; margin-top: 7px; }
.skel.w-num { width: 100%; height: 12px; }

/* ===================== DETAIL ===================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 16px;
}
.back-link:hover { color: var(--text); text-decoration: none; }
.back-link .icon { font-size: 1.05rem; }

.detail-head {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow);
}
.detail-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.detail-title .type-icon {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: rgba(var(--accent-rgb), .1);
  border: 1px solid rgba(var(--accent-rgb), .22);
  font-size: 24px;
}
.detail-title h1 {
  margin: 4px 0 0;
  font-size: clamp(1.25rem, 3.2vw, 1.7rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

.swarm-strip { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; }
.spill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  font-variant-numeric: tabular-nums;
}
.spill.se { color: var(--seeders); border-color: rgba(var(--seeders-rgb), .3); background: rgba(var(--seeders-rgb), .08); }
.spill.le { color: var(--leechers); border-color: rgba(var(--leechers-rgb), .3); background: rgba(var(--leechers-rgb), .08); }
.spill.off { color: var(--dead); }
.spill .icon { font-size: 10px; }
.spill .fdot { width: 8px; height: 8px; border-radius: 50%; }

.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.action-row .btn-primary { flex: 0 0 auto; }

/* permanence banner */
.permabanner {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), .08), rgba(var(--accent-rgb), .03));
  border: 1px solid rgba(var(--accent-rgb), .28);
}
.permabanner .pb-icon { color: var(--accent); font-size: 26px; flex-shrink: 0; }
.permabanner .pb-text { flex: 1; min-width: 0; font-size: .88rem; color: var(--text); line-height: 1.4; }
.permabanner .pb-text .pb-tx {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 4px;
  font-family: var(--mono); font-size: .76rem; color: var(--muted);
}
.copy-mini {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .12s ease, border-color .12s ease;
}
.copy-mini:hover { color: var(--text); border-color: var(--accent); }
.copy-mini .icon { font-size: 14px; }
.copy-mini.copied { color: var(--seeders); border-color: rgba(var(--seeders-rgb), .5); }

/* info panel */
.info-panel { margin-top: 18px; }
.info-panel h2, .file-panel h2 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 600;
}
.info-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.info-grid .k {
  padding: 11px 16px;
  color: var(--muted);
  font-size: .85rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.info-grid .v {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.info-grid .k:last-of-type, .info-grid .v:last-of-type { border-bottom: none; }
.info-grid .mono { font-family: var(--mono); font-size: .84rem; }
.info-grid .v .se-on { color: var(--seeders); font-weight: 600; }
.info-grid .v .le-on { color: var(--leechers); font-weight: 600; }
.info-grid .v .off { color: var(--dead); }
.info-grid .v .exact { color: var(--faint); font-variant-numeric: tabular-nums; }
.info-grid .v .anon { color: var(--faint); font-style: italic; }
.info-grid .v a { overflow-wrap: anywhere; }

/* file panel */
.file-panel { margin-top: 18px; }
.file-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.file-scroll { max-height: 360px; overflow-y: auto; }
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: .82rem;
  border-bottom: 1px solid var(--border);
}
.file-row:last-child { border-bottom: none; }
.file-row:nth-child(even) { background: rgba(255, 255, 255, .018); }
.file-row .fpath {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.file-row .fsize { color: var(--muted); white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.file-total {
  padding: 9px 16px;
  font-size: .78rem;
  color: var(--faint);
  background: var(--surface-2);
  border-top: 1px solid var(--border-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* detail skeletons */
.skel-block { border-radius: var(--radius); }
.skel-line { height: 14px; margin: 10px 0; }

/* ===================== Responsive ===================== */

/* Tablet: keep table, hide SIZE + AGE (folded into name micro-row) */
@media (max-width: 900px) {
  .col-size, .cell-size,
  .col-age, .cell-age { display: none; }
  .micro .mobile-only-meta { display: inline-flex; gap: 10px; }
  .trust-strip { grid-template-columns: 1fr 1fr; }
  .trust-card:last-child { grid-column: 1 / -1; }
}

/* Mobile: collapse table to cards */
@media (max-width: 600px) {
  :root { --header-h: 56px; }

  .header-inner { gap: 10px; padding: 0 12px; }
  .brand-sub { display: none; }
  .stat-chip-sub { display: none; }
  .arweave-dot span:not(.dot) { display: none; }

  .shell { padding: 16px 12px 32px; }

  /* header search becomes a second full-width row on results/detail */
  body.has-header-search .header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
  body.has-header-search .header-search { order: 3; flex: 1 0 100%; max-width: none; }

  .trust-strip { grid-template-columns: 1fr; }
  .trust-card:last-child { grid-column: auto; }

  /* table -> cards */
  table.torrents,
  table.torrents tbody,
  table.torrents tr,
  table.torrents td { display: block; width: 100%; }

  .table-wrap { background: transparent; border: none; box-shadow: none; overflow: visible; }

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

  table.torrents tbody tr {
    background: var(--surface) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 12px 14px 0;
    box-shadow: none !important;
    position: relative;
  }

  table.torrents tbody td {
    border: none;
    padding: 6px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: .9rem;
  }
  table.torrents tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .8rem;
    flex-shrink: 0;
  }

  /* type icon sits inline before the name card-title */
  .cell-type { display: none !important; }

  .cell-name {
    display: block !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid var(--border) !important;
    margin-bottom: 6px;
  }
  .cell-name::before { display: none; }
  .name-line { white-space: normal; font-weight: 600; font-size: .98rem; }
  .micro { white-space: normal; }
  .micro .mobile-only-meta { display: none; }

  .cell-size, .col-size { display: flex !important; }
  .cell-age, .col-age { display: flex !important; }
  .num { font-size: .9rem; }

  .cell-magnet {
    display: block !important;
    margin: 8px -14px 0;
    padding: 0 !important;
    border-top: 1px solid var(--border);
  }
  .cell-magnet::before { display: none; }
  .magnet-btn {
    width: 100%; height: 44px;
    border-radius: 0 0 var(--radius) var(--radius);
    color: var(--accent);
    background: rgba(var(--accent-rgb), .07);
  }
  .magnet-btn::after { content: "Open magnet"; margin-left: 8px; font-size: .9rem; font-weight: 600; }

  .info-grid { grid-template-columns: 1fr; }
  .info-grid .k {
    border-bottom: none;
    padding-bottom: 2px;
    background: transparent;
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .05em;
  }
  .info-grid .v { padding-top: 2px; padding-bottom: 12px; }
  .info-grid .v:last-of-type { border-bottom: none; }

  .action-row .btn { flex: 1 0 100%; }
  .detail-title h1 { font-size: 1.25rem; }
  .pager { gap: 10px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  #header.scrolled { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
