/* ============================================================
   TORRENT — design system + base styles
   tokens (CSS custom properties) + self-hosted IBM Plex Mono
   + UI primitives (buttons, chips, covers, tables, etc).
   Themes: [data-theme="dark|light"] on <html>.
   Accent override: [data-accent="<color>"] on <html>.
   ============================================================ */

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* --- type scale (fluid, clamp-based) ----------------------- */
  --fs-xs:   clamp(11px, 0.72rem + 0.05vw, 12px);
  --fs-sm:   clamp(12px, 0.8rem  + 0.05vw, 13px);
  --fs-base: clamp(13px, 0.85rem + 0.08vw, 14px);
  --fs-lg:   clamp(15px, 0.95rem + 0.1vw,  16px);
  --fs-xl:   clamp(17px, 1.05rem + 0.15vw, 19px);
  --fs-2xl:  clamp(22px, 1.3rem  + 0.4vw,  28px);
  --fs-3xl:  clamp(28px, 1.6rem  + 0.8vw,  40px);
  --fs-4xl:  clamp(36px, 2rem    + 1.6vw,  60px);

  --lh-tight:   1.15;
  --lh-normal:  1.45;
  --lh-relaxed: 1.7;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  --ff-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ff-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* --- spacing (4px base) ------------------------------------ */
  --space-0:  0;
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* --- radius ------------------------------------------------- */
  --r-sm:    2px;
  --r-md:    4px;
  --r-lg:    6px;
  --r-xl:    10px;
  --r-full:  999px;
  --r-cover: 2px;

  /* --- motion ------------------------------------------------- */
  --dur-fast: 100ms;
  --dur-base: 160ms;
  --dur-slow: 240ms;
  --ease-standard:   cubic-bezier(.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(.2, 0, .1, 1.2);

  /* --- sizes -------------------------------------------------- */
  --cover-thumb: 40px;
  --cover-sm:    64px;
  --cover-md:    128px;
  --cover-lg:    320px;

  --header-h: 52px;
  --container-max: 1280px;

  /* --- z-index ------------------------------------------------ */
  --z-header:  20;
  --z-drawer:  30;
  --z-modal:   40;
  --z-toast:   50;
  --z-tooltip: 60;
}

/* ============================================================
   THEME: dark (default)
   ============================================================ */
:root,
html[data-theme="dark"] {
  --bg-0: #000000;
  --bg-1: #0a0a0b;
  --bg-2: #111114;
  --bg-3: #17181c;

  --fg-primary: #e7e9ec;
  --fg-muted:   #9498a0;
  --fg-faint:   #5a5d64;

  --border-subtle: #1d1e22;
  --border-strong: #2b2d33;

  --accent:        #60a5fa;
  --accent-hover:  #7ab5fb;
  --accent-dim:    rgba(96, 165, 250, 0.14);
  --on-accent:     #05070a;

  --ok:     #4ade80;
  --warn:   #fbbf24;
  --danger: #f87171;
  --info:   #60a5fa;

  --freeleech:    #a78bfa;
  --freeleech-bg: rgba(167, 139, 250, 0.12);

  --ratio-good: #4ade80;
  --ratio-warn: #fbbf24;
  --ratio-bad:  #f87171;

  --new:    #60a5fa;
  --new-bg: rgba(96, 165, 250, 0.14);

  --focus-ring: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent);
  --shadow-sm: 0 1px 0 rgba(255,255,255,0.02) inset, 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 1px 0 rgba(255,255,255,0.02) inset, 0 6px 20px rgba(0,0,0,0.55);
  --shadow-lg: 0 1px 0 rgba(255,255,255,0.03) inset, 0 20px 60px rgba(0,0,0,0.7);
  --glow-accent: 0 0 0 1px var(--accent-dim), 0 8px 28px rgba(96,165,250,0.22);
}

/* ============================================================
   THEME: light
   ============================================================ */
