/* ==================================================================
  CrossWatch UI Stylesheet
  Purpose: Visual design for the CrossWatch app (layout, components,
  badges, overlays, and motion). This file favors clarity and small,
  isolated sections. Only comments were refined; selectors and rules
  remain unchanged unless noted for a safe correction.
  ================================================================== */

/* ==================================================================
  Design Tokens & Base
  - Global colors, gradients, and common primitives
  - Multiple :root blocks are intentional, grouping related tokens
  ================================================================== */
: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)
}
* {
  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
}
code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0a0a17
}
/* Brand RGB channel tokens (for translucent borders/shadows) */
:root {
  --plex-rgb: 229,160,13;
  --simkl-rgb: 0,194,255
}
/* Brand solid colors (hex) and accents */
:root {
  --plex: #e5a00d;
  --simkl: #00b7eb;
  --tmdb: #01d277;
  --trakt: #ed1c24
}
/* Switch palette (initial variant) */
:root {
  --sw-on: #26b87a;
  --sw-on2: #1e8f5f;
  --sw-off: #c84c4c;
  --sw-off2: #9c3d3d;
  --sw-rail: #101022;
  --sw-edge: #2a2a3a
}
/* Switch palette (final override) */
:root {
  --sw-on: #22b27e;
  --sw-on2: #1a9466;
  --sw-off: #c84c4c;
  --sw-off2: #9f3e3e;
  --sw-rail: #101022;
  --sw-edge: #2b2e44
}

/* ==================================================================
   Layout
   ================================================================== */
#ops-card.card {
  padding-block: 20px 38px
}
.det-right {
  position: sticky;
  top: 64px;
  align-self: start;
  margin-top: 20px
}
.details-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap: 16px;
  align-items: stretch
}
.det-left {
  display: flex;
  flex-direction: column;
  min-height: 0
}
.det-right {
  display: flex;
  flex-direction: column;
  min-height: 0
}
#ops-card {
  position: relative
}
.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
}
#stats-card.celebrate {
  animation: statPop .6s cubic-bezier(.2,.9,.2,1)
}
#stats-card {
  grid-row: 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
}
#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
}
#ops-card {
  grid-column: 1
}
#stats-card {
  grid-column: 2;
  align-self: stretch;
  height: 100%
}
#placeholder-card {
  grid-column: 1 / -1
}
#stats-card.card {
  overflow: hidden
}
#stats-card {
  position: relative;
  overflow: hidden;
  isolation: isolate
}
#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
}
#stats-card .stat-tiles {
  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 {
  transition: filter .2s ease
}
#stats-card.expanded {
  filter: brightness(1.02)
}

/* ==================================================================
   Utilities
   ================================================================== */
.hidden {
  display: none
}
.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
}
.dot {
  border-radius: 50%
}
.dot.ok {
  background: var(--accent2)
}
.dot.no {
  background: var(--danger)
}
.muted {
  color: var(--muted)
}
#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)
}
.hidden {
  display: none !important
}
.modal-backdrop.hidden {
  display: none !important
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block
}
.muted {
  opacity: .6;
  font-size: 12px
}
.sparkline .dot {
  r: 2.5;
  opacity: .9
}
.sparkline .dot:hover {
  transform: scale(1.6)
}
.modal-backdrop.cx-wide.hidden {
  display: none
}
.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.off .dot.flow {
  opacity: .15;
  animation: none
}
.flow-rail.pretty .arrow .dot.flow {
  top: 50% !important
}

/* ==================================================================
   Header & Navigation
   ================================================================== */
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
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px
}
.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));
}
.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
}
.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
}
/* brand vars (ensure these exist somewhere global) */
:root{
  --jellyfin: #AA5CC3;
  --jellyfin-rgb: 170, 92, 195;
}

.prov-card.brand-plex   { --brand-color: var(--plex);   --brand-rgb: var(--plex-rgb); }
.prov-card.brand-simkl  { --brand-color: var(--simkl);  --brand-rgb: var(--simkl-rgb); }
.prov-card.brand-trakt  { --brand-color: var(--trakt);  --brand-rgb: 237, 28, 36; }
.prov-card.brand-jellyfin { --brand-color: var(--jellyfin); --brand-rgb: var(--jellyfin-rgb); }

/* shared styling */
.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));
}

/* existing brand icon pills (add Jellyfin) */
.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.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);
}

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


