:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef0f6;
  --text: #1a1d29;
  --muted: #6b7185;
  --border: #e2e5ee;
  --primary: #4f46e5;
  --primary-soft: #eef0ff;
  --accent: #f59e0b;
  --success: #16a34a;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 4px 16px rgba(20, 24, 40, .06);
  --radius: 12px;
  --reader-bg: #ffffff;
  --reader-text: #1f2230;
}
:root[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #171a23;
  --surface-2: #1f2330;
  --text: #e7e9f0;
  --muted: #9097ab;
  --border: #2a2f3d;
  --primary: #818cf8;
  --primary-soft: #232644;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  --reader-bg: #171a23;
  --reader-text: #d9dce6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117;
    --surface: #171a23;
    --surface-2: #1f2330;
    --text: #e7e9f0;
    --muted: #9097ab;
    --border: #2a2f3d;
    --primary: #818cf8;
    --primary-soft: #232644;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    --reader-bg: #171a23;
    --reader-text: #d9dce6;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Cairo", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 20px; padding-bottom: 40px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ===== Top bar ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.3rem; white-space: nowrap; }
.logo b { color: var(--primary); margin-inline-start: .25em; }
.logo-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--logo-2, #9333ea)); color: #fff; font-size: 1.2rem;
}
.logo.small { font-size: 1.1rem; }
.logo.small .logo-mark { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.search { flex: 1; max-width: 320px; margin-inline-start: auto; }
.search input, .input, select.input {
  width: 100%; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-family: inherit; font-size: .95rem; outline: none;
}
.search input:focus, .input:focus { border-color: var(--primary); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 1.1rem; flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); }
.menu-btn { display: none; }

@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; inset-inline: 0; flex-direction: column;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 16px;
  }
  .nav.open { display: flex; }
  .search { max-width: none; }
  .logo-text { display: none; }
}

