    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: Arial, sans-serif;
      padding: 15px;
      background-color: #1d1d1d; 
      color: #e0e0e0;
      display: flex;
      flex-direction: column;
      align-items: center;
      min-height: 100vh;
      overflow-x: hidden;
    }

    .hidden {
      display: none !important;
    }

    /* --- AUTHENTICATIE SCHERMEN --- */
    .auth-card {
      background: #252525;
      padding: 30px;
      border-radius: 8px;
      box-shadow: 0 4px 16px rgba(0,0,0,0.6);
      width: 100%;
      max-width: 420px;
      margin-top: 40px;
      border: 1px solid #444;
    }

    .auth-card h2 {
      margin-bottom: 20px;
      color: #fff;
      text-align: center;
    }

    form {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    input, select, button {
      padding: 10px 14px;
      font-size: 14px;
      background-color: #2d2d2d;
      color: #ffffff;
      border: 1px solid #444;
      border-radius: 6px;
      outline: none;
    }

    input:focus, select:focus {
      border-color: #0066cc;
    }

    button {
      font-weight: bold;
      cursor: pointer;
      background-color: #0066cc;
      color: #ffffff;
      border: none;
      transition: background-color 0.2s, transform 0.1s;
    }

    button:hover {
      background-color: #0052a3;
    }

    button:active {
      transform: scale(0.98);
    }

    .danger-btn {
      background-color: #dc3545;
    }

    .danger-btn:hover {
      background-color: #bd2130;
    }

    .error-msg {
      color: #ff6b6b;
      margin-top: 10px;
      font-size: 13px;
      text-align: center;
    }

    .success-msg {
      color: #51cf66;
      margin-top: 10px;
      font-size: 13px;
      text-align: center;
    }

    /* --- HOOFD APPLICATIE LAYOUT --- */
    #reader-container {
      width: 100%;
      max-width: 1200px;
      display: flex;
      flex-direction: column;
      align-items: center;
      background-color: #1d1d1d;
      position: relative;
    }

    .header-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      margin-bottom: 12px;
      gap: 8px;
      flex-wrap: wrap;
    }

    .header-bar h1 {
      margin: 0;
      font-size: 1.2rem;
      color: #ffffff;
      white-space: nowrap;
    }

    .controls-group {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .font-control-inline {
      display: flex;
      align-items: center;
      gap: 6px;
      background-color: #2d2d2d;
      padding: 6px 10px;
      border: 1px solid #444;
      border-radius: 6px;
    }

    .font-control-inline input[type="range"] {
      width: 70px;
      cursor: pointer;
    }

    /* BOEK VIEWER (VOLLE BREEDTE) */
    #viewer {
      width: 100%;
      height: calc(100vh - 140px);
      background: #ffffff;
      border: 1px solid #3a3a3a;
      border-radius: 6px;
      box-shadow: 0 4px 16px rgba(0,0,0,0.6);
      transition: background-color 0.3s ease;
      position: relative;
      overflow: hidden;
      display: block;
    }


    #viewer.night-mode {
      background: #1d1d1d !important;
      border-color: #555555;
    }

    /* POP-OVER OVERLAYS (INHOUDSOPGAVE & ONLINE GEBRUIKERS) */
    .popover-overlay {
      display: none;
      position: absolute;
      top: 50px;
      left: 0;
      right: 0;
      margin: 0 auto;
      width: 90%;
      max-width: 450px;
      max-height: 70vh;
      background-color: #252525;
      border: 1px solid #555;
      border-radius: 8px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.8);
      z-index: 1000;
      overflow-y: auto;
      padding: 15px;
    }

    .popover-overlay h3 {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
      border-bottom: 1px solid #444;
      padding-bottom: 8px;
      color: #fff;
    }

    .user-list {
      display: flex;
      flex-direction: column;
      gap: 6px;
      max-height: 50vh;
      overflow-y: auto;
    }

    .user-item {
      padding: 8px 10px;
      background: #2d2d2d;
      border: 1px solid #3d3d3d;
      border-radius: 4px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 13px;
    }

    /* Klikbare online gebruikerslijst item */
    .user-item.clickable {
      cursor: pointer;
      transition: background-color 0.2s;
    }

    .user-item.clickable:hover {
      background: #383838;
      border-color: #0066cc;
    }

    .badge {
      font-size: 10px;
      padding: 2px 6px;
      border-radius: 10px;
      background: #6c757d;
      color: white;
      font-weight: bold;
    }

    .badge.mod {
      background: #ffc107;
      color: black;
    }

    #toc-list {
      list-style: none;
    }

    #toc-list li {
      padding: 8px 10px;
      border-bottom: 1px solid #333;
      cursor: pointer;
      font-size: 14px;
    }

    #toc-list li:hover {
      background-color: #383838;
      color: #66b2ff;
    }

    .footer-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      margin-top: 15px;
    }

    /* Klikzones links/rechts voor pagina-bladeren */
    #left-zone,
    #right-zone {
      position: absolute;
      top: 0;
      height: 100%;
      width: 10%;
      z-index: 900;
      cursor: pointer;
    }

    #left-zone { left: 0; }
    #right-zone { right: 0; }

    #left-zone:hover,
    #right-zone:hover {
      background: rgba(0,0,0,0.05);
    }

    /* Smalle bovenstrook om header terug te halen */
    #top-reveal-bar {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 18px;
      z-index: 950;
      cursor: pointer;
      background: rgba(0,0,0,0.15);
    }

    /* Symbolen in klikzones en topbar */
    /* Bovenstrook ^ */
    #top-reveal-bar::after {
      content: "^";
      position: absolute;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      font-size: 22px;          /* groter */
      font-weight: bold;
      color: #ffffff;           /* helder wit */
      opacity: 0.9;             /* bijna volledig zichtbaar */
      text-shadow: 0 0 6px #000; /* glow zodat het altijd zichtbaar is */
    }

    body.header-hidden #top-reveal-bar::after {
      content: "v";        /* pijltje omlaag */
      font-size: 22px;
      font-weight: bold;
      color: #ffffff;
      opacity: 0.9;
      text-shadow: 0 0 6px #000;
    }


    /* Linkerzone < */
    #left-zone::after {
      content: "<";
      position: absolute;
      top: 50%;
      left: 10px;
      transform: translateY(-50%);
      font-size: 32px;          /* veel groter */
      font-weight: bold;
      color: #ffffff;
      opacity: 0.85;
      text-shadow: 0 0 6px #000;
    }

    /* Rechterzone > */
    #right-zone::after {
      content: ">";
      position: absolute;
      top: 50%;
      right: 10px;
      transform: translateY(-50%);
      font-size: 32px;
      font-weight: bold;
      color: #ffffff;
      opacity: 0.85;
      text-shadow: 0 0 6px #000;
    }


    #left-zone:hover::after,
    #right-zone:hover::after,
    #top-reveal-bar:hover::after {
      opacity: 0.8;
      color: #fff;
    }

    #viewer iframe {
      position: relative;
      z-index: 1;
    }

    #left-zone,
    #right-zone,
    #top-reveal-bar {
      z-index: 9999; /* hoger dan iframe */
    }

    .book-select-row {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      margin-bottom: 10px;
    }

    .book-select-row label {
      white-space: nowrap;
      font-weight: bold;
      color: #ffd700;
    }

    .book-select-row select {
      flex: 1;
    }

    :fullscreen body {
      padding: 0 !important;
      margin: 0 !important;
    }

    :fullscreen #app-section {
      width: 100vw !important;
      height: 100vh !important;
    }

    :fullscreen #reader-container {
      width: 100vw !important;
      height: 100vh !important;
    }

    :fullscreen #viewer {
      height: calc(100vh - 0px) !important;
    }


    #fullscreen-btn {
      background-color: #444;
      border: 1px solid #666;
      padding: 6px 10px;
      border-radius: 6px;
    }
    #fullscreen-btn:hover {
      background-color: #555;
    }

    .footer-bar button {
      padding: 6px 10px;
      font-size: 14px;
    }

    @media (max-width: 600px) {
      .footer-bar button {
        padding: 12px 18px;
        font-size: 18px;
      }
      
      .header-bar button {
        height: 44px;           /* aanbevolen door Apple & Google */
        font-size: 16px;
        padding: 10px 14px;
      }

      #left-zone, #right-zone {
        width: 18%; /* bredere klikzones op mobiel */
      }

      #top-reveal-bar::after {
        font-size: 28px; /* grotere ^ / v */
      }

      
      .header-bar input[type="range"] {
        height: 32px;            /* iets groter voor duimen */
      }

      .header-bar input[type="range"]::-webkit-slider-runnable-track {
        height: 6px;             /* iets dikker */
      }

      .header-bar input[type="range"]::-webkit-slider-thumb {
        width: 18px;
        height: 18px;
        margin-top: -6px;
      }

      .header-bar input[type="range"]::-moz-range-thumb {
        width: 18px;
        height: 18px;
      }

      .header-bar input[type="range"]::-moz-range-track {
        height: 6px;
      }

      #spread-toggle-btn {
        display: none; /* spread verbergen op mobiel */
      }
    }

    :fullscreen .footer-bar {
      display: none !important;
    }

    .header-bar button {
      padding: 6px 10px;        /* zelfde padding als fullscreen */
      height: 36px;             /* vaste hoogte */
      line-height: 24px;        /* tekst mooi gecentreerd */
      font-size: 14px;
      border-radius: 6px;
    }

    /* Compacte sliders in de header */
    .header-bar input[type="range"] {
      height: 24px;              /* lagere totale hoogte */
      padding: 0;
      margin: 0 4px;
    }

    /* Dunne slider-track */
    .header-bar input[type="range"]::-webkit-slider-runnable-track {
      height: 4px;               /* dunne track */
      background: #666;
      border-radius: 4px;
    }

    /* Kleinere slider-knop (thumb) */
    .header-bar input[type="range"]::-webkit-slider-thumb {
      width: 12px;
      height: 12px;
      margin-top: -4px;          /* centreren op de track */
      background: #ddd;
      border-radius: 50%;
      cursor: pointer;
    }

    .header-bar input[type="range"]::-moz-range-thumb {
      width: 12px;
      height: 12px;
      background: #ddd;
      border-radius: 50%;
      cursor: pointer;
    }

    .header-bar input[type="range"]::-moz-range-track {
      height: 4px;
      background: #666;
    }

    .header-bar .font-control-inline label {
      font-size: 11px;
      margin-right: 4px;
    }

    /* Container van ePub.js beperken */
    #viewer.spread .epub-container {
      max-width: 1600px;  /* perfecte breedte voor 2 pagina’s */
      margin: 0 auto;
    }

    #viewer.single .epub-container {
      max-width: 100%;
      margin: 0 auto;
    }



    /* Zorg dat pagina’s altijd volledig zichtbaar zijn */
    #viewer iframe {
      width: 100% !important;
      height: 100% !important;
    }


    #viewer.single .epub-container {
      max-width: 100%;
    }

    #viewer.spread .epub-container {
      max-width: 1600px;
    }