/* ==================================================================
   Cards & Panels
   ================================================================== */
.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
}
.meta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  row-gap: 8px;
  align-items: center
}
.meta-label {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
  text-align: right;
  user-select: none
}
.meta-value {
  min-width: 0
}
.meta-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px
}
.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
}
.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-modal .panel.sub {
  background: #0a0a14
}
.cx-card .title-wrap {
  display: flex;
  align-items: center;
  gap: 10px
}
.panel.sub {
  background: #0a0a14
}

/* ==================================================================
   Buttons
   ================================================================== */
.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 {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #121224;
  color: #fff;
  font-weight: 650
}
.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
}
#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
}
.footer .btn {
  transition: filter .15s ease, box-shadow .25s ease, transform .05s ease
}
.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)
}
.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)
}
.wl-del.icon-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  pointer-events: auto;
  padding: 0
}
.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)
}
.prov-card .btn {
  transition: box-shadow .2s ease, filter .2s ease
}
.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
}
#cfg-conn .actions .btn {
  color: #fff
}
#cfg-conn .actions .btn.primary {
  background: radial-gradient(60% 120% at 50% -20%, rgba(124,92,255,.35), transparent),
 linear-gradient(180deg, rgba(124,92,255,.25), rgba(124,92,255,.10))
}
#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
}
#cx-modal .seg-toggle .btn {
  padding: 8px 12px;
  min-width: auto
}

/* ==================================================================
   Badges, Chips & Pills
   ================================================================== */
.badges {
  display: flex;
  gap: 8px;
  margin: 0;
  flex-wrap: wrap
}
.badge {
  font-weight: 650;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent
}
.ops-header .badges {
  margin-left: auto
}
.chip {
  border: 1px solid var(--border);
  background: #0a0a17;
  padding: 6px 10px;
  border-radius: 999px;
  color: #e7e9f4
}
.pill {
  backdrop-filter: blur(4px)
}
.hover .chip {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  background: #0b0b16aa;
  border: 1px solid #ffffff2b
}
.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
}
.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
}
.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 {
  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 {
  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
}

/* ==================================================================
   Forms & Inputs
   ================================================================== */
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
}
.sep {
  height: 1px;
  background: linear-gradient(90deg,transparent,#30304a,transparent);
  margin: 12px 0
}

/* ==================================================================
   Sync & Status UI
   ================================================================== */
.sync-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px
}
.sync-icon {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative
}
.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
}
.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #333
}
.tl-dot.on {
  background: #7c5cff;
  box-shadow: 0 0 10px var(--glow)
}
.sync-icon {
  top: 0
}

/* ==================================================================
   Watchlist & Posters
   ================================================================== */
.wl-grid {
  --gap: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: var(--gap)
}
.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
}
.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-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)
}
.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
}
.cap {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  font-size: 12px;
  color: #dfe3ea;
  text-shadow: 0 1px 2px #000
}
.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)
}
.poster:hover .hover {
  transform: translateY(0);
  opacity: 1
}
.hover .titleline {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .02em
}
.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
}
#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 {
  position: relative
}
.wl-hover {
  pointer-events: none
}
.auth-card-caps .cap {
  display: inline-block;
  margin: 4px 6px 0 0;
  opacity: .9
}
.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
}
.wl-grid {
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr))
}

/* ==================================================================
   Modals & Providers
   ================================================================== */
.section>.head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer
}
.section>.head:hover {
  background: #11111a
}
.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 {
  position: relative
}
.prov-card {
  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))
}
.section > .head {
  position: relative;
  padding-right: 44px
}
#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-jellyfin > .head {
  border-left: 3px solid var(--jellyfin);
  padding-left: 10px;
}
.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));
  outline: 2px solid magenta !important
}
.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));
  outline: 2px solid magenta !important
}
.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));
  outline: 2px solid magenta !important
}
#providers_list .prov-brand {
  outline: none !important;
  filter: none !important
}
#providers_list .prov-brand {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
  padding: 6px;
  border-radius: 12px
}
#providers_list .prov-brand {
  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;
}

/* ==================================================================
   Logs & Scrubbers
   ================================================================== */
.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 {
  height: 25vh;
  min-height: 180px;
  max-height: 25vh;
  scrollbar-width: thin;
  scrollbar-color: #6a67ff #0b0b16
}
#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 {
  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)
}

