/* Arr Home — "projection booth": warm near-black, marquee amber for what's live,
   tall condensed display type, film-perforation and ticket-stub details. */

@font-face { font-family: "Marquee"; src: url("/fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Marquee"; src: url("/fonts/big-shoulders-display-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Instrument"; src: url("/fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument"; src: url("/fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/plexmono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/plexmono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;
  --ink: #100e0b;
  --ink-2: #17140f;
  --panel: #1c1813;
  --panel-2: #241f18;
  --line: #342d23;
  --line-2: #4a4032;
  --text: #f1e8d8;
  --muted: #a89a82;
  --dim: #978a74;
  --amber: #f5b544;
  --amber-2: #ffd27a;
  --amber-glow: rgba(245, 181, 68, 0.28);
  --red: #ff6b57;
  --red-bg: rgba(255, 107, 87, 0.12);
  --ok: #7fd1a8;
  --ok-bg: rgba(127, 209, 168, 0.12);
  --tv: #86b7ff;
  --movie: #f5b544;
  --movie4k: #e58cff;
  --r: 14px;
  --display: "Marquee", "Arial Narrow", sans-serif;
  --body: "Instrument", ui-sans-serif, sans-serif;
  --mono: "Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(245, 181, 68, 0.09), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(229, 140, 255, 0.05), transparent 60%),
    var(--ink);
  color: var(--text);
  font: 15px/1.45 var(--body);
  min-height: 100vh;
}
/* film grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--amber-2); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 0.82em; letter-spacing: 0.01em; }
.dim { color: var(--dim); }
.muted { color: var(--muted); }
.warn { color: var(--amber); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- buttons */
.btn {
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.btn:hover { border-color: var(--amber); color: var(--amber-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn.quiet { background: transparent; }
.btn.solid, .btn.go { background: var(--amber); color: #1a1206; border-color: var(--amber); }
.btn.solid:hover, .btn.go:hover { background: var(--amber-2); color: #1a1206; }
.btn.danger:hover, .btn.armed { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.btn.tiny { padding: 2px 9px; font-size: 12px; min-height: 24px; min-width: 28px; }
.btn[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; display: grid; gap: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.login-card label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
.login-card input { background: var(--ink-2); border: 1px solid var(--line-2); color: var(--text); border-radius: 10px; padding: 11px 12px; font: 15px var(--body); }
.login-card input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-glow); }
.login-card .btn { padding: 11px; font-size: 15px; }
.marquee-word { font-family: var(--display); font-weight: 800; font-size: 64px; line-height: 0.85; letter-spacing: 0.02em; color: var(--amber); text-shadow: 0 0 28px var(--amber-glow); display: grid; }
.marquee-word span:last-child { color: var(--text); text-shadow: none; }

/* -------------------------------------------------------------------- top */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  background: rgba(16, 14, 11, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.wm { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: 0.04em; line-height: 1; }
.wm i { font-style: normal; color: var(--amber); padding: 0 2px; }
.pill { border: 0; border-radius: 999px; padding: 6px 14px 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; background: var(--ok-bg); color: var(--ok); }
.pill:disabled { cursor: default; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.pill.medium { background: rgba(245, 181, 68, 0.14); color: var(--amber); }
.pill.high { background: var(--red-bg); color: var(--red); }
.pill.high::before { animation: pulse 1.6s ease-in-out 3; }
.vitals { display: flex; gap: 18px; margin: 0 0 0 auto; }
.vital { display: flex; align-items: baseline; gap: 6px; }
.vital dt { color: var(--dim); font-size: 13px; }
.vital dd { margin: 0; font-size: 14px; }
.vital.hot dd { color: var(--amber-2); }
.vital.warn dd { color: var(--red); }
.conn { font: 11px var(--mono); color: var(--dim); display: inline-flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: 0.08em; }
.conn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.conn.live::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.conn.poll::before { background: var(--amber); }
.conn.lost::before { background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ------------------------------------------------------------------- grid */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  padding: 18px max(16px, env(safe-area-inset-left)) 40px;
  max-width: 1680px;
  margin: 0 auto;
}
.span-12 { grid-column: span 12; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.panel {
  background: linear-gradient(180deg, var(--panel), var(--ink-2));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px 18px;
  min-width: 0;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.panel:nth-child(2) { animation-delay: 0.05s; }
.panel:nth-child(3) { animation-delay: 0.1s; }
.panel:nth-child(4) { animation-delay: 0.15s; }
.panel:nth-child(5) { animation-delay: 0.2s; }
.panel:nth-child(6) { animation-delay: 0.25s; }
.panel:nth-child(7) { animation-delay: 0.3s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
section { scroll-margin-top: 96px; }
#needs-h:focus { outline: none; }
.head h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: 0.03em; text-transform: uppercase; line-height: 1; }
.head .sub { color: var(--dim); margin-left: auto; }
.head .count { color: var(--muted); }
.state { font: 10px var(--mono); text-transform: uppercase; letter-spacing: 0.1em; padding: 2px 7px; border-radius: 999px; }
.state:empty { display: none; }
.state.stale, .state.pending { background: rgba(245, 181, 68, 0.14); color: var(--amber); }
.state.down { background: var(--red-bg); color: var(--red); }
.empty { color: var(--dim); margin: 6px 0; }
.empty.bad { color: var(--red); }

/* ------------------------------------------------------------------ needs */
.needs { background: linear-gradient(180deg, #211a12, var(--ink-2)); border-color: #4a3a22; }
.tickets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.ticket {
  --edge: var(--amber);
  position: relative;
  background: var(--panel-2);
  border-radius: 10px;
  padding: 12px 14px 12px 20px;
  /* ticket-stub notches */
  -webkit-mask: radial-gradient(circle 7px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 7px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 7px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 7px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
.ticket::before { content: ""; position: absolute; left: 9px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--edge); box-shadow: 0 0 10px var(--edge); }
.ticket.high { --edge: var(--red); background: linear-gradient(90deg, rgba(255, 107, 87, 0.1), var(--panel-2) 40%); }
.ticket.low { --edge: var(--dim); }
.ticket.open { grid-column: 1 / -1; }
.t-main { display: flex; gap: 12px; align-items: center; }
.t-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.t-app { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; }
.t-title { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.t-detail { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.t-actions { display: flex; gap: 6px; flex-shrink: 0; }
.t-poster { width: 38px; height: 57px; border-radius: 5px; object-fit: cover; background: var(--line); flex-shrink: 0; }
.chev { color: var(--dim); }
.q-list { margin-top: 12px; border-top: 1px dashed var(--line-2); padding-top: 10px; }
.q-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.q-hint { color: var(--dim); font-size: 12.5px; margin: 0 0 8px; }
.q-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--ink-2); border-radius: 8px; padding: 8px 10px; }
.q-text { display: grid; gap: 1px; min-width: 0; }
.q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-meta { color: var(--muted); font-size: 12.5px; }
.q-msg { color: var(--amber); font-size: 12.5px; overflow-wrap: anywhere; }
.q-acts { display: flex; gap: 6px; flex-shrink: 0; }

/* ---------------------------------------------------------------- playing */
.playing {
  position: relative;
  padding-top: 26px;
  padding-bottom: 26px;
}
/* film perforations along top and bottom */
.playing::before, .playing::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  height: 8px;
  background: repeating-linear-gradient(90deg, rgba(241, 232, 216, 0.1) 0 12px, transparent 12px 24px);
  border-radius: 2px;
}
.playing::before { top: 8px; }
.playing::after { bottom: 8px; }
.streams { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.stream { display: flex; gap: 14px; background: var(--panel-2); border-radius: 12px; padding: 12px; border: 1px solid var(--line); position: relative; overflow: hidden; }
.stream.playing-glow, .stream.playing { box-shadow: inset 0 0 0 1px rgba(245, 181, 68, 0.12); }
.stream .poster { width: 84px; height: 126px; border-radius: 8px; flex-shrink: 0; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); }
.s-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.s-user { color: var(--amber); display: flex; align-items: center; gap: 8px; }
.s-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.02; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.s-sub { color: var(--muted); font-size: 13.5px; }
.s-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.s-player { color: var(--dim); font-size: 12px; margin-top: auto; }
.badge { font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 5px; background: rgba(241, 232, 216, 0.07); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: rgba(245, 181, 68, 0.14); color: var(--amber); }
.badge.lan { color: var(--ok); }
.badge.wan { color: var(--tv); }
.quiet-screen { display: grid; place-items: center; gap: 4px; padding: 34px 12px; color: var(--dim); text-align: center; }
.quiet-screen .big { font-family: var(--display); font-weight: 800; font-size: 40px; color: var(--dim); letter-spacing: 0.05em; text-transform: uppercase; }

.poster { background: linear-gradient(135deg, var(--line), var(--panel-2)); object-fit: cover; display: block; }
.poster.broken, .c-poster.broken, .rq-poster.broken, .dt-poster.broken, .t-poster.broken { visibility: hidden; }

.bar { height: 6px; border-radius: 999px; background: rgba(241, 232, 216, 0.08); overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; width: var(--p, 0%); background: linear-gradient(90deg, var(--amber), var(--amber-2)); border-radius: inherit; box-shadow: 0 0 10px var(--amber-glow); transition: width 0.8s ease; }
.bar.thin { height: 4px; margin-top: 5px; }
.bar.stall > span { background: var(--dim); box-shadow: none; }

/* -------------------------------------------------------------- downloads */
.downloads { display: flex; flex-direction: column; gap: 14px; }
.downloads .head { margin-bottom: 0; }
.client { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.c-head { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name ctl" "big ctl" "sub sub"; align-items: center; column-gap: 10px; }
.c-name { grid-area: name; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: center; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.c-big { grid-area: big; font-family: var(--display); font-weight: 800; font-size: 38px; line-height: 1; letter-spacing: 0.01em; color: var(--amber-2); }
.c-sub { grid-area: sub; color: var(--muted); margin-top: 2px; }
.c-ctl { grid-area: ctl; }
.spark { width: 100%; height: 34px; display: block; margin: 8px 0 2px; }
.spark .line { fill: none; stroke: var(--amber); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.spark .fill { fill: rgba(245, 181, 68, 0.12); }
.spark.qb .line { stroke: var(--tv); }
.spark.qb .fill { fill: rgba(134, 183, 255, 0.1); }
.jobs { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
.job, .client { min-width: 0; }
.j-top, .j-foot { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.j-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.j-eta { color: var(--muted); flex-shrink: 0; }
.j-foot { margin-top: 3px; }
.c-foot { margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font: 11px var(--mono); padding: 3px 8px; border-radius: 999px; background: rgba(241, 232, 216, 0.06); color: var(--muted); }
.chip.downloading { color: var(--amber); }
.chip.seeding { color: var(--ok); }
.chip.errored { color: var(--red); }

/* --------------------------------------------------------------- calendar */
.legend { display: flex; align-items: center; gap: 6px; color: var(--dim); margin-left: auto; flex-wrap: wrap; }
.legend .dot { margin-left: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; }
.seg button { border: 0; background: none; padding: 4px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: var(--amber); color: #1a1206; }
.k { font: 10px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 1px 6px; border-radius: 4px; border: 1px solid currentColor; }
.k.tv { color: var(--tv); }
.k.movie { color: var(--movie); }
.k.movie4k { color: var(--movie4k); }
.k.prem { color: var(--ok); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.downloaded { background: var(--ok); }
.dot.missing { background: var(--red); box-shadow: 0 0 6px var(--red); border-radius: 1px; transform: rotate(45deg) scale(0.9); }
.dot.upcoming { background: transparent; border: 1.5px solid var(--muted); }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day { background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 180px; }
.day.today {
  border-color: var(--amber);
  background: linear-gradient(180deg, rgba(245, 181, 68, 0.08), var(--ink-2) 60%);
  position: relative;
}
/* marquee bulbs over tonight */
.day.today::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 12px;
  right: 12px;
  height: 6px;
  background: radial-gradient(circle, var(--amber-2) 0 2px, transparent 2.5px) 0 0 / 14px 6px repeat-x;
  filter: drop-shadow(0 0 3px var(--amber));
  animation: bulbs 1.2s steps(2) 4;
}
@keyframes bulbs { 50% { background-position: 7px 0; } }
.d-head { margin: 0 0 8px; font: inherit; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 6px; }
.d-dow { font-family: var(--display); font-weight: 800; font-size: 19px; text-transform: uppercase; letter-spacing: 0.04em; }
.day.today .d-dow { color: var(--amber); }
.d-num { color: var(--dim); }
.d-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.d-empty { color: var(--dim); margin: 0; }
.cal {
  width: 100%;
  display: flex;
  gap: 9px;
  align-items: center;
  text-align: left;
  background: var(--panel-2);
  border: 1px solid transparent;
  border-left: 3px solid var(--tv);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.cal:hover { border-color: var(--line-2); transform: translateY(-1px); }
.cal.movie { border-left-color: var(--movie); }
.cal.movie4k { border-left-color: var(--movie4k); }
.cal.downloaded { border-left-color: rgba(241, 232, 216, 0.18); }
.cal.downloaded .c-title { color: var(--muted); }
.c-poster { width: 34px; height: 51px; border-radius: 4px; object-fit: cover; background: var(--line); flex-shrink: 0; }
.c-text { display: grid; gap: 1px; min-width: 0; }
.c-title { font-weight: 600; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.c-subt { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-meta { display: flex; align-items: center; gap: 5px; color: var(--dim); font-size: 10.5px; flex-wrap: wrap; }

.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.m-dow { color: var(--dim); text-align: center; text-transform: uppercase; }
.m-cell { position: relative; background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; min-height: 104px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.m-cell.other { background: transparent; border-style: dashed; }
.m-cell.other .m-item { color: var(--muted); }
.m-cell.past { background: transparent; }
.m-cell.today { border-color: var(--amber); }
.m-open { position: absolute; inset: 0; border: 0; background: none; border-radius: 8px; padding: 6px; cursor: pointer; text-align: left; display: flex; flex-direction: column; justify-content: space-between; color: inherit; }
.m-open:disabled { cursor: default; }
.m-open:not(:disabled):hover { background: rgba(241, 232, 216, 0.03); }
.m-dots { display: none; gap: 3px; flex-wrap: wrap; }
.m-num { color: var(--dim); }
.m-item, .m-more { position: relative; z-index: 1; }
.m-cell > .m-item:first-of-type { margin-top: 18px; }
.m-cell.today .m-num { color: var(--amber); }
.m-item { display: flex; align-items: center; gap: 5px; border: 0; background: none; padding: 1px 0; cursor: pointer; text-align: left; font-size: 11.5px; color: var(--text); white-space: nowrap; overflow: hidden; min-width: 0; }
.m-item:hover { color: var(--amber-2); }
.m-item.tv { color: #cfe0ff; }
.m-more { color: var(--muted); font-size: 10.5px; text-align: left; padding: 0; }
.m-note { font-size: 12px; margin: 8px 0 0; }

/* ------------------------------------------------------------------ recent */
.shelf > .empty { grid-column: 1 / -1; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px 12px; }
.shelf-item { margin: 0; scroll-snap-align: start; }
.shelf-item .poster { width: 100%; height: auto; aspect-ratio: 2 / 3; border-radius: 9px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5); transition: transform 0.2s; }
.shelf-item:hover .poster { transform: translateY(-3px) rotate(-0.6deg); }
.shelf-item figcaption { display: grid; gap: 1px; margin-top: 7px; }
.r-title { font-weight: 600; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-sub { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-when { color: var(--dim); font-size: 10.5px; }

/* ------------------------------------------------------- recently downloaded */
.got { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.got-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px; border-radius: 9px; background: var(--panel-2); border-left: 3px solid var(--tv); }
.got-row.movie { border-left-color: var(--movie); }
.got-row.movie4k { border-left-color: var(--movie4k); }
.got-poster { width: 32px; height: 48px; border-radius: 4px; object-fit: cover; background: var(--line); }
.got-text { display: grid; gap: 1px; min-width: 0; }
.got-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.got-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.got-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; margin-top: 2px; }
.badge.via.usenet { color: var(--amber); }
.badge.via.torrent { color: var(--tv); }
.badge.via.manual { color: var(--muted); }
.got-when { color: var(--dim); font-size: 11px; align-self: start; padding-top: 2px; white-space: nowrap; }

/* ---------------------------------------------------------------- requests */
.reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.req { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 9px; background: var(--panel-2); }
.req.pending { box-shadow: inset 3px 0 0 var(--amber); }
.rq-poster { width: 32px; height: 48px; border-radius: 4px; object-fit: cover; background: var(--line); flex-shrink: 0; }
.rq-text { display: grid; min-width: 0; flex: 1; }
.rq-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.rq-meta { color: var(--muted); font-size: 12px; }
.rq-acts { display: flex; gap: 5px; }
.rq-status { font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); flex-shrink: 0; }
.rq-status.available { color: var(--ok); }
.rq-status.processing, .rq-status.partial { color: var(--amber); }

/* ------------------------------------------------------------------ server */
.srv-grid { display: grid; grid-template-columns: minmax(260px, 1.1fr) minmax(0, 1.6fr) minmax(240px, 1fr); gap: 18px; align-items: start; }
.a-top { display: flex; align-items: baseline; gap: 10px; }
.a-pct { font-family: var(--display); font-weight: 800; font-size: 76px; line-height: 0.9; letter-spacing: -0.01em; }
.a-pct small { font-size: 36px; color: var(--muted); }
.a-label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; }
.a-bar { height: 14px; border-radius: 999px; background: rgba(241, 232, 216, 0.07); overflow: hidden; margin: 12px 0 8px; position: relative; }
.a-bar::after { content: ""; position: absolute; left: 95%; top: 0; bottom: 0; width: 2px; background: rgba(255, 107, 87, 0.7); }
.a-bar > span { display: block; height: 100%; width: var(--p); background: linear-gradient(90deg, #5a8f6d, var(--ok)); border-radius: inherit; }
.a-bar.warn > span { background: linear-gradient(90deg, #b07a22, var(--amber)); }
.a-bar.crit > span { background: linear-gradient(90deg, #b0452f, var(--red)); box-shadow: 0 0 14px rgba(255, 107, 87, 0.4); }
.a-facts { display: flex; justify-content: space-between; color: var(--muted); }
.a-forecast { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; }
.a-forecast b { color: var(--text); }
.a-parity { margin: 8px 0 0; color: var(--amber); font-size: 12.5px; }
.disks { display: grid; gap: 12px; }
.dk-group { display: grid; gap: 6px; }
.dk-label { color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; font-size: 10.5px; }
.dk-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.disk { position: relative; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px 8px 18px; display: grid; gap: 1px; overflow: hidden; }
.disk.bad { border-color: var(--red); }
.dk-fill { position: absolute; left: 6px; top: 8px; bottom: 8px; width: 5px; border-radius: 3px; background: rgba(241, 232, 216, 0.08); display: flex; align-items: flex-end; }
.dk-fill > span { display: block; width: 100%; height: var(--p); border-radius: 3px; background: var(--muted); }
.disk.ssd .dk-fill > span { background: var(--tv); }
.dk-name { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-pct { color: var(--muted); }
.dk-temp { color: var(--dim); }
.dk-temp.warm { color: var(--amber); }
.dk-temp.hot { color: var(--red); }
.dk-err { color: var(--red); }
.side { display: grid; gap: 12px; }
.sd { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 5px; }
.sd-title { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.sd-stats { color: var(--muted); }
.td-w { display: grid; gap: 1px; }
.td-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.containers { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 16px; align-items: center; }
.ct-label { color: var(--dim); margin-right: 6px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 10.5px; }
.ct { font: 11px var(--mono); padding: 3px 8px 3px 16px; border-radius: 999px; background: rgba(241, 232, 216, 0.05); color: var(--muted); position: relative; }
.ct::before { content: ""; position: absolute; left: 6px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--ok); }
.ct.media { color: var(--text); background: rgba(241, 232, 216, 0.08); }
.ct.down { color: var(--red); background: var(--red-bg); }
.ct.down::before { background: var(--red); }
.ct.idle { color: var(--dim); background: transparent; }
.ct.idle::before { background: var(--dim); }
.services { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--dim); }
.sv { display: inline-flex; align-items: center; gap: 6px; }
.sv-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.sv.stale .sv-dot, .sv.pending .sv-dot { background: var(--amber); }
.sv.down { color: var(--red); }
.sv.down .sv-dot { background: var(--red); }

/* ------------------------------------------------------------------ dialog */
.detail { border: 1px solid var(--line-2); border-radius: 18px; background: var(--panel); color: var(--text); padding: 0; width: min(640px, calc(100vw - 32px)); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7); }
.detail::backdrop { background: rgba(8, 7, 5, 0.72); backdrop-filter: blur(3px); }
.dt-day { padding: 20px; display: grid; gap: 12px; }
.dt-day h3 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 28px; }
.dt-wrap { display: flex; gap: 18px; padding: 20px; }
.dt-poster { width: 150px; height: 225px; border-radius: 10px; object-fit: cover; background: var(--line); flex-shrink: 0; }
.dt-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; align-items: flex-start; }
.dt-body h3 { margin: 4px 0 0; font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 0.95; }
.dt-sub { margin: 0; color: var(--muted); }
.dt-when { margin: 0; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dt-eps { list-style: none; margin: 0; padding: 0; color: var(--muted); display: grid; gap: 2px; }
.dt-eps li { display: flex; gap: 6px; align-items: center; }
.dt-over { margin: 4px 0 0; color: var(--text); font-size: 14px; max-height: 9em; overflow: auto; }
.dt-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Toasts: ticket stubs that slide in from the right, colour edge by kind,
   a countdown bar along the bottom that pauses while hovered or focused. */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  --edge: var(--ok);
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 12px 12px 14px 18px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--edge) 12%, var(--panel-2)), var(--panel-2) 45%);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: toast-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  -webkit-mask: radial-gradient(circle 6px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 6px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 6px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 6px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
.toast::before { content: ""; position: absolute; left: 8px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--edge); box-shadow: 0 0 10px var(--edge); }
.toast.error { --edge: var(--red); }
.toast.warn { --edge: var(--amber); }
.toast.info { --edge: var(--tv); }
.toast.out { animation: toast-out 0.2s ease-in both; }
.t-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--mono); color: #140f08; background: var(--edge); margin-top: 1px; }
.t-body { display: grid; gap: 2px; min-width: 0; }
.t-head { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.02em; line-height: 1.1; overflow-wrap: anywhere; }
.toast.error .t-head { color: #ffb3a8; }
.t-more { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.t-close { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; min-width: 28px; min-height: 28px; border-radius: 6px; }
.t-close:hover { color: var(--text); background: rgba(241, 232, 216, 0.06); }
.t-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--edge); opacity: 0.55; transform-origin: left; animation: toast-timer var(--toast-ms) linear forwards; }
.toast.paused .t-timer { animation-play-state: paused; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes toast-timer { to { transform: scaleX(0); } }
@media (max-width: 700px) {
  .toasts { right: 50%; transform: translateX(50%); bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* -------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .srv-grid { grid-template-columns: 1fr 1fr; }
  .side { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 1024px) {
  .span-7, .span-5 { grid-column: span 12; }
  .col { display: contents; }
  .col > .panel { grid-column: 1 / -1; }
  .vitals .vital:nth-child(n + 3) { display: none; }
}
@media (max-width: 700px) {
  body { font-size: 14.5px; }
  .grid { gap: 12px; padding-top: 12px; }
  .panel { padding: 14px; }
  .top { gap: 10px; flex-wrap: wrap; }
  .wm { font-size: 24px; }
  .brand .mono, #logout, .conn { display: none; }
  .vitals { gap: 12px; }
  .tickets { grid-template-columns: 1fr; }
  .t-main { flex-wrap: wrap; }
  .t-actions { width: 100%; justify-content: flex-end; }
  .q-row { flex-direction: column; align-items: stretch; }
  .q-acts { justify-content: flex-end; }
  .streams { grid-template-columns: 1fr; }
  .shelf { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 112px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; }
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .day .d-empty { display: none; }
  .month { gap: 3px; }
  .m-cell { min-height: 64px; padding: 4px; }
  .m-item, .m-more { display: none; }
  .m-dots { display: flex; }
  .m-dots .dot { width: 7px; height: 7px; }
  .srv-grid { grid-template-columns: 1fr; }
  .legend { width: 100%; margin-left: 0; order: 5; }
  .head .sub { margin-left: 0; width: 100%; }
  .a-pct { font-size: 60px; }
  .dt-wrap { flex-direction: column; }
  .dt-poster { width: 110px; height: 165px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
