/* =========================================================================
   TorrentSearch.xyz — single stylesheet
   Mobile-first; min-width media queries only.
   Sections:
     1.  Reset
     2.  Tokens
     3.  Base elements
     4.  Container & layout
     5.  Breadcrumbs
     6.  Page header
     7.  Site header & navigation
     8.  Site footer
     9.  Forms & buttons
     10. Loading & skeletons
     11. Home page (hero, search form, info)
     12. Category grid (browse, top)
     13. Torrent list (search)
     14. Pagination
     15. Detail page
     16. Article pages (about, contact, proxy-info)
     17. Utilities & motion
   ========================================================================= */

/* 1. Reset ----------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
  scrollbar-gutter: stable;
  color-scheme: dark;
}

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

@supports not (scrollbar-gutter: stable) {
  html {
    overflow-y: scroll;
  }
}

body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
dt,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* 2. Tokens ---------------------------------------------------------------- */
:root {
  /* Zinc palette */
  --color-zinc-100: oklch(96.7% 0.001 286.375);
  --color-zinc-200: oklch(92% 0.004 286.32);
  --color-zinc-300: oklch(87.1% 0.006 286.286);
  --color-zinc-400: oklch(70.5% 0.015 286.067);
  --color-zinc-500: oklch(55.2% 0.016 285.938);
  --color-zinc-600: oklch(44.2% 0.017 285.786);
  --color-zinc-700: #3f3f46;
  --color-zinc-800: oklch(27.4% 0.006 286.033);
  --color-zinc-900: oklch(21% 0.006 285.885);
  --color-zinc-950: oklch(14.1% 0.005 285.823);

  /* Violet accent */
  --color-violet-200: #e4d6ef;
  --color-violet-300: #ceb2df;
  --color-violet-400: #a978c4;
  --color-violet-500: #7a2f92;
  --color-violet-600: #5a1770;

  /* Semantic */
  --canvas: var(--color-zinc-950);
  --surface: var(--color-zinc-900);
  --surface-2: var(--color-zinc-800);
  --fill: var(--color-zinc-800);
  --fill-hover: var(--color-zinc-700);
  --border: var(--color-zinc-800);
  --border-strong: var(--color-zinc-700);

  --text: var(--color-zinc-100);
  --text-muted: color-mix(
    in oklab,
    var(--color-zinc-400) 55%,
    var(--color-zinc-300)
  );
  --text-subtle: var(--color-zinc-500);

  --link: var(--color-zinc-300);
  --link-hover: var(--color-violet-400);

  --accent: var(--color-violet-600);
  --accent-hover: var(--color-violet-500);
  --accent-soft: var(--color-violet-300);
  --on-accent: #ffffff;

  --seed: #22c55e;
  --leech: #ef4444;
  --torrent-link: var(--color-violet-400);
  --torrent-link-hover: var(--color-violet-300);
  --torrent-meta: #999999;
  --torrent-border: #1f2937;
  --table-header-bg: color-mix(
    in srgb,
    var(--canvas) 72%,
    var(--color-zinc-800)
  );
  --row-stripe: color-mix(in srgb, var(--color-zinc-100) 2%, transparent);

  --scrollbar-track: var(--surface);
  --scrollbar-thumb: var(--color-zinc-700);
  --scrollbar-thumb-hover: var(--color-zinc-600);

  /* Sizing */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --header-h: 3.75rem; /* 60px — mobile bar */
  --header-control-h: 2.5rem; /* 40px — mobile controls */
  --container: 96rem;

  /* Spacing scale */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 2.5rem;
  --space-3xl: 3rem;
  --space-4xl: 4rem;

  /* Fluid type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 0.9375rem;
  --text-md: 1rem;
  --text-lg: 1.0625rem;
  --text-xl: clamp(1.125rem, 1rem + 0.6vw, 1.25rem);
  --text-2xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-3xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
  --text-4xl: clamp(1.875rem, 1.5rem + 1.75vw, 2.75rem);

  --font: "Inter", "Inter Fallback", system-ui, -apple-system, sans-serif;
}

html[data-theme="light"] {
  /* Paper neutrals — warm, slightly dimmer than zinc-100 */
  --color-paper-50: oklch(98% 0.008 85);
  --color-paper-100: oklch(96% 0.012 85);
  --color-paper-200: oklch(93% 0.014 85);
  --color-paper-800: oklch(32% 0.02 285);
  --color-paper-900: oklch(24% 0.018 285);

  --canvas: var(--color-paper-100);
  --surface: var(--color-paper-50);
  --surface-2: var(--color-paper-100);
  --fill: var(--color-paper-200);
  --fill-hover: var(--color-zinc-300);
  --border: color-mix(in oklab, var(--text) 10%, transparent);
  --border-strong: color-mix(in oklab, var(--text) 18%, transparent);

  --text: var(--color-paper-900);
  --text-muted: var(--color-zinc-500);
  --text-subtle: var(--color-zinc-400);

  --link: var(--color-zinc-700);
  --link-hover: var(--color-violet-600);

  --accent-soft: var(--color-violet-600);

  --row-stripe: color-mix(in srgb, var(--text) 3%, transparent);

  --torrent-link: var(--color-violet-600);
  --torrent-link-hover: var(--color-violet-500);
  --torrent-meta: var(--color-paper-800);
  --torrent-border: color-mix(in oklab, var(--text) 12%, transparent);
  --table-header-bg: color-mix(in srgb, var(--fill) 85%, var(--color-paper-800));

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);

  --scrollbar-track: var(--fill);
  --scrollbar-thumb: var(--color-paper-800);
  --scrollbar-thumb-hover: var(--color-zinc-700);
}