/* ==================================================================
   Statistics
   ================================================================== */
.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
}
.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)
}
.chips {
  display: flex;
  gap: 8px;
  margin-top: 8px
}
.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
}
.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.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);
  box-shadow: 0 0 6px rgba(var(--plex-rgb), .18)
}
.tile.simkl {
  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
}

/* ==================================================================
   Update Banner
   ================================================================== */
#update-banner {
  display: flex;
  gap: 0.25em
}
#st-update {
  margin-left: auto
}

/* ==================================================================
   Generic Media Queries
   ================================================================== */

/* ==================================================================
   Animations
   ================================================================== */

/* ==================================================================
   Miscellaneous (unclassified by heuristic)
   ================================================================== */
.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
}
.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)
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}
.section {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel2);
  overflow: hidden;
  margin-bottom: 12px
}
.chev {
  transition: transform .25s ease
}
.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: 650px
}
.ops-header {
  display: flex;
  align-items: center;
  gap: 12px
}
.chiprow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0
}
.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
}
.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
}
#save_msg {
  margin-left: 8px
}
.wall-msg {
  color: var(--muted);
  margin-bottom: 10px
}
.wall-wrap {
  position: relative;
  overflow: hidden
}
.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
}
#conn-badges {
  position: static;
  top: auto;
  right: auto;
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}
.app-logo {
  font-size: 22px;
  line-height: 1
}
.app-name {
  font-weight: 800;
  font-size: 16px
}
.app-sub {
  color: var(--muted,#bbb);
  font-size: 13px
}
.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
}
.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
}
.dot.add {
  background: #19c37d
}
.dot.del {
  background: #ff6b6b
}
.n.bump {
  animation: valuePop .35s ease-out
}
.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
}
.stat-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px
}
.ghost {
  background: transparent;
  border: none;
  color: inherit;
  opacity: .6;
  cursor: pointer
}
.ghost:hover {
  opacity: 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)
}
.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)
}
.history-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  opacity: .9
}
.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 {
  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
}
.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;
  color: #fff;
  z-index: 2;
  mix-blend-mode: normal;
  -webkit-text-fill-color: #fff
}
.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 {
  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
}
.cw-badge--synced::before {
  box-shadow: inset 0 0 0 1px rgba(46, 255, 150, .45)
}
.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)
}
.auth-card {
  border: 1px solid var(--line, #2a2a2a);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  background: var(--panel, #121212)
}
.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
}
.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
}
.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
}
.prov-head {
  position: relative
}
#providers_list .prov-head {
  position: relative
}
#providers_list .prov-head::after {
  content: none !important
}
#providers_list .prov-title {
  color: #fff
}
#cfg-conn {
  --text: #fff;
  --border: rgba(255,255,255,.12);
  --accent: #7c5cff;
  color: var(--text)
}
#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 .form-grid {
  align-items: start
}
#cfg-conn .field {
  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(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.98rem;
  outline: none
}
#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 select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,92,255,.25)
}
#cfg-conn input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,92,255,.25)
}
#cfg-conn .seg {
  gap: 6px
}
#cfg-conn .seg input[type="radio"] {
  display: none
}
#cfg-conn .seg label {
  font-weight: 600
}
#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 .row {
  display: flex;
  align-items: center;
  gap: 14px
}
#cfg-conn .row .spacer {
  flex: 1
}
#cfg-conn .features {
  padding: 14px
}
#cfg-conn .fe-row {
  border-bottom: 1px dashed rgba(255,255,255,.06)
}
#cfg-conn .fe-row:last-child {
  border-bottom: none
}
#cfg-conn .fe-name {
  color: #eaeaf0
}
#cfg-conn .fe-muted {
  font-size: .9rem
}
#cfg-conn .actions {
  gap: 12px;
  backdrop-filter: blur(6px)
}
#cfg-conn {
  background: radial-gradient(120% 120% at 50% -10%, rgba(0,0,0,.35), transparent) , var(--bg)
}
#cfg-conn {
  --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 .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 {
  display: inline-flex;
  background: linear-gradient(180deg,#0e1016,#0c0e13);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 4px;
  gap: 6px
}
#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)
}
#cfg-conn .features {
  background: linear-gradient(180deg,#0d0f14,#0b0c11);
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 14px
}
#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)
}
#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)
}
#cfg-conn .actions {
  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
}
.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
}
#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-card {
  background: rgba(18,18,24,.92);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.55)
}
#cx-modal .cx-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg,rgba(255,255,255,.08),transparent)
}
#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-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)
}
.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-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 {
  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-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
}
.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
}
.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
}
.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
}
.opt-row .switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px
}
.opt-row .switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute
}
.opt-row .switch .slider {
  position: absolute;
  inset: 0;
  background: #1a1a2a;
  border: 1px solid #2a2a46;
  border-radius: 999px;
  transition: .2s
}
.opt-row .switch .slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 4px #0008
}
.opt-row .switch input:checked + .slider {
  background: linear-gradient(135deg,#7c5cff,#2de2ff);
  border-color: #5a63ff88
}
.opt-row .switch input:checked + .slider::before {
  transform: translate(18px, -50%)
}
.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)
}
.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
}
.flow-rail.pretty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px
}
.flow-rail.pretty .token {
  padding: 6px 10px;
  border-radius: 999px;
  background: #0b0b16;
  border: 1px solid var(--border);
  font-weight: 800
}
.flow-rail.pretty .arrow {
  position: relative;
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg,#7c5cff,#2de2ff);
  border-radius: 2px
}
.flow-rail.pretty .arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  transform: translateY(-50%)
}
.flow-rail.pretty .arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  transform: translateY(-50%)
}
.flow-rail.pretty .arrow::before {
  left: -2px;
  border-right-color: #7c5cff
}
.flow-rail.pretty .arrow::after {
  right: -2px;
  border-left-color: #2de2ff
}
.rules-card .rules .r {
  margin-top: 10px
}
.flow-rail.pretty {
  position: relative;
  padding: 10px;
  border-radius: 14px;
  background: linear-gradient(180deg,rgba(255,255,255,.02),transparent), var(--panel2);
  border: 1px solid var(--border)
}
.flow-rail.pretty .arrow {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(90deg,#7c5cff,#2de2ff);
  box-shadow: 0 0 16px #7c5cff33 inset;
  display: block
}
.flow-rail.pretty .token {
  padding: 8px 12px;
  border-radius: 999px;
  background: #0b0b16;
  border: 1px solid var(--border);
  font-weight: 800
}
.flow-rail.pretty {
  display: flex;
  align-items: center;
  gap: 14px
}
.flow-rail.off .arrow {
  filter: grayscale(.7) brightness(.8);
  opacity: .6
}
.cx-head .head-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px
}
.cx-head .head-toggle .lab {
  display: none
}
.cx-head {
  overflow: visible;
  align-items: center
}
.cx-head .head-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center
}
.cx-head .head-toggle .lab {
  display: none !important
}
.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 {
  position: absolute;
  opacity: 0
}
.opt-row .switch .slider {
  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 {
  left: calc(var(--w) - var(--dot) - var(--pad) - var(--bw))
}
#cx-modal .opt-row .switch input:checked + .slider::before {
  transform: translateY(-50%) !important
}
#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 {
  left: calc(44px - 18px - 3px - 1px) !important
}
#cx-modal .cx-head {
  overflow: visible;
  align-items: center
}
#cx-modal .cx-head .head-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center
}
#cx-modal .cx-head .switch.big {
  --w: 72px;
  --h: 34px;
  --pad: 3px;
  --dot: 26px;
  --bw: 1px;
  position: relative;
  display: inline-flex
}
#cx-modal .cx-head .switch.big input {
  position: absolute;
  opacity: 0;
  pointer-events: none
}
#cx-modal .cx-head .switch.big .slider {
  position: relative;
  width: var(--w);
  height: var(--h);
  box-sizing: border-box;
  border: var(--bw) solid #2b2e44;
  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
}
#cx-modal .cx-head .switch.big .slider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--pad) + var(--bw));
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px #000a, 0 0 0 1px #0005;
  transform: translateY(-50%) !important;
  transition: left .25s ease
}
#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 {
  overflow: visible !important
}
#cx-modal .cx-head {
  overflow: visible
}
#cx-modal .cx-head .switch.big {
  --w: 72px;
  --h: 34px;
  --pad: 3px;
  --dot: 26px;
  --bw: 1px
}
#cx-modal .cx-head .switch.big .slider {
  box-sizing: border-box;
  border: var(--bw) solid #2b2e44
}
#cx-modal .cx-head .switch.big .slider::before {
  top: 50%;
  left: calc(var(--pad) + var(--bw)) !important;
  width: var(--dot);
  height: var(--dot);
  transform: translateY(-50%) !important
}
#cx-modal .cx-head {
  padding-right: 20px
}
.flow-rail.pretty {
  align-items: center !important;
  gap: 14px !important;
  padding: 12px 16px !important;
  min-height: 68px !important
}
.flow-rail.pretty .token {
  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
}
.flow-rail.pretty .token img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block !important
}
.flow-rail.pretty .token {
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 80% auto !important
}
.flow-rail.pretty .arrow {
  height: 8px !important;
  border-radius: 4px !important
}
#cx-modal #cx-master-toggle {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 20
}
#cx-modal #cx-master-toggle.switch.big {
  --w: 72px;
  --h: 34px;
  --bw: 1px;
  --pad: 3px;
  --dot: 26px;
  display: inline-flex
}
#cx-modal #cx-master-toggle.switch.big .slider {
  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;
  transition: background .25s, border-color .25s, box-shadow .25s;
  box-shadow: inset 0 0 0 1px #0007
}
#cx-modal #cx-master-toggle.switch.big .slider::before {
  content: none !important
}
#cx-modal #cx-master-toggle.switch.big .slider::after {
  content: "✕";
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .02em;
  color: rgba(255,255,255,.9);
  pointer-events: none
}
#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)
}
#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 {
  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 {
  --w: 72px;
  --h: 34px;
  --pad: 3px;
  --dot: 26px;
  --bw: 1px
}
#cx-modal #cx-master-toggle.switch.big .slider {
  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 {
  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)
}
.head-toggle {
  display: none !important
}
@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%);
 }
}

