/* CrossWatch UI Stylesheet */

/* Base & Variables */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 20% -10%, #15152544, transparent), var(--bg);
  color: var(--fg);
  font: 14px/1.5 ui-sans-serif,system-ui,Segoe UI,Roboto;
}



/* Branding & Provider Palette */

.brand-ico.plex {
  color: var(--plex);
  background: rgba(229,160,13,.12);
  border-color: rgba(229,160,13,.35);
}

.brand-ico.simkl {
  color: var(--simkl);
  background: rgba(0,183,235,.12);
  border-color: rgba(0,183,235,.35);
}

.brand-ico.anilist {
  color: var(--anilist);
  background: rgba(var(--anilist-rgb), .12);
  border-color: rgba(var(--anilist-rgb), .35);
}

.brand-ico.tmdb {
  color: var(--tmdb);
  background: rgba(1,210,119,.12);
  border-color: rgba(1,210,119,.35);
}

.brand-ico.tmdb .tmdb-box {
  display: inline-block;
  padding: 0 4px;
  border-radius: 4px;
  line-height: 16px;
  font-size: 11px;
  font-weight: 800;
  color: var(--tmdb);
  border: 1px solid currentColor;
  background: rgba(1,210,119,.10);
}

.brand-ico.jellyfin {
  color: var(--jellyfin);
  background: rgba(var(--jellyfin-rgb), .12);
  border-color: rgba(var(--jellyfin-rgb), .35);
}

.brand-ico.emby {
  color: var(--emby);
  background: rgba(var(--emby-rgb), .12);
  border-color: rgba(var(--emby-rgb), .35);
}

.brand-ico.mdblist {
  color: var(--mdblist);
  background: rgba(var(--mdblist-rgb), .12);
  border-color: rgba(var(--mdblist-rgb), .35);
}

.brand-ico.tautulli {
  color: var(--tautulli);
  background: rgba(var(--tautulli-rgb), .12);
  border-color: rgba(var(--tautulli-rgb), .35);
}

.brand-text {
  display: inline-flex;
  align-items: flex-end;
}

.tile.plex {
  background: transparent;
  border: 1px solid rgba(var(--plex-rgb), .35);
  box-shadow: 0 0 6px rgba(var(--plex-rgb), .18);
}

.tile.simkl {
  background: transparent;
  border: 1px solid rgba(var(--plex-rgb), .35);
  border-color: rgba(var(--simkl-rgb), .35);
  box-shadow: 0 0 6px rgba(var(--simkl-rgb), .18);
}

.tile.plex .k {
  color: var(--fg, #fff);
  text-shadow: none;
}

.tile.plex .n {
  color: var(--fg, #fff);
  text-shadow: none;
}

.tile.simkl .k {
  color: var(--fg, #fff);
  text-shadow: none;
}

.tile.simkl .n {
  color: var(--fg, #fff);
  text-shadow: none;
}

.cw-badge--deleted::before {
  box-shadow: inset 0 0 0 1px rgba(255, 82, 82, .45);
}

.cw-badge--plex::before {
  box-shadow: inset 0 0 0 1px rgba(255, 179, 0, .45);
}

.cw-badge--simkl::before {
  box-shadow: inset 0 0 0 1px rgba(70, 195, 255, .45);
}

.cw-badge--emby::before {
  box-shadow: inset 0 0 0 1px rgba(var(--emby-rgb), .45);
}

#tile-plex, #tile-simkl, #tile-trakt, #tile-anilist {
  margin-top: 90px;
  position: relative;
  z-index: 1;
}

:root {
  --bg: #000;
  --panel: #0b0b0f;
  --panel2: #0e0e15;
  --muted: #9aa4b2;
  --fg: #f2f4f8;
  --accent: #7c5cff;
  --accent2: #19c37d;
  --danger: #ff4d4f;
  --border: #1a1a24;
  --glow: #7c5cff66;
  --glow2: #19c37d66;
  --grad1: linear-gradient(135deg,#7c5cff,#2da1ff);
  --grad2: linear-gradient(135deg,#19c37d,#36e0b7);
  --grad3: linear-gradient(135deg,#ff7ae0,#ffb86c);
  --brand-grad: linear-gradient(135deg,#2de2ff,#7c5cff,#ff7ae0);
  --plex-rgb: 229,160,13;
  --simkl-rgb: 0,194,255;
  --emby-rgb: 76, 175, 80;
  --mdblist-rgb: 59, 122, 189;
  --jellyfin-rgb: 170, 92, 195;
  --tautulli-rgb: 245, 124, 46;
  --anilist-rgb: 36,160,251;
  --plex: #e5a00d;
  --simkl: #00b7eb;
  --emby: #4CAF50;
  --tmdb: #01d277;
  --trakt: #ed1c24;
  --mdblist: #3B7ABD;
  --jellyfin: #AA5CC3;
  --tautulli: #F57C2E;
  --anilist: #24A0FB;
  --sw-on: #22b27e;
  --sw-on2: #1a9466;
  --sw-off: #c84c4c;
  --sw-off2: #9f3e3e;
  --sw-rail: #101022;
  --sw-edge: #2b2e44;
  --conn-pill-h: 32px;
  --vip-p1: #361863;
  --vip-p2: #5a28cd;
  --ok-b1: #214f86;
  --ok-b2: #2b7eb5;
  --no-1: #7c2f2f;
  --no-2: #612424;
  --bd: rgba(255,255,255,.12);
  --shadow: 0 6px 16px rgba(0,0,0,.30);
  --tip-bg: rgba(16,18,24,.96);
  --tip-bd: rgba(255,255,255,.10);
  --crown-size: 18px;
  --rail-pad: 8px;
  --vip-rail: calc(var(--crown-size) + 2*var(--rail-pad));
  --pill-alpha: .50;
  --rail-alpha: .75;
  --glass-blur: 6px;
}


/* Branding: Provider Helpers */

.prov-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .4;
}

.prov-card[class*="brand-"] .prov-watermark {
  background:
    radial-gradient(80% 60% at 35% 40%, rgba(var(--brand-rgb), .18), transparent 60%),
    radial-gradient(80% 60% at 50% 70%, rgba(var(--brand-rgb), .10), transparent 70%);
}

.prov-watermark::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 8%;
  width: 120%;
  aspect-ratio: 1/1;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: var(--wm);
  filter: grayscale(1) brightness(1.15);
  opacity: .14;
  mix-blend-mode: screen;
}



/* Branding: Insights Provider Tiles */

#stats-card #stat-providers .tile[data-provider=plex] { --brand: var(--plex-rgb); --wm: url("/assets/img/PLEX.svg"); }
#stats-card #stat-providers .tile[data-provider=simkl] { --brand: var(--simkl-rgb); --wm: url("/assets/img/SIMKL.svg"); }
#stats-card #stat-providers .tile[data-provider=trakt] { --brand: 237, 28, 36; --wm: url("/assets/img/TRAKT.svg"); }
#stats-card #stat-providers .tile[data-provider=anilist] { --brand: var(--anilist-rgb); --wm: url("/assets/img/ANILIST.svg"); }
#stats-card #stat-providers .tile[data-provider=jellyfin] { --brand: var(--jellyfin-rgb); --wm: url("/assets/img/JELLYFIN.svg"); }
#stats-card #stat-providers .tile[data-provider=emby] { --brand: var(--emby-rgb); --wm: url("/assets/img/EMBY.svg"); }
#stats-card #stat-providers .tile[data-provider=mdblist] { --brand: var(--mdblist-rgb); --wm: url("/assets/img/MDBLIST.svg"); }
#stats-card #stat-providers .tile[data-provider=tautulli] { --brand: var(--tautulli-rgb); --wm: url("/assets/img/TAUTULLI.svg"); }
#stats-card #stat-providers .tile[data-provider=crosswatch] { --brand: 124, 92, 255; --wm: url("/assets/img/CROSSWATCH.svg"); }



/* Branding: Client Formatter Badges */

.cf-plex { background: #2b240a; color: #ffbf3a; border-color: rgba(255,191,58,.28); }
.cf-simkl { background: #072430; color: #35d1ff; border-color: rgba(53,209,255,.28); }
.cf-trakt { background: #2b0a0a; color: #ff6470; border-color: rgba(255,100,112,.28); }
.cf-jellyfin { background: #15102b; color: #9aa5ff; border-color: rgba(154,165,255,.28); }
.cf-mdblist { background: #0d1926; color: #9fd3ff; border-color: rgba(159,211,255,.28); }
.cf-tautulli { background: #0b1f2b; color: #6ee7ff; border-color: rgba(110,231,255,.28); }
.cf-anilist { background: #071b2b; color: #75c6ff; border-color: rgba(36,160,251,.28); }
.cf-crosswatch { background: #15102b; color: #d6c8ff; border-color: rgba(124,92,255,.35); }



/* Branding: Playing Card Chips */

#playing-detail .pc-chip-source-plex {
  background: rgba(var(--plex-rgb), 0.18);
  color: #ffd36a;
  border: 1px solid rgba(var(--plex-rgb), 0.45);
}

#playing-detail .pc-chip-source-emby {
  background: rgba(var(--emby-rgb), 0.18);
  color: #bbf1bf;
  border: 1px solid rgba(var(--emby-rgb), 0.45);
}

#playing-detail .pc-chip-source-jellyfin {
  background: rgba(var(--jellyfin-rgb), 0.18);
  color: #e8cff8;
  border: 1px solid rgba(var(--jellyfin-rgb), 0.45);
}




/* Typography */

code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0a0a17;
}

.brand .name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .2px;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 6px rgba(124,92,255,.25));
  user-select: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand .version {
  margin-left: 0.35rem;
  font-size: 0.7rem;
  font-weight: 500;
  background: linear-gradient(90deg, #2de2ff, #8f7eff, #ff7ae0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.9;
  position: relative;
  top: -1px;
}

.details-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap: 16px;
  align-items: stretch;
}

.details-grid > .det-right {
  top: 28px !important;
  display: flex;
  flex-direction: column;
}

.details-grid > .det-right .meta-card {
  margin-top: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#placeholder-card .cap {
  display: none !important;
}

#cfg-conn .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title {
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.sub {
  color: var(--muted);
  margin-bottom: 10px;
}

.details {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  margin-top: 10px;
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent),var(--panel);
  box-shadow: 0 0 40px #000 inset;
}

.title-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
}

#cfg-conn .title {
  font-weight: 600;
  letter-spacing: .04em;
  color: #eaeaf0;
}

.cx-card .title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel.sub {
  background: #0a0a14;
}

.cap {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  font-size: 12px;
  color: #dfe3ea;
  text-shadow: 0 1px 2px #000;
}

.hover .titleline {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .02em;
}

.auth-card-caps .cap {
  display: inline-block;
  margin: 4px 6px 0 0;
  opacity: .9;
}

#details .details-grid {
  grid-template-columns: 1fr !important;
}

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



/* Layout & Structure */

#layout {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

#layout:not(.single):not(.full) {
  grid-template-columns: minmax(620px,1fr) minmax(360px,420px);
}

#layout.single {
  grid-template-columns: 1fr;
}

#layout.full {
  grid-template-columns: 1fr;
}

.section>.head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
}

.section>.head:hover {
  background: #11111a;
}