html,
.mobile-nav-panel,
.detail-description,
.file-list ol {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.torrent-table-scroll {
  scrollbar-width: auto;
  scrollbar-color: auto;
}

*::-webkit-scrollbar:horizontal {
  height: 0;
  display: none;
}

*::-webkit-scrollbar:vertical {
  width: 10px;
}

*::-webkit-scrollbar-track:vertical {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb:vertical {
  background: var(--scrollbar-thumb);
  border: 2px solid var(--scrollbar-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:vertical:hover {
  background: var(--scrollbar-thumb-hover);
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: optional;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.06%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

/* 3. Base elements --------------------------------------------------------- */
body {
  font-family: var(--font);
  font-size: var(--text-base);
  background: var(--canvas);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
}

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

/* 4. Container & layout ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: calc(var(--space-md) * 1.5);
}

@media (min-width: 40rem) {
  .container {
    padding-inline: var(--space-lg);
  }
}

@media (min-width: 64rem) {
  .container {
    padding-inline: var(--space-xl);
  }
}

main {
  flex: 1;
  padding-top: calc(var(--space-md) * 1.5);
  padding-bottom: var(--space-2xl);
}

@media (min-width: 40rem) {
  main {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-3xl);
  }
}

@media (min-width: 64rem) {
  main {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-3xl);
  }
}

main.container > * + *:not(script):not(.page-header) {
  margin-top: var(--space-lg);
}

@media (min-width: 64rem) {
  main.container > * + *:not(script):not(.page-header) {
    margin-top: var(--space-xl);
  }
}

/* 5. Breadcrumbs ----------------------------------------------------------- */
.breadcrumbs {
  padding-top: 0;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  list-style: none;
  font-size: var(--text-sm);
  line-height: 1.4;
  overflow: hidden;
}

.breadcrumb-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.breadcrumb-list li:not(:last-child) {
  flex-shrink: 0;
}

.breadcrumb-list li:last-child {
  flex: 1 1 auto;
  overflow: hidden;
}

.breadcrumb-list li:not(:last-child)::after {
  content: "/";
  color: var(--text-muted);
}

.breadcrumb-list a {
  color: var(--link-hover);
}

.breadcrumb-list a:hover {
  color: var(--accent-soft);
}

.breadcrumb-list [aria-current="page"] {
  display: block;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumbs ~ .page-header {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
}

/* 6. Page header ----------------------------------------------------------- */
.page-header {
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
  min-height: 1.2em;
}

.page-title a {
  color: inherit;
}
.page-title a:hover {
  color: var(--link-hover);
}

.page-subtitle {
  margin-top: calc(var(--space-xs) * 2);
  font-size: var(--text-md);
  color: var(--text-muted);
  font-weight: 400;
}

.page-search .page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.page-search .page-title {
  flex: 1 1 auto;
  min-width: 0;
}

.page-header + * {
  margin-top: var(--space-xl) !important;
}

/* 7. Site header & navigation --------------------------------------------- */
.site-header-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-md);
  isolation: isolate;
}

.site-header-wrap::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  background: color-mix(in oklab, var(--surface) 85%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 40rem) {
  .site-header-wrap {
    padding-inline: var(--space-lg);
  }
}

@media (min-width: 64rem) {
  .site-header-wrap {
    padding-inline: var(--space-xl);
  }
}

.site-header {
  background: transparent;
}

.header-container {
  width: 100%;
}

.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
  color: var(--text);
}

.logo:hover {
  color: var(--text);
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 1px;
  background: var(--fill);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 42%;
  transform: scale(1.18);
  transform-origin: center 42%;
}

.logo-text {
  font-weight: 700;
  font-size: calc(var(--text-md) + 2px);
  letter-spacing: -0.02em;
}

.nav-toggle-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: var(--header-control-h);
  height: var(--header-control-h);
  margin: 0;
  cursor: pointer;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: background 0.15s ease;
}

.nav-toggle-label:hover {
  background: var(--fill);
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.nav-toggle:checked
  ~ .site-header
  .nav-toggle-label
  .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle:checked
  ~ .site-header
  .nav-toggle-label
  .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle:checked
  ~ .site-header
  .nav-toggle-label
  .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav-backdrop {
  display: block;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  width: 100%;
  padding: 0;
  border: 0;
  background: color-mix(in srgb, var(--canvas) 72%, transparent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.nav-toggle:checked ~ .mobile-nav-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body:has(#nav-toggle:checked) {
  overflow: hidden;
}

.mobile-nav-panel {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 102;
  flex-direction: column;
  gap: var(--space-md);
  height: calc(100dvh - var(--header-h));
  padding: var(--space-lg);
  background: var(--surface);
  overflow-y: auto;
}

.nav-toggle:checked ~ .mobile-nav-panel {
  display: flex;
}

.site-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--header-control-h);
  padding: 0 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: var(--text-sm);
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--fill);
}

.nav-link.active {
  color: var(--accent-soft);
  background: var(--fill);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--header-control-h);
  height: var(--header-control-h);
  margin-top: auto;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--fill);
  border-color: var(--border-strong);
}

