:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #111827;
  --panel2: #182235;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #00a4dc;
  --danger: #ef4444;
  --ok: #22c55e;
  --border: rgba(255,255,255,.08);
  --arrserve-appbar-height: 68px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top, #14213d 0, var(--bg) 46%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
}
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }
#app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: rgba(5, 10, 20, .88);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand { font-size: 24px; font-weight: 800; margin: 4px 10px 22px; color: white; letter-spacing: -.02em; }
.brand.big { font-size: 34px; margin: 0 0 14px; }
.nav {
  width: 100%;
  display: block;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  text-align: left;
  cursor: pointer;
  margin: 4px 0;
}
.nav:hover, .nav.active { color: white; background: rgba(255,255,255,.08); }
.nav.ghost { color: #cbd5e1; }
.admin-entry { margin-top: auto; background: rgba(0,164,220,.12); color: white; }
.nav-section {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin: 18px 12px 6px;
  font-weight: 800;
}
.side-note { font-size: 13px; margin: 8px 12px; color: var(--muted); }
.sidebar-spacer { flex: 1; }
.main { padding: 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
h1 { margin: 0; font-size: 34px; }
h2, h3 { margin-top: 0; }
p { color: var(--muted); }
.status { background: rgba(255,255,255,.08); border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; color: var(--muted); }
.status:empty { display: none; }
.card {
  background: rgba(17, 24, 39, .86);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  min-height: 120px;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.card.clickable { cursor: pointer; transition: transform .12s ease, background .12s ease; }
.card.clickable:hover { transform: translateY(-3px); background: rgba(24,34,53,.95); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.compact-grid { grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}
.library-form { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.full { grid-column: 1 / -1; }
input, select, textarea {
  background: rgba(0,0,0,.24);
  color: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  min-width: 0;
}
textarea { width: 100%; min-height: 116px; resize: vertical; }
button.primary { background: var(--accent); color: white; border: 0; border-radius: 10px; padding: 11px 14px; cursor: pointer; }
button.secondary { background: rgba(255,255,255,.08); color: white; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
button.danger { background: var(--danger); color: white; border: 0; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
button.mini { padding: 6px 9px; font-size: 12px; }
small, .muted { color: var(--muted); }
.good-text { color: var(--ok); }
.section-card {
  background: rgba(255,255,255,.035);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  margin-bottom: 24px;
}
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-head h2 { margin: 0 0 4px; }
.section-head p { margin: 0; }
.hero-banner {
  padding: 24px;
  background: linear-gradient(135deg, rgba(0,164,220,.22), rgba(255,255,255,.05));
  border: 1px solid var(--border);
  border-radius: 26px;
  margin-bottom: 24px;
}
.banner-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.banner-card {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 10px;
}
.banner-poster, .poster, .library-thumb, .admin-library-thumb, .avatar {
  background: linear-gradient(135deg, #22304a, #0b1020);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}
.banner-poster { width: 76px; aspect-ratio: 2 / 3; border-radius: 12px; }
.banner-poster img, .poster img, .library-thumb img, .admin-library-thumb img, .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-meta { min-width: 0; }
.banner-meta strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner-empty { color: var(--muted); padding: 22px; border: 1px dashed var(--border); border-radius: 16px; }
.library-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.library-tile {
  text-align: left;
  background: rgba(17, 24, 39, .86);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px;
  color: white;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.library-tile:hover { transform: translateY(-3px); background: rgba(24,34,53,.95); }
.library-thumb { aspect-ratio: 16 / 9; border-radius: 16px; margin-bottom: 12px; font-size: 24px; }
.admin-library-thumb { aspect-ratio: 16 / 9; border-radius: 14px; margin-bottom: 12px; font-size: 22px; }
.poster { aspect-ratio: 2 / 3; border-radius: 14px; margin-bottom: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 18px; }
.big-number { font-size: 42px; }
.profile-card { display: flex; align-items: center; gap: 18px; }
.avatar.large { width: 120px; height: 120px; border-radius: 24px; font-size: 30px; }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.user-card {
  position: relative;
  text-align: center;
  background: rgba(17, 24, 39, .86);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 15px;
}
.user-avatar { width: 150px; height: 150px; margin: 0 auto 12px; border-radius: 18px; font-size: 34px; }
.user-name { font-weight: 800; }
.more-btn { margin-top: 12px; width: 100%; }
.more-menu {
  position: absolute;
  right: 14px;
  top: 170px;
  z-index: 4;
  display: grid;
  min-width: 170px;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 20px 40px rgba(0,0,0,.35);
}
.more-menu button { background: transparent; border: 0; color: white; text-align: left; padding: 10px; border-radius: 10px; cursor: pointer; }
.more-menu button:hover { background: rgba(255,255,255,.08); }
.source-editor { display: grid; gap: 12px; }
.source-row {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(0,0,0,.16);
  padding: 12px;
}
.source-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.source-grid { display: grid; grid-template-columns: 1fr 150px 240px; gap: 10px; }
.path-picker label { display: block; color: var(--text); font-weight: 700; margin-bottom: 8px; }
.check-list { display: grid; gap: 8px; }
.check-row {
  display: grid !important;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin: 0 !important;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,.18);
  font-weight: 500 !important;
}
.check-row input { width: auto; }
.path-list { display: grid; gap: 6px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.path-list div { padding: 7px 9px; background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-paths div { white-space: normal; }
.management-card h3 { margin-bottom: 6px; }
.action-row { margin-top: 14px; gap: 8px; }
.action-row button { padding: 8px 10px; font-size: 13px; }
.status-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.status-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,.06); color: var(--muted); font-size: 12px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.68); display: grid; place-items: center; padding: 28px; z-index: 10; }
.modal-card { background: #0f172a; border: 1px solid var(--border); border-radius: 24px; max-width: 1040px; width: min(1040px, 100%); max-height: 88vh; overflow: auto; padding: 24px; position: relative; }
.modal-close { position: absolute; right: 14px; top: 10px; background: transparent; border: 0; color: white; font-size: 32px; cursor: pointer; }
.modal-form { margin-top: 18px; margin-bottom: 0; }
.modal-actions { margin-top: 16px; }
video { width: 100%; max-height: 70vh; background: black; border-radius: 14px; }
.viewer-image { width: 100%; max-height: 76vh; object-fit: contain; border-radius: 14px; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-card { width: min(460px, 100%); background: rgba(17,24,39,.92); border: 1px solid var(--border); border-radius: 28px; padding: 28px; box-shadow: 0 24px 70px rgba(0,0,0,.45); }
.login-form { display: grid; gap: 12px; margin-top: 18px; }
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: block; }
  .source-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
}

.provider-type-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}
.provider-type-tile {
  display: grid;
  grid-template-columns: 58px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 12px;
  text-align: left;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: white;
  padding: 12px;
  cursor: pointer;
}
.provider-type-tile:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
.provider-type-thumb {
  grid-row: 1 / span 2;
  width: 58px;
  aspect-ratio: 1;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 25px;
  font-weight: 900;
  color: white;
  background: linear-gradient(135deg, rgba(0,164,220,.55), rgba(255,255,255,.12));
  border: 1px solid rgba(255,255,255,.14);
}
.provider-type-tile.sonarr .provider-type-thumb { background: linear-gradient(135deg, rgba(34,197,94,.48), rgba(255,255,255,.12)); }
.provider-type-tile.lidarr .provider-type-thumb { background: linear-gradient(135deg, rgba(168,85,247,.50), rgba(255,255,255,.12)); }
.provider-form-tight { grid-template-columns: minmax(200px, 1.2fr) 120px minmax(230px, 1.4fr) minmax(190px, 1fr) auto auto; align-items: center; }
.image-upload-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 14px;
  align-items: center;
  background: rgba(0,0,0,.16);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
}
.image-upload-card > label { grid-column: 1 / -1; font-weight: 800; color: var(--text); }
.library-image-preview {
  width: 150px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #22304a, #0b1020);
  border: 1px dashed var(--border);
  color: var(--muted);
  font-weight: 900;
}
.library-image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-grid { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(220px, 1.1fr); gap: 10px; }
.image-upload-card small { grid-column: 2; }
.root-folder-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 250px;
  overflow: auto;
  padding-right: 4px;
}
.root-folder-list .check-row { min-height: 42px; padding: 8px 10px; min-width: 0; }
.root-folder-list .check-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.root-folder-list .check-row small { white-space: nowrap; }
@media (max-width: 1200px) {
  .root-folder-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .root-folder-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .root-folder-list { grid-template-columns: 1fr; }
}
.five-row-textarea { min-height: 156px; max-height: 210px; }
@media (max-width: 900px) {
  .provider-type-tiles { grid-template-columns: 1fr; }
  .provider-form-tight { grid-template-columns: 1fr; }
  .image-upload-card { grid-template-columns: 1fr; }
  .image-upload-card small { grid-column: 1; }
  .upload-grid { grid-template-columns: 1fr; }
}

/* v0.4.8 Popular Releases and avatar uploads */
.popular-hero-card {
  width: 100%;
  min-height: 180px;
  max-height: 220px;
  aspect-ratio: 16 / 3;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  text-align: left;
  color: white;
  background: linear-gradient(135deg, rgba(5,8,14,.92), rgba(24,34,53,.72));
  background-position: center;
  background-size: cover;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px 22px;
  cursor: pointer;
  box-shadow: inset 0 -54px 90px rgba(0,0,0,.44), 0 12px 28px rgba(0,0,0,.24);
}
.popular-hero-card:hover { transform: translateY(-2px); }
.popular-hero-copy { max-width: 720px; }
.popular-hero-copy h3 { margin: 8px 0 4px; font-size: clamp(22px, 3vw, 36px); line-height: 1.02; }
.popular-hero-copy p { margin: 0 0 6px; color: #dbeafe; }
.popular-hero-copy small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 680px; color: #cbd5e1; }
.poster-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.popular-poster-card {
  display: grid;
  gap: 8px;
  text-align: left;
  color: white;
  background: rgba(0,0,0,.18);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  cursor: pointer;
}
.popular-poster-card:hover { background: rgba(255,255,255,.08); transform: translateY(-2px); }
.popular-poster-card .banner-poster { width: 100%; max-width: 170px; justify-self: center; }
.popular-poster-card strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popular-poster-card small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-preview {
  width: 100px;
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #22304a, #0b1020);
  border: 1px dashed var(--border);
  color: var(--muted);
  font-weight: 900;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-upload-card { grid-template-columns: 110px 1fr; }
.profile-settings-form { width: min(720px, 100%); margin: 0; }
@media (max-width: 900px) {
  .popular-hero-card { min-height: 160px; max-height: none; aspect-ratio: 16 / 5; padding: 16px; }
  .poster-strip { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .avatar-upload-card { grid-template-columns: 1fr; }
}

/* v0.4.12 home carousel/trending polish */
.home-view .topbar { display: none; }
.hero-carousel {
  margin-bottom: 16px;
}
.trending-section { margin-bottom: 24px; }
.compact-heading { margin-bottom: 10px; }
.compact-heading h2 { margin-bottom: 0; }
.popular-hero-card {
  position: relative;
  isolation: isolate;
  animation: heroFadeIn .85s ease both, heroKenBurns 10s ease-out both;
}
.popular-hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.18));
}
.popular-hero-card.ken-burns {
  background-size: 100%;
}
.watch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-top: 12px;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: #08111f;
  font-weight: 900;
  letter-spacing: .01em;
  box-shadow: 0 8px 20px rgba(0,0,0,.26);
}
.rotating-posters {
  animation: posterGroupFade .45s ease both;
}
.settings-panel {
  background: rgba(0,0,0,.18);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}
.settings-panel h3 { margin: 0 0 10px; }
.inline-check {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 0;
  padding: 4px 0;
  background: transparent;
  border: 0;
}
.inline-check input { width: auto; }
@keyframes heroFadeIn {
  from { opacity: .45; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroKenBurns {
  from { background-size: 100%; background-position: center; }
  to { background-size: 104%; background-position: center; }
}
@keyframes posterGroupFade {
  from { opacity: .35; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .popular-hero-card, .rotating-posters { animation: none; }
}
@media (max-width: 900px) {
  .watch-button { padding: 8px 13px; }
}

/* v0.4.14 softer Trending rotation */
.trending-posters-shell {
  position: relative;
  min-height: 0;
}
.trending-posters-shell > .poster-strip,
.trending-posters-shell > .banner-empty {
  transition: opacity .9s ease, transform .9s ease, filter .9s ease;
}
.trending-fade-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity .9s ease, transform .9s ease;
  pointer-events: none;
  z-index: 2;
}
.trending-fade-layer.is-soft-active {
  opacity: 1;
  transform: translateX(0);
}
.trending-posters-shell .is-soft-leaving {
  opacity: .72;
  transform: translateX(-4px);
  filter: saturate(.96);
}
.trending-fade-layer .poster-strip {
  animation: none;
}

/* v0.4.14 softer Trending rotation */
.trending-posters-shell {
  position: relative;
  min-height: 0;
}
.trending-posters-shell > .poster-strip,
.trending-posters-shell > .banner-empty {
  transition: opacity .9s ease, transform .9s ease, filter .9s ease;
}
.trending-fade-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity .9s ease, transform .9s ease;
  pointer-events: none;
  z-index: 2;
}
.trending-fade-layer.is-soft-active {
  opacity: 1;
  transform: translateX(0);
}
.trending-posters-shell .is-soft-leaving {
  opacity: .72;
  transform: translateX(-4px);
  filter: saturate(.96);
}
.trending-fade-layer .poster-strip {
  animation: none;
}


/* v0.4.14 library cache paging */
.library-page-toolbar,
.library-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.library-pager {
  justify-content: center;
  margin: 14px 0;
}

.cache-status {
  color: var(--muted);
  font-size: 12px;
}

.library-tile strong {
  margin-top: 10px;
}

/* v0.4.16 poster cleanup + home playback rows */
.media-poster-card {
  appearance: none;
  width: 100%;
  background: transparent;
  border: 0;
  color: white;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 8px 6px 12px;
  cursor: pointer;
  text-align: center;
  border-radius: 16px;
  transition: transform .12s ease, background .12s ease;
}
.media-poster-card:hover {
  background: rgba(255,255,255,.07);
  transform: translateY(-2px);
}
.media-poster-card .banner-poster {
  width: min(100%, 170px);
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(0,0,0,.26);
}
.media-poster-card strong {
  width: min(100%, 180px);
  color: white;
  font-size: 14px;
  line-height: 1.22;
  min-height: 2.44em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.media-poster-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.1;
}
.library-media-grid,
.grid:has(.library-media-card) {
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  align-items: start;
}
.library-media-card .banner-poster {
  width: min(100%, 165px);
}
.stable-posters {
  animation: none;
}
.home-playback-section {
  margin-bottom: 24px;
}
.small-empty {
  padding: 16px 18px;
}

@media (max-width: 900px) {
  .media-poster-card .banner-poster { width: min(100%, 140px); }
  .media-poster-card strong { width: min(100%, 150px); font-size: 13px; }
  .grid:has(.library-media-card) { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
}

/* v0.4.17 media-center chrome, drawer, search, and poster polish */
#app {
  display: block;
  min-height: 100vh;
}
.appbar {
  position: sticky;
  top: 0;
  z-index: 8;
  height: var(--arrserve-appbar-height);
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: rgba(5, 10, 20, .88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
}
.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: white;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
}
.icon-button:hover { background: rgba(255,255,255,.12); }
.app-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: white;
  font-weight: 900;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.app-logo-mark {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #7dd3fc);
  color: #04111f;
  font-size: 16px;
}
.appbar-links {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 24px;
}
.appbar-links button {
  background: transparent;
  border: 0;
  color: #dbeafe;
  cursor: pointer;
  font-weight: 750;
  padding: 7px 4px;
}
.appbar-links button:hover { color: white; }
.search-button { justify-self: end; }
.main {
  padding: 22px 28px 28px;
  min-height: calc(100vh - var(--arrserve-appbar-height));
}
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 20;
  width: min(310px, 86vw);
  height: 100vh;
  transform: translateX(-105%);
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
  box-shadow: 22px 0 60px rgba(0,0,0,.44);
  padding-top: 18px;
}
body.drawer-open .sidebar { transform: translateX(0); }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(0,0,0,.46);
  backdrop-filter: blur(2px);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 14px;
}
.drawer-head .brand { margin: 0 8px; }
.drawer-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: white;
  cursor: pointer;
}
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 76px 18px 18px;
}
.search-panel {
  width: min(720px, 100%);
  background: rgba(15, 23, 42, .98);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.48);
}
.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.search-row input {
  font-size: 18px;
  padding: 14px 15px;
  border-radius: 14px;
}
.search-results {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  max-height: min(56vh, 520px);
  overflow: auto;
}
.search-result-button {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  color: white;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 9px;
  cursor: pointer;
}
.search-result-button:hover { background: rgba(255,255,255,.1); }
.search-thumb {
  width: 44px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #22304a, #0b1020);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}
.search-thumb.library-search-thumb { aspect-ratio: 16 / 9; }
.search-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-result-button strong,
.search-result-button small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-poster-card strong {
  width: min(95%, 162px);
  max-width: 95%;
  min-height: 1.18em;
  line-height: 1.18;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-poster-card small {
  width: min(95%, 162px);
  text-align: center;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trending-posters-shell {
  position: relative;
  min-height: 300px;
}
.trending-section .rotating-posters { animation: none; }
.trending-fade-layer {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s ease;
}
.trending-fade-layer.is-soft-active { opacity: 1; }
.trending-posters-shell > .poster-strip.is-soft-leaving,
.trending-posters-shell > .banner-empty.is-soft-leaving {
  opacity: 1;
  transition: none;
}
@media (max-width: 900px) {
  .appbar { grid-template-columns: auto auto 1fr auto; padding: 0 12px; gap: 10px; }
  .appbar-links { gap: 12px; font-size: 14px; }
  .main { padding: 18px 14px 24px; }
  .search-overlay { padding-top: 66px; }
  .trending-posters-shell { min-height: 250px; }
  .media-poster-card strong,
  .media-poster-card small { width: min(95%, 134px); }
}

/* v0.4.18 Plex-style top search and drawer admin behavior */
.appbar {
  grid-template-columns: auto auto minmax(240px, 430px) 1fr;
}
.top-search {
  position: relative;
  width: min(430px, 34vw);
  min-width: 220px;
  justify-self: start;
}
.top-search input {
  width: 100%;
  height: 36px;
  border-radius: 12px;
  padding: 8px 13px;
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.12);
  color: white;
}
.top-search input:focus {
  outline: 0;
  border-color: rgba(125,211,252,.55);
  box-shadow: 0 0 0 3px rgba(0,164,220,.16);
}
.top-search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(760px, 82vw);
  max-height: min(72vh, 660px);
  overflow: auto;
  background: rgba(8, 13, 24, .98);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.top-search-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.search-loading {
  color: var(--muted);
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 16px;
}
.top-search-poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
}
.search-poster-card {
  padding: 6px 4px 10px;
}
.search-poster-card .banner-poster {
  width: min(100%, 106px);
}
.search-poster-card strong,
.search-poster-card small {
  width: min(95%, 106px);
}
@media (max-width: 900px) {
  .appbar { grid-template-columns: auto auto 1fr; }
  .top-search { grid-column: 1 / -1; order: 3; width: 100%; min-width: 0; margin-bottom: 8px; }
  .appbar { height: auto; min-height: var(--arrserve-appbar-height); padding-top: 6px; padding-bottom: 6px; }
  .appbar-links { justify-self: end; }
  .top-search-results { width: 100%; max-height: 66vh; }
}

/* v0.4.19 calmer home layout, grouped search, and centered top navigation */
.appbar {
  position: sticky;
  grid-template-columns: auto auto minmax(260px, 430px) 1fr;
}
.appbar-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  justify-self: auto;
}
.top-search-results {
  width: min(1320px, calc(100vw - 40px));
  max-height: min(74vh, 720px);
  padding: 16px 18px 18px;
}
.top-search-groups {
  display: grid;
  gap: 18px;
}
.top-search-group h3 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: .12em;
  color: #cbd5e1;
}
.top-search-poster-grid {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 14px;
}
.search-poster-card .banner-poster {
  width: min(100%, 118px);
}
.search-poster-card strong,
.search-poster-card small {
  width: min(95%, 118px);
}
.home-view .main {
  padding-top: 16px;
}
.home-view .section-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin-bottom: 18px;
}
.home-view .section-head {
  margin-bottom: 8px;
}
.home-view .section-head h2 {
  font-size: 22px;
  margin-bottom: 0;
}
.home-view .section-head p {
  display: none;
}
.home-view .poster-strip {
  margin-top: 8px;
  gap: 12px;
}
.home-view .trending-section .poster-strip {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}
.trending-posters-shell {
  position: relative;
  min-height: clamp(210px, 23vw, 280px);
  overflow: hidden;
}
.trending-fade-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 1.45s ease-in-out;
}
.trending-fade-layer.is-soft-active {
  opacity: 1;
}
.trending-fade-layer .poster-strip {
  margin-top: 0;
}
.home-view .library-tile-grid {
  gap: 12px;
}
.home-view .library-tile {
  padding: 10px;
  border-radius: 16px;
}
.home-view .library-thumb {
  margin-bottom: 8px;
  border-radius: 13px;
}
.media-poster-card strong {
  width: min(95%, 170px);
  max-width: 95%;
  min-height: 1.18em;
  line-height: 1.18;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: initial;
  -webkit-box-orient: initial;
}
.media-poster-card small {
  width: min(95%, 170px);
  text-align: center;
}
@media (max-width: 1200px) {
  .home-view .trending-section .poster-strip {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  }
}
@media (max-width: 900px) {
  .appbar-links {
    position: static;
    transform: none;
    justify-self: end;
  }
  .top-search-results {
    width: 100%;
  }
  .trending-posters-shell {
    min-height: 250px;
  }
}