.section > .head {
  position: relative;
  padding-right: 44px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}


/* Settings Hub (UI / Security / CW Tracker) */

#sec-ui.open > .body {
  max-height: 1400px;
}

.cw-settings-hub {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .cw-settings-hub {
    grid-template-columns: 1fr;
  }
}

.cw-hub-tile {
  text-align: left;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  border-radius: 18px;
  padding: 14px;
  color: var(--fg);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.cw-hub-tile:hover {
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.05);
  transform: translateY(-1px);
}

.cw-hub-tile.active {
  border-color: rgba(124, 92, 255, .55);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, .18), 0 14px 30px rgba(0,0,0,.35);
  background:
    radial-gradient(1200px 500px at 15% 0%, rgba(124,92,255,.14), transparent 50%),
    rgba(255,255,255,.04);
}

.cw-hub-title {
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .2px;
}

.cw-hub-desc {
  margin-top: 2px;
  color: rgba(242,244,248,.72);
  font-size: 12px;
}

.cw-hub-tile .chips {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cw-hub-tile .chip {
  cursor: default;
  border-color: rgba(255,255,255,.10);
  background: rgba(0,0,0,.30);
  padding: 5px 9px;
  font-size: 12px;
}

.cw-settings-panels {
  display: grid;
  gap: 12px;
}

.cw-settings-panel {
  display: none;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.16);
  border-radius: 16px;
  padding: 14px;
}

.cw-settings-panel.active {
  display: block;
}

.cw-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cw-panel-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .2px;
}

.cw-disabled {
  opacity: .55;
  filter: grayscale(.15);
  pointer-events: none;
}

.section {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel2);
  overflow: hidden;
  margin-bottom: 12px;
}

.section.open .chev {
  transform: rotate(90deg);
}

.section>.body {
  display: grid;
  gap: 12px;
  padding: 0 14px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
}

.section.open>.body {
  padding: 12px 14px;
  max-height: 850px;
}

#cfg-conn .row {
  display: flex;
  align-items: center;
  gap: 14px;
}

#cfg-conn .fe-row:last-child {
  border-bottom: none;
}

#cfg-conn .fe-row {
  display: grid;
  grid-template-columns: 1.2fr .8fr .6fr .6fr;
  gap: 12px;
  align-items: center;
  padding: 10px 6px;
  border-bottom: 1px dashed rgba(255,255,255,.06);
}

.cx-top.grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}

.cx-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.cx-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cx-mode-row .seg {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
  background: #0a0a17;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.cx-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b0b16;
  margin-bottom: 10px;
}

#st-main-update {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 6px;
}

.section.disabled {
  pointer-events: auto;
}

.section.disabled .head {
  opacity: 1;
}

.section.disabled .body {
  opacity: .55;
}

@media (max-width:1100px) {
  #layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .cx-top.grid {
    grid-template-columns: 1fr;
  }
}



/* Header & Navigation */

.flow-rail .arrow .dot.flow {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%,-50%);
  opacity: 0;
}

.flow-rail .arrow .dot.flow.a {
  background: #7c5cff;
  box-shadow: 0 0 10px #7c5cffaa;
}

.flow-rail .arrow .dot.flow.b {
  background: #2de2ff;
  box-shadow: 0 0 10px #2de2ffaa;
}

.flow-rail.mode-one.dir-add .arrow .dot.flow.a {
  opacity: 1;
  animation: flowRight 1.6s linear infinite;
}

.flow-rail.mode-one.dir-remove .arrow .dot.flow.a {
  opacity: 1;
  animation: flowLeft 1.6s linear infinite;
}

.flow-rail.mode-two.active .arrow .dot.flow.a {
  opacity: 1;
  animation: flowRight 1.6s linear infinite;
}

.flow-rail.mode-two.active .arrow .dot.flow.b {
  opacity: 1;
  animation: flowLeft 1.6s linear infinite;
}

.flow-rail.pretty .arrow .dot.flow {
  top: 50% !important;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg,rgba(10,10,14,.85),rgba(10,10,14,.6),transparent);
  backdrop-filter: blur(6px);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  align-items: center;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.tab {
  position: relative;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  color: var(--muted);
  transition: .2s;
  background: #0b0b16;
  box-shadow: 0 0 0px transparent;
  overflow: hidden;
  animation: neonPulse 3.2s ease-in-out infinite;
}

.tab.active {
  color: var(--fg);
  border-color: #3d38ff;
  box-shadow: 0 0 18px #3d38ff33;
}

.tab:hover {
  box-shadow: 0 0 22px #7c5cff88;
}

.tab.active:hover {
  box-shadow: 0 0 28px #7c5cffaa;
}

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10,10,23,.6);
  color: #fff;
  font-size: 24px;
  line-height: 60px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav:hover {
  box-shadow: 0 0 14px var(--glow);
}

.nav.prev {
  left: 8px;
}

.nav.next {
  right: 8px;
}

.edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  pointer-events: none;
}

.edge.left {
  left: 0;
  background: linear-gradient(90deg,var(--panel) 0%, transparent 100%);
}

.edge.right {
  right: 0;
  background: linear-gradient(270deg,var(--panel) 0%, transparent 100%);
}

.edge.hide {
  opacity: 0;
}

.ops-header .badges {
  margin-left: auto;
}

.stat-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.auth-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.auth-card-header h3 {
  margin: 0;
  font-size: 1rem;
}

.auth-card-header .status.ok {
  color: #5ad27a;
}

.auth-card-header .status.no {
  color: #ff6b6b;
}

.feature-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.feature-tabs .ftab {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0b0b16;
  color: #cdd5e2;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 0 transparent;
}

.feature-tabs .ftab.active {
  background: var(--grad1);
  color: #fff;
  box-shadow: 0 0 18px #7c5cff44;
}

.flow-rail.pretty .arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  transform: translateY(-50%);
  left: -2px;
  border-right-color: #7c5cff;
}

.flow-rail.pretty .arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  transform: translateY(-50%);
  right: -2px;
  border-left-color: #2de2ff;
}

.flow-rail.off .arrow {
  filter: grayscale(.7) brightness(.8);
  opacity: .6;
}

.flow-rail.pretty .arrow {
  position: relative;
  flex: 1;
  background: linear-gradient(90deg,#7c5cff,#2de2ff);
  box-shadow: 0 0 16px #7c5cff33 inset;
  display: block;
  height: 8px !important;
  border-radius: 4px !important;
}

.ftab.disabled {
  opacity: .35;
  pointer-events: none;
  cursor: default !important;
  text-decoration: line-through;
}

.ops-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 44px;
}

.ops-header .badges, #conn-badges.badges {
  margin-left: 0 !important;
}

#details .det-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
}

#details .det-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: .75;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

#details .det-tab.active {
  opacity: 1;
  background: rgba(255,255,255,.08);
}

#details .det-tab.connected::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(46,204,113,.85);
  vertical-align: middle;
}

#details .det-tab.stale::after {
  background: rgba(255,99,99,.85);
}

#details .det-tab:not(.active).connected::after {
  opacity: .45;
}



/* Utilities */

.truncate {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  opacity: .6;
  font-size: 12px;
}

.hover .chip {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  background: #0b0b16aa;
  border: 1px solid #ffffff2b;
}

.sep {
  height: 1px;
  background: linear-gradient(90deg,transparent,#30304a,transparent);
  margin: 12px 0;
}

.hover {
  position: absolute;
  inset: auto 0 0 0;
  background: radial-gradient(800px 220px at 20% -40%, #7c5cff33, transparent 60%),
 radial-gradient(800px 220px at 80% -40%, #19c37d33, transparent 60%),
 linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.55) 10%, rgba(0,0,0,.85) 55%);
  color: #eaf0ff;
  padding: 6px 8px;
  transform: translateY(100%);
  opacity: 0;
  transition: .25s ease;
  border-top: 1px solid #ffffff22;
  backdrop-filter: blur(8px);
}

.hover .meta {
  display: flex;
  gap: 8px;
  margin: 6px 0 8px 0;
  flex-wrap: wrap;
}

.hover .desc {
  font-size: 12px;
  line-height: 1.35;
  color: #e9ecffcc;
  max-height: 60px;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 4;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

#cfg-conn .row .spacer {
  flex: 1;
}

#st-main-update.hidden {
  display: none;
}

.history-badges .sep {
  display: inline-block;
  width: 8px;
}



/* Cards */

#ops-card.card {
  padding-block: 20px 38px;
}

#placeholder-card {
  grid-column: 1 / -1;
}

.meta-card {
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent),var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 0 40px #000 inset;
}

.card {
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent),var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 0 40px #000 inset;
}

.auth-card-actions .btn {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--chip, #1f1f1f);
  border: 1px solid var(--line, #2a2a2a);
  cursor: pointer;
}

.auth-card-actions .btn:hover {
  filter: brightness(1.1);
}

.auth-card-actions .btn.danger {
  background: #2a1414;
  border-color: #4a1a1a;
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
  margin-top: 12px;
}

.tile {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent),#0b0b16;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tile .k {
  color: #cdd5e0;
  font-size: 12px;
  letter-spacing: .03em;
}

.tile .n {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.tile.g1 {
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent),#0b101e;
}

.tile.g2 {
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent),#0c1410;
}

.tile.g3 {
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent),#160e17;
}

.tile.tautulli {
  background: transparent;
  border: 1px solid rgba(var(--tautulli-rgb), .35);
  box-shadow: 0 0 6px rgba(var(--tautulli-rgb), .18);
}

.tile.tautulli .k, .tile.tautulli .n {
  color: var(--fg, #fff);
  text-shadow: none;
}

.tile.emby {
  background: transparent;
  border: 1px solid rgba(var(--emby-rgb), .35);
  box-shadow: 0 0 6px rgba(var(--emby-rgb), .18);
}

.tile.emby .k, .tile.emby .n {
  color: var(--fg, #fff);
  text-shadow: none;
}

#tile-emby {
  margin-top: 90px;
  position: relative;
  z-index: 1;
}

.auth-card {
  border: 1px solid var(--line, #2a2a2a);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  background: var(--panel, #121212);
}

.auth-card-notes {
  font-size: .85rem;
  opacity: .8;
  margin-bottom: 8px;
}

.auth-card-fields .field {
  margin: 6px 0;
}

.auth-card-fields input {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line, #2a2a2a);
  background: var(--panel, #0f0f0f);
  color: inherit;
}

.auth-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.cx-card {
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent),var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 10px 50px #000a;
  padding: 0;
  width: min(1100px, 96vw);
  margin: 40px auto;
}

.cx-card .cx-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.cx-card .app-name {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .2px;
}

.cx-card .app-sub {
  font-size: 12px;
  color: var(--muted);
}

.cx-card .cx-body {
  padding: 16px;
}

.cx-card .cx-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.panel {
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 16px;
  padding: 14px;
}

.panel .panel-title {
  font-weight: 900;
  margin-bottom: 8px;
}

.panel .panel-title.small {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.flow-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: var(--panel2);
}

.flow-card .flow-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.rules-card .rules .r {
  margin-top: 10px;
}

#details .det-right, #details .meta-card, #details .meta-actions {
  display: none !important;
}

#ops-card {
  grid-column: 1;
  position: relative;
}

