/* ==========================================================================
   Glassy Modern UI for Madara
   Loaded by the child theme AFTER the parent stylesheet.
   Madara naming: body.text-ui-light = DARK look, body.text-ui-dark = LIGHT look.
   Accent colour comes from the theme's own --primary-color (Customizer).
   ========================================================================== */

/* ---------- 1. Design tokens ------------------------------------------- */
body {
  --g-accent: var(--primary-color, #eb3349);
  --g-accent-2: #7c5cff;
  --g-radius-lg: 22px;
  --g-radius: 16px;
  --g-radius-sm: 11px;
  --g-blur: 18px;
  --g-sat: 160%;
  --g-ease: cubic-bezier(.22, .8, .24, 1);
  --g-font: 'Inter', 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* dark look */
body.text-ui-light {
  --g-bg-1: #0b0d1a;
  --g-bg-2: #12142b;
  --g-surface: rgba(255, 255, 255, .07);
  --g-surface-strong: rgba(24, 27, 52, .62);
  --g-surface-hover: rgba(255, 255, 255, .12);
  --g-border: rgba(255, 255, 255, .14);
  --g-border-soft: rgba(255, 255, 255, .08);
  --g-highlight: rgba(255, 255, 255, .22);
  --g-shadow: 0 10px 34px rgba(0, 0, 0, .38);
  --g-shadow-hover: 0 18px 46px rgba(0, 0, 0, .5);
  --g-text: #f3f5ff;
  --g-text-2: rgba(226, 230, 255, .74);
  --g-text-3: rgba(210, 215, 245, .52);
  --g-input: rgba(255, 255, 255, .08);
  --g-orb-1: rgba(235, 51, 73, .34);
  --g-orb-2: rgba(124, 92, 255, .36);
  --g-orb-3: rgba(34, 193, 220, .22);
  color-scheme: dark;
}

/* light look */
body.text-ui-dark {
  --g-bg-1: #eef1fb;
  --g-bg-2: #e3e8f8;
  --g-surface: rgba(255, 255, 255, .55);
  --g-surface-strong: rgba(255, 255, 255, .78);
  --g-surface-hover: rgba(255, 255, 255, .8);
  --g-border: rgba(255, 255, 255, .85);
  --g-border-soft: rgba(80, 90, 140, .12);
  --g-highlight: rgba(255, 255, 255, .95);
  --g-shadow: 0 10px 30px rgba(52, 62, 120, .13);
  --g-shadow-hover: 0 18px 42px rgba(52, 62, 120, .22);
  --g-text: #14172b;
  --g-text-2: #4a5170;
  --g-text-3: #7a819e;
  --g-input: rgba(255, 255, 255, .7);
  --g-orb-1: rgba(235, 51, 73, .2);
  --g-orb-2: rgba(124, 92, 255, .24);
  --g-orb-3: rgba(34, 193, 220, .2);
  color-scheme: light;
}

/* ---------- 2. Canvas: aurora background ------------------------------- */
html { scroll-behavior: smooth; }

body.text-ui-light,
body.text-ui-dark {
  font-family: var(--g-font) !important;
  color: var(--g-text-2) !important;
  background: linear-gradient(160deg, var(--g-bg-1), var(--g-bg-2)) fixed !important;
  -webkit-font-smoothing: antialiased;
}

body.text-ui-light::before,
body.text-ui-dark::before {
  content: "";
  position: fixed;
  inset: -10vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 12% 8%, var(--g-orb-1), transparent 70%),
    radial-gradient(44vmax 44vmax at 90% 18%, var(--g-orb-2), transparent 70%),
    radial-gradient(40vmax 40vmax at 55% 98%, var(--g-orb-3), transparent 70%);
}

body .site-content { padding-top: 22px; }
body .wrap,
body .body-wrap,
body .site-content,
body .c-page-content,
body .c-page,
body .main-col-inner,
body .c-blog-listing,
body .c-blog__inner { background: transparent !important; }

body h1, body h2, body h3, body h4, body h5, body h6,
body .h1, body .h2, body .h3, body .h4, body .h5, body .h6,
body .entry-title, body .item-title, body .widget-title { color: var(--g-text) !important; letter-spacing: -.01em; }

body a { transition: color .2s var(--g-ease), background-color .2s var(--g-ease), border-color .2s var(--g-ease), box-shadow .25s var(--g-ease), transform .25s var(--g-ease); }
body .post-title a, body .item-summary a, body .widget a { color: var(--g-text); }
body .post-title a:hover, body .item-summary a:hover, body .widget a:hover { color: var(--g-accent); }
body .meta, body .post-on, body .font-meta, body .chapter-release-date, body .author, body .meta-item { color: var(--g-text-3) !important; }

::selection { background: color-mix(in srgb, var(--g-accent) 35%, transparent); color: var(--g-text); }

/* ---------- 3. Reusable glass mixin (applied via grouped selectors) ---- */
body .site-header .c-header__top,
body .site-header .c-sub-header-nav,
body .c-main-navigation,
body .page-item-detail,
body .widget,
body .c-sidebar .widget,
body .profile-manga,
body .c-blog_item,
body .c-blog-post .c-blog__inner,
body .listing-chapters_wrap,
body .c-page__content .tab-content-wrap,
body .settings-page .tabs-content-wrap,
body .c-tabs-item__content,
body .comment-respond,
body #comments,
body .wpd-comment,
body .site-footer,
body .modal-content,
body .c-search-header__wrapper,
body .manga-slider .slider__item,
body .popular-item-wrap {
  background: var(--g-surface) !important;
  border: 1px solid var(--g-border) !important;
  box-shadow: var(--g-shadow), inset 0 1px 0 var(--g-highlight);
  -webkit-backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
  backdrop-filter: blur(var(--g-blur)) saturate(var(--g-sat));
}

/* ---------- 4. Header & navigation ------------------------------------- */
body .site-header { background: transparent !important; border: 0 !important; box-shadow: none !important; }

body .site-header .c-header__top {
  border-radius: 0 0 var(--g-radius-lg) var(--g-radius-lg);
  border-top: 0 !important;
  margin: 0 auto;
  max-width: calc(100% - 24px);
}
body .site-header .main-navigation,
body .site-header .main-navigation .main-navigation_wrap { background: transparent !important; border: 0 !important; }

body .main-navbar > li > a,
body .main-menu .nav > li > a,
body .main-navigation .nav-menu > li > a { color: var(--g-text) !important; border-radius: 999px; padding-left: 14px; padding-right: 14px; }
body .main-navbar > li > a:hover,
body .main-navbar > li.current-menu-item > a,
body .main-navbar > li.current-menu-ancestor > a {
  background: var(--g-surface-hover) !important;
  color: var(--g-accent) !important;
  box-shadow: inset 0 0 0 1px var(--g-border-soft);
}

/* dropdowns */
body .main-navigation .sub-menu,
body .main-navbar .sub-menu,
body .main-navigation ul ul {
  background: var(--g-surface-strong) !important;
  border: 1px solid var(--g-border) !important;
  border-radius: var(--g-radius) !important;
  box-shadow: var(--g-shadow-hover) !important;
  -webkit-backdrop-filter: blur(26px) saturate(var(--g-sat));
  backdrop-filter: blur(26px) saturate(var(--g-sat));
  padding: 8px !important;
  overflow: hidden;
}
body .main-navigation .sub-menu li a,
body .main-navbar .sub-menu li a { color: var(--g-text-2) !important; border-radius: var(--g-radius-sm); }
body .main-navigation .sub-menu li a:hover,
body .main-navbar .sub-menu li a:hover { background: var(--g-surface-hover) !important; color: var(--g-accent) !important; }

/* header search */
body .site-header .search-main-menu form input[type="text"],
body .search-navigation input[type="text"] {
  background: var(--g-input) !important;
  color: var(--g-text) !important;
  border: 1px solid var(--g-border) !important;
  border-radius: 999px !important;
  padding-left: 18px;
}
body .open-search-main-menu, body .menu-search a { color: var(--g-text) !important; }

/* sub header (genre bar / reader bar) */
body .site-header .c-sub-header-nav {
  border-radius: 0 0 var(--g-radius) var(--g-radius);
  margin: 0 auto;
  max-width: calc(100% - 24px);
  border-top: 0 !important;
}
body .c-sub-header-nav a, body .c-sub-header-nav .sub-nav_list li a { color: var(--g-text-2) !important; }
body .c-sub-header-nav a:hover { color: var(--g-accent) !important; }

/* sticky nav */
body .c-main-navigation { border-radius: 0 0 var(--g-radius) var(--g-radius); }

/* mobile off-canvas menu */
body .mobile-menu.off-canvas {
  background: var(--g-surface-strong) !important;
  -webkit-backdrop-filter: blur(28px) saturate(var(--g-sat));
  backdrop-filter: blur(28px) saturate(var(--g-sat));
  border-right: 1px solid var(--g-border);
}
body .mobile-menu a { color: var(--g-text) !important; }
body .c-togle__menu button span, body .menu_icon__open span { background: var(--g-text) !important; }

/* ---------- 5. Headings, panels & layout ------------------------------- */
body .c-blog__heading {
  border: 0 !important;
  background: transparent !important;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
body .c-blog__heading .h4, body .c-blog__heading h1, body .c-blog__heading h2, body .c-blog__heading h3 {
  position: relative;
  padding-left: 14px;
  font-weight: 700;
}
body .c-blog__heading .h4::before, body .c-blog__heading h1::before, body .c-blog__heading h2::before, body .c-blog__heading h3::before {
  content: ""; position: absolute; left: 0; top: 12%; bottom: 12%; width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, var(--g-accent), var(--g-accent-2));
}

body .widget, body .c-sidebar .widget { border-radius: var(--g-radius-lg); padding: 20px; margin-bottom: 22px; }
body .widget .widget-title, body .widget .h6 {
  padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 1px solid var(--g-border-soft) !important;
  font-weight: 700;
}
body .widget ul li { border-color: var(--g-border-soft) !important; }

/* ---------- 6. Manga cards --------------------------------------------- */
body .page-item-detail {
  border-radius: var(--g-radius-lg);
  padding: 10px;
  margin-bottom: 18px;
  overflow: hidden;
  transition: transform .35s var(--g-ease), box-shadow .35s var(--g-ease), background-color .25s;
}
body .page-item-detail:hover {
  transform: translateY(-5px);
  background: var(--g-surface-hover) !important;
  box-shadow: var(--g-shadow-hover), inset 0 1px 0 var(--g-highlight);
}
body .page-item-detail .item-thumb { border-radius: var(--g-radius); overflow: hidden; margin-bottom: 0; position: relative; }
body .page-item-detail .item-thumb img { border-radius: var(--g-radius); transition: transform .6s var(--g-ease); display: block; width: 100%; height: auto; }
body .page-item-detail:hover .item-thumb img { transform: scale(1.05); }
body .page-item-detail .item-summary { padding: 12px 6px 4px; }
body .page-item-detail .post-title h3, body .page-item-detail .post-title .h5 { font-size: 15px; font-weight: 650; line-height: 1.3; margin: 0 0 4px; }

body .list-chapter .chapter-item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 8px;
  padding: 6px 10px; margin-top: 6px;
  border-radius: var(--g-radius-sm);
  background: var(--g-input);
  border: 1px solid var(--g-border-soft);
}
body .list-chapter .chapter-item:hover { background: var(--g-surface-hover); }
body .list-chapter .chapter { float: none !important; width: auto !important; }
body .list-chapter .chapter a, body .list-chapter .chapter-item a.btn-link {
  color: var(--g-text) !important; font-weight: 600; font-size: 13px;
  background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; white-space: nowrap;
}
body .list-chapter .post-on { font-size: 11px; float: none !important; margin-left: auto; white-space: nowrap; }

