      
      button#eraserBtn.active {
        background-color: #ffdddd;  /* Warna latar saat aktif */
        border: 2px solid #cc0000;
        color: black;
      }
      .no-scroll {
        overflow: hidden;
        height: 100vh;
      }

      .media-item {
        border: 1px solid #ccc;
        background: #fff;
        padding: 2px;
        border-radius: 4px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
      }
      .edit-media-btn {
        position: absolute; 
        background: #f0f0f0;
        padding: 4px 8px;
        border: 1px solid #ccc;
        cursor: pointer;
      }
      #drawToolbar {
        position:absolute;
        bottom: 4px;
        right: 4px;
        background: #efefef;
        border: 1px solid #ccc;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3); 
        z-index: 1100;
        padding: 10px;
      }
      #flipbook-wrapper {
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
      }
        
      .flipbook-wrapper {
          position: relative;
          width: 100%;
          height: 88vh;
          max-width: 100%;
          max-height: 100vh;
          display: flex;
          justify-content: center;
          align-items: center; 
          box-sizing: border-box;
          overflow-x: auto;
          flex-direction: column; 
          padding: 2px; 
          background-color: #f5f5f5;
      }

      .flipbook-header {
        display: flex;
        align-items: center;
        color: #fff;
        background-color: #464646; 
        padding: 4px;
      }

      .yayasan-logo {
        height: 40px;
        margin: 6px 10px;
      }

      .yayasan-title {
        font-size: 1.5rem;
        font-weight: bold;
        color: #fff;
        text-transform: uppercase;
      }

      .flipbook-footer {
         width: 100%;
         display: flex; 
         align-items: center;
         justify-content: center; 
         margin-top: 1px;
         padding: 4px 6px;
         color: #fff;
         background-color: #464646; 
      }

      #footer-center-controls {
        display: flex;
        align-items: center; 
        justify-content: center;
        gap: 4px;
        flex: 1;
      }
      #footer-left-controls {
        display: flex;
        align-items: center; 
        flex-wrap: wrap;
        margin-right: 6px;
        gap: 4px;
      }

      #flipbook {
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        position: relative;
        margin: 0 auto;
        border-radius: 10px;
        box-shadow: 0 10px 14px rgba(0,0,0,0.4);
        touch-action: pan-y pinch-zoom;
        overscroll-behavior: contain;
      }
      .page {
        position: relative;
        margin: 1px;
        box-shadow: 0 8px 10px rgba(0,0,0,0.3);
        border-radius: 8px;
        overflow: hidden;
        background: white;
        border: 1px solid #ccc;
      }
     
      canvas {
        display: block;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
      }
      #pagePopup {
        position: absolute;
        bottom: 4px;
        left: 4px;
        width: 320px;
        max-height: 660px;
        max-width: 100%;
        overflow-y: auto;
        background: white;
        border-radius: 10px;
        border: 1px solid #ccc;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
        display: none;
        z-index: 1000;
        padding: 10px;
      }
      #pagePopup button {
        display: block;
        width: 100%;
        margin-bottom: 5px;
        background: #f9f9f9;
        border: none;
        border-radius: 5px;
        text-align: left;
        padding: 8px;
        cursor: pointer;
        font-size: 14px;
      }
      #pagePopup button:hover {
        background: #eee;
      }
      .icon-btn {
        background: white;
        border-radius: 8px;
        padding: 6px;
        border: 1px solid #ccc;
        cursor: pointer;
        font-size: 16px;
      }
      .icon-btn:hover {
        background: #fafaa0;
      }
      .stf__block {
        box-shadow: 0 12px 32px rgba(0,0,0,0.25);
        border-radius: 12px;
      }
      .page.with-depth {
        box-shadow: inset 0 0 8px rgba(0,0,0,0.2), 0 8px 20px rgba(0,0,0,0.2);
        position: relative;
      }

      .page.with-depth::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 6px;
        background: rgba(0, 0, 0, 0.05);
        z-index: -1;
      }

      .page.with-depth:nth-child(even)::before {
        left: 0;
      }

      .page.with-depth:nth-child(odd)::before {
        right: 0;
      }
      .page-flip {
        position: relative;
        perspective: 2000px;
        overflow: hidden;
      }

      .stf__parent {
        position: relative;
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
      }

      .stf__block {
        position: relative;
        transform-style: preserve-3d;
        transition: transform 0.6s ease-in-out;
        display: flex;
      }

      .stf__item {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 50%;
        backface-visibility: hidden;
        overflow: hidden;
        background: white;
        box-shadow: 0 0 5px rgba(0,0,0,0.1);
        border-radius: 4px;
      }

      .stf__item--left {
        left: 0;
        transform-origin: right center;
        z-index: 1;
      }

      .stf__item--right {
        right: 0;
        transform-origin: left center;
        z-index: 0;
      }

      .stf__shadow {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 50%;
        pointer-events: none;
        background: linear-gradient(to left, rgba(0,0,0,0.1), transparent);
      }

      .stf__shadow--left {
        left: 0;
      }

      .stf__shadow--right {
        right: 0;
        background: linear-gradient(to right, rgba(0,0,0,0.1), transparent);
      }

      .stf__canvas {
        width: 100%;
        height: auto;
        display: block;
      }
   
      .btn-flipbook-nav {
          position: absolute;
          top: 50%;
          transform: translateY(-50%);
          z-index: 10;
          background-color: rgba(52, 144, 220, 0.8);
          color: white;
          border: none;
          border-radius: 50%;
          width: 40px;
          height: 40px;
          font-size: 18px;
          cursor: pointer;
          box-shadow: 0 2px 5px rgba(0,0,0,0.2);
      }

      .btn-flipbook-nav.left {
          left: 2px;
      }

      .btn-flipbook-nav.right {
          right: 2px;
      }

      .btn-flipbook-nav:hover{
         background-color: #0056b3;
      }

      #youtubeModal iframe { width:100%; height:450px; border-radius:10px; }
      @keyframes fadeIn { from{opacity:0} to{opacity:1} }

      #youtubeModal {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.8);
        z-index: 9999;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease;
      }
      #youtubeModal.show {
        display: flex;
        opacity: 1;
      }
      #youtubeModalContent {
        position: relative;
        width: 80%;
        max-width: 800px;
      }
      #youtubeFrame {
        width: 100%;
        height: 450px;
        border: none;
        border-radius: 8px;
      }
      #closeYoutube {
        position: absolute;
        top: -20px;
        right: -20px;
        background: #fff;
        border: none;
        font-size: 24px;
        padding: 0;
        cursor: pointer;
        border-radius: 50%;
        width: 35px;
        height: 35px;
      }

      .annot-canvas {
        z-index: 20 !important;
        touch-action: none; /* ❗ penting: agar tidak di-scroll saat menggambar */
      }

      .modal-media-flip { 
        position:fixed; 
        top:20%; 
        left:50%; 
        transform:translateX(-50%);
        background:#BDCEF2; 
        padding:20px; border:1px solid #ccc; z-index:2000;
      }
       
      @media (max-width: 768px) {
        #flipbook {
          flex-direction: column;
          border-radius: 0;
          border: none;
          box-shadow: none;
        }
      
        #pagePopup {
            width: 90vw;
            left: 0;
            bottom: 0;
            max-height: 70vh;
            border-radius: 16px 16px 0 0;
        }
        .btn-flipbook-nav {
            display: none;
        }
        .modal-media-flip { 
          left:5%;
          width: 90% !important; 
          transform:translateX(0%);
        }
        
      } 
  