/* =============================================================================
   style.css — hybrid design system
   Their look & feel (dark canvas, #E50914 brand, gold accents, Tajawal,
   pill/rect buttons, blurred sticky header) fused with your site's tools.
   Uses logical CSS properties so RTL (Arabic) and LTR (English) both work.
   ============================================================================= */

/* ---------------------------------------------------------------- tokens */
:root, body, body.dark-mode {
  color-scheme: dark;

  --brand: #E50914;
  --brand-dark: #B20000;
  --gold: #D4AF37;

  --bg: #0F0F10;
  --bg2: #17171A;
  --bg3: #26262B;
  --elevated: #33333A;

  --text: #FFFFFF;
  --text2: #B8B8BF;
  --muted: #78787F;

  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shell: 1280px;

  --font: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --shadow-sm: 0 4px 16px rgba(0, 0, 0, .28);
  --shadow: 0 14px 44px rgba(0, 0, 0, .42);
  --shadow-brand: 0 10px 30px rgba(var(--brand-rgb), .28);

  --header-h: 72px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

body:not(.dark-mode) {
  color-scheme: light;
  --bg: #F6F6F8;
  --bg2: #FFFFFF;
  --bg3: #EDEDF1;
  --elevated: #FFFFFF;
  --text: #16161A;
  --text2: #4A4A55;
  --muted: #77777F;
  --border: rgba(0, 0, 0, .10);
  --border-hover: rgba(0, 0, 0, .22);
  --shadow-sm: 0 4px 16px rgba(20, 20, 30, .08);
  --shadow: 0 14px 44px rgba(20, 20, 30, .14);
  --shadow-brand: 0 10px 26px rgba(var(--brand-rgb), .22);
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .25s ease, color .25s ease;
}

img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; font-weight: 800; }
p { margin: 0 0 1em; }
code { background: var(--bg3); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
::selection { background: var(--brand); color: #fff; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell {
  width: min(var(--shell), calc(100% - 40px));
  margin-inline: auto;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* top gradient hairline — the reference site's signature strip */
.topline {
  position: fixed; inset-block-start: 0; inset-inline: 0; height: 3px;
  background: linear-gradient(90deg, #FF7B53, var(--brand), var(--gold));
  z-index: 90;
}

/* page-load progress sweep */
#page-progress {
  position: fixed; inset-block-start: 0; inset-inline-start: 0;
  height: 3px; width: 0; z-index: 95; background: var(--brand);
  opacity: 0; transition: width .5s var(--ease), opacity .3s;
}
#page-progress.pp-active { width: 85%; opacity: 1; }
#page-progress.pp-done { width: 100%; opacity: 0; transition: width .25s, opacity .4s .1s; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 15px; line-height: 1.2;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform .18s var(--ease), background .18s, border-color .18s, filter .18s, color .18s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--brand); color: #fff; box-shadow: var(--shadow-brand);
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost {
  background: rgba(255, 255, 255, .06); color: var(--text);
  border-color: var(--border-hover);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
body:not(.dark-mode) .btn-ghost { background: rgba(0, 0, 0, .04); }
body:not(.dark-mode) .btn-ghost:hover { background: rgba(0, 0, 0, .08); }
.btn-gold { background: var(--gold); color: #1a1400; }
.btn-gold:hover { filter: brightness(1.08); }
.btn-pill { border-radius: 999px; padding-inline: 18px; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }
.btn-block { width: 100%; }

.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg2); color: var(--text2);
  transition: .18s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-hover); background: var(--bg3); }
.icon-btn svg { width: 19px; height: 19px; }

.text-link {
  color: var(--brand); font-weight: 700; font-size: 14px; white-space: nowrap;
}
.text-link:hover { filter: brightness(1.2); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--border-hover); background: rgba(255, 255, 255, .06);
  color: var(--text2);
}
.pill-brand { background: rgba(var(--brand-rgb), .14); border-color: rgba(var(--brand-rgb), .45); color: var(--brand); }
.pill-gold { background: rgba(212, 175, 55, .14); border-color: rgba(212, 175, 55, .45); color: var(--gold); }

/* ---------------------------------------------------------------- header */
.mj-site-header {
  position: sticky; inset-block-start: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .25s;
}
.mj-site-header.is-stuck { box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }

.nav {
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 26px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 21px; font-weight: 900; letter-spacing: -.3px; white-space: nowrap;
}
.brand img { height: 38px; width: auto; border-radius: 10px; }
.brand-letter {
  display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 11px; color: #fff; font-size: 17px; font-weight: 900;
  background: linear-gradient(145deg, #FF2D3F, #A8000F);
  box-shadow: 0 8px 22px rgba(var(--brand-rgb), .32);
}

.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 13px; border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 700; color: var(--text2);
  transition: color .18s, background .18s;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
body:not(.dark-mode) .nav-links a:hover { background: rgba(0, 0, 0, .05); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ''; position: absolute; inset-block-end: 2px; left: 50%;
  inset-inline-start: auto; left: 50%; transform: translateX(-50%);
  width: 18px; height: 2.5px; border-radius: 3px; background: var(--brand);
}
.nav-badge {
  font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 999px;
  background: var(--brand); color: #fff;
}

.nav-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 9px; }
.lang-btn {
  height: 40px; padding-inline: 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg2);
  font-size: 13px; font-weight: 800; letter-spacing: .3px; color: var(--text2);
  transition: .18s;
}
.lang-btn:hover { color: var(--text); border-color: var(--border-hover); }

.promo-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 17px; border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 800;
  box-shadow: var(--shadow-brand);
  transition: .18s var(--ease);
}
.promo-pill:hover { filter: brightness(1.1); transform: scale(1.04); }
.promo-pill .heart { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

.menu-btn { display: none; }

.mobile-nav {
  display: none; gap: 8px; flex-wrap: wrap;
  padding-block: 0 16px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 9px 14px; border-radius: var(--radius-sm);
  background: var(--bg3); font-size: 14px; font-weight: 700; color: var(--text2);
}
.mobile-nav a.active { background: rgba(var(--brand-rgb), .16); color: var(--brand); }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden;
  margin-block-start: 26px;
  min-height: 440px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--bg2);
  background-position: center, var(--hero-focal, center 30%);
  background-size: cover;
  box-shadow: var(--shadow);
  isolation: isolate;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 34%, color-mix(in srgb, var(--bg) 45%, transparent) 70%, transparent 100%),
    linear-gradient(0deg, color-mix(in srgb, var(--bg) 90%, transparent) 0%, transparent 55%);
  opacity: var(--hero-overlay, .72);
}
[dir='rtl'] .hero::before {
  background:
    linear-gradient(270deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 34%, color-mix(in srgb, var(--bg) 45%, transparent) 70%, transparent 100%),
    linear-gradient(0deg, color-mix(in srgb, var(--bg) 90%, transparent) 0%, transparent 55%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 15% 12%, rgba(240, 49, 59, .16), transparent 40%);
}

.hero-content { position: relative; z-index: 2; max-width: 660px; padding: 58px 52px 50px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 800;
  color: #FF8C95; background: rgba(var(--brand-rgb), .12);
  border: 1px solid rgba(var(--brand-rgb), .38);
}
.hero h1 {
  font-size: clamp(38px, 5.4vw, 64px); line-height: 1.08;
  margin: 18px 0 6px; font-weight: 900; letter-spacing: -1.4px;
}
.hero-sub {
  font-size: clamp(17px, 2vw, 22px); font-weight: 700;
  color: var(--gold); margin: 0 0 14px;
}
.hero-desc {
  font-size: 16px; line-height: 1.9; color: var(--text2);
  max-width: 540px; margin: 0 0 20px;
}
.hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.hero-rating { color: var(--gold); font-weight: 800; font-size: 14.5px; }
.hero-actions { display: flex; gap: 11px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- stats */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-block: 26px 6px;
}
.stat {
  display: flex; align-items: center; gap: 15px;
  padding: 18px 20px;
  background: linear-gradient(145deg, var(--bg3), var(--bg2));
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: .2s var(--ease);
}
.stat:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.stat-icon {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 13px; font-size: 19px;
  background: rgba(var(--brand-rgb), .13); color: var(--brand);
}
.stat strong { display: block; font-size: 19px; font-weight: 900; line-height: 1.3; }
.stat small { color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- sections */
.section { padding-block: 36px 4px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 18px;
}
.section-title {
  font-size: 24px; font-weight: 900; margin: 0;
  display: flex; align-items: center; gap: 11px;
}
.section-title::before {
  content: ''; width: 4px; height: 24px; border-radius: 4px;
  background: linear-gradient(180deg, var(--brand), var(--gold));
}
.section-sub { font-size: 14px; color: var(--muted); margin: 5px 0 0; padding-inline-start: 15px; }

/* ---------------------------------------------------------------- cards */
.grid, .mj-grid { display: grid; gap: 22px 16px; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); }