.theme-icon {
  width: 1.25rem;
  height: 1.25rem;
}

html[data-theme="dark"] .theme-icon-moon,
html[data-theme="light"] .theme-icon-sun {
  display: none !important;
}

.header-search {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: var(--header-control-h);
  background: var(--canvas);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.header-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

.header-search input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 0.75rem;
  font-size: var(--text-sm);
  line-height: 1;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.header-search input[type="search"]::placeholder {
  color: var(--text-subtle);
}

.header-search-submit {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--header-control-h);
  height: var(--header-control-h);
  padding: 0;
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--on-accent) 12%, var(--accent));
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.header-search-submit:hover {
  background: var(--accent-hover);
}

.header-search-icon {
  width: 1.125rem;
  height: 1.125rem;
}

/* Desktop header at 60rem (960px) */
@media (min-width: 60rem) {
  :root {
    --header-h: 4.5rem; /* 72px */
    --header-control-h: 2.625rem; /* 42px */
  }

  .site-header-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    min-height: var(--header-h);
  }

  .site-header {
    flex-shrink: 0;
  }

  .header-inner {
    min-height: var(--header-h);
  }

  .nav-toggle-label,
  .mobile-nav-backdrop {
    display: none !important;
  }

  .mobile-nav-panel {
    display: flex !important;
    position: static;
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
    height: auto;
    padding: 0;
    background: transparent;
    overflow: visible;
  }

  .header-search {
    order: 2;
    max-width: 280px;
    flex: 0 1 280px;
  }

  .site-nav {
    order: 1;
    flex-direction: row;
    align-items: center;
    margin-left: auto;
    gap: var(--space-md);
  }

  .nav-link {
    display: inline-flex;
    align-items: center;
    height: var(--header-control-h);
    padding-block: 0;
    padding-inline: 0.75rem;
    line-height: 1;
  }

  .header-search {
    min-height: var(--header-control-h);
    height: var(--header-control-h);
  }

  .header-search input[type="search"] {
    padding-block: 0;
    padding-inline: 0.75rem;
  }

  .header-search-submit {
    width: var(--header-control-h);
    height: var(--header-control-h);
  }

  .theme-toggle {
    order: 3;
    margin-top: 0;
    align-self: center;
    width: var(--header-control-h);
    height: var(--header-control-h);
  }
}