main.single #ops-card.card {
  padding-bottom: 120px !important;
}

#page-editor.card {
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  grid-column: 1 / -1;
}

#details .det-panels {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#details .det-panel {
  flex: 1 1 auto;
  min-height: 0;
}

@media (min-width:1101px) {
  #ops-card .chiprow {
    margin-bottom: 38px;
  }

  #ops-card .action-row {
    margin-top: 20px !important;
  }
}



/* Buttons & Controls */

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent), #0b0b16;
  color: #dfe6ff;
  cursor: pointer;
  box-shadow: 0 0 0 transparent;
  transition: box-shadow .25s ease, filter .2s ease, transform .05s ease, opacity .2s;
}

.iconbtn:hover {
  box-shadow: 0 0 14px #7c5cff66;
  filter: brightness(1.06);
}

.iconbtn:active {
  transform: translateY(1px);
}

.iconbtn:disabled {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}

.iconbtn.loading svg {
  animation: spin .8s linear infinite;
}

.iconbtn svg {
  transition: transform .3s ease;
}

.iconbtn.spin svg {
  animation: pulseSpin 2s linear;
}

.btn {
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #121224;
  color: #fff;
  cursor: pointer;
  font-weight: 650;
  transition: transform .05s ease, box-shadow .25s ease, background .25s ease, filter .25s ease;
}

.btn:hover {
  box-shadow: 0 0 14px var(--glow);
}

.btn:active {
  transform: translateY(1px);
}

.btn.acc {
  background: var(--grad1);
}

.btn.danger {
  background: linear-gradient(135deg,#ff4d4f,#ff7a7a);
  border-color: #ff9a9a55;
  box-shadow: 0 0 14px #ff4d4f55;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}

.footer .btn:first-child {
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent), var(--grad2);
  box-shadow: 0 0 14px var(--glow2);
}

.footer .btn:nth-child(2) {
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent), var(--grad3);
  box-shadow: 0 0 14px #ff7ae044;
}

.footer .btn:hover {
  filter: brightness(1.07);
  box-shadow: 0 0 22px #7c5cff66;
}

.footer .btn:active {
  transform: translateY(1px);
}

.btn.copied {
  box-shadow: 0 0 0 6px rgba(46, 204, 113, 0.15);
  position: relative;
}

.btn.copied::after {
  content: "Copied!";
  position: absolute;
  top: -28px;
  right: 0;
  background: #2ecc71;
  color: #111;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  animation: pop-fade 900ms ease forwards;
}

.footer .btn {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #121224;
  color: #fff;
  font-weight: 650;
  transition: filter .15s ease, box-shadow .25s ease, transform .05s ease;
}

.footer .btn-exit {
  color: #ffd7d7;
  background: linear-gradient(180deg,#150909,#100606)!important;
  border: 1px solid #4a1417!important;
  box-shadow: inset 0 1px 0 #1a0c0d;
}

.footer .btn-exit:hover {
  filter: brightness(1.05);
  box-shadow: inset 0 1px 0 #211013, 0 0 14px rgba(255,77,79,.15);
}

.footer .btn-exit:active {
  transform: translateY(1px);
}

.footer .btn-ic {
  margin-right: 8px;
  opacity: .9;
}

.icon-btn {
  --fg: #fff;
  --bg: rgba(255,255,255,0.06);
  --bd: rgba(255,255,255,0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--bd);
  color: var(--fg);
  cursor: pointer;
  transition: transform .12s ease, background .2s, border-color .2s, box-shadow .2s;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.icon-btn:active {
  transform: translateY(0);
}

.icon-btn .ico {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn.trash .lid {
  transform-origin: 12px 6px;
  transition: transform .25s ease;
}

.icon-btn.trash:hover .lid {
  transform: translateY(-1px) rotate(-12deg);
}

.icon-btn.working {
  pointer-events: none;
  opacity: .85;
}

.icon-btn.working .ico {
  animation: spin 900ms linear infinite;
}

.icon-btn.done {
  background: rgba(46,204,113,.18);
  border-color: rgba(46,204,113,.45);
}

.icon-btn.error {
  background: rgba(231,76,60,.18);
  border-color: rgba(231,76,60,.45);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .12s;
}

.btn-ghost:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.2);
  transform: translateY(-1px);
}

#cfg-conn .actions .btn {
  min-width: 110px;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  border: 1px solid var(--bd);
  background: var(--panel);
  color: #fff;
}

#cfg-conn .actions .btn.primary {
  border-color: rgba(124,92,255,.5);
  background: linear-gradient(180deg,rgba(124,92,255,.25),rgba(124,92,255,.1));
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.15);
  color: #cfd6ff;
  padding: 6px 10px;
  border-radius: 10px;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 0;
}

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#cfg-conn .actions {
  backdrop-filter: blur(6px);
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg,rgba(14,15,19,0),rgba(14,15,19,.9) 40%);
  padding: 16px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.cx-head .head-toggle {
  gap: 10px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

.cx-head .head-toggle .lab {
  display: none !important;
}

.head-toggle {
  display: none !important;
}

#conn-badges .iconbtn {
  margin-left: 6px;
}

.btn-row {
  display: flex;
  gap: 8px;
}

.btn.busy {
  opacity: .6;
  pointer-events: none;
  position: relative;
}

.btn.busy::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: cwspin 1s linear infinite;
  vertical-align: -3px;
}

.snap-btn {
  all: unset;
  background: linear-gradient(135deg,#7c5cff,#a48fff);
  padding: 6px 10px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  transition: filter .15s;
}

.snap-btn:hover {
  filter: brightness(1.15);
}

.snap-btn[data-name="latest"] {
  background: linear-gradient(135deg,#00e084,#2ea859);
}



/* Form Elements */

.meta-label {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
  text-align: right;
  user-select: none;
}

label {
  font-weight: 650;
  color: var(--muted);
  font-size: 12px;
}

input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0a0a17;
  color: #e7e9f4;
}

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0a0a17;
  color: #e7e9f4;
}

.mini-legend {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto 1fr;
  gap: 6px 10px;
  align-items: center;
  margin-top: 6px;
}

.mini-legend .l {
  color: var(--muted);
  font-size: 12px;
}

.mini-legend .n {
  font-weight: 800;
}

#cfg-conn .field label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

#cfg-conn input[type="text"] {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.98rem;
  outline: none;
}

#cfg-conn .input {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.98rem;
  outline: none;
}

#cfg-conn input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,92,255,.25);
}

#cfg-conn .seg input[type="radio"] {
  display: none;
}

#cfg-conn .seg input[type="radio"]:checked + label {
  background: linear-gradient(180deg, rgba(124,92,255,.35), rgba(124,92,255,.15));
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.06);
}

#cfg-conn input[type="checkbox"] {
  accent-color: var(--accent);
  transform: scale(1.2);
}

#cfg-conn input[type="radio"] {
  accent-color: var(--accent);
  transform: scale(1.2);
}

#cfg-conn .form-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

#cfg-conn .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#cfg-conn .field>label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

#cfg-conn select {
  background: var(--panel);
  color: var(--txt);
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: .98rem;
  outline: none;
}

#cfg-conn input[type=text] {
  background: var(--panel);
  color: var(--txt);
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: .98rem;
  outline: none;
}

#cfg-conn select:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(124,92,255,.25);
}

#cfg-conn input[type=text]:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(124,92,255,.25);
}

#cfg-conn .seg input[type=radio] {
  display: none;
}

#cfg-conn .seg label {
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
  user-select: none;
  font-weight: 600;
}

#cfg-conn .seg input[type=radio]:checked+label {
  background: rgba(124,92,255,.28);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.35),inset 0 0 0 1px rgba(255,255,255,.06);
}

#cfg-conn input[type=checkbox] {
  accent-color: var(--acc);
  transform: scale(1.1);
}

#cfg-conn input[type=radio] {
  accent-color: var(--acc);
  transform: scale(1.1);
}

.cx-row .field label {
  display: block;
  margin-bottom: 6px;
}

.cx-row .input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0a0a17;
  color: #e7e9f4;
}

.cx-mode-row .seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cx-mode-row .seg label {
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

#cx-mode-one:checked + label {
  background: var(--grad1);
  color: #fff;
}

#cx-mode-two:checked + label {
  background: var(--grad1);
  color: #fff;
}

.cx-mode-row .seg label.disabled {
  opacity: .45;
  cursor: not-allowed;
}

.opt-row .switch {
  --w: 44px;
  --h: 24px;
  --dot: 18px;
  --pad: 3px;
  --bw: 1px;
  position: relative;
  display: inline-block;
  width: var(--w);
  height: var(--h);
}

.opt-row .switch input {
  width: 0;
  height: 0;
  position: absolute;
  opacity: 0;
}

.opt-row .switch .slider {
  transition: .2s;
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: var(--bw) solid var(--sw-edge);
  border-radius: 999px;
  background: #0b0b16;
}

.opt-row .switch .slider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--pad) + var(--bw));
  width: var(--dot);
  height: var(--dot);
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px #0009;
  transition: left .25s ease;
}

.opt-row .switch input:checked + .slider {
  background: linear-gradient(135deg,#7c5cff,#2de2ff);
  border-color: #5a63ff66;
}

.opt-row .switch input:checked + .slider::before {
  transform: translate(18px, -50%);
  left: calc(var(--w) - var(--dot) - var(--pad) - var(--bw));
}

input.err,.input.err {
  border-color: #ff4d4f!important;
  box-shadow: 0 0 0 2px rgba(255,77,79,.2) inset;
}

@media (max-width: 820px) {
  #cfg-conn .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width:820px) {
  #cfg-conn .form-grid {
    grid-template-columns: 1fr;
  }
}



/* Badges & Chips */

.dot.ok {
  background: var(--accent2);
}

.dot.no {
  background: var(--danger);
}

#conn-badges .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

#conn-badges .dot.ok {
  background: var(--accent2);
}

#conn-badges .dot.no {
  background: var(--danger);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.flow-rail.off .dot.flow {
  opacity: .15;
  animation: none;
}

.meta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  row-gap: 8px;
  align-items: center;
}

.meta-value {
  min-width: 0;
}

.meta-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.badges {
  display: flex;
  gap: 8px;
  margin: 0;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--border);
  background: #0a0a17;
  padding: 6px 10px;
  border-radius: 999px;
  color: #e7e9f4;
  cursor: pointer;
  user-select: none;
}

.chip.on {
  background: linear-gradient(135deg, var(--accent, #7c5cff), var(--accent2, #19c37d));
  border-color: rgba(124, 92, 255, .9);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, .4), 0 0 14px rgba(124, 92, 255, .35);
}

.chip.src {
  background: #0b1420aa;
  border-color: #4aa8ff66;
}

.chip.time {
  background: #0e1b13aa;
  border-color: #19c37d66;
}

#conn-badges .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.45);
  color: #e7e9f4;
}

#conn-badges .badge.ok {
  background: rgba(25,195,125,.12);
  border-color: rgba(25,195,125,.35);
  box-shadow: 0 0 12px rgba(25,195,125,.35);
  color: #c8ffe6;
}

#conn-badges .badge.no {
  background: rgba(231,76,60,.12);
  border-color: rgba(231,76,60,.35);
  box-shadow: 0 0 12px rgba(231,76,60,.35);
  color: #ffd2d2;
}