/* v0.4.20 calm home rows and docked administration layout */
body.admin-docked .drawer-backdrop {
  display: none !important;
}
body.admin-docked .sidebar {
  transform: translateX(0);
  box-shadow: 18px 0 44px rgba(0,0,0,.36);
}
body.admin-docked .main {
  margin-left: min(310px, 86vw);
  transition: margin-left .28s cubic-bezier(.2,.8,.2,1);
}
body.admin-docked .topbar {
  margin-top: 0;
}
.home-scroll-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.home-scroll-wrap.has-overflow {
  grid-template-columns: 34px minmax(0, 1fr) 34px;
}
.home-scroll-wrap.has-overflow .home-scroll-track {
  grid-column: 2;
}
.home-scroll-wrap.has-overflow .row-arrow.left { grid-column: 1; }
.home-scroll-wrap.has-overflow .row-arrow.right { grid-column: 3; }
.home-scroll-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 2px 1px 10px;
}
.home-scroll-track::-webkit-scrollbar { display: none; }
.home-scroll-track > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
}
.row-arrow {
  width: 34px;
  height: 72px;
  display: none;
  place-items: center;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background: rgba(5,10,20,.62);
  color: white;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,.2);
  transition: opacity .18s ease, background .18s ease;
}
.home-scroll-wrap.has-overflow .row-arrow { display: grid; }
.home-scroll-wrap.has-overflow .row-arrow.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.row-arrow:hover { background: rgba(255,255,255,.1); }
.poster-home-row .media-poster-card {
  flex-basis: 132px;
  min-width: 132px;
}
.trending-home-row .media-poster-card {
  flex-basis: calc((100% - 96px) / 9);
  min-width: 118px;
  max-width: 170px;
}
.library-home-row .library-tile {
  width: 232px;
  min-width: 232px;
}
.home-view .trending-section .poster-strip,
.home-view .poster-strip,
.home-view .library-tile-grid {
  display: flex;
  grid-template-columns: none;
}
.trending-posters-shell,
.home-view .trending-posters-shell {
  min-height: 0;
  overflow: visible;
}
.home-view .banner-empty.small-empty,
.home-view .banner-empty {
  margin: 0;
}
@media (max-width: 900px) {
  body.admin-docked .main {
    margin-left: 0;
    padding-top: 18px;
  }
  body.admin-docked .drawer-backdrop {
    display: block !important;
    background: rgba(0,0,0,.18);
    backdrop-filter: none;
    pointer-events: none;
  }
  .home-scroll-wrap {
    gap: 6px;
  }
  .home-scroll-wrap.has-overflow {
    grid-template-columns: 30px minmax(0, 1fr) 30px;
  }
  .row-arrow {
    width: 30px;
    height: 62px;
    border-radius: 12px;
    font-size: 24px;
  }
  .trending-home-row .media-poster-card,
  .poster-home-row .media-poster-card {
    flex-basis: 122px;
    min-width: 122px;
  }
  .library-home-row .library-tile {
    width: 210px;
    min-width: 210px;
  }
}