/* 8. Site footer ----------------------------------------------------------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-top,
.footer-donate-band,
.footer-bar-band {
  width: 100%;
}

.footer-top {
  padding-block: var(--space-2xl);
}

.footer-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

.footer-brand {
  max-width: none;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  color: var(--text);
}

.footer-logo:hover {
  color: var(--text);
}

.footer-logo:hover .footer-logo-mark {
  background: var(--fill-hover);
}

.footer-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 3px;
  background: var(--fill);
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.footer-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footer-logo-text {
  font-weight: 700;
  font-size: var(--text-md);
  letter-spacing: -0.02em;
}

.footer-about {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-muted);
}

.footer-col-title {
  margin-bottom: var(--space-md);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.footer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-nav-list a {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.footer-nav-list a:hover {
  color: var(--link-hover);
}

.footer-donate-band {
  padding-block: var(--space-md);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

.footer-donate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm) var(--space-md);
  width: 100%;
  text-align: center;
}

.footer-donate-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  margin-inline-end: calc(var(--space-xs) - var(--space-md));
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-soft);
  background: color-mix(in srgb, var(--accent-soft) 12%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent-soft) 28%, var(--border));
  border-radius: var(--radius-sm);
}

.footer-donate-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.footer-donate-field {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 32rem;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

.footer-donate-field-body {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  align-items: center;
  padding: 0.625rem 0.75rem;
}

.footer-donate-address {
  min-width: 0;
  width: 100%;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--text-sm);
  line-height: 1;
  text-align: left;
  color: var(--text);
  user-select: all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-donate-copy {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.5rem 1rem;
  border: none;
  border-left: 1px solid var(--border-strong);
  border-radius: 0;
  background: var(--canvas);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.footer-donate-copy:hover {
  background: var(--fill);
}

.footer-donate-copy.is-copied {
  color: var(--accent-soft);
}

@media (min-width: 40rem) {
  .footer-donate-field {
    width: auto;
  }

  .footer-donate-address {
    overflow: visible;
    white-space: normal;
    word-break: break-all;
  }
}

.footer-bar-band {
  padding-block: var(--space-lg);
  border-top: 1px solid var(--border);
}

.footer-bar-text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

.footer-bar-text a {
  color: var(--text-muted);
}

.footer-bar-text a:hover {
  color: var(--link-hover);
}

.footer-bar-sep {
  margin-inline: 0.35em;
  color: var(--text-faint);
}

@media (min-width: 40rem) {
  .footer-columns {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl) var(--space-3xl);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (min-width: 64rem) {
  .footer-columns {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.75fr) minmax(0, 0.75fr);
    align-items: start;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-donate {
    flex-wrap: nowrap;
    gap: var(--space-md) var(--space-lg);
  }
}

/* 9. Forms & buttons ------------------------------------------------------- */
input[type="search"],
input[type="text"],
input[type="email"],
select,
textarea {
  background: var(--canvas);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-subtle);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
  white-space: nowrap;
  min-height: 44px;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.btn-secondary {
  background: var(--fill);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--fill-hover);
  color: var(--text);
}

.btn-sm {
  padding: 0.5rem 1rem;
  min-height: 38px;
}

.btn-magnet {
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--text-md);
  padding: 0.75rem 1.5rem;
}

.btn-magnet-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.btn-magnet:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

/* Noscript */
.noscript-banner {
  background: var(--fill);
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  font-size: var(--text-sm);
}

/* 10. Loading & skeletons ------------------------------------------------- */
.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--canvas) 70%, transparent);
  color: var(--text-muted);
  font-size: var(--text-sm);
  border-radius: inherit;
  pointer-events: none;
}

.loading-overlay[hidden] {
  display: none;
}

.detail-error,
.torrent-empty {
  padding: var(--space-xl);
  color: var(--text-muted);
  text-align: center;
  list-style: none;
}

.torrent-empty p {
  margin: 0;
}

.skeleton-line,
.skeleton-bar {
  display: block;
  height: 0.875rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--fill) 0%,
    var(--fill-hover) 50%,
    var(--fill) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-line-short {
  width: 55%;
}