html[data-theme="light"] {
  --bg-0: #fbfbfa;
  --bg-1: #ffffff;
  --bg-2: #f5f5f3;
  --bg-3: #ececea;

  --fg-primary: #0b0c0f;
  --fg-muted:   #5a5f68;
  --fg-faint:   #8c919a;

  --border-subtle: #e5e5e2;
  --border-strong: #c9c9c4;

  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --accent-dim:    rgba(37, 99, 235, 0.12);
  --on-accent:     #ffffff;

  --ok:     #16a34a;
  --warn:   #b45309;
  --danger: #b91c1c;
  --info:   #2563eb;

  --freeleech:    #6d28d9;
  --freeleech-bg: rgba(109, 40, 217, 0.10);

  --ratio-good: #16a34a;
  --ratio-warn: #b45309;
  --ratio-bad:  #b91c1c;

  --new:    #2563eb;
  --new-bg: rgba(37, 99, 235, 0.10);

  --focus-ring: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent);
  --shadow-sm: 0 1px 2px rgba(20,20,30,0.06);
  --shadow-md: 0 4px 16px rgba(20,20,30,0.08);
  --shadow-lg: 0 12px 40px rgba(20,20,30,0.12);
  --glow-accent: 0 0 0 1px var(--accent-dim), 0 8px 28px rgba(37,99,235,0.18);
}

/* ============================================================
   Accent overrides (set by tweaks panel)
   ============================================================ */
html[data-accent="blue"]   { --accent:#60a5fa; --accent-hover:#7ab5fb; --accent-dim:rgba(96,165,250,.14); }
html[data-accent="orange"] { --accent:#ff7a3d; --accent-hover:#ff9460; --accent-dim:rgba(255,122,61,.14); }
html[data-accent="green"]  { --accent:#4ade80; --accent-hover:#6ee7a0; --accent-dim:rgba(74,222,128,.14); }
html[data-accent="amber"]  { --accent:#eab308; --accent-hover:#facc15; --accent-dim:rgba(234,179,8,.16); }
html[data-accent="pink"]   { --accent:#ec4899; --accent-hover:#f472b6; --accent-dim:rgba(236,72,153,.14); }
html[data-accent="violet"] { --accent:#a78bfa; --accent-hover:#c4b5fd; --accent-dim:rgba(167,139,250,.14); }

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; }
}

/* ============================================================
   RESET + BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg-0);
  color: var(--fg-primary);
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; min-height: 100dvh; }

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

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

/* ============================================================
   UTILITIES
   ============================================================ */
.mono { font-family: var(--ff-mono); font-feature-settings: "zero" 1; }
.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.uppercase { text-transform: uppercase; letter-spacing: 0.06em; }
.tnum { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row { display: flex; align-items: center; gap: var(--space-2); }
.col { display: flex; flex-direction: column; gap: var(--space-2); }
.spacer { flex: 1; }

/* ============================================================
   APP CHROME
   ============================================================ */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: var(--header-h) 1fr auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-5);
  padding-left: max(var(--space-5), env(safe-area-inset-left));
  padding-right: max(var(--space-5), env(safe-area-inset-right));
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-h) + env(safe-area-inset-top));
  background: var(--bg-0);
  border-bottom: 1px solid var(--border-subtle);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--ff-mono);
  font-weight: 700;
  font-size: var(--fs-base);
  letter-spacing: 0.04em;
  color: var(--fg-primary);
}
.logo:hover { color: var(--fg-primary); }
.logo .dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: var(--r-full);
  display: inline-block;
}
.logo .slash { color: var(--fg-faint); font-weight: 400; }
.logo .scope { color: var(--fg-muted); font-weight: 400; }

.nav { display: flex; gap: var(--space-1); }
.nav a {
  padding: 6px var(--space-3);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  border-radius: var(--r-md);
  font-family: var(--ff-mono);
}
.nav a:hover { color: var(--fg-primary); background: var(--bg-2); }
.nav a.active { color: var(--fg-primary); background: var(--bg-2); }
.nav a.disabled { color: var(--fg-faint); cursor: not-allowed; }
.nav a.disabled:hover { background: transparent; color: var(--fg-faint); }

.search-bar {
  position: relative;
  max-width: 480px;
  width: 100%;
  justify-self: center;
}
.search-bar input {
  width: 100%;
  padding: 7px var(--space-3) 7px 32px;
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--fg-primary);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
}
.search-bar input::placeholder { color: var(--fg-faint); }
.search-bar input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow-accent); }
.search-bar .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-faint);
  pointer-events: none;
  display: inline-flex;
}
.search-bar .hotkey {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.header-actions { display: flex; align-items: center; gap: var(--space-1); }
.header-user {
  display: flex; align-items: center; gap: var(--space-2);
  padding-left: 10px; margin-left: 4px;
  border-left: 1px solid var(--border-subtle);
}
.header-user .avatar {
  width: 24px; height: 24px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #4a3b7a, #7aa5d4);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-family: var(--ff-mono); font-weight: 600;
  color: #fff;
}

main#app {
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
}

.footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-6) var(--space-5);
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  color: var(--fg-faint);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  max-width: var(--container-max);
  margin: 0 auto;
}
.footer a { color: var(--fg-muted); }

/* ============================================================
   BUTTON
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 7px var(--space-3);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--fg-primary);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--bg-3); border-color: var(--border-strong); color: var(--fg-primary); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

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

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--fg-muted);
}
.btn-ghost:hover { background: var(--bg-2); color: var(--fg-primary); border-color: transparent; }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--border-subtle);
}
.btn-danger:hover { background: rgba(248,113,113,.08); border-color: var(--danger); color: var(--danger); }

.btn-sm { padding: 4px var(--space-2); font-size: var(--fs-xs); }
.btn-lg { padding: 10px var(--space-4); font-size: var(--fs-base); }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-muted);
}
.btn-icon:hover { background: var(--bg-2); color: var(--fg-primary); }

/* ============================================================
   INPUT / SELECT / TEXTAREA
   ============================================================ */
.input, .select, .textarea {
  width: 100%;
  padding: 7px var(--space-3);
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--fg-primary);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}
.input::placeholder { color: var(--fg-faint); }
.textarea { min-height: 96px; resize: vertical; font-family: var(--ff-sans); }

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%), linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: var(--space-8);
}

label.field {
  display: block;
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
}

/* ============================================================
   CHIP / BADGE / PILL
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--space-2);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  line-height: 1.6;
  white-space: nowrap;
}
.chip-accent { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-dim); }
.chip-ok     { color: var(--ok);     border-color: rgba(74,222,128,.25); background: rgba(74,222,128,.08); }
.chip-warn   { color: var(--warn);   border-color: rgba(251,191,36,.25); background: rgba(251,191,36,.08); }
.chip-danger { color: var(--danger); border-color: rgba(248,113,113,.25); background: rgba(248,113,113,.08); }
.chip-freeleech { color: var(--freeleech); border-color: rgba(167,139,250,.3); background: var(--freeleech-bg); }
.chip-new { color: var(--new); border-color: rgba(96,165,250,.3); background: var(--new-bg); }

.fmt {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 1px 6px;
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--fg-primary);
  background: var(--bg-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.fmt.flac { color: var(--ok); border-color: rgba(74,222,128,.25); }
.fmt.mp3  { color: var(--fg-muted); }
.fmt.aac, .fmt.opus, .fmt.alac, .fmt.ogg { color: var(--fg-muted); }
.fmt .b { color: var(--fg-muted); font-weight: var(--fw-regular); }

.ratio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--ff-mono);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
.ratio.good { color: var(--ratio-good); }
.ratio.warn { color: var(--ratio-warn); }
.ratio.bad  { color: var(--ratio-bad); }
.ratio.inf  { color: var(--fg-muted); }

.kbd {
  display: inline-block;
  padding: 1px 6px;
  min-width: 18px;
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  line-height: 1.4;
  text-align: center;
}

/* ============================================================
   COVER
   ============================================================ */
.cover {
  display: inline-block;
  width: var(--cover-sm);
  height: var(--cover-sm);
  border-radius: var(--r-cover);
  background: var(--bg-2);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}
.cover.thumb { width: var(--cover-thumb); height: var(--cover-thumb); }
.cover.md    { width: var(--cover-md);    height: var(--cover-md); }
.cover.lg    { width: var(--cover-lg);    height: var(--cover-lg); }

/* ============================================================
   TABLE
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
}
.table th, .table td {
  text-align: left;
  padding: 8px var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.table th {
  font-weight: var(--fw-medium);
  color: var(--fg-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-1);
}
.table tbody tr:hover { background: var(--bg-1); }

.table .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg-muted); }

/* ============================================================
   RELEASE ROW
   ============================================================ */
.row-head, .release-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 2fr) auto auto 72px 72px 72px 80px 60px;
  gap: var(--space-4);
  align-items: center;
  padding: 10px var(--space-4);
}
.row-head {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  border-bottom: 1px solid var(--border-subtle);
}
.row-head .r { text-align: right; }

