:root {
      --bg: #0d1117;
      --sidebar-bg: #131722;
      --sidebar-border: #1e2433;
      --card-bg: #161b26;
      --card-border: #242c3e;
      --primary: #7c4dff;
      --primary-hover: #9366ff;
      --text: #f0f3fa;
      --text-muted: #848da0;
      --accent-green: #00e676;
      --accent-orange: #ff9100;
      --accent-blue: #38bdf8;
      --sidebar-active-bg: #22293a;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    }

    body {
      background-color: var(--bg);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      overflow-x: hidden;
    }

    /* --------------------------------------
       SIDEBAR
    -------------------------------------- */
    .sidebar {
      width: 260px;
      background: var(--sidebar-bg);
      border-right: 1px solid var(--sidebar-border);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      height: 100vh;
      position: sticky;
      top: 0;
      user-select: none;
    }

    .sidebar-header {
      padding: 1.25rem 1.25rem 1.5rem 1.25rem;
      display: flex;
      align-items: center;
      gap: 0.85rem;
      border-bottom: 1px solid var(--sidebar-border);
    }

    .app-icon {
      width: 36px;
      height: 36px;
      border-radius: 9px;
      background: linear-gradient(135deg, #7c4dff, #38bdf8);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.25rem;
      box-shadow: 0 4px 12px rgba(124, 77, 255, 0.35);
    }

    .app-title-group {
      display: flex;
      flex-direction: column;
    }

    .app-name {
      font-size: 1.05rem;
      font-weight: 700;
      color: #fff;
      letter-spacing: -0.02em;
    }

    .app-subtitle {
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    .sidebar-nav {
      padding: 1.25rem 0.85rem;
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
      flex: 1;
      overflow-y: auto;
    }

    .nav-group-title {
      font-size: 0.7rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #5c667a;
      padding: 0.5rem 0.75rem 0.25rem 0.75rem;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 0.85rem;
      padding: 0.7rem 0.85rem;
      border-radius: 8px;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 0.9rem;
      font-weight: 500;
      transition: all 0.15s ease;
      position: relative;
    }

    .nav-item:hover {
      background: rgba(255, 255, 255, 0.04);
      color: var(--text);
    }

    .nav-item.active {
      background: var(--sidebar-active-bg);
      color: #fff;
      font-weight: 600;
    }

    .nav-item.active::before {
      content: '';
      position: absolute;
      left: 0;
      top: 6px;
      bottom: 6px;
      width: 4px;
      border-radius: 0 4px 4px 0;
      background: var(--primary);
    }

    .nav-icon {
      font-size: 1.1rem;
      width: 22px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .nav-badge {
      margin-left: auto;
      background: #252c3d;
      color: #9aa5be;
      font-size: 0.72rem;
      font-weight: 600;
      padding: 0.15rem 0.5rem;
      border-radius: 999px;
    }

    .sidebar-footer {
      padding: 1rem 1.25rem;
      border-top: 1px solid var(--sidebar-border);
      background: #0f131c;
    }

    .status-panel {
      background: #171d2a;
      border: 1px solid var(--sidebar-border);
      border-radius: 8px;
      padding: 0.75rem 0.85rem;
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .status-avatar {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: #222a3d;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.9rem;
    }

    .status-details {
      display: flex;
      flex-direction: column;
      gap: 0.15rem;
      overflow: hidden;
    }

    .status-title {
      font-size: 0.8rem;
      font-weight: 600;
      color: #fff;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }

    .status-sub {
      font-size: 0.7rem;
      color: var(--accent-green);
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }

    .status-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--accent-green);
      box-shadow: 0 0 6px var(--accent-green);
    }

    /* --------------------------------------
       MAIN CONTENT AREA
    -------------------------------------- */
    .main-content {
      flex: 1;
      padding: 2.25rem 2.5rem;
      max-width: 1280px;
      overflow-y: auto;
    }

    .view-section {
      display: none;
      flex-direction: column;
      gap: 1.5rem;
      animation: fadeIn 0.2s ease-in-out;
    }

    .view-section.active {
      display: flex;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .view-header {
      display: flex;
      flex-direction: column;
      gap: 0.4rem;
      margin-bottom: 0.5rem;
    }

    .view-title {
      font-size: 1.7rem;
      font-weight: 700;
      color: #fff;
      letter-spacing: -0.02em;
    }

    .view-desc {
      font-size: 0.9rem;
      color: var(--text-muted);
      line-height: 1.5;
    }

    .card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 12px;
      padding: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    }

    .card-title {
      font-size: 1.1rem;
      font-weight: 600;
      color: #fff;
      display: flex;
      align-items: center;
      gap: 0.6rem;
    }

    /* --------------------------------------
       SOURCES MATRIX (AIOStreams Screenshot Match)
    -------------------------------------- */
    .sources-header-row {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 1.25rem;
    }

    .clear-all-btn {
      background: none;
      border: none;
      color: #8c9ba5;
      font-size: 0.85rem;
      font-weight: 500;
      cursor: pointer;
      padding: 0.35rem 0.65rem;
      border-radius: 6px;
      transition: color 0.15s, background 0.15s;
    }

    .clear-all-btn:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.06);
    }

    .sources-card-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.75rem;
    }

    .sources-section-label {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      color: #8c9ba5;
      text-transform: uppercase;
    }

    .sources-selected-counter {
      font-size: 0.8rem;
      color: #8c9ba5;
      font-weight: 500;
    }

    .sources-presets-bar {
      display: flex;
      align-items: center;
      gap: 1.2rem;
      flex-wrap: wrap;
      margin-bottom: 1.15rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      padding-bottom: 0.85rem;
    }

    .source-preset-pill {
      background: none;
      border: none;
      color: #8c9ba5;
      font-size: 0.82rem;
      font-weight: 500;
      cursor: pointer;
      padding: 2px 0;
      transition: color 0.15s;
      outline: none;
    }

    .source-preset-pill:hover {
      color: #fff;
    }

    .source-preset-pill.active {
      color: #fff;
      font-weight: 600;
    }

    .providers-matrix-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 0.65rem;
    }

    @media (max-width: 1200px) {
      .providers-matrix-grid {
        grid-template-columns: repeat(3, 1fr);
      }
    }

    @media (max-width: 850px) {
      .providers-matrix-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (max-width: 550px) {
      .providers-matrix-grid {
        grid-template-columns: 1fr;
      }
    }

    .provider-matrix-card {
      background: #141923;
      border: 1px solid #1f2737;
      border-radius: 8px;
      padding: 0.75rem 0.85rem;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      min-height: 62px;
      cursor: pointer;
      user-select: none;
      transition: background 0.15s, border-color 0.15s;
    }

    .provider-matrix-card:hover {
      background: #18202d;
      border-color: #313e54;
    }

    .provider-matrix-card.active {
      background: #17202e;
      border-color: #2e3a50;
    }

    .provider-matrix-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 0.5rem;
    }

    .provider-matrix-name {
      font-size: 0.88rem;
      font-weight: 600;
      color: #fff;
      letter-spacing: -0.01em;
    }

    .provider-check-disc {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      border: 1.5px solid #38465f;
      display: flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      flex-shrink: 0;
      transition: all 0.15s;
    }

    .provider-matrix-card.active .provider-check-disc {
      background: #4a638d;
      border-color: #4a638d;
      color: #fff;
    }

    .provider-matrix-meta {
      font-size: 0.7rem;
      color: #72819a;
      line-height: 1.35;
      margin-top: 0.35rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .sources-tip-footer {
      margin-top: 1.25rem;
      font-size: 0.78rem;
      color: #66768e;
      border-top: 1px solid rgba(255, 255, 255, 0.05);
      padding-top: 0.85rem;
    }

    /* Legacy or Order tag */
    .tag {
      font-size: 0.7rem;
      padding: 0.15rem 0.45rem;
      background: #252c3d;
      border-radius: 4px;
      color: #9aa5be;
    }

    .order-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.65rem 1rem;
      border-radius: 6px;
      background: rgba(22, 27, 38, 0.4);
      border: 1px solid var(--card-border);
      transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
      user-select: none;
    }

    .order-item:hover {
      background: rgba(34, 41, 58, 0.35);
    }

    .order-item.dragging {
      opacity: 0.4;
      border: 1px dashed var(--accent-blue);
    }

    .order-item.drag-over {
      border: 1px solid var(--accent-blue);
      background: rgba(56, 189, 248, 0.08);
      transform: translateY(-2px);
    }

    .order-drag-handle {
      cursor: grab;
      color: var(--text-muted);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0.2rem 0.3rem;
      border-radius: 4px;
      border: none;
      background: none;
      transition: color 0.15s, background 0.15s;
    }

    .order-drag-handle:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.1);
    }

    .order-drag-handle:active {
      cursor: grabbing;
    }

    .order-title {
      font-size: 0.9rem;
      font-weight: 500;
      color: #e2e8f0;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .order-controls {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .order-arrow-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 1rem;
      padding: 2px 6px;
      border-radius: 4px;
      transition: all 0.15s ease;
      user-select: none;
      line-height: 1;
    }

    .order-arrow-btn:hover:not(:disabled) {
      color: #fff;
      background: rgba(255, 255, 255, 0.1);
    }

    .order-arrow-btn:disabled {
      opacity: 0.15;
      cursor: default;
    }

    /* Playback View & Segmented Controls */
    .playback-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1.25rem;
      align-items: flex-start;
    }

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

    .segmented-control {
      display: flex;
      background: #090c12;
      border: 1px solid var(--card-border);
      border-radius: 6px;
      padding: 3px;
      gap: 3px;
    }

    .segmented-btn {
      flex: 1;
      padding: 0.45rem 0.65rem;
      font-size: 0.78rem;
      font-weight: 500;
      color: var(--text-muted);
      background: transparent;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      transition: all 0.15s ease;
      text-align: center;
      user-select: none;
      white-space: nowrap;
    }

    .segmented-btn:hover {
      color: #fff;
    }

    .segmented-btn.active {
      background: var(--primary);
      color: #fff;
      font-weight: 600;
      box-shadow: 0 2px 8px rgba(124, 77, 255, 0.35);
    }

    .template-textarea {
      width: 100%;
      background: #090c12;
      border: 1px solid var(--card-border);
      border-radius: 6px;
      color: #e2e8f0;
      font-family: 'Consolas', 'JetBrains Mono', 'Fira Code', monospace;
      font-size: 0.75rem;
      padding: 0.6rem 0.75rem;
      resize: vertical;
      line-height: 1.45;
      outline: none;
      box-sizing: border-box;
    }

    .template-textarea:focus {
      border-color: var(--primary);
    }

    .template-preview-card {
      background: #090c12;
      border: 1px solid var(--card-border);
      border-radius: 6px;
      padding: 0.75rem 1rem;
      font-family: 'Consolas', monospace;
      font-size: 0.78rem;
      color: #e2e8f0;
      white-space: pre-wrap;
      line-height: 1.4;
    }

    /* Preset & Quality Pills */
    .preset-pill {
      background: #111622;
      border: 1px solid var(--card-border);
      color: var(--text-muted);
      padding: 0.35rem 0.75rem;
      font-size: 0.78rem;
      font-weight: 500;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.15s ease;
      user-select: none;
      outline: none;
    }

    .preset-pill:hover {
      background: #192030;
      color: #fff;
      border-color: #35415c;
    }

    .preset-pill.active {
      background: var(--primary) !important;
      border-color: var(--primary) !important;
      color: #fff !important;
      font-weight: 600;
      box-shadow: 0 2px 8px rgba(124, 77, 255, 0.35);
    }

    .quality-pill {
      background: #111622;
      border: 1px solid var(--card-border);
      color: var(--text-muted);
      padding: 0.35rem 0.65rem;
      font-size: 0.76rem;
      font-weight: 500;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.15s ease;
      user-select: none;
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      outline: none;
    }

    .quality-pill:hover {
      background: #192030;
      color: #fff;
      border-color: #35415c;
    }

    .quality-pill.active {
      background: rgba(124, 77, 255, 0.22);
      border-color: var(--primary);
      color: #e2e8f0;
      font-weight: 600;
      box-shadow: 0 1px 6px rgba(124, 77, 255, 0.2);
    }

    /* URL & Action buttons */
    .url-input-group {
      display: flex;
      gap: 0.5rem;
    }

    .url-input {
      flex: 1;
      background: #0f131c;
      border: 1px solid var(--card-border);
      border-radius: 8px;
      padding: 0.75rem 1rem;
      color: var(--text);
      font-size: 0.875rem;
      outline: none;
      transition: border-color 0.2s;
    }

    .url-input:focus {
      border-color: var(--primary);
    }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      padding: 0.75rem 1.25rem;
      font-size: 0.875rem;
      font-weight: 600;
      border-radius: 8px;
      cursor: pointer;
      text-decoration: none;
      transition: all 0.15s ease;
      border: none;
    }

    .btn-primary {
      background: var(--primary);
      color: #fff;
    }

    .btn-primary:hover {
      background: var(--primary-hover);
      box-shadow: 0 4px 16px rgba(124, 77, 255, 0.4);
    }

    .btn-secondary {
      background: #232b3d;
      color: var(--text);
    }

    .btn-secondary:hover {
      background: #2e384f;
    }

    .preset-btn {
      padding: 0.55rem 0.95rem;
      font-size: 0.82rem;
      font-weight: 500;
      border-radius: 6px;
    }

    .preset-btn.active {
      background: var(--primary);
      color: #fff;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.35rem 0.75rem;
      border-radius: 999px;
      font-size: 0.78rem;
      font-weight: 500;
      border: 1px solid transparent;
    }

    .toast {
      position: fixed;
      bottom: 2rem;
      right: 2rem;
      background: #1b2130;
      border: 1px solid var(--primary);
      color: #fff;
      padding: 0.75rem 1.25rem;
      border-radius: 8px;
      font-size: 0.875rem;
      opacity: 0;
      transform: translateY(15px);
      transition: all 0.25s ease;
      pointer-events: none;
      box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    }

    .toast.show {
      opacity: 1;
      transform: translateY(0);
    }

    .feature-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      gap: 0.85rem;
    }

    .feature-item {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      font-size: 0.85rem;
      color: var(--text-muted);
      background: rgba(15, 19, 28, 0.5);
      padding: 0.75rem 1rem;
      border-radius: 8px;
      border: 1px solid var(--card-border);
    }

    /* --------------------------------------
       AUTH MODAL & OVERLAY
    -------------------------------------- */
    .auth-overlay {
      position: fixed;
      inset: 0;
      background: #090c10;
      z-index: 10000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 1rem;
    }

    .auth-overlay.hidden {
      display: none !important;
    }

    .auth-card {
      background: #141824;
      border: 1px solid var(--card-border);
      border-radius: 14px;
      width: 100%;
      max-width: 440px;
      padding: 2rem 1.85rem;
      box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(124, 77, 255, 0.15);
      animation: authPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes authPop {
      from { transform: scale(0.95); opacity: 0; }
      to { transform: scale(1); opacity: 1; }
    }

    .auth-header {
      text-align: center;
      margin-bottom: 1.5rem;
    }

    .auth-header h2 {
      font-size: 1.35rem;
      font-weight: 700;
      color: #fff;
      margin-bottom: 0.35rem;
    }

    .auth-header p {
      font-size: 0.82rem;
      color: var(--text-muted);
      line-height: 1.45;
    }

    .auth-tabs {
      display: flex;
      background: #0c1017;
      border: 1px solid var(--card-border);
      border-radius: 9px;
      padding: 3px;
      margin-bottom: 1.5rem;
    }

    .auth-tab {
      flex: 1;
      padding: 0.55rem;
      text-align: center;
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-muted);
      background: none;
      border: none;
      border-radius: 7px;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .auth-tab.active {
      background: var(--primary);
      color: #fff;
      box-shadow: 0 2px 8px rgba(124, 77, 255, 0.35);
    }

    .auth-form {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .auth-group {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
    }

    .auth-group label {
      font-size: 0.78rem;
      font-weight: 600;
      color: #9aa5be;
    }

    .auth-group input {
      background: #0c1017;
      border: 1px solid var(--card-border);
      border-radius: 8px;
      padding: 0.7rem 0.9rem;
      color: #fff;
      font-size: 0.875rem;
      outline: none;
      transition: border-color 0.2s;
    }

    .auth-group input:focus {
      border-color: var(--primary);
    }

    .auth-error-box {
      background: rgba(255, 82, 82, 0.12);
      border: 1px solid rgba(255, 82, 82, 0.3);
      color: #ff5252;
      border-radius: 6px;
      padding: 0.6rem 0.8rem;
      font-size: 0.8rem;
      line-height: 1.4;
    }

    /* --------------------------------------
       TOP-RIGHT SAVING STATUS BADGE
    -------------------------------------- */
    .save-status-indicator {
      position: fixed;
      top: 1.25rem;
      right: 1.75rem;
      z-index: 999;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.45rem 0.95rem;
      border-radius: 999px;
      font-size: 0.78rem;
      font-weight: 600;
      letter-spacing: -0.01em;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
      user-select: none;
      pointer-events: none;
    }

    .save-status-indicator.saved {
      background: rgba(16, 185, 129, 0.12);
      border: 1px solid rgba(16, 185, 129, 0.3);
      color: #10b981;
    }

    .save-status-indicator.saving {
      background: rgba(56, 189, 248, 0.14);
      border: 1px solid rgba(56, 189, 248, 0.35);
      color: #38bdf8;
    }

    .save-status-indicator.error {
      background: rgba(239, 68, 68, 0.14);
      border: 1px solid rgba(239, 68, 68, 0.35);
      color: #ef4444;
    }

    .save-status-spinner {
      display: inline-block;
      width: 12px;
      height: 12px;
      border: 2px solid rgba(56, 189, 248, 0.25);
      border-top-color: #38bdf8;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
    }

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

    /* --------------------------------------
       SOURCES SUB-TABS NAVIGATION
    -------------------------------------- */
    .sources-subtabs-nav {
      display: flex;
      gap: 0.5rem;
      border-bottom: 1px solid var(--card-border);
      padding-bottom: 0.5rem;
      margin-bottom: 0.5rem;
    }

    .sources-subtab {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.6rem 1.1rem;
      border-radius: 8px;
      background: none;
      border: 1px solid transparent;
      color: var(--text-muted);
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .sources-subtab:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.04);
    }

    .sources-subtab.active {
      background: #171d2b;
      border-color: var(--card-border);
      color: #fff;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }

    .subtab-badge {
      background: #252c3d;
      color: #38bdf8;
      font-size: 0.72rem;
      font-weight: 700;
      padding: 0.15rem 0.5rem;
      border-radius: 999px;
    }

    /* Jellyfin Server Cards */
    .jellyfin-card {
      background: #161b26;
      border: 1px solid var(--card-border);
      border-radius: 10px;
      padding: 1.1rem 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      transition: border-color 0.2s;
    }

    .jellyfin-card:hover {
      border-color: #344059;
    }

    .jellyfin-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      flex-wrap: wrap;
    }

    .jellyfin-card-title {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .jellyfin-icon {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      background: linear-gradient(135deg, #00a4dc, #aa5cc3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.15rem;
      box-shadow: 0 4px 12px rgba(0, 164, 220, 0.25);
    }

    .jellyfin-meta {
      display: flex;
      gap: 1.25rem;
      font-size: 0.78rem;
      color: var(--text-muted);
      flex-wrap: wrap;
    }

/* Testing & Benchmark Source Workbench */
.test-source-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: rgba(22, 27, 38, 0.7);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.test-source-card:hover {
  background: rgba(34, 41, 58, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
}
.test-source-card.active {
  background: rgba(124, 77, 255, 0.12);
  border-color: #7c4dff;
}
.test-only-btn {
  opacity: 0;
  transition: opacity 0.15s ease;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  border-radius: 3px;
  color: var(--text-muted);
  cursor: pointer;
}
.test-source-card:hover .test-only-btn {
  opacity: 1;
}
.test-only-btn:hover {
  color: #fff;
  background: rgba(124, 77, 255, 0.3);
  border-color: #7c4dff;
}


/* =====================================================================
   PenguPlay-Style Live Provider Status & Health Monitor
   ===================================================================== */
#testSourcesMatrix {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
  gap: 0.5rem;
}

.test-source-card {
  min-width: 0;
  padding: 0.5rem 0.75rem;
}

.status-monitor-container {
  background: #11141d;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.status-monitor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.status-monitor-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-monitor-logo {
  width: 38px;
  height: 38px;
  background: rgba(124, 77, 255, 0.15);
  border: 1px solid rgba(124, 77, 255, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.status-monitor-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}

.status-summary-card {
  background: #161b26;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.status-summary-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.status-summary-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin: 0.2rem 0;
}

.status-val-up {
  color: #34d399 !important;
}

.status-val-down {
  color: #f87171 !important;
}

.status-summary-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.status-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--card-border);
}

.status-filter-pills {
  display: flex;
  background: #161b26;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.status-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-pill-btn:hover {
  color: #fff;
}

.status-pill-btn.active {
  background: #7c4dff;
  color: #fff;
}

.status-provider-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.status-provider-row {
  background: #161b26;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.15s ease;
}

.status-provider-row:hover {
  background: #1a202e;
  border-color: rgba(255, 255, 255, 0.12);
}

.status-row-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 170px;
}

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

.health-dot.up {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

.health-dot.down {
  background: #f87171;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
}

.health-badge {
  padding: 0.18rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.health-badge.up {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.health-badge.down {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-row-chips {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  flex: 1;
}

.tested-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.status-row-metrics {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.status-row-streams {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.status-row-time {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.status-monitor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.75rem;
}