/* v0.4.25 true top-level search overlay */
body.top-search-open {
  overflow: hidden;
}
body.top-search-open::before {
  content: "";
  position: fixed;
  top: var(--arrserve-appbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99998;
  background: rgba(0,0,0,.66);
  pointer-events: none;
}
#topSearchResults.top-search-results {
  position: fixed !important;
  top: var(--arrserve-appbar-height) !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  height: auto !important;
  z-index: 99999 !important;
  overflow: auto;
  border-radius: 0;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.1);
  background: #071018;
  box-shadow: none;
  padding: 24px clamp(16px, 4vw, 54px) 54px;
}
.top-search-fullscreen-head {
  position: sticky;
  top: -24px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -24px calc(clamp(16px, 4vw, 54px) * -1) 20px;
  padding: 16px clamp(16px, 4vw, 54px);
  background: rgba(7, 16, 24, .96);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
}
.top-search-fullscreen-head strong {
  display: block;
  color: white;
  font-size: 20px;
}
.top-search-fullscreen-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
#topSearchResults .top-search-groups {
  display: grid;
  gap: 28px;
}
#topSearchResults .top-search-group h3 {
  margin: 0 0 14px;
  font-size: 15px;
  letter-spacing: .14em;
  color: #dbeafe;
}
#topSearchResults .top-search-poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 18px;
  align-items: start;
}
#topSearchResults .search-poster-card {
  width: 100%;
  max-width: 156px;
  justify-self: center;
}
#topSearchResults .search-poster-card .banner-poster {
  width: 100%;
  max-width: 156px;
}
#topSearchResults .search-poster-card strong,
#topSearchResults .search-poster-card small {
  width: 95%;
  max-width: 148px;
}
@media (max-width: 900px) {
  body.top-search-open::before,
  #topSearchResults.top-search-results {
    top: calc(var(--arrserve-appbar-height) * 2) !important;
  }
  #topSearchResults.top-search-results {
    padding: 18px 14px 38px;
  }
  .top-search-fullscreen-head {
    top: -18px;
    margin: -18px -14px 18px;
    padding: 14px;
  }
  #topSearchResults .top-search-poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 14px;
  }
}


/* v0.4.27 Latest toggle and 25-item home rows */
.latest-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.latest-title-row {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.latest-title-row h2 {
  margin: 0;
}

.latest-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  background: rgba(0,0,0,.20);
}
.latest-toggle button {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}
.latest-toggle button.active {
  background: rgba(255,255,255,.12);
  color: var(--text);
}
.latest-home-row .media-poster-card {
  flex-basis: 132px;
  min-width: 132px;
}
@media (max-width: 700px) {
  .latest-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* v0.4.34 compact TV/Movies category header + tighter Latest row */
#pageTitle.with-back-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.title-back-arrow {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.07);
  color: white;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}
.title-back-arrow:hover {
  background: rgba(255,255,255,.12);
}
.library-latest-section {
  margin-top: -6px;
  margin-bottom: 14px;
  padding: 10px 12px 8px;
  border-radius: 18px;
}
.library-latest-section .section-head {
  margin-bottom: 6px;
}
.library-latest-section .home-scroll-wrap {
  margin-top: 2px;
}
.library-latest-section .home-scroll-track {
  padding-bottom: 4px;
}
.library-latest-section .latest-toggle {
  padding: 2px;
}
.library-latest-section .latest-toggle button {
  padding: 5px 10px;
}
.library-latest-row .media-poster-card,
.library-latest-poster {
  flex-basis: 132px;
  min-width: 132px;
}
.library-showing-summary {
  color: var(--muted);
  font-size: 13px;
  padding: 0 4px;
}
.library-pager-summary {
  justify-content: flex-end;
}
@media (max-width: 700px) {
  #pageTitle.with-back-arrow {
    font-size: 28px;
  }
  .library-pager {
    justify-content: flex-start;
  }
  .library-showing-summary {
    width: 100%;
  }
}