/* ==================================================================
   Generic Media Queries
   ================================================================== */
@media (max-width: 900px){
 .details-grid{ grid-template-columns: 1fr; }
 .det-right{ position: static; }
 }
@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 (prefers-reduced-motion: reduce){
 .badge.upd,
 .badge.upd::before,
 .badge.upd::after { animation: none !important; transition: none !important; }
 }
@media (max-width:480px){ .about-grid{ grid-template-columns:1fr; } .modal-header,.modal-footer{ flex-wrap:wrap; gap:8px; } }
@media (max-width:900px){ .stats-modern{grid-template-columns:1fr} }
@media (max-width:1100px){
 #layout{ grid-template-columns:1fr; }
 #ops-card,#stats-card,#placeholder-card{ grid-column:1; }
}
@media (min-width:1101px){
 #ops-card .chiprow{ margin-bottom: 38px; }
 #ops-card .action-row{ margin-top: 20px !important; }
 #ops-card .stepper{ margin-top: 6px; }
}
@media (max-width:560px){
 #stats-card .stat-tiles{ grid-template-columns: 1fr; }
}
@media (max-width: 820px){
 #cfg-conn .form-grid{ grid-template-columns: 1fr; }
}
@media (max-width:820px){#cfg-conn .form-grid{grid-template-columns:1fr}}
@media (min-width: 1401px){
 .row-scroll{ --poster-visible: 8; } 
}
@media (max-width: 980px){ .cx-top.grid{ grid-template-columns: 1fr; } }

/* ==================================================================
   Animations
   ================================================================== */
@keyframes spin { to { transform: rotate(360deg) } }
@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 spin{ to{ transform: rotate(360deg); } }
@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; } }

