/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  mediathek.css — die EINE Mediathek-CSS                                   ║
   ║  Stand: 2026-05-10 (Schritt B FINAL)                                      ║
   ║                                                                            ║
   ║  Reihenfolge im HTML: NACH nm24.css einbinden!                            ║
   ║                                                                            ║
   ║  Inhalt:                                                                   ║
   ║   - App-Layout (Sidebar, Header, Tab-Bar)                                  ║
   ║   - Mediathek-Komponenten (Welcome, Akkordeon, Audio-Player, Themen-Cards)║
   ║   - Header-Korrekturen (ehemals Block 5 / nm24-template-fix)               ║
   ║                                                                            ║
   ║  Konflikte mit nm24.css wurden aufgelöst — nm24.css gewinnt überall, wo   ║
   ║  beide eine Eigenschaft definieren (entspricht dem Vor-Refactor-Verhalten)║
   ╚══════════════════════════════════════════════════════════════════════════╝
*/

/* ┌────────────────────────────────────────────────────────────────┐
   │ APP SHELL — vorher anonymer <style>-Block 1 (generischer Teil) │
   │ Erweitert vorher nm24.css um App-Layout (Sidebar + Header etc.) │
   │ Hier in mediathek.css, weil nm24.css NICHT verändert werden soll. │
   └────────────────────────────────────────────────────────────────┘
*/

  :root {
    --blue: #002060;
    --blue-dark: #001640;
    --blue-light: #1a3a7a;
    --red: #DB2303;
    --red-dark: #6e0000;
    --white: #ffffff;
    --gray-50: #E0E9F6;           /* NM24: Karten-Hintergrund (war #fafafa) */
    --gray-100: #ECF2FB;          /* NM24: Container-Hintergrund (war korrekt) */
    --gray-200: rgba(0,32,96,0.12); /* NM24: Rahmenfarbe (war #e5e5ea) */
    --gray-300: #d1d1d6;          /* Behalten: Input-Rahmen */
    --gray-400: #a1a1a6;
    --gray-500: #8e8e93;
    --gray-700: #48484a;
    --gray-900: #1c1c1e;
    --mint: #00E6B3;              /* NM24: Aktives Icon-Mint (war #00C9A7) */
    --card-bg:     #E0E9F6;       /* NM24-Token: Karte normal */
    --card-hover:  #D3DEEC;       /* NM24-Token: Karte hover */
    --card-border: rgba(0,32,96,0.12); /* NM24-Token: Karten-Rahmen */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,32,96,0.08);
    --shadow-lg: 0 8px 24px rgba(0,32,96,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 2s cubic-bezier(0.4, 0, 0.2, 1);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }

  html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--gray-900);
    background: var(--gray-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Full-screen layout — no phone frame */
  .device-frame {
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  .phone {
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Status bar — only visible on standalone iOS (home screen app) */
  .status-bar {
    height: 0;
    padding-top: var(--safe-top);
    background: var(--blue);
    color: var(--white);
    display: none;
    align-items: center;
    justify-content: space-between;
    padding-left: 24px;
    padding-right: 24px;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
  }

  @media all and (display-mode: standalone) {
    .status-bar {
      display: flex;
      height: calc(44px + var(--safe-top));
    }
  }

  .status-bar .icons {
    display: flex;
    gap: 6px;
    align-items: center;
  }

  /* Main app container */
  .app {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--gray-100);
  }

  /* === NEUROMEDIA24 STANDARD HEADER === */
  .nm-header{background:#D7E4F4;position:relative;z-index:10;flex-shrink:0;}
  .nm-header-inner{display:flex;min-height:130px;}
  .nm-header-sidebar-space{width:420px;flex-shrink:0;}
  .nm-header-content-area{flex:0 1 1200px;max-width:1200px;margin:0 auto;}
  /* High-specificity override beats browser extension !important injection */
  header.nm-header > .nm-header-inner > .nm-header-content-area{flex:0 1 1200px!important;max-width:1200px!important;margin:0 auto!important;}
  .nm-header-content-inner{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:0;height:130px;}
  .nm-brand{display:flex;align-items:center;gap:10px;}
  .nm-title{font-size:32px;letter-spacing:-0.4px;font-weight:400;color:var(--nm-blue,#002060);cursor:pointer;white-space:nowrap;font-family:'Inter',sans-serif;display:inline-flex;align-items:center;line-height:1;}
  .nm-app-label{color:#002060;margin-left:2px;}
  @media(max-width:768px){.nm-title{font-size:23px;}}
  .nm-header-logo{width:72px;height:72px;flex-shrink:0;display:block;object-fit:contain;border-radius:14px;}
  @media(max-width:600px){.nm-header-logo{width:56px;height:56px;}}
  .nm-hamburger{display:none;background:none;border:none;border-radius:8px;padding:7px;cursor:pointer;align-items:center;justify-content:center;margin-right:4px;}
  .nm-headtools{display:flex;gap:6px;align-items:center;background:none;padding:0;border-radius:0;}
  .nm-flags{display:flex;gap:6px;background:none;padding:0;}
  .nm-flags .flag-btn{width:34px;height:34px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;border:none;background:rgba(150,0,0,0.12);color:#960000;font-size:10.5px;font-weight:700;line-height:1;cursor:pointer;opacity:1;transition:all .15s;letter-spacing:0.2px;font-family:"Inter",sans-serif;}
  .nm-flags .flag-btn:hover{background:#960000;color:#fff;transform:none;}
  .nm-flags .flag-btn.active{background:#960000;color:#fff;}
  .nm-iconbtn{width:36px;height:36px;border-radius:50%;background:#002060;display:flex;align-items:center;justify-content:center;color:#fff;cursor:pointer;border:none;transition:background .15s;flex-shrink:0;}
  .nm-iconbtn:hover{background:#960000;}
  /* Suchleiste im Header */
  .nm-header-search{flex:1;max-width:380px;display:flex;align-items:center;gap:8px;background:rgba(255,255,255,0.18);border:1.5px solid rgba(255,255,255,0.28);border-radius:12px;padding:0 12px;height:40px;transition:border-color .15s,background .15s;}
  .nm-header-search:focus-within{border-color:rgba(255,255,255,0.55);background:rgba(255,255,255,0.26);}
  .nm-header-search-icon{color:rgba(0,32,96,0.55);flex-shrink:0;font-size:15px;line-height:1;}
  .nm-header-search-input{flex:1;border:none;background:transparent;font-size:14px;color:#002060;outline:none;min-width:0;}
  .nm-header-search-input::placeholder{color:rgba(0,32,96,0.48);}
  .nm-header-search-clear{width:20px;height:20px;border-radius:50%;background:rgba(0,32,96,0.12);border:none;cursor:pointer;font-size:11px;display:none;align-items:center;justify-content:center;color:#002060;padding:0;flex-shrink:0;line-height:1;}
  /* Suchleiste unter dem Header — auf Desktop versteckt, Mobile sichtbar */
  .nm-search-bar{display:none;align-items:center;gap:8px;background:rgba(0,32,96,0.06);border-bottom:1px solid rgba(0,32,96,0.1);padding:9px 16px;flex-shrink:0;}
  .nm-search-bar input{flex:1;border:none;background:transparent;font-size:14px;color:#002060;outline:none;}
  .nm-search-bar input::placeholder{color:rgba(0,32,96,0.4);}
  .nm-search-clear{display:none;background:rgba(0,32,96,0.1);border:none;cursor:pointer;width:22px;height:22px;border-radius:50%;color:#002060;font-size:13px;line-height:1;align-items:center;justify-content:center;flex-shrink:0;font-family:inherit;padding:0;}

  /* Breadcrumb bar below header */
  .breadcrumb-bar {
    background: #1a3a7a;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
    min-height: 38px;
  }

  .breadcrumb-bar.hidden {
    display: none;
  }

  .breadcrumb-bar .btn-back {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: var(--white);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
  }

  .breadcrumb-bar .btn-back:active {
    background: rgba(255,255,255,0.25);
    transform: scale(0.95);
  }

  .breadcrumb-path {
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .breadcrumb-path .bc-sep {
    opacity: 0.5;
    font-size: 11px;
  }

  /* Content */
  .content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(20px + var(--safe-bottom));
  }

  .content::-webkit-scrollbar {
    width: 0;
  }

  /* Screen animations */
  .screen {
    display: none;
    animation: fadeIn 0.3s ease;
  }

  .screen.active {
    display: block;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
  }
  @keyframes blink {
    0%, 20% { opacity: 0.2; }
    50% { opacity: 1; }
    80%, 100% { opacity: 0.2; }
  }

  /* LOGIN SCREEN */
  .login-screen {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 100%);
    display: flex;
    flex-direction: column;
    padding: 40px 28px;
    z-index: 100;
    color: var(--white);
  }

  .login-logo {
    margin-top: 60px;
    margin-bottom: 40px;
    text-align: center;
  }

  .login-logo img {
    width: 220px;
    height: auto;
  }

  .login-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    text-align: center;
  }

  .login-subtitle {
    font-size: 15px;
    opacity: 0.8;
    text-align: center;
    margin-bottom: 40px;
  }

  .login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .input-group {
    position: relative;
  }

  .input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 16px;
    outline: none;
    transition: var(--transition);
  }

  .input-group input::placeholder {
    color: rgba(255,255,255,0.4);
  }

  .input-group input:focus {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
  }

  .btn-primary {
    background: var(--red);
    color: var(--white);
    border: none;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 12px;
    width: 100%;
  }

  .btn-primary:active {
    background: var(--red-dark);
    transform: scale(0.98);
  }

  .btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
  }

  .btn-secondary:active {
    background: rgba(255,255,255,0.2);
  }

  .login-footer {
    margin-top: auto;
    text-align: center;
    font-size: 13px;
    opacity: 0.6;
  }

  .login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    font-size: 12px;
    opacity: 0.6;
  }

  .login-divider::before,
  .login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.2);
  }

  /* Header layout */
  .header-search {
    flex: 1;
    min-width: 0;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
  }

  .header-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--white);
    font-size: 14px;
    flex: 1;
    width: 100%;
  }

  .header-search input::placeholder {
    color: rgba(0,32,96,0.55);
  }

  .filter-btn {
    background: #C1CDE5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #002060;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
  }

  .filter-btn:active {
    background: #c4d2e8;
  }

  .filter-btn.has-filters {
    background: var(--red);
  }

  /* Language selector: three flags inline */
  .lang-flags {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.12);
    padding: 3px;
    border-radius: 14px;
  }

  .flag-btn {
    width: 30px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.9;
    filter: none;
    transition: var(--transition);
  }

  .flag-btn:hover {
    opacity: 1;
    filter: none;
    transform: scale(1.18);
  }

  .flag-btn.active {
    opacity: 1;
    filter: none;
    background: #960000;
    color: #fff;
    box-shadow: none;
  }

  /* GLOBAL HOVER EFFECTS for cards and buttons */
  @media (hover: hover) {
    .category-card:hover,
    .question-card:hover:not(.disabled),
    .module-card:hover,
    .exercise-card:hover,
    .format-card:hover,
    .search-result:hover:not(.disabled),
    .btn-primary:hover,
    .btn-secondary:hover,
    .filter-btn:hover,
    .chip:hover,
    .tab-btn:hover,
    .bulk-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 10px 20px rgba(0, 32, 96, 0.18);
      filter: brightness(1.05);
    }
    .category-card:hover { box-shadow: 0 12px 26px rgba(0, 32, 96, 0.32); }
    .chip:hover { transform: translateY(-1px); }
  }

  .category-card,
  .question-card,
  .module-card,
  .exercise-card,
  .format-card,
  .search-result,
  .btn-primary,
  .btn-secondary,
  .filter-btn,
  .chip,
  .tab-btn,
  .bulk-btn,
  .format-chip {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .home-spacer {
    height: 12px !important;
  }

  /* HOME: Welcome - compact */
  .welcome {
    padding: 14px 20px 6px;
    background: var(--blue);
    color: var(--white);
    margin-top: 0;
  }

  .welcome h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
  }

  .welcome p {
    font-size: 13px;
    opacity: 0.8;
  }

  /* HOME: Categories grid - compact, dark blue, all visible */
  .section-header {
    padding: 12px 16px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .section-header h3 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--gray-700);
    text-transform: uppercase;
  }

  .section-header .count {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 600;
  }


  .recently-viewed { padding: 0 16px 16px; }
  .recently-divider { border: none; border-top: 1px solid var(--gray-300); margin: 8px 0 16px; }
  .recently-viewed h3 { font-size: 13px; font-weight: 700; color: var(--gray-700); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
  .recently-strip { display: flex; flex-direction: column; gap: 10px; }
  .recently-chip { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%); border-radius: var(--radius-lg); padding: 14px 16px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; box-shadow: 0 2px 8px rgba(0,32,96,0.15); }
  .recently-chip:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,32,96,0.3); }
  .recently-chip .chip-icon { font-size: 28px; flex-shrink: 0; }
  .recently-chip .chip-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .recently-chip .chip-name { font-size: 14px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .recently-chip .chip-time { font-size: 11px; color: rgba(255,255,255,0.6); }


  .notes-section { padding: 0 16px 20px; }
  .notes-toggle { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--gray-300); border-radius: var(--radius-md); padding: 10px 16px; width: 100%; cursor: pointer; color: var(--gray-600); font-size: 16px; font-weight: 600; transition: background 0.2s, border-color 0.2s; }
  .notes-toggle:hover { background: var(--gray-100); border-color: var(--gray-400); }
  .notes-toggle svg { flex-shrink: 0; }
  .notes-toggle .notes-arrow { margin-left: auto; transition: transform 0.2s; }
  .notes-toggle.open .notes-arrow { transform: rotate(180deg); }
  .notes-toggle .notes-indicator { width: 6px; height: 6px; background: var(--blue); border-radius: 50%; margin-left: 4px; }
  .notes-body { display: none; margin-top: 10px; }
  .notes-body.open { display: block; }
  .notes-textarea { width: 100%; min-height: 120px; padding: 14px 16px; border: 1.5px solid var(--gray-300); border-radius: var(--radius-md); font-size: 16px; font-family: inherit; line-height: 1.6; resize: vertical; background: white; color: var(--gray-800); outline: none; transition: border-color 0.2s; box-sizing: border-box; }
  .notes-textarea:focus { border-color: var(--blue); }
  .notes-textarea::placeholder { color: var(--gray-400); }
  .notes-status { font-size: 11px; color: var(--gray-400); margin-top: 6px; text-align: right; min-height: 16px; }
  .notes-status.saved { color: var(--green, #22c55e); }

  .categories-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px 16px;
  }

  /* Recommendations */
  .recommendations-section { padding: 0 16px 20px; }
  .recommendations-section h3 { font-size: 15px; color: var(--gray-700); margin: 0 0 10px; font-weight: 600; }
  .recommendations-strip { display: flex; flex-direction: column; gap: 10px; }
  .rec-cat-label { font-size: 10px; color: #E91E63; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }

  /* Collections */
  #navigator-section { padding: 8px 16px 32px; border-top: 1px solid var(--gray-200); margin-top: 8px; max-width: 100%; box-sizing: border-box; }
  .nav-section-title { font-size: 15px; font-weight: 700; color: #002060; margin-bottom: 6px; }
  .nav-section-text { font-size: 15px; color: #002060; line-height: 1.5; margin-bottom: 12px; }
  .nav-section-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-start; }
  .nav-section-buttons a { flex: 0 0 auto; }
  .nav-btn-img { width: 220px; height: auto; display: block; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); transition: transform 0.18s ease, box-shadow 0.18s ease; }
  .nav-section-buttons a:hover .nav-btn-img { transform: scale(1.04); box-shadow: 0 6px 18px rgba(0,0,0,0.22); }
  .playlists-section { padding: 0 16px 20px; }
  .playlists-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  .playlists-header h3 { font-size: 13px; font-weight: 700; color: var(--gray-700); text-transform: uppercase; letter-spacing: 0.5px; margin: 0; }
  .playlist-add-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--mint); background: none; color: var(--mint); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); }
  .playlist-add-btn:hover { background: var(--mint); color: white; }
  .playlist-form { display: flex; gap: 8px; margin-bottom: 12px; }
  .playlist-form input { flex: 1; padding: 10px 14px; border: 1.5px solid var(--gray-300); border-radius: var(--radius-md); font-size: 14px; outline: none; }
  .playlist-form input:focus { border-color: var(--blue); }
  .playlist-form button { padding: 10px 16px; border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; cursor: pointer; background: var(--blue); color: white; }
  .playlist-form button.cancel { background: var(--gray-200); color: var(--gray-700); padding: 10px 12px; }
  .playlists-grid { display: flex; flex-direction: column; gap: 10px; }
  .playlists-empty { font-size: 13px; color: var(--gray-400); line-height: 1.5; margin: 0; }
  .playlist-chip { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card-bg); border-radius: var(--radius-md); border: 1px solid var(--card-border); cursor: pointer; transition: var(--transition); box-shadow: var(--shadow-sm); }
  .playlist-chip:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }
  .playlist-chip .pl-icon { width: 40px; height: 40px; background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .playlist-chip .pl-icon svg { color: white; }
  .playlist-chip .pl-info { flex: 1; min-width: 0; }
  .playlist-chip .pl-name { font-size: 15px; font-weight: 600; color: var(--gray-900); display: block; }
  .playlist-chip .pl-count { font-size: 12px; color: var(--gray-400); }
  .playlist-chip .pl-delete { width: 28px; height: 28px; border: none; background: none; color: var(--gray-400); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: var(--transition); flex-shrink: 0; }
  .playlist-chip .pl-delete:hover { background: #fee2e2; color: #ef4444; }
  .playlist-chip .pl-rename { width: 28px; height: 28px; border: none; background: none; color: var(--gray-400); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: var(--transition); flex-shrink: 0; }
  .playlist-chip .pl-rename:hover { background: rgba(0,32,96,0.10); color: #002060; }

  /* Collection detail screen */
  .playlist-detail-header { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 12px; }
  .playlist-detail-header h3 { font-size: 18px; font-weight: 700; color: var(--gray-900); margin: 0; }
  .playlist-detail-empty { padding: 20px 16px; text-align: center; color: var(--gray-400); font-size: 14px; }

  /* Add to collection modal */
  .pl-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 1000; display: flex; align-items: center; justify-content: center; }
  .pl-modal { background: #DEE9F7; border-radius: var(--radius-lg); padding: 0; width: 90%; max-width: 340px; max-height: 70vh; overflow: hidden; display: flex; flex-direction: column; }
  .pl-modal h3 { font-size: 16px; font-weight: 700; margin: 0; padding: 16px 20px; background: #002060; color: white; font-family: 'Inter', sans-serif; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .pl-modal-body { padding: 12px 16px; overflow-y: auto; flex: 1; }
  .pl-modal-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
  .pl-modal-item:hover { background: rgba(0,32,96,0.08); }
  .pl-modal-item .pl-modal-check { width: 22px; height: 22px; border: 2px solid #002060; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: var(--transition); }
  .pl-modal-item.in-playlist .pl-modal-check { background: #002060; border-color: #002060; }
  .pl-modal-item .pl-modal-name { font-size: 14px; color: #002060; font-weight: 500; }
  .pl-modal-close { width: 100%; padding: 12px; border: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: #002060; color: white; font-size: 14px; font-weight: 600; cursor: pointer; transition: var(--transition); }
  .pl-modal-close:hover { background: #003080; }

  .category-card {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,32,96,0.15);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
  }

  .category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,32,96,0.35);
    background: linear-gradient(135deg, var(--blue-light) 0%, #1a3a6e 100%);
  }

  .category-card:hover .cat-icon {
    background: rgba(255,255,255,0.2);
    transform: scale(1.08);
    transition: var(--transition);
  }

  .category-card:hover .name {
    color: #5eead4;
  }

  .category-card:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0,32,96,0.4);
    transition: transform 0.1s ease;
  }

  .category-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at top right, rgba(150,0,0,0.2) 0%, transparent 70%);
    pointer-events: none;
  }

  .category-card .cat-icon {
    font-size: 36px;
    line-height: 1;
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 14px;
  }

  .category-card .cat-content {
    flex: 1;
    min-width: 0;
  }

  .category-card .cat-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
  }

  .category-card .num {
    font-size: 14px;
    font-weight: 800;
    color: #5eead4;
    letter-spacing: 0.6px;
    line-height: 1;
  }

  .category-card .name {
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.1px;
    line-height: 1.2;
  }

  .category-card .cat-desc {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .cat-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
  }
  .cat-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
  }
  .cat-progress-fill {
    height: 100%;
    background: var(--mint);
    border-radius: 2px;
    transition: width 0.3s ease;
  }
  .cat-progress-text {
    font-size: 11px;
    color: rgba(0,32,96,0.65);
    white-space: nowrap;
  }

  .category-card .cat-meta {
    font-size: 10px;
    color: #5eead4;
    margin-top: 4px;
    display: block;
    letter-spacing: 0.3px;
  }

  .category-card .cat-arrow {
    display: none;
  }

  /* Stats bar in welcome */
  .stats-bar {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.15);
    gap: 8px;
  }

  .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
  }

  .stat-num {
    font-size: 22px;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
  }

  .stat-label {
    font-size: 10px;
    color: rgba(255,255,255,0.65);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* CATEGORY DETAIL: Questions */
  .category-hero {
    padding: 24px 16px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    color: var(--white);
  }

  .category-hero .num-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
  }

  .category-hero h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
  }

  .category-hero p {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 6px;
  }

  .questions-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .questions-help-text {
    font-size: 14px;
    color: var(--gray-400);
    line-height: 1.5;
    margin: 0;
    padding: 0 16px 12px;
  }

  .favorites-list {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .favorites-list .section-header {
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
  }

  .favorites-list .section-header .count {
    font-size: inherit;
    color: var(--mint);
    font-weight: 700;
  }

  .favorites-list .question-card {
    align-items: center;
    padding: 10px 14px 10px 12px;
  }

  .favorites-list .question-card .text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-top: 0;
  }

  .favorites-list .question-card .chevron {
    margin-top: 0;
  }

  .favorites-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--gray-500);
  }

  .favorites-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
  }

  .favorites-empty p {
    font-size: 14px;
    line-height: 1.5;
  }

  .question-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 14px 16px 14px 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
  }

  .question-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--blue);
  }

  .question-card:active {
    transform: scale(0.99);
    background: var(--gray-50);
  }

  .question-card.disabled {
    opacity: 0.7;
    cursor: default;
    background: var(--gray-50);
  }

  .question-card.disabled::before {
    background: var(--gray-300);
  }

  .question-card.disabled:active {
    transform: none;
  }

  .question-card .num {
    font-size: 12px;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0;
  }
  .question-card.visited .num {
    background: #E91E63;
  }
  .question-card .check-icon {
    display: none;
  }

  .question-card.disabled .num {
    background: var(--gray-300);
    color: var(--white);
  }

  .question-card .text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: var(--gray-900);
    padding-top: 4px;
  }

  .question-card.disabled .text {
    color: var(--gray-500);
  }

  .question-card .badge-soon {
    font-size: 9px;
    padding: 3px 8px;
    background: var(--red);
    color: var(--white);
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 6px;
    display: inline-block;
    text-transform: uppercase;
  }

  .question-card .chevron {
    color: var(--blue);
    flex-shrink: 0;
    margin-top: 6px;
  }

  .question-card .star-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    padding: 0;
  }

  .question-card .star-btn:active {
    transform: scale(0.9);
  }

  .question-card .star-btn.favorited {
    color: #FFD700;
  }

  .question-card .star-btn.in-collection {
    color: #E91E63;
  }

  .question-card .star-btn svg {
    width: 20px;
    height: 20px;
  }

  /* QUESTION DETAIL */
  .question-hero {
    padding: 24px 20px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    color: var(--white);
  }

  .question-hero .meta {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.3px;
  }

  .question-hero h2 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.2px;
    line-height: 1.35;
  }

  .video-preview {
    margin: 16px 20px;
    border-radius: var(--radius-lg);
    background: #000;
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
  }

  .video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 50%, var(--red-dark) 100%);
  }
  .video-placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.5) 100%);
  }
  .video-preview.has-video .video-placeholder { display: none; }
  .video-preview:not(.has-video) iframe { display: none; }

  .play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  }

  .video-preview:active .play-btn {
    transform: scale(0.9);
  }

  .video-preview .label {
    position: absolute;
    bottom: 12px;
    left: 14px;
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    background: rgba(0,0,0,0.5);
    padding: 4px 10px;
    border-radius: 10px;
    z-index: 1;
  }

  .module-section {
    padding: 8px 20px 20px;
  }

  .module-section h3 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--gray-700);
    text-transform: uppercase;
    margin-bottom: 12px;
  }

  .module-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .module-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 18px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
    display: flex;
    gap: 14px;
    align-items: center;
  }

  .module-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
  }

  .module-card .avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 800;
    font-size: 22px;
  }

  .module-card.a .avatar {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    color: var(--white);
  }

  .module-card.b .avatar {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: var(--white);
  }

  .module-card .info {
    flex: 1;
    min-width: 0;
  }

  .module-card .title {
    font-size: 15px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 2px;
    letter-spacing: -0.2px;
  }

  .module-card .subtitle {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.35;
  }

  /* ---- MODULE TOGGLE ---- */
  .module-toggle {
    display: flex;
    gap: 6px;
    margin: 10px 16px 12px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 14px;
  }

  .module-toggle-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border: none;
    background: var(--gray-300);
    border-radius: 11px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
  }

  .module-toggle-btn .dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gray-400);
    color: var(--white);
    font-size: 12px;
    font-weight: 800;
  }

  .module-toggle-btn.active[data-mod="A"] {
    background: var(--red);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(150, 0, 0, 0.25);
  }
  .module-toggle-btn.active[data-mod="A"] .dot { background: rgba(255,255,255,0.25); }

  .module-toggle-btn.active[data-mod="B"] {
    background: var(--red);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(150, 0, 0, 0.25);
  }
  .module-toggle-btn.active[data-mod="B"] .dot { background: rgba(255,255,255,0.25); }

  .module-toggle-btn:hover:not(.active) {
    background: var(--gray-400);
  }

  /* ---- BULK BAR ---- */
  .bulk-bar {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
  }

  .bulk-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 10px;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: var(--white);
  }

  .bulk-btn.bulk-module {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  }

  .section-divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 24px 20px;
  }
  .format-hint {
    margin: 0 20px 16px;
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.5;
  }

  .bulk-btn.bulk-question {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  }

  .bulk-btn svg { flex-shrink: 0; }

  /* ---- FLAT EXERCISES LIST ---- */
  .flat-exercises {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px 20px;
  }

  .flat-ex-card {
    background: var(--card-bg);
    border-radius: 14px;
    border: 1px solid var(--card-border);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    cursor: default;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .flat-ex-head {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
  }

  .flat-ex-chevron {
    color: var(--gray-500);
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  .flat-ex-card.open .flat-ex-chevron {
    transform: rotate(180deg);
  }

  .flat-ex-info {
    font-size: 13px;
    line-height: 1.5;
    color: var(--gray-700);
    padding: 4px 4px 2px 46px;
  }

  .flat-ex-info em {
    color: var(--gray-500);
    font-style: italic;
  }

  .flat-ex-head .num {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--white);
  }

  .flat-ex-card.mod-a .num {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  }

  .flat-ex-card.mod-b .num {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  }

  .flat-ex-head .name {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: var(--blue);
    letter-spacing: -0.2px;
    line-height: 1.3;
  }

  .flat-ex-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .format-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    font-size: 11px;
    font-weight: 700;
    color: var(--blue);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  .format-chip:hover {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
    transform: translateY(-1px);
  }

  .format-chip.chip-all {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
    margin-left: auto;
  }

  .format-chip.chip-all:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
  }

  .flat-ex-card.mod-b .format-chip {
    color: var(--red);
  }

  .flat-ex-card.mod-b .format-chip:hover {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
  }

  .flat-ex-card.mod-b .format-chip.chip-all {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
  }

  .flat-ex-card.mod-b .format-chip.chip-all:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
  }

  .format-chip svg { flex-shrink: 0; }

  /* Toast for download feedback */
  .toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 32, 96, 0.95);
    color: var(--white);
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 9999;
    max-width: 80%;
    text-align: center;
  }

  .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  /* EXERCISES LIST */
  .exercises-list {
    padding: 16px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .exercise-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
  }

  .exercise-card:active {
    transform: scale(0.99);
  }

  .exercise-card .num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
  }

  .exercise-card.module-a .num {
    background: rgba(0,32,96,0.08);
    color: var(--blue);
  }

  .exercise-card.module-b .num {
    background: rgba(0,32,96,0.08);
    color: var(--blue);
  }

  .exercise-card .name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
    line-height: 1.3;
  }

  .exercise-card .chevron {
    color: var(--gray-400);
    flex-shrink: 0;
  }

  /* FORMAT LIST */
  .formats-list {
    padding: 16px 16px 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .format-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    min-height: 140px;
    justify-content: center;
  }

  .format-card:active {
    transform: scale(0.97);
  }

  .format-card .icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .format-card.docx .icon { background: rgba(0,120,212,0.12); color: #0078d4; }
  .format-card.pptx .icon { background: rgba(212,97,38,0.12); color: #d46126; }
  .format-card.video .icon { background: rgba(150,0,0,0.12); color: var(--red); }
  .format-card.podcast .icon { background: rgba(0,32,96,0.12); color: var(--blue); }

  .format-card .title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
  }

  .format-card .desc {
    font-size: 11px;
    color: var(--gray-500);
    line-height: 1.3;
  }

  /* CONTENT VIEWER */
  .viewer-hero {
    padding: 20px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    color: var(--white);
  }

  .viewer-hero .type {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
  }

  .viewer-hero h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.3;
  }

  .player-container {
    padding: 16px 20px;
  }

  .video-player {
    background: #000;
    border-radius: var(--radius-lg);
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 50%, var(--red-dark) 100%);
  }

  .video-player::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.5) 100%);
  }

  .video-player .controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
  }

  .video-player .progress {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
  }

  .video-player .progress-fill {
    width: 35%;
    height: 100%;
    background: var(--red);
    border-radius: 2px;
  }

  .video-player .time {
    font-size: 11px;
    font-weight: 600;
  }

  .audio-player {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
  }

  .audio-artwork {
    width: 100%;
    aspect-ratio: 1;
    max-width: 240px;
    margin: 0 auto 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--blue) 0%, var(--red) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: 0 12px 32px rgba(0,32,96,0.25);
  }

  .audio-info {
    text-align: center;
    margin-bottom: 20px;
  }

  .audio-info h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
  }

  .audio-info p {
    font-size: 13px;
    color: var(--gray-500);
  }

  .audio-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
  }

  .audio-progress .track {
    flex: 1;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
  }

  .audio-progress .fill {
    width: 28%;
    height: 100%;
    background: var(--blue);
    border-radius: 2px;
  }

  .audio-progress .time {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 600;
    min-width: 32px;
  }

  .audio-controls {
    display: flex;
    justify-content: center;
    gap: 28px;
    align-items: center;
  }

  .ctrl-btn {
    background: none;
    border: none;
    color: var(--gray-700);
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
  }

  .ctrl-btn:active {
    transform: scale(0.9);
  }

  .ctrl-btn.play {
    width: 56px;
    height: 56px;
    background: var(--blue);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .ctrl-btn.play:active {
    background: var(--blue-dark);
  }

  .doc-preview {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
  }

  .doc-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .doc-icon.docx { background: rgba(0,120,212,0.12); color: #0078d4; }
  .doc-icon.pptx { background: rgba(212,97,38,0.12); color: #d46126; }

  .doc-preview h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
  }

  .doc-preview p {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 20px;
  }

  .btn-download {
    background: var(--blue);
    color: var(--white);
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .btn-download:active {
    background: var(--blue-dark);
    transform: scale(0.98);
  }

  .viewer-description {
    padding: 0 20px 20px;
  }

  .viewer-description h4 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--gray-700);
    text-transform: uppercase;
    margin-bottom: 10px;
    margin-top: 8px;
  }

  .viewer-description p {
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.5;
  }

  /* Bottom tab bar */
  .tab-bar {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 8px 0 calc(8px + var(--safe-bottom));
    display: flex;
    justify-content: space-around;
    flex-shrink: 0;
  }

  .tab-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--gray-500);
    transition: var(--transition);
    min-width: 56px;
  }

  .tab-btn.active {
    color: var(--blue);
  }

  .tab-btn span {
    font-size: 10px;
    font-weight: 600;
  }

  /* Modal */
  .modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }

  .modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  .modal {
    background: var(--white);
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    padding: 16px 20px calc(24px + var(--safe-bottom));
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .modal-overlay.active .modal {
    transform: translateY(0);
  }

  .modal-handle {
    width: 40px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    margin: 0 auto 16px;
  }

  .modal h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--blue);
  }

  .modal-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .modal-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
  }

  .modal-option:active {
    background: var(--gray-100);
  }

  .modal-option.selected {
    border-color: var(--blue);
    background: rgba(0,32,96,0.04);
  }

  .modal-option .flag {
    font-size: 24px;
    width: 32px;
    text-align: center;
  }

  .modal-option .text {
    flex: 1;
    font-weight: 600;
    color: var(--gray-900);
  }

  .modal-option .check {
    color: var(--blue);
    opacity: 0;
  }

  .modal-option.selected .check {
    opacity: 1;
  }

  /* Info banner */
  .info-banner {
    margin: 48px 20px 24px;
    padding: 12px 14px;
    background: rgba(0,32,96,0.06);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--blue);
    line-height: 1.4;
    display: flex;
    gap: 10px;
    align-items: flex-start;
  }

  .info-banner svg {
    flex-shrink: 0;
    margin-top: 1px;
  }

  /* Empty / No results */
  .empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--gray-500);
  }

  .empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
  }

  .empty-state p {
    font-size: 14px;
  }

  /* SEARCH SCREEN */
  .search-hero {
    padding: 14px 16px 10px;
    background: var(--blue);
    margin-top: 12px;
  }

  .search-main {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .search-main input {
    flex: 1;
    background: rgba(255,255,255,0.15);
    border: none;
    outline: none;
    color: var(--white);
    font-size: 15px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
  }

  .search-main input::placeholder {
    color: rgba(0,32,96,0.55);
  }

  .search-main svg {
    color: rgba(255,255,255,0.6);
    flex-shrink: 0;
  }

  .search-clear {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .filter-block {
    padding: 14px 18px 6px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
  }

  .filter-block:last-of-type {
    border-bottom: none;
  }

  .filter-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-700);
  }

  .filter-clear {
    background: none;
    border: none;
    color: var(--red);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  .chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 10px;
  }

  .chip {
    padding: 7px 14px;
    border-radius: 18px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
  }

  .chip:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
  }

  .chip.active:hover {
    opacity: 0.9;
  }

  .chip:active {
    transform: scale(0.95);
  }

  .chip.active {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
  }

  .chip.chip-format.active {
    background: var(--red);
    border-color: var(--red);
  }

  .search-results-header {
    padding: 12px 18px;
    background: var(--gray-100);
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
  }

  .search-results {
    padding: 8px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .search-result {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 12px 14px 12px 12px;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }

  .search-result::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--blue);
  }

  .search-result:active {
    background: var(--gray-50);
    transform: scale(0.99);
  }

  .search-result .badge {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: var(--blue);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
  }

  .search-result .info {
    flex: 1;
    min-width: 0;
  }

  .search-result .cat {
    font-size: 10px;
    color: #E91E63;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 2px;
  }

  .search-result .text {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-900);
    line-height: 1.3;
    margin-bottom: 4px;
  }

  .search-result .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .search-result .tags span {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: 4px;
    font-weight: 600;
  }

  .search-result.disabled {
    opacity: 0.55;
  }

  /* Utility */
  .hidden { display: none !important; }

  /* Scrollbar hide */
  .content { scrollbar-width: none; }

  /* ============================
     RESPONSIVE DESIGN
     ============================ */

  /* --- Tablet (≥ 600px) --- */
  @media (min-width: 600px) {
  
  .categories-grid {
      gap: 12px;
      padding: 0 24px 24px;
    }
    .category-card {
      padding: 18px 20px;
    }
    .category-card .cat-icon {
      font-size: 36px;
      width: 56px;
      height: 56px;
    }
    .category-card .num {
      font-size: 16px;
    }
    .category-card .name {
      font-size: 16px;
    }
    .category-card .cat-desc {
      font-size: 13px;
    }
    .stat-num {
      font-size: 28px;
    }
    .stat-label {
      font-size: 11px;
    }
    .nm-header {
      padding: 0 28px;
      min-height: 56px;
    }
    .nm-header h1 {
      font-size: 25px;
    }
    .breadcrumb-bar {
      padding: 8px 28px;
    }
    .home-spacer {
      height: 61px !important;
    }
    .welcome {
      padding: 20px 24px 12px;
    }
    .welcome h2 {
      font-size: 20px;
    }
    .welcome p {
      font-size: 14px;
    }
    .content {
      padding-bottom: calc(24px + var(--safe-bottom));
    }
    .section-header {
      padding: 20px 24px 10px;
    }
    .section-header h3 {
      font-size: 14px;
    }
    .question-hero {
      padding: 28px 28px;
    }
    .question-hero h2 {
      font-size: 19px;
    }
    .question-card {
      padding: 16px 18px 16px 16px;
    }
    .questions-help-text {
      padding: 0 24px 16px;
    }
    .question-card .text {
      font-size: 15px;
    }
    .questions-list {
      padding: 0 24px 20px;
      gap: 10px;
    }
    .exercises-list {
      padding: 20px 24px 24px;
      gap: 10px;
    }
    .exercise-card {
      padding: 18px;
    }
    .exercise-card .name {
      font-size: 15px;
    }
    .login-screen {
      padding: 60px 48px;
    }
    .login-screen .logo img {
      max-width: 220px;
    }
    .tab-bar {
      padding: 10px 0 calc(10px + var(--safe-bottom));
    }
    .tab-btn span {
      font-size: 11px;
    }
    /* Info banner */
    .info-banner {
      margin: 48px 24px 24px;
      font-size: 13px;
    }
    /* Video */
    .video-preview {
      margin: 16px 24px;
    }
    /* Module cards */
    .module-cards {
      gap: 14px;
    }
    .module-card {
      padding: 20px;
    }
  }

  /* --- Tablet landscape / small desktop (≥ 900px) --- */
  @media (min-width: 900px) {

  .recently-viewed { padding: 0 32px 28px; }
  .notes-section { padding: 0 32px 20px; }
  .recommendations-section { padding: 0 32px 20px; }
  .playlists-section { padding: 0 32px 20px; }
  #navigator-section { padding-left: 32px; padding-right: 32px; }
  .recently-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; overflow: hidden; }
  .recommendations-strip { display: flex; flex-direction: column; gap: 10px; }

  .categories-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 14px;
      padding: 0 32px 28px;
    }
    .category-card {
      padding: 20px;
    }
    .category-card .cat-icon {
      font-size: 42px;
      width: 80px;
      height: 80px;
      border-radius: 16px;
    }
    .category-card .num {
      font-size: 17px;
    }
    .category-card .name {
      font-size: 17px;
    }
    .category-card .cat-desc {
      font-size: 13px;
    }
    .stat-num {
      font-size: 32px;
    }
    .stat-label {
      font-size: 12px;
    }
    .nm-header {
      min-height: 132px;
      padding: 0 20px;
      justify-content: center;
      max-width: 100%;
    }