/* v0.4.41 home row image sizing polish */
.home-view .library-home-row .library-tile {
  width: 290px;
  min-width: 290px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.home-view .library-home-row .library-tile:hover {
  background: transparent;
  transform: translateY(-3px);
}
.home-view .library-home-row .library-thumb {
  margin-bottom: 8px;
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(0,0,0,.24);
}
.home-view .trending-home-row .media-poster-card,
.home-view .latest-home-row .media-poster-card {
  flex-basis: 106px;
  min-width: 106px;
  max-width: 136px;
}
.home-view .trending-home-row .media-poster-card .banner-poster,
.home-view .latest-home-row .media-poster-card .banner-poster {
  width: min(100%, 106px);
}
.home-view .trending-home-row .media-poster-card strong,
.home-view .trending-home-row .media-poster-card small,
.home-view .latest-home-row .media-poster-card strong,
.home-view .latest-home-row .media-poster-card small {
  width: min(95%, 106px);
}
@media (max-width: 900px) {
  .home-view .library-home-row .library-tile {
    width: 263px;
    min-width: 263px;
  }
  .home-view .trending-home-row .media-poster-card,
  .home-view .latest-home-row .media-poster-card {
    flex-basis: 98px;
    min-width: 98px;
    max-width: 122px;
  }
  .home-view .trending-home-row .media-poster-card .banner-poster,
  .home-view .latest-home-row .media-poster-card .banner-poster {
    width: min(100%, 98px);
  }
}


/* v0.4.43 fixed movie and TV poster ratio */
.home-view .library-home-row .library-tile {
  width: 512px;
  min-width: 512px;
  max-width: 512px;
}
.home-view .library-home-row .library-thumb {
  width: 512px;
  max-width: 100%;
}

.media-poster-card.media-type-movie,
.media-poster-card.media-type-tv {
  flex-basis: 280px;
  min-width: 280px;
  max-width: 280px;
}
.media-poster-card.media-type-movie .banner-poster,
.media-poster-card.media-type-tv .banner-poster {
  width: 280px;
  height: 420px;
  max-width: 100%;
  aspect-ratio: 2 / 3;
}
.media-poster-card.media-type-movie strong,
.media-poster-card.media-type-movie small,
.media-poster-card.media-type-tv strong,
.media-poster-card.media-type-tv small {
  width: min(95%, 280px);
}

.media-poster-card.media-type-music {
  flex-basis: 280px;
  min-width: 280px;
  max-width: 280px;
}
.media-poster-card.media-type-music .banner-poster {
  width: 280px;
  height: 280px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
}
.media-poster-card.media-type-music strong,
.media-poster-card.media-type-music small {
  width: min(95%, 280px);
}

.library-media-grid,
.grid:has(.library-media-card) {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 900px) {
  .home-view .library-home-row .library-tile {
    width: min(512px, 82vw);
    min-width: min(512px, 82vw);
    max-width: min(512px, 82vw);
  }
  .home-view .library-home-row .library-thumb {
    width: min(512px, 82vw);
  }
  .media-poster-card.media-type-movie,
  .media-poster-card.media-type-tv,
  .media-poster-card.media-type-music {
    flex-basis: min(280px, 72vw);
    min-width: min(280px, 72vw);
    max-width: min(280px, 72vw);
  }
  .media-poster-card.media-type-movie .banner-poster,
  .media-poster-card.media-type-tv .banner-poster {
    width: min(280px, 72vw);
    height: min(420px, 108vw);
  }
  .media-poster-card.media-type-music .banner-poster {
    width: min(280px, 72vw);
    height: min(280px, 72vw);
  }
  .library-media-grid,
  .grid:has(.library-media-card) {
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 72vw), 1fr));
  }
}

/* v0.4.44 hard-lock Movie/TV poster frames after v0.4.43 sizing conflict */
:root {
  --arrserve-poster-w: 280px;
  --arrserve-poster-h: 420px;
  --arrserve-music-art: 280px;
  --arrserve-poster-card-w: 292px;
}

.media-poster-card.media-type-movie,
.media-poster-card.media-type-tv {
  width: var(--arrserve-poster-card-w) !important;
  min-width: var(--arrserve-poster-card-w) !important;
  max-width: var(--arrserve-poster-card-w) !important;
  flex: 0 0 var(--arrserve-poster-card-w) !important;
  justify-items: center;
  align-self: start;
}

.media-poster-card.media-type-movie .banner-poster,
.media-poster-card.media-type-tv .banner-poster {
  width: var(--arrserve-poster-w) !important;
  min-width: var(--arrserve-poster-w) !important;
  max-width: var(--arrserve-poster-w) !important;
  height: var(--arrserve-poster-h) !important;
  min-height: var(--arrserve-poster-h) !important;
  max-height: var(--arrserve-poster-h) !important;
  aspect-ratio: auto !important;
  overflow: hidden;
  flex: 0 0 auto;
}

.media-poster-card.media-type-movie .banner-poster img,
.media-poster-card.media-type-tv .banner-poster img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center;
  display: block;
}

.media-poster-card.media-type-movie strong,
.media-poster-card.media-type-movie small,
.media-poster-card.media-type-tv strong,
.media-poster-card.media-type-tv small {
  width: var(--arrserve-poster-w) !important;
  max-width: var(--arrserve-poster-w) !important;
}

.media-poster-card.media-type-music {
  width: var(--arrserve-poster-card-w) !important;
  min-width: var(--arrserve-poster-card-w) !important;
  max-width: var(--arrserve-poster-card-w) !important;
  flex: 0 0 var(--arrserve-poster-card-w) !important;
  justify-items: center;
  align-self: start;
}

.media-poster-card.media-type-music .banner-poster {
  width: var(--arrserve-music-art) !important;
  min-width: var(--arrserve-music-art) !important;
  max-width: var(--arrserve-music-art) !important;
  height: var(--arrserve-music-art) !important;
  min-height: var(--arrserve-music-art) !important;
  max-height: var(--arrserve-music-art) !important;
  aspect-ratio: auto !important;
  overflow: hidden;
  flex: 0 0 auto;
}

.media-poster-card.media-type-music .banner-poster img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center;
  display: block;
}

.media-poster-card.media-type-music strong,
.media-poster-card.media-type-music small {
  width: var(--arrserve-music-art) !important;
  max-width: var(--arrserve-music-art) !important;
}

.library-media-grid,
.grid:has(.library-media-card) {
  grid-template-columns: repeat(auto-fill, minmax(var(--arrserve-poster-card-w), 1fr));
  justify-items: center;
}

@media (max-width: 900px) {
  :root {
    --arrserve-poster-w: min(280px, 72vw);
    --arrserve-poster-h: min(420px, 108vw);
    --arrserve-music-art: min(280px, 72vw);
    --arrserve-poster-card-w: calc(min(280px, 72vw) + 12px);
  }
}

/* v0.4.45 responsive poster density sizing */
:root {
  --arrserve-home-poster-across: 11;
  --arrserve-home-gap-total: 120px;
  --arrserve-library-across: 11;
  --arrserve-library-gap-total: 120px;
  --arrserve-poster-gap: 12px;
}

.poster-density-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(15,23,42,.62);
  color: var(--text);
}
.poster-density-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 15px;
  line-height: 1;
  color: #cbd5e1;
}
.poster-density-control select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.poster-density-control select option {
  background: #0f172a;
  color: var(--text);
}
.field-row {
  display: grid;
  gap: 8px;
}
.field-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* Home: scale poster rows by desired visible poster count. Default = 8.5 across. */
.home-view .poster-home-row .home-scroll-track {
  gap: var(--arrserve-poster-gap);
}
.home-view .poster-home-row .media-poster-card {
  width: calc((100% - var(--arrserve-home-gap-total)) / var(--arrserve-home-poster-across)) !important;
  min-width: calc((100% - var(--arrserve-home-gap-total)) / var(--arrserve-home-poster-across)) !important;
  max-width: none !important;
  flex: 0 0 calc((100% - var(--arrserve-home-gap-total)) / var(--arrserve-home-poster-across)) !important;
  padding: 8px 4px 12px;
}
.home-view .poster-home-row .media-poster-card .banner-poster {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden;
}
.home-view .poster-home-row .media-poster-card strong,
.home-view .poster-home-row .media-poster-card small {
  width: 100% !important;
  max-width: 100% !important;
}

/* Library latest rows use the selected library poster density. */
.library-latest-row .home-scroll-track {
  gap: var(--arrserve-poster-gap);
}
.library-latest-row .media-poster-card {
  width: calc((100% - var(--arrserve-library-gap-total)) / var(--arrserve-library-across)) !important;
  min-width: calc((100% - var(--arrserve-library-gap-total)) / var(--arrserve-library-across)) !important;
  max-width: none !important;
  flex: 0 0 calc((100% - var(--arrserve-library-gap-total)) / var(--arrserve-library-across)) !important;
  padding: 8px 4px 12px;
}
.library-latest-row .media-poster-card .banner-poster {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

/* Library pages: exact selected poster count across the available grid width. */
.library-media-grid,
.grid:has(.library-media-card) {
  grid-template-columns: repeat(var(--arrserve-library-across), minmax(0, 1fr)) !important;
  gap: var(--arrserve-poster-gap) !important;
  justify-items: stretch !important;
}
.library-media-grid .media-poster-card,
.grid:has(.library-media-card) .media-poster-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: none !important;
  padding: 8px 4px 12px;
}
.library-media-grid .media-poster-card .banner-poster,
.grid:has(.library-media-card) .media-poster-card .banner-poster {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden;
}
.library-media-grid .media-poster-card strong,
.library-media-grid .media-poster-card small,
.grid:has(.library-media-card) .media-poster-card strong,
.grid:has(.library-media-card) .media-poster-card small,
.library-latest-row .media-poster-card strong,
.library-latest-row .media-poster-card small {
  width: 100% !important;
  max-width: 100% !important;
}

.media-poster-card.media-type-movie .banner-poster,
.media-poster-card.media-type-tv .banner-poster {
  aspect-ratio: 2 / 3 !important;
}
.media-poster-card.media-type-music .banner-poster {
  aspect-ratio: 1 / 1 !important;
}

@media (max-width: 900px) {
  :root {
    --arrserve-home-poster-across: 3.5;
    --arrserve-home-gap-total: 30px;
  }
  .poster-density-control {
    width: 100%;
    justify-content: space-between;
  }
}

/* v0.4.46 home library category responsive sizing */
:root {
  --arrserve-home-library-across: 4.5;
  --arrserve-home-library-gap-total: 42px;
}

.home-view .library-home-row .home-scroll-track {
  gap: var(--arrserve-poster-gap);
}
.home-view .library-home-row .library-tile {
  width: calc((100% - var(--arrserve-home-library-gap-total)) / var(--arrserve-home-library-across)) !important;
  min-width: calc((100% - var(--arrserve-home-library-gap-total)) / var(--arrserve-home-library-across)) !important;
  max-width: none !important;
  flex: 0 0 calc((100% - var(--arrserve-home-library-gap-total)) / var(--arrserve-home-library-across)) !important;
  padding: 0 !important;
}
.home-view .library-home-row .library-thumb {
  width: 100% !important;
  max-width: none !important;
  aspect-ratio: 16 / 9;
}
.home-view .library-home-row .library-tile strong {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 900px) {
  :root {
    --arrserve-home-library-across: 1.5;
    --arrserve-home-library-gap-total: 12px;
  }
}