/* Pin connection badges to the top-right of the ops card */
#ops-card { position: relative; }

#conn-badges {
  position: absolute !important;
  top: 10px;
  right: 12px;
  margin-left: 0 !important;
  z-index: 2;             /* stay above progress bar */
}

/* Keep the refresh icon aligned with the badges */
#conn-badges .iconbtn { margin-left: 6px; }

/* Responsive: revert to inline flow on smaller screens */
@media (max-width: 820px) {
  #conn-badges {
    position: static !important;
    margin-left: auto !important;
  }
}
/* Push Plex / SIMKL / Trakt stat tiles further down */
#tile-plex,
#tile-simkl,
#tile-trakt {
  margin-top: 90px;   /* increase until it feels right (20, 30, 40, etc.) */
  position: relative;
  z-index: 1;         /* keep them above the neon bg */
}

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

/* left log full-width gaan */
#details .details-grid { grid-template-columns: 1fr !important; }
#details .det-left { grid-column: 1 / -1; }

.ftab.disabled {
  opacity: .35;
  pointer-events: none;
  cursor: default !important;
  text-decoration: line-through;
}
/* Main update pill – inline under actions row */
#st-main-update {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 6px;
}
#st-main-update.hidden { display: none; }

#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; }


/* ==========================================================================
   Scrobbler Card
   ========================================================================== */