.badge.upd {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: rgba(206,117,0,0.18);
  border: 1px solid rgba(206,117,0,0.45);
  color: #fff;
  font-weight: 700;
  will-change: transform, box-shadow;
  transition: background .3s ease, border-color .3s ease, transform .2s ease, box-shadow .2s ease;
  animation: updPulse 2.4s ease-in-out infinite;
}

.badge.upd::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(206,117,0,0.0);
  animation: updHalo 2.4s ease-in-out infinite;
  z-index: -1;
  pointer-events: none;
}

.badge.upd::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(
 120deg,
 transparent 0%,
 rgba(255,255,255,.16) 35%,
 rgba(255,255,255,.18) 50%,
 transparent 65%
 );
  transform: skewX(-12deg);
  animation: updShimmer 5.5s ease-in-out infinite;
  will-change: left;
  pointer-events: none;
}

.badge.upd:hover {
  background: rgba(206,117,0,0.26);
  border-color: rgba(206,117,0,0.55);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(206,117,0,.18);
}

.badge.upd.reveal {
  animation: updPop 650ms cubic-bezier(.2,.9,.2,1) 1, updPulse 2.4s ease-in-out 0s infinite;
}

.badge.upd a {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.badge.upd a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chip.trend.up {
  border-color: #2ecc71;
  color: #c8ffe6;
  box-shadow: 0 0 12px rgba(46,204,113,.25);
}

.chip.trend.down {
  border-color: #ff6b6b;
  color: #ffd7d7;
  box-shadow: 0 0 12px rgba(255,77,79,.20);
}

.chip.trend.flat {
  border-color: #2a2a3a;
  color: #aeb6c2;
}

.pill {
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.08);
  color: #fff;
  background-clip: initial;
  -webkit-text-fill-color: #fff;
  -webkit-background-clip: initial;
}

.stat-block .pill {
  background: linear-gradient(90deg,var(--grad1,#7c5cff),var(--grad2,#2de2ff));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  border: 0;
  background-color: transparent;
  color: inherit;
}

.badge.ok {
  border-color: rgba(46, 204, 113, .5);
}

.badge.warn {
  border-color: rgba(231, 76, 60, .5);
}

.pill.plain {
  background: none !important;
  background-clip: unset !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: unset !important;
  color: #fff !important;
}

.stat-block .pill:not(.plain) {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .2px;
  background: linear-gradient(90deg,var(--grad1,#7c5cff),var(--grad2,#2de2ff));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.badge {
  font-weight: 650;
  align-items: center;
  gap: 8px;
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  opacity: .75;
}

#cfg-conn .chip {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #000;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 6px 16px rgba(0,0,0,.45),inset 0 0 0 1px rgba(255,255,255,.05);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
}

.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #333;
}

.tl-dot.on {
  background: #7c5cff;
  box-shadow: 0 0 10px var(--glow);
}

.chips {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.pillvalue {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #0b0b16aa;
  border: 1px solid #ffffff1a;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
}

.chiprow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.dot.add {
  background: #19c37d;
}

.dot.del {
  background: #ff6b6b;
}

.history-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  opacity: .9;
}

.cw-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.20));
  box-shadow: inset 0 0 0 1px rgba(80, 255, 190, .35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: -1;
}

.cw-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: .35rem .75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
  z-index: 2;
  mix-blend-mode: normal;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: #fff !important;
  color: #fff !important;
  filter: none !important;
}

.cw-badge * {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: #fff !important;
  color: #fff !important;
  filter: none !important;
}

#st-main-update .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(124, 92, 255, .12);
  border: 1px solid rgba(124, 92, 255, .35);
  box-shadow: 0 6px 18px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.04);
  color: #e9e6ff;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

#st-main-update .pill a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(233,230,255,.6);
}

#st-main-update .pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8a6cff;
  box-shadow: 0 0 10px #8a6cff;
}

.sc-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot.ok {
  background: #1e8c5a;
  border-color: rgba(0,220,130,.4);
}

.status-dot.err {
  background: #732727;
  border-color: rgba(255,80,80,.5);
}

.status-dot {
  border: 1px solid rgba(255,255,255,0.25);
  background: #732727;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.on {
  background: #19c37d;
}

.status-dot.off {
  background: #ff4d4f;
}

.history-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-badges .badge, .history-meta .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.1;
  height: auto;
  min-width: unset;
}

.badge.err {
  border-color: rgba(231, 76, 60, .5);
  color: #ffd2d2;
}

.badge.micro {
  font-size: 11px;
  opacity: .85;
}

.history-badges .badge:nth-child(1) {
  color: #c8ffe6;
  border-color: rgba(46,204,113,.35);
}

.history-badges .badge:nth-child(2) {
  color: #ffd2d2;
  border-color: rgba(231,76,60,.35);
}

.history-meta .badge, .history-badges .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.2;
  height: auto;
  width: auto;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.35);
  font-weight: 650;
}

.history-meta .badge.ok {
  background: rgba(25,195,125,.12);
  border-color: rgba(25,195,125,.35);
  color: #c8ffe6;
}

.history-meta .badge.warn {
  background: rgba(255,196,0,.10);
  border-color: rgba(255,196,0,.35);
  color: #ffe28a;
}

.history-meta .badge.err {
  background: rgba(255,77,79,.12);
  border-color: rgba(255,77,79,.35);
  color: #ffd2d2;
}

.history-badges .badge:nth-of-type(1) {
  background: rgba(25,195,125,.12);
  border-color: rgba(25,195,125,.35);
  color: #c8ffe6;
}

.history-badges .badge:nth-of-type(2) {
  background: rgba(255,77,79,.12);
  border-color: rgba(255,77,79,.35);
  color: #ffd2d2;
}

.conn-badges {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.conn-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--conn-pill-h);
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--bd);
  color: #fff;
  font-weight: 800;
  letter-spacing: .01em;
  background: transparent;
  box-shadow: var(--shadow);
  user-select: none;
  cursor: default;
  transition: transform .12s ease, filter .12s ease;
  backdrop-filter: blur(var(--glass-blur)) saturate(120%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(120%);
  z-index: 0;
}

.conn-pill:hover {
  transform: translateY(-1px);
  filter: saturate(1.04);
}

.conn-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg,var(--ok-b1),var(--ok-b2));
  opacity: var(--pill-alpha);
  z-index: -2;
}

.conn-pill.no::after {
  background: linear-gradient(135deg,var(--no-1),var(--no-2));
}

.conn-pill.ok.has-vip::before {
  content: "";
  position: absolute;
  inset: -1px auto -1px -1px;
  width: var(--vip-rail);
  background: linear-gradient(135deg,var(--vip-p1),var(--vip-p2));
  border-radius: 10px 0 0 10px;
  opacity: var(--rail-alpha);
  z-index: -1;
  pointer-events: none;
}

.conn-pill.has-vip {
  padding-left: 0;
}

.conn-pill:hover .conn-slot {
  animation: crown-bob 5s ease-in-out infinite, crown-tilt .8s cubic-bezier(.2,.8,.2,1) 1;
}

#conn-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: absolute !important;
  top: 8px;
  right: 56px;
  z-index: 4;
  margin-left: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .badge.upd, .badge.upd::before, .badge.upd::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 820px) {
  #conn-badges {
    position: static !important;
    margin-left: auto !important;
  }
}

@media (prefers-reduced-motion:reduce) {
  .conn-pill, .conn-item .tip {
    transition: none;
  }
}



/* Sync & Stepper */

#run.btn.acc {
  position: relative;
  overflow: hidden;
}

#run.btn.acc::after {
  content: "";
  position: absolute;
  top: -120%;
  left: -30%;
  width: 60%;
  height: 300%;
  transform: rotate(25deg);
  opacity: 0;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0) 100%);
}

#run.btn.acc.loading::after {
  opacity: 1;
  animation: shimmer 1.2s linear infinite;
}

#run {
  --prog: 0;
  position: relative;
  overflow: hidden;
}

#run::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #7c5cff33, #2da1ff33 50%, #19c37d33),
 linear-gradient(180deg, rgba(255,255,255,.04), transparent);
  transform: scaleX(calc(var(--prog) / 100));
  transform-origin: left center;
  transition: transform .35s ease, opacity .2s ease;
  opacity: 0;
  z-index: 0;
}

#run.loading::before {
  opacity: 1;
}

#run.loading.indet::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.12) 45%, rgba(255,255,255,.28) 50%, rgba(255,255,255,.12) 55%, transparent 100%);
  animation: run-sweep 1.1s linear infinite;
  z-index: 0;
}

#run .label {
  position: relative;
  z-index: 1;
}

#run .spinner {
  position: relative;
  z-index: 1;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px;
}

.sync-icon.sync-warn {
  background: #ffc400;
  box-shadow: 0 0 12px #ffc40088, 0 0 24px #ffc40044;
  animation: pulseWarn 1.6s infinite ease-in-out;
}

.sync-icon.sync-bad {
  background: #ff4d4f;
  box-shadow: 0 0 12px #ff4d4f88, 0 0 24px #ff4d4f44;
  animation: pulseBad 1.2s infinite ease-in-out;
}

.sync-ok {
  background: var(--accent2);
}

.sync-warn {
  background: #ffc400;
}

.sync-bad {
  background: #ff4d4f;
}

.stepper {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0;
}

.sync-icon {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  top: 0;
}

.cw-badge--synced::before {
  box-shadow: inset 0 0 0 1px rgba(46, 255, 150, .45);
}

#btn-status-refresh.sync-ctrl-fixed {
  position: absolute !important;
  top: 8px;
  right: 12px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color, rgba(255,255,255,.10));
  background: rgba(255,255,255,.04);
}

#ux-progress {
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

#ux-progress .ux-rail {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: #1f1f26;
  overflow: hidden;
}

#ux-progress .ux-bead {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg,#7c4dff,#00d4ff);
  box-shadow: inset 0 0 14px rgba(124,77,255,.35);
  transition: width .35s ease;
}

#ux-progress .ux-rail.running::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg,transparent 0%,rgba(255,255,255,.08) 20%,transparent 40%);
  transform: translateX(-100%);
  animation: shimmer 1.6s linear infinite;
}

@media (min-width:1101px) {
  #ops-card .stepper {
    margin-top: 6px;
  }
}



/* Watchlist & Posters */

.wl-del.icon-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  pointer-events: auto;
  padding: 0;
}

.wl-poster:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 0 24px #7c5cff44;
}

.wl-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wl-ovr {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}

.wl-del {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.wl-cap {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  font-size: 12px;
  color: #dfe3ea;
  text-shadow: 0 1px 2px #000;
}

.wl-poster:hover .wl-hover {
  transform: translateY(0);
  opacity: 1;
}

.wl-removing {
  opacity: 0;
  transform: scale(.98);
  filter: blur(1px);
}

.row-scroll {
  --poster-gap: 12px;
  --poster-visible: 7;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--poster-gap) * (var(--poster-visible) - 1))) / var(--poster-visible));
  gap: var(--poster-gap);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 40px 6px 40px;
  scroll-snap-type: x mandatory;
  width: 100%;
  max-width: 100%;
}

.row-scroll::-webkit-scrollbar {
  height: 10px;
}

