:root {
  --brand: #ff6a1f; --brand-600: #e85a12; --brand-50: #fff4ee; --brand-100: #ffe4d4;
  --yellow: #f5c518; --ink: #1a1a1f; --muted: #6b7280; --line: #e9e9ee; --soft: #f6f6f8;
  --header-h: 64px; --sidebar-w: 260px; --ai: #7c3aed;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--soft); color: var(--ink); font-family: 'Cairo', 'Tajawal', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- HEADER ---------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: #fff; border-bottom: 2px solid var(--brand); box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 16px; max-width: 1600px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.25rem; white-space: nowrap; }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1rem; }
.logo-text span { color: var(--brand); }
.search-form { position: relative; flex: 1; max-width: 560px; margin: 0 auto; display: flex; align-items: center; }
.search-form > i { position: absolute; right: 14px; color: var(--muted); pointer-events: none; }
.search-form input { width: 100%; height: 42px; border: 1.5px solid var(--line); background: var(--soft); border-radius: 999px; padding: 0 42px 0 16px; font-size: .95rem; outline: none; transition: .2s; }
.search-form input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-50); }
.search-suggest { position: absolute; top: 48px; right: 0; left: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.12); overflow: hidden; z-index: 60; }
.search-suggest a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.search-suggest a:hover { background: var(--brand-50); }
.search-suggest img { width: 36px; height: 50px; object-fit: cover; border-radius: 6px; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: none; background: transparent; font-size: 1.15rem; display: grid; place-items: center; color: var(--ink); }
.icon-btn:hover { background: var(--soft); }
.btn-brand { display: inline-flex; align-items: center; gap: 8px; background: var(--brand); color: #fff; font-weight: 700; padding: 9px 18px; border-radius: 10px; border: none; transition: .15s; white-space: nowrap; }
.btn-brand:hover { background: var(--brand-600); transform: translateY(-1px); }
.btn-brand:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--ink); font-weight: 700; padding: 9px 14px; border-radius: 10px; border: 1.5px solid var(--line); transition: .15s; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.btn-dark { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; font-weight: 700; padding: 9px 18px; border-radius: 10px; border: none; }
.user-menu { position: relative; }
.user-trigger { display: flex; align-items: center; gap: 8px; border: none; background: transparent; padding: 4px 8px 4px 12px; border-radius: 999px; font-weight: 700; }
.user-trigger:hover { background: var(--soft); }
.user-trigger img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brand); }
.user-dropdown { position: absolute; top: 48px; left: 0; min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 6px; z-index: 60; }
.user-dropdown a, .user-dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: right; padding: 10px 12px; border-radius: 8px; border: none; background: transparent; font-weight: 600; font-size: .92rem; }
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--brand-50); color: var(--brand); }
.user-dropdown i { width: 18px; text-align: center; }