.release-row {
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--dur-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.release-row:hover { background: var(--bg-1); color: inherit; }
.release-row.freeleech { background: var(--freeleech-bg); }
.release-row .title { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.release-row .artist {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.release-row .album {
  font-family: var(--ff-sans);
  font-weight: var(--fw-medium);
  font-size: var(--fs-base);
  color: var(--fg-primary);
}
.release-row .album .year { font-family: var(--ff-mono); font-weight: 400; font-size: var(--fs-sm); color: var(--fg-faint); margin-left: 4px; }
.release-row .chips { display: flex; gap: 4px; flex-wrap: wrap; }
.release-row .s, .release-row .l, .release-row .sn {
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--fg-muted);
}
.release-row .s b { color: var(--ok); font-weight: 500; }
.release-row .l b { color: var(--warn); font-weight: 500; }
.release-row .size { color: var(--fg-primary); font-variant-numeric: tabular-nums; text-align: right; }
.release-row .age { color: var(--fg-faint); text-align: right; font-size: var(--fs-xs); }
.release-row .dl-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-subtle); border-radius: var(--r-md);
  color: var(--fg-muted);
  background: transparent;
}
.release-row .dl-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   RELEASE CARD
   ============================================================ */
.release-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  cursor: pointer;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.release-card:hover { color: inherit; }
.release-card:hover .album { color: var(--accent); }
.release-card .cover {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}
.release-card .artist {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.release-card .album {
  font-size: var(--fs-base);
  color: var(--fg-primary);
  font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
  transition: color var(--dur-fast);
}
.release-card .meta {
  display: flex;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}

/* ============================================================
   HEADINGS / SECTION TITLE
   ============================================================ */
h1, h2, h3, h4 { margin: 0; font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
h1 { font-size: var(--fs-3xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-base); }

.section-title {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-4) 0 var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-4);
}
.section-title h2 {
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-primary);
}
.section-title .count {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--fg-faint);
}
.section-title .right { margin-left: auto; display: flex; gap: var(--space-2); }

/* ============================================================
   TABS (catalog strip)
   ============================================================ */
.strip-tabs {
  display: flex;
  gap: var(--space-4);
  padding-top: var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  align-items: flex-end;
}
.strip-tabs button {
  padding: var(--space-2) 0;
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
}
.strip-tabs button:hover { color: var(--fg-primary); }
.strip-tabs button.active { color: var(--fg-primary); border-bottom-color: var(--accent); }
.strip-tabs .right { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); padding-bottom: 8px; }
.strip-tabs .right .select { width: auto; padding: 4px 24px 4px 8px; font-size: 12px; }

/* ============================================================
   CARD / KV LIST
   ============================================================ */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--space-5);
}

.kv {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: var(--space-2) var(--space-4);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  margin: 0;
}
.kv dt { color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--fs-xs); align-self: center; }
.kv dd { margin: 0; color: var(--fg-primary); }

/* ============================================================
   SKELETON / EMPTY / ERROR
   ============================================================ */
@keyframes sk-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}
.skeleton {
  background: var(--bg-2);
  border-radius: var(--r-sm);
  animation: sk-pulse 1.4s ease-in-out infinite;
}

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-16) var(--space-6);
  text-align: center;
  color: var(--fg-muted);
}
.state .glyph {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  color: var(--fg-faint);
  font-family: var(--ff-mono);
  font-size: var(--fs-lg);
}
.state h3 { color: var(--fg-primary); }

.empty { padding: var(--space-12); text-align: center; color: var(--fg-muted); font-family: var(--ff-mono); font-size: var(--fs-sm); }
.error { color: var(--danger); margin: 0; font-family: var(--ff-mono); font-size: var(--fs-sm); }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr) auto auto;
  gap: var(--space-2);
  align-items: end;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-subtle);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-6) 0;
}
.pagination .btn { min-width: 32px; }
.pagination .btn.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pagination .dots { display: inline-flex; align-items: center; color: var(--fg-faint); padding: 0 var(--space-2); font-family: var(--ff-mono); }

/* ============================================================
   CATALOG: hero
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-6);
  padding: var(--space-6) 0 var(--space-8);
  border-bottom: 1px solid var(--border-subtle);
}
.hero-feature {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-5);
  align-items: center;
}
.hero-feature .cover { width: 240px; height: 240px; }
.hero-feature .eyebrow {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}
.hero-feature h1 {
  font-family: var(--ff-sans);
  font-size: clamp(28px, 2.4vw, 44px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg-primary);
}
.hero-feature .feature-artist {
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--space-2);
}
.hero-feature .actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); flex-wrap: wrap; }
.hero-feature .chips { display: flex; gap: 6px; margin-top: var(--space-3); flex-wrap: wrap; }

.hero-side { display: flex; flex-direction: column; gap: var(--space-3); }
.hero-strip-title {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex; justify-content: space-between;
}
.hero-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

/* ============================================================
   RELEASE DETAIL
   ============================================================ */