/* ===== Buttons & chips ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 700; font-size: .95rem;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.chip {
  display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid transparent;
}
a.chip:hover, button.chip:hover { color: var(--primary); border-color: var(--primary); }
button.chip { border: 1px solid var(--border); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .75rem; font-weight: 700; }
.badge.ongoing { background: #dcfce7; color: #166534; }
.badge.completed { background: #dbeafe; color: #1e40af; }
.badge.hiatus { background: #fee2e2; color: #991b1b; }
:root[data-theme="dark"] .badge.ongoing { background: #14532d; color: #bbf7d0; }
:root[data-theme="dark"] .badge.completed { background: #1e3a8a; color: #bfdbfe; }
:root[data-theme="dark"] .badge.hiatus { background: #7f1d1d; color: #fecaca; }

/* ===== Sections ===== */
.section { margin-bottom: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 1.35rem; }
.section-head a { color: var(--primary); font-weight: 600; font-size: .9rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 32px; margin-bottom: 36px;
  color: #fff; display: grid; grid-template-columns: 1fr 180px; gap: 28px; align-items: center;
}
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.18), transparent 50%); pointer-events: none; }
.hero h1 { margin: 6px 0 10px; font-size: 2rem; line-height: 1.3; }
.hero p { margin: 0 0 18px; opacity: .92; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero .tag { font-size: .85rem; font-weight: 700; opacity: .85; }
.hero .btn { background: #fff; color: #111; border: none; }
.hero .btn.ghost { background: rgba(255,255,255,.15); color: #fff; }
.hero-dots { position: absolute; bottom: 14px; inset-inline-start: 32px; display: flex; gap: 6px; z-index: 2; }
.hero-dots button { width: 8px; height: 8px; border-radius: 99px; border: none; background: rgba(255,255,255,.45); padding: 0; }
.hero-dots button.active { width: 22px; background: #fff; }
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; padding: 22px 18px 36px; }
  .hero .cover { display: none; }
  .hero h1 { font-size: 1.5rem; }
}

/* ===== Cover (generated) ===== */
.cover {
  position: relative; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden;
  display: flex; align-items: flex-end; padding: 10px; color: #fff; box-shadow: var(--shadow);
}
.cover::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 75% 20%, rgba(255,255,255,.35), transparent 35%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 8px, transparent 8px 16px);
}
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.65), transparent 60%); }
.cover span { position: relative; z-index: 1; font-family: "Amiri", serif; font-weight: 700; font-size: 1.05rem; line-height: 1.35; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.cover .glyph { position: absolute; z-index: 1; top: 12%; inset-inline: 0; text-align: center; font-size: 3.2rem; opacity: .3; font-family: "Amiri", serif; }

/* ===== Novel grid ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.novel-card { display: flex; flex-direction: column; gap: 8px; }
.novel-card:hover .cover { transform: translateY(-3px); }
.novel-card .cover { transition: transform .2s; }
.novel-card h3 { margin: 0; font-size: .95rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.novel-card .meta { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.star { color: var(--accent); }

/* ===== List rows ===== */
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: none; }
.row:hover { background: var(--surface-2); }
.row .cover { padding: 4px; border-radius: 6px; box-shadow: none; }
.row .cover span { font-size: .55rem; }
.row .cover .glyph { font-size: 1.4rem; }
.row h4 { margin: 0; font-size: 1rem; }
.row .sub { font-size: .85rem; color: var(--muted); }
.row .time { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.rank-num { font-size: 1.4rem; font-weight: 800; color: var(--muted); width: 32px; text-align: center; }
.rank-num.top { color: var(--accent); }
.row.ranked { grid-template-columns: 32px 56px 1fr auto; }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.genre-cloud { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px; }

/* ===== Filters ===== */
.filters { padding: 16px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 14px; }
.filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-row label { font-weight: 700; min-width: 70px; font-size: .9rem; }
.filter-row select { width: auto; border-radius: 10px; }
.page-title { margin: 0 0 18px; font-size: 1.6rem; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 3rem; }

/* ===== Novel detail ===== */
.detail { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding: 24px; margin-bottom: 24px; }
.detail h1 { margin: 0; font-size: 1.8rem; line-height: 1.35; }
.detail .original { color: var(--muted); direction: ltr; text-align: right; font-size: .9rem; margin-bottom: 10px; }
.detail .alt-names { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .85rem; margin: -4px 0 10px; }
.detail .alt-name { background: var(--chip, rgba(127,127,127,.12)); border-radius: 6px; padding: 1px 8px; color: var(--text); }
.stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 0; }
.stat b { display: block; font-size: 1.15rem; }
.stat span { font-size: .8rem; color: var(--muted); }
.detail .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.detail .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.synopsis { white-space: pre-line; }
.rate { display: flex; gap: 2px; direction: ltr; justify-content: flex-end; }
.rate button { background: none; border: none; font-size: 1.4rem; color: var(--border); padding: 0 2px; }
.rate button.on { color: var(--accent); }
@media (max-width: 700px) {
  .detail { grid-template-columns: 1fr; padding: 18px; }
  .detail .cover { max-width: 180px; margin: 0 auto; }
  .detail h1 { font-size: 1.4rem; }
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 16px; }
.tabs button { background: none; border: none; padding: 12px 14px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; font-size: .95rem; }
.tabs button.active { color: var(--primary); border-color: var(--primary); }
.tab-body { padding: 16px; }
.chapter-tools { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.chapter-tools .input { max-width: 240px; border-radius: 10px; }
.chapter-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.chapter-list a { padding: 9px 12px; border-radius: 8px; background: var(--surface-2); font-size: .9rem; display: flex; justify-content: space-between; gap: 8px; }
.chapter-list a:hover { color: var(--primary); }
.chapter-list a.read { opacity: .55; }
.chapter-list a .date { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager button { min-width: 38px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.pager button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.comments { display: flex; flex-direction: column; gap: 12px; }
.comment { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.comment .who { font-weight: 700; font-size: .9rem; }
.comment .when { color: var(--muted); font-size: .75rem; margin-inline-start: 8px; }
.comment-form { display: flex; gap: 8px; margin-bottom: 14px; }
.comment-form textarea { flex: 1; border-radius: 10px; min-height: 44px; resize: vertical; }

/* ===== Reader ===== */
.reader-wrap { max-width: var(--reader-width, 780px); margin: 0 auto; transition: max-width .2s; }
.reader-head { text-align: center; margin-bottom: 18px; }
.reader-head a.novel-link { color: var(--primary); font-weight: 700; }
.reader-head h1 { margin: 6px 0 0; font-size: 1.5rem; }
.reader-nav { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin: 14px 0; }
.reader-nav select { max-width: 280px; border-radius: 10px; }
.reader {
  background: var(--reader-bg); color: var(--reader-text);
  padding: 32px 36px; border-radius: var(--radius); border: 1px solid var(--border);
  font-family: var(--reader-font, "Noto Naskh Arabic"), serif;
  font-size: var(--reader-size, 20px); line-height: var(--reader-lh, 2.1);
}
.reader p { margin: 0 0 1.1em; text-align: var(--reader-align, justify); }
.reader { transition: background-color .25s, color .25s; }
@media (max-width: 640px) { .reader { padding: 20px 16px; } }

.settings-panel {
  position: fixed; bottom: 16px; inset-inline-start: 16px; z-index: 60; width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain;
  padding: 16px; display: flex; flex-direction: column; gap: 14px;
}
@media (max-width: 640px) {
  .settings-panel { inset-inline: 0; bottom: 0; width: 100%; border-radius: 18px 18px 0 0; max-height: 75vh; }
  .wide-only { display: none; }
}
.settings-panel h3 { margin: 0; font-size: 1rem; display: flex; justify-content: space-between; }
.settings-panel .opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .9rem; }
.settings-panel .opt .ctrls { display: flex; gap: 6px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); padding: 0; }
.swatch.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.reader-tools { position: fixed; bottom: 16px; inset-inline-start: 16px; z-index: 55; display: flex; flex-direction: column; gap: 10px; }
.fab { width: 50px; height: 50px; border-radius: 50%; font-size: 1.2rem; box-shadow: var(--shadow); }
.progress-bar { position: fixed; top: 64px; inset-inline: 0; height: 3px; z-index: 49; }
.progress-bar div { height: 100%; background: var(--primary); width: 0; transition: width .1s; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 24px 0; margin-top: auto; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer p { margin: 8px 0 0; font-size: .9rem; max-width: 420px; }
.footer-links { display: flex; gap: 16px; align-items: center; color: var(--muted); font-weight: 600; }
.footer-links a:hover { color: var(--primary); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100;
  background: var(--text); color: var(--bg); padding: 10px 20px; border-radius: 10px; font-weight: 600;
  animation: fade 2.2s forwards;
}
@keyframes fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ===== Accounts ===== */
.small { font-size: .85rem; }
.small-btn { padding: 6px 14px; font-size: .88rem; }
.btn.danger { color: var(--danger); }
.link-btn { background: none; border: none; color: var(--primary); font-weight: 700; cursor: pointer; padding: 0 4px; font-size: .85rem; }
.user-menu { position: relative; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; border: none; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--logo-2, #9333ea)); color: #fff; font-weight: 800; font-size: 1rem;
}
.dropdown { position: absolute; top: 46px; inset-inline-end: 0; min-width: 220px; padding: 8px; display: flex; flex-direction: column; z-index: 70; }
.dropdown a, .dropdown button { padding: 8px 12px; border-radius: 8px; text-align: start; background: none; border: none; color: var(--text); font-size: .92rem; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); }
.dropdown .dd-head { padding: 6px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 20, .55); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { width: min(420px, 100%); position: relative; padding-bottom: 8px; }
.modal-close { position: absolute; top: 8px; inset-inline-end: 8px; width: 32px; height: 32px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.auth-form label, .edit-form label, .bundle label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .9rem; }
.auth-form .input, .edit-form .input, .bundle .input { border-radius: 10px; }
.form-error { color: var(--danger); font-weight: 600; font-size: .9rem; }
.form-error:empty { display: none; }
.login-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 10px; background: var(--primary-soft); margin-bottom: 14px; }
.comment .chip { margin-inline-start: 6px; font-size: .72rem; padding: 1px 8px; }
.comment-body { white-space: pre-line; margin-top: 4px; }
.tabs a.tab { padding: 12px 14px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; font-size: .95rem; }
.tabs a.tab.active { color: var(--primary); border-color: var(--primary); }
.loading { display: grid; place-items: center; padding: 80px 0; gap: 12px; color: var(--muted); }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cover.has-img { padding: 0; background: var(--surface-2); }
.cover.has-img::before, .cover.has-img::after { display: none; }
.cover.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-cover { background: linear-gradient(160deg, var(--primary), #1e1b4b); align-items: center; justify-content: center; }
.mini-cover span { font-size: 1.4rem !important; }
@media (max-width: 900px) { .nav a.hidden { display: none; } }

/* ===== Admin ===== */
.dropzone {
  border: 2px dashed var(--border); border-radius: 14px; padding: 36px 16px; text-align: center;
  background: var(--surface-2); transition: border-color .15s, background .15s;
}
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .big { font-size: 2.6rem; color: var(--primary); }
.dropzone p { margin: 6px 0; }
.upload-help { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.upload-help details { flex: 1; min-width: 260px; }
.upload-help summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.upload-help pre { background: var(--surface-2); padding: 12px; border-radius: 10px; overflow-x: auto; font-size: .82rem; line-height: 1.5; text-align: left; }
.bundles { display: flex; flex-direction: column; gap: 14px; }
.bundle { display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; padding: 16px; align-items: start; }
.bundle-cover img, .bundle-cover .cover { width: 90px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; display: block; }
.bundle-cover .cover span { font-size: .7rem; }
.bundle-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bundle-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.bundle-remove { width: 30px; height: 30px; font-size: .85rem; }
.bundle-progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bundle-progress div { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.excerpt { font-family: "Noto Naskh Arabic", serif; background: var(--surface-2); padding: 10px; border-radius: 8px; font-size: .9rem; white-space: pre-line; }
.warn { color: #b45309; font-size: .85rem; }
.ok { color: var(--success); font-weight: 700; }
.err { color: var(--danger); font-weight: 700; }
.admin-row { grid-template-columns: 48px 1fr auto; }
.admin-row h4 a:hover { color: var(--primary); }
.row-actions { display: flex; gap: 6px; }
.edit-form { padding: 20px; margin-top: 20px; display: flex; flex-direction: column; gap: 14px; }
.edit-form h2 { margin: 0; font-size: 1.2rem; }
.genre-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.genre-pick .chip { cursor: pointer; display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 4px; font-weight: 600 !important; }
@media (max-width: 640px) {
  .bundle { grid-template-columns: 1fr auto; }
  .bundle-cover { display: none; }
  .admin-row { grid-template-columns: 40px 1fr; }
  .admin-row .row-actions { grid-column: 1 / -1; }
}
.reader-nav .btn { white-space: nowrap; }
.reader-nav select { flex: 1; min-width: 0; }
@media (max-width: 640px) { .reader-nav .btn { padding: 9px 12px; } }

/* ===== Translation ===== */
.translate-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; }
.tr-modes { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.tr-modes button { background: var(--surface); border: none; padding: 8px 12px; font-weight: 700; color: var(--muted); font-size: .85rem; }
.tr-modes button + button { border-inline-start: 1px solid var(--border); }
.tr-modes button.active { background: var(--primary); color: #fff; }
.tr-status { font-size: .88rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tr-status:empty { display: none; }
.translate-bar .tr-status { flex-basis: 100%; justify-content: center; text-align: center; }
.spinner.tiny { width: 14px; height: 14px; border-width: 2px; display: inline-block; }
.translate-panel { padding: 16px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 14px; }
.tr-langs { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.tr-langs label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .85rem; flex: 1; min-width: 140px; }
.tr-langs .input { border-radius: 10px; }
.tr-arrow { padding-bottom: 8px; color: var(--muted); }
.tr-engines { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.engine {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.engine:hover { border-color: var(--primary); background: var(--primary-soft); }
.engine b { font-size: .95rem; }
.engine span { font-size: .78rem; color: var(--muted); }
.engine.off { opacity: .55; }
.tr-auto { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; cursor: pointer; }
.reader p[dir="ltr"] { text-align: left; font-family: Georgia, "Times New Roman", serif; }
.reader .tr-para { color: var(--primary); opacity: .9; border-inline-start: 3px solid var(--primary-soft); padding-inline-start: 10px; }
.reader hr { border: none; border-top: 1px dashed var(--border); margin: 1.5em 0; }
.info-box { background: var(--primary-soft); border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; font-size: .92rem; }
.info-box ul { margin: 8px 0 0; padding-inline-start: 20px; }
.switch-row { flex-direction: row !important; align-items: center; gap: 8px !important; }

/* ===== Refinements: controls ===== */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: none; background: none; padding: 8px 14px; border-radius: 9px; font-weight: 700; color: var(--muted); font-size: .9rem; }
.seg button.active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.small-seg button { padding: 6px 10px; font-size: .82rem; }
#up-modes { margin-bottom: 16px; }
.btn.mini { padding: 4px 10px; font-size: .85rem; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
.opt-block { display: flex; flex-direction: column; gap: 8px; }
.opt-label { font-weight: 700; font-size: .88rem; display: flex; justify-content: space-between; }
.opt-label b { color: var(--primary); }
.range-row { display: flex; align-items: center; gap: 8px; }
.font-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.font-grid button { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 10px; padding: 8px 4px; font-size: 1rem; }
.font-grid button.active, .preset-grid button.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.preset-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.preset-grid button { aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--border); font-family: "Amiri", serif; font-size: 1rem; padding: 0; }
.preset-grid .auto-swatch { background: linear-gradient(135deg, #ffffff 50%, #15171d 50%); color: transparent; }
.color-row { display: flex; gap: 12px; flex-wrap: wrap; }
.color-row label { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; }
.color-row input[type="color"] { width: 40px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; }
body.reading-tinted { background: var(--reader-bg); transition: background-color .25s; }
body.reading-tinted .reader { border-color: transparent; box-shadow: none; }
body.reading-tinted .reader-head, body.reading-tinted .reader-head h1 { color: var(--reader-text); }

/* ===== Import from link ===== */
.link-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .9rem; }
.link-row { display: flex; gap: 8px; }
.link-row .input { flex: 1; border-radius: 10px; }
.link-form code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
#link-result .edit-form { margin-top: 12px; }
.method { display: flex; flex-direction: column; gap: 10px; }
.radio { display: flex !important; flex-direction: row !important; gap: 10px !important; align-items: flex-start; font-weight: 400 !important; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio input[type="radio"] { margin-top: 6px; }
.radio .range { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: 6px; }
.input.tiny { width: 80px; padding: 4px 8px; border-radius: 8px; display: inline-block; }
.advanced summary { cursor: pointer; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.advanced { display: flex; flex-direction: column; gap: 10px; }
.cover-thumb { width: 36px; height: 54px; object-fit: cover; border-radius: 4px; }
.crawl-progress { display: flex; flex-direction: column; gap: 8px; }
.crawl-log { max-height: 220px; overflow-y: auto; font-size: .85rem; background: var(--surface-2); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; }
.chapter-peek { max-height: 220px; overflow-y: auto; font-size: .85rem; margin: 8px 0; padding-inline-start: 36px; }
.bundle.done { border-color: var(--success); }
.section-head .actions { display: flex; gap: 8px; }

/* ===== Site settings: logo, pages, ads, names ===== */
.logo-img { height: 40px; width: auto; max-width: 220px; object-fit: contain; display: block; }
.logo.small .logo-img { height: 32px; }
.nav-pages { display: contents; }
.footer-pages { display: contents; }
.footer-copy { flex-basis: 100%; text-align: center; }
.footer-copy:empty { display: none; }
.footer-inner { flex-wrap: wrap; }
.footer-links { flex-wrap: wrap; }

.ad-holder:empty { display: none; }
.ad-holder { margin: 16px auto; text-align: center; overflow: hidden; }
#ad-top { margin-top: 16px; margin-bottom: 0; }
.reader .ad-holder { margin: 1.4em 0; font-size: 16px; line-height: 1.5; }
.ad-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 90px; padding: 12px;
  border: 2px dashed var(--border); border-radius: var(--radius); color: var(--muted); background: var(--surface-2); font-size: .85rem;
}
.ad-placeholder b { color: var(--text); }
.ad-placeholder small { opacity: .8; }

.char-name { --c: #4f46e5; }
.char-name.cn-color { color: var(--c); font-weight: 700; }
.char-name.cn-bold { font-weight: 800; }
.char-name.cn-underline { text-decoration: underline 2px var(--c); text-underline-offset: 4px; }
.char-name.cn-badge { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); border-radius: 6px; padding: 0 4px; font-weight: 700; }
:root[data-theme="dark"] .char-name.cn-color, :root[data-theme="dark"] .char-name.cn-badge { color: color-mix(in srgb, var(--c) 70%, white); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .char-name.cn-color, :root:not([data-theme="light"]) .char-name.cn-badge { color: color-mix(in srgb, var(--c) 70%, white); }
}

.cms-page { padding: 24px 28px; }
.cms-body { font-size: 1.05rem; line-height: 1.9; overflow-wrap: anywhere; }
.cms-body img { height: auto; border-radius: 10px; }
.cms-body a { color: var(--primary); text-decoration: underline; }
.cms-body iframe { max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 10px; }
.cms-body blockquote { margin: 1em 0; padding: 8px 16px; border-inline-start: 4px solid var(--primary); background: var(--surface-2); border-radius: 8px; }
@media (max-width: 640px) { .cms-page { padding: 16px; } }

.admin-head { align-items: center; }
.admin-tabs { overflow-x: auto; scrollbar-width: thin; white-space: nowrap; }
.admin-tabs a.tab { flex-shrink: 0; }

/* ===== Admin: pages editor, image library, glossary, characters, ads ===== */
.check-row { display: flex; gap: 18px; flex-wrap: wrap; }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px 10px 0 0; position: sticky; top: 64px; z-index: 5; }
.rich-toolbar button { min-width: 34px; height: 32px; border: 1px solid transparent; background: none; border-radius: 6px; color: var(--text); font-size: .9rem; }
.rich-toolbar button:hover, .rich-toolbar button.active { background: var(--surface); border-color: var(--border); }
.rich-toolbar .tb-sep { width: 1px; background: var(--border); margin: 4px 4px; }
.rich-wrap { margin-top: -14px; }
.rich { min-height: 320px; padding: 18px; border: 1px solid var(--border); border-top: none; border-radius: 0 0 10px 10px; background: var(--surface); outline: none; }
.rich:focus { box-shadow: inset 0 0 0 2px var(--primary-soft); }
.rich-source { min-height: 320px; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; border-radius: 0 0 10px 10px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.media-grid.big-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.media-item { padding: 0; border: 2px solid var(--border); border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); }
.media-item:hover { border-color: var(--primary); }
.media-item img, .media-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-card { overflow: hidden; display: flex; flex-direction: column; }
.media-card a { aspect-ratio: 4 / 3; background: var(--surface-2); display: block; }
.media-meta { display: flex; gap: 6px; align-items: center; padding: 8px; flex-wrap: wrap; }
.media-meta span { flex: 1; }
.media-modal { width: min(720px, 100%); max-height: 86vh; overflow: auto; }
.media-modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.media-modal-body h3 { margin: 0; }
.small-drop { padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.gl-table table, .cn-table, .ads-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.gl-table th, .gl-table td, .cn-table th, .cn-table td, .ads-table th, .ads-table td { padding: 8px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: middle; }
.gl-table th, .cn-table th, .ads-table th { color: var(--muted); font-size: .8rem; }
.gl-table { overflow-x: auto; }
.gl-samples { display: flex; flex-direction: column; gap: 8px; font-family: "Noto Naskh Arabic", serif; }
.gl-samples > div { background: var(--surface-2); padding: 8px 12px; border-radius: 8px; }
.gl-samples mark { background: #fde68a; color: #111; border-radius: 4px; padding: 0 2px; }
.cn-table input.input { border-radius: 8px; padding: 6px 10px; min-width: 110px; }
.cn-table input[type="color"], #cn-add input[type="color"] { width: 40px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; }
.cn-table tr.is-hidden { opacity: .5; }
.cn-sample { align-self: center; font-family: "Noto Naskh Arabic", serif; font-size: 1.1rem; }
.ads-table .input { border-radius: 8px; padding: 6px 10px; }
@media (max-width: 700px) {
  .cn-table thead { display: none; }
  .cn-table tr { display: grid; grid-template-columns: 50px 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .cn-table td { border: none; padding: 2px; }
}

/* ===== Visual editor (studio) ===== */
body.studio-open { overflow: hidden; }
.studio { position: fixed; inset: 0; z-index: 85; display: flex; flex-direction: column; background: var(--bg); }
.studio-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.studio-title { white-space: nowrap; }
.studio-page { width: auto; max-width: 200px; border-radius: 10px; padding: 6px 10px; }
.studio-spacer { flex: 1; }
.studio-dirty { color: #d97706; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.studio-main { flex: 1; display: grid; grid-template-columns: 360px 1fr; min-height: 0; }
.studio-panel { overflow-y: auto; border-inline-end: 1px solid var(--border); background: var(--surface); }
.studio-stage { background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--bg) 0 50%) 0 0 / 20px 20px; display: flex; justify-content: center; overflow: auto; padding: 0; }
.studio-stage iframe { width: 100%; height: 100%; border: 0; background: var(--bg); transition: width .3s; }
.studio-stage.mobile { padding: 16px 0; }
.studio-stage.mobile iframe { width: 390px; height: calc(100% - 0px); border-radius: 22px; box-shadow: 0 10px 40px rgba(0,0,0,.25); border: 8px solid #111; }
.st-sec { border-bottom: 1px solid var(--border); }
.st-sec-head { width: 100%; text-align: start; padding: 12px 16px; background: none; border: none; color: var(--text); font-weight: 800; font-size: .95rem; display: flex; justify-content: space-between; }
.st-sec-head::after { content: "▾"; color: var(--muted); transition: transform .2s; }
.st-sec.open .st-sec-head::after { transform: rotate(180deg); }
.st-sec-body { display: none; padding: 0 16px 16px; flex-direction: column; gap: 12px; }
.st-sec.open .st-sec-body { display: flex; }
.st-sec[data-sec="inspect"] .st-sec-head { color: #e11d48; }
.st-field { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; font-weight: 700; }
.st-field .input { border-radius: 8px; padding: 7px 10px; font-weight: 400; }
.st-field textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.st-field small { font-weight: 400; }
.st-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-check { font-size: .88rem; font-weight: 600; }
.st-val { color: var(--primary); font-weight: 800; }
.st-colors { display: flex; flex-direction: column; gap: 6px; }
.st-color { display: flex; align-items: center; gap: 10px; font-size: .85rem; cursor: pointer; }
.st-color input, .st-colorline input { width: 42px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; flex-shrink: 0; }
.st-colorline { display: flex; gap: 6px; align-items: center; }
.st-palettes { display: flex; gap: 8px; flex-wrap: wrap; }
.st-palette { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); padding: 0; }
.st-palette:hover { transform: scale(1.1); }
.st-blocks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.st-blocks li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; background: var(--surface-2); border-radius: 8px; font-weight: 600; font-size: .85rem; }
.st-blocks li span { display: flex; gap: 4px; flex-shrink: 0; }
.st-image { display: flex; gap: 10px; align-items: center; }
.st-image img, .st-noimg { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); flex-shrink: 0; }
.st-noimg { display: grid; place-items: center; font-size: .65rem; color: var(--muted); text-align: center; font-weight: 400; }
.st-image > div { display: flex; gap: 6px; flex-wrap: wrap; }
.st-crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: .8rem; }
.st-crumbs .chip { cursor: pointer; }
.st-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.st-rules li { display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; background: var(--surface-2); padding: 8px; border-radius: 8px; font-size: .82rem; }
.st-rules li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-rules code { font-size: .72rem; overflow-wrap: anywhere; }
.st-files { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; background: var(--surface-2); padding: 10px; border-radius: 8px; }
.st-files code { overflow-wrap: anywhere; font-size: .72rem; }
.st-files div { display: flex; flex-direction: column; }
.studio-modal { z-index: 95; }
@media (max-width: 900px) {
  .studio-main { grid-template-columns: 1fr; grid-template-rows: 1fr 45%; }
  .studio-panel { order: 2; border-inline-end: none; border-top: 1px solid var(--border); }
  .studio-title, .studio-dirty { display: none; }
  .studio-stage.mobile iframe { width: 100%; border: 0; border-radius: 0; }
}
@media (max-width: 900px) { #st-device { display: none; } }

/* ---------- Email confirmation strip ---------- */
.verify-bar { max-width: 1200px; margin: 12px auto 0; padding: 10px 16px; border-radius: 10px; background: var(--primary-soft); color: var(--text); font-size: .9rem; }
.verify-bar .link-btn { font-weight: 700; }

/* ---------- Admin: novel filter bar, tags ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px; margin-bottom: 14px; }
.filter-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.filter-label select { min-width: 220px; max-width: 360px; }
.tag-add { margin: 6px 0 4px; }
.tag-add .input { max-width: 320px; }
.seg a { padding: 8px 14px; border-radius: 9px; font-weight: 700; color: var(--muted); font-size: .9rem; text-decoration: none; }
.seg a.active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- Admin: statistics ---------- */
#st-body { margin-top: 14px; }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 16px; }
.st-tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.st-tile b { font-size: 1.5rem; color: var(--text); }
.st-tile span { color: var(--muted); font-size: .85rem; }
.st-tile small { color: var(--muted); font-size: .75rem; }
.small-tiles .st-tile b { font-size: 1.2rem; }
.st-card { padding: 16px; margin-top: 8px; }
.st-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; margin-top: 16px; }
.st-grid h4 { margin: 0 0 8px; font-size: .95rem; }
@media (max-width: 760px) { .st-grid { grid-template-columns: 1fr; } }
.st-bars { width: 100%; height: 120px; display: block; }
.st-bars .st-bar { fill: var(--primary); }
.st-bars .st-hit { fill: transparent; }
.st-bars g:hover .st-bar { opacity: .75; }
.st-bars .st-axis { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.st-axis-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; margin-top: 4px; }
.st-ratings > div { display: grid; grid-template-columns: 48px 1fr 40px; align-items: center; gap: 8px; margin: 6px 0; font-size: .85rem; color: var(--muted); }
.st-meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.st-meter div { height: 100%; background: var(--primary); border-radius: 4px; }
.st-uploads { list-style: none; margin: 0; padding: 0; }
.st-uploads li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.st-table tr[data-slug] { cursor: pointer; }
.st-table tr[data-slug]:hover td { background: var(--surface-2); }
.st-table tr.is-current td { background: var(--primary-soft); }
.st-table th .link-btn { color: var(--muted); font-weight: 700; font-size: .8rem; white-space: nowrap; }

/* ---------- Admin: comments ---------- */
.cm-items { display: flex; flex-direction: column; gap: 8px; }
.cm-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; }
.cm-item p { margin: 6px 0 0; white-space: pre-wrap; }
.cm-meta { font-size: .85rem; }
.cm-check { padding-top: 2px; }

/* ---------- Show / hide password ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { width: 100%; padding-inline-end: 44px; }
.pw-eye { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center;
  border: none; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--primary); background: var(--primary-soft); }

/* Anti-bot: the honeypot field is off-screen (people never see it, bots fill it in) */
.hp-field { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; opacity: 0; pointer-events: none; }
.captcha-slot:empty { display: none; }
.captcha-slot { min-height: 65px; display: flex; justify-content: center; }
.switch-list { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .9rem; }

/* Novel suggestions */
.suggest-page { align-items: start; }
.suggest-row { grid-template-columns: 1fr auto; }
.suggest-row h4 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sg-reply { margin-top: 6px; padding: 8px 10px; background: var(--primary-soft); border-radius: 8px; font-size: .9rem; }
.sg-item { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sg-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.sg-head h4 { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sg-note { white-space: pre-wrap; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font-size: .92rem; }
.sg-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sg-actions select { max-width: 140px; }
.sg-actions [data-reply] { flex: 1; min-width: 180px; }
/* Popular novels (home) and the and/or tag switch */
.popular-block .section-head { flex-wrap: wrap; gap: 8px; }
.remember-row { font-weight: 600 !important; }

/* Profile pictures */
.avatar { overflow: hidden; padding: 0; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.avatar-letter { display: grid; place-items: center; width: 100%; height: 100%; }
.big-avatar { width: 84px; height: 84px; font-size: 2rem; }
.profile-pic { display: flex; gap: 14px; align-items: center; }
.profile-pic-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.profile-pic-actions label.btn { flex-direction: row !important; cursor: pointer; }
.account-more { padding: 0 20px 16px; }
.account-more summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.account-more .auth-form { padding: 14px 0 0; }
.comment-avatar { display: inline-grid; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; vertical-align: middle; margin-inline-end: 6px;
  background: linear-gradient(135deg, var(--primary), var(--logo-2, #9333ea)); color: #fff; font-size: .75rem; font-weight: 800; }

/* Sign in with Google / Facebook / X */
.social-login { display: flex; flex-direction: column; gap: 8px; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 700; text-decoration: none; }
.social-btn:hover { background: var(--surface-2); }
.social-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Reading progress */
.rprog { height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin-top: 6px; }
.rprog span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.rprog-text { color: var(--muted); font-size: .78rem; }
.novel-card .rprog { margin: 6px 4px 0; height: 4px; }
.novel-progress { max-width: 360px; margin-top: 12px; }
.reader-progress { max-width: 420px; margin: 16px auto 0; text-align: center; }
.row .time .rprog { min-width: 110px; }
.next-release { margin-top: 10px; color: var(--primary); font-weight: 700; font-size: .92rem; }

/* Report a chapter, recommendations under the chapter */
.reader-after { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin: 8px 0 16px; }
.report-btn { color: var(--muted); font-size: .88rem; }
.report-btn:hover { color: #e11d48; }
.report-reasons { display: flex; flex-direction: column; gap: 6px; }
.report-reasons .switch-row { font-weight: 600 !important; }
.reader-recs { margin-top: 28px; }
.reader-recs h2 { font-size: 1.1rem; margin: 18px 0 10px; }

/* Admin red badges and new tabs */
.alert-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-inline-start: 6px; border-radius: 99px; background: #e11d48; color: #fff;
  font-size: .72rem; font-weight: 800; line-height: 18px; text-align: center; vertical-align: middle; }
.rp-item { padding: 14px 16px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.rp-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.rp-head h4 { margin: 0; }
.rp-list { margin: 0; padding-inline-start: 20px; font-size: .9rem; display: flex; flex-direction: column; gap: 4px; }
.bk-row { grid-template-columns: 40px 1fr auto; }
.sched-table td, .sched-table th { white-space: nowrap; }
.seo-list { columns: 2; }
.oauth-provider { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.oauth-provider legend { padding: 0 6px; }
.auth-form [hidden] { display: none !important; }

/* Admin: automatic release plan — 30-day chart */
.ro-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin: 10px 0 18px; }
.ro-day { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .75rem; text-align: center; }
.ro-day small { color: var(--muted); }
.ro-day em { font-style: normal; color: var(--primary); font-weight: 700; }
.ro-bar { width: 100%; height: 70px; background: var(--surface-2); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column-reverse; }
.ro-bar span { display: block; width: 100%; background: var(--primary); }
.ro-bar span.est { background: var(--primary); opacity: .3; }
.ro-btns { white-space: nowrap; }
.ro-btns .btn { margin: 1px; }
tr.ro-launch td { background: var(--primary-soft); }