/* ---------- SHELL / SIDEBAR ---------- */
.shell { display: flex; max-width: 1600px; margin: 0 auto; min-height: calc(100vh - var(--header-h)); }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: #fff; border-left: 1px solid var(--line); position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; display: flex; flex-direction: column; }
.nav-list { list-style: none; margin: 0; padding: 12px 0; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 14px; padding: 13px 22px; font-weight: 700; font-size: 1rem; color: #333; position: relative; transition: .15s; }
.nav-item i { width: 24px; text-align: center; font-size: 1.1rem; }
.nav-item:hover { background: var(--soft); }
.nav-item.active { background: var(--yellow); color: #111; }
.nav-item.sub { padding-right: 44px; font-size: .95rem; }
.nav-item.sub::before { content: ''; position: absolute; right: 30px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.nav-item.sub.active::before { background: #111; }
.nav-item.accent { color: var(--brand); }
.nav-item.accent.active { background: var(--brand); color: #fff; }
.nav-divider { height: 1px; background: var(--line); margin: 8px 16px; }
.badge-new { background: #ff1f1f; color: #fff; font-size: .7rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; margin-inline-start: 4px; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--line); }
.ai-note { font-size: .78rem; color: var(--muted); line-height: 1.7; background: var(--soft); padding: 10px; border-radius: 10px; }
.ai-note i { color: var(--ai); }
.chip-ai { display: inline-block; background: var(--ai); color: #fff; font-size: .68rem; font-weight: 800; padding: 1px 7px; border-radius: 6px; letter-spacing: .5px; }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }
.main-content { flex: 1; min-width: 0; padding: 20px 24px 60px; overflow-x: hidden; }
.shell { overflow-x: clip; }
.page { max-width: 1280px; margin: 0 auto; }
.loader { text-align: center; padding: 80px 0; color: var(--brand); font-size: 2rem; }

@media (max-width: 1023px) {
  .sidebar { position: fixed; top: var(--header-h); right: 0; transform: translateX(100%); transition: transform .25s; z-index: 56; box-shadow: -8px 0 32px rgba(0,0,0,.12); height: calc(100vh - var(--header-h)); }
  .sidebar.open { transform: translateX(0); }
  .main-content { padding: 14px 12px 60px; }
  .search-form { max-width: none; }
  .logo-text { display: none; }
}
body.bare .sidebar, body.bare .site-footer { display: none; }
body.bare .main-content { padding: 0; }

/* ---------- FOOTER ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--line); padding: 20px 24px; text-align: center; color: var(--muted); font-size: .85rem; display: flex; flex-direction: column; gap: 8px; }
.footer-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.footer-links a:hover { color: var(--brand); }

/* ---------- COMPONENTS ---------- */
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 14px; }
.section-title h2 { font-size: 1.3rem; font-weight: 900; margin: 0; display: flex; align-items: center; gap: 10px; }
.section-title h2::before { content: ''; width: 5px; height: 24px; background: var(--brand); border-radius: 4px; }
.section-title a { color: var(--brand); font-weight: 700; font-size: .9rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--soft); border: 1px solid var(--line); color: #444; padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Manga grid card */
.manga-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
@media (max-width: 640px) { .manga-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; } }
.manga-card { position: relative; display: block; background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); transition: .2s; }
.manga-card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(0,0,0,.12); border-color: var(--brand); }
.manga-card .poster { aspect-ratio: 2/3; overflow: hidden; background: #ddd; position: relative; }
.manga-card .poster img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.manga-card:hover .poster img { transform: scale(1.05); }
.manga-card .meta { padding: 10px; }
.manga-card .title { font-weight: 800; font-size: .92rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.manga-card .sub { font-size: .75rem; color: var(--muted); margin-top: 4px; display: flex; justify-content: space-between; }
.tag-ai { position: absolute; top: 8px; right: 8px; background: var(--ai); color: #fff; font-size: .7rem; font-weight: 900; padding: 3px 8px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.3); display: inline-flex; gap: 4px; align-items: center; }
.tag-human { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.92); color: #333; font-size: .7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; display: inline-flex; gap: 4px; align-items: center; }
.tag-rating { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,.72); color: #ffd84d; font-size: .75rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
.tag-ch { position: absolute; bottom: 8px; right: 8px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; }

/* Hero */
.hero { position: relative; border-radius: 20px; overflow: hidden; min-height: 320px; display: flex; align-items: flex-end; color: #fff; background: #222; margin-top: 4px; }
.hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(14px) brightness(.55); transform: scale(1.1); }
.hero .content { position: relative; display: flex; gap: 22px; padding: 26px; width: 100%; align-items: flex-end; }
.hero .poster { width: 150px; flex-shrink: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.hero h1 { font-size: 1.9rem; font-weight: 900; margin: 6px 0; }
.hero p { opacity: .9; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 700px; line-height: 1.7; }
.hero-dots { position: absolute; bottom: 12px; left: 20px; display: flex; gap: 6px; }
.hero-dots button { width: 8px; height: 8px; border-radius: 50%; border: none; background: rgba(255,255,255,.4); }
.hero-dots button.on { background: var(--brand); width: 22px; border-radius: 4px; }
@media (max-width: 640px) { .hero .poster { width: 100px; } .hero h1 { font-size: 1.3rem; } .hero .content { padding: 16px; gap: 12px; } .hero p { -webkit-line-clamp: 2; font-size: .85rem; } }

/* Character card */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
@media (max-width: 640px) { .char-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; } }
.char-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-align: center; transition: .2s; position: relative; }
.char-card:hover { border-color: var(--brand); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.char-card .img { aspect-ratio: 4/5; background: #eee; overflow: hidden; }
.char-card .img img { width: 100%; height: 100%; object-fit: cover; }
.char-card .name { font-weight: 800; font-size: .9rem; padding: 8px 8px 2px; line-height: 1.3; }
.char-card .role { font-size: .72rem; color: var(--muted); }
.like-btn { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-weight: 800; font-size: .85rem; margin: 8px 0 10px; transition: .15s; color: #444; }
.like-btn i { color: #c4c4c4; transition: .2s; }
.like-btn:hover { border-color: #ff3b5c; }
.like-btn.liked { border-color: #ff3b5c; background: #fff0f3; color: #ff3b5c; }
.like-btn.liked i { color: #ff3b5c; animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(1) } 40% { transform: scale(1.5) } 100% { transform: scale(1) } }
.rank-badge { position: absolute; top: 8px; right: 8px; background: var(--brand); color: #fff; font-weight: 900; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: .8rem; }
.rank-badge.gold { background: #f5c518; color: #111; } .rank-badge.silver { background: #c0c0c0; color: #111; } .rank-badge.bronze { background: #cd7f32; }

/* Manga detail */
.detail-hero { position: relative; border-radius: 20px; overflow: hidden; background: #111; color: #fff; }
.detail-hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(20px) brightness(.4); transform: scale(1.15); }
.detail-hero .inner { position: relative; display: flex; gap: 24px; padding: 28px; }
.detail-hero .poster { width: 220px; flex-shrink: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.detail-hero h1 { font-size: 2rem; font-weight: 900; margin: 0 0 4px; }
.detail-hero .en { opacity: .75; font-size: 1rem; }
.detail-hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.detail-hero .actions .btn-ghost { border-color: rgba(255,255,255,.3); color: #fff; }
.detail-hero .actions .btn-ghost.active { background: rgba(255,255,255,.15); border-color: #fff; }
@media (max-width: 768px) { .detail-hero .inner { flex-direction: column; align-items: center; text-align: center; padding: 20px; } .detail-hero .poster { width: 170px; } .detail-hero h1 { font-size: 1.4rem; } .detail-hero .actions { justify-content: center; } }
.score-box { display: inline-flex; flex-direction: column; align-items: center; background: #fff; color: #111; border-radius: 12px; padding: 8px 16px; min-width: 90px; }
.score-box b { font-size: 1.5rem; color: var(--brand); line-height: 1; }
.score-box small { color: var(--muted); font-size: .7rem; }
.stars { display: inline-flex; gap: 2px; direction: ltr; }
.stars button { background: none; border: none; font-size: 1.1rem; color: #ccc; padding: 0 1px; }
.stars button.on { color: #f5c518; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.info-grid .k { font-size: .72rem; color: var(--muted); font-weight: 700; }
.info-grid .v { font-weight: 800; font-size: .92rem; }
.ai-banner { background: linear-gradient(90deg, #ede9fe, #f5f3ff); border: 1px solid #ddd6fe; color: #4c1d95; padding: 12px 16px; border-radius: 12px; display: flex; gap: 12px; align-items: center; font-size: .9rem; }
.ai-banner i { font-size: 1.4rem; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 24px 0 16px; overflow-x: auto; }
.tabs button { background: none; border: none; padding: 10px 18px; font-weight: 800; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-color: var(--brand); }
.chapter-list { display: flex; flex-direction: column; gap: 8px; }
.chapter-row { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; transition: .15s; }
.chapter-row:hover { border-color: var(--brand); background: var(--brand-50); }
.chapter-row .num { width: 48px; height: 48px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 900; flex-shrink: 0; }
.chapter-row .t { flex: 1; min-width: 0; }
.chapter-row .t b { display: block; }
.chapter-row .t small { color: var(--muted); }
.chapter-row .pdf { color: #e53935; font-size: 1.3rem; }

/* Comments */
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment .body { flex: 1; min-width: 0; }
.comment .head { display: flex; gap: 8px; align-items: center; font-size: .85rem; }
.comment .head b { font-weight: 800; }
.comment .head small { color: var(--muted); }
.comment p { margin: 6px 0; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.comment .spoiler { background: #222; color: transparent; border-radius: 6px; cursor: pointer; user-select: none; }
.comment .spoiler.show { background: #fff7ed; color: inherit; }
.comment .foot { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); }
.comment .foot button { background: none; border: none; color: inherit; font-weight: 700; display: inline-flex; gap: 5px; align-items: center; }
.comment .foot button.liked { color: var(--brand); }
.comment-box textarea { width: 100%; min-height: 90px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; resize: vertical; outline: none; }
.comment-box textarea:focus { border-color: var(--brand); }

/* Reader */
.reader { background: #111; color: #fff; min-height: 100vh; }
.reader-bar { position: sticky; top: var(--header-h); z-index: 40; background: rgba(20,20,20,.95); backdrop-filter: blur(8px); display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #333; flex-wrap: wrap; }
.reader-bar select { background: #222; color: #fff; border: 1px solid #444; border-radius: 8px; padding: 7px 10px; font-weight: 700; max-width: 240px; }
.reader-bar .btn-ghost { border-color: #444; color: #fff; padding: 7px 12px; }
.reader-bar .btn-ghost:hover { border-color: var(--brand); }
.reader-pages { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 0 80px; }
.reader-pages canvas { max-width: 100%; height: auto; box-shadow: 0 4px 24px rgba(0,0,0,.6); background: #fff; }
.reader-pages.fit-width canvas { width: min(100%, 900px); }
.reader-progress { position: fixed; bottom: 0; right: 0; left: 0; height: 4px; background: #333; z-index: 45; }
.reader-progress div { height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.reader-end { text-align: center; padding: 40px 16px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 800; font-size: .9rem; }
.field input, .field textarea, .field select { border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 14px; outline: none; background: #fff; font-size: .95rem; transition: .15s; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.field small { color: var(--muted); font-size: .78rem; }
.auth-card { max-width: 440px; margin: 40px auto; }
.dropzone { border: 2px dashed #ccc; border-radius: 16px; padding: 30px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; background: #fff; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.dropzone i { font-size: 2.2rem; display: block; margin-bottom: 8px; }
.steps { display: flex; gap: 0; margin-bottom: 24px; counter-reset: s; overflow: hidden; }
.steps div { flex: 1; text-align: center; position: relative; font-weight: 800; font-size: .85rem; color: var(--muted); padding-top: 38px; }
.steps div::before { counter-increment: s; content: counter(s); position: absolute; top: 0; right: 50%; transform: translateX(50%); width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 900; z-index: 1; }
.steps div::after { content: ''; position: absolute; top: 14px; right: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.steps div { overflow: visible; }
.steps div:first-child::after { display: none; }
.steps div.on { color: var(--brand); } .steps div.on::before { background: var(--brand); border-color: var(--brand); color: #fff; }
.steps div.done::before { background: #16a34a; border-color: #16a34a; color: #fff; content: '✓'; }
.steps div.done::after, .steps div.on::after { background: var(--brand); }
.seg { display: inline-flex; background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: none; background: transparent; padding: 9px 18px; border-radius: 9px; font-weight: 800; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.seg button.on.ai { background: var(--ai); color: #fff; }

/* Toast / modal */
.toast-root { position: fixed; bottom: 20px; right: 50%; transform: translateX(50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1a1a1f; color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.3); animation: up .25s ease; display: flex; gap: 10px; align-items: center; }
.toast.err { background: #dc2626; } .toast.ok { background: #16a34a; }
@keyframes up { from { opacity: 0; transform: translateY(12px) } }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 18px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 22px; animation: up .2s ease; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; text-align: center; }
.stat b { display: block; font-size: 1.8rem; color: var(--brand); }
.stat small { color: var(--muted); font-weight: 700; }

/* Channel */
.channel-head { background: #fff; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.channel-banner { height: 180px; background: linear-gradient(120deg, var(--brand), #c026d3); background-size: cover; background-position: center; }
.channel-info { display: flex; gap: 18px; padding: 0 24px 20px; align-items: flex-end; margin-top: -44px; flex-wrap: wrap; }
.channel-info img { width: 96px; height: 96px; border-radius: 50%; border: 4px solid #fff; object-fit: cover; background: #fff; }
.channel-stats { display: flex; gap: 18px; color: var(--muted); font-size: .85rem; font-weight: 700; }
.channel-stats b { color: var(--ink); }
.channel-card { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.channel-card img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.feed-row { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.feed-row img { width: 50px; height: 70px; object-fit: cover; border-radius: 8px; }
.empty { text-align: center; padding: 60px 16px; color: var(--muted); }
.empty i { font-size: 3rem; margin-bottom: 10px; display: block; opacity: .5; }
.h-scroll { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.h-scroll > * { flex: 0 0 150px; scroll-snap-align: start; }
@media (max-width: 640px) { .h-scroll > * { flex-basis: 125px; } }
.progress { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress div { height: 100%; background: var(--brand); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); font-size: .9rem; }
.table th { color: var(--muted); font-size: .78rem; }
.icon-sm { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; color: #555; }
.icon-sm:hover { border-color: var(--brand); color: var(--brand); }
.icon-sm.danger:hover { border-color: #dc2626; color: #dc2626; }

/* ---------- Announcement / logo img / social ---------- */
.announcement-bar { background: var(--brand); color: #fff; padding: 9px 16px; text-align: center; font-weight: 700; font-size: .9rem; display: flex; gap: 10px; align-items: center; justify-content: center; position: relative; }
.announcement-bar button { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.2); border: none; color: #fff; width: 26px; height: 26px; border-radius: 50%; }
.logo-img { height: 40px; width: auto; object-fit: contain; }
.footer-social { display: flex; gap: 14px; justify-content: center; font-size: 1.2rem; }
.footer-social a:hover { color: var(--brand); }

/* ---------- ADMIN PANEL ---------- */
.admin-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
@media (max-width: 900px) { .admin-wrap { grid-template-columns: 1fr; } }
.admin-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius, 14px); padding: 8px; position: sticky; top: calc(var(--header-h) + 16px); align-self: start; }
.admin-nav a { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 10px; font-weight: 700; font-size: .92rem; color: #444; }
.admin-nav a i { width: 20px; text-align: center; }
.admin-nav a:hover { background: var(--soft); }
.admin-nav a.on { background: var(--ai); color: #fff; }
@media (max-width: 900px) { .admin-nav { display: flex; overflow-x: auto; position: static; } .admin-nav a { white-space: nowrap; } }
.admin-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.admin-head h1 { font-size: 1.5rem; font-weight: 900; margin: 0; display: flex; gap: 10px; align-items: center; }
.admin-head h1 i { color: var(--ai); }
.color-field { display: flex; gap: 10px; align-items: center; }
.color-field input[type=color] { width: 48px; height: 42px; border: 1.5px solid var(--line); border-radius: 10px; padding: 2px; background: #fff; cursor: pointer; }
.color-field input[type=text] { flex: 1; direction: ltr; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.swatches button:hover { transform: scale(1.1); }
.toggle { position: relative; width: 48px; height: 26px; background: #ccc; border-radius: 999px; border: none; transition: .2s; flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle.on { background: var(--brand); }
.toggle.on::after { transform: translateX(-22px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row b { display: block; font-size: .92rem; }
.toggle-row small { color: var(--muted); }
.preview-box { border: 1px dashed var(--line); border-radius: var(--radius, 14px); padding: 14px; background: var(--soft); }
.sticky-save { position: sticky; bottom: 12px; z-index: 30; display: flex; justify-content: flex-end; gap: 10px; padding: 10px; background: rgba(255,255,255,.85); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 14px; margin-top: 16px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.pill.ok { background: #dcfce7; color: #166534; } .pill.warn { background: #fef3c7; color: #92400e; } .pill.bad { background: #fee2e2; color: #991b1b; } .pill.info { background: #ede9fe; color: #5b21b6; }
.nav-editor { display: flex; flex-direction: column; gap: 6px; }
.nav-editor .row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.nav-editor .row i.fa-solid { width: 22px; text-align: center; color: var(--brand); }
.nav-editor .row input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.terminal { background: #0f0f14; color: #d4d4d8; font-family: ui-monospace, monospace; font-size: .8rem; padding: 14px; border-radius: 12px; direction: ltr; text-align: left; white-space: pre-wrap; max-height: 320px; overflow: auto; }
[data-theme=dark] .admin-nav, [data-theme=dark] .sticky-save { background: #17171c; }
[data-theme=dark] .nav-editor .row { background: #17171c; }
[data-theme=dark] .color-field input[type=color] { background: #1e1e25; }

/* ================= RESPONSIVE POLISH ================= */
html { -webkit-text-size-adjust: 100%; }
img { -webkit-user-drag: none; }
.main-content { padding-bottom: 90px; }
@media (max-width: 640px) {
  :root { --header-h: 58px; }
  .header-inner { gap: 8px; padding: 0 10px; }
  .logo-mark { width: 34px; height: 34px; font-size: .9rem; }
  .logo-img { height: 32px; }
  .search-form input { height: 38px; font-size: .9rem; }
  .btn-brand, .btn-ghost { padding: 8px 12px; font-size: .9rem; }
  .user-trigger { padding: 2px 6px; } .user-trigger img { width: 30px; height: 30px; }
  .section-title { margin: 20px 0 10px; } .section-title h2 { font-size: 1.05rem; }
  .hero { min-height: 230px; border-radius: 14px; }
  .hero .content { padding: 14px; gap: 10px; align-items: center; }
  .hero .poster { width: 90px; }
  .hero h1 { font-size: 1.15rem; margin: 4px 0; }
  .hero p { -webkit-line-clamp: 2; font-size: .8rem; line-height: 1.5; }
  .hero .content > div .flex.gap-2.mt-3 .btn-ghost { display: none; }
  .hero-dots { bottom: 8px; left: 12px; }
  .manga-card .meta { padding: 7px 8px; } .manga-card .title { font-size: .82rem; }
  .manga-card .sub { font-size: .68rem; }
  .tag-ai, .tag-human { font-size: .62rem; padding: 2px 6px; top: 6px; right: 6px; }
  .tag-rating, .tag-ch { font-size: .65rem; padding: 2px 6px; bottom: 6px; }
  .char-card .name { font-size: .8rem; } .like-btn { padding: 4px 10px; font-size: .78rem; }
  .feed-row { padding: 8px; gap: 10px; } .feed-row img { width: 44px; height: 62px; }
  .detail-hero .inner { padding: 16px 14px; } .detail-hero .poster { width: 140px; }
  .detail-hero h1 { font-size: 1.25rem; } .detail-hero .actions { gap: 6px; } .detail-hero .actions .btn-ghost, .detail-hero .actions .btn-brand { padding: 8px 12px; font-size: .85rem; }
  .score-box { padding: 6px 12px; min-width: 76px; } .score-box b { font-size: 1.25rem; }
  .stars button { font-size: .95rem; }
  .tabs button { padding: 9px 12px; font-size: .9rem; }
  .chapter-row { padding: 10px 12px; gap: 10px; } .chapter-row .num { width: 40px; height: 40px; font-size: .9rem; }
  .card { padding: 14px; border-radius: 14px; }
  .stat { padding: 14px 10px; } .stat b { font-size: 1.4rem; }
  .steps div { font-size: .68rem; padding-top: 34px; }
  .reader-bar { padding: 8px; gap: 6px; } .reader-bar select { max-width: 150px; font-size: .85rem; padding: 6px 8px; }
  .reader-bar .btn-ghost { padding: 6px 9px; }
  .reader-pages { padding: 6px 0 70px; gap: 3px; }
  .channel-banner { height: 120px; } .channel-info { padding: 0 14px 14px; margin-top: -36px; gap: 12px; }
  .channel-info img { width: 76px; height: 76px; } .channel-info .pt-12 { padding-top: 2.5rem; }
  .auth-card { margin: 14px auto; }
  .site-footer { padding: 16px 12px 80px; font-size: .78rem; }
  .toast-root { bottom: 76px; } .toast { font-size: .85rem; padding: 10px 16px; }
  .admin-head h1 { font-size: 1.2rem; }
  .sticky-save { bottom: 66px; }
  .table th, .table td { padding: 8px; font-size: .82rem; }
  .table td .w-9 { width: 30px; } .table td .h-12 { height: 40px; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .search-suggest img { width: 30px; height: 42px; }
}
/* Mobile bottom nav */
.bottom-nav { display: none; }
@media (max-width: 1023px) {
  body:not(.bare) .bottom-nav { display: flex; position: fixed; bottom: 0; right: 0; left: 0; height: 60px; background: #fff; border-top: 1px solid var(--line); z-index: 50; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 20px rgba(0,0,0,.06); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .66rem; font-weight: 700; color: var(--muted); }
  .bottom-nav a i { font-size: 1.15rem; }
  .bottom-nav a.on { color: var(--brand); }
  .bottom-nav a.fab i { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; margin-top: -18px; box-shadow: 0 6px 16px rgba(0,0,0,.2); font-size: 1.1rem; }
  [data-theme=dark] .bottom-nav { background: #17171c; }
  .sidebar { padding-bottom: 70px; }
}
@media (min-width: 1024px) { .main-content { padding-bottom: 60px; } }
/* Tablet */
@media (min-width: 641px) and (max-width: 1023px) {
  .manga-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .detail-hero .poster { width: 180px; }
}
/* Large desktop */
@media (min-width: 1600px) { .page { max-width: 1400px; } .manga-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
/* Smooth scrollbars + touch */
.h-scroll { -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.h-scroll::-webkit-scrollbar { height: 6px; } .h-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.tabs { scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
button, a { -webkit-tap-highlight-color: transparent; }
.manga-card:active { transform: scale(.98); }
/* Skeleton loader */
.skeleton { background: linear-gradient(90deg, var(--line) 25%, var(--soft) 50%, var(--line) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
/* Focus visible */
:focus-visible { outline: 3px solid var(--brand-100); outline-offset: 2px; border-radius: 6px; }
/* Print */
@media print { .site-header, .sidebar, .site-footer, .bottom-nav, .reader-bar { display: none !important; } }

/* ---------- Earn / monetization ---------- */
.earn-hero { background: linear-gradient(135deg, var(--brand), #c026d3); color: #fff; border-radius: var(--radius, 14px); padding: 40px 20px; text-align: center; }
.earn-hero h1 { font-size: 2rem; font-weight: 900; margin: 0 0 10px; }
.earn-hero p { max-width: 720px; margin: 0 auto; opacity: .95; line-height: 1.8; }
.earn-hero .btn-ghost { border-color: rgba(255,255,255,.5); color: #fff; }
.earn-hero .btn-brand { background: #fff; color: var(--brand); }
@media (max-width: 640px) { .earn-hero { padding: 28px 14px; } .earn-hero h1 { font-size: 1.4rem; } }
.ad-slot { display: flex; justify-content: center; margin: 0 auto 16px; min-height: 0; overflow: hidden; }
.ad-slot:empty { display: none; }
.ad-top { max-width: 1280px; }

/* ---------- A-ADS UNITS ---------- */
.aads-unit { position: relative; width: 100%; }
.aads-unit iframe { min-height: 60px; }
.ad-label { position: absolute; top: -8px; right: 8px; font-size: .6rem; font-weight: 700; color: var(--muted); background: var(--soft); padding: 0 6px; border-radius: 4px; letter-spacing: .5px; z-index: 2; }
.ad-slot.ad-top { width: 100%; max-width: 980px; margin: 0 auto 18px; padding: 10px 0 0; }
.ad-slot.ad-sidebar { margin: 0 0 12px; padding: 10px 0 0; }
.ad-slot.ad-sidebar .aads-unit iframe { min-height: 250px; }
.ad-slot.ad-reader { max-width: 760px; margin: 0 auto 22px; padding: 12px 0 0; }
.ad-slot.ad-home-mid, .ad-slot.ad-detail { max-width: 980px; margin: 14px auto 22px; padding: 10px 0 0; }
.ad-slot.ad-sticky { position: fixed; bottom: 0; left: 0; right: 0; z-index: 48; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); padding: 6px 8px 8px; box-shadow: 0 -4px 20px rgba(0,0,0,.08); display: none; }
.ad-slot.ad-sticky .aads-unit iframe { min-height: 50px; max-height: 100px; }
.ad-sticky-close { position: absolute; top: -14px; right: 10px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: .75rem; line-height: 1; color: var(--muted); }
@media (max-width: 1023px) { .ad-slot.ad-sticky { display: block; } body:has(.ad-slot.ad-sticky) .bottom-nav { bottom: 70px; } }
[data-theme="dark"] .ad-slot.ad-sticky { background: rgba(23,23,28,.97); }
[data-theme="dark"] .ad-sticky-close { background: #1e1e25; color: #ddd; }
.ads-preview { background: repeating-linear-gradient(45deg, #f6f6f8, #f6f6f8 10px, #eeeef2 10px, #eeeef2 20px); border: 1.5px dashed var(--line); border-radius: 12px; padding: 14px; text-align: center; color: var(--muted); font-size: .85rem; }
.wizard-step { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.wizard-step:last-child { border-bottom: 0; }
.wizard-step .n { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 900; display: grid; place-items: center; flex-shrink: 0; }
.wizard-step .n.done { background: #16a34a; }
.rev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.rev-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.rev-card b { display: block; font-size: 1.45rem; font-weight: 900; }
.rev-card small { color: var(--muted); }
.rev-card.good b { color: #16a34a; } .rev-card.bad b { color: #dc2626; } .rev-card.brand b { color: var(--brand); }
[data-theme="dark"] .rev-card { background: #17171c; }