.crumbs {
  display: flex;
  gap: 6px;
  align-items: center;
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 0 var(--space-3);
}
.crumbs a { color: var(--fg-muted); }
.crumbs .sep { color: var(--fg-faint); }

.release-hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-6);
  padding: var(--space-2) 0 var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}
.release-hero h1 { font-size: clamp(28px, 2.4vw, 44px); line-height: 1.04; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; }
.release-hero .artist-line {
  font-family: var(--ff-mono); font-size: var(--fs-sm); color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.release-hero .artist-line a:hover { color: var(--accent); }
.release-hero .meta-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--space-4); }
.release-hero .actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); flex-wrap: wrap; align-items: center; }
.release-hero .hero-stats {
  display: grid; grid-template-columns: repeat(4, auto); gap: var(--space-6);
  margin-top: var(--space-5); padding: var(--space-4) 0;
  border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle);
}
.release-hero .hero-stats .stat .k {
  font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.release-hero .hero-stats .stat .v {
  font-family: var(--ff-mono); font-size: var(--fs-lg); color: var(--fg-primary);
  font-weight: 600; margin-top: 2px;
}
.release-hero .hero-stats .stat .v.s { color: var(--ok); }
.release-hero .hero-stats .stat .v.l { color: var(--warn); }
.release-hero .hero-stats .stat .v.small { font-size: var(--fs-sm); font-weight: 500; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-8);
  padding: var(--space-6) 0;
}
.detail-section { margin-bottom: var(--space-8); }
.detail-section h2 {
  font-family: var(--ff-mono); font-size: var(--fs-sm); font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; color: var(--fg-muted);
  padding-bottom: var(--space-2); margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: baseline; gap: var(--space-3);
}
.detail-section h2 .count { color: var(--fg-faint); font-weight: 400; }

.description {
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--fg-primary);
  max-width: 68ch;
  white-space: pre-wrap;
}

.files { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--fg-muted); }
.files .file {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  padding: 4px 0;
  border-bottom: 1px dashed var(--border-subtle);
}
.files .file .p { color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .file .sz { color: var(--fg-faint); font-variant-numeric: tabular-nums; }

.info-card {
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--space-4);
}
.info-card + .info-card { margin-top: var(--space-4); }
.info-card h3 {
  font-family: var(--ff-mono); font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--fg-muted); margin-bottom: var(--space-3);
}

/* ============================================================
   ARTIST
   ============================================================ */
.artist-hero {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: var(--space-5);
  padding: var(--space-2) 0 var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}
.artist-hero .cover { width: 180px; height: 180px; border-radius: var(--r-full); }
.artist-hero h1 { font-size: clamp(36px, 3.5vw, 64px); letter-spacing: -.02em; line-height: 1; font-weight: 600; }
.artist-hero .eyebrow {
  font-family: var(--ff-mono); font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: .1em; color: var(--fg-muted);
}
.artist-hero .stats {
  display: flex; gap: var(--space-6); margin-top: var(--space-3);
  font-family: var(--ff-mono); font-size: var(--fs-sm); color: var(--fg-muted);
  flex-wrap: wrap;
}
.artist-hero .stats b { color: var(--fg-primary); font-weight: 600; }
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-4);
  padding: var(--space-3) 0 var(--space-6);
}

/* ============================================================
   AUTH / UPLOAD / PROFILE
   ============================================================ */
.auth-card, .upload-card, .profile-card {
  max-width: 520px;
  margin: var(--space-6) auto;
}
.auth-card h1, .upload-card h1, .profile-card h1 { margin-bottom: var(--space-5); font-size: var(--fs-2xl); }

.field-list { display: flex; flex-direction: column; gap: var(--space-4); }
.field-list .row { display: flex; gap: var(--space-3); }
.field-list .row > * { flex: 1; }
.field-list .actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }

.file-drop {
  display: block;
  border: 1px dashed var(--border-strong);
  padding: var(--space-6);
  text-align: center;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--fg-muted);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.file-drop:hover, .file-drop.hover { border-color: var(--accent); color: var(--fg-primary); background: var(--bg-1); }
.file-drop input { display: none; }

.profile-card .stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.profile-card .stat-cell {
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--space-3);
}
.profile-card .stat-cell .k {
  font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.profile-card .stat-cell .v {
  font-family: var(--ff-mono); font-size: var(--fs-lg); color: var(--fg-primary);
  margin-top: 4px; font-weight: 600;
}
.profile-card .passkey {
  display: block;
  background: var(--bg-2);
  padding: var(--space-3);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  border-radius: var(--r-md);
  word-break: break-all;
  border: 1px solid var(--border-subtle);
  margin: var(--space-2) 0 var(--space-5);
  color: var(--fg-primary);
}

.invites-section {
  margin: var(--space-5) 0;
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
}
.invites-section h2 {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fg-muted);
  margin: 0;
}
.invites-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.invites-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.invite-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.invite-code {
  font-size: var(--fs-sm);
  color: var(--fg-primary);
  cursor: pointer;
  user-select: all;
}
.invite-meta { font-size: var(--fs-xs); }
.invite-status {
  font-family: var(--ff-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  color: var(--fg-muted);
}
.invite-status.active  { color: var(--accent); border-color: var(--accent); }
.invite-status.used    { color: var(--fg-muted); }
.invite-status.expired { color: #b04040; border-color: #b04040; }

/* ============================================================
   TAGS / TRACKLIST / ADMIN
   ============================================================ */
.chip.tag {
  color: var(--fg-muted);
  border-color: var(--border-subtle);
  background: var(--bg-1);
  text-transform: lowercase;
}
.chip .chip-x {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0 2px;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  line-height: 1;
}
.tag-input-wrap { position: relative; display: flex; flex-direction: column; gap: 6px; }
.tag-suggest {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  z-index: 20;
  display: flex; flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  margin-top: 4px;
  overflow: hidden;
}
.tag-suggest-item {
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--fg-primary);
  padding: 6px var(--space-3);
  cursor: pointer;
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
}
.tag-suggest-item:hover { background: var(--bg-2); }

.row-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 6px; vertical-align: middle; }

[data-tracklist] .track {
  display: grid;
  grid-template-columns: 2.5em 1fr auto;
  gap: var(--space-3);
  padding: 4px 0;
  border-bottom: 1px dashed var(--border-subtle);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
}
[data-tracklist] .track .num { color: var(--fg-faint); text-align: right; }
[data-tracklist] .track .t   { color: var(--fg-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-tracklist] .track .d   { color: var(--fg-faint); font-variant-numeric: tabular-nums; }

.tracks-edit-table { display: flex; flex-direction: column; gap: 6px; }
.tracks-edit-row {
  display: grid;
  grid-template-columns: 2.5em 1fr auto;
  gap: var(--space-2);
  align-items: center;
}
.tracks-edit-row .num { color: var(--fg-faint); text-align: right; }

.admin-users h1 { margin-bottom: var(--space-4); }
.admin-filter { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); }
.admin-filter input { flex: 1; }
.admin-table { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); }
.admin-row {
  display: grid;
  grid-template-columns: 60px 1fr 2fr 110px 180px 90px 100px;
  gap: var(--space-2);
  align-items: center;
  padding: 6px var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}