.row-scroll::-webkit-scrollbar-thumb {
  background: #2a2a3a;
  border-radius: 8px;
}

.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: #0a0a17;
  border: 1px solid var(--border);
  scroll-snap-align: start;
  box-shadow: 0 0 0 transparent;
  transition: transform .15s ease, box-shadow .2s;
}

.poster:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 0 24px #7c5cff44;
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster:hover .hover {
  transform: translateY(0);
  opacity: 1;
}

#page-watchlist .wl-cap {
  display: none !important;
}

.wl-poster.vanish {
  opacity: 0;
  transform: scale(.96);
  filter: saturate(.7) brightness(.9);
  transition: opacity .28s ease, transform .28s ease, filter .28s ease;
  pointer-events: none;
}

.wl-poster {
  aspect-ratio: 2/3;
  border-radius: 14px;
  overflow: hidden;
  background: #0a0a17;
  border: 1px solid var(--border);
  transition: transform .15s ease, box-shadow .2s ease, opacity .35s ease, filter .35s ease;
  position: relative;
}

.wl-hover {
  position: absolute;
  inset: auto 0 0 0;
  height: 62%;
  background: linear-gradient(180deg,rgba(0,0,0,.1),rgba(0,0,0,.60) 20%, rgba(0,0,0,.85));
  color: #eaf0ff;
  padding: 10px;
  transform: translateY(100%);
  opacity: 0;
  transition: .25s ease;
  border-top: 1px solid #ffffff22;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.wall-wrap .poster-card {
  max-width: 120px;
  height: auto;
}

#wl-grid .poster-card {
  max-width: 120px;
  height: auto;
}

.wall-wrap .poster-card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
}

#wl-grid .poster-card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.wall-wrap .row-scroll {
  --poster-gap: 10px;
  grid-auto-columns: 130px;
}

.wl-grid {
  --gap: 12px;
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
}

.wall-msg {
  color: var(--muted);
  margin-bottom: 10px;
}

.wall-wrap {
  position: relative;
  overflow: hidden;
}

@media (max-width:1400px) {
  .row-scroll {
    --poster-visible: 6;
  }
}

@media (max-width:1100px) {
  .row-scroll {
    --poster-visible: 5;
  }
}

@media (max-width:900px) {
  .row-scroll {
    --poster-visible: 4;
  }
}

@media (max-width:700px) {
  .row-scroll {
    --poster-visible: 3;
  }
}

@media (max-width:520px) {
  .row-scroll {
    --poster-visible: 2;
  }
}

@media (min-width: 1401px) {
  .row-scroll {
    --poster-visible: 8;
  }
}



/* Settings */

.footer .btn-save {
  color: #d3ffe9;
  background: linear-gradient(180deg,#0a1411,#08110e)!important;
  border: 1px solid #144233!important;
  box-shadow: inset 0 1px 0 #0f1f19;
}

.footer .btn-save:hover {
  filter: brightness(1.05);
  box-shadow: inset 0 1px 0 #142a22, 0 0 14px rgba(25,195,125,.15);
}

.footer .btn-save:active {
  transform: translateY(1px);
}

#save_msg {
  margin-left: 8px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px 14px;
}

.about-item .k {
  color: var(--muted,#bbb);
  font-size: 13px;
}

.about-item .v a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,255,255,.35);
}

.about-item .v a:hover {
  border-bottom-style: solid;
}

#cw-settings-left .section {
  position: relative;
  overflow: hidden;
}

#cw-settings-left .section::before, #cw-settings-left .section::after {
  display: none !important;
}

#cw-settings-left .section > .head {
  position: relative;
  padding-left: 22px;
}

#cw-settings-left .section > .head::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 6px;
  background: linear-gradient(180deg,var(--accent,#7c5cff),var(--accent2,#ff7ae0));
  opacity: .95;
  pointer-events: none;
}

#cw-settings-left .section > .head::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 8px;
  border-radius: 10px;
  background: linear-gradient(180deg,var(--accent,#7c5cff),var(--accent2,#ff7ae0));
  filter: blur(10px);
  opacity: .35;
  pointer-events: none;
}

#save-frost {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 84px;
  background: linear-gradient(0deg,rgba(10,10,14,.85) 0%,rgba(10,10,14,.60) 35%,rgba(10,10,14,0) 100%);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(6px) saturate(110%);
  -webkit-backdrop-filter: blur(6px) saturate(110%);
  pointer-events: none;
  z-index: 9998;
}

#save-fab {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  background: transparent;
}

#save-fab .btn {
  pointer-events: auto;
  position: relative;
  z-index: 10001;
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  background: linear-gradient(135deg,#ff4d4f,#ff7a7a);
  border: 1px solid #ff9a9a55;
  box-shadow: 0 10px 28px rgba(0,0,0,.35),0 0 14px #ff4d4f55;
}

#save-fab.hidden, #save-frost.hidden {
  display: none;
}

body:has(#about-backdrop:not(.hidden)) #save-fab, body:has(#about-backdrop:not(.hidden)) #save-frost {
  display: none !important;
}

@media (max-width:480px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}



/* Modal & Provider Cards */

.prov-card.brand-crosswatch {
  --brand-color: rgb(124, 92, 255);
  --brand-rgb: 124, 92, 255;
  --wm: url("/assets/img/CROSSWATCH.svg");
}


.prov-card.brand-plex {
  --wm: url("/assets/img/PLEX.svg");
  --brand-color: var(--plex);
  --brand-rgb: var(--plex-rgb);
}

.prov-card.brand-simkl {
  --wm: url("/assets/img/SIMKL.svg");
  --brand-color: var(--simkl);
  --brand-rgb: var(--simkl-rgb);
}

.prov-card.brand-anilist {
  --wm: url("/assets/img/ANILIST.svg");
  --brand-color: var(--anilist);
  --brand-rgb: var(--anilist-rgb);
}

.prov-card.brand-trakt {
  --wm: url("/assets/img/TRAKT.svg");
  --brand-color: var(--trakt);
  --brand-rgb: 237, 28, 36;
}

.prov-card.brand-emby {
  --wm: url("/assets/img/EMBY.svg");
  --brand-color: var(--emby);
  --brand-rgb: var(--emby-rgb);
}

.prov-card.brand-jellyfin {
  --wm: url("/assets/img/JELLYFIN.svg");
  --brand-color: var(--jellyfin);
  --brand-rgb: var(--jellyfin-rgb);
}

.prov-card.brand-tautulli {
  --wm: url("/assets/img/TAUTULLI.svg");
  --brand-color: var(--tautulli);
  --brand-rgb: var(--tautulli-rgb);
}

.prov-card.brand-mdblist {
  --wm: url("/assets/img/MDBLIST.svg");
  --brand-color: var(--mdblist);
  --brand-rgb: var(--mdblist-rgb);
}

.prov-card[class*="brand-"] {
  border: 1px solid color-mix(in oklab, var(--brand-color) 55%, rgba(255,255,255,0.14));
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--brand-color) 45%, rgba(255,255,255,0.10)) inset,
    0 0 24px color-mix(in oklab, var(--brand-color) 30%, transparent);
  transition: box-shadow .25s ease, border-color .25s ease;
}

.prov-card[class*="brand-"]:hover {
  box-shadow: 0 0 0 1px var(--brand-color) inset,
    0 0 30px color-mix(in oklab, var(--brand-color) 55%, transparent);
}

.prov-card[class*="brand-"] .btn:hover {
  box-shadow: 0 0 16px rgba(var(--brand-rgb), .25);
}

.prov-card[class*="brand-"] .prov-brand {
  border-color: color-mix(in oklab, var(--brand-color) 35%, rgba(255,255,255,.35));
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-backdrop.cx-wide.hidden {
  display: none;
}

#cx-modal .panel.sub {
  background: #0a0a14;
}

.prov-card .btn {
  transition: box-shadow .2s ease, filter .2s ease;
}

#cx-modal .seg-toggle .btn {
  padding: 8px 12px;
  min-width: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  animation: fadeIn .18s ease;
}

.modal-card {
  width: min(560px,92vw);
  background: rgba(24,24,24,.9);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  overflow: hidden;
  transform: scale(.98);
  animation: popIn .22s cubic-bezier(.2,.9,.2,1) forwards;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0));
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0));
}

.modal-body {
  padding: 16px;
}

.prov-card {
  --brand-color: rgba(255,255,255,.22);
  --brand-rgb: 255,255,255;
  --wm: none;

  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent),
 var(--panel, #0d0f14);
}

.prov-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 60% at 15% 0%,
 color-mix(in oklab, var(--brand-color) 22%, transparent) 0%,
 transparent 60%)
 ,
 radial-gradient(120% 80% at 85% 0%,
 color-mix(in oklab, var(--brand-color) 18%, transparent) 0%,
 transparent 70%)
 ,
 linear-gradient(180deg,
 color-mix(in oklab, var(--brand-color) 10%, transparent) 0%,
 transparent 52%);
  opacity: .75;
  filter: saturate(115%);
  transition: opacity .25s ease, transform .45s ease, filter .25s ease;
}

.prov-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--brand-color) 22%, transparent);
  opacity: .35;
  transition: opacity .25s ease;
}

.prov-card:hover::before {
  opacity: .95;
  transform: scale(1.01);
  filter: saturate(125%);
}

.prov-card:hover::after {
  opacity: .55;
}

.prov-card.is-source::before {
  opacity: 1;
}

.prov-card.is-target::before {
  opacity: 1;
}

.prov-card.is-source::after {
  opacity: .7;
}

.prov-card.is-target::after {
  opacity: .7;
}

.prov-brand {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  z-index: 3;
  padding: 4px;
  border-radius: 8px;
  background: rgba(0,0,0,.55);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.55));
}

.prov-card[data-prov="Tautulli"] .prov-head::after, .prov-card[data-prov="TAUTULLI"] .prov-head::after, .prov-card[data-prov="tautulli"] .prov-head::after {
  content: " ";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: block;
  z-index: 50;
  background-color: rgba(0,0,0,55) !important;
  background-image: url("/assets/img/TAUTULLI.svg?v=1") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  border-radius: 8px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,55));
}

.prov-card[data-prov="Plex"] .prov-head::after {
  content: " ";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: block;
  z-index: 50;
  background-color: rgba(0,0,0,.55) !important;
  background-image: url("/assets/img/Plex.svg?v=1") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  border-radius: 8px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.55));
}

.prov-card[data-prov="AniList"] .prov-head::after, .prov-card[data-prov="ANILIST"] .prov-head::after, .prov-card[data-prov="anilist"] .prov-head::after {
  content: " ";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: block;
  z-index: 50;
  background-color: rgba(0,0,0,.55) !important;
  background-image: url("/assets/img/ANILIST.svg?v=1") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  border-radius: 8px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.55));
}

.prov-card[data-prov="SIMKL"] .prov-head::after {
  content: " ";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: block;
  z-index: 50;
  background-color: rgba(0,0,0,.55) !important;
  background-image: url("/assets/img/SIMKL.svg?v=1") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  border-radius: 8px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.55));
}

.prov-card[data-prov="Simkl"] .prov-head::after {
  content: " ";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: block;
  z-index: 50;
  background-color: rgba(0,0,0,.55) !important;
  background-image: url("/assets/img/SIMKL.svg?v=1") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  border-radius: 8px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.55));
}