.nm-header h1 {
      font-size: 27px;
      letter-spacing: -0.2px;
    }
    .header-row-top {
      display: contents;
    }
    .header-inner {
      max-width: 1200px;
      margin: 0 auto;
    }
    .header-search {
      flex: 1;
      min-width: 0;
      max-width: 400px;
      padding: 10px 16px;
      box-sizing: border-box;
    }
    .breadcrumb-bar {
      padding: 8px 32px;
    }
    .breadcrumb-path {
      max-width: none;
      margin: 0;
      width: auto;
    }
    .welcome {
      padding: 28px 32px 16px;
    }
    .welcome h2 {
      font-size: 22px;
    }
    .welcome p {
      font-size: 15px;
      margin-top: 4px;
    }
    .section-header {
      padding: 24px 32px 12px;
    }
    .section-header h3 {
      font-size: 15px;
      letter-spacing: 0.8px;
    }
    .question-hero {
      padding: 36px 0;
    }
    .question-hero .meta,
    .question-hero h2 {
      max-width: 960px;
      margin-left: auto;
      margin-right: auto;
      padding-left: 36px;
      padding-right: 36px;
    }
    .question-hero .meta {
      font-size: 13px;
      margin-bottom: 10px;
    }
    .question-hero h2 {
      font-size: 21px;
    }
    /* Category-hero: use padding to align content with centered blocks */
    .category-hero {
      padding: 36px 32px;
    }
    .category-hero h2 {
      font-size: 28px;
    }
    .category-hero p {
      font-size: 15px;
      margin-top: 6px;
    }
    /* Button font sizes for desktop */
    .module-toggle-btn {
      font-size: 15px;
      padding: 12px 14px;
    }
    .bulk-btn {
      font-size: 14px;
      padding: 13px 12px;
    }
    .question-card .text {
      font-size: 16px;
    }
    .questions-help-text {
      padding: 0 32px 20px;
    }
    .questions-list {
      padding: 0 32px 24px;
      gap: 12px;
    }
    .exercises-list {
      padding: 24px 32px 28px;
      gap: 12px;
    }
    .exercise-card .name {
      font-size: 16px;
    }
    .login-screen {
      padding: 80px 80px;
      align-items: center;
    }
    .login-form {
      max-width: 400px;
      width: 100%;
    }
    .login-screen .logo {
      margin-bottom: 40px;
    }
    .info-banner {
      margin: 48px 32px 24px;
      padding: 14px 18px;
      font-size: 14px;
    }
    /* Video */
    .video-preview {
      margin: 20px 32px;
    }
    /* Module cards side by side on wider screens */
    .module-cards {
      flex-direction: row;
      gap: 16px;
    }
    .module-card {
      flex: 1;
      padding: 22px;
    }
    /* Center content blocks inside screens */
    .welcome,
    .section-header,
    .categories-grid,
    .questions-list,
    .exercises-list,
    .module-cards,
    .info-banner,
    .video-preview,
    .module-toggle,
    .bulk-bar,
    .format-hint,
    .flat-exercises,
    .section-divider,
    .search-hero,
    .filter-block,
    .search-results-header,
    .search-results {
      max-width: 960px;
      margin-left: auto;
      margin-right: auto;
    }
    /* Search screen desktop refinements */
    .search-hero {
      padding: 20px 24px 16px;
      border-radius: 0 0 var(--radius-md) var(--radius-md);
    }
    .search-main input {
      font-size: 16px;
      padding: 12px 16px;
    }
    .filter-block {
      padding: 16px 24px 8px;
    }
    .filter-row-head {
      font-size: 12px;
      margin-bottom: 10px;
    }
    .chip {
      padding: 8px 16px;
      font-size: 14px;
      border-radius: 20px;
    }
    .chip-row {
      gap: 8px;
      padding-bottom: 12px;
    }
    .search-results-header {
      padding: 14px 24px;
      font-size: 12px;
    }
    .search-results {
      padding: 12px 16px 24px;
      gap: 10px;
    }
    /* Padding for question-detail elements at desktop */
    .module-toggle {
      margin-top: 10px;
      margin-bottom: 12px;
      padding: 4px;
    }
    .bulk-bar {
      padding: 0 0 12px;
    }
    .format-hint {
      margin-top: 0;
      margin-bottom: 16px;
    }
    .flat-exercises {
      padding: 0 0 20px;
    }
    /* Larger font for exercise descriptions on desktop */
    .flat-ex-info {
      font-size: 15px;
    }
    .flat-ex-head .name {
      font-size: 16px;
    }
    .flat-ex-head .num {
      width: 38px;
      height: 38px;
      font-size: 15px;
    }
    .format-hint {
      font-size: 14px;
    }
    /* Welcome as centered card with rounded corners on desktop */
    .welcome {
      border-radius: 0 0 var(--radius-xl) var(--radius-xl);
      padding: 28px 36px 20px;
    }
  }

  /* --- Desktop (≥ 1200px) --- */
  @media (min-width: 1200px) {
    .breadcrumb-bar {
      padding-left: max(32px, calc((100% - 960px) / 2));
      padding-right: max(32px, calc((100% - 960px) / 2));
    }
  .categories-grid {
      grid-template-columns: repeat(3, 1fr);
      gap: 18px;
    }
    .category-card {
      padding: 22px 24px;
      border-radius: var(--radius-xl);
    }
    .category-card .cat-icon {
      font-size: 40px;
      width: 64px;
      height: 64px;
    }
    .category-card .num {
      font-size: 18px;
    }
    .category-card .name {
      font-size: 18px;
    }
    .category-card .cat-desc {
      font-size: 14px;
    }
    .category-card .cat-meta {
      font-size: 11px;
    }
    .nm-header {
      min-height: 132px;
      padding: 0 24px;
    }
    .nm-header h1 {
      font-size: 29px;
    }
    .header-search {
      max-width: 450px;
    }
    .welcome {
      padding: 32px 0 20px;
    }
    .welcome h2 {
      font-size: 24px;
    }
    .welcome p {
      font-size: 16px;
      margin-top: 6px;
    }
    .section-header {
      padding: 28px 0 14px;
    }
    .section-header h3 {
      font-size: 15px;
    }
    .question-hero {
      padding: 40px 0;
    }
    .question-hero .meta,
    .question-hero h2 {
      max-width: 1060px;
      padding-left: 40px;
      padding-right: 40px;
    }
    .question-hero .meta {
      font-size: 14px;
      margin-bottom: 12px;
    }
    .question-hero h2 {
      font-size: 24px;
      line-height: 1.4;
    }
    .category-hero {
      padding: 40px max(32px, calc((100% - 960px) / 2));
    }
    .category-hero h2 {
      font-size: 30px;
    }
    .category-hero p {
      font-size: 16px;
    }
    .module-toggle-btn {
      font-size: 16px;
      padding: 13px 16px;
    }
    .bulk-btn {
      font-size: 15px;
      padding: 14px 14px;
    }
    .flat-ex-info {
      font-size: 16px;
    }
    .flat-ex-head .name {
      font-size: 17px;
    }
    .flat-ex-head .num {
      width: 40px;
      height: 40px;
      font-size: 16px;
    }
    .format-hint {
      font-size: 15px;
    }
    .welcome,
    .section-header,
    .categories-grid,
    .questions-list,
    .exercises-list,
    .module-cards,
    .info-banner,
    .video-preview,
    .module-toggle,
    .bulk-bar,
    .format-hint,
    .flat-exercises,
    .search-hero,
    .filter-block,
    .search-results-header,
    .search-results {
      max-width: 1060px;
    }
    .welcome {
      padding: 32px 40px 24px;
    }
    .login-screen {
      justify-content: center;
    }
    .login-form {
      max-width: 440px;
    }
    .tab-bar {
      justify-content: center;
      gap: 12px;
      padding: 12px 0 calc(12px + var(--safe-bottom));
      border-top: 1px solid var(--gray-200);
    }
    .tab-btn {
      min-width: 90px;
      padding: 8px 24px;
    }
    .tab-btn span {
      font-size: 12px;
    }
    /* Questions as 2-column grid on desktop - column-first order */
    .questions-list {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      grid-template-rows: repeat(5, auto);
      grid-auto-flow: column;
      gap: 14px;
    }
    /* Favorites: single column, no grid */
    .favorites-list .questions-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      width: 100%;
    }
    .question-card {
      padding: 18px 20px 18px 18px;
      border-radius: var(--radius-lg);
    }
    /* Exercises as 2-column grid */
    .exercises-list {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 14px;
    }
    .exercise-card {
      padding: 20px;
      border-radius: var(--radius-lg);
    }
    /* Video max-width */
    .video-preview {
      margin: 28px auto;
      max-width: 720px;
      border-radius: var(--radius-xl);
    }
    /* Module cards */
    .module-card {
      padding: 24px;
      border-radius: var(--radius-xl);
    }
    .module-card .avatar {
      width: 56px;
      height: 56px;
    }
    .info-banner {
      border-radius: var(--radius-lg);
      padding: 16px 20px;
      font-size: 15px;
      margin-top: 48px;
      margin-bottom: 24px;
    }
  }

  /* --- Large desktop (≥ 1600px) — keep 6 columns, just wider max --- */
  @media (min-width: 1600px) {
    .welcome,
    .section-header,
    .categories-grid,
    .questions-list,
    .exercises-list,
    .module-cards,
    .info-banner,
    .video-preview,
    .module-toggle,
    .bulk-bar,
    .format-hint,
    .flat-exercises,
    .section-divider,
    .search-hero,
    .filter-block,
    .search-results-header,
    .search-results,
    .recently-viewed,
    .notes-section,
    .recommendations-section,
    .playlists-section,
    .playlist-detail-header,
    .questions-help-text,
    #navigator-section {
      max-width: 1200px;
      margin-left: auto;
      margin-right: auto;
    }
    .info-banner {
      margin-top: 48px;
      margin-bottom: 24px;
    }
    .nm-header {
      padding: 0 28px;
    }
    .header-search {
      max-width: 500px;
    }
    .breadcrumb-bar {
      padding-left: max(32px, calc((100% - 1200px) / 2));
      padding-right: max(32px, calc((100% - 1200px) / 2));
    }
  }