.admin-row.head {
  color: var(--fg-muted);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .release-row, .row-head { grid-template-columns: 40px 2fr auto auto 70px 70px; }
  .release-row .l, .release-row .sn, .release-row .age,
  .row-head .l, .row-head .sn, .row-head .age { display: none; }
}
@media (max-width: 1024px) {
  .release-hero { grid-template-columns: 1fr; }
  .release-hero .cover.lg { width: 100%; max-width: 320px; height: auto; aspect-ratio: 1/1; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .header {
    grid-template-columns: auto 1fr auto;
    padding-left: max(var(--space-3), env(safe-area-inset-left));
    padding-right: max(var(--space-3), env(safe-area-inset-right));
  }
  .nav { display: none; }
  .search-bar { grid-column: unset; max-width: none; }
  main#app { padding: var(--space-4) var(--space-3); }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-feature { grid-template-columns: 1fr; }
  .hero-feature .cover { width: 100%; height: auto; aspect-ratio: 1/1; }
  .artist-hero { grid-template-columns: 100px 1fr; }
  .artist-hero .cover { width: 100px; height: 100px; }
  .artist-hero > div:last-child { grid-column: 1 / -1; }
}

/* Mobile: tap-targets ≥ 44 px per iOS HIG. */
@media (pointer: coarse) and (max-width: 900px) {
  .btn-icon { width: 44px; height: 44px; }
  .release-row .dl-btn { width: 44px; height: 44px; }
  .nav a { padding: 10px var(--space-3); }
  .pagination .btn { min-width: 44px; min-height: 44px; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 32px; }
}

/* ============================================================
   MODAL / TOAST (for delete confirmation)
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-4);
}
.modal {
  background: var(--bg-1); border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg); padding: var(--space-5);
  max-width: 480px; width: 100%;
}
.modal h2 { margin-top: 0; font-size: var(--fs-lg); }
.modal .textarea { width: 100%; margin-top: var(--space-1); }
.modal .actions { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: var(--space-3); }

.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-2); border: 1px solid var(--border-subtle);
  color: var(--fg-primary); padding: var(--space-2) var(--space-4);
  border-radius: var(--r-lg); font-size: var(--fs-sm);
  opacity: 0; transition: opacity .3s, transform .3s;
  z-index: var(--z-toast);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   COMMENTS
   ============================================================ */
.comment-form { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.comment-form .textarea { width: 100%; }
.comment-form .actions { display: flex; gap: var(--space-2); align-items: center; justify-content: flex-end; }
.comments-feed { display: flex; flex-direction: column; gap: var(--space-3); }
.comment {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--space-3);
  background: var(--bg-1);
}
.comment-head { display: flex; gap: var(--space-2); align-items: baseline; margin-bottom: var(--space-1); }
.comment-who { font-weight: var(--fw-semibold); }
.comment-when { font-size: var(--fs-xs); }
.comment-body { font-size: var(--fs-sm); line-height: var(--lh-normal); }
.comment-body code {
  background: var(--bg-2); padding: 0 4px;
  border-radius: var(--r-sm); font-family: var(--ff-mono);
  font-size: 0.92em;
}
.comment-body blockquote {
  margin: var(--space-1) 0;
  padding-left: var(--space-2);
  border-left: 2px solid var(--border-strong);
  color: var(--fg-muted);
}
.comment-body a { color: var(--accent); }
.comment-actions { display: flex; gap: var(--space-3); margin-top: var(--space-1); }
.link-btn {
  background: none; border: none; color: var(--fg-muted);
  font-size: var(--fs-xs); cursor: pointer; padding: 0;
  font-family: var(--ff-mono); text-transform: uppercase;
  letter-spacing: .06em;
}
.link-btn:hover { color: var(--accent); }

/* ============================================================
   FAVORITES / bookmark button
   ============================================================ */
.fav-grid {
  display: grid; gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-top: var(--space-2);
}
.favorites-section { margin-top: var(--space-6); }
[data-bookmark].active { color: var(--accent); }
.release-row.is-favorite .title .album::after {
  content: ' ★'; color: var(--accent); font-size: 0.9em;
}

/* ============================================================
   NOTIFICATIONS (bell panel) — TORRENT-57
   ============================================================ */
.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}
.notif-panel {
  position: fixed;
  width: 360px;
  max-width: calc(100vw - 16px);
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-modal);
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0;
  background: var(--bg-1);
}
.notif-list { display: flex; flex-direction: column; }
.notif-item {
  display: flex; align-items: baseline; gap: var(--space-2);
  padding: 8px 12px;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--border-subtle);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--accent-dim); }
.notif-item a { color: var(--fg-primary); text-decoration: none; flex: 1; min-width: 0; }
.notif-item a:hover { color: var(--accent); }
.notif-item > span:first-child { flex: 1; min-width: 0; }
.notif-time { font-family: var(--ff-mono); font-size: 11px; color: var(--fg-faint); white-space: nowrap; }

/* ============================================================
   AUDIT TABLE
   ============================================================ */
.audit-table .admin-row {
  grid-template-columns: 60px 160px 120px 140px 140px 1fr;
}

/* ============================================================
   FEEDS STRIP (recent / snatched / active top-10) — TORRENT-34
   ============================================================ */