/* v0.4.48 top-bar poster density control */
.appbar {
  grid-template-columns: auto auto minmax(260px, 430px) 1fr auto;
}
.poster-settings-button {
  justify-self: end;
  margin-left: auto;
  font-size: 18px;
}
.poster-settings-panel {
  position: fixed;
  top: calc(var(--arrserve-appbar-height) + 8px);
  right: 16px;
  z-index: 1600;
  width: min(260px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(8, 13, 24, .98);
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.poster-settings-head {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}
.poster-settings-head strong {
  font-size: 14px;
}
.poster-settings-head small {
  color: var(--muted);
  font-size: 12px;
}
.poster-settings-options {
  display: grid;
  gap: 6px;
}
.poster-settings-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.poster-settings-options button:hover,
.poster-settings-options button.active {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
}
.poster-settings-options small {
  color: var(--muted);
  font-size: 12px;
}
.library-page-toolbar .poster-density-control {
  display: none !important;
}
.home-view .poster-home-row .media-poster-card,
.home-view .library-home-row .library-tile,
.library-latest-row .media-poster-card {
  transition: width .12s ease, min-width .12s ease, flex-basis .12s ease;
}
@media (max-width: 900px) {
  .appbar {
    grid-template-columns: auto auto 1fr auto;
  }
  .poster-settings-button {
    grid-column: 4;
    grid-row: 1;
  }
}


/* v0.4.49 library category cards use a separate scale from normal posters.
   Applied from app.js: Smallest 6.5, Small 5, Medium/Large/XL 4.5 across. */


/* v0.4.71b RequestArr-matched external services fields */
.external-services-form {
  grid-template-columns: 1fr;
}
.external-service-panel {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}
.external-service-panel h3 {
  margin: 0;
}
.external-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.external-services-grid label:not(.check-row) {
  display: grid;
  gap: 6px;
  font-weight: 700;
}
.external-services-grid label:not(.check-row) span {
  color: var(--muted);
  font-size: 12px;
}


/* v0.4.75 cleaner Libraries administration layout */
body.admin-libraries-view .topbar {
  display: none;
}
.admin-library-section-head {
  align-items: center;
  margin-bottom: 14px;
}
.section-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.section-title-row h2 {
  margin: 0;
}
.section-count-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.08);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.library-admin-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1350px) {
  .library-admin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1050px) {
  .library-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .library-admin-grid { grid-template-columns: 1fr; }
}

/* v0.4.76 Libraries media-source line cleanup */
.library-compact-form {
  grid-template-columns: 1fr;
}
.library-name-source-line {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(520px, 2fr);
  gap: 12px;
  align-items: start;
}
.library-name-source-line > input[name="name"] {
  width: 100%;
}
.library-inline-source-editor {
  display: grid;
  gap: 10px;
}
.library-inline-source-editor .source-row {
  padding: 0;
  border: 0;
  background: transparent;
}
.source-grid-compact {
  grid-template-columns: minmax(130px, 160px) minmax(220px, 1fr) auto;
  align-items: center;
}
.source-grid-compact .source-picker {
  grid-column: 1 / -1;
}
.source-grid-compact .path-picker label {
  margin-top: 2px;
}
.source-remove {
  white-space: nowrap;
}
@media (max-width: 1050px) {
  .library-name-source-line {
    grid-template-columns: 1fr;
  }
  .source-grid-compact {
    grid-template-columns: 1fr 1fr auto;
  }
}
@media (max-width: 680px) {
  .source-grid-compact {
    grid-template-columns: 1fr;
  }
  .source-grid-compact .source-remove {
    width: fit-content;
  }
}

/* v0.4.77 Library source flow cleanup */
.source-add-row {
  margin-top: -2px;
  justify-content: flex-start;
}
.source-add-row button {
  width: fit-content;
}
.library-submit-row {
  justify-content: flex-end;
}

/* v0.4.78 Root-folder layout correction */
.library-name-source-line {
  grid-template-columns: minmax(260px, .85fr) minmax(130px, 160px) minmax(320px, 1.7fr) auto;
  align-items: start;
}
.library-inline-source-editor,
.library-inline-source-editor .source-row,
.library-inline-source-editor .source-grid-compact {
  display: contents;
}
.library-inline-source-editor .source-picker {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 2px;
}
.root-folder-details {
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
}
.root-folder-details summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
  margin-bottom: 8px;
  list-style-position: inside;
}
.root-folder-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 174px;
  overflow: auto;
  align-items: stretch;
}
.root-folder-list .check-row {
  min-height: 46px;
  align-items: start;
}
.root-folder-list .check-row span {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
.root-folder-list .check-row small {
  display: none;
}
.preserved-root-path {
  display: none !important;
}
@media (max-width: 1050px) {
  .library-name-source-line {
    grid-template-columns: minmax(180px, 1fr) minmax(120px, 150px) minmax(220px, 1fr) auto;
  }
}
@media (max-width: 900px) {
  .library-name-source-line {
    grid-template-columns: 1fr;
  }
  .library-inline-source-editor,
  .library-inline-source-editor .source-row,
  .library-inline-source-editor .source-grid-compact {
    display: grid;
  }
  .library-inline-source-editor .source-row {
    padding: 0;
    border: 0;
    background: transparent;
  }
  .root-folder-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .root-folder-list { grid-template-columns: 1fr; }
}

/* v0.4.93 Continue Watching progress marker */
.media-poster-card .banner-poster {
  position: relative;
}
.watch-progress-bar {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .74);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12);
}
.watch-progress-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #facc15, #38bdf8);
}


/* v0.4.94 Continue Watching quick resume + Jellyfin dense top bar polish */
.continue-watching-card {
  border: 0;
  text-align: center;
}
.continue-watching-card .banner-poster {
  overflow: hidden;
}
.continue-watch-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.92);
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  background: rgba(0,0,0,.62);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease, background .14s ease;
  box-shadow: 0 12px 36px rgba(0,0,0,.42);
}
.continue-watching-card:hover .continue-watch-play,
.continue-watching-card:focus-within .continue-watch-play {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.continue-watch-play:hover {
  background: rgba(0,164,220,.82);
}
.continue-watching-card:hover .banner-poster img {
  filter: brightness(.72);
}
.continue-watching-card small {
  min-height: 1.1em;
}


/* v0.4.95 Jellyfin-style header height and right-side action icons */
.appbar {
  min-height: var(--arrserve-appbar-height);
  height: var(--arrserve-appbar-height);
  grid-template-columns: auto auto minmax(260px, 430px) 1fr auto auto;
  gap: 14px;
  padding: 0 18px;
  background: linear-gradient(180deg, rgba(5, 10, 20, .94), rgba(5, 10, 20, .86));
}
.appbar .icon-button,
.appbar-action-button {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #f8fafc;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: background .16s ease, transform .16s ease;
}
.appbar .icon-button:hover,
.appbar-action-button:hover,
.appbar .icon-button:focus-visible,
.appbar-action-button:focus-visible {
  background: rgba(255,255,255,.13);
  outline: 0;
}
.appbar .icon-button:active,
.appbar-action-button:active {
  transform: scale(.96);
}
.hamburger-button {
  font-size: 24px;
}
.app-logo {
  gap: 11px;
  font-size: 18px;
}
.app-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 18px;
}
.top-search input {
  height: 42px;
  border-radius: 13px;
  padding: 9px 14px;
}
.appbar-links button {
  padding: 10px 5px;
}
.appbar-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
.poster-settings-button {
  justify-self: end;
  margin-left: 0;
}
.arrserve-icon {
  width: 25px;
  height: 25px;
  display: inline-block;
  background: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.arrserve-icon-syncplay {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 11c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3Zm-8 0c1.66 0 3-1.34 3-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3Zm0 2c-2.33 0-7 1.17-7 3.5V19h10.2c-.13-.46-.2-.96-.2-1.5 0-1.08.32-2.06.88-2.9C10.43 13.62 8.92 13 8 13Zm8 0c-.43 0-1 .06-1.61.18A4.94 4.94 0 0 1 17 17.5c0 .53-.08 1.04-.23 1.5H23v-2.5c0-2.33-4.67-3.5-7-3.5Zm-1.8 2.2v4.6l4-2.3-4-2.3Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 11c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3Zm-8 0c1.66 0 3-1.34 3-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3Zm0 2c-2.33 0-7 1.17-7 3.5V19h10.2c-.13-.46-.2-.96-.2-1.5 0-1.08.32-2.06.88-2.9C10.43 13.62 8.92 13 8 13Zm8 0c-.43 0-1 .06-1.61.18A4.94 4.94 0 0 1 17 17.5c0 .53-.08 1.04-.23 1.5H23v-2.5c0-2.33-4.67-3.5-7-3.5Zm-1.8 2.2v4.6l4-2.3-4-2.3Z'/%3E%3C/svg%3E");
}
.arrserve-icon-cast {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 18v3h3c0-1.66-1.34-3-3-3Zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7Zm0-4v2c4.97 0 9 4.03 9 9h2c0-6.08-4.92-11-11-11Zm17-7H4c-1.1 0-2 .9-2 2v3h2V5h16v14h-4v2h4c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 18v3h3c0-1.66-1.34-3-3-3Zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7Zm0-4v2c4.97 0 9 4.03 9 9h2c0-6.08-4.92-11-11-11Zm17-7H4c-1.1 0-2 .9-2 2v3h2V5h16v14h-4v2h4c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Z'/%3E%3C/svg%3E");
}
.arrserve-icon-person {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4Zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4Zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4Z'/%3E%3C/svg%3E");
}
.arrserve-header-toast {
  position: fixed;
  top: calc(var(--arrserve-appbar-height) + 12px);
  right: 18px;
  z-index: 2200;
  max-width: min(420px, calc(100vw - 36px));
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background: rgba(8, 13, 24, .96);
  color: #f8fafc;
  box-shadow: 0 22px 60px rgba(0,0,0,.45);
}
@media (max-width: 900px) {
  .appbar {
    grid-template-columns: auto auto 1fr auto auto;
    min-height: var(--arrserve-appbar-height);
  }
  .top-search {
    grid-column: 1 / -1;
  }
  .appbar-actions {
    grid-column: 4;
    grid-row: 1;
  }
  .poster-settings-button {
    grid-column: 5;
    grid-row: 1;
  }
  .appbar-action-button,
  .appbar .icon-button {
    width: 42px;
    height: 42px;
  }
  .appbar-links {
    display: none;
  }
}
@media (max-width: 560px) {
  .appbar-action-button {
    width: 38px;
    height: 38px;
  }
  .poster-settings-button {
    width: 38px !important;
    height: 38px !important;
  }
  .arrserve-icon {
    width: 22px;
    height: 22px;
  }
}

/* v0.4.98 Next Up row */
.next-up-card .banner-poster::after {
  content: "Next Up";
  position: absolute;
  left: 9px;
  top: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: rgba(255, 255, 255, .92);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  pointer-events: none;
}
.next-up-card small,
.continue-watching-card small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* v0.5.02 SyncPlay / Watch Together foundation */
.appbar-action-button.is-active,
.movie-player-icon-button.is-active {
  color: #facc15;
  background: rgba(250, 204, 21, .14);
}
.syncplay-panel {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .62);
}
.syncplay-panel.hidden { display: none; }
.syncplay-card {
  width: min(680px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;
  position: relative;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.14);
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 30px 90px rgba(0,0,0,.5);
  padding: 22px;
}
.syncplay-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  color: #f8fafc;
  background: rgba(255,255,255,.08);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.syncplay-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 42px;
  margin-bottom: 18px;
}
.syncplay-head .arrserve-icon {
  width: 34px;
  height: 34px;
  color: #facc15;
}
.syncplay-head h2 {
  margin: 0;
  font-size: 1.35rem;
}
.syncplay-head p,
.syncplay-note,
.syncplay-active-card p {
  margin: 4px 0 0;
  color: #94a3b8;
}
.syncplay-body {
  display: grid;
  gap: 16px;
}
.syncplay-active-card,
.syncplay-create,
.syncplay-group-row,
.syncplay-empty {
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 18px;
  background: rgba(15, 23, 42, .72);
  padding: 14px;
}
.syncplay-state-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  margin-bottom: 8px;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #111827;
  background: #facc15;
}
.syncplay-active-card h3 {
  margin: 0;
}
.syncplay-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.syncplay-person {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(148, 163, 184, .16);
  color: #e2e8f0;
  font-size: .85rem;
}
.syncplay-person.is-host {
  background: rgba(250, 204, 21, .16);
  color: #fde68a;
}
.syncplay-create {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}
.syncplay-create label {
  display: grid;
  gap: 6px;
  color: #cbd5e1;
  font-size: .82rem;
  font-weight: 800;
}
.syncplay-create input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 13px;
  background: rgba(2, 6, 23, .72);
  color: #f8fafc;
  padding: 10px 12px;
}
.syncplay-create button,
.syncplay-join,
.syncplay-leave {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 900;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #111827;
}
.syncplay-leave.secondary {
  background: rgba(148, 163, 184, .16);
  color: #e2e8f0;
}
.syncplay-section-title {
  margin: 0 0 8px;
  color: #cbd5e1;
  font-weight: 900;
  letter-spacing: .04em;
}
.syncplay-groups {
  display: grid;
  gap: 10px;
}
.syncplay-group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.syncplay-group-row strong,
.syncplay-group-row small {
  display: block;
}
.syncplay-group-row small {
  margin-top: 4px;
  color: #94a3b8;
}
.syncplay-group-row.is-joined {
  border-color: rgba(250, 204, 21, .38);
}
.syncplay-empty {
  color: #94a3b8;
}
.syncplay-note {
  font-size: .82rem;
}
@media (max-width: 640px) {
  .syncplay-panel { padding: 12px; }
  .syncplay-card { padding: 18px; border-radius: 20px; }
  .syncplay-create,
  .syncplay-group-row {
    grid-template-columns: 1fr;
    display: grid;
    align-items: stretch;
  }
}