.prov-card[data-prov="MDBLIST"] .prov-head::after {
  content: " ";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  z-index: 50;
  background-color: rgba(0,0,0,.55) !important;
  background-image: url("/assets/img/MDBLIST.svg?v=1") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  border-radius: 8px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.55));
}

.prov-card[data-prov="Emby"] .prov-head::after, .prov-card[data-prov="EMBY"] .prov-head::after {
  content: " ";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: block;
  z-index: 50;
  background-color: rgba(0,0,0,.55) !important;
  background-image: url("/assets/img/EMBY.svg?v=1") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  border-radius: 8px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.55));
}

#providers_list .prov-brand {
  outline: none !important;
  filter: none !important;
  position: absolute;
  top: 12px;
  right: 14px;
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
  padding: 6px;
  border-radius: 12px;
  background: #000 !important;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 6px 16px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.04);
}

#cfg-conn .modal-body {
  padding: 20px;
}

#cfg-conn .modal-shell {
  background: radial-gradient(120% 120% at 50% -10%, rgba(0,0,0,.35), transparent) , var(--bg);
}

#cx-modal.cx-wide .modal-shell {
  max-width: 1180px;
  width: 92vw;
}

.modal-backdrop.cx-wide {
  position: fixed;
  inset: 0;
  background: rgba(4,6,12,.66);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 12px;
}

.prov-head {
  position: relative;
}

#providers_list .prov-head {
  position: relative;
}

#providers_list .prov-head::after {
  content: none !important;
}

#providers_list .prov-title {
  color: #fff;
}

#cx-modal .mode {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

#cx-modal .mode-group {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

#cx-modal .seg-toggle {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

#cx-modal label[for="cx-mode-one"] {
  padding: 8px 12px;
  min-width: auto;
}

#cx-modal label[for="cx-mode-two"] {
  padding: 8px 12px;
  min-width: auto;
}

#cx-modal .dir {
  font-size: 22px;
  margin: 0 10px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(124,92,255,.35));
}

#cx-modal .dir.one {
  animation: dirPulse 1.2s ease-in-out infinite;
}

#cx-modal .dir.bidi {
  animation: dirGlow 1.6s ease-in-out infinite;
}

#cx-modal .flow-rail.pretty .token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 10px;
  min-width: 44px;
}

#cx-modal .flow-rail.pretty .token .token-logo {
  width: 28px;
  height: 28px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}

#cx-modal .flow-rail.pretty .token .token-text {
  font-weight: 800;
}

#cx-modal .cx-body {
  padding: 16px 18px 8px;
}

#cx-modal .cx-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(0deg,rgba(255,255,255,.06),transparent);
}

#cx-modal .app-name {
  font-weight: 800;
  font-size: 18px;
}

#cx-modal .app-sub {
  opacity: .7;
  font-size: 13px;
}

#cx-modal .cx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

#cx-modal .cx-row .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  flex: 1 1 320px;
}

#cx-modal .cx-row label {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .8;
}

#cx-modal .cx-row .input {
  background: #0b0b16;
  color: #e9ebff;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 12px 14px;
}

#cx-modal .cx-row select {
  background: #0b0b16;
  color: #e9ebff;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 12px 14px;
}

#cx-modal .flow-rail {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  padding: 10px 14px;
}

#cx-modal .flow-rail .token {
  font-weight: 800;
}

#cx-modal .flow-rail .arrow {
  opacity: .85;
}

#cx-modal .seg {
  display: inline-flex;
  background: linear-gradient(180deg,#0e1016,#0c0e13);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 4px;
  gap: 6px;
}

#cx-modal .seg input {
  display: none;
}

#cx-modal .seg label {
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  opacity: .9;
}

#cx-modal .seg input:checked + label {
  background: rgba(124,92,255,.28);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.06);
}

#cx-modal .seg label.disabled {
  opacity: .45;
  filter: grayscale(1);
}

#cx-modal .feature-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#cx-modal .feature-tabs .ftab {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: #0b0b16;
  color: #e9ebff;
  cursor: pointer;
  transition: .2s;
  box-shadow: 0 0 0 0 rgba(124,92,255,0);
}

#cx-modal .feature-tabs .ftab.active {
  border-color: #7c5cff;
  box-shadow: 0 0 20px rgba(124,92,255,.2);
}

#cx-modal .feature-tabs .ftab.disabled {
  opacity: .5;
  cursor: default;
}

#cx-modal .cx-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

#cx-modal .panel {
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent), #0b0b16;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 12px;
  box-shadow: inset 0 0 40px #000;
}

#cx-modal .panel .panel-title {
  font-weight: 700;
  margin-bottom: 10px;
}

#cx-modal .panel .panel-title.small {
  font-size: 12px;
  opacity: .8;
  margin-bottom: 6px;
}

#cx-modal .opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255,255,255,.08);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  background: rgba(255,255,255,.02);
}

#cx-modal .switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

#cx-modal .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

#cx-modal .switch .slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #1e1f2b;
  border: 1px solid rgba(255,255,255,.16);
  transition: .2s;
}

#cx-modal .switch .slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e9ebff;
  transition: .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

#cx-modal .switch input:checked + .slider {
  background: #3d38ff55;
  border-color: #7c5cff;
}

#cx-modal .switch input:checked + .slider::before {
  transform: translateX(20px);
}

#cx-modal .rules .r {
  border: 1px solid rgba(255,255,255,.10);
  background: #0b0b16;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

#cx-modal .rules .r .t {
  font-weight: 700;
}

#cx-modal .rules .r .s {
  opacity: .7;
  font-size: 12px;
}

#cx-modal .opt-row .switch .slider::before {
  top: 50%;
  left: calc(3px + 1px) !important;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translateY(-50%) !important;
}

#cx-modal .opt-row .switch input:checked + .slider::before {
  transform: translateY(-50%) !important;
  left: calc(44px - 18px - 3px - 1px) !important;
}

#cx-modal .cx-head .head-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

#cx-modal .cx-head .switch.big input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#cx-modal .cx-head .switch.big input:checked + .slider::before {
  left: calc(var(--w) - var(--dot) - var(--pad) - var(--bw)) !important;
}

#cx-modal .cx-head .switch.big input:checked + .slider {
  background: linear-gradient(180deg, rgba(255,255,255,.05), transparent),
 linear-gradient(135deg, #22b27e, #1a9466);
  border-color: color-mix(in srgb, #22b27e 65%, #000);
  box-shadow: inset 0 0 14px color-mix(in srgb, #22b27e 38%, transparent);
}

#cx-modal .cx-head .head-toggle .lab {
  display: none !important;
}

#cx-modal .cx-card {
  background: rgba(18,18,24,.92);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
  overflow: visible !important;
}

#cx-modal .cx-head .switch.big {
  position: relative;
  display: inline-flex;
  --w: 72px;
  --h: 34px;
  --pad: 3px;
  --dot: 26px;
  --bw: 1px;
}

#cx-modal .cx-head .switch.big .slider {
  position: relative;
  width: var(--w);
  height: var(--h);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent), #101022;
  box-shadow: inset 0 0 0 1px #0007;
  transition: background .25s, border-color .25s, box-shadow .25s;
  box-sizing: border-box;
  border: var(--bw) solid #2b2e44;
}

#cx-modal .cx-head .switch.big .slider::before {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px #000a, 0 0 0 1px #0005;
  transition: left .25s ease;
  top: 50%;
  left: calc(var(--pad) + var(--bw)) !important;
  width: var(--dot);
  height: var(--dot);
  transform: translateY(-50%) !important;
}

#cx-modal #cx-master-toggle {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 20;
}

#cx-modal #cx-master-toggle.switch.big .slider::before {
  content: none !important;
}

#cx-modal #cx-master-toggle.switch.big input:checked + .slider::after {
  content: "✓";
  left: 12px;
  right: auto;
}

#cx-modal #cx-master-toggle.head-toggle .lab {
  display: none !important;
}

#cx-modal .cx-head {
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(180deg,rgba(255,255,255,.08),transparent);
  overflow: visible;
  padding-right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

#cx-modal .head-right {
  margin-left: auto;
  display: flex;
  align-items: center;
}

#cx-modal #cx-master-toggle.switch.big {
  display: inline-flex;
  --w: 72px;
  --h: 34px;
  --pad: 3px;
  --dot: 26px;
  --bw: 1px;
}

#cx-modal #cx-master-toggle.switch.big .slider {
  transition: background .25s, border-color .25s, box-shadow .25s;
  position: relative;
  width: var(--w);
  height: var(--h);
  border-radius: 999px;
  box-sizing: border-box;
  border: var(--bw) solid #2b2e44;
  background: linear-gradient(180deg,rgba(255,255,255,.05),transparent),#0f1120;
  box-shadow: inset 0 0 0 1px #0007;
}

#cx-modal #cx-master-toggle.switch.big .slider::after {
  letter-spacing: .02em;
  pointer-events: none;
  content: "✕";
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-weight: 900;
  font-size: 12px;
  color: rgba(255,255,255,.9);
}

#cx-modal #cx-master-toggle.switch.big input:checked + .slider {
  background: linear-gradient(180deg,rgba(255,255,255,.05),transparent),linear-gradient(135deg,#22b27e,#168d63);
  border-color: color-mix(in srgb,#22b27e 65%,#000);
  box-shadow: inset 0 0 14px color-mix(in srgb,#22b27e 38%,transparent);
}

body.cx-modal-open main.single #ops-card.card {
  padding-bottom: 48px !important;
}

.cw-maint .action-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cw-maint .action-main {
  flex: 1 1 auto;
  min-width: 0;
}

.cw-maint .action-options {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cw-maint .action-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  color: var(--muted);
}

.cw-maint .action-options label span {
  white-space: normal;
}

.cw-maint .action-options input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #ff627e;
}

@supports not (background: color-mix(in oklab, red 50%, white)) {
  .prov-card::before {
    background: radial-gradient(120% 60% at 15% 0%, rgba(var(--brand-rgb, 255,255,255), .16), transparent 60%),
   radial-gradient(120% 80% at 85% 0%, rgba(var(--brand-rgb, 255,255,255), .12), transparent 70%),
   linear-gradient(180deg, rgba(var(--brand-rgb, 255,255,255), .08), transparent 52%);
  }
}

@media (max-width:480px) {
  .modal-header,.modal-footer {
    flex-wrap: wrap;
    gap: 8px;
  }
}



/* Log Viewer */

.brand .logo {
  width: 34px;
  height: 34px;
  display: inline-block;
  cursor: pointer;
}

.brand .logo, .brand .name {
  transition: filter .2s ease, transform .2s ease, text-shadow .2s ease;
}

.brand .logo:hover, .brand .logo:focus, .brand .name:hover, .brand .name:focus {
  filter: drop-shadow(0 0 10px rgba(124, 92, 255, 0.45));
}

.log {
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  background: #05060b;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px;
  min-height: 160px;
  max-height: 50vh;
  overflow: auto;
  white-space: pre-wrap;
}

#det-log::-webkit-scrollbar {
  width: 12px;
}

#det-log::-webkit-scrollbar-track {
  background: #0b0b16;
  border-left: 1px solid var(--border);
  border-radius: 10px;
}

