:root {
  color-scheme: dark;
  --red: #e50914;
  --red-hover: #f6121d;
  --bg: #141414;
  --card: #1f1f1f;
  --line: #333;
  --text: #fff;
  --muted: #b3b3b3;
  --ok: #46d369;
  --warn: #f5c518;
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: inherit; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 64px; }
h1 { font-size: 32px; margin: 8px 0 20px; }
h2 { font-size: 21px; margin: 40px 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.error { color: #ff6b6b; }
.ok { color: var(--ok); }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
       padding: 16px 20px; max-width: 1100px; margin: 0 auto; }
.logo img { height: 30px; display: block; }
nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 15px; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }
nav form { margin: 0; }

/* Buttons and forms */
button, .button {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 999px;
  padding: 10px 22px; background: #333; color: var(--text); text-decoration: none; display: inline-block;
}
button:hover, .button:hover { background: #444; }
button.primary, .button.primary { background: var(--red); }
button.primary:hover, .button.primary:hover { background: var(--red-hover); }
button.link { background: none; padding: 0; color: var(--muted); font-weight: 400; }
button.link:hover { color: var(--text); background: none; }
input, select {
  font: inherit; color: var(--text); background: #2a2a2a; border: 1px solid #444; border-radius: 8px;
  padding: 11px 13px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--red); border-color: transparent; }
label { display: block; font-size: 15px; color: var(--muted); }
label input, label select { margin-top: 6px; }
.stack > * + * { margin-top: 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 22px; }
.narrow { max-width: 440px; margin: 6vh auto 0; }
.narrow .brand { display: block; width: 240px; margin: 0 auto 28px; }

/* Landing page (logged out) */
.landing { min-height: 100vh; display: grid; place-items: center; text-align: center;
           background: radial-gradient(ellipse at 50% 35%, #2a0a0c 0%, var(--bg) 60%); }
.landing main { padding: 24px; }
.landing .brand { width: min(560px, 82vw); filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .6)); margin-bottom: 20px; }
.landing .tagline { color: var(--muted); font-size: clamp(17px, 2.4vw, 21px); margin: 0 0 36px; }
.landing .button { font-size: 20px; padding: 14px 40px; margin: 6px; }
.button.ghost { background: rgba(255, 255, 255, .12); }
.button.ghost:hover { background: rgba(255, 255, 255, .2); }

/* Portal (logged in) */
.tiles { display: grid; grid-template-columns: 2fr repeat(6, 1fr); gap: 14px; }
.tile { background: var(--card); border-radius: var(--radius); padding: 26px 20px; text-decoration: none;
        display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px;
        min-height: 140px; font-weight: 700; font-size: 19px; text-align: center; transition: background .15s, transform .15s; }
.tile:hover { background: #2a2a2a; transform: translateY(-2px); }
.tile .icon { width: 30px; height: 30px; }
/* "Titta": the logo red (--red) with a slow darker/lighter drift, a film strip along the edges, a light sweep */
.tile.watch { position: relative; overflow: hidden; isolation: isolate; font-size: 28px; letter-spacing: .5px;
              background: linear-gradient(115deg, #a8060e, var(--red) 30%, #f5222c 55%, var(--red) 80%, #b9070f);
              background-size: 300% 300%; animation: watch-flow 18s ease-in-out infinite alternate;
              text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
              /* the 100vmax shadow is the "cinema lights" that dim the page on hover; same shadow list in both
                 states so it fades */
              box-shadow: 0 10px 30px -12px rgba(229, 9, 20, .8), 0 0 0 0 rgba(229, 9, 20, 0),
                          0 0 0 100vmax rgba(0, 0, 0, 0), inset 0 0 0 1px rgba(255, 255, 255, .12);
              transition: transform .2s, box-shadow .6s ease; }
.tile.watch:is(:hover, :focus-visible) { transform: translateY(-3px) scale(1.015); z-index: 5;
  box-shadow: 0 18px 44px -12px rgba(229, 9, 20, .95), 0 0 120px 30px rgba(229, 9, 20, .45),
              0 0 0 100vmax rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .25); }
/* sprocket holes top and bottom + faint diagonal stripes in 40px tiles (seamless);
   360px = 20 holes = 9 stripe tiles, so the loop has no jump */
.tile.watch::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle, rgba(0, 0, 0, .38) 3.5px, transparent 4.5px) 0 7px / 18px 12px repeat-x,
    radial-gradient(circle, rgba(0, 0, 0, .38) 3.5px, transparent 4.5px) 0 calc(100% - 7px) / 18px 12px repeat-x,
    linear-gradient(45deg, rgba(255, 255, 255, .06) 25%, transparent 25% 50%, rgba(255, 255, 255, .06) 50% 75%,
                    transparent 75%) 0 0 / 40px 40px;
  animation: watch-film 11s linear infinite paused; }
/* one shine per hover: slides across when the pointer enters, jumps back unseen when it leaves */
.tile.watch::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 45%; z-index: -1;
  pointer-events: none; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .32), transparent); }
.tile.watch .icon { width: 38px; height: 38px; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .55)); }
/* At rest only the colours drift (slowly); the film rolls, shines and pulses on hover/focus */
.tile.watch:is(:hover, :focus-visible)::before { animation-play-state: running; }
.tile.watch:is(:hover, :focus-visible)::after { left: 130%; transition: left .9s ease-out; }
.tile.watch:is(:hover, :focus-visible) .icon { animation: watch-pulse 1.2s ease-in-out infinite; }
@keyframes watch-flow { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes watch-film { from { background-position: 0 7px, 0 calc(100% - 7px), 0 0; }
                        to { background-position: 360px 7px, 360px calc(100% - 7px), 360px 0; } }
@keyframes watch-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14);
                         filter: drop-shadow(0 0 14px rgba(255, 255, 255, .9)); } }
@media (prefers-reduced-motion: reduce) {
  .tile.watch, .tile.watch::before, .tile.watch:is(:hover, :focus-visible) .icon { animation: none; }
  .tile.watch:is(:hover, :focus-visible)::after { transition: none; }
}
.tile.soon { opacity: .45; pointer-events: none; }
.tile .note { font-size: 13px; font-weight: 400; color: var(--muted); }
@media (max-width: 720px) { .tiles { grid-template-columns: 1fr 1fr; } .tile.watch { grid-column: 1 / -1; } }

.row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.poster { flex: 0 0 140px; text-decoration: none; font-size: 14px; }
.poster img { width: 140px; height: 210px; object-fit: cover; border-radius: 6px; display: block; background: #222;
              transition: transform .15s; }