/* v0.5.08 OCTO branding */
.app-logo {
  min-width: 178px;
}
.app-logo-image {
  display: block;
  height: 46px;
  width: auto;
  max-width: 216px;
  object-fit: contain;
}
.logo-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 18px;
}
.logo-brand img {
  display: block;
  width: min(260px, 82vw);
  height: auto;
  max-height: 88px;
  object-fit: contain;
}

/* v0.5.14 Admin Playback / Transcoding settings foundation */
.playback-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.field-stack {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}
.field-stack > span {
  font-weight: 800;
}
.transcoding-test-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: start;
}
.transcoding-test-panel #transcodingStatusMount {
  grid-column: 1 / -1;
}
.transcoding-status {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0,0,0,.18);
}
.transcoding-status p,
.transcoding-status small {
  margin: 0;
}
.transcoding-status.good {
  border-color: rgba(48, 209, 88, .35);
  background: rgba(48, 209, 88, .08);
}
.transcoding-status.warn {
  border-color: rgba(255, 204, 0, .32);
  background: rgba(255, 204, 0, .07);
}
@media (max-width: 760px) {
  .transcoding-test-panel {
    grid-template-columns: 1fr;
  }
}

/* v0.5.19 Admin Activity / Playback monitoring cleanup */
.admin-activity-section .section-head { margin-bottom: 16px; }
.activity-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.activity-summary-card {
  display: grid;
  gap: 2px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(0,0,0,.18);
}
.activity-summary-card strong {
  font-size: 28px;
  line-height: 1;
}
.activity-summary-card span { color: var(--muted); font-size: 12px; }
.activity-updated { margin: 8px 0 14px; font-size: 12px; }
.activity-session-list { display: grid; gap: 12px; }
.activity-session-card {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.035);
}
.activity-avatar { width: 50px; height: 50px; border-radius: 16px; }
.activity-session-main { min-width: 0; display: grid; gap: 9px; }
.activity-session-head,
.activity-session-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.activity-session-head strong,
.activity-playback-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-session-head small,
.activity-session-foot small,
.activity-session-detail small {
  display: block;
  color: var(--muted);
}
.activity-session-age { text-align: right; color: var(--muted); font-size: 12px; }
.activity-chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.activity-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 12px;
}
.activity-chip.qsv-chip { border-color: rgba(48, 209, 88, .35); color: #b9f6c8; background: rgba(48, 209, 88, .08); }
.activity-chip.cpu-chip { border-color: rgba(255, 204, 0, .32); color: #ffe89a; background: rgba(255, 204, 0, .07); }
.activity-chip.direct-chip { border-color: rgba(0, 164, 220, .35); color: #bceeff; background: rgba(0, 164, 220, .08); }
.activity-chip.sync-chip { border-color: rgba(167, 139, 250, .35); color: #d8ccff; background: rgba(167, 139, 250, .08); }
.activity-chip.warn-chip { border-color: rgba(255, 120, 120, .36); color: #ffc6c6; background: rgba(255, 120, 120, .08); }
.activity-chip.ok-chip { border-color: rgba(48, 209, 88, .35); color: #b9f6c8; background: rgba(48, 209, 88, .08); }
.activity-chip.neutral-chip { border-color: rgba(255,255,255,.14); color: var(--text); background: rgba(255,255,255,.05); }
.activity-chip.state-chip { text-transform: capitalize; }
.activity-chip.muted-chip { color: var(--muted); }
.activity-session-detail {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(0,0,0,.16);
}
.activity-session-detail p { margin: 0; }
.activity-playback-title { font-weight: 800; }
.activity-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  margin-top: 9px;
}
.activity-meta-cell {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}
.activity-meta-cell span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.activity-meta-cell strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
  font-size: 12px;
}
.activity-meta-cell.qsv-meta strong { color: #b9f6c8; }
.activity-meta-cell.cpu-meta strong { color: #ffe89a; }
.activity-meta-cell.direct-meta strong { color: #bceeff; }
.activity-meta-cell.warn-meta strong { color: #ffc6c6; }
.activity-fallback-reason { margin-top: 8px; color: #ffc6c6 !important; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .activity-session-card { grid-template-columns: 1fr; }
  .activity-session-head,
  .activity-session-foot { display: grid; }
  .activity-session-age { text-align: left; }
}


/* v0.5.20 OCTO branding/admin sidebar polish */
body.admin-docked .sidebar {
  background: #070d18;
  border-right-color: rgba(255, 255, 255, .10);
  box-shadow: 18px 0 44px rgba(0,0,0,.44);
}
body.admin-docked .sidebar::before {
  content: none;
}
.admin-drawer-head {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 38px;
  align-items: start;
  gap: 8px;
  margin: 0 2px 12px;
  min-height: 92px;
}
.admin-sidebar-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 92px;
  padding: 4px 0 0 38px;
}
.admin-sidebar-logo img {
  display: block;
  width: min(132px, 70%);
  max-height: 86px;
  object-fit: contain;
}
body.admin-docked .drawer-close {
  width: 36px;
  height: 36px;
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: #f8fafc;
}
body.admin-docked .drawer-close:hover {
  background: rgba(255,255,255,.16);
}
body.admin-docked .nav:hover,
body.admin-docked .nav.active {
  background: rgba(255,255,255,.10);
}
.login-logo-brand img {
  width: min(230px, 72vw);
  max-height: 180px;
}
.app-logo-image {
  height: 50px;
  max-width: 246px;
}

/* v0.5.21 OCTRIX favicon + solid admin UI color polish */
:root {
  --octrix-admin-bg: #090d14;
  --octrix-admin-bg-soft: #101724;
  --octrix-admin-panel: #121926;
  --octrix-admin-panel-2: #1b2637;
  --octrix-admin-line: rgba(148, 163, 184, .20);
  --octrix-admin-line-strong: rgba(244, 179, 71, .36);
  --octrix-admin-gold: #f4b347;
  --octrix-admin-gold-2: #ffd166;
  --octrix-admin-blue: #4fc3ff;
  --octrix-admin-blue-2: #7dd3fc;
}
body.admin-docked .appbar {
  background: var(--octrix-admin-bg);
  border-bottom-color: var(--octrix-admin-line);
  backdrop-filter: none;
  box-shadow: 0 14px 36px rgba(0,0,0,.36);
}
body.admin-docked .sidebar {
  background: var(--octrix-admin-bg);
  border-right-color: var(--octrix-admin-line);
  box-shadow: 18px 0 44px rgba(0,0,0,.42);
  overflow-x: visible;
}
body.admin-docked .main {
  background: radial-gradient(circle at top left, rgba(79,195,255,.08), transparent 28%), var(--octrix-admin-bg-soft);
}
body.admin-docked .admin-drawer-head {
  min-height: 128px;
  padding-top: 92px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--octrix-admin-line);
}
body.admin-docked .admin-sidebar-logo-perched {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 136px;
  height: 86px;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: #0b111c;
  border: 1px solid var(--octrix-admin-line-strong);
  box-shadow: 0 18px 45px rgba(0,0,0,.34), 0 0 32px rgba(79,195,255,.10);
}
body.admin-docked .admin-sidebar-logo-perched img {
  width: 104px;
  max-width: 104px;
  max-height: 70px;
  object-fit: contain;
}
body.admin-docked .drawer-close {
  position: absolute;
  top: 14px;
  right: 8px;
  background: #121926;
  border-color: var(--octrix-admin-line);
  color: #f7f8fb;
}
body.admin-docked .drawer-close:hover {
  background: #1b2637;
  border-color: rgba(244,179,71,.52);
  color: var(--octrix-admin-gold-2);
}
body.admin-docked .nav-section {
  color: var(--octrix-admin-blue-2);
  letter-spacing: .13em;
}
body.admin-docked .nav {
  color: #9da8ba;
  background: #101724;
  border: 1px solid transparent;
}
body.admin-docked .nav:hover {
  color: #f7f8fb;
  background: #121926;
  border-color: rgba(79,195,255,.24);
}
body.admin-docked .nav.active {
  color: #fff7dc;
  background: linear-gradient(135deg, rgba(244,179,71,.18), rgba(79,195,255,.08));
  border-color: var(--octrix-admin-line-strong);
  box-shadow: inset 3px 0 0 var(--octrix-admin-gold);
}
body.admin-docked .nav.ghost {
  color: #dbeafe;
  background: #0f1724;
  border-color: rgba(79,195,255,.18);
}
body.admin-docked .nav.ghost:hover {
  color: white;
  border-color: rgba(79,195,255,.36);
}
body.admin-docked .card,
body.admin-docked .section-card,
body.admin-docked .form,
body.admin-docked .settings-panel,
body.admin-docked .activity-session-card,
body.admin-docked .activity-summary-card {
  background: var(--octrix-admin-panel);
  border-color: var(--octrix-admin-line);
  box-shadow: 0 18px 46px rgba(0,0,0,.24);
}
body.admin-docked .section-card,
body.admin-docked .card {
  border-radius: 22px;
}
body.admin-docked input,
body.admin-docked select,
body.admin-docked textarea {
  background: #0b111c;
  border-color: rgba(148,163,184,.24);
}
body.admin-docked input:focus,
body.admin-docked select:focus,
body.admin-docked textarea:focus {
  outline: 2px solid rgba(79,195,255,.28);
  border-color: rgba(79,195,255,.44);
}
body.admin-docked button.primary {
  background: linear-gradient(135deg, var(--octrix-admin-blue), #2e96df);
  color: #03111f;
  font-weight: 850;
}
body.admin-docked button.secondary {
  background: #101724;
  border-color: var(--octrix-admin-line);
}
body.admin-docked button.secondary:hover {
  background: #1b2637;
  border-color: rgba(79,195,255,.35);
}
body.admin-docked .status {
  background: #101724;
  border-color: var(--octrix-admin-line);
  color: #cbd5e1;
}
body.admin-docked .badge,
body.admin-docked .nav-badge {
  background: rgba(244,179,71,.18);
  color: var(--octrix-admin-gold-2);
  border-color: rgba(244,179,71,.35);
}
body.admin-docked .activity-chip.qsv-chip,
body.admin-docked .activity-meta-cell.qsv-meta strong {
  color: #bfffe0;
}
body.admin-docked .activity-chip.cpu-chip,
body.admin-docked .activity-meta-cell.cpu-meta strong {
  color: var(--octrix-admin-gold-2);
}
body.admin-docked .appbar-links button:hover,
body.admin-docked .appbar-links button:focus-visible {
  color: var(--octrix-admin-gold-2);
}

/* v0.5.22 Admin/User sidebar mascot match */
body.admin-docked .admin-sidebar-logo-perched {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}
body.admin-docked .admin-sidebar-logo-perched img {
  width: 116px;
  max-width: 116px;
  max-height: 78px;
}
body.drawer-open:not(.admin-docked) .sidebar {
  background: var(--octrix-admin-bg, #090d14);
  border-right-color: var(--octrix-admin-line, rgba(148,163,184,.20));
  box-shadow: 18px 0 44px rgba(0,0,0,.42);
  overflow-x: visible;
}
body.drawer-open:not(.admin-docked) .sidebar::before {
  content: none;
}
.user-drawer-head {
  position: relative;
  min-height: 128px;
  padding-top: 92px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--octrix-admin-line, rgba(148,163,184,.20));
}
.user-sidebar-logo-perched {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 136px;
  height: 86px;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}
.user-sidebar-logo-perched img {
  width: 116px;
  max-width: 116px;
  max-height: 78px;
  object-fit: contain;
}
body.drawer-open:not(.admin-docked) .drawer-close {
  position: absolute;
  top: 14px;
  right: 8px;
  background: #121926;
  border-color: var(--octrix-admin-line, rgba(148,163,184,.20));
  color: #f7f8fb;
}
body.drawer-open:not(.admin-docked) .drawer-close:hover {
  background: #1b2637;
  border-color: rgba(244,179,71,.52);
  color: var(--octrix-admin-gold-2, #ffd166);
}
body.drawer-open:not(.admin-docked) .nav-section {
  color: var(--octrix-admin-blue-2, #7dd3fc);
  letter-spacing: .13em;
}
body.drawer-open:not(.admin-docked) .nav {
  color: #9da8ba;
  background: #101724;
  border: 1px solid transparent;
}
body.drawer-open:not(.admin-docked) .nav:hover {
  color: #f7f8fb;
  background: #121926;
  border-color: rgba(79,195,255,.24);
}
body.drawer-open:not(.admin-docked) .nav.active {
  color: #fff7dc;
  background: linear-gradient(135deg, rgba(244,179,71,.18), rgba(79,195,255,.08));
  border-color: var(--octrix-admin-line-strong, rgba(244,179,71,.36));
  box-shadow: inset 3px 0 0 var(--octrix-admin-gold, #f4b347);
}
body.drawer-open:not(.admin-docked) .nav.ghost {
  color: #dbeafe;
  background: #0f1724;
  border-color: rgba(79,195,255,.18);
}
body.drawer-open:not(.admin-docked) .nav.ghost:hover {
  color: white;
  border-color: rgba(79,195,255,.36);
}
body.drawer-open:not(.admin-docked) .admin-entry {
  color: #fff7dc;
  background: linear-gradient(135deg, rgba(244,179,71,.16), rgba(79,195,255,.08));
  border-color: var(--octrix-admin-line-strong, rgba(244,179,71,.36));
}
body.drawer-open:not(.admin-docked) .side-note {
  color: #9da8ba;
}


/* v0.5.23 Activity transcode buffer bars */
.activity-progress-wrap {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.activity-progress-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}
.activity-progress-labels span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-progress-bar {
  position: relative;
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.28);
}
.activity-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  min-width: 1px;
}
.activity-progress-fill.transcode-fill {
  background: linear-gradient(90deg, rgba(79,195,255,.30), rgba(125,211,252,.22));
}
.activity-progress-fill.watched-fill {
  background: linear-gradient(90deg, rgba(244,179,71,.92), rgba(255,209,102,.78));
  box-shadow: 0 0 12px rgba(244,179,71,.18);
}
body.admin-docked .activity-progress-bar {
  background: rgba(1,6,14,.52);
  border-color: rgba(125,211,252,.14);
}

/* v0.5.25 Stream Health / Activity upgrade */
.stream-health-summary {
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
}
.stream-health-summary .activity-summary-card {
  background: linear-gradient(180deg, rgba(18,25,38,.92), rgba(9,13,20,.92));
  border-color: rgba(125,211,252,.16);
}
.activity-chip.risk-chip {
  border-color: rgba(244,179,71,.42);
  color: #ffdca0;
  background: rgba(244,179,71,.09);
}
.activity-meta-cell.risk-meta strong {
  color: #ffdca0;
}
.activity-meta-cell.warn-meta,
.activity-meta-cell.risk-meta {
  border-color: rgba(244,179,71,.22);
}
.activity-meta-cell.qsv-meta {
  border-color: rgba(48,209,88,.16);
}

/* v0.5.26 Load view + Admin version polish */
body.admin-docked .admin-sidebar-logo-perched {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.admin-sidebar-version {
  display: block;
  color: rgba(255, 209, 102, .82);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1;
  text-shadow: 0 1px 8px rgba(0,0,0,.42);
}
body.admin-docked .admin-sidebar-logo-perched .admin-sidebar-version {
  margin-top: 12px;
}
.load-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}
.activity-summary-card.load-card {
  border-color: rgba(125,211,252,.24);
  background: linear-gradient(180deg, rgba(18,25,38,.98), rgba(9,13,20,.96));
}
.activity-summary-card.load-card strong {
  font-size: 18px;
  letter-spacing: .01em;
}
.activity-summary-card.load-card.load-good strong { color: #b9f6c8; }
.activity-summary-card.load-card.load-active strong { color: var(--octrix-admin-blue-2, #7dd3fc); }
.activity-summary-card.load-card.load-warn strong { color: #ffdca0; }
.activity-summary-card.load-card.load-idle strong { color: #cbd5e1; }
.activity-load-warning {
  margin: -2px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(244,179,71,.28);
  border-radius: 14px;
  background: rgba(244,179,71,.08);
  color: #ffdca0;
  font-size: 13px;
  font-weight: 800;
}

/* v0.5.28 Activity avatar polish */
.admin-activity-section .activity-session-list {
  grid-template-columns: repeat(auto-fill, minmax(320px, 380px));
  align-items: start;
  justify-content: start;
  gap: 16px;
}
.admin-activity-section .activity-session-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  grid-template-areas:
    "media body"
    "foot foot";
  width: 100%;
  max-width: 380px;
  min-height: 0;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(18,25,38,.96), rgba(7,13,24,.96));
}
.admin-activity-section .activity-card-media { grid-area: media; min-width: 0; }
.admin-activity-section .activity-card-body { grid-area: body; min-width: 0; display: grid; gap: 8px; }
.admin-activity-section .card-footline {
  grid-area: foot;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.activity-poster {
  width: 104px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 1px solid rgba(125,211,252,.16);
  background: radial-gradient(circle at 28% 18%, rgba(79,195,255,.22), transparent 38%), linear-gradient(145deg, rgba(244,179,71,.14), rgba(9,13,20,.96));
  box-shadow: 0 18px 30px rgba(0,0,0,.32);
  color: #fff7dc;
  font-weight: 900;
  letter-spacing: .08em;
}
.activity-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.activity-poster.backdrop-poster img { object-fit: cover; }
.activity-poster span { font-size: 24px; text-shadow: 0 1px 16px rgba(79,195,255,.25); }
.admin-activity-section .activity-avatar-large {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  margin: 6px auto 0;
}
.admin-activity-section .compact-session-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.admin-activity-section .compact-session-head strong {
  font-size: 15px;
}

.admin-activity-section .activity-user-headline {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.admin-activity-section .activity-user-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.admin-activity-section .activity-avatar-inline {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 10px;
  font-size: 11px;
  border: 1px solid rgba(125,211,252,.18);
  background: radial-gradient(circle at 30% 15%, rgba(244,179,71,.18), transparent 38%), linear-gradient(135deg, rgba(79,195,255,.18), rgba(8,13,24,.96));
  box-shadow: 0 8px 18px rgba(0,0,0,.24);
}
.admin-activity-section .activity-avatar-inline img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.admin-activity-section .activity-session-age {
  font-size: 10px;
  line-height: 1.25;
}
.admin-activity-section .activity-chip-row {
  gap: 5px;
}
.admin-activity-section .activity-chip {
  min-height: 21px;
  padding: 3px 7px;
  font-size: 10px;
}
.admin-activity-section .activity-session-detail {
  padding: 0;
  border: 0;
  background: transparent;
}
.activity-now-title-row {
  display: grid;
  gap: 2px;
}
.activity-now-title-row small,
.activity-media-subline {
  color: var(--muted);
  font-size: 11px;
}
.admin-activity-section .activity-playback-title {
  font-size: 16px;
  line-height: 1.12;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.admin-activity-section .activity-progress-wrap { margin-top: 8px; gap: 5px; }
.admin-activity-section .activity-progress-labels { font-size: 10px; }
.admin-activity-section .activity-progress-bar { height: 13px; }
.activity-key-stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}
.activity-key-stat {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
}
.activity-key-stat span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.activity-key-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-key-stat.qsv-stat strong { color: #b9f6c8; }
.admin-activity-section .compact-meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.admin-activity-section .compact-meta-grid .activity-meta-cell {
  padding: 6px 7px;
  border-radius: 10px;
}
.admin-activity-section .compact-meta-grid .activity-meta-cell span { font-size: 8px; }
.admin-activity-section .compact-meta-grid .activity-meta-cell strong { font-size: 10px; }
.admin-activity-section .activity-browsing-card {
  grid-template-columns: 96px minmax(0, 1fr);
}
@media (max-width: 760px) {
  .admin-activity-section .activity-session-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-activity-section .activity-session-card {
    max-width: none;
  }
}
@media (max-width: 430px) {
  .admin-activity-section .activity-session-card {
    grid-template-columns: 82px minmax(0, 1fr);
  }
  .activity-poster { width: 82px; border-radius: 14px; }
  .activity-key-stat-row,
  .admin-activity-section .compact-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* v0.5.29 Activity card detail polish */
.admin-activity-section .activity-session-list {
  grid-template-columns: repeat(auto-fill, minmax(340px, 400px));
}
.admin-activity-section .activity-session-card {
  grid-template-columns: 112px minmax(0, 1fr);
  max-width: 400px;
}
.admin-activity-section .activity-browsing-card {
  grid-template-columns: 104px minmax(0, 1fr);
}
.activity-poster {
  width: 112px;
  border-radius: 17px;
}
.admin-activity-section .activity-avatar-inline {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 12px;
  font-size: 12px;
}
.admin-activity-section .activity-user-headline {
  gap: 10px;
}
.admin-activity-section .activity-primary-meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-activity-section .activity-primary-meta-grid .activity-meta-cell:empty {
  display: none;
}
.activity-advanced-details {
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  overflow: hidden;
}
.activity-advanced-details summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.activity-advanced-details summary::-webkit-details-marker { display: none; }
.activity-advanced-details summary::after {
  content: "+";
  float: right;
  color: #7dd3fc;
  font-weight: 900;
}
.activity-advanced-details[open] summary::after { content: "−"; }
.activity-advanced-details .activity-detail-meta-grid {
  margin: 0;
  padding: 0 8px 8px;
}
.activity-advanced-details .activity-fallback-reason {
  display: block;
  padding: 0 10px 10px;
}
@media (max-width: 430px) {
  .admin-activity-section .activity-session-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }
  .activity-poster { width: 92px; }
  .admin-activity-section .activity-avatar-inline {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }
}


.activity-diagnostics-panel {
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid rgba(125, 211, 252, .22);
  border-radius: 18px;
  background: rgba(9, 13, 20, .82);
}
.activity-diagnostics-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: #e5f4ff;
}
.activity-diagnostic-tables {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}
.activity-diagnostic-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
  background: rgba(15, 23, 42, .72);
  padding: 10px;
}
.activity-diagnostic-table-wrap h3 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7dd3fc;
}
.activity-diagnostic-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  font-size: 12px;
}
.activity-diagnostic-table th,
.activity-diagnostic-table td {
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  padding: 7px 8px;
  text-align: left;
  white-space: nowrap;
}
.activity-diagnostic-table th {
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.activity-diagnostic-table code {
  color: #ffd166;
}
.activity-diagnostic-command-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.activity-diagnostic-command-card {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
  background: rgba(15, 23, 42, .72);
  padding: 10px;
  overflow: hidden;
}
.activity-diagnostic-command-card h3,
.activity-diagnostic-command-card h4 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7dd3fc;
}
.activity-diagnostic-command-card h4 {
  margin-top: 10px;
  color: #cbd5e1;
}
.activity-diagnostic-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 12px;
  margin-bottom: 10px;
  font-size: 12px;
}
.activity-diagnostic-kv-grid span {
  color: #94a3b8;
}
.activity-diagnostic-kv-grid strong {
  color: #e5f4ff;
  overflow-wrap: anywhere;
}
.activity-diagnostic-pre {
  margin: 0;
  max-height: 170px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 10px;
  background: rgba(2, 6, 23, .72);
  padding: 8px;
  color: #dbeafe;
  font-size: 11px;
  line-height: 1.45;
}

/* v0.5.56 Activity diagnostic cleanup */
.activity-hidden-hls-diagnostics {
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 8px;
}
.activity-hidden-hls-diagnostics summary {
  cursor: pointer;
  color: rgba(226,232,240,.72);
  font-size: 11px;
  letter-spacing: .04em;
}
.activity-hidden-hls-diagnostics table {
  margin-top: 8px;
}


/* v0.5.70 OCTO Media Center branding/logo animation */
.app-logo {
  min-width: 188px;
}

.app-logo-image {
  height: 50px;
  max-width: 252px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.28)) drop-shadow(0 0 8px rgba(79,195,255,.12));
}

.login-logo-brand {
  overflow: visible;
}

.login-logo-brand img {
  width: min(360px, 78vw);
  max-height: 360px;
  object-fit: contain;
  overflow: visible;
  filter: drop-shadow(0 24px 44px rgba(0,0,0,.42)) drop-shadow(0 0 18px rgba(255,211,92,.18));
}

.user-sidebar-logo-perched,
.admin-sidebar-logo-perched {
  overflow: visible;
}

.user-sidebar-logo-perched img,
.admin-sidebar-logo-perched img {
  width: 132px;
  max-width: 132px;
  max-height: 124px;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,.38)) drop-shadow(0 0 10px rgba(79,195,255,.16));
}


/* v0.5.70 OCTO login logo sizing cleanup */
.login-screen {
  align-items: start;
  padding-top: clamp(52px, 8vh, 96px);
}

.login-card {
  margin-top: 0;
  padding-top: 24px;
}

.login-logo-brand {
  margin-top: 0;
  margin-bottom: 20px;
  overflow: visible;
}

.login-logo-brand img {
  width: min(288px, 66vw);
  max-height: 336px;
  object-fit: contain;
  object-position: center top;
  overflow: visible;
}


/* v0.5.70 full-width sidebar mascot swim area */
.sidebar {
  overflow: hidden;
}

.user-drawer-head,
.admin-drawer-head {
  overflow: visible !important;
}

.user-drawer-head {
  min-height: 174px !important;
  padding-top: 142px !important;
  margin: 0 0 14px !important;
}

.admin-drawer-head {
  min-height: 164px !important;
  margin: -6px 0 10px !important;
  grid-template-columns: 1fr 38px !important;
}

.user-sidebar-logo-perched,
body.admin-docked .admin-sidebar-logo-perched,
.admin-sidebar-logo-perched {
  width: calc(100% + 28px) !important;
  height: 148px !important;
  max-height: none !important;
  min-height: 148px !important;
  position: absolute !important;
  top: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  pointer-events: none;
}

body.admin-docked .admin-sidebar-logo-perched {
  top: 4px !important;
  padding-left: 0 !important;
  flex-direction: initial !important;
  gap: 0 !important;
}

.user-sidebar-logo-perched img,
body.admin-docked .admin-sidebar-logo-perched img,
.admin-sidebar-logo-perched img {
  width: 150px !important;
  max-width: 150px !important;
  height: 132px !important;
  max-height: 132px !important;
  object-fit: contain !important;
  overflow: visible !important;
  display: block !important;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,.38)) drop-shadow(0 0 12px rgba(79,195,255,.18));
}

body.admin-docked .admin-sidebar-version-bottom {
  margin: auto 12px 6px;
  padding: 8px 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255, 209, 102, .82);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .12em;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0,0,0,.42);
}

body.admin-docked .admin-sidebar-logo-perched .admin-sidebar-version {
  display: none !important;
}


/* v0.5.70 padded mascot SVG + 10% smaller sidebar mascot */
.user-sidebar-logo-perched,
body.admin-docked .admin-sidebar-logo-perched,
.admin-sidebar-logo-perched {
  overflow: visible !important;
}

.user-sidebar-logo-perched img,
body.admin-docked .admin-sidebar-logo-perched img,
.admin-sidebar-logo-perched img {
  width: 135px !important;
  max-width: 135px !important;
  height: 119px !important;
  max-height: 119px !important;
  object-fit: contain !important;
  overflow: visible !important;
}