/* badges */
body .manga-title-badges, body .manga-type, body .quick-chapter-link {
  border-radius: 999px !important;
  padding: 2px 10px !important;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  display: inline-block; float: none; line-height: 1.7; white-space: nowrap; margin: 6px 6px 0 0;
  background: linear-gradient(135deg, var(--g-accent), var(--g-accent-2)) !important;
  color: #fff !important; border: 0 !important;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--g-accent) 40%, transparent);
}
body .quick-chapter-link, body .manga-type {
  background: rgba(10, 12, 28, .55) !important;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .18) !important; box-shadow: none;
}

body .manga-title-badges { width: auto !important; height: auto !important; min-width: 0 !important; transform: none !important; text-indent: 0 !important; }
body .manga-title-badges::before, body .manga-title-badges::after { display: none !important; }

/* ---------- 7. Single manga page --------------------------------------- */
body .summary_image, body .summary_image a, body .profile-manga .tab-summary .summary_image { background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
body .listing-chapters_wrap ul { list-style: none; margin: 0; padding: 0; }
body .listing-chapters_wrap .wp-manga-chapter { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
body .listing-chapters_wrap .wp-manga-chapter .chapter-release-date { margin-left: auto; white-space: nowrap; }
body .profile-manga { border-radius: var(--g-radius-lg); padding: 26px; margin-bottom: 22px; }
body .profile-manga .tab-summary .summary_image img,
body .summary_image img { border-radius: var(--g-radius); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
body .profile-manga .post-title h1, body .post-title h1 { font-size: clamp(22px, 3vw, 32px); font-weight: 800; }
body .post-content_item .summary-heading h5, body .summary-heading h5 { color: var(--g-text-3) !important; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
body .post-content_item .summary-content, body .summary-content { color: var(--g-text) !important; }
body .genres-content a, body .tags-content a, body .item-tags ul li a {
  display: inline-block; padding: 3px 12px; margin: 2px 4px 2px 0;
  border-radius: 999px; background: var(--g-input); border: 1px solid var(--g-border-soft);
  color: var(--g-text-2) !important; font-size: 12px;
}
body .genres-content a:hover, body .tags-content a:hover, body .item-tags ul li a:hover {
  background: var(--g-accent); color: #fff !important; border-color: transparent;
}

body .listing-chapters_wrap { border-radius: var(--g-radius-lg); padding: 14px; }
body .listing-chapters_wrap .wp-manga-chapter {
  border: 0 !important; border-bottom: 1px solid var(--g-border-soft) !important;
  padding: 11px 12px; border-radius: var(--g-radius-sm);
  transition: background-color .2s var(--g-ease), transform .2s var(--g-ease);
}
body .listing-chapters_wrap .wp-manga-chapter:last-child { border-bottom: 0 !important; }
body .listing-chapters_wrap .wp-manga-chapter:hover { background: var(--g-surface-hover); transform: translateX(3px); }
body .listing-chapters_wrap .wp-manga-chapter a { color: var(--g-text) !important; font-weight: 600; }
body .listing-chapters_wrap .wp-manga-chapter.has-thumb:hover a { color: var(--g-accent) !important; }
body .listing-chapters_wrap ul.sub-chap, body .listing-chapters_wrap .volumns > li > a { color: var(--g-text) !important; }

/* ---------- 8. Reader --------------------------------------------------- */
body .reading-content img { border-radius: 4px; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); }
body .entry-header .c-breadcrumb-wrapper, body .c-breadcrumb { background: transparent !important; }
body .wp-manga-nav .select-view, body .wp-manga-nav .c-selectpicker { background: transparent !important; }
body .chapters_selectbox_holder { gap: 8px; }
/* NB: no backdrop-filter is ever applied to reader images or the long scrolling reading area. */

/* ---------- 9. Buttons --------------------------------------------------- */
body .btn, body .c-btn, body .c-btn_style-1, body button.btn,
body input[type="submit"], body button[type="submit"], body .wp-submit, body .button {
  border-radius: 999px !important;
  border: 1px solid transparent !important;
  background: linear-gradient(135deg, var(--g-accent), color-mix(in srgb, var(--g-accent) 55%, var(--g-accent-2))) !important;
  color: #fff !important;
  font-weight: 650;
  padding: 9px 22px;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--g-accent) 38%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .2s var(--g-ease), box-shadow .25s var(--g-ease), filter .2s;
}
body .btn:hover, body .c-btn:hover, body input[type="submit"]:hover, body button[type="submit"]:hover, body .button:hover {
  transform: translateY(-2px); filter: brightness(1.08);
  box-shadow: 0 14px 30px color-mix(in srgb, var(--g-accent) 48%, transparent), inset 0 1px 0 rgba(255, 255, 255, .45);
}
body .btn:active, body .c-btn:active { transform: translateY(0); }
body .btn-default, body .btn-secondary, body .btn-outline {
  background: var(--g-surface) !important; color: var(--g-text) !important;
  border: 1px solid var(--g-border) !important; box-shadow: none;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

/* ---------- 10. Forms ---------------------------------------------------- */
body .form-control, body input[type="text"], body input[type="email"], body input[type="password"],
body input[type="search"], body input[type="url"], body input[type="number"], body textarea, body select {
  background: var(--g-input) !important;
  color: var(--g-text) !important;
  border: 1px solid var(--g-border) !important;
  border-radius: var(--g-radius-sm) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
body .form-control:focus, body input:focus, body textarea:focus, body select:focus {
  outline: 0; border-color: var(--g-accent) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--g-accent) 25%, transparent) !important;
}
body ::placeholder { color: var(--g-text-3) !important; opacity: 1; }
body select option { background: var(--g-bg-2); color: var(--g-text); }

/* ---------- 11. Modals --------------------------------------------------- */
body .modal-backdrop.show, body .modal-backdrop.in { background: rgba(6, 8, 22, .55) !important; opacity: 1 !important; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body .modal-content { border-radius: var(--g-radius-lg) !important; background: var(--g-surface-strong) !important; }
body .modal-header, body .modal-footer { border-color: var(--g-border-soft) !important; background: transparent !important; }
body .modal-header .close, body .close { color: var(--g-text) !important; text-shadow: none; opacity: .7; }

/* ---------- 12. Pagination ---------------------------------------------- */
body .pagination a, body .pagination span, body .page-numbers, body .wp-pagenavi a, body .wp-pagenavi span,
body .nav-links a, body .nav-links span, body .c-pagination a {
  display: inline-block; min-width: 38px; padding: 7px 12px; margin: 0 3px; text-align: center;
  border-radius: 12px !important;
  background: var(--g-surface) !important; color: var(--g-text) !important;
  border: 1px solid var(--g-border) !important;
}
body .pagination a:hover, body .page-numbers:hover, body .wp-pagenavi a:hover { background: var(--g-surface-hover) !important; color: var(--g-accent) !important; }
body .pagination .active > *, body .page-numbers.current, body .wp-pagenavi span.current {
  background: linear-gradient(135deg, var(--g-accent), var(--g-accent-2)) !important; color: #fff !important; border-color: transparent !important;
}
body .c-btn.load-more, body .load_more_btn, body #navigation-ajax { margin: 10px auto; display: table; }

/* ---------- 13. Tables, comments, alerts -------------------------------- */
body table:not(#wp-calendar) > thead > tr > th,
body table:not(#wp-calendar) > tbody > tr td { background: transparent !important; color: var(--g-text-2) !important; border-color: var(--g-border-soft) !important; }
body .comment-respond, body #comments { border-radius: var(--g-radius-lg); padding: 22px; }
body .alert { border-radius: var(--g-radius); border: 1px solid var(--g-border) !important; background: var(--g-surface) !important; color: var(--g-text) !important; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* ---------- 14. Footer --------------------------------------------------- */
body .site-footer {
  margin-top: 40px; border-radius: var(--g-radius-lg) var(--g-radius-lg) 0 0;
  border-bottom: 0 !important; color: var(--g-text-3);
}
body .site-footer a { color: var(--g-text-2) !important; }
body .site-footer a:hover { color: var(--g-accent) !important; }
body .site-footer .top-footer, body .site-footer .bottom-footer { background: transparent !important; border-color: var(--g-border-soft) !important; }

/* ---------- 14b. Fixes found on a real site ----------------------------- */
/* Logos are usually white (made for a dark header). On the light look, flip lightness but keep hue. */
body.text-ui-dark .site-branding .logo img,
body.text-ui-dark .c-branding .logo img { filter: invert(1) hue-rotate(180deg); }

/* Breadcrumb band: drop the full-width grey/pattern background (set in Customizer, inline style) */
body .c-breadcrumb-wrapper { background: transparent !important; background-image: none !important; border: 0 !important; }
body .c-breadcrumb .breadcrumb { background: transparent !important; }

/* Wrappers that carry an opaque background in the parent theme */
body .c-page__content,
body .page-content-listing,
body .page-listing-item,
body .c-page-content .main-col,
body .c-page-content .main-col .main-col-inner,
body .tab-content-wrap,
body .c-tabs-item { background: transparent !important; border: 0 !important; box-shadow: none !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* Headings that already carry an icon do not need the accent bar */
body .c-blog__heading h1:has(> i, > img, > svg, > .icon)::before,
body .c-blog__heading h2:has(> i, > img, > svg, > .icon)::before,
body .c-blog__heading h3:has(> i, > img, > svg, > .icon)::before,
body .c-blog__heading .h4:has(> i, > img, > svg, > .icon)::before { display: none; }
body .c-blog__heading h1:has(> i, > img, > svg, > .icon),
body .c-blog__heading h2:has(> i, > img, > svg, > .icon),
body .c-blog__heading h3:has(> i, > img, > svg, > .icon),
body .c-blog__heading .h4:has(> i, > img, > svg, > .icon) { padding-left: 0; }

/* On "page" templates the parent lays cards out horizontally (100px thumb on the left).
   In narrow columns (5-6 per row) that squeezes the text, so switch those cards to a vertical layout. */
body.page .page-listing-item .row > [class*="col-"] { container-type: inline-size; }
body.page .page-item-detail .list-chapter .chapter-item .chapter { background: transparent !important; padding: 0 !important; border-radius: 0 !important; }
body.page .page-item-detail .list-chapter .chapter-item span { margin-right: 0 !important; }
body.page .page-item-detail .list-chapter .chapter-item { margin-bottom: 0 !important; }

@container (max-width: 360px) {
  body.page .page-item-detail .item-thumb { width: 100% !important; float: none !important; margin: 0 0 8px !important; }
  body.page .page-item-detail .item-summary { padding: 4px 4px 2px; }
  body.page .page-item-detail .item-summary .post-title h3 { font-size: 14px; }
  body.page .page-item-detail .item-summary .rating { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; margin-bottom: 6px; }
  body.page .page-item-detail .item-summary .rating .ratings_stars { font-size: 13px !important; margin: 0 !important; display: inline-block; }
  body.page .page-item-detail .item-summary .rating .score { font-size: 13px !important; margin-left: 4px !important; color: var(--g-text-2) !important; }
}

/* Slimmer, floating header */
body .site-header .c-header__top,
body .site-header .c-sub-header-nav { margin-top: 0; max-width: min(1240px, calc(100% - 24px)); }
body .site-header .c-header__top { margin-top: 8px; border-radius: var(--g-radius-lg) !important; border-top: 1px solid var(--g-border) !important; }
body .site-header .c-header__top .main-navigation,
body .site-header .c-header__top .c-header__top-inner,
body .site-header .c-header__top .container { min-height: 0; }
body .site-header .c-header__top .site-branding .logo img { max-height: 44px; width: auto; }
body .site-header .c-header__top .main-navigation { padding-top: 0 !important; padding-bottom: 0 !important; }
body .site-header .c-sub-header-nav { margin-top: 8px; border-radius: var(--g-radius) !important; border-top: 1px solid var(--g-border) !important; }
body .site-header .c-sub-header-nav .sub-nav_list li a { padding-top: 10px; padding-bottom: 10px; }

/* ---------- 15. Scrollbar & focus --------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--g-accent) 55%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--g-accent) 55%, transparent); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
body a:focus-visible, body button:focus-visible, body [tabindex]:focus-visible {
  outline: 2px solid var(--g-accent); outline-offset: 2px; border-radius: 8px;
}

/* ---------- 16. Responsive & performance -------------------------------- */
@media (max-width: 767px) {
  body { --g-blur: 12px; --g-radius-lg: 18px; }
  body .profile-manga { padding: 16px; }
  body .site-header .c-header__top, body .site-header .c-sub-header-nav { max-width: 100%; border-radius: 0 0 var(--g-radius) var(--g-radius); }
  body .page-item-detail { padding: 7px; margin-bottom: 12px; }
  body .page-item-detail:hover { transform: none; }
  body .widget { padding: 16px; }
}

/* Many cards on low-power devices: keep the look, drop the blur cost */
@media (max-width: 767px) and (pointer: coarse) {
  body .page-item-detail, body .list-chapter .chapter-item { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--g-surface-strong) !important; }
}

/* Browsers without backdrop-filter get a more opaque surface so text stays readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body .site-header .c-header__top, body .site-header .c-sub-header-nav, body .c-main-navigation,
  body .page-item-detail, body .widget, body .profile-manga, body .listing-chapters_wrap,
  body .site-footer, body .modal-content, body .comment-respond, body #comments { background: var(--g-surface-strong) !important; }
}

/* Users who ask for more contrast / less transparency */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  body { --g-surface: var(--g-surface-strong); --g-border: var(--g-text-3); }
  body * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}

/* Users who ask for less motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body *, body *::before, body *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  body .page-item-detail:hover, body .btn:hover { transform: none; }
}

/* Print: no glass */
@media print {
  body::before { display: none; }
  body * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; box-shadow: none !important; background: #fff !important; color: #000 !important; }
}
