    * { margin: 0; padding: 0; box-sizing: border-box; }

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      background: #000;
      color: var(--wc-text);
      min-height: 100vh;
      position: relative;
      overflow-x: hidden;
    }

    /* Bubbles */
    .bubble {
      position: fixed;
      border-radius: 50%;
      filter: blur(80px);
      pointer-events: none;
      z-index: 0;
      will-change: transform;
    }

    .dot { width: 8px; height: 8px; border-radius: 50%; background: #1a2d4a; flex-shrink: 0; }
    .dot.live { background: #ef4444; box-shadow: 0 0 6px #ef4444; animation: pulse 1.5s infinite; }
    @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

    main { max-width: 960px; margin: 0 auto; padding: 32px 24px; }

    .section { margin-bottom: 32px; }
    #rec-content, #srv-content { display: grid !important; }
    .codec-global { margin-bottom: 22px; }
    body.vue-srv .codec-global { display: none; }

    /* ── Une seule navigation, a toutes les largeurs ──────────────────────
       Visibilite = onglet actif ET codec actif. Les deux se composent par
       classes, sans !important, donc sans conflit possible. */
    .section[data-tab] { display: none; }
    .section[data-tab].tab-active { display: block; }
    body.codec-h264 .section.mode-h265.tab-active,
    body.codec-h265 .section.mode-h264.tab-active { display: none; }
    body.codec-h264 .mode-h265:not(.section),
    body.codec-h265 .mode-h264:not(.section) { display: none; }

    /* ── Navigation : segments en haut, identiques a Liens & QR ──────────
       Segment actif = surface surelevee (pas d'aplat colore), icone en accent. */
    .seg {
      display: flex; gap: 3px; padding: 3px; margin-bottom: 26px;
      border-radius: 13px;
      background: rgba(0,0,0,.28);
      border: 1px solid rgba(255,255,255,.07);
    }
    .seg > button {
      flex: 1 1 0; min-width: 0;
      display: inline-flex; align-items: center; justify-content: center; gap: 6px;
      position: relative;
      background: none; border: none; border-radius: 9px;
      padding: 7px 10px; min-height: 42px;
      cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
      color: #6f8fb5;
      transition: background .15s, color .15s;
      white-space: nowrap;
    }
    .seg > button:hover { color: #c8d8f0; }
    .seg > button.active {
      background: rgba(255,255,255,.11);
      color: #eaf1fb;
      box-shadow: 0 1px 3px rgba(0,0,0,.35);
    }
    .seg > button .i { width: 17px; height: 17px; flex: none; }
    .seg > button.active .i { color: var(--wc-accent, #2997ff); }
    .seg > button .nav-badge { position: static; margin-left: 2px; }

    /* Commutateur de codec : meme grammaire, mais compact et non pleine largeur */
    .seg-codec { display: inline-flex; margin-bottom: 26px; }
    .seg-codec > button { flex: 0 0 auto; padding: 7px 16px; }
    @media (max-width: 700px) {
      .seg-codec { display: flex; width: 100%; }
      .seg-codec > button { flex: 1 1 0; flex-direction: row; min-height: 42px; font-size: 12.5px; }
    }

    @media (max-width: 700px) {
      .seg { gap: 2px; padding: 3px; margin-bottom: 20px; }
      .seg > button {
        flex-direction: column; gap: 3px;
        padding: 7px 2px; min-height: 52px; font-size: 10px; letter-spacing: -0.01em;
      }
      .seg > button .i { width: 19px; height: 19px; }
    }
    .section-title {
      font-size: 13px;
      font-weight: 600;
      letter-spacing: 0;
      color: #6f8fb5;
      margin-bottom: 10px;
      padding-left: 2px;
    }

    /* RTMP URL Box */
    .rtmp-box {
      background: rgba(12, 24, 41, 0.25);
      border: 1px solid rgba(26, 45, 74, 0.6);
      border-radius: 12px;
      padding: 20px 24px;
      backdrop-filter: blur(12px);
    }

    .rtmp-box p { font-size: 13px; color: #3a5070; margin-bottom: 14px; }

    .rtmp-url-row {
      display: flex;
      gap: 10px;
      align-items: center;
      margin-bottom: 12px;
    }

    .rtmp-label { font-size: 12px; color: #2e4d70; width: 80px; flex-shrink: 0; }

    .rtmp-value {
      flex: 1;
      background: #070d1a;
      border: 1px solid #1a2d4a;
      border-radius: 8px;
      padding: 10px 14px;
      font-family: 'SF Mono', 'Fira Code', monospace;
      font-size: 13px;
      color: #60a5fa;
      cursor: pointer;
      user-select: all;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .copy-btn {
      background: #112040;
      border: 1px solid #1a3560;
      border-radius: 8px;
      padding: 10px 14px;
      cursor: pointer;
      font-size: 12px;
      color: #5a80a8;
      white-space: nowrap;
      transition: all 0.15s;
    }
    .btn-copie {
      width: 38px; height: 38px; padding: 0; flex: none;
      background-color: #112040;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a80a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E");
      background-repeat: no-repeat; background-position: center; background-size: 17px;
    }
    .btn-copie:hover { background-color: #1a2d4a; }
    .btn-copie.copied {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234ade80' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    }
    @media (pointer: coarse) { .btn-copie { width: 44px; height: 44px; } }

    .copy-btn:hover { background: #1a2d4a; color: #c8d8f0; }
    .copy-btn.copied { background: #0c2d1a; border-color: #1a5c34; color: #4ade80; }

    .stream-key-row {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .stream-key-input {
      flex: 1;
      background: #070d1a;
      border: 1px solid #1a2d4a;
      border-radius: 8px;
      padding: 10px 14px;
      font-family: 'SF Mono', 'Fira Code', monospace;
      font-size: 13px;
      color: #c8d8f0;
      outline: none;
    }
    .stream-key-input:focus { border-color: #2e5090; }
    .stream-key-input::placeholder { color: #1e3050; }

    /* Stats row */
    .stats-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
    }

    .stat-card {
      background: rgba(12, 24, 41, 0.25);
      border: 1px solid rgba(26, 45, 74, 0.6);
      border-radius: 12px;
      padding: 16px 20px;
      backdrop-filter: blur(12px);
    }

    .stat-value { font-size: 28px; font-weight: 700; color: #e8f0ff; line-height: 1; }
    .stat-label { font-size: 12px; color: #2e4d70; margin-top: 4px; }

    /* Destinations */
    .dest-list { display: flex; flex-direction: column; gap: 10px; }

    .dest-card {
      background: rgba(12, 24, 41, 0.25);
      border: 1px solid rgba(26, 45, 74, 0.6);
      border-radius: 12px;
      padding: 16px 20px;
      display: flex;
      align-items: center;
      gap: 16px;
      backdrop-filter: blur(12px);
    }

    .dest-platform-icon {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      flex-shrink: 0;
    }

    .dest-info { flex: 1; min-width: 0; }
    .dest-name { font-size: 14px; font-weight: 600; color: #e8f0ff; }
    .dest-url { font-size: 12px; color: #2e4d70; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .toggle {
      position: relative;
      width: 42px;
      height: 24px;
      flex-shrink: 0;
    }
    .toggle input { opacity: 0; width: 0; height: 0; }
    .toggle-slider {
      position: absolute;
      inset: 0;
      background: #112040;
      border-radius: 24px;
      cursor: pointer;
      transition: 0.2s;
    }
    .toggle-slider::before {
      content: '';
      position: absolute;
      width: 18px;
      height: 18px;
      left: 3px;
      bottom: 3px;
      background: #2e4d70;
      border-radius: 50%;
      transition: 0.2s;
    }
    .toggle input:checked + .toggle-slider { background: #0c2d4a; }
    .toggle input:checked + .toggle-slider::before { background: #3b82f6; transform: translateX(18px); }

    .dest-delete {
      background: none;
      border: none;
      color: #1e3050;
      cursor: pointer;
      font-size: 16px;
      padding: 4px 8px;
      border-radius: 4px;
      transition: all 0.15s;
      flex-shrink: 0;
    }
    .dest-delete:hover { color: #ef4444; background: #1a1520; }

    /* Add destination */
    .preset-btn {
      background: rgba(12, 24, 41, 0.25);
      border: 1px solid rgba(26, 45, 74, 0.6);
      border-radius: 8px;
      padding: 6px 10px;
      font-size: 12px;
      color: #5a80a8;
      cursor: pointer;
      transition: all 0.15s;
      backdrop-filter: blur(12px);
      flex: 1;
      min-width: max-content;
      white-space: nowrap;
      text-align: center;
    }
    .preset-btn:hover { background: rgba(29, 78, 216, 0.2); border-color: #3b82f6; color: #93c5fd; }

    .add-btn {
      background: rgba(12, 24, 41, 0.15);
      border: 1px dashed rgba(26, 45, 74, 0.7);
      border-radius: 12px;
      padding: 14px;
      width: 100%;
      cursor: pointer;
      font-size: 13px;
      color: #2e4d70;
      transition: all 0.15s;
      text-align: center;
    }
    .add-btn:hover { border-color: #2e5090; color: #5a80a8; background: #0e1f38; }

    /* Modal */
    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(2, 6, 15, 0.85);
      z-index: 100;
      align-items: center;
      justify-content: center;
    }
    .modal-overlay.open { display: flex; }

    .modal {
      background: #0c1829;
      border: 1px solid #1a2d4a;
      border-radius: 12px;
      padding: 28px;
      width: 100%;
      max-width: 480px;
      margin: 20px;
    }

    .modal h2 { font-size: 16px; font-weight: 600; color: #e8f0ff; margin-bottom: 20px; }

    .platform-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-bottom: 20px;
    }

    .platform-btn {
      background: #070d1a;
      border: 2px solid #112040;
      border-radius: 8px;
      padding: 12px 8px;
      cursor: pointer;
      text-align: center;
      transition: all 0.15s;
    }
    .platform-btn:hover { border-color: #2e5090; }
    .platform-btn.selected { border-color: #3b82f6; background: #0a1e40; }
    .platform-btn .icon { font-size: 22px; margin-bottom: 4px; }
    .platform-btn .name { font-size: 11px; color: #3a5070; }
    .platform-btn.selected .name { color: #60a5fa; }

    .form-group { margin-bottom: 14px; }
    .form-group label { display: block; font-size: 12px; color: #3a5070; margin-bottom: 6px; }
    .form-group input {
      width: 100%;
      background: #070d1a;
      border: 1px solid #1a2d4a;
      border-radius: 8px;
      padding: 10px 12px;
      font-size: 13px;
      color: #c8d8f0;
      outline: none;
    }
    .form-group input:focus { border-color: #2e5090; }
    .form-group input::placeholder { color: #1e3050; }

    .modal-actions { display: flex; gap: 10px; margin-top: 20px; }

    .btn-primary {
      flex: 1;
      background: #1d4ed8;
      border: none;
      border-radius: 8px;
      padding: 11px;
      font-size: 14px;
      font-weight: 600;
      color: #fff;
      cursor: pointer;
      transition: all 0.15s;
    }
    .btn-primary:hover { background: #2563eb; }
    .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

    .btn-secondary {
      background: #112040;
      border: 1px solid #1a3560;
      border-radius: 8px;
      padding: 11px 18px;
      font-size: 14px;
      color: #5a80a8;
      cursor: pointer;
      transition: all 0.15s;
    }
    .btn-secondary:hover { background: #1a2d4a; color: #c8d8f0; }

    /* Stream stats */
    .stream-stats {
      background: rgba(12, 24, 41, 0.25);
      border: 1px solid rgba(26, 45, 74, 0.6);
      border-radius: 12px;
      padding: 18px 24px;
      backdrop-filter: blur(12px);
    }

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

    .stat-item {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .stat-item-label {
      font-size: 11px;
      font-weight: 500;
      letter-spacing: 0;
      color: #6f8fb5;
    }

    .stat-item-value {
      font-size: 15px;
      font-weight: 600;
      color: #c8d8f0;
      font-variant-numeric: tabular-nums;
    }

    .stat-item-value.dim { color: #1e3050; font-weight: 400; font-size: 13px; }
    .stat-item-value.live-val { color: #60a5fa; }

    /* Preview (inside merged block) */

    .preview-img-wrap {
      position: relative;
      background: #070d1a;
      aspect-ratio: 16/9;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }

    .preview-img-wrap video {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
    }

    .preview-placeholder {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      color: #1e3050;
    }

    .preview-placeholder svg { opacity: 0.4; }

    .preview-placeholder p { font-size: 13px; }

    .preview-spinner {
      position: absolute;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(7,13,26,0.6);
    }

    .preview-spinner.active { display: flex; }

    .spin {
      width: 28px; height: 28px;
      border: 3px solid #1a2d4a;
      border-top-color: #3b82f6;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    .preview-toolbar {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px 16px;
      border-top: 1px solid #1a2d4a;
    }

    .preview-ts { font-size: 12px; color: #2e4d70; flex: 1; }

    .live-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: rgba(220,38,38,0.15);
      border: 1px solid rgba(220,38,38,0.4);
      border-radius: 4px;
      padding: 3px 8px;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.05em;
      color: #f87171;
    }
    .live-badge::before {
      content: '';
      width: 6px; height: 6px;
      background: #ef4444;
      border-radius: 50%;
      animation: pulse-red 1.4s ease-in-out infinite;
    }
    @keyframes pulse-red {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.4; transform: scale(0.8); }
    }

    .quality-chip {
      display: flex;
      align-items: center;
      gap: 7px;
      background: rgba(12,24,41,0.4);
      border: 1px solid rgba(26,45,74,0.6);
      border-radius: 8px;
      padding: 8px 14px;
      font-size: 13px;
      color: #5a80a8;
      cursor: pointer;
      transition: all 0.15s;
      user-select: none;
    }
    .quality-chip:has(input:checked) { border-color: #3b82f6; background: rgba(29,78,216,0.2); color: #93c5fd; }
    .quality-chip input { accent-color: #3b82f6; width: 14px; height: 14px; }

    /* Server cards */
    .srv-card {
      background: rgba(12, 24, 41, 0.25);
      border: 1px solid rgba(26, 45, 74, 0.6);
      border-radius: 12px;
      padding: 16px 18px;
      backdrop-filter: blur(12px);
    }
    .srv-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .srv-card-label { font-size: 11px; font-weight: 500; letter-spacing: 0; color: #6f8fb5; margin-bottom: 4px; }
    .srv-card-value { font-size: 26px; font-weight: 700; color: #e8f0ff; line-height: 1; }
    .srv-card-sub   { font-size: 11px; color: #3a5070; margin-top: 4px; }

    .empty-msg { text-align: center; color: #2e4d70; font-size: 13px; padding: 20px; }

    .report-card {
      display: flex; align-items: center; gap: 14px;
      padding: 12px 16px;
      border-bottom: 1px solid rgba(26,45,74,0.4);
    }
    .report-card:last-child { border-bottom: none; }
    .report-date { font-size: 12px; color: #60a5fa; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .report-duration { font-size: 13px; font-weight: 600; color: #e8f0ff; white-space: nowrap; }
    .report-meta { font-size: 11px; color: #2e4d70; flex: 1; }
    .report-badge { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
    .report-badge.ok  { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
    .report-badge.warn { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
    .report-badge.err  { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

    .toast {
      position: fixed;
      bottom: 24px;
      right: 24px;
      background: #0c1829;
      border: 1px solid #1a2d4a;
      border-radius: 8px;
      padding: 12px 18px;
      font-size: 13px;
      color: #c8d8f0;
      z-index: 200;
      opacity: 0;
      transform: translateY(8px);
      transition: all 0.2s;
      pointer-events: none;
    }
    .toast.show { opacity: 1; transform: translateY(0); }
    .toast.success { border-color: #1a5c34; color: #4ade80; }
    .toast.error { border-color: #5c1a1a; color: #f87171; }

    .srv-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
    .srv-card-full { grid-column: span 3; }
    .rec-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

    /* Flux entrant */
    .stream-preview-col { flex: 1; min-width: 0; border-right: 1px solid rgba(26,45,74,0.6); }
    .stream-stats-panel {
      width: 220px; flex-shrink: 0; padding: 20px;
      display: flex; flex-direction: column; gap: 16px; justify-content: center;
    }

    @media (pointer: coarse) {
      .copy-btn, .codec-btn, button.pop-btn,
      input[type="text"], input[type="password"], select { min-height: 44px; }
      input[type="checkbox"] { width: 20px; height: 20px; }
    }

    /* Badge */
    .nav-badge {
      position: absolute;
      top: 4px; right: 4px;
      background: #ef4444;
      color: #fff;
      font-size: 9px; font-weight: 700;
      min-width: 15px; height: 15px;
      border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      padding: 0 4px;
      border: 1.5px solid rgb(3, 7, 16);
      line-height: 1;
    }
    .nav-badge.blue { background: #1d4ed8; }
    .nav-badge.green { background: #059669; }
    .nav-badge[hidden] { display: none !important; }

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

    /* ─── Responsive 700px ───────────────────────────────────────────────── */
    @media (max-width: 700px) {
      main { padding: 14px 16px 72px; }
      .section { margin-bottom: 16px; }

      /* Espacement des cartes dans les grilles */
      .rec-grid { gap: 14px !important; }
      .rec-grid > div { gap: 14px !important; }
      .srv-grid { gap: 14px !important; }

      /* Séparateur visuel entre sections d'un même onglet */
      .section[data-tab].tab-active + .section[data-tab].tab-active {
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid rgba(26, 45, 74, 0.35);
      }

      /* Header : flex au lieu de grid sur mobile */
      .header-right a, .header-right button { padding: 6px 10px !important; font-size: 12px !important; }
      #header-status { display: none; }

      /* Stats top row : 2 colonnes */
      .stats-row { grid-template-columns: repeat(2, 1fr) !important; }

      /* Flux entrant : colonne */
      .stream-stats > div:first-child { flex-direction: column !important; }
      .stream-preview-col { border-right: none !important; border-bottom: 1px solid rgba(26,45,74,0.6); }
      .stream-stats-panel {
        width: 100% !important;
        flex-direction: row !important;
        flex-wrap: wrap;
        padding: 14px !important;
        gap: 10px !important;
      }
      .stat-item { min-width: calc(50% - 5px); flex: 1; }
      /* Bitrate chart takes full width in the wrapped flex panel */
      .stream-stats-panel > div:last-child { width: 100%; flex-basis: 100%; margin-top: 4px; }

      /* Report cards : wrap on mobile */
      .report-card { flex-wrap: wrap; gap: 6px; }
      .report-card .report-date { min-width: 120px; }
      .report-card .report-meta { order: 3; flex-basis: 100%; }

      /* RTMP rows — label full width, puis input + bouton sur même ligne */
      .rtmp-url-row, .stream-key-row { flex-wrap: wrap; gap: 6px !important; }
      .rtmp-label { width: 100% !important; font-size: 11px; margin-bottom: 0; }
      .rtmp-value, .stream-key-input { flex: 1 !important; min-width: 0 !important; font-size: 12px !important; }

      /* Relay status */
      #relay-status { font-size: 12px !important; }

      /* Accès clients : 1 colonne */
      .guest-access-grid { grid-template-columns: 1fr !important; }

      /* Server grid : 2 col */
      .srv-grid { grid-template-columns: 1fr 1fr !important; gap: 14px !important; }
      .srv-card-full { grid-column: span 2 !important; }
      .srv-card { padding: 12px 14px !important; }

      /* Recording : 1 col + fix overflow */
      .rec-grid { grid-template-columns: 1fr !important; overflow: hidden; gap: 14px !important; }
      /* min-width:0 is required so grid items can shrink below their min-content */
      .rec-grid > * { min-width: 0; overflow: hidden; }
      /* Prevent inner file list from creating a horizontal scrollbar */
      #rec-files { overflow-x: hidden !important; }
      /* Recording status timer: allow wrap if multiple qualities */
      #rec-status { display: flex; flex-wrap: wrap; gap: 4px; }
      /* Time estimate can be long text — allow word break */
      #rec-time-estimate, #rec-storage-label { word-break: break-word; }

      /* Preset scroll */
      #preset-btns::-webkit-scrollbar { display: none; }
      .preset-scroll-wrap::after {
        content: '';
        position: absolute;
        top: 0; right: 0; bottom: 6px;
        width: 40px;
        background: linear-gradient(to right, transparent, rgba(8,16,32,0.95));
        pointer-events: none;
      }

      /* Modal */
      .platform-grid { grid-template-columns: repeat(3, 1fr) !important; }
      .modal { padding: 18px 14px !important; margin: 10px !important; }

      /* Charts */
      #chart-cpu { width: 80px !important; height: 44px !important; }
      #chart-ram, #chart-disk { width: 50px !important; height: 50px !important; }
      #chart-bitrate { max-height: 28px !important; }
    /* ── Mobile tab navigation ───────────────────────────────────────── */

      .section[data-tab="live"] > .section-title { display: none; }

      /* (deplace hors media query : voir .vue-* plus haut) */

      /* Force-expand collapsible sub-sections — collapse is irrelevant per-tab */
      #rec-content  { display: grid !important; }
      #srv-content  { display: grid !important; }
      #guest-content { display: grid !important; }
      #dbg-content  { display: grid !important; }
      #report-content { display: block !important; }

      /* Section titles: lighter, slightly bigger as in-tab headings */
      .section-title { font-size: 13px !important; color: #6f8fb5 !important; letter-spacing: 0 !important; }
    }

    /* ─── Responsive 480px ───────────────────────────────────────────────── */
    @media (max-width: 480px) {
      /* Hide Folder/Preview nav links — keep only logout */
      .header-nav-link { display: none !important; }
      .live-dot-wrap { display: flex; align-items: center; gap: 6px; }
      /* Toast : keep away from edge */
      .toast { bottom: 16px; left: 12px; right: 12px; text-align: center; }
      /* Stop-all section title : allow wrap */
      .section-title[style] { flex-wrap: wrap; gap: 6px; }
      /* Reduce copy-btn padding on small screens to save horizontal space */
      .copy-btn { padding: 8px 10px !important; font-size: 11px !important; }
      /* rec-files items: tighter gap */
      #rec-files > div { gap: 8px !important; padding: 8px 10px !important; }
    }

    /* ─── Responsive 420px ───────────────────────────────────────────────── */
    @media (max-width: 420px) {
      .platform-grid { grid-template-columns: repeat(2, 1fr) !important; }
      .srv-grid { grid-template-columns: 1fr !important; }
      .srv-card-full { grid-column: span 1 !important; }
      .stream-stats-panel .stat-item { min-width: calc(50% - 5px); }
      .stats-row { grid-template-columns: 1fr !important; }
    }

    /* ─── Debug block ──────────────────────────────────────────────────────── */
    .dbg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .dbg-span2 { grid-column: span 2; }
    .dbg-mono {
      font-family: 'SF Mono', 'Fira Code', monospace;
      font-size: 11px;
      color: #5a80a8;
      background: #040a14;
      border: 1px solid #0e1f38;
      border-radius: 8px;
      padding: 12px;
      max-height: 220px;
      overflow-y: auto;
      white-space: pre-wrap;
      word-break: break-all;
      line-height: 1.5;
    }
    .dbg-test-row {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 6px 0;
      border-bottom: 1px solid #070f1e;
    }
    .dbg-test-row:last-child { border-bottom: none; }
    .dbg-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
    .dbg-restart-btn {
      width: 100%;
      background: rgba(12, 24, 41, 0.5);
      border: 1px solid rgba(26, 45, 74, 0.7);
      border-radius: 8px;
      padding: 9px 14px;
      font-size: 13px;
      font-weight: 600;
      color: #60a5fa;
      cursor: pointer;
      text-align: left;
      transition: all 0.15s;
    }
    .dbg-restart-btn:hover { background: rgba(29, 78, 216, 0.2); border-color: #3b82f6; }
    .dbg-restart-warn { color: #facc15; }
    .dbg-restart-warn:hover { background: rgba(120,90,0,0.2) !important; border-color: #854d0e !important; }
    .dbg-restart-danger { color: #f87171; }
    .dbg-restart-danger:hover { background: rgba(127,29,29,0.3) !important; border-color: #7f1d1d !important; }
    @media (max-width: 700px) {
      .dbg-grid { grid-template-columns: 1fr !important; }
      .dbg-span2 { grid-column: span 1 !important; }
    }
  
    /* ─── Standard Nav (logo | titre | id) ─── */
    nav:not(.mobile-nav) {
      position: sticky; top: 0; z-index: 1000;
      height: 64px;
      display: grid; grid-template-columns: 1fr auto;
      align-items: center;
      padding: 0 24px;
      background: rgba(0,0,0,0.75);
      backdrop-filter: saturate(180%) blur(20px);
      border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    nav .lien-retour {
      justify-self: start;
      display: inline-flex; align-items: center; gap: 4px;
      font-size: 14px; color: var(--wc-accent, #2997ff);
      text-decoration: none; line-height: 1;
    }
    nav .lien-retour::before { content: "\2039"; font-size: 20px; line-height: 1; margin-top: -2px; }
    nav .lien-retour:hover { opacity: .75; }

    .ent { margin-bottom: 28px; }
    .ent .titre {
      font-size: 32px; font-weight: 700; letter-spacing: -0.02em;
      color: #eaf1fb; line-height: 1.15;
    }
    .ent .sous {
      margin-top: 5px; font-size: 14px; color: #6f8fb5; line-height: 1.4;
    }
    @media (max-width: 600px) {
      .ent { margin-bottom: 20px; }
      .ent .titre { font-size: 26px; }
      .ent .sous { font-size: 13px; }
    }

    nav .brand { justify-self: end; display: inline-flex; align-items: center; height: 100%; }
    nav .brand img { height: 24px; display: block; }
    nav .nav-pill {
      justify-self: center;
      display: inline-flex; align-items: center;
      padding: 6px 14px;
      font-size: 12px; font-weight: 500;
      color: var(--wc-text-secondary);
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 999px;
      max-width: 60vw;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      line-height: 1;
    }
    nav .nav-user {
      justify-self: end;
      display: inline-flex; align-items: center; gap: 8px;
      padding: 6px 14px;
      border-radius: 999px;
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.08);
      font-size: 12px; font-weight: 500;
      color: var(--wc-text-secondary);
      cursor: pointer;
      transition: all .15s;
      line-height: 1;
    }
    nav .nav-user:hover { background: rgba(255,69,58,0.15); border-color: rgba(255,69,58,0.3); color: var(--wc-red); }
    nav .nav-user .x { opacity: 0.5; font-size: 10px; }
    nav .nav-clock {
      justify-self: end;
      font-size: 18px; font-weight: 700;
      font-variant-numeric: tabular-nums;
      letter-spacing: 0.04em;
      color: #e8f0ff;
      text-shadow: 0 0 8px rgba(96,165,250,0.45), 0 0 40px rgba(59,130,246,0.35);
      line-height: 1;
    }
    nav .nav-timer {
      justify-self: center;
      font-size: 22px; font-weight: 700;
      font-variant-numeric: tabular-nums;
      color: #e8f0ff; letter-spacing: 0.04em;
      line-height: 1;
    }
    @media (max-width: 600px) {
      nav:not(.mobile-nav) { padding: 0 14px; height: 56px; }
      nav .brand img { height: 13px; }
      nav .nav-pill { font-size: 9px; padding: 4px 8px; max-width: 50vw; }
      nav .nav-user { font-size: 10px; padding: 4px 11px; }
    }
    /* ─── Footer ─── */
    .page-footer {
      padding: 18px 32px;
      border-top: 1px solid rgba(255,255,255,0.07);
      display: flex; justify-content: center; align-items: center;
      font-size: 12px; color: rgba(255,255,255,0.3);
      margin-top: auto;
    }
    .page-footer a { color: rgba(255,255,255,0.3); text-decoration: none; }
    .page-footer a:hover { color: rgba(255,255,255,0.6); }

    /* ── Santé des sorties et réglages d'encodage ─────────────────────────
       Placé ici, à la racine de la feuille : une première version se
       trouvait à l'intérieur d'un @media mobile et ne s'appliquait donc
       jamais sur écran large. */
    .sante-synthese { display:flex; gap:22px; flex-wrap:wrap; padding:2px 2px 12px;
                      border-bottom:1px solid rgba(255,255,255,0.07); margin-bottom:6px; }
    .sante-synthese .sy { display:flex; flex-direction:column; gap:2px; min-width:0; }
    .sante-synthese .v { font-size:19px; font-weight:700; letter-spacing:-.02em;
                         font-variant-numeric:tabular-nums; }
    .sante-synthese .v.alerte { color:#ff9f0a; }
    .sante-synthese .l { font-size:11.5px; color:rgba(245,247,250,.40); }

    /* Santé des sorties */
    .sante-l { display:flex; align-items:center; gap:11px; padding:10px 2px;
               border-bottom:1px solid rgba(255,255,255,0.07); min-width:0; }
    .sante-l:last-child { border-bottom:none; }
    .sante-pt { width:9px; height:9px; border-radius:50%; flex:none; background:#6b7280; }
    .sante-pt.ok { background:#30d158; box-shadow:0 0 0 3px rgba(48,209,88,.18); }
    .sante-pt.souci { background:#ff9f0a; }
    .sante-pt.ko { background:#ff453a; }
    .sante-nom { flex:1; min-width:0; }
    .sante-nom .n { font-size:14px; font-weight:500; overflow:hidden;
                    text-overflow:ellipsis; white-space:nowrap; }
    .sante-nom .t { font-size:11.5px; color:rgba(245,247,250,.40); margin-top:2px; }
    .sante-chiffres { flex:none; display:flex; gap:14px; font-size:12.5px;
                      color:rgba(245,247,250,.62); font-variant-numeric:tabular-nums; }
    .sante-chiffres b { color:#f5f7fa; font-weight:600; }
    .sante-chiffres .lent b { color:#ff9f0a; }
    .sante-vide { color:rgba(245,247,250,.40); font-size:13.5px; text-align:center; padding:18px 8px; }
    .sante-aide { color:rgba(245,247,250,.40); font-size:12px; line-height:1.55; margin-top:12px; }
    .enc-l { display:flex; align-items:center; gap:12px; padding:9px 2px; flex-wrap:wrap;
             border-bottom:1px solid rgba(255,255,255,0.07); }
    .enc-l:last-of-type { border-bottom:none; }
    .enc-l label { flex:1 1 200px; font-size:14px; min-width:0; }
    .enc-l select, .enc-l input { flex:0 1 190px; min-width:0; background:rgba(255,255,255,0.075);
      border:none; border-radius:10px; color:#f5f7fa; font-family:inherit; font-size:14px; padding:9px 11px; }
    @media (max-width:600px) {
      .sante-l { flex-wrap:wrap; }
      .sante-chiffres { flex-basis:100%; padding-left:20px; gap:12px; }
      .enc-l select, .enc-l input { flex:1 1 100%; }
    }