#det-log::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg,#7c5cff66,#00b7eb66);
  border: 1px solid #ffffff20;
  border-radius: 10px;
}

#det-log::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg,#9f97ff88,#24c8ff88);
}

.log-scrub input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(90deg,#3d38ff33,#00b7eb33);
}

.log-scrub input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #ffffff22;
  box-shadow: 0 0 10px var(--glow);
}

.log-scrub input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #ffffff22;
  box-shadow: 0 0 10px var(--glow);
}

#det-log {
  height: 25vh;
  min-height: 180px;
  max-height: 25vh;
  scrollbar-width: thin;
  scrollbar-color: #6a67ff #0b0b16;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.log .b {
  font-weight: 700;
}

.log .u {
  text-decoration: underline;
}

.log .c30 {
  color: #6e7681;
}

.log .c31 {
  color: #ff7b72;
}

.log .c32 {
  color: #3fb950;
}

.log .c33 {
  color: #d29922;
}

.log .c34 {
  color: #58a6ff;
}

.log .c35 {
  color: #bc8cff;
}

.log .c36 {
  color: #76e3ea;
}

.log .c37 {
  color: #f0f6fc;
}

.log .c90 {
  color: #8b949e;
}

.log .c91 {
  color: #ff7b72;
}

.log .c92 {
  color: #3fb950;
}

.log .c93 {
  color: #d29922;
}

.log .c94 {
  color: #58a6ff;
}

.log .c95 {
  color: #bc8cff;
}

.log .c96 {
  color: #76e3ea;
}

.log .c97 {
  color: #ffffff;
}

.log .bg40 {
  background: rgba(110,118,129,.15);
}

.log .bg41 {
  background: rgba(255,123,114,.15);
}

.log .bg42 {
  background: rgba(63,185,80,.15);
}

.log .bg43 {
  background: rgba(210,153,34,.15);
}

.log .bg44 {
  background: rgba(88,166,255,.15);
}

.log .bg45 {
  background: rgba(188,140,255,.15);
}

.log .bg46 {
  background: rgba(118,227,234,.15);
}

.log .bg47 {
  background: rgba(240,246,252,.15);
}

.log .bg100 {
  background: rgba(139,148,158,.20);
}

.log .bg101 {
  background: rgba(255,123,114,.22);
}

.log .bg102 {
  background: rgba(63,185,80,.22);
}

.log .bg103 {
  background: rgba(210,153,34,.22);
}

.log .bg104 {
  background: rgba(88,166,255,.22);
}

.log .bg105 {
  background: rgba(188,140,255,.22);
}

.log .bg106 {
  background: rgba(118,227,234,.22);
}

.log .bg107 {
  background: rgba(255,255,255,.22);
}

.app-logo {
  font-size: 22px;
  line-height: 1;
}

.conn-logo {
  height: var(--crown-size);
}

.cw-snap-dialog {
  background: #0b0f19;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 14px;
  padding: 18px 20px;
  width: 340px;
  box-shadow: 0 0 28px rgba(124,92,255,.45);
}

#det-log, #det-watch-log {
  height: 25vh;
  min-height: 180px;
  max-height: 25vh;
  scrollbar-width: thin;
  scrollbar-color: #6a67ff #0b0b16;
}

#det-watch-log {
  font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size: 12px;
  line-height: 1.2;
}

#det-log::-webkit-scrollbar, #det-watch-log::-webkit-scrollbar {
  width: 12px;
}

#det-log::-webkit-scrollbar-track, #det-watch-log::-webkit-scrollbar-track {
  background: #0b0b16;
  border-left: 1px solid var(--border);
  border-radius: 10px;
}

#det-log::-webkit-scrollbar-thumb, #det-watch-log::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg,#7c5cff66,#00b7eb66);
  border: 1px solid #ffffff20;
  border-radius: 10px;
}

#det-log::-webkit-scrollbar-thumb:hover, #det-watch-log::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg,#9f97ff88,#24c8ff88);
}

#details .wlog-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 1px 6px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

#details .wlog-tag {
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 800;
  padding: 0 6px;
  line-height: 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  opacity: .9;
}

#details .wlog-msg {
  flex: 1 1 auto;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.2;
}



/* Statistics Panel */

#stats-card.celebrate {
  animation: statPop .6s cubic-bezier(.2,.9,.2,1);
}

main.full #stats-card {
  grid-column: 1;
  grid-row: auto;
  align-self: start;
  height: auto;
}

main.single #stats-card {
  grid-column: 1;
  grid-row: auto;
  align-self: start;
  height: auto;
}

#stats-card .aurora {
  position: absolute;
  inset: -24% -18% -18% -18%;
  pointer-events: none;
  z-index: 1;
  filter: blur(18px) saturate(118%);
  opacity: .55;
}

#stats-card.card {
  overflow: hidden;
}

#stats-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: url("/assets/img/background.svg") no-repeat 50% 96% / cover;
  opacity: .14;
  mix-blend-mode: screen;
  pointer-events: none;
}

#stats-card .stats-modern.v2 {
  position: relative;
  z-index: 1;
}

#stats-card .stat-tiles {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

#stats-card .tile.g3 {
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent),
 rgba(11,11,22,0.32) !important;
  border-color: rgba(255,255,255,.12) !important;
  backdrop-filter: blur(2px) saturate(110%);
}

#stats-card .tile.g3 .k {
  color: #dfe3ee;
}

#stats-card .tile.g3 .n {
  color: #fff;
}

#stats-card.collapsed .stat-block {
  display: none;
}

#stats-card {
  grid-row: 1;
  grid-column: 2;
  align-self: stretch;
  height: 100%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: filter .2s ease;
}

#stats-card.expanded {
  filter: brightness(1.02);
}

.sparkline .dot {
  r: 2.5;
  opacity: .9;
}

.sparkline .dot:hover {
  transform: scale(1.6);
}

.stats-modern .chip.trend {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0b0b16;
  color: #dfe6ff;
  font-weight: 700;
}

.stats-modern {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: center;
}

.stats-modern .now .label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stats-modern .value {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  font-size: 52px;
  line-height: 1;
}

.sparkline {
  height: 64px;
  width: 100%;
  position: relative;
}

.sparkline svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sparkline path.line {
  fill: none;
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(124,92,255,.6));
  stroke: url(#spark-grad);
}

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

@media (max-width:560px) {
  #stats-card .stat-tiles {
    grid-template-columns: 1fr;
  }
}

@media (max-width:1100px) {
  #ops-card,#stats-card,#placeholder-card {
    grid-column: 1;
  }
}



/* Scrobbler */

#card-scrobbler.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

#card-scrobbler .section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#card-scrobbler .section.disabled {
  opacity: .5;
  pointer-events: none;
}

#card-scrobbler .h {
  font-size: 13px;
  font-weight: 600;
  opacity: .9;
}

#card-scrobbler .muted {
  font-size: 12px;
  opacity: .6;
}

#card-scrobbler .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#card-scrobbler .chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.03);
}

#card-scrobbler .chip .rm {
  cursor: pointer;
  opacity: .5;
}

#card-scrobbler .chip .rm:hover {
  opacity: 1;
}

#card-scrobbler .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
}

#card-scrobbler .status-badge.ok {
  border-color: rgba(0,220,130,.4);
  color: #4be3a6;
}

#card-scrobbler .status-badge.err {
  border-color: rgba(255,80,80,.5);
  color: #ff7b7b;
}

#scrobble-logs {
  max-height: 160px;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  background: #0a0a17;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  white-space: pre-wrap;
}

#sec-scrobbler .sc-grid, #card-scrobbler .sc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

#sec-scrobbler .sc-col, #card-scrobbler .sc-col {
  min-width: 0;
}

#sec-scrobbler .section.disabled, #card-scrobbler .section.disabled {
  opacity: 0.5;
  pointer-events: none;
}

#sec-scrobbler .h, #card-scrobbler .h {
  font-size: 13px;
  font-weight: 600;
}

#sec-scrobbler .muted, #card-scrobbler .muted {
  font-size: 12px;
  opacity: 0.7;
}

#sec-scrobbler .chips, #card-scrobbler .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#sec-scrobbler .chip, #card-scrobbler .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
}

#sec-scrobbler .chip .rm, #card-scrobbler .chip .rm {
  cursor: pointer;
  opacity: 0.6;
  line-height: 1;
}

#sec-scrobbler .chip .rm:hover, #card-scrobbler .chip .rm:hover {
  opacity: 1;
}

@media (max-width: 900px) {
  #sec-scrobbler .sc-grid, #card-scrobbler .sc-grid {
    grid-template-columns: 1fr;
  }
}



/* Pairs Board */

.pairs-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 2px;
}

.pair-card {
  flex: 0 0 320px;
  cursor: grab;
}

.pair-card.dragging {
  opacity: .6;
}

#pairs_list .pair-card {
  cursor: default !important;
}

#pairs_list .pair-card.dragging {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

#pairs_list .ord-badge {
  cursor: default !important;
}

#pairs_list .feat-beads .bead {
  cursor: help;
  pointer-events: auto;
}



/* Animations */

@keyframes pulseSpin {
  0% { transform: rotate(0deg) scale(1); }
   50% { transform: rotate(180deg) scale(1.2); }
   100% { transform: rotate(360deg) scale(1); }
}