.feeds-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  padding: var(--space-4) 0 var(--space-3);
  border-top: 1px solid var(--border-subtle);
}
.feed-col {
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-2);
  min-width: 0;
}
.feed-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
}
.feed-list { display: flex; flex-direction: column; }
.feed-item {
  display: grid;
  grid-template-columns: 22px 28px 1fr auto;
  gap: var(--space-2);
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px dashed var(--border-subtle);
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: var(--bg-2); }
.feed-item .rank {
  font-family: var(--ff-mono);
  color: var(--fg-faint);
  font-size: 11px;
  text-align: right;
}
.feed-item .mini-cover {
  width: 28px; height: 28px; border-radius: 3px;
  background: var(--bg-2);
  background-size: cover; background-position: center;
  flex-shrink: 0;
}
.feed-item .title {
  display: flex; flex-direction: column; min-width: 0;
}
.feed-item .title .art {
  font-family: var(--ff-mono); font-size: 11px;
  color: var(--fg-muted); text-transform: uppercase;
  letter-spacing: 0.04em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feed-item .title .alb {
  font-size: 12px; font-weight: 500; color: var(--fg-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feed-item .chip-sm {
  font-family: var(--ff-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  color: var(--fg-muted);
  white-space: nowrap;
}
.feed-item .chip-sm.active { color: var(--ok); }
.feed-empty { font-size: 12px; color: var(--fg-faint); padding: 6px 0; }

@media (max-width: 900px) {
  .feeds-strip { grid-template-columns: 1fr; }
}

/* ============================================================
   INVITE MODAL (created invite preview) — TORRENT-31
   ============================================================ */
.invite-modal-scrim {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-modal);
}
.invite-modal {
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--space-5);
  min-width: 320px; max-width: 440px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.invite-modal h3 {
  font-family: var(--ff-mono); font-size: var(--fs-sm);
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-muted); margin-bottom: 4px;
}
.invite-modal-code-row {
  display: flex; gap: var(--space-2); align-items: center;
  padding: var(--space-2); background: var(--bg-2);
  border-radius: var(--r-md);
}
.invite-modal-code-row .invite-code {
  flex: 1; font-size: 14px; letter-spacing: 0.04em;
  overflow: auto; white-space: nowrap;
}

.invite-group-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  padding: var(--space-2) 0 4px;
}
.invite-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: var(--space-3); align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-subtle);
}
.invite-code {
  cursor: pointer; font-size: 13px; font-family: var(--ff-mono);
  background: var(--bg-2); padding: 3px 6px; border-radius: var(--r-sm);
}
.invite-status {
  font-family: var(--ff-mono); font-size: 11px;
  padding: 1px 6px; border-radius: var(--r-sm);
}
.invite-status.active { color: var(--ok); background: rgba(16,185,129,0.08); }
.invite-status.used { color: var(--fg-muted); background: var(--bg-2); }
.invite-status.expired { color: var(--warn); background: rgba(245,158,11,0.08); }
.invite-meta { font-size: 12px; color: var(--fg-muted); }

/* TORRENT-27 / TORRENT-37 — release-group details + FL / 2xUP / SCENE badges */
.release-group-details {
  border: 1px dashed var(--border-subtle);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  background: var(--bg-1, transparent);
}
.release-group-details > summary {
  cursor: pointer;
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fg-muted);
  user-select: none;
}
.release-group-details[open] > summary { margin-bottom: 10px; }
.release-group-details .row { gap: var(--space-3); }
.checkbox-field {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); color: var(--fg-primary);
  margin-top: 8px;
}

.badge {
  display: inline-flex; align-items: center;
  padding: 1px 6px;
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: var(--fw-bold, 600);
  letter-spacing: .06em;
  border-radius: var(--r-xs, 3px);
  border: 1px solid transparent;
  vertical-align: middle;
}
.badge.fl    { color: var(--ok, #10b981); border-color: rgba(16,185,129,0.4); background: rgba(16,185,129,0.1); }
.badge.up2   { color: var(--warn, #f5a524); border-color: rgba(245,165,36,0.4); background: rgba(245,165,36,0.1); }
.badge.scene { color: var(--fg-primary); border-color: var(--border-strong, #555); background: transparent; }
.badge.log   { color: #8bb8ff; border-color: rgba(139,184,255,0.4); background: rgba(139,184,255,0.08); }
.badge.cue   { color: #c89bff; border-color: rgba(200,155,255,0.4); background: rgba(200,155,255,0.08); }

.row-flags { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 6px; vertical-align: middle; }