.card { position: relative; min-width: 0; }
.cover-wrap {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 2 / 2.85;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.cover-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease), filter .3s;
}
.card:hover .cover-wrap img { transform: scale(1.06); }
.cover-gradient {
  position: absolute; inset: 35% 0 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(6, 6, 8, .92), transparent);
}
.badge-rating {
  position: absolute; inset-block-start: 9px; inset-inline-end: 9px;
  padding: 4px 8px; border-radius: 7px;
  background: rgba(15, 15, 16, .85); border: 1px solid var(--border-hover);
  color: var(--gold); font-size: 12px; font-weight: 800;
  backdrop-filter: blur(6px);
}
.badge-cat {
  position: absolute; inset-block-start: 9px; inset-inline-start: 9px;
  padding: 4px 9px; border-radius: 7px;
  background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 800;
}
.badge-new {
  position: absolute; inset-block-end: 9px; inset-inline-start: 9px;
  padding: 3px 8px; border-radius: 6px;
  background: var(--gold); color: #1a1400;
  font-size: 10.5px; font-weight: 900; letter-spacing: .4px;
}
.bookmark {
  position: absolute; inset-block-end: 9px; inset-inline-end: 9px;
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; font-size: 16px; color: #fff;
  background: rgba(10, 10, 12, .78); border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(6px);
  transition: .2s var(--ease);
}
.card:hover .bookmark, .bookmark.saved { opacity: 1; transform: none; }
.bookmark:hover { background: var(--brand); border-color: var(--brand); }
.bookmark.saved { color: #FF7E8A; border-color: #FF7E8A; }
.bookmark.saved:hover { background: var(--brand); color: #fff; }

.card-title {
  display: block; font-size: 14.5px; font-weight: 800; line-height: 1.5;
  margin: 10px 1px 3px; min-height: 44px;
  transition: color .18s;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-title:hover { color: var(--brand); }
.card-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.card-sub span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- category cards */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-card {
  position: relative; overflow: hidden; display: flex; align-items: flex-end;
  min-height: 150px; padding: 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background-color: var(--bg3);
  background-size: cover; background-position: center;
  transition: .25s var(--ease);
}
.cat-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(8, 8, 10, .92) 0%, rgba(8, 8, 10, .45) 55%, rgba(8, 8, 10, .18) 100%);
  transition: .25s;
}
.cat-card::after {
  content: ''; position: absolute; inset: 0; opacity: 0;
  box-shadow: inset 0 0 0 2px var(--cat, var(--brand));
  border-radius: inherit; transition: .25s;
}
.cat-card:hover { transform: translateY(-4px); border-color: transparent; }
.cat-card:hover::after { opacity: 1; }
.cat-card:hover::before { background: linear-gradient(0deg, rgba(8, 8, 10, .86) 0%, rgba(8, 8, 10, .3) 60%, transparent 100%); }
.cat-name { position: relative; z-index: 2; font-size: 19px; font-weight: 900; color: #fff; }
.cat-meta {
  position: absolute; inset-block-start: 16px; inset-inline-start: 18px; z-index: 2;
  font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .72);
}
.cat-count {
  position: absolute; inset-block-end: 18px; inset-inline-end: 18px; z-index: 2;
  font-size: 12px; font-weight: 800; color: #fff;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2);
}

/* ---------------------------------------------------------------- promo banner */
.promo {
  position: relative; overflow: hidden; display: flex; align-items: center;
  gap: 26px; flex-wrap: wrap;
  margin-block: 34px 6px; padding: 34px 38px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background-color: var(--bg2);
  background-size: cover; background-position: center;
  box-shadow: var(--shadow-sm);
}
.promo::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10, 10, 12, .94) 0%, rgba(10, 10, 12, .72) 55%, rgba(10, 10, 12, .35) 100%);
}
[dir='rtl'] .promo::before {
  background: linear-gradient(270deg, rgba(10, 10, 12, .94) 0%, rgba(10, 10, 12, .72) 55%, rgba(10, 10, 12, .35) 100%);
}
.promo-body { position: relative; z-index: 2; flex: 1 1 340px; }
.promo h3 { font-size: 25px; font-weight: 900; color: #fff; margin-bottom: 6px; }
.promo p { color: rgba(255, 255, 255, .76); margin: 0; font-size: 15px; }
.promo .btn { position: relative; z-index: 2; }

/* ---------------------------------------------------------------- page intro / toolbar */
.page-intro { padding: 40px 0 6px; }
.page-intro h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 900; letter-spacing: -.8px; }
.page-intro p { color: var(--muted); margin: 6px 0 0; font-size: 15px; }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 18px 0 16px; padding: 15px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
}
.search-field { position: relative; flex: 1 1 260px; min-width: 180px; }
.search-field svg {
  position: absolute; inset-inline-start: 14px; inset-block-start: 50%;
  transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted);
  pointer-events: none;
}
.search-field input {
  width: 100%; height: 44px; padding-inline: 42px 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.search-field input::placeholder { color: var(--muted); }
.search-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .16); }

.select {
  height: 44px; min-width: 150px; padding-inline: 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text2); outline: none;
  transition: border-color .18s;
}
.select:focus { border-color: var(--brand); }

.result-count { margin-inline-start: auto; color: var(--muted); font-size: 13.5px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  padding: 7px 15px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg2);
  color: var(--text2); font-size: 13px; font-weight: 700;
  transition: .18s;
}
.chip:hover { color: var(--text); border-color: var(--border-hover); }
.chip.active {
  color: #fff; background: rgba(var(--brand-rgb), .18); border-color: rgba(var(--brand-rgb), .65);
}

/* ---------------------------------------------------------------- empty state */
.empty {
  padding: 64px 24px; text-align: center;
  border: 1px dashed var(--border-hover); border-radius: var(--radius);
  color: var(--muted); background: var(--bg2);
}
.empty .emoji { font-size: 40px; margin-bottom: 12px; opacity: .7; }
.empty strong { display: block; font-size: 18px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 14px; margin: 0 0 18px; }

/* ---------------------------------------------------------------- detail page */
.detail-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 230px 1fr; gap: 34px; align-items: center;
  margin-block-start: 26px; padding: 34px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background-color: var(--bg2); background-size: cover; background-position: center;
  box-shadow: var(--shadow);
}
.detail-hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(12, 12, 14, .95) 20%, rgba(12, 12, 14, .78) 100%);
}
.detail-cover {
  position: relative; z-index: 2; width: 100%; aspect-ratio: 2 / 2.8;
  object-fit: cover; border-radius: 10px;
  border: 1px solid var(--border-hover); box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
}
.detail-copy { position: relative; z-index: 2; min-width: 0; }
.detail-copy h1 { font-size: clamp(27px, 3.6vw, 44px); font-weight: 900; letter-spacing: -1px; margin: 12px 0; }
.detail-desc { color: var(--text2); line-height: 1.9; max-width: 760px; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.tag-row .pill:hover { color: var(--brand); border-color: var(--brand); }
.detail-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; color: var(--text2); font-size: 14.5px; }