.skeleton-bar {
  width: 100%;
  height: 1rem;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.torrent-row-skeleton {
  pointer-events: none;
}

.torrent-row-skeleton .skeleton-bar {
  grid-column: 1 / -1;
}

.category-card-skeleton {
  pointer-events: none;
}

.category-card-skeleton .skeleton-line {
  width: 70%;
}

.category-card-skeleton .category-links .skeleton-line {
  width: 100%;
}

/* 11. Home page ------------------------------------------------------------ */
.page-home main.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: calc(100dvh - var(--header-h) - var(--space-3xl));
  padding-block: var(--space-2xl) var(--space-3xl);
}

.page-home main.container > * + * {
  margin-top: var(--space-2xl);
}

.page-home main.container > .info-section {
  margin-top: calc(var(--space-2xl) + var(--space-md));
}

.hero-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: calc(var(--space-xl) * 0.5);
  padding-block: var(--space-md) 0;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.hero-visual {
  flex-shrink: 0;
}

.hero-mascot {
  width: auto;
  height: auto;
  max-height: 13rem;
  max-width: 21rem;
  margin-inline: auto;
}

.hero-text {
  text-align: center;
  max-width: 36rem;
}

.hero-title {
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.hero-subtitle {
  margin-top: var(--space-md);
  font-size: var(--text-md);
  color: var(--text-muted);
  line-height: 1.5;
}

@media (min-width: 48rem) {
  .page-home main.container {
    padding-block: var(--space-3xl) var(--space-4xl);
  }
  .page-home main.container > * + * {
    margin-top: var(--space-3xl);
  }
  .page-home main.container > .info-section {
    margin-top: calc(var(--space-3xl) + var(--space-lg));
  }
  .hero-section {
    padding-block: var(--space-2xl) 0;
    gap: calc(var(--space-xl) * 0.5);
  }
  .hero-content {
    gap: var(--space-xl);
  }
  .hero-mascot {
    max-height: 17rem;
    max-width: 26rem;
  }
  .hero-subtitle {
    font-size: var(--text-lg);
  }
}

/* Search form */
.page-home .search-form {
  width: 100%;
  max-width: 48rem;
  margin-inline: auto;
}

.page-search .search-form {
  width: 100%;
  max-width: 42rem;
  margin-bottom: var(--space-xl);
}

.page-search .search-filters {
  justify-content: flex-start;
}

.page-search .search-bar,
.search-bar--compact {
  margin-bottom: var(--space-md);
}

.page-search .search-bar .search-input,
.search-bar--compact .search-input {
  min-height: 2.5rem;
  padding: 0.625rem 0.875rem;
  font-size: var(--text-base);
}

.page-search .search-bar .btn-search,
.search-bar--compact .btn-search {
  min-height: 2.5rem;
  padding: 0.625rem 1rem;
  font-size: var(--text-base);
}

@media (min-width: 40rem) {
  .page-search .search-bar .search-input,
  .search-bar--compact .search-input,
  .page-search .search-bar .btn-search,
  .search-bar--compact .btn-search {
    padding-block: 0.625rem;
  }

  .page-search .search-bar .search-input,
  .search-bar--compact .search-input {
    padding-inline: 0.875rem;
  }

  .page-search .search-bar .btn-search,
  .search-bar--compact .btn-search {
    padding-inline: 1rem;
  }
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.search-bar .search-input {
  flex: 1 1 100%;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.9375rem 1rem;
  font-size: var(--text-md);
  background: var(--fill);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.search-bar .search-input::placeholder {
  color: var(--text-subtle);
}

.search-bar .search-input:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.btn-search,
.btn-lucky {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  padding: 0.9375rem 1rem;
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  min-height: 3.25rem;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.btn-search {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-search:hover {
  background: var(--accent-hover);
}

.btn-lucky {
  background: var(--fill);
  color: var(--text-muted);
  font-weight: 500;
}

.btn-lucky:hover {
  background: var(--fill-hover);
  color: var(--text);
}

.search-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.875rem;
}

@media (min-width: 40rem) {
  .search-bar {
    flex-wrap: nowrap;
    align-items: stretch;
  }

  .search-bar .search-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    padding: 0.875rem 1rem;
  }

  .btn-search,
  .btn-lucky {
    flex: 0 0 auto;
    padding: 0.875rem 1.25rem;
  }

  .search-filters {
    gap: 0.75rem 1.25rem;
  }
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.filter input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex-shrink: 0;
  border: 1.5px solid rgb(255 255 255 / 0.65);
  border-radius: 0.2rem;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.filter input[type="checkbox"]:checked {
  background: #fff;
  border-color: #fff;
}

.filter input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.1rem;
  width: 0.3rem;
  height: 0.55rem;
  border: solid var(--color-zinc-950);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

html[data-theme="light"] .filter input[type="checkbox"] {
  border-color: color-mix(in oklab, var(--text) 40%, transparent);
}

html[data-theme="light"] .filter input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

html[data-theme="light"] .filter input[type="checkbox"]:checked::after {
  border-color: var(--on-accent);
}

.filter input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filter:hover {
  color: var(--text);
}

/* Home info section */
.info-section {
  width: 100%;
  max-width: 52rem;
  margin-inline: auto;
  padding: var(--space-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

@media (min-width: 48rem) {
  .info-section {
    padding: var(--space-3xl);
  }
}

.info-content h2 {
  margin-bottom: var(--space-md);
  font-size: var(--text-2xl);
  color: var(--text);
}

.info-content p {
  margin-inline: auto;
  margin-bottom: var(--space-lg);
  color: var(--text-muted);
  line-height: 1.7;
}

.info-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

@media (min-width: 40rem) {
  .info-links {
    flex-direction: row;
    gap: var(--space-xl);
  }
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  color: var(--accent-soft);
  font-weight: 600;
}

.link-arrow:hover {
  color: var(--color-violet-200);
}

/* 12. Category grid (browse, top) ----------------------------------------- */
.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.category-grid.is-loading {
  min-height: 32rem;
}

main.container > .page-header + .category-grid {
  margin-top: var(--space-xl) !important;
}

@media (min-width: 48rem) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.category-card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.category-card-header h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.category-card-header h2 > a:first-child {
  color: var(--accent-soft);
}

.category-card-header h2 > a:first-child:hover {
  color: var(--color-violet-200);
}

.category-links {
  list-style: none;
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  align-items: stretch;
}

@media (min-width: 30rem) {
  .category-links {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  }
}

.category-links li {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  overflow: hidden;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.category-links li:hover {
  border-color: var(--border-strong);
  background: var(--fill);
}

.category-pill {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0.625rem 0.875rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  background: transparent;
  text-align: left;
  line-height: 1.4;
}

.category-links li > .category-pill:only-child {
  align-self: stretch;
}

.category-pill:hover {
  color: var(--text);
}

.category-pill-48h {
  flex: 0 0 auto;
  width: auto;
  min-width: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding: 0 0.55rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--fill);
  border-left: 1px solid var(--border);
}

.category-pill-48h:hover {
  color: var(--text);
  background: var(--fill-hover);
}

.category-card-header h2 .category-pill-48h {
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  text-transform: none;
  letter-spacing: normal;
  font-size: var(--text-xs);
}

.top-highlight {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

/* 13. Torrent list (search) ------------------------------------------------ */
.page-search .search-toolbar {
  flex: 0 0 auto;
  margin-left: auto;
}

.page-search .search-toolbar input#flist {
  width: min(100%, 30rem);
  min-width: 20rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  font-size: var(--text-sm);
  background: var(--fill);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
}

.page-search .search-toolbar input#flist:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

@media (max-width: 39.9375rem) {
  .page-search .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-search .page-title {
    flex: none;
    width: 100%;
  }

  .page-search .search-toolbar {
    flex: none;
    width: 100%;
    margin-left: 0;
  }

  .page-search .search-toolbar input#flist {
    width: 100%;
    min-width: 0;
  }
}

.torrent-table-wrap {
  position: relative;
  background: var(--canvas);
  border: 1px solid var(--torrent-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.torrent-table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.torrent-table-scroll-hint {
  margin: 0 0 0.5rem;
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

main:has(.torrent-table-wrap.is-empty) .torrent-table-scroll-hint {
  display: none !important;
}

.torrent-table-wrap.is-empty .torrent-table-header {
  display: none !important;
}

.torrent-table {
  list-style: none;
  min-width: 0;
}

.torrent-table-header,
.torrent-row {
  --cols: 5rem minmax(14rem, 32rem) 4.75rem 3.75rem 2.25rem 2.25rem 5rem;
  display: grid;
  grid-template-columns: var(--cols);
  gap: 0 0.65rem;
  box-sizing: border-box;
  width: max-content;
  min-width: 100%;
}

.torrent-table-header {
  padding: 0.625rem var(--space-md);
  background: var(--table-header-bg);
  border-bottom: 1px solid var(--torrent-border);
  font-size: var(--text-xs);
}

.torrent-table-header .list-item {
  white-space: nowrap;
}

.torrent-row {
  padding: var(--space-md);
  border-bottom: 1px solid var(--torrent-border);
  align-items: center;
}

.torrent-row:last-child {
  border-bottom: none;
}
.torrent-row:nth-child(even) {
  background: var(--row-stripe);
}

.torrent-row .list-item {
  display: block;
  min-width: 0;
}

.torrent-row .item-name a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--torrent-link-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.torrent-row .item-name a:hover {
  color: var(--torrent-link);
}

.torrent-row .item-type .category-parent,
.torrent-row .item-type .category-sep {
  display: none;
}

.torrent-row .item-type,
.torrent-row .item-uploaded,
.torrent-row .item-size,
.torrent-row .item-user {
  font-size: var(--text-xs);
  color: var(--torrent-meta);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.torrent-row .item-type a,
.torrent-row .item-user a {
  color: var(--torrent-meta);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.torrent-row .item-type a:hover,
.torrent-row .item-user a:hover {
  color: var(--torrent-link-hover);
}

.torrent-row .item-name {
  min-width: 0;
}

.torrent-row .item-name a {
  white-space: normal;
}

.torrent-row .item-seed,
.torrent-row .item-leech {
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}

.torrent-row .magnet-link:hover {
  opacity: 0.85;
}

.item-seed,
#s {
  color: var(--seed);
  font-weight: 600;
}

.item-leech,
#l {
  color: var(--leech);
  font-weight: 600;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: var(--torrent-meta);
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0;
  transition: color 0.15s ease;
}

.sort-btn:hover {
  color: var(--torrent-link-hover);
}

.sort-btn-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0.5rem;
  font-size: 0.5rem;
  line-height: 1;
  color: transparent;
}

.sort-btn.is-active {
  color: var(--accent-soft);
}

.sort-btn.is-active .sort-btn-indicator {
  color: var(--accent-soft);
}

html[data-theme="light"] .sort-btn.is-active,
html[data-theme="light"] .sort-btn.is-active .sort-btn-indicator {
  color: var(--torrent-link);
}

.torrent-row-skeleton {
  grid-template-columns: 1fr;
  width: auto;
}

@media (min-width: 56rem) {
  .torrent-table-scroll-hint {
    display: none !important;
  }

  .torrent-table-scroll {
    overflow-x: visible;
  }

  .torrent-table-header,
  .torrent-row {
    --cols: 9rem 1fr 5.5rem 4.5rem 2.5rem 2.5rem 6rem;
    width: 100%;
  }

  .torrent-row .item-type .category-parent,
  .torrent-row .item-type .category-sep {
    display: inline;
  }
}

@media (min-width: 80rem) {
  .torrent-table-header,
  .torrent-row {
    --cols: 10rem 1fr 6rem 4.75rem 2.75rem 2.75rem 6.5rem;
    padding: 1rem 1.25rem;
  }
}

/* 14. Pagination ----------------------------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: center;
  min-height: 3rem;
  padding-block: var(--space-md) var(--space-xl);
}

.pagination:empty {
  display: none;
}

.pagination a,
.pagination strong {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  min-width: 2.5rem;
  text-align: center;
  display: inline-block;
}

.pagination a {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--text);
}

.pagination strong {
  background: var(--accent);
  color: var(--on-accent);
}

/* 15. Detail page ---------------------------------------------------------- */
.page-detail main.container > .torrent-detail {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.torrent-detail {
  position: relative;
  min-height: 20rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.torrent-detail-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  background: var(--fill);
}

.torrent-detail-header h1 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
  word-break: break-word;
}

.detail-meta {
  display: grid;
  gap: var(--space-lg);
  padding: var(--space-lg);
}

.detail-meta dl {
  display: grid;
  gap: var(--space-xs);
}

.detail-meta .meta-row {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: var(--space-sm) var(--space-md);
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  line-height: 1.5;
  background: var(--fill);
  border-radius: var(--radius-sm);
}

.detail-meta .meta-row:nth-child(even) {
  background: color-mix(in srgb, var(--fill) 65%, var(--canvas));
}

.detail-meta dt {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.detail-meta dd {
  font-size: var(--text-sm);
  word-break: break-word;
}

.detail-meta #user {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.user-badge {
  width: 16px;
  height: 16px;
  max-width: none;
  flex-shrink: 0;
  object-fit: contain;
}

.detail-actions {
  padding-inline: var(--space-xl);
  padding-bottom: var(--space-lg);
}

.detail-magnet {
  margin: 0 var(--space-lg) var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.file-list h2,
.detail-magnet-head {
  margin: 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--fill);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.detail-magnet .detail-magnet-field {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: none;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

.detail-magnet .footer-donate-field-body {
  padding: var(--space-sm) var(--space-md);
}

.detail-magnet .detail-magnet-uri,
.detail-magnet .footer-donate-address {
  color: var(--text-muted);
  opacity: 0.9;
  font-size: var(--text-xs);
  line-height: 1.45;
  word-break: break-all;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.detail-magnet .footer-donate-copy {
  width: 100%;
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  padding: var(--space-sm) 1.25rem;
  min-height: 2.75rem;
  background: var(--accent);
  font-weight: 600;
  color: var(--on-accent);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.detail-magnet .footer-donate-copy:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.detail-magnet .footer-donate-copy.is-copied {
  background: color-mix(in srgb, var(--accent) 75%, var(--surface));
  color: var(--on-accent);
}

@media (min-width: 40rem) {
  .detail-magnet .detail-magnet-field {
    flex-direction: row;
    width: 100%;
  }

  .detail-magnet .footer-donate-copy {
    width: auto;
    min-width: 5.5rem;
    border-top: none;
    border-left: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    min-height: 0;
    padding: 0.625rem 1.25rem;
  }
}

.detail-description {
  margin: 0 var(--space-lg) var(--space-lg);
  padding: var(--space-md);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  font-family: ui-monospace, monospace;
  font-size: var(--text-xs);
  line-height: 1.6;
  max-height: 25rem;
  overflow-y: auto;
}

.file-list {
  margin: 0 var(--space-lg) var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.file-list ol {
  list-style: none;
  max-height: 20rem;
  overflow-y: auto;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border);
}

.file-list li:nth-child(even) {
  background: var(--row-stripe);
}

.file-list .file-size {
  color: var(--text-muted);
  flex-shrink: 0;
}

@media (min-width: 48rem) {
  .detail-meta {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-2xl) var(--space-3xl);
    padding: var(--space-xl);
  }

  .detail-meta .meta-row {
    grid-template-columns: 8rem 1fr;
    padding: var(--space-sm) var(--space-lg);
  }

  .detail-description,
  .detail-magnet,
  .file-list {
    margin-inline: var(--space-xl);
  }
}

/* 16. Article pages (about, contact, proxy-info) -------------------------- */
.page-about main.container,
.page-contact main.container,
.page-support main.container,
.page-proxy-info main.container {
  padding-bottom: var(--space-3xl);
}

.about-story,
.proxy-info {
  width: 100%;
  padding-bottom: var(--space-xl);
  color: var(--text);
}

.about-story p,
.proxy-info p {
  margin: 0 0 var(--space-lg);
  font-size: var(--text-md);
  line-height: 1.75;
}

.about-story p:last-child,
.proxy-info p:last-child {
  margin-bottom: 0;
}

.about-story h2,
.proxy-info h2 {
  margin: var(--space-2xl) 0 var(--space-md);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.about-story h2:first-of-type,
.proxy-info h2:first-of-type {
  margin-top: var(--space-xl);
}

.about-story h3 {
  margin: var(--space-xl) 0 var(--space-sm);
  font-size: var(--text-xl);
  color: var(--text);
}

.about-story a,
.proxy-info a {
  color: var(--link);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.about-story a:hover,
.proxy-info a:hover {
  color: var(--link-hover);
}

.about-story ul,
.about-story ol,
.proxy-info ul {
  margin: 0 0 var(--space-lg);
  padding-left: 1.5rem;
}

.about-story li,
.proxy-info li {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

.support-btc-heading {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-2xl) 0 var(--space-md);
}

.support-btc-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent-soft);
  background: color-mix(in srgb, var(--accent-soft) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent-soft) 28%, var(--border));
  border-radius: var(--radius-sm);
}

.support-btc-title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.support-page .support-btc-heading + h2 {
  margin-top: var(--space-xl);
}

.support-donate-field {
  max-width: 36rem;
  margin-bottom: var(--space-lg);
}

.proxy-info-cta {
  padding-top: var(--space-lg);
  margin: 0;
}

/* 17. Utilities & motion --------------------------------------------------- */
.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;
}

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