#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;
}
/* --- Scrobbler layout --- */
#sec-scrobbler .sc-grid,
#card-scrobbler .sc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  #sec-scrobbler .sc-grid,
  #card-scrobbler .sc-grid {
    grid-template-columns: 1fr;
  }
}

#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;
}

/* Headings / muted text (reuse if already present) */
#sec-scrobbler .h,
#card-scrobbler .h { font-size: 13px; font-weight: 600; }
#sec-scrobbler .muted,
#card-scrobbler .muted { font-size: 12px; opacity: 0.7; }

/* Status row */
.sc-status-row { display: flex; align-items: center; gap: 10px; }
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: #732727; /* default: red-ish */
}
.status-dot.ok { background: #1e8c5a; border-color: rgba(0,220,130,.4); }
.status-dot.err { background: #732727; border-color: rgba(255,80,80,.5); }
.flex-spacer { flex: 1 1 auto; }
.btn-row { display: flex; gap: 8px; }
.sc-autostart { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; }

/* Chips */
#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; }

.status-dot { width:10px; height:10px; border-radius:50%; display:inline-block; }
.status-dot.on { background:#19c37d; }
.status-dot.off { background:#ff4d4f; }

/* Recent syncs – fix badge layout and missing status styles */
.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;
}

/* Status colors (the list already has .ok and .warn; err was missing) */
.badge.err{
  border-color: rgba(231, 76, 60, .5);
  color:#ffd2d2;
}

/* Tiny chips like “WL +0/-1” */
.badge.micro{
  font-size:11px;
  opacity:.85;
}

/* (Optional) make + and - numeric pills hint their meaning */
.history-badges .badge:nth-child(1){ /* +added */
  color:#c8ffe6;
  border-color: rgba(46,204,113,.35);
}
.history-badges .badge:nth-child(2){ /* -removed */
  color:#ffd2d2;
  border-color: rgba(231,76,60,.35);
}

/* === Fix history badges layout & colors === */
.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;
}

/* Status (meta) badge states */
.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; }

/* + / – counters */
.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; }

/* small spacer between counters and micro chips */
.history-badges .sep { display:inline-block; width: 8px; }

/* Keep header clickable; only body looks dimmed.
  Add a no-op property to avoid empty ruleset warnings without altering visuals. */
.section.disabled { pointer-events: auto; }
.section.disabled .head { opacity: 1; }
.section.disabled .body { opacity: .55; }

.lane-ico .material-symbol {
  font-family: 'Material Symbols Rounded';
  font-size: 22px;      /* a bit larger than text */
  line-height: 1;
  font-variation-settings: 'FILL' 1;
}
/* Accent ONLY on the section header (no bleed in body) */
#cw-settings-left .section { position: relative; overflow: hidden; }

/* kill previous section-level bars if present */
#cw-settings-left .section::before,
#cw-settings-left .section::after { display: none !important; }

/* header anchor */
#cw-settings-left .section > .head {
  position: relative;
  padding-left: 22px; /* room for the accent bar */
}

