/* Protonia portal. Visual language borrowed from Elklockan: a Recraft comic banner (night sky
   #062b5e, sky blue, amber, orange), Ben-Day dot background, see-through cards with corner
   brackets, amber uppercase labels. Always dark. */
:root {
  --bg: #061226; --card: #0d1d38; --card-2: #142a4d; --text: #e9f0fa; --muted: #93a6c2; --line: #1e365c;
  --ok: #3ccf7a; --warn: #f2b33d; --crit: #ff5c63; --info: #4fb3ee; --hud: #4fb3ee; --amber: #f2b33d;
  --radius: 8px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: #040c1a; }
body {
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, #0a2147 0, #061226 520px, #040c1a 100%) fixed;
  min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle, rgb(79 179 238 / 0.24) 0 1.3px, transparent 1.8px) 0 0 / 12px 12px,
    radial-gradient(circle, rgb(236 122 15 / 0.14) 0 1.1px, transparent 1.6px) 6px 6px / 12px 12px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 78%);
}
a { color: var(--hud); }
a:hover { color: #8fd0f6; }
h1, h2, h3 { margin: 0; font-weight: 650; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
code { font: 0.92em ui-monospace, "SF Mono", Menlo, monospace; background: var(--card-2); padding: 1px 6px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
:focus-visible { outline: 2px solid var(--hud); outline-offset: 2px; }

/* The frame around banner + content + footer */
.frame { max-width: 1120px; margin: 0 auto; background: #05285d; position: relative; overflow: clip; min-height: 100vh; display: flex; flex-direction: column; }
@media (min-width: 760px) {
  .frame { margin: 16px auto 24px; min-height: 0; border: 1px solid #02060d; border-radius: 10px; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35), 0 20px 60px rgb(0 0 0 / 0.55); }
}

/* Banner header */
.top {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; gap: 16px;
  grid-template-areas: "brand who" ". ." "menu menu";
  min-height: 290px; padding: 28px 20px 16px;
  background:
    linear-gradient(0deg, rgb(6 18 38 / 0.85) 0%, rgb(6 18 38 / 0) 38%),
    #062b5e url("banner.webp") center 88% / cover no-repeat;
  border-bottom: 1px solid #02060d;
}
.brand { grid-area: brand; display: flex; gap: 14px; align-items: center; }
.logo { width: 54px; height: 54px; border-radius: 12px; flex: none; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.14), 0 4px 14px rgb(0 0 0 / 0.45); }
.brand h1 { font-size: 1.7rem; letter-spacing: 0.01em; text-shadow: 0 1px 8px rgb(0 0 0 / 0.6); }
.brand p { margin: 2px 0 0; color: #c9d4e4; font-size: 0.88rem; max-width: 34ch; text-shadow: 0 1px 2px rgb(0 0 0 / 0.9), 0 1px 8px rgb(0 0 0 / 0.8); }
.who { grid-area: who; align-self: start; display: flex; gap: 10px; align-items: center; font-size: 0.85rem; background: rgb(6 18 38 / 0.74); border: 1px solid rgb(255 255 255 / 0.14); padding: 5px 12px; border-radius: 999px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.who a { color: #c9d4e4; }
.menu {
  grid-area: menu; justify-self: start;
  display: flex; flex-wrap: wrap; gap: 2px; max-width: 100%;
  padding: 4px; border-radius: 10px; background: rgb(6 18 38 / 0.78); border: 1px solid rgb(255 255 255 / 0.14);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.menu a { color: #c9d4e4; text-decoration: none; font-weight: 600; font-size: 0.92rem; letter-spacing: 0.02em; padding: 8px 16px; border-radius: 7px; position: relative; }
.menu a:hover { color: #fff; background: rgb(255 255 255 / 0.07); }
.menu a.on { color: #fff; background: rgb(79 179 238 / 0.16); }
.menu a.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 1px; background: var(--hud); }
@media (max-width: 600px) {
  .top {
    grid-template-columns: 1fr; grid-template-areas: "who" "brand" "." "menu";
    min-height: 260px; padding: 14px 14px 12px; gap: 12px;
    background-image: linear-gradient(90deg, rgb(6 18 38 / 0.9) 0%, rgb(6 18 38 / 0.55) 60%, rgb(6 18 38 / 0.2) 100%), linear-gradient(0deg, rgb(6 18 38 / 0.85) 0%, rgb(6 18 38 / 0) 45%), url("banner.webp");
    background-position: 0 0, 0 0, 78% 60%; background-size: auto, auto, cover;
  }
  .who { justify-self: end; }
  .brand h1 { font-size: 1.4rem; }
  .logo { width: 46px; height: 46px; }
  .menu a { padding: 8px 11px; font-size: 0.88rem; }
}

main { flex: 1; padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; position: relative; z-index: 1; }
@media (max-width: 600px) { main { padding: 14px; } }

/* Headings above sections, Elklockan style */
.hello { margin: 4px 0 -4px; }
.hello.split { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.kicker { margin: 0 0 2px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }
.title { font-size: 1.35rem; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.crumb { margin: 0; font-size: 0.88rem; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--text); }

/* Cards with corner brackets */
.card {
  --frame: var(--hud);
  position: relative; min-width: 0;
  padding: 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--frame) 22%, var(--line));
  box-shadow: inset 0 1px 28px color-mix(in srgb, var(--frame) 5%, transparent);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.card[data-status="warn"] { --frame: var(--warn); }
.card[data-status="crit"] { --frame: var(--crit); }
.card[data-status="ok"] { --frame: var(--ok); }
.card::after {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  --l: 14px; --w: 2px; --c: linear-gradient(var(--frame), var(--frame));
  background:
    var(--c) top left / var(--l) var(--w), var(--c) top left / var(--w) var(--l),
    var(--c) top right / var(--l) var(--w), var(--c) top right / var(--w) var(--l),
    var(--c) bottom left / var(--l) var(--w), var(--c) bottom left / var(--w) var(--l),
    var(--c) bottom right / var(--l) var(--w), var(--c) bottom right / var(--w) var(--l);
  background-repeat: no-repeat; opacity: 0.75; border-radius: var(--radius);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  margin: -16px -16px 14px; padding: 12px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--frame) 13%, transparent), color-mix(in srgb, var(--frame) 4%, transparent));
  border-bottom: 1px solid color-mix(in srgb, var(--frame) 22%, transparent);
}
.card-head h2 { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; color: var(--amber); }
.card[data-status="crit"] .card-head h2 { color: #ff8b90; }

/* Status */
.status-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.status-row p { flex: 1 1 280px; margin: 2px 0 0; }
.chip { display: inline-flex; align-items: center; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid; }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.chip.crit { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 50%, transparent); background: color-mix(in srgb, var(--crit) 12%, transparent); }
.chip.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 45%, transparent); background: color-mix(in srgb, var(--info) 10%, transparent); font-size: 0.68rem; padding: 1px 7px; }
.title .chip { font-size: 0.78rem; }
.note { margin-top: 12px; padding: 8px 12px; border-left: 3px solid var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); border-radius: 0 6px 6px 0; font-size: 0.9rem; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hello .actions { margin-top: 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  min-height: 40px; padding: 8px 16px; border-radius: 8px;
  font: inherit; font-weight: 600; font-size: 0.9rem; text-decoration: none; cursor: pointer;
  color: var(--amber); background: rgb(6 18 38 / 0.5); border: 1px solid color-mix(in srgb, var(--amber) 55%, transparent);
}
.btn:hover { color: #ffd27a; border-color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, rgb(6 18 38 / 0.5)); }
.btn.primary { color: #1a1204; background: var(--amber); border-color: var(--amber); }
.btn.primary:hover { background: #ffc85c; color: #1a1204; }
.btn.danger { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 55%, transparent); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn .ic { width: 18px; height: 18px; }
.mobile-only { display: none; }
@media (hover: none) and (pointer: coarse) { .mobile-only { display: inline-flex; } }

/* Service tiles */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px; min-height: 96px;
  border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--hud) 22%, var(--line));
  transition: border-color 0.15s, transform 0.15s;
}
a.tile:hover { border-color: var(--hud); color: var(--text); transform: translateY(-1px); }
.tile .ic { width: 28px; height: 28px; flex: none; color: var(--hud); margin-top: 2px; }
.tile h3 { font-size: 1rem; margin-bottom: 2px; }
.tile p { margin: 0; color: var(--muted); font-size: 0.86rem; }
.tile.locked { opacity: 0.55; border-style: dashed; }
@media (max-width: 600px) { .tile { min-height: 0; padding: 14px; } }
.tile.locked .ic { color: var(--muted); }
.ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Forms */
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.field small { color: var(--muted); font-size: 0.78rem; }
input, select {
  font: inherit; color: var(--text); background: rgb(4 12 26 / 0.7);
  border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; min-height: 40px; width: 100%;
}
input:focus, select:focus { border-color: var(--hud); outline: none; box-shadow: 0 0 0 3px rgb(79 179 238 / 0.2); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; }
.inline-form .field { flex: 1 1 240px; }
.stack { display: grid; gap: 12px; }
.stack.narrow { max-width: 460px; }
.stack .btn { justify-self: start; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { flex: none; width: 20px; height: 20px; min-height: 0; margin: 1px 0 0; accent-color: var(--amber); }
.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg legend { font-size: 0.8rem; color: var(--muted); font-weight: 600; padding: 0; margin-bottom: 6px; width: 100%; }
.seg label { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.seg label:has(input:checked) { border-color: var(--amber); color: var(--amber); }
.seg input { width: auto; min-height: 0; accent-color: var(--amber); }

/* Payment */
.months { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip-btn {
  display: grid; gap: 1px; text-align: center; min-width: 96px; padding: 9px 14px; border-radius: 9px; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--text); background: rgb(4 12 26 / 0.6); border: 1px solid var(--line);
}
.chip-btn small { color: var(--muted); font-weight: 500; }
.chip-btn:hover { border-color: var(--amber); }
.chip-btn.on { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, rgb(4 12 26 / 0.6)); color: var(--amber); }
.chip-btn.on small { color: #ffd27a; }
.pay-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: stretch; }
.swish { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.swish img { width: 220px; height: 220px; border-radius: 10px; background: #fff; padding: 6px; }
.swish > div { flex: 1 1 200px; }
.big { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 4px; }

/* Lists, tables, stats */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 0.86rem; }
.kv dd { margin: 0; }
.list { margin: 0; padding: 0; list-style: none; }
.list li { padding: 7px 0; }
.list li + li { border-top: 1px solid var(--line); }
.list.log li { font-size: 0.88rem; }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: color-mix(in srgb, var(--card-2) 85%, transparent); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.stat .k { font-size: 0.74rem; color: var(--muted); }
.stat .v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.warn .v { color: var(--warn); }
.stat.crit .v { color: var(--crit); }
.table-wrap { overflow-x: auto; margin: 0 -16px -16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tbl th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; padding: 8px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: rgb(79 179 238 / 0.05); }
.tbl a { text-decoration: none; }

/* Steps (passkey guide) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps .num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #1a1204; background: var(--amber); }
.steps h3 { font-size: 1rem; margin-bottom: 2px; }
.steps p { margin: 0; color: #c9d4e4; }

/* Flash */
.flash { padding: 10px 14px; border-radius: 8px; font-weight: 600; }
.flash.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }

/* Footer: a comic shelf of media (films, TV, records, books, games) in the banner's style; the
   night sky at its top fades into the page, the text sits on a dark band along the bottom */
.foot {
  position: relative; z-index: 0; margin-top: 8px;
  aspect-ratio: 1536 / 400; min-height: 190px;
  display: flex; align-items: flex-end; padding: 0 20px 12px;
  font-size: 0.82rem; color: #c9d4e4; text-shadow: 0 1px 3px rgb(0 0 0 / 0.95);
  background: linear-gradient(0deg, rgb(5 13 27 / 0.85) 0%, rgb(5 13 27 / 0) 30%), #05285d url("footer-media.webp") center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgb(0 0 0 / 0.6) 50px, #000 110px);
  mask-image: linear-gradient(180deg, transparent 0, rgb(0 0 0 / 0.6) 50px, #000 110px);
}
.foot p { margin: 0; max-width: 60ch; padding: 6px 12px; border-radius: 8px; background: rgb(6 18 38 / 0.78); border: 1px solid rgb(255 255 255 / 0.14); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* Latest movies / series */
.media { list-style: none; margin: -6px 0; padding: 0; }
.media li + li { border-top: 1px solid var(--line); }
.media a { display: grid; gap: 2px; padding: 9px 0; color: var(--text); text-decoration: none; }
.media li.has-ext { position: relative; }
.media li.has-ext > a:first-child { padding-right: 4.2em; }
.media a.m-ext { position: absolute; top: 9px; right: 0; display: inline; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; font-size: 0.72rem; color: var(--muted); }
.media a.m-ext:hover { color: #f5c518; border-color: #f5c518; }
.media a:hover .m-title { color: var(--hud); }
.media li.has-thank { position: relative; }
.media li.has-thank > a:first-child { padding-right: 5.6em; }
.m-thank { position: absolute; right: 0; bottom: 9px; margin: 0; font-size: 0.74rem; }
.m-thank button { min-height: 26px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.m-thank button:hover, .m-thank button:focus-visible { color: #ff8fb1; border-color: #ff8fb1; }
.m-thank.done, .m-thank.own { padding: 2px 9px; color: #ff8fb1; font-weight: 600; }
.m-thank .n { font-variant-numeric: tabular-nums; }
.thanks-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.thanks-list .heart { color: #ff8fb1; }
@media (pointer: coarse) { .m-thank button { min-height: 36px; } }
.m-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-sub { font-size: 0.86rem; color: #c9d4e4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-sub .ep { font-weight: 700; color: var(--amber); font-variant-numeric: tabular-nums; }
.m-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.78rem; }
.tag { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 4px; color: var(--hud); border: 1px solid color-mix(in srgb, var(--hud) 40%, transparent); }

/* Claims: approve / reject */
.claims li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.claim-actions { display: flex; gap: 8px; margin: 10px 0; }
.claims .claim-actions { margin: 0; }
.claim-actions form { margin: 0; }
.claim-actions .btn { min-height: 34px; padding: 5px 14px; }

/* Login page: text beside Authelia's form (in a frame), stacked on phones */
.login-wrap { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); align-items: start; padding: 8px 0 12px; }
.login-text { padding-top: 24px; }
.login-text .title { font-size: 1.7rem; margin-bottom: 10px; }
.login-card { padding: 0; overflow: hidden; }
.login-card iframe { display: block; width: 100%; height: 500px; border: 0; background: transparent; color-scheme: dark; }
@media (max-width: 760px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-text { padding-top: 0; }
  .login-card { order: -1; }   /* the form first on phones */
  /* …but the "new login" note above it: the text block dissolves so the note can be ordered on its own */
  .login-wrap:has(.login-news) { gap: 0; }
  .login-wrap:has(.login-news) .login-text { display: contents; }
  .login-wrap:has(.login-news) .login-card { margin-bottom: 20px; }
  .login-news { order: -2; margin: 0 0 16px; }
  .login-card iframe { height: 500px; }
}
.check span { line-height: 1.35; }
.check small { font-size: 0.8rem; }

/* Series (FlexGet) */
.sugg li, .watched li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.watched li > div:first-child { flex: 1 1 220px; }
.sugg form, .watched form { margin: 0; }
.sugg .btn, .watched .btn { min-height: 34px; padding: 5px 14px; }
.row-form { display: flex; gap: 6px; align-items: center; }
.row-form select { width: auto; min-height: 34px; padding: 4px 8px; }
.js .nojs { display: none; }
.form-sub { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--amber); margin-top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.crit { color: var(--crit); }
.w-main { flex: 1 1 260px; min-width: 0; }
.w-main a { color: var(--text); text-decoration: none; }
.w-main a:hover { color: var(--hud); }
.facts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 3px; }
.facts .chip { font-size: 0.68rem; padding: 1px 7px; }
.years { font-size: 0.82rem; color: #c9d4e4; font-variant-numeric: tabular-nums; }
.fix { margin-top: 4px; font-size: 0.82rem; }
.fix summary { cursor: pointer; color: var(--muted); width: max-content; }
.fix .row-form { margin-top: 6px; max-width: 460px; }
.fix .row-form input { min-height: 34px; padding: 4px 8px; }
.fix p { margin: 4px 0 0; }
.credit { margin: 10px 0 0; }
.flash.toast {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 10;
  width: max-content; max-width: calc(100vw - 32px); background: #0b2a1f; box-shadow: 0 6px 24px rgb(0 0 0 / 0.5);
  transition: opacity 0.4s;
}
.flash.toast.gone { opacity: 0; pointer-events: none; }
.card-link { font-size: 0.82rem; font-weight: 600; color: var(--hud); text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.media.wide { columns: 2 340px; column-gap: 28px; }
.media.wide li { break-inside: avoid; }
.card > p.card-more { max-width: none; margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.media.wide li + li { border-top: 0; }
.media.wide li { border-bottom: 1px solid var(--line); }
.card-head .card-link { margin-left: auto; flex: none; white-space: nowrap; }
.card-head h2 { min-width: 0; }
.media.wide li:last-child { border-bottom: 0; }

/* TVmaze posters */
.thumb { width: 42px; height: 59px; flex: none; border-radius: 5px; object-fit: cover; background: rgb(255 255 255 / 0.06); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1); }
.thumb.none { display: block; background: repeating-linear-gradient(135deg, rgb(255 255 255 / 0.04) 0 6px, transparent 6px 12px); }
.media.thumbs a { grid-template-columns: 42px minmax(0, 1fr); column-gap: 12px; align-items: center; }
.m-text { display: grid; gap: 2px; min-width: 0; }
.watched li { flex-wrap: nowrap; align-items: flex-start; }
.watched li > .thumb { margin-top: 2px; }
.watched li > form { margin-top: 4px; }
@media (max-width: 560px) { .watched li { flex-wrap: wrap; } .watched li > form:first-of-type { margin-left: 54px; } }

/* Dina filer: own torrents */
.torrent-form .type { flex: 0 1 180px; }
.crit-note { border-left-color: var(--crit); background: color-mix(in srgb, var(--crit) 10%, transparent); margin: 0 0 4px; }
.torrents { margin-top: 10px; }
.torrents li { display: grid; gap: 4px; }
.t-name { display: flex; gap: 8px; align-items: center; min-width: 0; }
.t-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.t-name .tag { flex: none; }
.t-status { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.bar { flex: 1 1 200px; max-width: 420px; height: 8px; border-radius: 4px; background: rgb(255 255 255 / 0.1); overflow: hidden; }
.bar .fill { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--hud), var(--amber)); transition: width 0.6s; }
/* width in 5 % steps: the CSP forbids inline style attributes */
.w0{width:0%} .w5{width:5%} .w10{width:10%} .w15{width:15%} .w20{width:20%} .w25{width:25%} .w30{width:30%} .w35{width:35%} .w40{width:40%} .w45{width:45%} .w50{width:50%} .w55{width:55%} .w60{width:60%} .w65{width:65%} .w70{width:70%} .w75{width:75%} .w80{width:80%} .w85{width:85%} .w90{width:90%} .w95{width:95%} .w100{width:100%}
.traffic { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; color: #c9d4e4; font-variant-numeric: tabular-nums; }
.traffic strong { color: var(--text); }
/* torrent state pills: same size as the other chips; download blue, check/done green, seeding violet */
.chip.t-chip { font-size: 0.74rem; padding: 3px 9px; }
.chip.dl { color: var(--info); border-color: color-mix(in srgb, var(--info) 50%, transparent); background: color-mix(in srgb, var(--info) 12%, transparent); }
.chip.seed { --seed: #b896ff; color: var(--seed); border-color: color-mix(in srgb, var(--seed) 50%, transparent); background: color-mix(in srgb, var(--seed) 12%, transparent); }

/* torrent rows: everything after the name on one wrapping line, actions at the end */
.torrents li { gap: 6px; }
.t-actions { display: inline-flex; gap: 6px; align-items: flex-start; margin-left: auto; }
.t-actions form { margin: 0; }
.small-btn { min-height: 30px; padding: 3px 12px; font-size: 0.82rem; }
.t-del { display: grid; justify-items: end; }
.t-del summary { list-style: none; cursor: pointer; }
.t-del summary::-webkit-details-marker { display: none; }
.t-confirm { margin-top: 6px; width: min(300px, 78vw); padding: 12px; border-radius: 10px; text-align: left;
  background: color-mix(in srgb, var(--crit) 8%, rgb(4 12 26 / 0.85)); border: 1px solid color-mix(in srgb, var(--crit) 45%, var(--line)); display: grid; gap: 8px; }
.t-confirm p { margin: 0; }
.t-confirm .btn { justify-self: start; }
.t-actions:has(.t-del[open]) { flex-basis: 100%; justify-content: flex-end; }
.t-actions:has(.t-del[open]) > form { display: none; }

/* header membership badge */
.badge { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; padding-right: 10px; margin-right: 2px; border-right: 1px solid rgb(255 255 255 / 0.18); }
.badge .chip { font-size: 0.7rem; padding: 1px 8px; }
.badge-until { color: #c9d4e4; white-space: nowrap; }
a.badge:hover .badge-until { color: #fff; }
.badge-short { display: none; color: #c9d4e4; white-space: nowrap; }
@media (max-width: 560px) { .badge-until { display: none; } .badge-short { display: inline; } }
.credit-mini { margin-left: auto; font-size: 0.72rem; color: var(--muted); }
/* checking: green fills over the downloaded part, from the left */
.bar { position: relative; }
.bar .fill.check { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, color-mix(in srgb, var(--ok) 70%, #0b3) , var(--ok)); }

/* Server status (start page card + admin System) */
.flash.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.sys-grid { display: grid; gap: 14px 40px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); align-items: start; }
.sys-disk { display: grid; gap: 8px; }
.sys-disk p { margin: 0; }
.sys-foot { margin: 12px 0 0; }
.card .table-wrap + p, .card .table-wrap + .actions { margin-top: 28px; } /* .table-wrap bleeds 16px into the padding */
.sys-disk .bar { max-width: none; flex: none; }
.bar .fill.warn { background: linear-gradient(90deg, var(--amber), var(--warn)); }
.bar .fill.crit { background: linear-gradient(90deg, var(--warn), var(--crit)); }
.sys-net { display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.sys-net-row { display: grid; grid-template-columns: minmax(4.5em, auto) 1fr 1fr; gap: 8px 12px; align-items: baseline; }
.sys-net-row .k { color: var(--muted); font-size: 0.82rem; }
.sys-ctr td.t-actions { display: table-cell; text-align: right; white-space: nowrap; }
.sys-ctr td.t-actions .t-del { display: inline-grid; margin-left: 6px; }
pre.log { margin: 0; max-height: 70vh; overflow: auto; padding: 12px; border-radius: 8px; background: var(--card-2); font: 0.8rem/1.45 ui-monospace, "SF Mono", Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.login-alt { display: flex; justify-content: center; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.login-alt .btn { width: 100%; justify-content: center; }
.m-sub .imdb strong { color: #f5c518; font-weight: 700; }  /* IMDb's yellow */
.sys-doomed td { color: var(--warn); }
.sys-log { margin-top: 14px; }
.sys-log summary { cursor: pointer; color: var(--muted); font-size: 0.86rem; }
.sys-log .table-wrap { margin-top: 10px; }
.card .actions + .table-wrap { margin-top: 16px; }
.card .table-wrap + .sys-log { margin-top: 28px; }
.sys-log + p, .card .table-wrap + p.muted { margin-top: 12px; }

/* readable line length in full-width cards */
.card > p, .card > .muted, .steps p, .note { max-width: 78ch; }
.chip.muted { color: var(--muted); border-color: var(--line); background: rgb(255 255 255 / 0.04); }
.tbl .nw { white-space: nowrap; }

/* confirm-first buttons (confirmPost): left = the box opens under the button */
.t-del.left { justify-items: start; }
.claim-actions .t-del summary { min-height: 34px; padding: 5px 14px; }
.watched li:has(.t-del[open]) { flex-wrap: wrap; }
.watched .t-del[open] { flex-basis: 100%; }
/* a row of red "Sluta följa" would outshout the series names: neutral until hovered or opened */
.watched .t-del > summary.btn.danger { color: var(--muted); border-color: var(--line); }
.watched .t-del > summary.btn.danger:hover, .watched .t-del[open] > summary.btn.danger { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 55%, transparent); }
@media (pointer: coarse) { .sugg .btn, .watched .btn, .watched select, .small-btn { min-height: 44px; } }

/* Swish on phones: the app button first, the QR code only on request (it can't scan itself) */
.mobile-block { display: none; }
@media (hover: none) and (pointer: coarse) {
  .mobile-block { display: block; }
  .desk-only { display: none; }
  .swish .mobile-only { margin: 4px 0 8px; }
}
.qr-phone summary { cursor: pointer; color: var(--muted); font-size: 0.86rem; margin-top: 10px; }
.qr-phone img { margin-top: 10px; width: 220px; height: 220px; border-radius: 10px; background: #fff; padding: 6px; }
.paid-step { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; justify-items: start; }
.paid-step p, .paid-step form { margin: 0; }
.more-pay { display: grid; gap: 16px; }
.more-pay > summary { list-style: none; justify-self: start; }
.more-pay > summary::-webkit-details-marker { display: none; }
.swish > .desk-only { flex: none; }
.tbl td.res { min-width: 16em; }

.how-works { margin-top: 18px; }
.how-works summary { cursor: pointer; color: var(--muted); font-size: 0.86rem; width: max-content; }
.how-works p, .how-works ul { font-size: 0.9rem; margin-top: 10px; max-width: none; }
.how-works li + li { margin-top: 6px; }

.card-fold > summary { list-style: none; cursor: pointer; }
.card-fold > summary::-webkit-details-marker { display: none; }
.card-fold > summary::after { content: ''; margin-left: auto; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.15s; }
.card-fold:not([open]) > summary::after { transform: rotate(-45deg); }
.card-fold:not([open]) > summary { margin-bottom: -4px; }
.card-fold .note, .card-fold p { max-width: none; }