.detail-columns {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px;
  margin-block: 24px;
}
.panel {
  padding: 22px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.panel h2 { font-size: 19px; font-weight: 900; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
.panel h2::before { content: ''; width: 3px; height: 17px; border-radius: 3px; background: var(--brand); }

.chapter-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
  transition: .15s;
}
.chapter-row:last-child { border-bottom: 0; padding-bottom: 0; }
.chapter-row:hover .text-link { filter: brightness(1.25); }
.chapter-row small { color: var(--muted); display: block; font-size: 12.5px; }
.chapter-row strong { font-weight: 800; }
.chapter-row .go { display: inline-flex; align-items: center; gap: 5px; }

.fact { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.fact:last-child { border-bottom: 0; }
.fact span { color: var(--muted); }
.fact strong { font-weight: 800; text-align: end; }

/* ratings */
.rating-row { display: flex; gap: 5px; align-items: center; }
.star {
  font-size: 21px; color: var(--muted); transition: .15s var(--ease); line-height: 1;
}
.star:hover { transform: scale(1.2); }
.star.on { color: var(--gold); }

/* ---------------------------------------------------------------- reader */
.reader-bar {
  position: sticky; inset-block-start: var(--header-h); z-index: 40;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-block-start: 18px; padding: 14px 16px;
  background: color-mix(in srgb, var(--bg2) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.reader-bar .title { min-width: 0; flex: 1 1 220px; }
.reader-bar .title strong { display: block; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-bar .title small { color: var(--muted); font-size: 12.5px; }
.reader-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.reader-pages {
  max-width: var(--reader-width, 860px); margin: 22px auto 40px;
  background: var(--reader-bg, #17171B);
  transition: max-width .2s var(--ease), background .2s;
  border-radius: var(--radius-sm); overflow: hidden;
}
.reader-pages img {
  display: block; width: 100%; height: auto;
  filter: brightness(var(--reader-brightness, 1));
  border-bottom: 1px solid var(--border);
}
.reader-pages img:last-child { border-bottom: 0; }
.reader-pages.page-mode { display: flex; }
.reader-pages.page-mode img { display: none; border-bottom: 0; }
.reader-pages.page-mode img.current { display: block; }

.reader-empty { max-width: 720px; margin: 26px auto 70px; }

.settings-panel {
  position: fixed; z-index: 80; inset-block-end: 20px;
  inset-inline-end: 20px; width: min(340px, calc(100vw - 32px));
  padding: 20px; background: var(--elevated);
  border: 1px solid var(--border-hover); border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
}
.settings-panel.open { display: block; animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.settings-panel h3 { font-size: 16px; font-weight: 900; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.set-row { margin-bottom: 15px; }
.set-row > label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--text2); margin-bottom: 7px; }
.set-row > label b { color: var(--brand); }
.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1; padding: 8px 6px; font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg2); color: var(--text2); transition: .16s;
}
.seg button:hover { border-color: var(--border-hover); color: var(--text); }
.seg button.on { background: rgba(var(--brand-rgb), .16); border-color: var(--brand); color: var(--brand); }
input[type='range'] {
  width: 100%; accent-color: var(--brand); height: 5px;
}
.swatches { display: flex; gap: 8px; }
.swatch {
  flex: 1; height: 34px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); font-size: 12px; font-weight: 700;
}
.swatch.on { border-color: var(--brand); }
.swatch[data-bg='dark']   { background: #17171B; color: #fff; }
.swatch[data-bg='light']  { background: #F2F2F4; color: #111; }
.swatch[data-bg='sepia']  { background: #EFE3CC; color: #4a3b22; }

.page-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px 0 44px; }
.page-nav .counter { font-size: 14px; font-weight: 700; color: var(--text2); min-width: 90px; text-align: center; }

/* ---------------------------------------------------------------- saved page */
.tabs { display: flex; gap: 8px; margin: 20px 0 24px; border-bottom: 1px solid var(--border); }
.tab {
  position: relative; padding: 11px 18px; font-size: 14.5px; font-weight: 700;
  color: var(--muted); transition: .18s;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); }
.tab.on::after {
  content: ''; position: absolute; inset-block-end: -1px; inset-inline: 12px;
  height: 2.5px; background: var(--brand); border-radius: 3px;
}
.tab .count { font-size: 11.5px; background: var(--bg3); padding: 1px 7px; border-radius: 999px; margin-inline-start: 6px; }

.history-row {
  display: flex; align-items: center; gap: 14px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg2); margin-bottom: 10px; transition: .18s;
}
.history-row:hover { border-color: var(--border-hover); }
.history-row img { width: 46px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
.history-row .info { flex: 1; min-width: 0; }
.history-row .info strong { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-row .info small { color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- about page */
.about-hero {
  position: relative; overflow: hidden; margin-block-start: 26px;
  padding: 56px 40px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background-size: cover; background-position: center;
}
.about-hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10, 10, 12, .95), rgba(10, 10, 12, .6));
}
[dir='rtl'] .about-hero::before { background: linear-gradient(270deg, rgba(10, 10, 12, .95), rgba(10, 10, 12, .6)); }
.about-hero > * { position: relative; z-index: 2; }
.about-hero h1 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 900; letter-spacing: -1px; color: #fff; }
.about-hero p { color: rgba(255, 255, 255, .78); margin: 8px 0 0; font-size: 16px; }

.block { margin-block: 34px; }
.block-title { font-size: 23px; font-weight: 900; margin-bottom: 16px; display: flex; align-items: center; gap: 11px; }
.block-title::before { content: ''; width: 4px; height: 22px; border-radius: 4px; background: linear-gradient(180deg, var(--brand), var(--gold)); }
.block-text { color: var(--text2); line-height: 1.95; font-size: 15.5px; max-width: 820px; }
.block-text p:last-child { margin-bottom: 0; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature {
  padding: 22px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: .2s var(--ease);
}
.feature:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.feature .ico {
  width: 46px; height: 46px; display: grid; place-items: center; font-size: 20px;
  border-radius: 13px; margin-bottom: 14px;
  background: rgba(var(--brand-rgb), .13); color: var(--brand);
}
.feature h4 { font-size: 16.5px; font-weight: 900; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.8; }

.link-grid { display: flex; gap: 12px; flex-wrap: wrap; }

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat-strip .stat { flex-direction: column; text-align: center; gap: 8px; padding: 24px 16px; }
.stat-strip .stat strong { font-size: 30px; font-weight: 900; background: linear-gradient(135deg, var(--brand), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-strip .stat small { font-size: 13px; }

.faq { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg2); }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  padding: 16px 20px; font-weight: 800; font-size: 15.5px; cursor: pointer;
  list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center;
  transition: background .16s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 22px; color: var(--brand); font-weight: 400; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { background: var(--bg3); }
.faq .ans { padding: 0 20px 18px; color: var(--text2); font-size: 14.5px; line-height: 1.9; }
.faq .ans p { margin: 0; }

.block-image img { border-radius: var(--radius); border: 1px solid var(--border); width: 100%; }
.block-image figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; text-align: center; }

.callout {
  padding: 18px 22px; border-radius: var(--radius);
  background: rgba(212, 175, 55, .1); border: 1px solid rgba(212, 175, 55, .35);
  color: var(--text2); font-size: 15px;
}

/* ---------------------------------------------------------------- ad slot */
.ad-slot {
  display: grid; place-items: center; min-height: 90px; margin-block: 24px;
  padding: 12px; border: 1px dashed var(--border-hover); border-radius: var(--radius);
  background: var(--bg2); color: var(--muted); font-size: 12px; letter-spacing: .5px;
}

/* ---------------------------------------------------------------- footer */
.mj-site-footer {
  margin-block-start: 70px;
  background: var(--bg2); border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr repeat(auto-fit, minmax(170px, 1fr));
  gap: 34px; padding-block: 46px 34px;
}
.footer-brand p { color: var(--muted); font-size: 14px; margin: 12px 0 0; max-width: 300px; }
.footer-col h4 { font-size: 15px; font-weight: 900; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--text2); font-size: 14px; transition: .16s; display: inline-flex; align-items: center; gap: 8px; }
.footer-col a:hover { color: var(--brand); transform: translateX(3px); }
[dir='rtl'] .footer-col a:hover { transform: translateX(-3px); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
  padding-block: 18px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 13px;
}
.footer-bottom p { margin: 0; }

/* ---------------------------------------------------------------- search overlay */
.search-overlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  flex-direction: column; align-items: center;
  padding-block: 70px 40px;
  background: rgba(4, 4, 6, .97); backdrop-filter: blur(14px);
  overflow-y: auto;
}
.search-overlay.open { display: flex; animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.search-close {
  position: absolute; inset-block-start: 22px; inset-inline-end: 22px;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border-hover);
  color: var(--text2); display: grid; place-items: center;
  transition: .2s var(--ease);
}
.search-close:hover { color: #fff; transform: rotate(90deg); border-color: var(--brand); }
.search-box { width: min(720px, calc(100% - 32px)); }
.search-box h2 { font-size: 20px; font-weight: 900; color: #fff; margin-bottom: 16px; }
.search-input-wrap { position: relative; }
.search-input-wrap svg {
  position: absolute; inset-inline-start: 18px; inset-block-start: 50%;
  transform: translateY(-50%); width: 22px; height: 22px; color: var(--brand);
}
.search-input-wrap input {
  width: 100%; padding: 18px 54px; font-size: 20px; font-weight: 700;
  background: rgba(38, 38, 43, .8); color: #fff;
  border: 2px solid rgba(255, 255, 255, .16); border-radius: var(--radius);
  outline: none; transition: .2s;
}
.search-input-wrap input::placeholder { color: #78787F; font-weight: 500; }
.search-input-wrap input:focus { border-color: var(--brand); }
.search-hint { color: var(--muted); font-size: 13.5px; margin-top: 10px; }
.search-sugs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.search-sugs button {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  color: #B8B8BF; transition: .18s;
}
.search-sugs button:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.search-results { margin-top: 26px; display: grid; gap: 10px; }
.search-result {
  display: flex; align-items: center; gap: 14px; padding: 11px;
  background: rgba(38, 38, 43, .6); border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius); transition: .18s;
}
.search-result:hover { border-color: var(--brand); background: rgba(var(--brand-rgb), .1); transform: translateX(4px); }
[dir='rtl'] .search-result:hover { transform: translateX(-4px); }
.search-result img { width: 42px; height: 58px; object-fit: cover; border-radius: 5px; flex: none; }
.search-result .meta { min-width: 0; }
.search-result .meta strong { display: block; color: #fff; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result .meta small { color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- toast + misc */
.toast {
  position: fixed; z-index: 120; inset-block-end: 26px; inset-inline-start: 50%;
  transform: translate(50%, 24px);
  padding: 13px 22px; border-radius: var(--radius);
  background: var(--elevated); border: 1px solid var(--border-hover);
  color: var(--text); font-size: 14.5px; font-weight: 700;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: .24s var(--ease);
}
[dir='ltr'] .toast { transform: translate(-50%, 24px); }
.toast.show { opacity: 1; transform: translate(50%, 0); }
[dir='ltr'] .toast.show { transform: translate(-50%, 0); }

.back-top {
  position: fixed; z-index: 70; inset-block-end: 22px; inset-inline-end: 22px;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff; box-shadow: var(--shadow-brand);
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: .22s var(--ease);
}
.back-top.show { opacity: 1; pointer-events: auto; transform: none; }
.back-top:hover { filter: brightness(1.12); }

.loading-bar { height: 3px; width: 100%; overflow: hidden; background: var(--bg3); border-radius: 3px; }
.loading-bar::after { content: ''; display: block; height: 100%; width: 40%; background: var(--brand); animation: slide 1s infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(350%); } }

.pagination { display: flex; gap: 8px; justify-content: center; margin-block: 30px; flex-wrap: wrap; }
.pagination button {
  min-width: 40px; height: 40px; padding-inline: 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg2); color: var(--text2);
  font-weight: 700; font-size: 14px; transition: .16s;
}
.pagination button:hover { border-color: var(--border-hover); color: var(--text); }
.pagination button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination button:disabled { opacity: .35; pointer-events: none; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .grid, .mj-grid { --cols: 5 !important; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-columns { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .menu-btn { display: grid; }
  .hero-content { padding: 44px 32px 38px; }
  .detail-hero { grid-template-columns: 170px 1fr; gap: 22px; padding: 24px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .shell { width: min(var(--shell), calc(100% - 28px)); }
  :root { --header-h: 62px; }
  .nav { gap: 12px; }
  .brand { font-size: 18px; }
  .brand img { height: 32px; }
  .promo-pill { display: none; }
  .hero { min-height: 400px; margin-block-start: 16px; }
  .hero-content { padding: 34px 22px 30px; }
  .hero h1 { letter-spacing: -.6px; }
  .hero-desc { font-size: 14.5px; line-height: 1.8; }
  .stats { gap: 9px; }
  .stat { flex-direction: column; text-align: center; gap: 7px; padding: 14px 8px; }
  .stat strong { font-size: 15px; }
  .stat small { font-size: 10.5px; }
  .section { padding-block: 26px 2px; }
  .section-title { font-size: 20px; }
  .section-head { flex-wrap: wrap; gap: 10px; }
  .grid, .mj-grid { --cols: 3 !important; gap: 16px 10px; }
  .card-title { font-size: 13px; min-height: 40px; }
  .card-sub { font-size: 11px; }
  .bookmark { opacity: 1; transform: none; width: 30px; height: 30px; font-size: 14px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-card { min-height: 116px; padding: 14px; }
  .cat-name { font-size: 16px; }
  .cat-meta, .cat-count { font-size: 11px; }
  .promo { padding: 26px 22px; }
  .promo h3 { font-size: 20px; }
  .page-intro { padding: 26px 0 4px; }
  .toolbar { padding: 11px; gap: 8px; }
  .select { flex: 1 1 130px; min-width: 0; }
  .result-count { width: 100%; margin-inline-start: 0; }
  .detail-hero { grid-template-columns: 108px 1fr; gap: 15px; padding: 16px; align-items: start; }
  .detail-cover { border-radius: 8px; }
  .detail-copy h1 { font-size: 23px; margin: 7px 0; }
  .detail-desc { font-size: 13.5px; line-height: 1.75; }
  .panel { padding: 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; padding-block: 32px 24px; }
  .search-overlay { padding-block: 60px 30px; }
  .search-input-wrap input { font-size: 17px; padding: 15px 48px; }
  .settings-panel { inset-inline: 14px; width: auto; inset-block-end: 14px; }
  .reader-bar { inset-block-start: var(--header-h); }
}

@media (max-width: 430px) {
  .grid, .mj-grid { --cols: 2 !important; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}


/* =============================================================================
   WordPress adapter: old theme pages (manga, reader, library, search) take the
   new palette; cards from Manga Studio look like the Manjatak cards.
   ============================================================================= */
body, body.dark-mode {
  --primary: var(--brand); --primary-dark: var(--brand-dark); --primary-light: var(--brand);
  --surface: var(--bg2); --surface-alt: var(--bg3); --card-bg: var(--bg2); --card-border: var(--border);
  --mica-bg: var(--bg2); --text-light: var(--text2); --text-disabled: var(--muted);
  --radius-md: var(--radius-sm); --radius-xl: var(--radius-lg);
  --mr-font: var(--font);
}
body:not(.dark-mode) {
  --primary: var(--brand); --primary-dark: var(--brand-dark);
  --surface: #fff; --surface-alt: #EDEDF1; --card-bg: #fff; --card-border: rgba(0,0,0,.10);
  --mica-bg: #fff; --text-light: #4A4A55; --text-disabled: #77777F;
}
body.mj { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; }
html[dir="rtl"] body.mj, body.mj.rtl { font-family: var(--font); }
body.mj::before, body.mj::after { display: none; }
body.mj.mr-has-bg::before { display: block; }
.mj-wrapper { padding-bottom: 40px; min-height: 60vh; }
.mj .container { max-width: none; padding: 0; }
.mj a { color: inherit; }
.mj .mj-wrapper a:hover { color: var(--brand); }
.mj .btn { padding: 11px 20px; }

/* header / footer (renamed so the old theme CSS cannot touch them) */
.mj-site-header .nav-links a { font-size: 14.5px; }
.dark-mode-toggle .sun-icon { display: none; }
body.dark-mode .dark-mode-toggle .sun-icon { display: block; }
body.dark-mode .dark-mode-toggle .moon-icon { display: none; }
.dark-mode-toggle svg { width: 19px; height: 19px; }
.brand-name { white-space: nowrap; }
.mj-site-footer .brand { margin-bottom: 8px; }

/* Manga Studio cards -> Manjatak cards */
.mr-grid { display: grid; gap: 22px 16px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.mr-grid.mj-grid { grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); }
.mr-card { position: relative; min-width: 0; display: flex; flex-direction: column; }
.mr-card-cover {
  position: relative; display: block; overflow: hidden; aspect-ratio: 2 / 2.85;
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: none;
}
.mr-card-cover::after { content: ''; position: absolute; inset: 40% 0 0; pointer-events: none; background: linear-gradient(0deg, rgba(6,6,8,.85), transparent); }
.mr-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.mr-card:hover .mr-card-cover img { transform: scale(1.06); }
.mr-badge { font-weight: 800; border-radius: 7px; z-index: 2; }
.mr-badge-status { background: var(--brand); color: #fff; inset-inline-start: 9px; top: 9px; }
.mr-badge-lang { background: var(--gold); color: #1a1400; }
.mr-badge-langs { z-index: 2; top: 9px; inset-inline-end: 9px; }
.mr-card-title { margin: 10px 1px 3px; text-align: start; font-size: 14.5px; font-weight: 800; line-height: 1.5; }
.mr-card-title a { color: var(--text); }
.mr-card-title a:hover { color: var(--brand); }
.mr-card-sub { text-align: start; color: var(--muted); }
.mr-card-chapters { gap: 6px; margin-top: 8px; }
.mr-ch {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text2); transition: .18s;
}
.mr-ch:hover { border-color: var(--brand); color: var(--text); }
.mr-ch-num { font-weight: 800; color: var(--text); }
.mr-ch-date { color: var(--muted); font-size: 11.5px; }
.mr-new { background: var(--gold); color: #1a1400; border-radius: 5px; padding: 1px 6px; font-size: 10px; margin-inline-start: 4px; }
.mr-card-empty { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* titles, chips, pagination */
.mr-section-head { align-items: flex-end; margin: 26px 0 18px; }
.mr-section-head h2, .mr-page-title { font-size: 24px; font-weight: 900; display: flex; align-items: center; gap: 11px; }
.mr-section-head h2::before, .mr-page-title::before { content: ''; width: 4px; height: 24px; border-radius: 4px; background: linear-gradient(180deg, var(--brand), var(--gold)); }
.mr-chip-link, .mr-lang-chip {
  display: inline-flex; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--bg2); border: 1px solid var(--border-hover); color: var(--text2);
}
.mr-chip-link:hover, .mr-lang-chip:hover { border-color: var(--brand); color: var(--text); }
.mr-chip-link.is-active, .mr-lang-chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 30px 0; }
.pagination .page-numbers { padding: 8px 14px; border-radius: var(--radius-sm); background: var(--bg2); border: 1px solid var(--border); font-weight: 700; }
.pagination .page-numbers.current, .pagination .page-numbers:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.mr-empty-state { padding: 40px 10px; text-align: center; color: var(--muted); }

/* search popup */
.search-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 90px 16px; background: rgba(5,5,7,.78); backdrop-filter: blur(8px); }
.search-modal.active { display: flex; }
.search-modal-content { position: relative; width: min(640px, 100%); padding: 28px; background: var(--bg2); border: 1px solid var(--border-hover); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.search-modal-content h3 { font-size: 20px; margin-bottom: 14px; }
.search-modal-close { position: absolute; inset-block-start: 10px; inset-inline-end: 14px; font-size: 28px; color: var(--text2); line-height: 1; }
.search-form-modal { display: flex; gap: 8px; }
.search-input-modal { flex: 1; min-width: 0; padding: 13px 16px; background: var(--bg3); border: 1px solid var(--border-hover); border-radius: var(--radius-sm); color: var(--text); }
.search-input-modal:focus { outline: 2px solid var(--brand); }
.search-button-modal { padding: 0 22px; background: var(--brand); color: #fff; border-radius: var(--radius-sm); font-weight: 800; }
.search-suggestions { margin-top: 18px; color: var(--muted); font-size: 13px; }
.popular-manga-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.popular-manga-list a { padding: 6px 12px; background: var(--bg3); border-radius: 999px; font-size: 13px; color: var(--text2); }
.popular-manga-list a:hover { background: var(--brand); color: #fff !important; }

/* manga page + reader chrome (old classes, new palette) */
.widget, .manga-item {
  background: var(--bg2) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; color: var(--text);
  backdrop-filter: none !important; box-shadow: none !important;
}
.mj input[type=text], .mj input[type=search], .mj input[type=email], .mj input[type=password], .mj select, .mj textarea {
  background: var(--bg3); color: var(--text); border: 1px solid var(--border-hover); border-radius: var(--radius-sm);
}
.mj .entry-content, .mj .page-content { color: var(--text2); line-height: 1.9; }
.mj .entry-content a { color: var(--brand); }

/* extra blocks + info page */
.mj-info { padding-bottom: 20px; }
.ad-slot { margin: 22px 0; text-align: center; }
.block-title { margin: 22px 0 4px; font-size: 22px; }
@media (max-width: 1100px) { .mr-grid.mj-grid { --cols: var(--colst, 5) !important; } }
@media (max-width: 760px) { .mr-grid.mj-grid { --cols: var(--colsm, 3) !important; gap: 16px 10px; } .mr-grid { grid-template-columns: repeat(var(--colsm, 3), minmax(0, 1fr)); gap: 16px 10px; } .search-modal { padding-top: 60px; } }
@media (max-width: 430px) { .mr-grid.mj-grid, .mr-grid { --cols: var(--colsxs, 2) !important; grid-template-columns: repeat(var(--colsxs, 2), minmax(0, 1fr)); } }


/* =============================================================================
   Inner pages in the Manjatak look
   ============================================================================= */
/* manga page */
.mj-manga { padding-top: 26px; }
.detail-desc p { margin: 0 0 .8em; }
.mj-actions { margin-top: 16px; }
.mj-actions .mr-btn, .mj-actions button, .mj-actions a { border-radius: var(--radius-sm); }
.mr-alt-names { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--text2); font-size: 13.5px; margin: 0 0 10px; }
.mr-alt-names b { color: var(--text); }
.mr-mature { display: inline-block; margin: 0 0 10px; padding: 6px 12px; border-radius: var(--radius-sm); background: rgba(var(--brand-rgb), .14); border: 1px solid rgba(var(--brand-rgb), .45); color: #FF8C95; font-size: 13px; font-weight: 700; }
.mj-ch-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mj-ch-head h2 { margin: 0; }
.mj-ch-ctl { display: flex; gap: 8px; }
.chip { cursor: pointer; }
.mj-ch-list { display: flex; flex-direction: column; max-height: 640px; overflow: auto; padding-inline-end: 4px; }
.mj-ch-list .chapter-row { text-decoration: none; }
.mj-ch-meta { display: inline-flex; align-items: center; gap: 8px; }
.mj-new { padding: 2px 8px; border-radius: 6px; background: var(--gold); color: #1a1400; font-size: 10.5px; font-weight: 900; }
.mr-lang-tag { padding: 2px 8px; border-radius: 6px; background: rgba(var(--brand-rgb), .16); color: var(--brand); font-size: 11px; font-weight: 800; }
.mr-manga-chips { margin-bottom: 12px; }
.mr-team { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.mr-team-head, .mr-team-row { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 8px; padding: 9px 12px; font-size: 13px; align-items: center; }
.mr-team-head { background: var(--bg3); color: var(--muted); font-weight: 700; }
.mr-team-row { border-top: 1px solid var(--border); }
.mr-team-cell a { color: var(--brand); font-weight: 700; }
.mr-related { padding-bottom: 10px; }

/* library / archive filter bar = test-site toolbar */
.mr-browse { padding-bottom: 10px; }
.mr-browse-bar, .mr-search-form {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 18px 0 16px; padding: 15px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
}
.mr-browse-bar input[type=search], .mr-search-form input[type=search] { flex: 1 1 260px; min-width: 180px; height: 44px; padding: 0 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); }
.mr-browse-bar select { height: 44px; min-width: 140px; padding: 0 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text2); }
.mr-browse-bar input:focus, .mr-browse-bar select:focus, .mr-search-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .16); }
.mr-search-form button, .mr-browse-bar button[type=submit] { height: 44px; padding: 0 22px; border-radius: var(--radius-sm); background: var(--brand); color: #fff; font-weight: 800; box-shadow: var(--shadow-brand); border: 0; }
.mr-browse-count { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.mr-browse-results.is-loading { opacity: .5; transition: opacity .2s; }
.mr-browse .mr-btn, .mr-lib-tabs .mr-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06); border: 1px solid var(--border-hover); color: var(--text); font-weight: 700; cursor: pointer;
}
.mr-browse .mr-btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
body:not(.dark-mode) .mr-browse .mr-btn { background: rgba(0,0,0,.04); }
.mr-lib-tabs { margin: 12px 0 18px; }

/* reader: same toolbar language as the Manjatak reader */
body.single-chapter .mj-site-header { position: static; }
.mr-bar { background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom: 1px solid var(--border); }
.mr-btn {
  padding: 9px 14px; border-radius: var(--radius-sm); font-weight: 700; font-size: 13.5px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border-hover); color: var(--text);
  transition: transform .18s var(--ease), background .18s, border-color .18s;
}
body:not(.dark-mode) .mr-btn { background: rgba(0,0,0,.04); }
.mr-btn:hover { border-color: var(--brand); color: var(--text); transform: translateY(-1px); }
.mr-btn-primary { background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important; box-shadow: var(--shadow-brand); }
.mr-select { background: var(--bg2); border: 1px solid var(--border-hover); border-radius: var(--radius-sm); color: var(--text); font-weight: 700; }
.mr-counter { color: var(--gold); font-weight: 800; }
.mr-panel { background: var(--bg2); border-top: 1px solid var(--border); max-width: none; }
.mr-panel > .mr-group, .mr-panel { color: var(--text); }
.mr-label { color: var(--muted); font-weight: 800; }
.mr-chip { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text2); font-weight: 700; }
.mr-chip:hover { border-color: var(--border-hover); color: var(--text); }
.mr-chip.is-active { background: rgba(var(--brand-rgb), .18); border-color: rgba(var(--brand-rgb), .65); color: #fff; }
body:not(.dark-mode) .mr-chip.is-active { color: var(--brand); }
.mr-langs { display: inline-flex; gap: 4px; }
.mr-langs a, .mr-langs .is-current { padding: 6px 10px; border-radius: 7px; font-size: 12px; font-weight: 800; background: var(--bg3); color: var(--text2); }
.mr-langs .is-current { background: var(--brand); color: #fff; }
.mr-end { padding: 34px 16px 46px; }
.mr-credit { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 0 16px 40px; }
.mr-credit-who { display: flex; align-items: center; gap: 10px; }
.mr-credit-who img { border-radius: 50%; }
.mr-credit small { display: block; color: var(--muted); }
.mr-comments { max-width: 860px; margin: 0 auto 40px; padding: 0 16px; }
.mr-reader[data-bg="auto"] .mr-stage { background: var(--bg); }

/* search + 404 + generic page */
.mr-search .mr-grid { margin-top: 10px; }
.mr-card-match { color: var(--gold); }
.mr-404 { margin: 40px 0; }
.mr-page .block-text { max-width: 860px; }
.mr-page-body a { color: var(--brand); }
.mr-page-body h2, .mr-page-body h3 { margin: 1.4em 0 .5em; }
.mr-page-body ul, .mr-page-body ol { padding-inline-start: 1.4em; margin: 0 0 1em; }
.author .mr-page-title { margin-top: 26px; }

/* reader toolbar buttons: beat the old ".mr-nav a" menu rule */
.mr-bar .mr-nav a.mr-btn, .mr-bar .mr-nav span.mr-btn {
  display: inline-flex; padding: 9px 14px; gap: 6px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06); border: 1px solid var(--border-hover); color: var(--text); font-size: 13.5px; font-weight: 700;
}
body:not(.dark-mode) .mr-bar .mr-nav a.mr-btn { background: rgba(0,0,0,.04); }
.mr-bar .mr-nav a.mr-btn:hover { border-color: var(--brand); color: var(--text); }


/* =============================================================================
   Site Builder features
   ============================================================================= */
.btn, .mr-btn, .search-button-modal { border-radius: var(--btn-r, var(--radius-sm)); }
.mr-card-cover, .cover-wrap { border-radius: var(--card-r, var(--radius-sm)); }
.hide-ch .mr-card-chapters, .hide-ch .mr-card-empty { display: none; }

/* home section boxes */
.mj-sec { position: relative; isolation: isolate; padding-block: var(--pt, 0px) var(--pb, 0px); }
.mj-sec-grid, .mj-sec-categories, .mj-sec-content, .mj-sec-stats { --pt: 0px; --pb: 0px; }
.mj-sec .section { padding-block: 36px 4px; }
.mj-sec[style*="--pt"] .section, .mj-sec[style*="--pb"] .section { padding-block: 0; }
.mj-sec.has-bg { background-color: var(--sb, transparent); background-image: var(--si, none); background-size: cover; background-position: center; border-radius: var(--radius-lg); margin-block: 14px; }
.mj-sec.has-bg::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: rgba(0,0,0,var(--so, 0)); }
.mj-sec.has-bg > .mj-sec-in { padding-inline: 28px; }
.mj-sec.has-bg .section { padding-block: 28px; }
.mj-sec.is-full { width: 100vw; margin-inline: calc(50% - 50vw); border-radius: 0; }
.mj-sec.is-full > .mj-sec-in { width: min(var(--shell), calc(100% - 40px)); margin-inline: auto; padding-inline: 0; }
.mj-sec.al-center { text-align: center; }
.mj-sec.al-center .section-head { justify-content: center; text-align: center; flex-direction: column; align-items: center; }
.mj-sec.al-center .mj-links, .mj-sec.al-center .hero-actions { justify-content: center; }
.mj-sec.al-end { text-align: end; }
@media (max-width: 760px) { .mj-sec.hide-m { display: none; } }
@media (min-width: 761px) { .mj-sec.hide-d { display: none; } }

/* hero layouts */
.hero { align-items: center; }
.hero.hero-center .hero-content { margin-inline: auto; text-align: center; }
.hero.hero-center .hero-meta, .hero.hero-center .hero-actions { justify-content: center; }
.hero.hero-center::before { background: linear-gradient(0deg, var(--bg), transparent 55%), rgba(0,0,0,var(--hero-overlay, .6)); }
.hero.hero-right .hero-content { margin-inline-start: auto; margin-inline-end: 0; }

/* banner variants */
.promo { background-size: cover; background-position: center; position: relative; isolation: isolate; }
.promo::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: rgba(0,0,0,var(--promo-overlay, 0)); }
.promo.promo-center { flex-direction: column; text-align: center; justify-content: center; }
.promo.promo-end { flex-direction: row-reverse; }

/* image + link list sections */
.mj-img { display: block; overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--border); margin: 0; }
.mj-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mj-img:hover { border-color: var(--brand); }
.mj-links { display: flex; flex-wrap: wrap; gap: 12px; }
.mj-links-cards .mj-link { flex: 1 1 200px; display: flex; align-items: center; gap: 12px; padding: 18px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); font-weight: 800; transition: .2s; }
.mj-links-cards .mj-link:hover { border-color: var(--brand); transform: translateY(-3px); }
.mj-links-cards .mj-link-i { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: rgba(var(--brand-rgb), .14); color: var(--brand); font-size: 18px; }
.mj-links-chips .mj-link { padding: 8px 16px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--border-hover); font-weight: 700; font-size: 14px; }
.mj-links-chips .mj-link:hover { background: var(--brand); border-color: var(--brand); color: #fff !important; }
.mj-links-list { flex-direction: column; gap: 4px; }
.mj-links-list .mj-link { padding: 8px 0; border-bottom: 1px solid var(--border); }
.mj-link-i { margin-inline-end: 4px; }

/* header: layout, background and menu styles */
.mj-site-header { min-height: var(--header-h, 72px); }
.mj-site-header .nav { min-height: var(--header-h, 72px); }
.mj-site-header.not-sticky { position: relative; }
.mj-site-header.bgm-solid { background: var(--hbg, var(--bg2)); backdrop-filter: none; }
.mj-site-header.bgm-transparent { background: var(--hbg, transparent); border-color: transparent; backdrop-filter: none; }
.mj-site-header.bgm-blur[style*="--hbg"] { background: var(--hbg); }
.mj-site-header.hdr-center .nav { position: relative; }
.mj-site-header.hdr-center .brand { order: 2; position: absolute; inset-inline: 0; margin-inline: auto; width: max-content; }
.mj-site-header.hdr-center .nav-links { order: 1; }
.mj-site-header.hdr-center .nav-tools { order: 3; margin-inline-start: auto; }
.mj-site-header.menu-pill .nav-links a::after { display: none; }
.mj-site-header.menu-pill .nav-links a.active { background: rgba(var(--brand-rgb), .16); color: var(--text); }
.mj-site-header.menu-plain .nav-links a::after { display: none; }
.mj-site-header.menu-plain .nav-links a.active { color: var(--brand); }
.nav-badge { margin-inline-start: 6px; padding: 1px 7px; border-radius: 6px; background: var(--gold); color: #1a1400; font-size: 10px; font-weight: 900; }
@media (max-width: 900px) { .mj-site-header.hdr-center .brand { position: static; margin: 0; } }

/* footer link layouts */
.mj-site-footer.ft-center { text-align: center; }
.mj-site-footer.ft-center .footer-grid { justify-items: center; }
.footer-col.d-inline ul { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-col.d-chips ul { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-col.d-chips li a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--bg3); border: 1px solid var(--border-hover); font-size: 13.5px; font-weight: 700; }
.footer-col.d-chips li a:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.footer-col.d-buttons ul { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.footer-col.d-buttons li a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: var(--btn-r, 8px); background: var(--brand); color: #fff; font-weight: 800; }
.footer-col.d-buttons li a:hover { background: var(--brand-dark); color: #fff; }
.footer-col.d-grid ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }

/* ================================================================ footer v2 (wide) */
.mj-site-footer .footer-grid {
  display: grid; align-items: start; gap: 34px 44px; padding-block: 48px 30px;
  grid-template-columns: minmax(250px, 1.55fr) repeat(var(--fcols, 3), minmax(0, 1fr));
}
.mj-site-footer.ft-nobrand .footer-grid { grid-template-columns: repeat(var(--fcols, 3), minmax(0, 1fr)); }
.mj-site-footer .footer-brand p { max-width: 340px; line-height: 1.8; margin: 14px 0 0; color: var(--text2); }
.mj-site-footer .footer-col h4 { margin: 0 0 16px; font-size: 15px; font-weight: 900; display: flex; align-items: center; gap: 9px; }
.mj-site-footer.ft-mark .footer-col h4::before { content: ""; width: 4px; height: 15px; border-radius: 3px; background: var(--brand); flex: none; }
.mj-site-footer .footer-col ul { gap: 11px; }
.mj-site-footer .footer-col a { color: var(--text2); }
.mj-site-footer .footer-col a:hover { color: var(--brand); transform: none; }
.mj-site-footer .footer-col.d-chips a:hover, .mj-site-footer .footer-col.d-buttons a:hover { color: #fff; }

.footer-social { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.footer-social a {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px;
  color: var(--text2); background: var(--bg3); border: 1px solid var(--border-hover);
  transition: background .16s, color .16s, transform .16s, border-color .16s;
}
.footer-social a:hover { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateY(-2px); }
.footer-social.is-bottom { margin-top: 0; }
.footer-social.is-bottom a { width: 36px; height: 36px; border-radius: 9px; }

.mj-site-footer .footer-bottom { padding-block: 20px 26px; }
.mj-site-footer.ft-nodiv .footer-bottom { border-top: 0; }
.mj-site-footer .fb-credit a { color: inherit; border-bottom: 1px dotted currentColor; }
.mj-site-footer .fb-credit a:hover { color: var(--brand); }

/* tablet: brand on its own row, columns share the next row */
@media (max-width: 1000px) {
  .mj-site-footer.ft-wide .footer-grid { grid-template-columns: repeat(var(--fcols, 3), minmax(0, 1fr)); gap: 30px 28px; }
  .mj-site-footer.ft-wide .footer-brand { grid-column: 1 / -1; }
}
/* phone: columns stay side by side (2 per row by default), brand on top */
@media (max-width: 760px) {
  .mj-site-footer.ft-wide .footer-grid { grid-template-columns: repeat(var(--fcm, 2), minmax(0, 1fr)); gap: 26px 18px; padding-block: 34px 22px; }
  .mj-site-footer.ft-wide .footer-brand { grid-column: 1 / -1; }
  .mj-site-footer.ft-wide .footer-col.d-chips, .mj-site-footer.ft-wide .footer-col.d-buttons, .mj-site-footer.ft-wide .footer-col.d-inline, .mj-site-footer.ft-wide .footer-col.d-grid, .mj-site-footer.ft-wide .footer-col:has(> p) { grid-column: 1 / -1; }
  .mj-site-footer .footer-col a { font-size: 13.5px; }
  .mj-site-footer .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}
/* stacked: the old one-under-another layout */
.mj-site-footer.ft-stacked .footer-grid { grid-template-columns: 1fr; }
/* centered */
.mj-site-footer.ft-center .footer-grid { justify-items: center; text-align: center; }
.mj-site-footer.ft-center .footer-brand { display: flex; flex-direction: column; align-items: center; }
.mj-site-footer.ft-center .footer-social, .mj-site-footer.ft-center .footer-col ul { justify-content: center; justify-items: center; }
.mj-site-footer.ft-center .footer-col h4 { justify-content: center; }
.mj-site-footer.ft-center .footer-bottom { justify-content: center; text-align: center; }
@media (max-width: 760px) { .mj-site-footer.ft-center .footer-bottom { align-items: center; } }

/* ================================================================ announcement bar, density, card hover */
.mj-announce { background: var(--brand); color: #fff; font-size: 13.5px; font-weight: 700; }
.mj-announce .shell { position: relative; display: flex; align-items: center; justify-content: center; min-height: 38px; padding-block: 6px; padding-inline: 34px; text-align: center; }
.mj-announce a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.mj-announce-x { position: absolute; inset-inline-end: 0; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.mj-announce-x:hover { background: rgba(255,255,255,.3); }
.mj-announce.is-hidden { display: none; }

body.dens-compact .section { padding-block: 22px 2px; }
body.dens-compact .mr-grid, body.dens-compact .mr-grid.mj-grid { gap: 14px 10px; }
body.dens-roomy .section { padding-block: 52px 8px; }
body.dens-roomy .mr-grid, body.dens-roomy .mr-grid.mj-grid { gap: 30px 22px; }

body.ch-none .mr-card:hover .mr-card-cover img, body.ch-none .card:hover .cover-wrap img { transform: none; }
body.ch-lift .mr-card:hover .mr-card-cover img, body.ch-lift .card:hover .cover-wrap img { transform: none; }
body.ch-lift .mr-card, body.ch-lift .card { transition: transform .18s ease, box-shadow .18s ease; }
body.ch-lift .mr-card:hover, body.ch-lift .card:hover { transform: translateY(-6px); }

/* ---------- Comments ---------- */
.mrc { background: var(--bg2); border: 1px solid var(--border); border-radius: 18px; padding: 20px; }
.mrc-top h2 { margin: 0 0 16px; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.mrc-count { background: var(--bg3); border-radius: 999px; padding: 2px 10px; font-size: 13px; color: var(--text2); }
.mrc-field { display: flex; gap: 12px; align-items: flex-start; }
.mrc-field img, .mrc-avatar img { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.mrc-field textarea { flex: 1; min-height: 84px; resize: vertical; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; font: inherit; }
.mrc-field textarea:focus { outline: none; border-color: var(--brand); }
.mrc-submit { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 10px; }
.mrc-as { color: var(--muted); font-size: 13px; margin-inline-end: auto; }
.mrc-form p { margin: 0; }
.mrc-login { text-align: center; padding: 22px 12px; background: var(--bg); border: 1px dashed var(--border-hover); border-radius: 14px; }
.mrc-login p { color: var(--text2); margin: 6px 0 14px; }
.mrc-login-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.mrc-list, .mrc-list ol { list-style: none; margin: 18px 0 0; padding: 0; }
.mrc-list ol { margin: 0; padding-inline-start: 24px; border-inline-start: 2px solid var(--border); margin-inline-start: 22px; }
.mrc-item { margin: 0; }
.mrc-body { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.mrc-main { flex: 1; min-width: 0; }
.mrc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mrc-name { font-size: 14px; }
.mrc-badge { background: var(--brand); color: #fff; border-radius: 6px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.mrc-head time { color: var(--muted); font-size: 12px; }
.mrc-text { margin-top: 6px; line-height: 1.7; overflow-wrap: anywhere; }
.mrc-text p { margin: 0 0 6px; }
.mrc-actions a { color: var(--text2); font-size: 13px; font-weight: 600; }
.mrc-wait { color: var(--gold); font-size: 13px; margin: 4px 0 0; }
.mrc-empty, .mrc-closed { color: var(--muted); text-align: center; padding: 18px 0 4px; }
.mrc .comment-reply-title, .mrc #cancel-comment-reply-link { font-size: 13px; }
@media (max-width: 560px) { .mrc { padding: 14px; border-radius: 14px; } .mrc-field img { display: none; } .mrc-list ol { padding-inline-start: 12px; margin-inline-start: 10px; } }

/* ---------- fixes: NEW badge, translator card ---------- */
.mr-ch { align-items: center; }
.mr-ch-num { display: inline-flex; align-items: center; gap: 6px; line-height: 1.3; }
.mr-ch-num .mr-new, .mr-ch-num b { display: inline-block; margin: 0; padding: 1px 6px; line-height: 1.5; font-size: 10px; border-radius: 5px; background: var(--gold); color: #1a1400; font-weight: 900; }
.mj-ch-meta .mj-new, .mj-chapter .mj-new { display: inline-block; line-height: 1.5; }
body .mr-credit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; max-width: 560px; margin: 0 auto 36px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg2); }
body .mr-credit .mr-credit-who { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-width: 0; }
body .mr-credit .mr-credit-who img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; }
body .mr-credit .mr-credit-who span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
body .mr-credit .mr-credit-who b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body .mr-credit .mr-btn { flex: none; }
body .mr-credit .mr-credit-pub { flex-basis: 100%; margin: 0; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text2); }
@media (max-width: 480px) { body .mr-credit { flex-direction: column; align-items: stretch; text-align: center; } body .mr-credit .mr-credit-who { justify-content: center; } }

/* genre cards: the picture is a real <img> (works even where inline background urls are blocked) */
.cat-card { background: linear-gradient(135deg, color-mix(in srgb, var(--cat, #E50914) 33%, transparent), var(--bg3)); isolation: isolate; }
.cat-card .cat-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.cat-card .cat-count { position: relative; z-index: 2; }

/* ---------- info pages ---------- */
.block.al-center, .block-text.al-center { text-align: center; margin-inline: auto; }
.block.al-end { text-align: end; }
.link-grid.al-center { justify-content: center; }
.link-grid.al-end { justify-content: flex-end; }
.block-image.al-center { margin-inline: auto; }
.block-image.al-end { margin-inline-start: auto; }
.pg-banner { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); min-height: 190px; display: flex; align-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 30%, var(--bg2)), var(--bg2)); }
.pg-banner-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pg-banner.has-img::after, .pg-banner:not(.no-img)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8,8,10,.78), rgba(8,8,10,.25)); }
.pg-banner-body { position: relative; z-index: 1; padding: 34px 30px; width: 100%; }
.pg-banner h1 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 38px); font-weight: 900; }
.pg-banner p { margin: 0; color: var(--text2); max-width: 640px; font-size: 16px; }
.pg-banner.al-center { text-align: center; } .pg-banner.al-center p { margin-inline: auto; }
.pg-imgtext { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: center; }
.pg-imgtext.no-img { grid-template-columns: 1fr; }
.pg-imgtext figure { margin: 0; } .pg-imgtext img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.pg-imgtext.img-end figure { order: 2; }
.pg-steps { list-style: none; counter-reset: st; padding: 0; display: grid; gap: 12px; }
.pg-steps li { counter-increment: st; display: grid; grid-template-columns: 38px 1fr; gap: 2px 14px; padding: 14px 16px; background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; }
.pg-steps li::before { content: counter(st); grid-row: span 2; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 900; }
.pg-steps b { font-size: 15.5px; } .pg-steps span { color: var(--text2); line-height: 1.8; font-size: 14.5px; }
.pg-contact { max-width: 640px; }
.pg-explore .section-head { margin-bottom: 14px; }
@media (max-width: 700px) { .pg-imgtext { grid-template-columns: 1fr; } .pg-imgtext.img-end figure { order: 0; } .pg-banner-body { padding: 24px 18px; } }

/* contact form */
.mj-contact { display: grid; gap: 14px; max-width: 640px; margin: 18px auto; }
.mj-contact .mj-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.mj-contact .mj-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mj-contact label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.mj-contact label > span { font-weight: 600; opacity: .85; }
.mj-contact input[type=text], .mj-contact input[type=email], .mj-contact select, .mj-contact textarea { width: 100%; box-sizing: border-box; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line, rgba(128,128,128,.35)); background: var(--card, rgba(128,128,128,.08)); color: inherit; font: inherit; }
.mj-contact textarea { min-height: 170px; resize: vertical; }
.mj-contact input:focus, .mj-contact select:focus, .mj-contact textarea:focus { outline: 2px solid var(--brand, #E50914); outline-offset: 1px; }
.mj-contact .btn { justify-self: start; }
.mj-form-msg { padding: 10px 14px; border-radius: 10px; max-width: 640px; margin: 10px auto; }
.mj-form-msg.ok { background: rgba(40,160,80,.15); } .mj-form-msg.bad { background: rgba(229,9,20,.15); }
@media (max-width: 560px) { .mj-contact .mj-row { grid-template-columns: 1fr; } }

/* theme toggle: the old animated-switch CSS hid the icons; show sun (in dark) / moon (in light) */
.icon-btn.dark-mode-toggle { width: 40px; height: 40px; background: var(--bg2); border: 1px solid var(--border); }
.icon-btn.dark-mode-toggle svg { position: static !important; opacity: 1 !important; transform: none !important; width: 19px; height: 19px; color: var(--text2); }
.icon-btn.dark-mode-toggle .sun-icon { color: #f5b301; }
.icon-btn.dark-mode-toggle .moon-icon { color: var(--text2); }

/* dropdown options must stay readable in both themes */
select, select option { color: var(--text, #111); }
select option { background: var(--bg2, #fff); }
.mj-contact select option { background: #1b1b22; color: #f2f2f5; }
body:not(.dark-mode) .mj-contact select option { background: #fff; color: #111; }

/* contact topics: buttons + sliding answer */
.mj-topics-wrap .mj-lbl { display: block; font-size: 14px; font-weight: 600; opacity: .85; margin-bottom: 8px; }
.mj-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.mj-topic { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border, rgba(128,128,128,.35)); background: var(--bg2, rgba(128,128,128,.1)); color: var(--text, inherit); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: .18s; }
.mj-topic:hover { border-color: var(--brand); }
.mj-topic.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.mj-answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.mj-answer > div { overflow: hidden; }
.mj-answer.open { grid-template-rows: 1fr; }
.mj-answer p { margin: 10px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(var(--brand-rgb, 229,9,20), .10); border-inline-start: 3px solid var(--brand); font-size: 14px; line-height: 1.7; }

/* ===== Language selector (globe button + animated panel) ===== */
.mr-lang { --lang-acc: var(--primary, var(--brand, #6366f1)); --lang-bg: var(--surface-alt, var(--bg2, #f3f4f8)); --lang-bd: var(--card-border, var(--border, rgba(127,127,127,.28))); --lang-tx: var(--text, #1b1d2a); --lang-panel: var(--surface, var(--bg, #fff)); position: relative; display: inline-block; font-size: 14px; line-height: 1.2; }
.mr-lang > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--lang-bd); background: var(--lang-bg); color: var(--lang-tx); font-weight: 700; user-select: none; -webkit-tap-highlight-color: transparent; transition: border-color .2s, box-shadow .2s, background .2s; }
.mr-lang > summary::-webkit-details-marker { display: none; }
.mr-lang > summary::marker { content: ""; }
.mr-lang > summary:hover, .mr-lang[open] > summary { border-color: var(--lang-acc); }
.mr-lang > summary:focus-visible { outline: 2px solid var(--lang-acc); outline-offset: 2px; }
.mr-lang[open] > summary { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lang-acc) 22%, transparent); }
.mr-lang-globe { color: var(--lang-acc); flex: none; }
.mr-lang-chev { opacity: .7; transition: transform .22s ease; flex: none; }
.mr-lang[open] .mr-lang-chev { transform: rotate(180deg); }
.mr-lang-panel { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0; z-index: 1000; margin: 0; padding: 6px; list-style: none; min-width: 210px; max-width: min(280px, calc(100vw - 24px)); background: var(--lang-panel); color: var(--lang-tx); border: 1px solid var(--lang-bd); border-radius: 18px; box-shadow: 0 22px 44px -14px rgba(0,0,0,.35); transform-origin: top; animation: mrLangIn .2s cubic-bezier(.2,.8,.2,1); }
.mr-lang-panel li { margin: 0; padding: 0; list-style: none; }
.mr-lang-panel a { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border-radius: 13px; color: inherit; text-decoration: none; font-weight: 700; transition: background .15s, transform .15s; }
.mr-lang-panel a:hover, .mr-lang-panel a:focus-visible { background: color-mix(in srgb, var(--lang-acc) 14%, transparent); outline: none; }
.mr-lang-panel a:active { transform: scale(.98); }
.mr-lang-panel a[aria-current="true"] { background: var(--lang-acc); color: #fff; }
.mr-lang-name { flex: 1; }
.mr-lang-code { font-size: 11px; font-weight: 800; letter-spacing: .06em; opacity: .6; }
.mr-lang-check { flex: none; }
.mr-lang[open] .mr-lang-panel li { animation: mrLangItem .22s ease both; }
.mr-lang[open] .mr-lang-panel li:nth-child(2) { animation-delay: .03s; }
.mr-lang[open] .mr-lang-panel li:nth-child(3) { animation-delay: .06s; }
.mr-lang[open] .mr-lang-panel li:nth-child(4) { animation-delay: .09s; }
@keyframes mrLangIn { from { opacity: 0; transform: translateY(-6px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes mrLangItem { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .mr-lang > summary { padding: 0 11px; } .mr-lang-panel { min-width: 200px; } }
@media (max-width: 380px) { .mr-lang-cur { display: none; } }
@media (prefers-reduced-motion: reduce) { .mr-lang-panel, .mr-lang[open] .mr-lang-panel li { animation: none; } .mr-lang-chev { transition: none; } }