/* the accent bar */
#cw-settings-left .section > .head::before{
  content:"";
  position:absolute;
  left:8px;                /* pulled in from rounded corner */
  top:8px; bottom:8px;     /* only spans header */
  width:4px;
  border-radius:6px;
  background:linear-gradient(180deg,var(--accent,#7c5cff),var(--accent2,#ff7ae0));
  opacity:.95;
  pointer-events:none;
}

/* soft glow for the bar */
#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; }

/* Make indeterminate start from 0% instead of 15% */
@keyframes rail-pulse { 
  0% { width:0%;  opacity:.7 }
  50%{ width:30%; opacity:.95 }
  100%{width:0%;  opacity:.7 }
}

:root{
  /* Theme palette (muted/dark-friendly) */
  --vip-p1:#361863;         /* purple rail start */
  --vip-p2:#5a28cd;         /* purple rail end */
  --ok-b1:#214f86;          /* connected blue 1 */
  --ok-b2:#2b7eb5;          /* connected blue 2 */
  --no-1:#7c2f2f;           /* disconnected red 1 */
  --no-2:#612424;           /* disconnected red 2 */

  --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 + rail geometry (exact centering) */
  --crown-size:18px;
  --rail-pad:8px;
  --vip-rail:calc(var(--crown-size) + 2*var(--rail-pad));

  /* NEW: “glass” transparency */
  --pill-alpha:.50;         /* main pill transparency */
  --rail-alpha:.75;         /* purple rail transparency */
  --glass-blur:6px;         /* backdrop blur amount */
}

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

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

/* Compact pill (background is now drawn by ::after so text stays opaque) */
.conn-pill{
  position:relative;
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 12px; min-height:30px;
  border-radius:10px; overflow:hidden;                /* clip the glass layers */
  border:1px solid var(--bd); color:#fff; font-weight:800; letter-spacing:.01em;

  background:transparent;                              /* moved to ::after */
  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); }

/* Glass body layer */
.conn-pill::after{
  content:""; position:absolute; inset:0; border-radius:inherit;
  background:linear-gradient(135deg,var(--ok-b1),var(--ok-b2)); /* connected */
  opacity:var(--pill-alpha);
  z-index:-2;  /* keep below the purple rail (::before) */
}
/* Disconnected = fully red (still transparent via alpha) */
.conn-pill.no::after{
  background:linear-gradient(135deg,var(--no-1),var(--no-2));
}

/* VIP only: narrow purple rail under the crown */
.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;
}

/* Remove left padding when the rail is shown so the crown centers perfectly */
.conn-pill.has-vip{ padding-left:0; }

/* Crown block = same width as the rail, centered crown */
.conn-slot{
  display:inline-flex; align-items:center; justify-content:center;
  width:var(--vip-rail); line-height:0; transform-origin:50% 70%;
}
.conn-slot svg{ width:var(--crown-size); height:var(--crown-size); }

/* Subtle animation (non-destructive) */
@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)} }
.conn-slot{ animation:crown-bob 5s ease-in-out infinite; }
.conn-pill:hover .conn-slot{ animation:crown-bob 5s ease-in-out infinite, crown-tilt .8s cubic-bezier(.2,.8,.2,1) 1; }

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

/* Tooltip below the pill (details only) */
.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); }

/* Manual refresh control inline */
.conn-ctrl{ margin-left:10px; align-self:flex-start; }
.conn-ctrl.spinning svg{ animation:spin 1s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg) } }

/* Reduced motion */
@media (prefers-reduced-motion:reduce){
  .conn-slot{ animation:none }
  .conn-pill, .conn-item .tip{ transition:none }
  .conn-ctrl.spinning svg{ animation:none }
}
/* Pairs board: kill legacy DnD cursor/animations and restore tooltips */
#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; }

/* Make feature beads feel hoverable and ensure pointer events */
#pairs_list .feat-beads .bead { cursor: help; pointer-events: auto; }

/* Busy + input error */
.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}
@keyframes cwspin{to{transform:rotate(360deg)}}
input.err,.input.err{border-color:#ff4d4f!important;box-shadow:0 0 0 2px rgba(255,77,79,.2) inset}

/* Scrobbler icons in header */
.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; }

/* anchor */
#ops-card { position: relative; }

/* lift the header content down so pills + refresh can live above it */
.ops-header { padding-top: 44px; } /* tweak to taste */

/* top-right placement (above the progress bar) */
#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);
}

#conn-badges{
  position: absolute !important;
  top: 8px;
  right: 56px;              /* leaves space for the refresh button */
  z-index: 4;
  margin-left: 0 !important;
}

/* neutralize any older rules that push badges left */
.ops-header .badges, #conn-badges.badges { margin-left: 0 !important; }

/* Hide sticky Save while About is open */
body:has(#about-backdrop:not(.hidden)) #save-fab,
body:has(#about-backdrop:not(.hidden)) #save-frost { display:none !important; }

/* Reserve room for the sticky Save bar on settings */
main.single #ops-card.card { padding-bottom: 120px !important; }

/* When a modal is open we already hide the save bar; shrink padding */
body.cx-modal-open main.single #ops-card.card { padding-bottom: 48px !important; }

/* --- Sync rail fallback (keeps bar visible even if JS-injected styles are late) --- */
#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;
}

