        /* ═══ TIMELINE SCROLL CONTAINER ═══ */
        /* Simple conteneur de mise en page : .stage (à l'intérieur) est
           l'unique élément qui scrolle réellement (overflow-x:auto natif). */
        .timeline-scroll {
          position: relative;
          flex: 1;
          display: flex;
          flex-direction: column;
          overflow: hidden;
          width: 100%;
          min-height: 0;
          z-index: 100;
        }

    :root {
      --bg: #0d0d1a;
      --surface: #13132b;
      --border: rgba(255, 255, 255, 0.08);
      --text: #e8eaf6;
      --muted: #6272a4;
      --accent: #7c6af7;
      --accent2: #f7786a;
      --glass: rgba(255, 255, 255, 0.05);
      --year-w: 80px;
      /* pixels par an */
    }

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

    html,
    body {
      height: 100%;
      font-family: 'Inter', sans-serif;
      background: var(--bg);
      color: var(--text);
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    /* ═══ TOPBAR ═══ */
    .topbar {
      position: relative;
      z-index: 200;
      background: rgba(13, 13, 26, 0.92);
      backdrop-filter: blur(16px);
      border-bottom: 1px solid var(--border);
      padding: 8px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 15px;
      flex-wrap: nowrap;
      flex-shrink: 0;
    }

    .topbar-left,
    .topbar-right {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .topbar-mid {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 1;
      overflow-x: auto;
      padding: 4px 0;
    }

    .topbar-mid::-webkit-scrollbar {
      display: none;
    }

    .topbar-brand {
      font-size: 1.1rem;
      font-weight: 800;
      letter-spacing: 2px;
      background: linear-gradient(90deg, #a78bfa, #f7786a);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      white-space: nowrap;
    }

    .btn-top {
      border: 1px solid var(--border);
      background: var(--glass);
      color: var(--text);
      border-radius: 10px;
      padding: 7px 14px;
      cursor: pointer;
      font-size: 0.8rem;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: background 0.2s, border-color 0.2s;
      font-family: 'Inter', sans-serif;
      white-space: nowrap;
    }

    .btn-top:hover {
      background: rgba(255, 255, 255, 0.1);
      border-color: rgba(255, 255, 255, 0.2);
    }

    .btn-top:disabled {
      opacity: .35;
      cursor: not-allowed;
      pointer-events: none;
    }

    .btn-top.primary {
      background: linear-gradient(135deg, #7c6af7, #f7786a);
      border: none;
      color: #fff;
      box-shadow: 0 4px 14px rgba(124, 106, 247, .35);
    }

    .btn-top.primary:hover {
      opacity: .88;
    }

    .btn-top.success {
      background: rgba(100, 220, 140, .15);
      border-color: rgba(100, 220, 140, .3);
      color: #64dc8c;
    }

    .btn-top.success:hover {
      background: rgba(100, 220, 140, .25);
    }

    .btn-top.warning {
      background: rgba(255, 216, 107, .15);
      border-color: rgba(255, 216, 107, .3);
      color: #ffd86b;
    }

    #currentFrequeName {
      color: var(--muted);
      font-size: 0.76rem;
      padding: 4px 10px;
      border-radius: 20px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border);
    }

    /* Regroupe les boutons d'action de la topbar dans un même pavé, sur le
       modèle de .zoom-ctrl : ça permet au groupe entier de passer à la ligne
       d'un bloc quand ça ne tient plus, plutôt que chaque bouton qui déborde
       individuellement hors de l'écran (ancien comportement, non responsive :
       .topbar était en flex-wrap:nowrap et rien ne permettait de les
       atteindre sur mobile). */
    .topbar-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      background: var(--glass);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 3px;
    }

    /* Seuls les boutons "neutres" (Exporter, Importer) perdent leur bordure
       propre ici : ils sont déjà dans le pavé bordé .topbar-actions. Les
       variantes colorées (primary/success/warning : Item, Ère, Sauvegarder,
       Charger) gardent leur couleur et ombre habituelles pour rester
       repérables au premier coup d'œil. */
    .topbar-actions .btn-top:not(.primary):not(.success):not(.warning) {
      border: none;
      background: transparent;
    }

    .topbar-actions .btn-top:not(.primary):not(.success):not(.warning):hover {
      background: rgba(255, 255, 255, 0.1);
    }

    .search-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 1;
      min-width: 120px;
    }

    .search-bar .form-ctrl {
      width: 100%;
      max-width: 220px;
    }

    .btn-top-list {
      margin-left: auto;
    }

    /* ═══ RESPONSIVE ═══ */
    @media (max-width: 900px) {
      .topbar {
        flex-wrap: wrap;
        row-gap: 8px;
      }

      .search-bar {
        order: 5;
        flex-basis: 100%;
      }

      .search-bar .form-ctrl {
        max-width: none;
      }
    }

    @media (max-width: 560px) {
      .topbar {
        padding: 8px 12px;
      }

      .topbar-brand {
        font-size: 0.95rem;
      }

      #itemCountBadge {
        display: none;
      }

      /* Icônes seules (comme .zoom-btn) : le texte prend trop de place sur
         petit écran, la place est alors le facteur limitant, pas la
         compréhension (les icônes restent explicites via leur forme + le
         hover title éventuel). */
      .btn-label {
        display: none;
      }

      .topbar-actions .btn-top,
      .btn-top-list {
        padding: 8px;
      }
    }

    /* ═══ FILTERS ═══ */
    .filters {
      position: relative;
      z-index: 190;
      padding: 10px 20px;
      display: flex;
      gap: 7px;
      flex-wrap: wrap;
      align-items: center;
      background: rgba(13, 13, 26, 0.85);
      backdrop-filter: blur(10px);
      border-top: 1px solid var(--border);
      flex-shrink: 0;
    }

    .filter-btn {
      padding: 3px 12px;
      border-radius: 20px;
      font-size: 0.75rem;
      font-weight: 500;
      border: 1px solid var(--border);
      background: var(--glass);
      color: var(--muted);
      cursor: pointer;
      transition: all 0.2s;
      font-family: 'Inter', sans-serif;
    }

    .filter-btn.active,
    .filter-btn:hover {
      background: rgba(124, 106, 247, .15);
      border-color: #7c6af7;
      color: #a78bfa;
    }

    /* ═══ SCROLL CONTAINER ═══ */
    /* Unique élément scrollable de la frise (horizontal ET vertical, au cas
       où le lane-packing ne suffirait pas). Le ruler vit maintenant DANS
       .canvas (voir .ruler plus bas), donc il défile avec elle nativement —
       plus besoin de synchroniser deux conteneurs de scroll séparés. */
    .stage {
      flex: 1;
      position: relative;
      overflow-x: auto;
      overflow-y: auto;
      cursor: grab;
      z-index: 50;
    }

    .stage:active {
      cursor: grabbing;
    }

    .stage::-webkit-scrollbar {
      height: 6px;
    }

    .stage::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.03);
    }

    .stage::-webkit-scrollbar-thumb {
      background: rgba(124, 106, 247, 0.4);
      border-radius: 10px;
    }

    /* ═══ CANVAS ═══ */
    .canvas {
      position: relative;
      height: 100%;
      /* width set by JS — pas de max-width:100% ici : ça clampait le canvas
         à la largeur de .stage, donc stage.scrollWidth == stage.clientWidth
         en permanence et le scroll ne bougeait jamais rien. Résultat : la
         règle (.ruler, non clampée) défilait normalement en révélant les
         bonnes années, mais les items au-delà de la largeur visible restaient
         coincés hors champ pour toujours → zone vide "fantôme" à droite. */
    }

    /* ═══ TIMELINE AXIS ═══ */
    .axis {
      position: absolute;
      bottom: 50px;
      left: 0;
      right: 0;
      height: 2px;
      background: linear-gradient(90deg, transparent 0%, #7c6af7 5%, #f7786a 50%, #7c6af7 95%, transparent 100%);
      z-index: 10;
    }

    /* ═══ YEAR RULER (en bas de la timeline) ═══ */
    /* Enfant de .canvas (pas un sibling) : width:100% suit donc TOUJOURS
       automatiquement la largeur réelle du canvas, sans jamais avoir besoin
       d'être fixée séparément en JS ni de pouvoir désynchroniser. */
    .ruler {
      position: absolute;
      left: 0;
      bottom: 0;
      width: 100%;
      height: 50px;
      background: rgba(13, 13, 26, 0.95);
      border-top: 1px solid var(--border);
      z-index: 200;
    }

    .year-tick {
      position: absolute;
      top: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      transform: translateX(-50%);
      cursor: pointer;
      pointer-events: auto;
    }

    .year-tick-label {
      font-size: 0.65rem;
      font-weight: 600;
      color: var(--muted);
      padding-top: 6px;
      white-space: nowrap;
      transition: color 0.2s;
    }

    .year-tick:hover .year-tick-label {
      color: #a78bfa;
    }

    .year-tick-label.decade {
      color: #90caf9;
      font-weight: 700;
      font-size: 0.75rem;
    }

    .year-tick-line {
      width: 1px;
      background: rgba(255, 255, 255, 0.1);
      position: absolute;
      bottom: 50px;
      /* up from axis */
    }

    .year-tick-line.decade {
      background: rgba(255, 255, 255, 0.2);
    }

    /* Major tick marks on axis */
    .axis-tick {
      position: absolute;
      bottom: -1px;
      width: 1px;
      background: rgba(255, 255, 255, 0.15);
      transform: translateX(-50%);
    }

    .axis-tick.decade {
      background: rgba(255, 255, 255, 0.4);
      height: 14px;
    }

    .axis-tick.year {
      height: 7px;
    }

    /* ═══ ITEMS ═══ */
    .fresque-item {
      position: absolute;
      bottom: 20px;
      transform: translateX(-50%);
      display: flex;
      flex-direction: column;
      align-items: center;
      z-index: 30;
      justify-content: flex-end;
      pointer-events: none;
    }

    .fresque-item.above {
      transform: translate(-50%, -100%);
    }

    .fresque-item:hover {
      z-index: 50;
      /* Bring hovered item to front so it's clickable */
    }

    .fresque-item.above {
      bottom: 50px;
      /* Upwards from axis */
      transform: translate(-50%, -100%);
    }

    .item-connector {
      width: 1px;
      min-height: 20px;
      pointer-events: none;
    }

    .item-dot {
      position: absolute;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--accent);
      border: 1px solid rgba(255, 255, 255, 0.2);
      /* Thinner, semi-transparent border */
      box-shadow: 0 0 8px rgba(124, 106, 247, 0.7);
      flex-shrink: 0;
      z-index: 2;
      left: 50%;
      bottom: 0px;
      /* Center precisely on the 2px axis line (which is at 50px-52px) */
      transform: translate(-50%, calc(50% - 1px));
      pointer-events: auto;
    }

    .item-card {
      width: 180px;
      max-height: 190px;
      border-radius: 12px;
      background: rgba(20, 20, 50, 0.92);
      border: 1px solid rgba(124, 106, 247, 0.2);
      backdrop-filter: blur(12px);
      overflow: hidden;
      cursor: pointer;
      transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
      flex-shrink: 0;
      position: relative;
      z-index: 35;
      pointer-events: auto;
      margin-top: 10px;
      /* Space for tall cards */
    }

    .item-card:hover {
      transform: scale(1.05);
      box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
      border-color: rgba(124, 106, 247, 0.6);
      z-index: 55;
    }

    .item-card img {
      width: 100%;
      height: 75px;
      object-fit: cover;
      display: block;
    }

    .item-card-body {
      padding: 8px 10px;
    }

    .item-cat {
      font-size: 0.58rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1px;
      padding: 2px 7px;
      border-radius: 20px;
      display: inline-block;
      margin-bottom: 4px;
    }

    .item-title {
      font-size: 0.8rem;
      font-weight: 700;
      line-height: 1.3;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .item-subtitle {
      font-size: 0.68rem;
      color: var(--muted);
      margin-top: 1px;
      line-height: 1.3;
      display: -webkit-box;
      -webkit-line-clamp: 1;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .item-dates {
      font-size: 0.62rem;
      color: var(--muted);
      margin-top: 5px;
      display: flex;
      gap: 3px;
      align-items: center;
    }

    .item-dates i {
      color: var(--accent);
    }

    /* Duration bar */
    .duration-bar {
      position: absolute;
      height: 4px;
      border-radius: 2px;
      background: linear-gradient(90deg, rgba(124, 106, 247, 0.6), rgba(247, 120, 106, 0.4));
      bottom: 49px;
      /* Centered on bottom-anchored axis */
      z-index: 5;
      pointer-events: none;
    }

    /* ═══ ERAS (PERIODS) ═══ */
    .era-block {
      position: absolute;
      top: 0;
      bottom: 50px;
      z-index: 0;
      /* Behind everything */
      border-left: 2px dashed rgba(255, 255, 255, 0.1);
      border-right: 2px dashed rgba(255, 255, 255, 0.1);
      background: rgba(255, 255, 255, 0.02);
      pointer-events: none;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .era-content {
      padding: 15px 20px;
      background: linear-gradient(180deg, rgba(13, 13, 26, 0.8) 0%, transparent 100%);
      pointer-events: auto;
      /* allow click for edit/delete */
    }

    .era-title {
      font-size: 1.1rem;
      font-weight: 800;
      color: rgba(255, 255, 255, 0.8);
      letter-spacing: 2px;
      text-transform: uppercase;
      margin-bottom: 5px;
      cursor: pointer;
      transition: color 0.2s;
    }

    .era-title:hover {
      color: var(--accent);
    }

    .era-desc {
      font-size: 0.75rem;
      color: var(--muted);
      max-width: 400px;
    }

    /* Cat colors */
    .cat-0 {
      background: rgba(124, 106, 247, .2);
      color: #a78bfa;
    }

    .cat-1 {
      background: rgba(247, 120, 106, .2);
      color: #f7786a;
    }

    .cat-2 {
      background: rgba(100, 220, 140, .2);
      color: #64dc8c;
    }

    .cat-3 {
      background: rgba(255, 216, 107, .2);
      color: #ffd86b;
    }

    .cat-4 {
      background: rgba(100, 180, 255, .2);
      color: #64b4ff;
    }

    .cat-5 {
      background: rgba(255, 150, 200, .2);
      color: #ff96c8;
    }

    /* ═══ MODALS ═══ */
    .overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(6px);
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.22s;
    }

    .overlay.open {
      opacity: 1;
      pointer-events: all;
    }

    .panel {
      background: #1a1a35;
      border: 1px solid var(--border);
      border-radius: 20px;
      width: 520px;
      max-width: 95vw;
      max-height: 90vh;
      overflow-y: auto;
      transform: translateY(24px);
      transition: transform 0.22s;
      position: relative;
    }

    .overlay.open .panel {
      transform: translateY(0);
    }

    .panel-header {
      padding: 18px 22px 12px;
      border-bottom: 1px solid var(--border);
      font-size: 0.95rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .panel-header i {
      color: var(--accent);
    }

    .panel-body {
      padding: 18px 22px 22px;
    }

    .btn-close-panel {
      position: absolute;
      top: 12px;
      right: 12px;
      background: rgba(255, 255, 255, .08);
      border: none;
      color: var(--text);
      width: 32px;
      height: 32px;
      border-radius: 50%;
      cursor: pointer;
      font-size: .9rem;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .btn-close-panel:hover {
      background: rgba(255, 255, 255, .18);
    }

    .form-label {
      font-size: 0.76rem;
      font-weight: 600;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .5px;
      margin-bottom: 5px;
      display: block;
    }

    .form-ctrl {
      width: 100%;
      background: rgba(255, 255, 255, .05);
      border: 1px solid var(--border);
      border-radius: 10px;
      color: var(--text);
      padding: 9px 13px;
      font-size: 0.86rem;
      outline: none;
      transition: border-color .2s;
      font-family: 'Inter', sans-serif;
    }

    .form-ctrl:focus {
      border-color: var(--accent);
    }

    .form-ctrl::placeholder {
      color: var(--muted);
    }

    textarea.form-ctrl {
      resize: vertical;
      min-height: 70px;
    }

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

    .form-group {
      margin-bottom: 13px;
    }

    .btn-submit {
      width: 100%;
      padding: 11px;
      background: linear-gradient(135deg, #7c6af7, #f7786a);
      border: none;
      border-radius: 12px;
      color: #fff;
      font-weight: 700;
      font-size: .9rem;
      cursor: pointer;
      margin-top: 5px;
      transition: opacity .2s;
      font-family: 'Inter', sans-serif;
    }

    .btn-submit:hover {
      opacity: .88;
    }

    .img-preview {
      width: 100%;
      height: 100px;
      object-fit: cover;
      border-radius: 10px;
      margin-top: 7px;
      display: none;
      border: 1px solid var(--border);
    }

    /* Detail */
    .detail-img {
      width: 100%;
      height: 180px;
      object-fit: cover;
      border-radius: 20px 20px 0 0;
    }

    .detail-img-placeholder {
      width: 100%;
      height: 130px;
      background: linear-gradient(135deg, #1e1e40, #2a1a40);
      border-radius: 20px 20px 0 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 3rem;
      color: var(--muted);
    }

    .detail-body {
      padding: 18px 20px 20px;
    }

    .detail-title {
      font-size: 1.15rem;
      font-weight: 800;
      margin-bottom: 3px;
    }

    .detail-subtitle {
      color: var(--muted);
      font-size: .86rem;
      margin-bottom: 10px;
    }

    .detail-dates {
      display: flex;
      gap: 14px;
      color: var(--muted);
      font-size: .78rem;
      margin-bottom: 12px;
    }

    .detail-dates span {
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .detail-dates i {
      color: var(--accent);
    }

    .detail-text {
      color: #b0b8d8;
      font-size: .85rem;
      line-height: 1.7;
    }

    .btn-danger-sm {
      background: rgba(247, 120, 106, .15);
      border: 1px solid rgba(247, 120, 106, .3);
      color: #f7786a;
      border-radius: 8px;
      padding: 6px 14px;
      cursor: pointer;
      font-size: .8rem;
      font-family: 'Inter', sans-serif;
    }

    .btn-edit-sm {
      background: rgba(124, 106, 247, .15);
      border: 1px solid rgba(124, 106, 247, .3);
      color: #a78bfa;
      border-radius: 8px;
      padding: 6px 14px;
      cursor: pointer;
      font-size: .8rem;
      font-family: 'Inter', sans-serif;
    }

    .btn-danger-sm:hover {
      background: rgba(247, 120, 106, .3);
    }

    .btn-edit-sm:hover {
      background: rgba(124, 106, 247, .3);
    }

    /* Files list */
    .file-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 12px;
      border-radius: 10px;
      background: rgba(255, 255, 255, .03);
      border: 1px solid var(--border);
      margin-bottom: 7px;
      cursor: pointer;
      transition: background .18s;
    }

    .file-row:hover {
      background: rgba(255, 255, 255, .08);
    }

    .file-row-icon {
      font-size: 1.3rem;
      color: #ffd86b;
    }

    .file-row-info {
      flex: 1;
    }

    .file-row-name {
      font-weight: 600;
      font-size: .86rem;
    }

    .file-row-meta {
      color: var(--muted);
      font-size: .72rem;
    }

    .file-row-del {
      background: none;
      border: none;
      color: var(--muted);
      cursor: pointer;
      padding: 4px 7px;
      border-radius: 6px;
    }

    .file-row-del:hover {
      color: #f7786a;
      background: rgba(247, 120, 106, .15);
    }

    .save-name-row {
      display: flex;
      gap: 10px;
    }

    .save-name-row .form-ctrl {
      flex: 1;
    }

    .btn-save-go {
      background: linear-gradient(135deg, #7c6af7, #f7786a);
      border: none;
      color: #fff;
      border-radius: 10px;
      padding: 0 18px;
      font-weight: 700;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      white-space: nowrap;
    }

    .no-files {
      color: var(--muted);
      font-size: .86rem;
      text-align: center;
      padding: 18px 0;
    }

    /* Toast */
    .toast-wrap {
      position: fixed;
      bottom: 24px;
      right: 24px;
      z-index: 9999;
      display: flex;
      flex-direction: column;
      gap: 7px;
    }

    .toast-item {
      background: #1e1e3a;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 10px 16px;
      font-size: .83rem;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 8px;
      box-shadow: 0 8px 28px rgba(0, 0, 0, .4);
      animation: slideUp .28s ease;
    }

    @keyframes slideUp {
      from {
        opacity: 0;
        transform: translateY(14px)
      }

      to {
        opacity: 1;
        transform: translateY(0)
      }
    }

    .toast-item.ok i {
      color: #64dc8c;
    }

    .toast-item.err i {
      color: #f7786a;
    }

    /* Empty */
    .empty-fresque {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      gap: 10px;
      pointer-events: none;
    }

    .empty-fresque i {
      font-size: 3.5rem;
      opacity: .25;
    }

    .empty-fresque p {
      font-size: .95rem;
      opacity: .4;
    }

    /* Zoom controls */
    .zoom-ctrl {
      display: flex;
      gap: 2px;
      background: var(--glass);
      padding: 2px;
      border-radius: 10px;
      border: 1px solid var(--border);
    }

    .zoom-btn {
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      border: none;
      color: var(--text);
      cursor: pointer;
      border-radius: 8px;
      font-size: 0.9rem;
      transition: background 0.2s;
    }

    .zoom-btn:hover {
      background: rgba(255, 255, 255, 0.1);
    }

    .zoom-btn[title] {
      position: relative;
    }

    .zoom-btn[title]:hover::after {
      content: attr(title);
      position: absolute;
      top: 40px;
      right: 0;
      background: #111;
      color: #eee;
      padding: 4px 8px;
      border-radius: 4px;
      font-size: 0.7rem;
      white-space: nowrap;
      pointer-events: none;
      border: 1px solid var(--border);
      z-index: 1000;
    }

    /* ═══ OFFCANVAS ═══ */
    .offcanvas {
      position: fixed;
      top: 0;
      right: -420px;
      width: 400px;
      height: 100vh;
      background: #111;
      color: #fff;
      z-index: 2000;
      transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
      display: flex;
      flex-direction: column;
      border-left: 1px solid #333;
    }

    .offcanvas.open {
      right: 0;
    }

    .offcanvas-header {
      padding: 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid #333;
      font-weight: 700;
      font-size: 1.1rem;
      color: var(--accent);
    }

    .offcanvas-body {
      flex: 1;
      overflow-y: auto;
      padding: 10px 0;
    }

    .offcanvas-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(0, 0, 0, 0.6);
      z-index: 1999;
      display: none;
      backdrop-filter: blur(2px);
    }

    .offcanvas-overlay.open {
      display: block;
    }

    .off-item {
      padding: 15px 20px;
      cursor: pointer;
      transition: background 0.2s;
      display: block;
      border-bottom: 1px solid #222;
    }

    .off-item:hover {
      background: #1a1a1a;
    }

    .off-item-img {
      width: 40px;
      height: 40px;
      border-radius: 4px;
      object-fit: cover;
      background: #333;
      flex-shrink: 0;
    }

    .off-item-info {
      flex: 1;
      min-width: 0;
    }

    .off-item-title {
      font-weight: 600;
      font-size: 0.9rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .off-item-date {
      font-size: 0.75rem;
      color: #888;
    }

    .off-item-cat {
      font-size: 0.65rem;
      text-transform: uppercase;
      padding: 1px 6px;
      border-radius: 3px;
      margin-top: 2px;
      display: inline-block;
    }

    /* ═══ LIST GROUP & UTILITIES ═══ */
    .list-group {
      display: flex;
      flex-direction: column;
      padding-left: 0;
      margin-bottom: 0;
      border-radius: 0;
    }

    .list-group-item {
      position: relative;
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      padding: 1rem 1.25rem;
      background-color: transparent;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      cursor: pointer;
      transition: background-color 0.2s;
      text-decoration: none;
      color: inherit;
    }

    .list-group-item:hover {
      background-color: rgba(255, 255, 255, 0.03);
    }

    .ms-2 {
      margin-left: 0.5rem !important;
    }

    .me-auto {
      margin-right: auto !important;
    }

    .fw-bold {
      font-weight: 700 !important;
    }

    .badge {
      display: inline-block;
      padding: 0.35em 0.65em;
      font-size: 0.75em;
      font-weight: 700;
      line-height: 1;
      color: #fff;
      text-align: center;
      white-space: nowrap;
      vertical-align: baseline;
      border-radius: 50rem;
    }

    .rounded-pill {
      border-radius: 50rem !important;
    }

    /* Category specific badges */
    .badge.cat-0 {
      background-color: #6c757d;
    }

    .badge.cat-1 {
      background-color: #0d6efd;
    }

    .badge.cat-2 {
      background-color: #198754;
    }

    .badge.cat-3 {
      background-color: #dc3545;
    }

    .badge.cat-4 {
      background-color: #ffc107;
      color: #000;
    }

    .badge.cat-5 {
      background-color: #0dcaf0;
      color: #000;
    }

    .offcanvas-group-header {
      background-color: #1a1a1a !important;
      color: var(--accent) !important;
      font-weight: 700;
      font-size: 0.8rem;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      padding: 8px 20px !important;
      border-bottom: 2px solid #333 !important;
      position: sticky;
      top: 0;
      z-index: 2;
      cursor: default !important;
    }

    .offcanvas-group-header:hover {
      background-color: #1a1a1a !important;
    }