@keyframes neonPulse {
  0% { box-shadow:0 0 10px #7c5cff33, inset 0 0 0 #0000 }
   50% { box-shadow:0 0 18px #7c5cff66, inset 0 0 12px #7c5cff22 }
   100% { box-shadow:0 0 10px #7c5cff33, inset 0 0 0 #0000 }
}

@keyframes pulseWarn {
  0%,100% { transform:scale(1); opacity:1; } 50% { transform:scale(1.15); opacity:0.8; }
}

@keyframes pulseBad {
  0%,100% { transform:scale(1); } 50% { transform:scale(1.2); }
}

@keyframes pop-fade {
  0% { transform: translateY(6px) scale(0.9); opacity: 0; }
   20% { transform: translateY(0) scale(1); opacity: 1; }
   70% { opacity: 1; }
   100% { transform: translateY(-2px) scale(0.98); opacity: 0; }
}

@keyframes shimmer {
  0%{ transform: translateX(-120%) rotate(25deg); } 100%{ transform: translateX(220%) rotate(25deg); }
}

@keyframes run-sweep {
  0%{ transform: translateX(-100%);} 100%{ transform: translateX(100%);}
}

@keyframes updShimmer {
  0%, 35% { left: -40%; }
   55%, 100% { left: 100%; }
}

@keyframes updPulse {
  0%,100% { box-shadow: 0 0 0 rgba(206,117,0,0); }
   50% { box-shadow: 0 0 16px rgba(206,117,0,.25); }
}

@keyframes updHalo {
  0% { box-shadow: 0 0 0 0 rgba(206,117,0,0.0); }
   50% { box-shadow: 0 0 0 6px rgba(206,117,0,0.18); }
   100% { box-shadow: 0 0 0 0 rgba(206,117,0,0.0); }
}

@keyframes updPop {
  0% { transform: scale(.92); filter: saturate(.9) brightness(.95); }
   60% { transform: scale(1.06); }
   100% { transform: scale(1); filter: none; }
}

@keyframes popIn {
  to{ transform:scale(1); }
}

@keyframes fadeIn {
  from{ opacity:0 } to{ opacity:1 }
}

@keyframes meterGlow {
  from{transform:translateX(-2%)}to{transform:translateX(2%)}
}

@keyframes statPop {
  0%{transform:scale(.99)}50%{transform:scale(1.01)}100%{transform:scale(1)}
}

@keyframes valuePop {
  0% { transform: translateY(0) scale(1); filter: none; opacity: .9; }
   40% { transform: translateY(-1px) scale(1.08); filter: drop-shadow(0 0 6px rgba(255,255,255,.25)); }
   100% { transform: translateY(0) scale(1); filter: none; opacity: 1; }
}

@keyframes fadeUp {
  from { opacity:0; transform: translateY(6px) } to { opacity:1; transform:none }
}

@keyframes dirPulse {
  0%{transform:translateX(0);opacity:.8} 50%{transform:translateX(3px);opacity:1} 100%{transform:translateX(0);opacity:.8}
}

@keyframes dirGlow {
  0%,100%{text-shadow:0 0 0 rgba(124,92,255,.0)} 50%{text-shadow:0 0 10px rgba(124,92,255,.6)}
}

@keyframes flowRight {
  from { left:6px; } to { left: calc(100% - 6px); }
}

@keyframes flowLeft {
  from { left: calc(100% - 6px); } to { left:6px; }
}

@keyframes rail-pulse {
  0% { width:0%;  opacity:.7 }
    50%{ width:30%; opacity:.95 }
    100%{width:0%;  opacity:.7 }
}

@keyframes crown-bob {
  0%{margin-top:0} 50%{margin-top:-1px} 100%{margin-top:0}
}

@keyframes crown-tilt {
  0%{transform:rotate(0)} 30%{transform:rotate(18deg)} 60%{transform:rotate(-12deg)} 100%{transform:rotate(0)}
}

@keyframes spin {
  to{ transform:rotate(360deg) }
}

@keyframes cwspin {
  to{transform:rotate(360deg)}
}



/* Misc */

.det-left {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.det-right {
  position: sticky;
  top: 64px;
  align-self: start;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#sec-plex > .head {
  border-left: 3px solid var(--plex);
  padding-left: 10px;
}

#sec-simkl > .head {
  border-left: 3px solid var(--simkl);
  padding-left: 10px;
}

#sec-tmdb > .head {
  border-left: 3px solid var(--tmdb);
  padding-left: 10px;
}

#sec-trakt > .head {
  border-left: 3px solid var(--trakt);
  padding-left: 10px;
}

#sec-anilist > .head {
  border-left: 3px solid var(--anilist);
  padding-left: 10px;
}

#sec-jellyfin > .head {
  border-left: 3px solid var(--jellyfin);
  padding-left: 10px;
}

#sec-emby > .head {
  border-left: 3px solid var(--emby);
  padding-left: 10px;
}

#sec-mdblist > .head {
  border-left: 3px solid var(--mdblist);
  padding-left: 10px;
}

#sec-tautulli > .head {
  border-left: 3px solid var(--tautulli);
  padding-left: 10px;
}

.stat-meter {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent),#0a0a17;
}

.stat-meter::before {
  content: "";
  position: absolute;
  inset: -60% -40%;
  pointer-events: none;
  opacity: .35;
  background: radial-gradient(80% 40% at 0% 50%, #7c5cff33, transparent 60%),
 radial-gradient(80% 40% at 100% 50%, #2da1ff33, transparent 60%);
  filter: blur(10px);
  animation: meterGlow 10s ease-in-out infinite alternate;
}

#stat-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(135deg,#7c5cff,#2da1ff);
  box-shadow: 0 0 16px #7c5cff44 inset;
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}

#update-banner {
  display: flex;
  gap: 0.25em;
}

#st-update {
  margin-left: auto;
}

.ok {
  background: rgba(25,195,125,.12);
  color: #c8ffe6;
  border-color: rgba(25,195,125,.35);
  box-shadow: 0 0 12px var(--glow2);
}

.no {
  background: rgba(255,77,79,.10);
  color: #ffd2d2;
  border-color: rgba(255,77,79,.35);
}

.chev {
  transition: transform .25s ease;
}

.step {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.msg {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 12px;
  margin-top: 8px;
  font-weight: 650;
}

.msg.ok {
  background: rgba(25,195,125,.12);
  border-color: rgba(25,195,125,.35);
  color: #c8ffe6;
}

.msg.warn {
  background: rgba(255,196,0,.10);
  border-color: rgba(255,196,0,.35);
  color: #ffe28a;
}

.footer {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.ovr {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}

.p-syn {
  color: #c8ffe6;
  border-color: rgba(25,195,125,.35);
}

.p-px {
  color: #cfe2ff;
}

.p-sk {
  color: #d0d9ff;
}

.app-name {
  font-weight: 800;
  font-size: 16px;
}

.app-sub {
  color: var(--muted,#bbb);
  font-size: 13px;
}

.facts {
  display: grid;
  gap: 8px;
  align-content: start;
}

.fact {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.fact .k {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .02em;
}

.fact .v {
  font-weight: 800;
}

.n.bump {
  animation: valuePop .35s ease-out;
}

.ghost {
  background: transparent;
  border: none;
  color: inherit;
  opacity: .6;
  cursor: pointer;
}

.ghost:hover {
  opacity: 1;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
}

.watchtime {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.watchtime .big {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .2px;
  background: linear-gradient(90deg,var(--grad1,#7c5cff),var(--grad2,#2de2ff));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.watchtime .units {
  font-size: 12px;
  opacity: .8;
}

.micro-note {
  margin-top: 6px;
  font-size: 11px;
  opacity: .6;
}

.stat-block {
  margin-top: 14px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset;
  animation: fadeUp .35s ease-out both;
}

#plex_pin {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #fff;
  text-align: center;
  max-width: 7ch;
}

.feature-disabled {
  opacity: .35;
  pointer-events: none;
  filter: grayscale(40%);
}

.draggable-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.draggable-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: #0f1022;
  cursor: grab;
  box-shadow: 0 0 8px #0006;
}

.draggable-item.dragging {
  opacity: .7;
  outline: 1px dashed var(--accent);
}

.matrix {
  display: grid;
  grid-template-columns: 180px repeat(2,120px);
  gap: 6px;
  align-items: center;
}

.matrix .head {
  font-weight: 700;
  opacity: .8;
}

#cfg-conn .content {
  padding: 20px;
}

#cfg-conn h2 {
  font-weight: 600;
  letter-spacing: .04em;
  color: #eaeaf0;
}

#cfg-conn h3 {
  font-weight: 600;
  letter-spacing: .04em;
  color: #eaeaf0;
}

#cfg-conn {
  --text: #fff;
  --border: rgba(255,255,255,.12);
  --accent: #7c5cff;
  background: radial-gradient(120% 120% at 50% -10%, rgba(0,0,0,.35), transparent) , var(--bg);
  --bg: #0e0f13;
  --panel: #11141a;
  --muted: rgba(255,255,255,.65);
  --txt: #fff;
  --bd: rgba(255,255,255,.12);
  --acc: #7c5cff;
  color: var(--txt);
}

#cfg-conn .seg {
  display: inline-flex;
  background: linear-gradient(180deg,#0e1016,#0c0e13);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 4px;
  gap: 6px;
}

#cfg-conn .features {
  background: linear-gradient(180deg,#0d0f14,#0b0c11);
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 14px;
}

#cfg-conn .fe-name {
  font-weight: 600;
  color: #eaeaf0;
}

#cfg-conn .fe-muted {
  color: var(--muted);
  font-size: .9rem;
}

#cfg-conn .summary {
  border: 1px solid var(--bd);
  background: #0b0d12;
  border-radius: 16px;
  padding: 14px;
}

#cfg-conn .summary .line {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: #00000040;
  border: 1px solid rgba(255,255,255,.08);
}

.cx-help {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  font-size: 18px;
  line-height: 1;
  padding: 0;
  cursor: help;
}

.cx-help:hover {
  background: rgba(255,255,255,.10);
}

.rules .r {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0b0b16;
  padding: 12px;
  margin-bottom: 10px;
}

.rules .r .t {
  font-weight: 900;
}

.rules .r .s {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.rules .r.note {
  border-style: dashed;
  color: var(--muted);
}

.cx-head {
  overflow: visible;
  align-items: center;
}

.flow-rail.pretty {
  justify-content: space-between;
  position: relative;
  border-radius: 14px;
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent), var(--panel2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center !important;
  gap: 14px !important;
  padding: 12px 16px !important;
  min-height: 68px !important;
}

.flow-rail.pretty .token img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block !important;
}

.flow-rail.pretty .token {
  font-weight: 800;
  width: 44px !important;
  height: 44px !important;
  padding: 6px !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #000 !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: 0 6px 16px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.05) !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 80% auto !important;
}

.flex-spacer {
  flex: 1 1 auto;
}

.sc-autostart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.lane-ico .material-symbol {
  font-family: 'Material Symbols Rounded';
  font-size: 22px;
  line-height: 1;
  font-variation-settings: 'FILL' 1;
}

.conn-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.conn-brand {
  display: inline-flex;
  align-items: center;
}

.conn-text {
  font-size: 12.6px;
  white-space: nowrap;
  line-height: 1;
}

.conn-slot svg {
  width: var(--crown-size);
  height: var(--crown-size);
}

.conn-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--vip-rail);
  line-height: 0;
  transform-origin: 50% 70%;
  animation: crown-bob 5s ease-in-out infinite;
}

.conn-item .tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--tip-bg);
  color: #fff;
  border: 1px solid var(--tip-bd);
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 12.2px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0,0,0,.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}

.conn-item .tip::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--tip-bg);
  filter: drop-shadow(0 -1px 0 var(--tip-bd));
}

.conn-item:hover .tip, .conn-item:focus-within .tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.conn-ctrl {
  margin-left: 10px;
  align-self: flex-start;
}

.conn-ctrl.spinning svg {
  animation: spin 1s linear infinite;
}

.scrob-icons {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.scrob-icon {
  height: 18px;
  width: auto;
  opacity: .85;
}

.scrob-icon:hover {
  opacity: 1;
}

.cw-snap-picker {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.cw-snap-picker.cw-snap-hidden {
  display: none;
}

.cw-snap-head {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 12px;
  color: #e3ddff;
  text-align: center;
}

.cw-snap-head .hl {
  color: #7c5cff;
}

.cw-snap-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.cw-snap-foot {
  margin-top: 10px;
  text-align: right;
}

.snap-close {
  all: unset;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  color: #ddd;
  cursor: pointer;
}

.snap-close:hover {
  background: rgba(255,255,255,.2);
}

#details .det-left {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#details .det-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

#details .det-title {
  font-weight: 800;
  letter-spacing: .01em;
}

#details .det-tools {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

#details .det-tools .ghost {
  width: auto;
  min-width: unset;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  cursor: pointer;
  opacity: .92;
}

#details .det-tools .ghost:hover {
  background: rgba(255,255,255,.06);
}

@media (prefers-reduced-motion:reduce) {
  .conn-slot {
    animation: none;
  }

  .conn-ctrl.spinning svg {
    animation: none;
  }
}

@media (max-width: 900px) {
  .det-right {
    position: static;
  }
}