/* ┌────────────────────────────────────────────────────────────────┐
   │ MEDIATHEK-SPEZIFISCH — was nicht in alle 4 Apps gehört         │
   └────────────────────────────────────────────────────────────────┘
*/
/* ============ MEDIATHEK-OVERRIDES ============ */
  /*
   * ────────────────────────────────────────────────────────────────
   * NM24 DESIGN-TOKENS — NeuroMedia24 Mediathek
   * Schriftart: Inter (400 · 500 · 600 · 700)
   *
   * FARBEN
   *   Primär          #002060                  Überschriften, Icons, Labels
   *   Sekundär        rgba(0,32,96,0.65)        Untertitel, Beschreibungen
   *   Gedimmt         rgba(0,32,96,0.55)        Timestamps, Hilfstext
   *   Rahmen          rgba(0,32,96,0.12)        Alle Karten-Rahmen
   *   Schatten        0 2px 8px rgba(0,32,96,0.10)
   *   Aktiv/Mint      #00E6B3                  Icons aktiv (Collection, Notiz)
   *   Gold            #ffd700                  Favorit-Stern aktiv
   *   Fehler          #960000
   *   Auf Dunkel      #ffffff
   *
   * KARTEN-HINTERGRÜNDE
   *   Normal          #E0E9F6
   *   Hover           #D3DEEC
   *   Studio-Recs     #D7E4F4  /  Hover #C8D5E8
   *   Container       #ECF2FB
   *   Hero / Playlist #D7E4F4
   *
   * SCHRIFTGROSSEN-HIERARCHIE
   *   Headline L      27px / 700   Große Seitenüberschriften
   *   Headline M      24px / 700   Hero-Titel (Kategorie, Frage, Playlist)
   *   Headline S      20px / 700   Abschnittstitel
   *   Body L          15px / 600   Buttons, wichtige Fließtexte
   *   Body M          14px / 400   Navigation, Haupttext
   *   Body S          13px / 400   Karten-Text, Akkordeon-Inhalt
   *   Label           12px / 600   Untertitel, Tabellen-Captions
   *   Caption         11px / 500   Kleine Labels, Rechtszeile
   *   Micro           9–10px / 700 Badges, Kategorie-Pillen
   *
   * LETTER-SPACING
   *   Große Headlines  -0.2px bis -0.3px   (kompakter)
   *   Fließtext         0
   *   UPPERCASE Labels  0.5px bis 1.4px
   *
   * ANIMATION
   *   Akkordeon         1.5s ease-in-out   max-height 4500px
   *   Note-Cards        0.5s ease-in-out   max-height 4500px
   * ────────────────────────────────────────────────────────────────
   */
  /* Alte Transfer-Studio-Elemente ausblenden */
  #screen-question .video-preview,
  #screen-question #moduleToggle,
  #screen-question .bulk-bar,
  #screen-question #moduleDescText,
  #screen-question #flatExercisesList,
  #screen-question hr.section-divider {
    display: none !important;
  }
  /* Neuer Thema-Block */
  .topic-desc {
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    padding: 0 16px;
    max-width: 900px;
    margin: 20px auto;
  }
  /* HTML-formatierte Beschreibungen (neue Word-Dok-Inhalte) */
  .topic-desc.html-desc {
    color: #002060;
  }
  .topic-desc.html-desc strong {
    display: block;
    font-weight: 700;
    font-size: 16px;
    color: #002060;
    margin-top: 22px;
    margin-bottom: 5px;
  }
  .topic-desc.html-desc strong:first-child {
    margin-top: 0;
  }
  .topic-desc.html-desc p {
    color: #002060;
    margin: 0 0 10px 0;
    text-align: justify;
  }
  .topic-desc h3 {
    color: var(--accent-mint);
    font-size: 17px;
    font-weight: 700;
    margin: 20px 0 8px 0;
  }
  .topic-desc p {
    margin: 0 0 14px 0;
  }
  .topic-desc p.sec-head,
  .topic-desc-placeholder p.sec-head {
    margin-top: 28px;
  }
  .topic-desc p.sec-head:first-child,
  .topic-desc-placeholder p.sec-head:first-child {
    margin-top: 0;
  }
  .topic-formats-table {
    width: calc(100% - 32px);
    max-width: 900px;
    margin: 24px auto 16px auto;
    border-collapse: collapse;
    font-size: 15px;
    color: var(--text);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
  .topic-formats-table caption {
    text-align: left;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-mint);
    padding: 0 0 10px 4px;
    caption-side: top;
  }
  .topic-formats-table th,
  .topic-formats-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
  }
  .topic-formats-table th {
    background: rgba(94,234,212,0.08);
    font-weight: 600;
    font-size: 15px;
  }
  .topic-formats-table tr:last-child td { border-bottom: none; }
  .topic-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 32px);
    max-width: 868px;
    margin: 24px auto;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 32, 96, 0.25);
    transition: transform 0.15s, box-shadow 0.15s;
  }
  .topic-open-btn svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
  }
  .topic-open-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
  }
  .topic-open-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }


/* ===== Block #2: MEDIATHEK_WELCOME_STYLE ===== */
  /* ============ MEDIATHEK: Formats-Bar (statt Zahlen-Stats) ============ */
  .formats-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: flex-start;
    gap: 12px 8px;
    padding: 16px 8px 4px 8px;
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 16px;
  }
  .format-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
    color: rgba(255,255,255,1);
    text-align: center;
    padding: 12px 6px 10px 6px;
    border-radius: 10px;
    background: rgba(94, 234, 212, 0.12);
    border: 1px solid rgba(94, 234, 212, 0.3);
    cursor: default;
  }
  .format-chip svg {
    color: var(--accent-mint, #5eead4);
    opacity: 1;
  }
  .format-chip .fmt-label {
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
  }
  @media (max-width: 480px) {
    /* 4+3 Layout: 4 Chips in Reihe 1, 3 in Reihe 2 — genug Platz für Text */
    .formats-bar {
      gap: 8px 6px;
      justify-content: center;
    }
    .format-chip {
      flex: 0 0 calc(25% - 5px);
      min-width: 0;
      padding: 10px 4px 8px;
      gap: 6px;
    }
    .format-chip svg { width: 24px !important; height: 24px !important; }
    .format-chip .fmt-label {
      font-size: 10px;
      white-space: normal;
      word-break: break-word;
      line-height: 1.2;
    }
    .topic-title { font-size: 12px !important; }
    .topic-subtitle { font-size: 12px !important; }
    .topic-desc { font-size: 12px !important; }
    .topic-desc-placeholder { font-size: 12px !important; }
    .topic-formats-table,
    .topic-formats-table th,
    .topic-formats-table td,
    .topic-formats-table caption { font-size: 12px !important; }
    .viewer-description h4 { font-size: 12px !important; }
    .viewer-description p { font-size: 12px !important; }
  }


/* ===== Block #3: MEDIATHEK_ACCORDION_STYLE ===== */
  /* ============ MEDIATHEK: Accordion Themen-Liste ============ */
  #questionsList {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
  }
  .topic-accordion {
    background: var(--bg-card, rgba(255,255,255,0.04));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md, 8px);
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
  }
  .topic-accordion.open {
    border-color: rgba(94, 234, 212, 0.35);
    background: rgba(255,255,255,0.06);
  }
  .topic-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    gap: 12px;
    transition: background 0.15s;
  }
  .topic-head:hover { background: rgba(255,255,255,0.04); }
  .topic-accordion.open .topic-head {
    background: rgba(94,234,212,0.2);
    border-radius: 8px 8px 0 0;
    transition: background 0.2s;
  }
  .topic-head-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-width: 0;
  }
  .topic-num {
    display: none;
  }
  .topic-title {
    color: var(--text, #fff);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topic-subtitle {
    display: block;
    font-size: 15px;
    font-weight: 400;
    opacity: 0.65;
    line-height: 1.3;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topic-head-right {
    display: flex;
    align-items: center;
    align-self: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .topic-head-right .star-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--gray-400, #999);
    transition: color 0.15s;
  }
  .topic-head-right .star-btn:hover { color: #f5c518; }
  .topic-head-right .star-btn.favorited { color: #f5c518; }
  .topic-head-right .chev {
    color: rgba(255,255,255,0.5);
    transition: transform 0.2s;
  }
  .topic-accordion.open .chev { transform: rotate(180deg); color: var(--accent-mint, #5eead4); }
  .topic-accordion.visited .topic-num {
    display: none;
  }
  .topic-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 2s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .topic-accordion.open .topic-body {
    grid-template-rows: 1fr;
  }
  .topic-body > * {
    overflow: hidden;
    min-height: 0;
  }
  .topic-body-inner {
    padding: 8px 16px 20px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .topic-desc-placeholder {
    font-size: 15px;
    opacity: 0.85;
    font-style: normal;
    margin: 12px 0 18px 0;
    line-height: 1.6;
    text-align: justify;
  }
  .topic-desc-placeholder p {
    margin: 0 0 14px 0;
  }
  .topic-formats-table {
    width: 100%;
    max-width: none;
    border-collapse: collapse;
    font-size: 15px;
    color: var(--text, #fff);
    margin: 0 0 16px 0;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
    overflow: hidden;
  }
  .topic-formats-table caption {
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-mint, #5eead4);
    padding: 0 0 8px 4px;
    caption-side: top;
  }
  .topic-formats-table th,
  .topic-formats-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 15px;
  }
  .topic-formats-table th {
    background: rgba(94,234,212,0.06);
    font-weight: 600;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .topic-formats-table tr:last-child td { border-bottom: none; }
  .topic-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md, 8px);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 102, 255, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
  }
  .topic-open-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.45);
  }
  .topic-open-btn:disabled { opacity: 0.4; cursor: not-allowed; }

  /* Mobile font overrides — must be in this style block to win cascade */
  @media (max-width: 480px) {
    .topic-title { font-size: 12px !important; }
    .topic-subtitle { font-size: 12px !important; }
    .topic-desc-placeholder { font-size: 12px !important; }
    .topic-formats-table,
    .topic-formats-table th,
    .topic-formats-table td,
    .topic-formats-table caption { font-size: 12px !important; }
    .viewer-description h4 { font-size: 12px !important; }
    .viewer-description p { font-size: 12px !important; }
  }
/* Footer ausblenden (Tab-Bar ist die Navigation) */
.nm-footer, #appFooter { display: none !important; }


/* ===== Block #4: MEDIATHEK_DARKMODE_FIX ===== */
  /* ============ MEDIATHEK: Light Mode ============ */
  body {
    
    color: #1a1a2e !important;
  }
  .app, .phone, .content {
    
  }
  /* Home-Spacer: kein grauer Streifen oben */
  .home-spacer {
    
  }

  /* Welcome block: abgerundete Karte
     KEINE margin-Überschreibung → Desktop-Zentrierung (auto) bleibt erhalten */
  .welcome {
    
    
    
    padding: 20px 24px 14px !important;
  }
  .welcome h2, .welcome p, .welcome strong {
    
  }

  /* Logout-Button im Header */
  .logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #002060;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
  }
  .logout-btn:hover {
    color: #001640;
    background: rgba(0,32,96,0.12);
  }

  /* Info banner */
  .info-banner, .info-row {
    
    
    border-color: rgba(0,32,96,0.30) !important;
  }

  /* Accordion Zeilen */
  .topic-accordion {
    background: #E0E9F6 !important;
    border: 1px solid rgba(0,32,96,0.12) !important;
    box-shadow: none !important;
  }
  .topic-accordion.open {
    border-color: rgba(0,32,96,0.30) !important;
    background: #CAD2E2 !important;
  }
  .topic-accordion.open .topic-head {
    background: #002060 !important;
    border-radius: 8px 8px 0 0 !important;
  }
  .topic-accordion.open .topic-head .topic-title,
  .topic-accordion.open .topic-head .topic-subtitle {
    color: #ffffff !important;
    opacity: 1 !important;
  }
  .topic-accordion.open .topic-head .chev,
  .topic-accordion.open .topic-head .star-btn,
  .topic-accordion.open .topic-head .collect-btn,
  .topic-accordion.open .topic-head .note-btn {
    color: rgba(255,255,255,0.8) !important;
  }
  .topic-accordion.open .topic-head .star-btn.favorited { color: #ffd700 !important; }
  .topic-accordion.open .topic-head .collect-btn.in-collection {  }
  .topic-accordion.open .topic-head .note-btn.has-note {  }
  .topic-accordion.open .topic-head:hover {
    background: #002060 !important;
  }
  .topic-head:hover {
    background: rgba(0,0,0,0.03) !important;
  }
  .topic-title {
    color: #1a1a2e !important;
  }
  .topic-subtitle {
    color: #1a1a2e !important;
    opacity: 0.55;
  }
  .topic-body-inner {
    border-top: 1px solid rgba(0,0,0,0.07) !important;
  }
  .topic-desc-placeholder {
    color: #002060 !important;
  }
  .topic-formats-table {
    color: #002060 !important;
    background: rgba(0,0,0,0.02) !important;
  }
  .topic-formats-table th,
  .topic-formats-table td {
    border-bottom: 1px solid rgba(0,0,0,0.07) !important;
    color: #002060 !important;
  }
  .topic-formats-table th {
    background: rgba(0,32,96,0.06) !important;
    color: #002060 !important;
  }
  .topic-formats-table caption {
    color: #002060 !important;
  }

  /* Format-Tabelle im Topic-Detail-Block: gleiche Breite wie Beschreibungstext
     topic-desc ist max 900px mit padding 0 16px → Inhalt max 868px
     Tabelle soll auf gleiche Inhaltsbreite kommen → max-width: 868px */
  .topic-block .topic-formats-table {
    width: calc(100% - 32px);
    max-width: 868px;
    margin: 24px auto 16px auto;
  }

  /* Thema-Nummer: ausgeblendet */
  .topic-num {
    display: none !important;
  }

  /* Format-Bar Icons: kein Rollover-Effekt */
  .formats-bar .format-chip:hover {
    transform: none !important;
    
    border-color: rgba(94, 234, 212, 0.3) !important;
    color: rgba(255,255,255,1) !important;
    cursor: default !important;
  }

  /* Icons rechts in Accordion-Zeile */
  .topic-head-right .chev {
    color: rgba(0,0,0,0.35) !important;
  }
  .topic-head-right .star-btn {
    color: rgba(0,0,0,0.25) !important;
  }
  .topic-head-right .star-btn:hover { color: #002060 !important; }
  .topic-head-right .star-btn.favorited { color: #ffd700 !important; }
  .topic-head-right .collect-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: rgba(0,0,0,0.25);
    transition: color 0.15s;
  }
  .topic-head-right .collect-btn:hover { color: #e040fb; }
  .topic-head-right .collect-btn.in-collection {  }
  /* Notiz-Button in Topic-Kopfzeile */
  .topic-head-right .note-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: rgba(0,0,0,0.25);
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .topic-head-right .note-btn:hover {  }
  .topic-head-right .note-btn.has-note {  }
  /* Notiz-Popup (DIN A6 Notizzettel) */
  .topic-note-popup {
    position: fixed;
    z-index: 9990;
    background: #E9F4FF;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
    padding: 0;
    width: 390px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .topic-note-popup::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 18px;
    width: 14px;
    height: 14px;
    background: #002060;
    transform: rotate(45deg);
    border-left: 1px solid rgba(0,0,0,0.12);
    border-top: 1px solid rgba(0,0,0,0.12);
  }
  .topic-note-popup-header {
    font-size: 14px;
    font-weight: 700;
    color: white;
    background: #002060;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
  }
  .topic-note-popup-header span:first-child { flex: 1; }
  .topic-note-autosave {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    white-space: nowrap;
  }
  .topic-note-close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    padding: 0;
    line-height: 1;
    font-size: 20px;
    flex-shrink: 0;
  }
  .topic-note-close:hover { color: white; }
  .topic-note-popup textarea {
    border: 1.5px solid #002060;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    resize: none;
    height: 222px;
    font-family: inherit;
    color: #002060;
    background: #E0E9F6;
    outline: none;
    line-height: 1.55;
    width: calc(100% - 28px);
    box-sizing: border-box;
    margin: 14px;
  }
  .topic-note-popup textarea:focus { border-color: rgba(0,32,96,0.45); box-shadow: 0 0 0 2px rgba(0,32,96,0.12); }
  /* Topic title block: Titel + Kategorie-Badges untereinander */
  .topic-title-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }
  .topic-cat-badges { display: none !important; /* hidden */ 
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
  }
  /* Farbige Nummern-Badges pro Kategorie */
  .topic-cat-num-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    
    letter-spacing: 0.3px;
    line-height: 1.5;
    flex-shrink: 0;
  }
  .cat-color-01 {  }
  .cat-color-02 { background: #dc2626 !important; }
  .cat-color-03 { background: #16a34a !important; }
  .cat-color-04 { background: #d97706 !important; }
  .cat-color-05 { background: #7c3aed !important; }
  .cat-color-06 { background: #db2777 !important; }
  .cat-color-07 { background: #0891b2 !important; }
  .cat-color-08 { background: #ea580c !important; }
  .cat-color-09 { background: #0d9488 !important; }

  /* Category page hint text */
  #screen-category > p {
    color: rgba(0,0,0,0.45) !important;
  }

  /* ============ MEDIATHEK: Category Card Icons ============ */
  /* FOUC-Fix: .webp-Placeholder ausblenden bis JS das Base64-Icon einbaut (.cat-img) */
  .cat-icon img:not(.cat-img) { opacity: 0 !important; }
  .cat-icon img.cat-img {
    width: 66px;
    height: 66px;
    object-fit: contain;
    border-radius: 12px;
    opacity: 1;
  }
  /* Mini category badges in topic rows */
  .topic-cat-badges { display: none !important; /* hidden */ 
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
  }
  .topic-cat-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
  }
  .topic-cat-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  /* eBOOKS: kein uppercase, damit die Schreibweise erhalten bleibt */
  .format-chip .fmt-label[data-fmt="ebook"] {
    text-transform: none !important;
  }

  /* ============ SIDEBAR ============ */
  .ms-sidebar { position: fixed; left: 0; bottom: 81px; top: var(--ms-header-height, 132px); width: 380px; z-index: 90; background: var(--nm-blue, #002060); color: #fff; overflow-y: auto; padding-top: 14px; transition: transform 0.25s; box-sizing: border-box; pointer-events: auto; }
  .ms-sb-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(255,255,255,0.55); padding: 6px 22px 10px; font-weight: 700; }
  .ms-sb-nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 14px; }
  .ms-nav-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px; color: rgba(255,255,255,0.8); cursor: pointer; font-size: 12.5px; font-weight: 500; background: transparent; border: none; text-align: left; width: 100%; font-family: inherit; transition: background 0.15s; position: relative; }
  .ms-nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
  .ms-nav-item.active { background: rgba(88,192,249,0.15); color: #fff; font-weight: 600; }
  .ms-nav-item.active::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #002060; flex-shrink: 0; margin-left: auto; box-shadow: 0 0 4px rgba(0,32,96,0.3); }
  .ms-nav-icon { flex-shrink: 0; width: 24px; height: 24px;  object-fit: cover; }
  .ms-nav-num { font-size: 13px; opacity: 1; color: #002060; flex-shrink: 0; min-width: 16px; font-weight: 700; }
  .ms-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ms-sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 89; display: none; pointer-events: none; }
  .ms-sidebar-backdrop.open { display: block; pointer-events: auto; }
  /* Sidebar-Footer: Nutzer-Aktionen */
  .ms-sb-actions { border-top: 1px solid rgba(0,32,96,0.12); margin-top: 8px; padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 1px; }
  .ms-sb-action-btn { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: none; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: #002060 !important; font-family: inherit; width: 100%; text-align: left; transition: background 0.15s; }
  .ms-sb-action-btn:hover { background: rgba(0,32,96,0.07); color: #002060; }
  .ms-sb-action-btn svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.6; color: #002060; }
  .ms-menu-btn { display: none; width: 36px; height: 36px; border-radius: 8px; border: none; background: rgba(255,255,255,0.18); color: #fff; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex-shrink: 0; }
  .ms-menu-btn svg { width: 20px; height: 20px; }
  .ms-menu-btn:hover { background: rgba(255,255,255,0.28); }
  @media (min-width: 769px) {
    .app > :not(.nm-header):not(.ms-sidebar):not(.ms-sidebar-backdrop) { padding-left: 380px; box-sizing: border-box; }
    .ms-sidebar-backdrop { display: none !important; }
  }
  @media (max-width: 768px) {
    .ms-sidebar { transform: translateX(-100%); width: min(94vw, 380px); bottom: 0 !important; box-shadow: 6px 0 24px rgba(0,0,0,0.25); pointer-events: none; }
    .ms-sidebar.open { transform: translateX(0); pointer-events: auto; }
    .ms-menu-btn { display: inline-flex; }
      /* Standard Header — Mobile */
    .nm-header-sidebar-space { display: none; }
    .nm-header-content-area { max-width: none; }
    .nm-header-content-inner { padding: 0 16px; height: 70px; }
    .nm-header-search { display: none; }
    .nm-search-bar { display: flex; }
    .nm-hamburger { display: flex; }
  }
/* Footer ausblenden (Tab-Bar ist die Navigation) */
.nm-footer, #appFooter { display: none !important; }

/* ══════════════════════════════════════════════════════════
   MOBILE LAYOUT (≤ 768px) — in HEAD, nicht löschbar
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* ── HEADER: Desktop-Elemente ausblenden ── */
  .nm-header-inner { display: none !important; }
  #filterSearchBtn  { display: none !important; }

  /* ── HEADER: einzeilig (Icons jetzt im Sidebar-Menü) ── */
  .nm-header { display: flex !important; flex-direction: row !important; align-items: center !important; height: auto !important; min-height: auto !important; max-height: none !important; padding: 6px 12px !important; gap: 0 !important; }

  /* ── Hamburger | Titel (flex:1) | Flaggen ── */
  .nm-brand { display: flex !important; flex-direction: row !important; align-items: center !important; gap: 8px !important; width: 100% !important; position: static !important; transform: none !important; height: 44px !important; }
  .nm-header-logo { display: none !important; }

  /* 16px: passt "NeuroMedia24 Business Atelier" (laengster Titel) */
  .nm-title { font-size: 16px !important; white-space: nowrap !important; flex: 1 !important; overflow: hidden !important; text-overflow: ellipsis !important; }
  .nm-title span { font-size: 16px !important; }

  /* Flaggen-Groesse auf Mobile */
  .nm-flags .flag-btn { width: 24px !important; height: 24px !important; border-radius: 50% !important; padding: 0 !important;  }
  .nm-flags .flag-btn svg { width: 24px !important; height: 24px !important; display: block !important; }

  /* Icons-Row ausblenden (Profil/Switcher/Logout jetzt im Sidebar) */
  .nm-headtools { display: none !important; }

  /* ── Welcome + Spacer ausblenden ── */
  .welcome { display: none !important; }
  .home-spacer { display: none !important; }
  .formats-bar { display: none !important; }

  /* ── Kategorien: 1 Spalte ── */
  .categories-grid { grid-template-columns: 1fr !important; gap: 10px !important; padding: 0 12px 12px !important; }
  .category-card { padding: 14px 16px !important; border-radius: 14px !important; min-height: 0 !important; }
  .cat-icon { width: 52px !important; height: 52px !important; flex-shrink: 0 !important;  }
  .cat-name { font-size: 15px !important; }
  .cat-keywords { font-size: 12px !important; }
  .section-header { padding: 14px 12px 8px !important; font-size: 13px !important; }
  .recently-strip { grid-template-columns: 1fr !important; padding: 0 12px !important; }
  .content { padding-left: 0 !important; }
}





/* ===== ehemals mediathek-post.css (Block 5 + Header-Höhe-Fix) ===== */
/* ===== ehemals mediathek-post.css (template-fix) ===== */

/* ===== Block #5: nm24-template-fix ===== */

/* ── HEADER: Brand absolut links, Headtools absolut rechts ── */
.nm-header {
  position: relative !important;
}
/* nm-header-inner: volle Breite, enthält nur noch die Suchleiste zentriert */
.nm-header-inner {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  min-height: 130px !important;
}
/* Sidebar-Spacer ausblenden (Brand ist absolut, braucht keinen Spacer mehr) */
.nm-header-sidebar-space {
  display: none !important;
}
/* Content-Area: nimmt den ganzen verfügbaren Platz, nur für Suchfeld */
.nm-header-content-area {
  flex: 1 !important;
  max-width: none !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
}
/* Content-Inner: zentriert die Suchleiste mit Puffer für Brand + Headtools */
.nm-header-content-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 130px !important;
  padding: 0 320px !important; /* 320px beidseitig: Platz für ~280px Brand links + ~260px Headtools rechts */
  box-sizing: border-box !important;
  gap: 0 !important;
}
/* Suchleiste: nimmt den Mittelbereich ein */
.nm-header-content-inner .nm-header-search {
  flex: 1 !important;
  max-width: 800px !important;
  min-width: 0 !important;
}

/* ── BRAND: absolut links ── */
.nm-brand {
  position: absolute !important;
  left: 24px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 2 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: none !important;
  padding: 0 !important;
}

/* ── HEADTOOLS: absolut rechts ── */
.nm-headtools {
  position: absolute !important;
  right: 24px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 2 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: none !important;
  
  padding: 0 !important;
}

/* ── LOGO im Header ausblenden ── */
#nmHeaderLogo {
  display: none !important;
}

/* ── SCHRIFTZUG Farben sicherstellen ── */
.nm-title {
  color: #002060 !important;
  font-size: 27px !important;
  font-weight: 400 !important;
  letter-spacing: -0.2px !important;
  font-family: 'Inter', sans-serif !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}
/* "24" rot */
.nm-title span:first-child { color: #960000 !important; }
/* " Mediathek" dunkelblau */
.nm-title span:last-child  { color: #002060 !important; }

/* ── TAB-BAR: Icons zentriert (Desktop) ── */
@media (min-width: 769px) {
  .tab-bar {
    display:         flex !important;
    align-items:     flex-end !important;
    justify-content: center !important;
  }
}
@media (max-width: 768px) {
  #nm-legal-bar { display: none !important; }
}

/* ── HAMBURGER nur auf Mobile ── */
@media (min-width: 769px) {
  .nm-hamburger { display: none !important; }
}

/* ── Mobile Header Korrektur ── */
@media (max-width: 768px) {
  /* nm-header-inner komplett ausblenden – nm24-template-fix base wuerde
     display:flex + min-height:130px erzwingen; hier uebersteuern wir das */
  .nm-header-inner {
    display: none !important;
  }
  .nm-header-content-inner {
    padding: 0 16px !important;
    height: 70px !important;
    justify-content: space-between !important;
  }
  .nm-brand {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
  }
  /* Icons-Row komplett ausblenden auf Mobile (jetzt im Sidebar-Menue) */
  .nm-headtools {
    display: none !important;
  }
  .nm-header-search {
    display: none !important;
  }
  /* Titelgroesse 16px + Overflow-Fix fuer Flex-Item */
  .nm-title {
    display: block !important;        /* inline-flex → block: text-overflow braucht Block */
    font-size: 16px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;          /* Flex-Item darf unter Content-Breite schrumpfen */
    flex: 1 !important;
    line-height: 1.3 !important;
  }
  .nm-title span {
    font-size: 16px !important;
    vertical-align: baseline !important;  /* kein Superscript-Effekt */
    line-height: inherit !important;
  }
  /* renderScreen() setzt <a>-Wrapper – auch der muss clippen */
  .nm-title a {
    display: block !important;
    font-size: 16px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: inherit !important;
    text-decoration: none !important;
  }
  /* Willkommensbereich auf Mobile anzeigen */
  .welcome { display: block !important; }
  /* Kategorie-Hero + Favoriten-Hero: Seitenabstand */
  .category-hero {
    margin-left: 12px !important;
    margin-right: 12px !important;
    
  }
  /* Info-Banner Seitenabstand */
  .info-banner {
    margin-left: 12px !important;
    margin-right: 12px !important;
  }
}

/* Footer ausblenden (Tab-Bar ist die Navigation) */
.nm-footer, #appFooter { display: none !important; }
  /* ── NM24 WELCOME MSG FORMATTING ── */
  #welcomeMsg strong {
    color: #002060 !important;
    font-weight: 700 !important;
    display: block;
    margin-bottom: 2px;
  }
  #welcomeMsg {
    color: #002060;
  }



/* ===== Header-Höhe-Lock (Refactor-Fix 2026-05-10) ============================
   Cascade-Workaround: nach der Migration setzte 'MEDIATHEK-OVERRIDES' den
   Header auf height:auto, was auf Mobile 60px statt 70px ergab.
   Hier die explizite Höhe als finale Regel.
============================================================================ */
@media (max-width: 768px) {
  .nm-header { height: 70px !important; min-height: 70px !important; max-height: 70px !important; }
}
@media (min-width: 769px) {
  .nm-header { min-height: 130px !important; }
}


/* ═════ COLLECTIONS-AKKORDEON v3 2026-05-14 — Pin + Toolbar + Single-Open, Hex hart ═════ */
.playlists-grid { display: flex !important; flex-direction: column !important; gap: 10px !important; }

/* Toolbar oben: Alle öffnen / Alle schließen */
.coll-toolbar { display: flex; align-items: center; gap: 4px; margin: 0 0 14px; padding: 0 2px; }
.coll-toolbar-link {
  all: unset !important;
  cursor: pointer;
  color: #002060;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background .15s;
}
.coll-toolbar-link:hover { background: rgba(0,32,96,0.08); }
.coll-toolbar-sep { color: rgba(0,32,96,0.35); font-size: 13px; padding: 0 2px; }

/* Akkordeon-Container */
.coll-acc {
  background: #E0E9F6;
  border: 1px solid rgba(0,32,96,0.12);
  border-radius: 12px;
  overflow: hidden;
  transition: background .35s cubic-bezier(0.4, 0, 0.2, 1), border-color .35s cubic-bezier(0.4, 0, 0.2, 1);
}
.coll-acc.open { background: #002060 !important; border-color: #002060 !important; box-shadow: 0 4px 14px rgba(0,32,96,0.18); }

/* Header */
.coll-acc-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  background: transparent;
  border: none; width: 100%;
  font-family: inherit;
  color: #002060;
  text-align: left;
  transition: color .35s cubic-bezier(0.4, 0, 0.2, 1);
}
.coll-acc.open .coll-acc-head,
.coll-acc.open .coll-acc-head .cr-name,
.coll-acc.open .coll-acc-head .cr-count,
.coll-acc.open .coll-acc-head .coll-acc-chev { color: #fff !important; }
.coll-acc-head .cr-name { flex: 1; font-size: 16px; font-weight: 600; color: inherit; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coll-acc-head .cr-count { font-size: 12.5px; opacity: 0.75; color: inherit; margin-right: 4px; }

/* Action-Buttons im Header (Pin/Stift/Trash) — voller Button-Reset */
.coll-acc-head button.cr-act,
.coll-acc-head .cr-act {
  all: unset !important;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  opacity: 0.55;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: inherit;
  flex-shrink: 0;
  transition: opacity .15s, background .15s, color .15s;
}
.coll-acc-head .cr-act:hover { background: rgba(0,32,96,0.10); opacity: 1; }
.coll-acc.open .coll-acc-head .cr-act:hover { background: rgba(255,255,255,0.14) !important; opacity: 1; }
.coll-acc.open .coll-acc-head .cr-act.danger:hover { background: rgba(255,255,255,0.14) !important; color: #ffb3b3 !important; }

/* Pin aktiv = Gold #ffd700 (gleicher Ton wie star-btn.favorited) */
.coll-acc-head .cr-pin.active { color: #ffd700 !important; opacity: 1 !important; }
.coll-acc.open .coll-acc-head .cr-pin.active { color: #ffd700 !important; opacity: 1 !important; }

/* Chevron */
.coll-acc-chev {
  flex-shrink: 0;
  color: inherit;
  opacity: 0.70;
  transition: transform .35s cubic-bezier(0.4, 0, 0.2, 1), opacity .15s;
}
.coll-acc-head:hover .coll-acc-chev { opacity: 1; }
.coll-acc.open .coll-acc-chev { transform: rotate(180deg); opacity: 1; }

/* Panel (Soft-Open via max-height 2s wie Mediathek-Topic-Akkordeon) */
.coll-acc-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 2s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ECF2FB;
}
.coll-acc.open .coll-acc-panel { max-height: 9999px; }
.coll-acc-panel-inner {
  padding: 0 18px;
  transition: padding .35s cubic-bezier(0.4, 0, 0.2, 1);
}
.coll-acc.open .coll-acc-panel-inner { padding: 14px 18px 18px; }
.coll-acc-empty { color: rgba(0,32,96,0.55); font-size: 13px; padding: 8px 0; font-style: italic; }

/* Items im Panel: Card-BG statt weiß */
.coll-acc-panel-inner .question-card { background: #E0E9F6 !important; margin-bottom: 8px; }
.coll-acc-panel-inner .question-card:last-child { margin-bottom: 0; }

/* Item-X-Button (eigene Klasse, kein Konflikt mit .pl-delete) */
.coll-acc-panel-inner .coll-item-del,
.coll-acc-panel-inner button.coll-item-del {
  all: unset !important;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50% !important;
  background: transparent;
  color: rgba(0,32,96,0.55);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.coll-acc-panel-inner .coll-item-del:hover {
  background: #fee2e2 !important;
  color: #ef4444 !important;
}
