  :root{
    --ink: #121214;
    --paper: #F6F4EF;
    --paper-card: #FFFFFF;
    --line: #E7E3D8;
    --muted: #79756C;
    --red: #E8382D;    /* manga */
    --blue: #2D6FE8;   /* manhwa */
    --green: #1D9A6C;  /* manhua */
    --gray: #6B6862;   /* lainnya */
  }
  [data-theme="dark"]{
    --paper: #121214;
    --paper-card: #1C1C20;
    --line: #2C2C33;
    --muted: #9A968D;
    --ink: #F0EEE8;
  }
  html,body{ background: var(--paper); }
  body{ font-family: 'Inter', sans-serif; color: var(--ink); transition: background-color .2s ease, color .2s ease; }

  /* ============ PROTEKSI GAMBAR ============ */
  /* Cegah long-press "Simpan ke Foto" (iOS/Android) dan seleksi/salin gambar.
     Dipasangkan dengan pencegahan klik-kanan & drag lewat JS di api.js. */
  img{
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    pointer-events: auto;
  }
  .font-display{ font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.02em; }

  .halftone{
    background-image: radial-gradient(rgba(255,255,255,0.14) 1.4px, transparent 1.4px);
    background-size: 11px 11px;
  }

  .header-wrap{
    background: var(--ink);
    position: relative;
    overflow: hidden;
  }
  .speed-lines{
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
      100deg,
      transparent 0px,
      transparent 38px,
      rgba(232,56,45,0.10) 38px,
      rgba(232,56,45,0.10) 40px
    );
    pointer-events: none;
  }

  .icon-btn{
    width: 38px; height: 38px;
    border-radius: 9999px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    color: #F6F4EF;
    transition: background 0.2s ease, transform 0.2s ease;
    flex: 0 0 auto;
    cursor: pointer;
  }
  .icon-btn:hover{ background: rgba(255,255,255,0.16); transform: translateY(-1px); }

  .search-input{
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    color: #F6F4EF;
  }
  .search-input::placeholder{ color: rgba(246,244,239,0.5); }
  .search-input:focus{ outline: none; border-color: var(--red); background: rgba(255,255,255,0.12); }

  .tab-bar{
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar{ display: none; }
  .tab-item{
    white-space: nowrap;
    padding: 0.55rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--muted);
    transition: background 0.2s ease, color 0.2s ease;
  }
  .tab-item:hover{ background: var(--line); color: var(--ink); }
  .tab-item.active{
    background: var(--ink);
    color: var(--paper);
  }

  .badge{
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.28rem 0.6rem;
    border-radius: 6px;
    color: #fff;
  }
  .badge-manga{ background: var(--red); }
  .badge-manhwa{ background: var(--blue); }
  .badge-manhua{ background: var(--green); }
  .badge-lainnya{ background: var(--gray); }
  .badge-status{
    background: rgba(18,18,20,0.75);
    color: #fff;
  }

  .featured{
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--paper-card);
  }
  .featured img{ width: 100%; height: 340px; object-fit: cover; display: block; }
  .featured-overlay{
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.88) 10%, rgba(0,0,0,0.15) 55%, transparent 75%);
  }

  .comic-card{
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color .2s ease, border-color .2s ease;
    position: relative;
    display: block;
  }
  .comic-card:hover{
    transform: translateY(-4px);
    box-shadow: 0 12px 28px -14px rgba(18,18,20,0.28);
  }
  .cover-wrap{ position: relative; aspect-ratio: 3/4; overflow: hidden; background: var(--line); }
  .cover-wrap img{ width: 100%; height: 100%; object-fit: cover; }

  .clamp2{
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
  }

  .card-bookmark-btn{
    position: absolute;
    top: 8px; left: 8px;
    width: 30px; height: 30px;
    border-radius: 9999px;
    background: rgba(18,18,20,0.7);
    color: #fff;
    border: none;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: background .2s ease;
  }
  .card-bookmark-btn.active{ background: var(--red); }

  .fab-donate{
    position: fixed;
    right: 1.1rem;
    bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.1rem;
    border-radius: 9999px;
    background: var(--red);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 10px 24px -8px rgba(232,56,45,0.55);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 40;
  }
  .fab-donate:hover{ transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(232,56,45,0.65); }

  .ad-slot{ margin: 1.5rem 0; text-align: center; overflow: hidden; }
  .ad-slot:empty{ display: none; }

  /* ============ HEADER MINIMAL (comic.html, chapter.html) ============ */
  .header-mini{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .back-link{
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(246,244,239,0.75);
    font-size: 0.85rem;
    font-weight: 600;
  }
  .back-link:hover{ color: #F6F4EF; }

  /* ============ HERO DETAIL KOMIK ============ */
  .detail-hero{
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 1.25rem;
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.25rem;
  }
  .detail-hero .cover-wrap{ border-radius: 12px; }
  .detail-hero h1{ font-size: 1.7rem; line-height: 1.15; margin-bottom: 0.5rem; }
  .badge-outline{
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.28rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--line);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .bookmark-toggle-btn{
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
  }
  .bookmark-toggle-btn.active{ background: var(--red); color: #fff; border-color: var(--red); }
  .view-count-inline{
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--muted);
  }

  /* ============ DAFTAR CHAPTER ============ */
  .chapter-list-wrap{
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
  }
  .chapter-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--line);
  }
  .chapter-row:last-child{ border-bottom: none; }
  .chapter-row:hover{ background: var(--paper); }
  .chapter-row .ch-title{ font-weight: 600; font-size: 0.9rem; color: var(--ink); }
  .chapter-row .ch-date{ font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

  /* ============ READER (chapter.html) ============ */
  .reader-bar{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.85rem 1.1rem;
  }
  .reader-bar .comic-name{ font-weight: 700; font-size: 0.9rem; }
  .reader-bar .comic-name a{ color: var(--ink); }
  .reader-nav{ display: flex; align-items: center; gap: 0.4rem; }
  .reader-nav a, .reader-nav select{
    padding: 0.5rem 0.8rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--ink);
  }
  .reader-nav a:hover{ background: var(--red); color: #fff; border-color: var(--red); }
  .reader-nav a.disabled{ opacity: 0.35; pointer-events: none; }

  .reader-images{ display: flex; flex-direction: column; align-items: center; gap: 0; margin: 1rem 0; }
  .reader-images img{ width: 100%; display: block; }

  .no-data{ text-align: center; padding: 3rem 1rem; color: var(--muted); }

  @media (max-width: 640px){
    .detail-hero{ grid-template-columns: 120px 1fr; padding: 1rem; }
    .detail-hero h1{ font-size: 1.3rem; }
    .reader-images{ margin-left: -1.25rem; margin-right: -1.25rem; }
  }

  /* ============ AKUN MEMBER: form auth, dashboard, membership ============ */
  .auth-wrap{ max-width: 440px; margin: 0 auto; padding: 2.5rem 1.25rem 3rem; }
  .auth-card{
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.75rem 1.5rem;
  }
  .auth-card h1{ font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.02em; font-size: 1.6rem; margin-bottom: 0.25rem; }
  .auth-card .sub{ font-size: 0.85rem; color: var(--muted); margin-bottom: 1.25rem; }

  .field{ margin-bottom: 0.9rem; }
  .field label{ display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--ink); }
  .field input, .field select, .field textarea{
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
  }
  .field input:focus, .field select:focus, .field textarea:focus{ outline: none; border-color: var(--red); }
  .field-hint{ font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; }

  .btn-brand{
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    width: 100%; padding: 0.65rem 1rem; border-radius: 10px;
    background: var(--red); color: #fff; font-weight: 600; font-size: 0.88rem;
    border: none; cursor: pointer; text-decoration: none;
  }
  .btn-brand:hover{ opacity: 0.92; }
  .btn-brand:disabled{ opacity: 0.6; cursor: not-allowed; }
  .btn-brand.small{ width: auto; padding: 0.45rem 0.85rem; font-size: 0.78rem; }

  .btn-outline-brand{
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    width: 100%; padding: 0.65rem 1rem; border-radius: 10px;
    background: transparent; color: var(--ink); font-weight: 600; font-size: 0.88rem;
    border: 1px solid var(--line); cursor: pointer; text-decoration: none;
  }
  .btn-outline-brand:hover{ background: var(--paper); }
  .btn-outline-brand.small{ width: auto; padding: 0.4rem 0.75rem; font-size: 0.76rem; }
  .btn-outline-brand.danger{ color: #c0392b; border-color: #f0c9c4; }

  .msg-box{ border-radius: 10px; padding: 0.65rem 0.9rem; font-size: 0.8rem; margin-bottom: 1rem; }
  .msg-error{ background: #fde8e8; color: #a11; }
  .msg-success{ background: #e6f7ec; color: #1a7a3d; }

  .auth-switch{ text-align: center; font-size: 0.82rem; color: var(--muted); margin-top: 1.1rem; }
  .auth-switch a{ color: var(--red); font-weight: 600; }

  /* Dashboard member */
  .dash-section{
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
  }
  .dash-section h3{ font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.02em; font-size: 1.15rem; margin-bottom: 0.85rem; }

  .plan-pill{
    display: inline-block; padding: 0.2rem 0.7rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; color: #fff;
  }
  .plan-pill.free{ background: var(--gray); }
  .plan-pill.basic{ background: var(--blue); }
  .plan-pill.plus{ background: #7A3FE0; }
  .plan-pill.ultimate{ background: #C9971F; }

  .status-pill{ display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }
  .status-pending{ background: #fff4d6; color: #8a6300; }
  .status-approved{ background: #e6f7ec; color: #1a7a3d; }
  .status-rejected{ background: #fde8e8; color: #a11; }

  .order-row{
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem;
    padding: 0.8rem 0; border-bottom: 1px solid var(--line);
  }
  .order-row:last-child{ border-bottom: none; }

  .proof-thumb{ width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }

  /* Halaman membership: kartu pricing */
  .plan-card{
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.5rem 1.25rem;
    display: flex; flex-direction: column; gap: 0.75rem;
  }
  .plan-card.highlight{ border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
  .plan-card .price{ font-family: 'Bebas Neue', sans-serif; font-size: 1.9rem; letter-spacing: 0.02em; }
  .plan-card .price small{ font-family: 'Inter', sans-serif; font-size: 0.75rem; color: var(--muted); font-weight: 500; }
  .plan-card ul{ font-size: 0.82rem; color: var(--muted); display: flex; flex-direction: column; gap: 0.4rem; }
  .plan-card ul li{ display: flex; align-items: center; gap: 0.4rem; }

  .method-option{
    display: flex; align-items: flex-start; gap: 0.6rem;
    border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.85rem;
    cursor: pointer; margin-bottom: 0.6rem;
  }
  .method-option.selected{ border-color: var(--red); background: rgba(232,56,45,0.05); }
  .method-option input{ margin-top: 0.2rem; }