.poster:hover img { transform: scale(1.04); }
.poster span { display: block; margin-top: 6px; color: var(--muted); }
.devices { display: flex; flex-wrap: wrap; gap: 10px; }
.devices a { background: var(--card); padding: 9px 18px; border-radius: 999px; text-decoration: none; font-size: 15px; }
.devices a:hover { background: #2a2a2a; }

/* TV code */
.code { font-size: 34px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

/* Admin */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; }
td form { margin: 0; display: inline; }
.pill { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #333; color: var(--muted); }
.pill.red { background: var(--red); color: #fff; }
.pill.green { background: #1d3b26; color: var(--ok); }
.pill.imdb { background: #f5c518; color: #141414; font-weight: 700; text-decoration: none; }
.pill.mf { background: none; border: 1px solid var(--red); padding: 1px 8px; color: var(--text); font-weight: 600; }
/* A film's dialog on the DHT page: all its torrents, Martflix's choice first, each score worked out */
.dht-dialog { padding: 0; border: 0; border-radius: var(--radius); background: var(--card); color: var(--text);
              width: min(760px, 94vw); max-height: 88vh; }
.dht-dialog.wide { width: min(1180px, 96vw); }  /* a series: its season picker's picture */
.dht-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.dht-dialog-body { padding: 20px 22px; }
.dht-dialog-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dht-dialog-head h2 { margin: 0; font-size: 20px; }
.dht-card[data-dialog] { cursor: pointer; }
.dht-card[data-dialog]:hover { outline: 1px solid #444; }
.dht-card.on-martflix { background: #1a2a1f; box-shadow: inset 0 0 0 1px #2a4a33; }  /* Martflix has it already (series: all of it) */
.dht-film { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; margin-top: 12px; }
.dht-film img { width: 110px; border-radius: 6px; }
.dht-film > div:only-child { grid-column: 1 / -1; }  /* no poster: the text the whole width */
.dht-film p { margin: 0 0 8px; }
.dht-overview { color: var(--text); line-height: 1.45; }
.dht-dialog-sub { font-size: 16px; margin: 18px 0 2px; }
.dht-choices { margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.dht-choice { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; width: 100%; text-align: left; font-weight: 400;
              border-radius: 8px; padding: 9px 12px; background: #181818; border: 1px solid var(--line); }
.dht-choice:hover { background: #222; }
.dht-choice[aria-checked="true"] { border-color: var(--text); background: #222; }
.dht-detail { margin-top: 10px; padding: 12px 14px; border-radius: 8px; background: #181818; border: 1px solid var(--line); }
@media (max-width: 560px) { .dht-film { grid-template-columns: 72px minmax(0, 1fr); } .dht-film img { width: 72px; } }
.dht-steps { width: auto; margin: 8px 0 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
.dht-steps td { padding: 1px 16px 1px 0; border: 0; color: var(--muted); }
.dht-steps td.num { text-align: right; color: var(--text); padding-right: 0; }
.dht-steps caption { text-align: left; color: var(--text); font-weight: 600; padding-bottom: 2px; }
.dht-open { margin-top: 4px; }
.inline-form { display: grid; grid-template-columns: 2fr 1fr auto; gap: 10px; align-items: end; }
@media (max-width: 720px) { .inline-form { grid-template-columns: 1fr; } }
.linkbox { display: flex; gap: 8px; margin-top: 10px; }
.linkbox input { font-family: ui-monospace, monospace; font-size: 14px; }
.notice { background: #2b2410; border: 1px solid #5c4a14; color: #f5d67b; border-radius: var(--radius); padding: 14px 18px; }
.success { background: #12291a; border: 1px solid #1f5130; border-radius: var(--radius); padding: 18px; }

/* Signup: plans */
.signup .brand { display: block; width: 220px; margin: 0 auto 28px; }
.signup h1 { text-align: center; }
.signup > section > .muted { text-align: center; margin-top: -8px; }
.step { text-align: center; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.narrow-block { max-width: 440px; margin: 0 auto; }
.narrow-block h1 { text-align: left; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0; }
@media (max-width: 800px) { .plans { grid-template-columns: 1fr; } }
.plan { background: var(--card); border-radius: 14px; overflow: hidden; cursor: pointer; color: var(--text);
        border: 2px solid transparent; transition: transform .15s, border-color .15s; position: relative; }
.plan:hover { transform: translateY(-3px); }
.plan:has(input:checked) { border-color: var(--plan); box-shadow: 0 0 0 4px color-mix(in srgb, var(--plan) 25%, transparent); }
.plan input { position: absolute; opacity: 0; }
.plan-head { background: linear-gradient(135deg, var(--plan), color-mix(in srgb, var(--plan) 55%, #000));
             padding: 22px 20px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
             min-height: 176px; }
.plan-head strong { font-size: 22px; }
.plan-head .spec { font-size: 14px; opacity: .85; margin-bottom: 8px; }
.plan-head .price { font-size: 30px; font-weight: 800; }
.plan-head small { font-size: 15px; font-weight: 400; opacity: .8; }
.plan .badge { align-self: flex-start; background: rgba(0, 0, 0, .35); font-size: 12px; font-weight: 700;
               padding: 3px 10px; border-radius: 999px; margin-bottom: 6px; }
.plan ul { margin: 0; padding: 16px 20px 22px 38px; font-size: 15px; color: #ddd; }
.plan li + li { margin-top: 8px; }
.center { text-align: center; }
button.big { font-size: 19px; padding: 13px 64px; }

/* Device picker (welcome + help) */
.device-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 16px 0 20px; }
.device-picker button { background: var(--card); border-radius: var(--radius); padding: 16px 12px; font-size: 15px;
                        display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px solid transparent; }
.device-picker button .icon { width: 28px; height: 28px; }
.device-picker button:hover { background: #2a2a2a; }
.device-picker button.on { border-color: var(--red); background: #2a1416; }
.device { margin-bottom: 14px; }
.device h2 { margin-top: 0; }
.js .device { display: none; }
.js .device.shown { display: block; }

/* Help page */
.prose { max-width: 720px; }
.prose h2 { scroll-margin-top: 20px; }
.prose li + li { margin-top: 6px; }

/* Signup: plans */
.signup .brand { display: block; width: 220px; margin: 0 auto 28px; }
.signup h1 { text-align: center; }
.signup > section > .muted { text-align: center; margin-top: -8px; }
.step { text-align: center; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.narrow-block { max-width: 440px; margin: 0 auto; }
.narrow-block h1 { text-align: left; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0; }
@media (max-width: 800px) { .plans { grid-template-columns: 1fr; } }
.plan { background: var(--card); border-radius: 14px; overflow: hidden; cursor: pointer; color: var(--text);
        border: 2px solid transparent; transition: transform .15s, border-color .15s; position: relative; }
.plan:hover { transform: translateY(-3px); }
.plan:has(input:checked) { border-color: var(--plan); box-shadow: 0 0 0 4px color-mix(in srgb, var(--plan) 25%, transparent); }
.plan input { position: absolute; opacity: 0; }
.plan-head { background: linear-gradient(135deg, var(--plan), color-mix(in srgb, var(--plan) 55%, #000));
             padding: 22px 20px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
             min-height: 176px; }
.plan-head strong { font-size: 22px; }
.plan-head .spec { font-size: 14px; opacity: .85; margin-bottom: 8px; }
.plan-head .price { font-size: 30px; font-weight: 800; }
.plan-head small { font-size: 15px; font-weight: 400; opacity: .8; }
.plan .badge { align-self: flex-start; background: rgba(0, 0, 0, .35); font-size: 12px; font-weight: 700;
               padding: 3px 10px; border-radius: 999px; margin-bottom: 6px; }
.plan ul { margin: 0; padding: 16px 20px 22px 38px; font-size: 15px; color: #ddd; }
.plan li + li { margin-top: 8px; }
.center { text-align: center; }
button.big { font-size: 19px; padding: 13px 64px; }

/* Device picker (welcome + help) */
.device-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 16px 0 20px; }
.device-picker button { background: var(--card); border-radius: var(--radius); padding: 16px 12px; font-size: 15px;
                        display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px solid transparent; }
.device-picker button .icon { width: 28px; height: 28px; }
.device-picker button:hover { background: #2a2a2a; }
.device-picker button.on { border-color: var(--red); background: #2a1416; }
.device { margin-bottom: 14px; }
.device h2 { margin-top: 0; }
.js .device { display: none; }
.js .device.shown { display: block; }

/* Help page */
.prose { max-width: 720px; }
.prose h2 { scroll-margin-top: 20px; }
.prose li + li { margin-top: 6px; }

/* Upload */
.drop { display: block; border: 2px dashed #555; border-radius: var(--radius); padding: 46px 20px; text-align: center;
        cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over, .drop:hover { border-color: var(--red); background: #1c1112; }
.drop strong { display: block; font-size: 19px; margin-bottom: 4px; }
.uploads { display: grid; gap: 14px; margin-top: 20px; }
.upload .head { display: flex; justify-content: space-between; gap: 10px; }
.upload .name { word-break: break-all; }
.bar { height: 6px; background: #333; border-radius: 3px; margin: 12px 0 6px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--red); transition: width .3s; }
.upload.done .bar > div { background: var(--ok); }
.upload.failed .bar > div { background: #666; }
.kinds { display: inline-flex; background: #2a2a2a; border-radius: 999px; padding: 3px; margin: 8px 0 12px; }
.kinds button { background: none; padding: 6px 16px; font-weight: 500; }
.kinds button.on { background: #555; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 180px)); gap: 10px; margin-bottom: 12px; }
.match { display: flex; gap: 16px; align-items: flex-start; }
.match img, .match .noimg { width: 92px; border-radius: 6px; flex: none; }
.noimg { height: 138px; display: grid; place-items: center; background: #2a2a2a; color: #666; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.choice { background: none; padding: 0; text-align: left; font-weight: 400; font-size: 14px; border-radius: 6px; }
.choice img, .choice .noimg { width: 100%; border-radius: 6px; display: block; margin-bottom: 4px; }
.choice:hover { background: none; outline: 2px solid var(--red); }
.confirmed { color: var(--ok); }
.check { font-size: 14px; margin-top: 8px; }
.check.warn { color: var(--warn); }
.inline select { width: auto; margin-left: 8px; }

/* Upload ---------------------------------------------------------------- */
.upload-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.upload-head h1 { margin-bottom: 12px; }
.space { min-width: 220px; text-align: right; }
.space .bar { margin: 0 0 4px; }
.notice, .error-box { border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; }
.error-box { background: #2b1214; border: 1px solid #5c1f24; color: #ffb3b3; }
.drop { display: block; border: 2px dashed #555; border-radius: var(--radius); padding: 56px 20px; text-align: center;
        transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--red); background: #1c1112; }
.drop strong { display: block; font-size: 22px; margin-bottom: 6px; }
.drop p { margin: 0 0 22px; }
.buttons.center { justify-content: center; }
.analysing { padding: 48px 20px; }
.spinner { width: 36px; height: 36px; border: 3px solid #444; border-top-color: var(--red); border-radius: 50%;
           margin: 0 auto 14px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.group { margin-bottom: 14px; }
.group-main { display: flex; gap: 18px; align-items: flex-start; transition: opacity .15s; }
.group-main.off { opacity: .4; }
.group-poster { width: 96px; flex: none; border-radius: 6px; aspect-ratio: 2 / 3; object-fit: cover; background: #2a2a2a; }
.noimg { display: grid; place-items: center; color: #555; font-size: 28px; }
.group-info { flex: 1; min-width: 0; }
.group-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.group-top h2 { margin: 0 0 6px; font-size: 21px; }
.year { color: var(--muted); font-weight: 400; }
.include { display: flex; gap: 6px; align-items: center; white-space: nowrap; color: var(--text); font-size: 15px; }
.include input, .files input[type=checkbox] { width: auto; accent-color: var(--red); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pill.warn { background: #3d3210; color: var(--warn); }
.group-status { margin: 0 0 4px; }
.overview { margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.episode-grid { margin-top: 14px; }  /* the series' grid on a review card (styles under /admin/serier) */
.group-files { margin-top: 14px; }
.group-files summary { cursor: pointer; color: var(--muted); font-size: 15px; }
.group-files h3 { font-size: 14px; color: var(--muted); margin: 14px 0 4px; font-weight: 500; }
.files { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.files li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid #2a2a2a; }
.files li.skipped, .files li.unticked { opacity: .5; }
.files .dash { width: 13px; text-align: center; color: #666; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42%; }
.arrow { color: #666; }
.file-target { color: var(--ok); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42%; }
.file-note { flex-basis: 100%; padding-left: 21px; color: var(--muted); font-size: 13px; }
.files select { width: auto; padding: 4px 8px; font-size: 13px; }
.search-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid #2a2a2a; }
.search-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.search-form input { flex: 1; min-width: 160px; }
.search-form .year-input { flex: 0 0 90px; min-width: 0; }
.search-form .kinds { margin: 0; }
.choice-img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 4px; }
.unknown-card h2 { margin: 0 0 6px; font-size: 20px; }
.unknown-card .buttons { margin-top: 12px; }
.ignored { margin: 10px 0 90px; color: var(--muted); font-size: 14px; }
.ignored summary { cursor: pointer; }
.commit-bar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px;
              flex-wrap: wrap; background: rgba(20, 20, 20, .96); backdrop-filter: blur(6px); border-top: 1px solid var(--line);
              padding: 14px 0; margin-top: 10px; }
.commit-actions { display: flex; gap: 16px; align-items: center; }
.commit-bar button.primary { font-size: 18px; padding: 12px 34px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.overall { margin-bottom: 14px; }
.overall-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bar.big { height: 10px; border-radius: 5px; }
.progress-row { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; padding: 14px; }
.progress-poster { width: 46px; flex: none; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; background: #2a2a2a; }
.progress-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.progress-info .bar { margin: 4px 0 0; }
.progress-row.finished .bar > div { background: var(--ok); }
.notes p { margin: 4px 0 0; }
.warn { color: var(--warn); }
@media (max-width: 600px) {
  .group-poster { width: 64px; }
  .file-name, .file-target { max-width: 100%; }
  .arrow { display: none; }
}
.tips { margin: 18px 0 0; padding-left: 20px; }
.tips li + li { margin-top: 6px; }

/* Name menu in the header */
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; color: var(--text); font-weight: 600; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 10; min-width: 190px; max-width: calc(100vw - 32px); background: var(--card);
                   border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.user-menu .menu a, .user-menu .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 6px;
                                            color: var(--text); font-size: 15px; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: #2a2a2a; }

/* Wishlist */
.wish-form .choices { margin-top: 6px; }
.choice .pill { margin-top: 4px; display: inline-block; }
.wishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.wish { display: flex; gap: 14px; align-items: flex-start; padding: 16px; }
.wish.picked { margin-top: 14px; background: #262626; }
.wish-poster { width: 70px; flex: none; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: #2a2a2a; }
.wish-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wish-info p { margin: 0; }
.wish-info .pill { margin-left: 6px; }
.wish-info input { margin: 4px 0; }
.wish .note { color: #ddd; font-style: italic; }
.wish-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.wish-actions .vote { padding: 6px 14px; font-size: 14px; }
.wish-actions .vote.on { background: #1d3b26; color: var(--ok); }
.wish-actions .stop[data-sure="1"] { color: #ff9a9f; }  /* the second click stops it and deletes what came */
.coming-item .seasons { white-space: nowrap; }
/* A series wish's seasons, the season picker's tiles: pressed is wished for; one Martflix has all of can't be
   pressed, and shows its green whole */
.wish-seasons { margin: 2px 0; gap: 5px; }
.wish-seasons .season-tile { width: 46px; padding: 6px 6px 7px; font-size: 12px; }
.wish-seasons .season-tile:disabled { opacity: .75; }
.wish-seasons .season-tile:disabled .season-bar { opacity: 1; }
.wish.done { opacity: .85; }
.wish.done .button { align-self: flex-start; padding: 6px 16px; font-size: 14px; }
@media (max-width: 720px) { .tiles { grid-template-columns: 1fr 1fr; } }

/* Admin: start page */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
              margin-bottom: 20px; }
.admin-head h1 { margin: 0; }
.admin h2 { display: flex; align-items: center; gap: 10px; margin-top: 34px; }
.admin h2::before { content: ""; width: 4px; height: 1em; border-radius: 2px; background: var(--red); }
.admin-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* Server status next to the title: green = up and everything works, amber = low disk, red = not answering */
.health { --health: var(--ok); display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px;
          border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--health);
          background: color-mix(in srgb, var(--health) 14%, transparent); }
.health.warn { --health: var(--warn); }
.health.down { --health: var(--red); }
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--health); flex: none;
              animation: health-pulse 2.4s ease-out infinite; }
@keyframes health-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--health) 60%, transparent); }
                          100% { box-shadow: 0 0 0 9px transparent; } }
@media (prefers-reduced-motion: reduce) { .health-dot { animation: none; } }
.now-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--muted); }
.now-list strong { color: var(--text); }
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; transition: background .3s; }
.stat strong { font-size: 30px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; }
.stat.hot { background: linear-gradient(135deg, #a8060e, var(--red)); }
.stat.hot span { color: rgba(255, 255, 255, .85); }
.admin td.actions { white-space: nowrap; }
@media (max-width: 700px) {
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .admin .card { padding: 16px; }
}
/* On phones and narrow windows each table row becomes its own small card: name first, then labelled fields */
@media (max-width: 900px) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr:has(th) { display: none; }
  table.stack tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 3px 0; }
  table.stack td:first-child { font-size: 17px; font-weight: 700; padding-bottom: 6px; }
  table.stack td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  table.stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 400; flex: none; }
  table.stack td[data-label] > * { min-width: 0; }
  table.stack .linkbox { flex: 1; justify-content: flex-end; margin-top: 0; }
  table.stack .linkbox input { min-width: 0; width: 100%; }
  table.stack td.actions { padding-top: 8px; }
}

/* Admin: the featured title ("Utvald") */
.featured-admin { display: grid; gap: 18px; }
.featured-now { display: flex; gap: 16px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.featured-now img { width: 72px; height: 108px; object-fit: cover; border-radius: 6px; background: #222; flex: none; }
.featured-now > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.featured-now strong { font-size: 19px; }
.featured-pick { display: grid; gap: 12px; }
.featured-pick label { display: grid; gap: 6px; }
.featured-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; color: var(--muted); }
.featured-hit { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 2px solid transparent;
                border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13px;
                text-align: left; cursor: pointer; }
.featured-hit img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 5px; background: #222; }
.featured-hit:hover { background: #2a2a2a; }
.featured-hit.picked { border-color: var(--red); background: #2a1214; }
.featured-pick .primary { justify-self: start; }
.featured-pick .primary:disabled { opacity: .45; cursor: default; }

/* Admin: subtitles */
.admin-links { margin: 0 0 24px; }
.sub-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 8px; }
.sub-stats .card { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.sub-stats strong { font-size: 28px; }
.sub-stats span { color: var(--muted); font-size: 14px; }
.sub-stats .alert strong { color: var(--warn); }
.sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.sources .card { display: flex; flex-direction: column; gap: 10px; }
.sources h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.sources label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
details.series-subs { margin-bottom: 10px; padding: 14px 22px; }
details.series-subs summary { cursor: pointer; }
details.series-subs table { margin-top: 12px; }
form.inline { display: inline; }
@media (max-width: 700px) {
  .sub-stats { grid-template-columns: 1fr 1fr; }
  .sources { grid-template-columns: 1fr; }
}

/* Settings */
.settings fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.settings legend { font-weight: 600; margin-bottom: 8px; }
.choice-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.notice.ok { background: #14261a; border-color: #2a5a36; color: var(--ok); }

/* Icons (Lucide, static/icons): line icons in the colour of the text */
.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.noimg .icon { width: 34px; height: 34px; color: #555; }

/* Series overview (/admin/serier): a row of episodes per season */
.admin-links { display: flex; gap: 8px; flex-wrap: wrap; }
.series-card { margin-bottom: 14px; }
.series-card h2 { margin: 0 0 2px; font-size: 1.1rem; }
.series-card > p { margin: 0 0 6px; }
.season-row { display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; }
.season-label { flex: 0 0 2.2rem; color: var(--muted); font-size: 0.85rem; line-height: 24px; }
.episodes { display: flex; flex-wrap: wrap; gap: 4px; }
.ep { width: 24px; height: 24px; border-radius: 4px; display: inline-grid; place-items: center;
      font-size: 0.7rem; font-variant-numeric: tabular-nums; }
.ep.have { background: var(--ok); color: #0b2a14; }
.ep.missing { background: #6b1015; color: #ffc9cc; }
.ep.coming { border: 1px dashed #555; color: var(--muted); min-width: 0; display: inline-grid; }  /* not the wishlist's .coming box */
.ep.extra { background: var(--warn); color: #2a2200; }
.ep.adding { background: #fff; color: #141414; font-weight: 700; }  /* in the upload, new */
.ep.adding.unlisted { box-shadow: inset 0 0 0 2px var(--warn); }  /* a number the episode list doesn't have */
.ep.double { background: repeating-linear-gradient(135deg, var(--ok) 0 4px, #2c8a48 4px 8px); color: #0b2a14; }  /* in the upload, already there */
.ep.none { visibility: hidden; }
.episodes-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.episodes-legend .ep { width: 12px; height: 12px; margin-left: 8px; }
.episodes-legend .ep:first-child { margin-left: 0; }

/* Upload: films and series, or home videos */
.mode-switch { display: flex; width: fit-content; margin: 0 auto 14px; gap: 4px; padding: 4px; background: var(--card);
               border: 1px solid var(--line); border-radius: 999px; }
.mode-switch label { padding: 8px 18px; border-radius: 999px; cursor: pointer; color: var(--muted); font-size: 16px; }
.mode-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mode-switch label:has(input:checked) { background: #fff; color: #141414; font-weight: 600; }
.mode-switch label:has(input:focus-visible) { outline: 2px solid var(--red); }

/* Start page: "Har du de här?", holes in a series someone uploaded (home.html, gaps.py) */
dialog.holes { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0;
               border-radius: 14px; background: var(--card); color: var(--text); box-shadow: 0 24px 80px rgba(0, 0, 0, .7); }
dialog.holes::backdrop { background: rgba(0, 0, 0, .65); }
dialog.holes form { display: flex; flex-direction: column; gap: 10px; padding: 24px; max-height: inherit; box-sizing: border-box; }
.holes-label { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
dialog.holes h2 { margin: 0; }
.holes-text { margin: 0 0 4px; color: var(--muted); }
.holes-grid { overflow-y: auto; min-height: 0; padding-bottom: 4px; }
.holes-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 500px) { dialog.holes form { padding: 18px; } .holes-buttons > * { flex: 1; } }

/* Martflix TV: the start page box and /kanal (channel.html, main.tv_now) */
.tv-label { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.tv-progress { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.tv-progress span { display: block; height: 100%; background: var(--red); }
.tv-box { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 18px 26px; align-items: center; }
.tv-box-now { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tv-box-title { color: var(--text); text-decoration: none; font-size: 19px; }
.tv-box-next { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 15px; }
.tv-box-next time, .tv-row time { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 6px; }
.tv-box-buttons { display: flex; flex-direction: column; gap: 8px; }
/* The start page: Martflix TV big, Martflix Film and Martflix Barn beside it, each with a small touch of its own */
@font-face { font-family: "Bebas Neue"; src: url("/static/fonts/bebas-neue.woff2") format("woff2"); font-display: swap; }
.tv-boxes { display: grid; grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px;
            margin-top: 22px; align-items: stretch; }
/* The three boxes share one grid of lines: the same padding, a one-line title of the same height and
   bars of the same footprint, so label, title, bar and the line under it sit level; buttons at the bottom */
.tv-boxes .card { padding: 34px 22px; }
.tv-boxes .tv-box { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 1fr auto; align-items: start; }
.tv-boxes .tv-box-now, .tv-mini { gap: 8px; }
.tv-boxes .tv-box-buttons { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-self: end; }
.tv-boxes .tv-box-title, .tv-mini-title { font-size: 19px; line-height: 26px; height: 26px; white-space: nowrap;
                                          overflow: hidden; text-overflow: ellipsis; }
.tv-box-next { align-self: start; }
.tv-mini { display: flex; flex-direction: column; min-width: 0; position: relative; overflow: hidden; }
.tv-mini .tv-label { text-decoration: none; }
.tv-mini-title { color: var(--text); text-decoration: none; font-weight: 700; }
.tv-mini-title .icon { width: 18px; height: 18px; vertical-align: -3px; }
.tv-mini .button { margin-top: auto; align-self: flex-start; }
.tv-mini .small { margin-bottom: 14px; }
/* Film: holes of a film strip along the top and bottom, and the title in the poster typeface of the breaks */
.tv-mini-film::before, .tv-mini-film::after { content: ""; position: absolute; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(90deg, transparent 0 8px, rgba(0, 0, 0, .55) 8px 16px, transparent 16px 24px); }
.tv-mini-film::before { top: 12px; }
.tv-mini-film::after { bottom: 12px; }
.tv-mini-film .tv-label { color: #d9a441; }
.tv-mini-film .tv-mini-title { font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: 26px;
                               letter-spacing: .03em; }
/* Barn: rounder, a warm glow in the corner and a rainbow for the progress */
.tv-mini-barn { border-radius: 20px; background:
  radial-gradient(160px 110px at 100% 0%, rgba(255, 196, 61, .14), transparent 70%),
  radial-gradient(150px 110px at 0% 100%, rgba(94, 200, 255, .10), transparent 70%), var(--card); }
.tv-mini-barn .tv-label { color: #ffc43d; }
.tv-mini-barn .tv-mini-title { font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif; }
.tv-mini-barn .tv-progress { height: 6px; margin: -1px 0; border-radius: 999px; }  /* takes the 4px of the others */
.tv-mini-barn .tv-progress span { border-radius: 999px; background: linear-gradient(90deg, #ff6b6b, #ffc43d, #5fd38d, #5ec8ff); }
.tv-mini-barn .button { border-radius: 999px; }
@media (max-width: 900px) {
  .tv-boxes { grid-template-columns: 1fr 1fr; }
  .tv-boxes .tv-box { grid-column: 1 / -1; }
}
@media (max-width: 520px) { .tv-boxes { grid-template-columns: 1fr; } }
.tv-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tv-tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  text-decoration: none; font-size: 14px; font-weight: 600; transition: color .15s, border-color .15s; }
.tv-tabs a:hover { color: var(--text); border-color: var(--muted); }
.tv-tabs a.on { color: #fff; background: var(--red); border-color: var(--red); }
.tv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tv-head h1 { margin: 0; }
.tv-now { display: flex; gap: 20px; align-items: flex-start; margin: 18px 0 8px; }
.tv-now img { width: 120px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: #222; flex: none; }
.tv-now-text { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.tv-now-text h2, .tv-now-text p { margin: 0; }
.tv-day { padding: 6px 22px; }
.tv-row { display: flex; align-items: baseline; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tv-row:last-child { border-bottom: 0; }
.tv-row.on { color: var(--text); }
.tv-row.on time { color: var(--red); font-weight: 700; }
.tv-row-title { flex: 1; min-width: 0; }
.tv-row-title .pill { margin-left: 6px; }
.tv-row > a { white-space: nowrap; color: var(--muted); }
@media (max-width: 720px) {
  .tv-box, .tv-boxes .tv-box { grid-template-columns: 1fr; }
  .tv-box-buttons { flex-direction: row; flex-wrap: wrap; }
  .tv-now img { width: 84px; }
  .tv-row { flex-wrap: wrap; row-gap: 2px; }
  .tv-row > a { flex-basis: 100%; padding-left: 56px; font-size: 13px; }  /* under the title, lined up with it */
}

/* DHT-sökning (/admin/dht): the score's bands. Säker is filled, the rest tinted; each pill also says
   its band in words, so the colour never carries it alone */
.pill.safe { background: var(--ok); color: #0b2a14; font-weight: 600; }
.pill.risk { background: #3d2416; color: #ec835a; }
.dht-score { white-space: nowrap; }
.dht-score .small { white-space: normal; max-width: 220px; }
.dl-bar { height: 4px; background: var(--line); border-radius: 2px; margin-top: 6px; max-width: 180px; overflow: hidden; }
.dl-bar span { display: block; height: 100%; background: var(--ok); border-radius: 2px; }
.dl-actions { white-space: nowrap; }
.dl-actions form { display: inline; }
label.tick { display: inline-flex; gap: 8px; align-items: center; color: var(--text); }
label.tick input { width: auto; margin: 0; accent-color: var(--red); }
/* The download queue, dragged into order by its grips, and the finished ones under it */
.dl-auto { margin: -4px 0 10px; }
.dl-hint .icon { width: 1.1em; height: 1.1em; vertical-align: -.2em; }
.dl-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dl-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
           background: var(--card); border-radius: var(--radius); padding: 12px 14px; }
.dl-done .dl-item { grid-template-columns: minmax(0, 1fr) auto; }
.dl-item.paused { opacity: .65; }
.dl-item.dragging { outline: 2px solid var(--red); box-shadow: 0 10px 28px rgba(0, 0, 0, .55); position: relative; z-index: 1; }
.dl-grip { background: none; padding: 6px 2px; margin: -2px 0; color: var(--muted); cursor: grab; touch-action: none;
           border-radius: 6px; line-height: 0; }
.dl-grip:hover, .dl-grip:focus-visible { color: var(--text); background: #2a2a2a; }
.dl-item.dragging .dl-grip { cursor: grabbing; }
.dl-title { font-size: 16px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.dl-name { overflow-wrap: anywhere; }
.dl-item .dl-bar { max-width: none; }
.dl-item .dl-actions { display: flex; gap: 14px; align-items: center; }
@media (max-width: 640px) {
  .dl-item { grid-template-columns: auto minmax(0, 1fr); }
  .dl-item .dl-actions { grid-column: 2; }
  .dl-done .dl-item { grid-template-columns: minmax(0, 1fr); }
  .dl-done .dl-item .dl-actions { grid-column: 1; }
}
/* A pasted magnet link, and what Martflix makes of it */
.magnet-paste { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin: 18px 0 14px; }
.magnet-review { margin-bottom: 18px; }
.magnet-review > p:first-child { margin-top: 0; overflow-wrap: anywhere; }
.magnet-search { display: grid; grid-template-columns: 9rem 1fr 6.5rem auto; gap: 10px; align-items: end; }
.magnet-candidates { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.magnet-candidates label { display: flex; gap: 10px; align-items: flex-start; color: var(--text); }
.magnet-candidates .overview { display: block; margin-top: 2px; }
.magnet-candidates input[type=radio], .magnet-review .check input { width: auto; margin: 3px 0 0; accent-color: var(--red); }
.magnet-review .check { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
@media (max-width: 640px) { .magnet-paste, .magnet-search { grid-template-columns: 1fr; } }
.small.warn { color: var(--warn); }
.dht-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dht-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.dht-line .pill { margin-left: 0; }
.dht-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dht-card .wish-info strong { overflow-wrap: anywhere; }  /* a torrent's name as title: no spaces to break at */
.dht-card .pill { white-space: nowrap; }
.dht-card details summary { cursor: pointer; color: var(--muted); margin: 2px 0 8px; }
.dht-tabs { display: flex; gap: 6px; margin: 28px 0 12px; border-bottom: 1px solid var(--line); }
.dht-tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dht-tabs a.on { color: var(--text); border-bottom-color: var(--red); }
.dht-search { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.dht-search input[type=search] { flex: 1; max-width: 420px; }
.dht-pages { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 20px 0; }
.dht-card.cover-seasons { opacity: .6; }  /* the torrents can't give the whole series */
.dht-card.cover-scattered { opacity: .35; }  /* not even one whole season */
.dht-card.cover-seasons .wish-poster { filter: grayscale(.6); }
.dht-card.cover-scattered .wish-poster { filter: grayscale(1); }
.dht-card.cover-seasons:hover, .dht-card.cover-scattered:hover, .dht-card:has(details.dht-pick[open]) { opacity: 1; }
.dht-card:has(details.dht-pick[open]) { grid-column: 1 / -1; }  /* opened: the whole row, for the episodes */
.dht-card:has(details.dht-pick[open]) .wish-poster { filter: none; }
.dht-pick-body { margin-top: 4px; }
.dht-seasons .season-label { display: flex; align-items: center; gap: 6px; flex: 0 0 3.6rem; }
.dht-seasons .season-row > div { display: flex; flex-direction: column; gap: 4px; }
.dht-seasons input[type=checkbox] { width: auto; margin: 0; accent-color: var(--red); }
.dht-unfit { display: flex; gap: 8px; align-items: center; margin: 14px 0 10px; }
.find { display: flex; gap: 8px; margin: 4px 0 14px; max-width: 560px; }
.find input[type=search] { flex: 1; }
.find-results { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.find-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 10px; background: #1c1c1c; }
.find-poster { width: 54px; flex: none; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: #2a2a2a; }
.find-poster.noimg { height: auto; font-size: 20px; }
.find-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.find-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.approval { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-left: 2px solid var(--red); background: #222; border-radius: 0 6px 6px 0; }
.approval-actions { display: flex; gap: 12px; align-items: center; }
.find-item:has(details.dht-pick[open]) .find-poster { display: none; }
.count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 12px; line-height: 18px; text-align: center; }
/* /admin/dht: sorting and filters under the search (dht.SORTS, dht.FILTERS) */
.dht-search { flex-wrap: wrap; }
.dht-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; flex-basis: 100%; margin-top: 4px; }
.dht-sort { display: inline-flex; align-items: center; margin-right: 6px; }
.dht-sort select { margin: 0 0 0 8px; width: auto; padding: 6px 10px; }
.dht-filter { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border: 1px solid var(--line);
              border-radius: 999px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.dht-filter input { width: auto; margin: 0; padding: 0; accent-color: var(--red); }
.dht-filter:hover { color: var(--text); }
.dht-filter.on { color: #fff; border-color: var(--red); background: rgba(229, 9, 20, .18); }
.odometer { display: inline-flex; align-items: flex-start; height: 1.15em; line-height: 1.15em; overflow: hidden; font-variant-numeric: tabular-nums; }
.odometer .wheel { display: inline-block; height: 1.15em; overflow: hidden; }
.odometer .strip { display: flex; flex-direction: column; will-change: transform; }
.odometer .strip span { height: 1.15em; line-height: 1.15em; text-align: center; }
.odometer .gap { width: 0.22em; }
.sub-stats .odometer span { font-size: inherit; color: inherit; }  /* not the cards' small grey captions */
.coming { display: inline-block; min-width: 220px; }
.coming-bar { display: block; height: 4px; margin-top: 5px; border-radius: 2px; background: #333; overflow: hidden; }
.coming-bar span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .6s; }
#dht-list[aria-busy="true"] { opacity: .6; transition: opacity .2s; }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 999px; background: #1c1c1c; color: var(--muted); font-size: 14px; }
.steps li span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #333; color: var(--text); font-weight: 600; font-size: 13px; }
.steps li.on { color: var(--text); background: #2a2a2a; }
.steps li.on span { background: var(--red); color: #fff; }
.steps li.done span { background: var(--ok); color: #0b2a14; }
.publishing { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 14px; }
.publishing .bar { flex: 1; }
.review-title { margin: 0 0 4px; }
/* Ladda upp: a YouTube link instead of files (youtube.py) */
.youtube { margin-top: 14px; display: grid; gap: 10px; }
.youtube label { color: var(--text); }
.youtube-row { display: flex; gap: 8px; }
.youtube-row input { flex: 1; }
.youtube-row button { white-space: nowrap; }
[hidden] { display: none !important; }  /* hidden always wins, also over a class that sets display (.publishing, .button) */
/* /admin/favicon: the designs in a light and a dark browser tab bar, at the sizes a tab and a bookmark use */
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin: 18px 0 28px; }
.fav { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.fav.on, .fav-own.on { outline: 2px solid var(--red); }
.fav-big { width: 96px; height: 96px; align-self: center; object-fit: contain; }
.fav-bar { padding: 6px 8px 0; border-radius: 8px; }
.fav-bar.light { background: #dee1e6; }
.fav-bar.dark { background: #202124; }
.fav-tab { display: flex; align-items: center; gap: 8px; width: 150px; padding: 7px 10px; border-radius: 8px 8px 0 0;
           font: 12px system-ui, sans-serif; }
.fav-bar.light .fav-tab { background: #fff; color: #202124; }
.fav-bar.dark .fav-tab { background: #35363a; color: #e8eaed; }
.fav-tab img[src=""] { visibility: hidden; }
.fav-sizes { display: flex; align-items: center; gap: 12px; }
.fav .buttons { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.fav-own { display: grid; gap: 12px; }
.fav-own textarea { font: 12px ui-monospace, Menlo, monospace; background: #2a2a2a; color: var(--text); border: 1px solid #444;
                    border-radius: 8px; padding: 10px; width: 100%; }
.fav-own-preview { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.fav-own-preview > div { display: grid; gap: 8px; }

/* Beroenden och kostnader (/admin/beroenden) */
.deps td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.deps .deps-total td { border-bottom: 0; }
.deps-list td { font-size: 14px; vertical-align: top; }
.deps-list td:first-child { white-space: nowrap; }
.deps-list a { color: var(--text); text-decoration: none; }
.deps-list a:hover { text-decoration: underline; }
.deps-list .pill { display: inline-block; margin-top: 4px; }
.deps-later { margin: 12px 0 0; padding-left: 18px; }
.deps-later li { margin: 4px 0; }
.deps-assume { padding: 18px 20px; }
.deps-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 16px; }
.deps-fields input { width: 100%; }
.deps-fields span { display: block; margin-top: 6px; }
@media (max-width: 900px) {
  /* Long texts under their label, not squeezed beside it */
  table.stack.deps-list td[data-label], table.stack td.long[data-label] { display: block; }
  table.stack.deps-list td[data-label]::before, table.stack td.long[data-label]::before { display: block; margin-bottom: 2px; }
  .deps-list td:first-child { white-space: normal; }
}

/* Välj film (/valj, /k/<kod>; static/valj.js) */
.pick-stage, .pick-evening, .pick-enter { max-width: 860px; }  /* the pill itself centres in the whole column */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* One pill, two halves: Snabbval in Martflix Film's look (film strip, poster letters, gold), Filmkväll in
   Martflix Barn's (rounded letters, a warm glow, a rainbow) */
.pick-home { min-height: calc(100vh - 240px); display: grid; place-items: center; }
.pick-pill { display: flex; border-radius: 999px; overflow: hidden;
             box-shadow: 0 22px 60px -24px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.pick-half-form { display: contents; }
.pick-half { position: relative; overflow: hidden; width: 300px; height: 136px; padding: 0 30px; border-radius: 0;
             display: grid; place-items: center; transition: filter .2s; }
.pick-half span { position: relative; z-index: 1; transition: transform .2s; }
.pick-half:is(:hover, :focus-visible) { filter: brightness(1.18); }
.pick-half:is(:hover, :focus-visible) span { transform: scale(1.06); }
.pick-quick, .pick-quick:hover { background: linear-gradient(135deg, #2b2217, #18140f); color: #f0c35a;
  font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: 50px; letter-spacing: .06em;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .08); }
.pick-quick::before, .pick-quick::after { content: ""; position: absolute; left: 0; right: 0; height: 8px;
  background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(0, 0, 0, .65) 10px 20px, transparent 20px 30px);
  animation: pick-roll 1.2s linear infinite paused; }
.pick-quick::before { top: 16px; }
.pick-quick::after { bottom: 16px; }
.pick-quick:is(:hover, :focus-visible)::before, .pick-quick:is(:hover, :focus-visible)::after { animation-play-state: running; }
.pick-party, .pick-party:hover { color: #fff; font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  font-size: 40px; font-weight: 800; background:
  radial-gradient(240px 150px at 100% 0%, rgba(255, 196, 61, .24), transparent 70%),
  radial-gradient(240px 150px at 0% 100%, rgba(94, 200, 255, .2), transparent 70%), #231f2b; }
.pick-party::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 28px; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, #ff6b6b, #ffc43d, #5fd38d, #5ec8ff); transition: left .3s, right .3s; }
.pick-party:is(:hover, :focus-visible)::after { left: 18%; right: 18%; }
@keyframes pick-roll { to { background-position: 30px 0; } }
.pick-stage { margin-top: 24px; }
.pick-genres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 0 12px; }
.pick-genre, .pick-genre:hover { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; align-items: flex-start;
  min-height: 170px; padding: 20px 22px; text-align: left; color: #fff; border-radius: 16px; font-size: 26px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6); transition: transform .15s, filter .15s;
  background: linear-gradient(to top, rgba(0, 0, 0, .6), transparent 65%),
              linear-gradient(color-mix(in srgb, var(--g) 70%, transparent), color-mix(in srgb, var(--g) 25%, transparent)),
              var(--img, none) center / cover, var(--g); }
.pick-genre:hover { transform: translateY(-3px); filter: brightness(1.12); }
.pick-genre span { font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .85); }
.pick-shuffle { display: flex; justify-content: center; padding: 24px 0; }
.pick-shuffle img { width: 200px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; background: #222; }
.pick-film { display: flex; gap: 18px; align-items: flex-start; background: var(--card); border-radius: var(--radius);
             padding: 14px; border: 1px solid transparent; }
.pick-film.big { padding: 20px; gap: 24px; animation: pick-in .35s ease-out; }  /* the reveal, not every redraw */
.pick-film h2 { margin: 0 0 4px; font-size: 20px; }
.pick-film.big h2 { font-size: 28px; }
.pick-film p { margin: 0 0 8px; }
.pick-poster { width: 90px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: #222; flex: none; }
.pick-film.big .pick-poster { width: 200px; }
.pick-film-text { min-width: 0; flex: 1; }
.pick-overview { line-height: 1.5; }
.pick-actions { margin-top: 14px; align-items: center; }
.pick-hint { margin: 8px 0 0; }
@keyframes pick-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pick-film { animation: none; } }

/* Filmkväll */
.pick-join-box { display: flex; gap: 22px; align-items: center; padding: 18px; }
.pick-qr { width: 180px; height: 180px; border-radius: 8px; background: #fff; flex: none; }
.pick-code { font-size: 54px; font-weight: 800; letter-spacing: 10px; margin: 4px 0 0; }
/* Everyone who has joined, as a smiling face in their own colour; newcomers pop in */
.pick-people { list-style: none; padding: 0; margin: 28px 0 22px; display: flex; flex-wrap: wrap; gap: 20px 24px; }
.pick-person { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 92px; }
.pick-face { width: 78px; height: 78px; border-radius: 50%; background: var(--c); color: #141414; display: grid;
             place-items: center; box-shadow: 0 10px 26px -12px var(--c); }
.pick-face .icon { width: 50px; height: 50px; }
.pick-name { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-person.arrive { animation: pick-arrive .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.pick-person.arrive .icon { animation: pick-wiggle .9s .45s ease-in-out; }
@keyframes pick-arrive { from { opacity: 0; transform: translateY(16px) scale(.4); } to { opacity: 1; transform: none; } }
@keyframes pick-wiggle { 30% { transform: rotate(-12deg); } 65% { transform: rotate(10deg); } }
.pick-go { margin: 6px 0 14px; }
.pick-evening label.tick { display: flex; margin: 10px 0; }
.pick-start { font-size: 20px; padding: 14px 44px; }
.pick-evening .buttons { margin-top: 16px; }
.pick-waiting { font-size: 18px; margin: 18px 0 6px; }
/* Duels: two genres in one box cut along a slant, each in its colour over a still from a film of it */
.pick-duel { position: relative; height: 380px; border-radius: 22px; overflow: hidden; background: var(--bg); }
.pick-side, .pick-side:hover { position: absolute; inset: 0; padding: 0; border-radius: 0; color: #fff; font-size: 42px;
  font-weight: 800; letter-spacing: .01em; text-shadow: 0 2px 16px rgba(0, 0, 0, .65);
  background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent 60%),
              linear-gradient(color-mix(in srgb, var(--g) 70%, transparent), color-mix(in srgb, var(--g) 30%, transparent)),
              var(--img, none) center / cover, var(--g);
  transition: filter .2s, opacity .25s; }
.pick-side span { position: absolute; top: 50%; transform: translate(-50%, -50%); transition: transform .2s; width: 40%;
                  text-align: center; line-height: 1.05; font-size: clamp(26px, 3.6vw, 42px); overflow-wrap: anywhere; }
.pick-side.a { clip-path: polygon(0 0, 55% 0, 45% 100%, 0 100%); }
.pick-side.b { clip-path: polygon(55.7% 0, 100% 0, 100% 100%, 45.7% 100%); }
.pick-side.a span { left: 26%; }
.pick-side.b span { left: 74%; }
.pick-side:is(:hover, :focus-visible) { filter: brightness(1.15) saturate(1.1); }
.pick-side:is(:hover, :focus-visible) span { transform: translate(-50%, -50%) scale(1.06); }
.pick-side:disabled { opacity: .3; }
.pick-side.chosen { opacity: 1; filter: brightness(1.2) saturate(1.2); }
.pick-or { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; pointer-events: none;
           background: var(--bg); color: var(--text); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 14px; }
.pick-duel .pick-step { position: absolute; top: 14px; left: 18px; z-index: 2; margin: 0; color: #fff; pointer-events: none;
                        text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }
/* Who is done: the faces of those still choosing are pale and bob */
.pick-people.waiting .pick-person:not(.ready) { opacity: .4; animation: pick-think 1.6s ease-in-out infinite; }
@keyframes pick-think { 50% { transform: translateY(-5px); } }
/* Three films: tap the one to take away */
.pick-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0 8px; }
.pick-option { display: flex; flex-direction: column; gap: 6px; padding: 0; background: none; text-align: left;
               border-radius: 10px; transition: opacity .2s; }
.pick-option:hover { background: none; }
.pick-option img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; background: #222;
                   outline: 3px solid transparent; transition: filter .2s, outline-color .2s; }
.pick-option strong { font-size: 15px; line-height: 1.25; }
.pick-option.out img { filter: grayscale(1) brightness(.35); outline-color: var(--red); }
.pick-option.out strong { text-decoration: line-through; color: var(--muted); }
.pick-kicker { color: var(--red); text-transform: uppercase; letter-spacing: 2px; font-weight: 700; font-size: 14px; margin: 0 0 10px; }
.pick-enter-form { padding: 20px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; max-width: 360px; }
.pick-enter-form label { width: 100%; }
.pick-code-input { text-transform: uppercase; letter-spacing: 6px; font-size: 24px; }
@media (prefers-reduced-motion: reduce) {
  .pick-person.arrive, .pick-person.arrive .icon, .pick-quick::before, .pick-quick::after { animation: none; }
}
/* On a phone the pill becomes the whole screen under the header, cut in two along a slant; the page
   colour shows through the cut. --top (valj.js) is where the screen starts. */
@media (max-width: 720px) {
  .pick-home { display: block; place-items: normal; min-height: 0; margin: -24px -20px -64px; }
  .pick-pill { position: relative; display: block; width: 100%; height: calc(100svh - var(--top, 64px));
               border-radius: 0; box-shadow: none; }
  .pick-half-form { display: block; }
  .pick-half { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; display: block; }
  .pick-half span { position: absolute; left: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
  .pick-half:is(:hover, :focus-visible) span { transform: translate(-50%, -50%) scale(1.06); }
  .pick-quick { clip-path: polygon(0 0, 100% 0, 100% 44%, 0 56%); }
  .pick-quick span { top: 26%; }
  .pick-quick, .pick-quick:hover { font-size: 68px; box-shadow: none; }
  .pick-quick::after { display: none; }
  .pick-party { clip-path: polygon(0 57.5%, 100% 45.5%, 100% 100%, 0 100%); }
  .pick-party span { top: 76%; }
  .pick-party, .pick-party:hover { font-size: 46px; background:
    radial-gradient(300px 220px at 100% 50%, rgba(255, 196, 61, .2), transparent 70%),
    radial-gradient(300px 220px at 0% 100%, rgba(94, 200, 255, .18), transparent 70%), #231f2b; }
  .pick-party::after { top: calc(76% + 34px); bottom: auto; left: 30%; right: 30%; }
  .pick-genres { grid-template-columns: 1fr; }
  .pick-genre { padding: 20px; }
  .pick-duel { height: calc(100svh - var(--top, 64px)); margin: -24px -20px -64px; border-radius: 0; }
  .pick-side.a { clip-path: polygon(0 0, 100% 0, 100% 44%, 0 56%); }
  .pick-side.b { clip-path: polygon(0 57.5%, 100% 45.5%, 100% 100%, 0 100%); }
  .pick-side.a span, .pick-side.b span { left: 50%; width: 86%; font-size: 40px; }
  .pick-side.a span { top: 26%; }
  .pick-side.b span { top: 76%; }
  .pick-or { top: 50.75%; }
  .pick-three { gap: 8px; }
  .pick-option strong { font-size: 13px; }
  .pick-film.big { flex-direction: column; }
  .pick-film.big .pick-poster { width: 160px; }
  .pick-join-box { flex-direction: column; text-align: center; }
  .pick-code { font-size: 44px; }
}

/* IMDb topp 100 (/topp-100): the leaderboard, each person's ring as full (green) as the share of the hundred
   they've seen, the trophy on the leader's; then the list, a ticked film's row green. Someone else's list (their
   picture clicked) is blue instead: their ticks, nothing to tick, their name in a bar over it, the others faded */
.top-page { max-width: 860px; margin: 0 auto; --theirs: #5b9cf5; --theirs-bg: #1b3352; }  /* in the middle of the screen */
.top-board { list-style: none; margin: 14px 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 16px 20px; }
.top-board li { display: grid; justify-items: center; width: 72px; text-align: center; transition: opacity .2s; }
.top-who { position: relative; display: block; }
.top-board .top-ring { display: block; width: 64px; height: 64px; padding: 4px; border-radius: 50%; box-sizing: border-box;
                       background: conic-gradient(var(--ok) var(--seen), var(--line) 0); }
.top-avatar { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; box-sizing: border-box;
              border-radius: 50%; border: 2px solid var(--bg); overflow: hidden; background: hsl(var(--hue) 35% 32%);
              color: #fff; font-size: 20px; font-weight: 700; }
.top-avatar img { width: 100%; height: 100%; object-fit: cover; }
.top-lead { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); display: flex; padding: 3px;
            border-radius: 50%; background: var(--bg); color: #f5c518; pointer-events: none; }
.top-lead .icon { width: 18px; height: 18px; }
.top-edit { position: absolute; right: -4px; bottom: -4px; display: flex; padding: 5px; border-radius: 50%; cursor: pointer;
            border: 2px solid var(--bg); background: #444; color: var(--text); }
.top-edit:hover { background: #666; }
.top-edit .icon { width: 12px; height: 12px; }
.top-board .top-ring.busy .top-avatar { opacity: .4; }
.top-board .top-ring.failed { background: var(--red); }
.top-board strong { margin-top: 4px; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.top-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
/* The start page's tile: the three ahead's faces in a pile, the leader's on top, where its icon was */
.top-tile .top-faces { display: flex; height: 34px; }
.top-tile .top-faces .top-avatar { position: relative; width: 34px; height: 34px; margin-left: -9px; border-color: var(--card);
                                   font-size: 13px; }
.top-tile .top-faces .top-avatar:first-child { margin-left: 0; z-index: 2; }
.top-tile .top-faces .top-avatar:nth-child(2) { z-index: 1; }
.top-tile:hover .top-faces .top-avatar { border-color: #2a2a2a; }
#top-board.viewing li:not(.shown) { opacity: .45; }
.top-board li.shown .top-ring { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--theirs); }
.top-board li.shown :is(strong, .top-name) { color: var(--theirs); }
.top-theirs { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; margin: 0 0 8px;
              padding: 8px 12px; border-radius: 8px; background: var(--theirs-bg); box-shadow: 0 6px 12px var(--bg); }
.top-theirs[hidden] { display: none; }
.top-theirs .top-avatar { width: 36px; height: 36px; flex: none; border: 0; font-size: 15px; }
.top-theirs strong { flex: 1; min-width: 0; font-size: 18px; overflow-wrap: anywhere; }
.top-theirs .button { padding: 6px 14px; font-size: 14px; white-space: nowrap; }
.top-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 6px; }
.top-list li { display: grid; grid-template-columns: 2em 36px minmax(0, 1fr) auto; gap: 12px; align-items: center;
               background: var(--card); border-radius: 8px; padding: 5px 12px; scroll-margin-top: 80px; transition: background .2s; }
.top-list:not(.theirs) li.seen { background: #1d4a2b; }
.top-list:not(.theirs) li.seen :is(.year, .muted, .top-rank) { color: #a8d8b4; }
.top-list.theirs li.theirs-seen { background: var(--theirs-bg); }
.top-list.theirs li.theirs-seen :is(.year, .muted, .top-rank) { color: #a9c7f0; }
.top-rank { color: var(--muted); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.top-poster { width: 36px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; background: #2a2a2a; }
.top-poster.noimg { height: auto; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.top-poster.noimg .icon { width: 18px; height: 18px; }
.top-title strong { overflow-wrap: anywhere; }
.top-title .pill { margin-left: 4px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-watch, .top-dht { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; font-size: 14px; }
.top-tick { margin: 0; }
.top-tick button { width: 32px; height: 32px; padding: 0; border-radius: 8px; background: none; border: 2px solid #555;
                   color: transparent; display: inline-flex; align-items: center; justify-content: center; }
.top-tick button:hover { background: none; border-color: var(--muted); color: #555; }
.top-tick button[aria-checked="true"] { background: var(--ok); border-color: var(--ok); color: #0b2a14; }
.top-tick .icon { width: 20px; height: 20px; stroke-width: 3; }
.top-list.theirs .top-tick button { pointer-events: none; background: none; border-color: #3a3a3a; color: transparent; }
.top-list.theirs li.theirs-seen .top-tick button { background: var(--theirs); border-color: var(--theirs); color: #0b1a2e; }
@media (max-width: 560px) {
  .top-board { gap: 14px; }
  .top-board li { width: 60px; }
  .top-board .top-ring { width: 56px; height: 56px; }
  .top-avatar { font-size: 18px; }
  .top-list li { grid-template-columns: 1.5em 32px minmax(0, 1fr) auto; gap: 8px; padding: 5px 8px; }
  .top-poster { width: 32px; }
  .top-watch { padding: 5px 10px; }
}

/* A series' season picker (dht_pick.html). First the seasons, a tile each, its bar what Martflix has of it; then
   the chosen ones as a picture: a column per episode, season by season, Martflix's row, then a row per torrent.
   The colours carry it: green what Martflix has, red what it lacks, and each chosen torrent its own colour
   (dark-mode categorical steps, checked for colour-blind separation; past four they come round again and the
   number in the torrent's button tells them apart) */
.season-tiles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 12px; }
.season-tile { position: relative; display: grid; gap: 6px; width: 54px; padding: 7px 7px 8px; border-radius: 8px;
               border: 1px solid #3a3a3a; background: none; color: var(--muted); font-size: 13px; font-weight: 700;
               text-align: left; }
.season-tile:hover { border-color: #777; background: none; color: var(--text); }
.season-tile[aria-pressed="true"] { border-color: transparent; background: rgba(255, 255, 255, .13); color: var(--text); }
.season-tile[aria-pressed="true"]:hover { background: rgba(255, 255, 255, .18); }
.season-tile[aria-pressed="false"] .season-bar { opacity: .45; }
.season-tile[aria-pressed="true"]::after { content: ""; position: absolute; top: 7px; right: 7px; width: 12px; height: 12px;
  background: currentColor; -webkit-mask: url(icons/check.svg) center / contain no-repeat; mask: url(icons/check.svg) center / contain no-repeat; }
.season-tile:disabled { opacity: .3; cursor: default; border-color: #3a3a3a; color: var(--muted); }
.season-bar { display: flex; gap: 1px; height: 6px; }
.season-bar i { min-width: 1px; border-radius: 1px; background: var(--tone); }
.season-bar .queued { background: none; box-shadow: inset 0 0 0 1px var(--ok); }
.map { display: grid; gap: 3px; margin: 6px 0 12px; }
.map-row { display: grid; grid-template-columns: 300px minmax(0, 1fr) 48px; align-items: center; column-gap: 12px;
           padding: 4px 6px; border-radius: 6px; }
/* Every row's strip on one grid (--tracks: a column an episode, a narrow one between seasons; zooming in on a
   season widens its columns: dht-pick.js), so the episodes line up from row to row. A row is a run for each
   stretch alike, its episodes ticked off by the gradient: a 1px gap after each, none once an episode is
   narrower than 3px (a long series, or the seasons beside the one zoomed in on) */
.map-strip { display: grid; grid-template-columns: var(--tracks); align-items: center; min-width: 0; }
.map-strip > * { grid-row: 1; }
.map .run { --tick: clamp(0px, (100% / var(--n) - 3px) * 100, 1px); height: 10px; border-radius: 2px;
            background: repeating-linear-gradient(90deg, var(--tone) 0 calc(100% / var(--n) - var(--tick)),
                                                  transparent 0 calc(100% / var(--n))); }
.map-martflix .run { height: 18px; }
.cell { display: inline-block; background: var(--tone); }
:is(.cell, .run, .season-bar i).have { --tone: var(--ok); }
:is(.cell, .run, .season-bar i).missing { --tone: #a3242b; }
:is(.cell, .run, .season-bar i).future { --tone: #2b2b2b; }
.cell.queued, .map .run.queued { background: none; box-shadow: inset 0 0 0 2px var(--ok); }
.run.has { --tone: #8f8f8f; }  /* a torrent not chosen: what it holds that Martflix lacks */
.run.had { --tone: #3f3f3f; }  /* what it holds that Martflix has */
.run.spare { opacity: .3; }  /* a chosen torrent: what it holds that comes from elsewhere, or is there */
.c0:is(.cell, .run, .map-pick) { --tone: #3987e5; }
.c1:is(.cell, .run, .map-pick) { --tone: #d95926; }
.c2:is(.cell, .run, .map-pick) { --tone: #9085e9; }
.c3:is(.cell, .run, .map-pick) { --tone: #d55181; }
.map-season { background: none; padding: 0 0 2px; border-radius: 0; font-size: 12px; font-weight: 700; color: var(--muted);
              text-align: left; min-width: 0; overflow: hidden; white-space: nowrap; cursor: zoom-in;
              container-type: inline-size; }
.map-season span::before { content: "S"; }
@container (max-width: 26px) { .map-season span::before { content: none; } }  /* squeezed: the number, then nothing */
@container (max-width: 12px) { .map-season span { visibility: hidden; } }
.map-season:hover { background: none; color: var(--text); }
.map-season.zoomed { color: var(--text); cursor: zoom-out; text-decoration: underline; text-underline-offset: 3px; }
.map-side { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 13px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); padding: 0 6px 8px 318px; }
.cell.every { background: linear-gradient(90deg, #3987e5 25%, #d95926 25% 50%, #9085e9 50% 75%, #d55181 75%); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend .cell, .map-gap .cell { width: 10px; height: 10px; border-radius: 2px; }
.map-torrent { background: rgba(255, 255, 255, .03); }
.map-torrent.chosen { background: rgba(255, 255, 255, .08); }
.map-torrent.just { animation: map-just 1.2s ease-out; }  /* the one just clicked, where it is now */
@keyframes map-just { from { background: rgba(255, 255, 255, .24); } }
@media (prefers-reduced-motion: reduce) { .map-torrent.just { animation: none; outline: 1px solid var(--muted); } }
.map-torrent.unfit .map-side > :not(.map-pick), .map-torrent.unfit .map-strip,
.map-torrent.risky .map-side > :not(.map-pick), .map-torrent.risky .map-strip { opacity: .5; }
.map-pick { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid #666; background: none; flex: none;
            color: #141414; font-weight: 800; font-size: 12px; line-height: 1; }
.map-pick:hover { border-color: var(--text); background: none; }
.map-pick[aria-pressed="true"] { border-color: transparent; background: var(--tone); }
.map-pick[aria-pressed="true"]:hover { border-color: var(--text); background: var(--tone); }
.map-pick:disabled { opacity: .3; cursor: not-allowed; border-style: dashed; }
.map-mf { min-width: 30px; text-align: center; border: 1px solid var(--red); border-radius: 999px; padding: 0 5px;
          font-weight: 700; font-size: 12px; }
.map-q { min-width: 40px; font-size: 12px; color: var(--muted); }
.map-q.warn { color: var(--warn); font-weight: 700; }
.map-safe, .map-seed { display: inline-flex; align-items: center; gap: 2px; min-width: 42px; font-size: 12px;
                       font-variant-numeric: tabular-nums; }
/* Their icons drawn from the icon files (fetched once) rather than inline: a long series has hundreds of rows */
.map-safe::before, .map-seed::before, .map-more::before { content: ""; display: block; flex: none; width: 14px;
                                                          height: 14px; background: currentColor; }
.map-safe::before { -webkit-mask: url(icons/shield.svg) center / contain no-repeat; mask: url(icons/shield.svg) center / contain no-repeat; }
.map-seed::before { -webkit-mask: url(icons/users.svg) center / contain no-repeat; mask: url(icons/users.svg) center / contain no-repeat; }
.map-more::before { -webkit-mask: url(icons/chevron-down.svg) center / contain no-repeat;
                    mask: url(icons/chevron-down.svg) center / contain no-repeat; transition: transform .15s; }
.map-safe.safe { color: var(--ok); }
.map-safe.green { color: #9bd36b; }
.map-safe.warn { color: var(--warn); }
.map-safe.risk { color: #ec835a; }
.map-seed { color: var(--muted); }
.map-seed.none { color: #ec835a; font-weight: 700; }
.map-seed.unknown { color: var(--warn); }
.map-size { font-size: 12px; color: var(--muted); white-space: nowrap; }
.map-end { display: flex; justify-content: flex-end; gap: 2px; }
.map-more, .map-alts { background: none; padding: 2px 4px; border-radius: 4px; color: var(--muted); font-size: 12px; }
.map-more:hover, .map-alts:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.map-more[aria-expanded="true"]::before { transform: rotate(180deg); }
.map-detail { grid-column: 1 / -1; padding: 8px 4px 6px 36px; }
.map-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.map-gap { display: inline-flex; align-items: center; gap: 6px; color: #ff9a9f; }
@media (max-width: 640px) {
  .map-row { grid-template-columns: minmax(0, 1fr) 48px; row-gap: 6px; }  /* every strip as wide: the seasons line up */
  .map-side { grid-column: 1 / -1; }
  .map-head .map-side { display: none; }
  .map-legend { padding-left: 6px; }
}
