/* ============================================================
   ModsHub — Dark Gaming Theme for DLE
   MODS.EmpireG.RU
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2233;
    --bg-card-hover: #1f2a3e;
    --bg-surface: #151d2e;
    --bg-input: #0f1520;
    --accent: #00d4ff;
    --accent-glow: rgba(0,212,255,0.12);
    --accent-secondary: #7c3aed;
    --accent-warm: #f59e0b;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --text-primary: #e8ecf4;
    --text-secondary: #8899b0;
    --text-muted: #556680;
    --border: rgba(255,255,255,0.06);
    --border-accent: rgba(0,212,255,0.2);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-glow: 0 0 30px rgba(0,212,255,0.08);
    --font-main: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --transition: 0.25s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #33dfff; }
img { max-width: 100%; height: auto; border: 0; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: 26px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
h4 { font-size: 16px; } h5 { font-size: 15px; } h6 { font-size: 14px; }
p { margin-bottom: 1em; }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
input, textarea, select, button { font-family: var(--font-main); }
input[type="checkbox"], input[type="radio"] { margin-right: 6px; vertical-align: middle; }
::selection { background: rgba(0,212,255,0.3); color: #fff; }

/* ---------- Performance ---------- */
.mod-card, .grid-card, .hero-card, .sb-block { contain: layout style; }
.mod-card-img img, .grid-card-img img { will-change: transform; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Background Grid ---------- */
.bg-grid {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        linear-gradient(rgba(0,212,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,212,255,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none; z-index: 0;
}
.page-wrapper { position: relative; z-index: 1; }

/* ---------- Container ---------- */
.container { max-width: 1340px; margin: 0 auto; padding: 0 20px; }

/* ---------- Top Bar ---------- */
.top-bar {
    background: rgba(10,14,23,0.85);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 7px 0; font-size: 13px; color: var(--text-muted);
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.top-bar a { color: var(--text-secondary); transition: all var(--transition); }
.top-bar a:hover { color: var(--accent); }
.topbar-desc { font-size: 12px; color: var(--text-muted); }
.social-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.topbar-btn {
    display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 12px;
    padding: 4px 12px; border-radius: 50px; border: 1px solid transparent;
    transition: all 0.25s ease; text-decoration: none; letter-spacing: 0.3px;
}
.topbar-btn svg { width: 14px; height: 14px; vertical-align: middle; flex-shrink: 0; }
.topbar-btn-orders { color: var(--accent) !important; border-color: var(--accent); background: rgba(0,212,255,0.06); }
.topbar-btn-orders:hover { background: var(--accent); color: #000 !important; box-shadow: 0 0 12px rgba(0,212,255,0.3); }
.topbar-btn-vk { color: #4c75a3 !important; border-color: rgba(76,117,163,0.3); }
.topbar-btn-vk:hover { background: #4c75a3; color: #fff !important; border-color: #4c75a3; }
.topbar-btn-tg { color: #29b6f6 !important; border-color: rgba(41,182,246,0.3); }
.topbar-btn-tg:hover { background: #29b6f6; color: #fff !important; border-color: #29b6f6; }
.topbar-btn-max { color: #22c55e !important; border-color: rgba(34,197,94,0.3); }
.topbar-btn-max:hover { background: #22c55e; color: #fff !important; border-color: #22c55e; }
.topbar-btn-boosty { color: #f15f2c !important; border-color: rgba(241,95,44,0.3); }
.topbar-btn-boosty:hover { background: #f15f2c; color: #fff !important; border-color: #f15f2c; }
.max-icon { width: 14px; height: 14px; vertical-align: middle; margin-right: 3px; display: inline-block; }
.max-icon { width: 16px; height: 16px; vertical-align: middle; }

/* ---------- Header / Navbar ---------- */
.header {
    background: rgba(17,24,39,0.92);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    transition: box-shadow 0.3s;
}
.header.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,0.4); }
.header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 18px; color: #fff;
    box-shadow: 0 0 20px rgba(0,212,255,0.25);
}
.logo-text { font-weight: 800; font-size: 20px; color: var(--text-primary); letter-spacing: -0.5px; }
.logo-text span { color: var(--accent); }

/* Navigation */
.nav-main { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-main > li { position: relative; }
.nav-main > li > a {
    color: var(--text-secondary); padding: 8px 13px; border-radius: var(--radius-sm);
    font-weight: 500; font-size: 14px; transition: all var(--transition);
    white-space: nowrap; display: block;
}
.nav-main > li > a:hover, .nav-main > li:hover > a { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-main > li > a.active { color: var(--accent); background: var(--accent-glow); }

/* Dropdown */
.sub-menu {
    position: absolute; top: calc(100% + 6px); left: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 6px; min-width: 230px;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: all 0.25s ease; box-shadow: var(--shadow-card); z-index: 200;
}
.sub-menu::before {
    content: ''; position: absolute; top: -10px; left: 0; right: 0; height: 10px;
}
.nav-main > li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.sub-menu.active { opacity: 1 !important; visibility: visible !important; transform: translateY(0) !important; }
.sub-menu a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 14px; border-radius: var(--radius-sm); font-size: 13.5px;
    color: var(--text-secondary);
}
.sub-menu a:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.sub-menu .count {
    font-size: 11px; background: rgba(255,255,255,0.06);
    padding: 2px 8px; border-radius: 20px; color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Profile Dropdown */
.header-right .sub-menu {
    right: 0; left: auto; min-width: 240px; padding: 8px;
    border: 1px solid rgba(0,212,255,0.15);
    background: linear-gradient(160deg, var(--bg-card) 0%, rgba(10,14,24,0.98) 100%);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 20px rgba(0,212,255,0.06);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.header-right .sub-menu a {
    padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13.5px;
    color: var(--text-secondary); gap: 10px; justify-content: flex-start;
    transition: all 0.2s ease;
}
.header-right .sub-menu a i {
    width: 20px; text-align: center; font-size: 16px;
}
.header-right .sub-menu a:hover {
    background: rgba(0,212,255,0.08); color: var(--text-primary);
    transform: translateX(2px);
}
.header-right .sub-menu a:last-child { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 12px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.header-right .sub-menu .badge { font-size: 11px; min-width: 22px; text-align: center; }

/* Header Right */
.header-right { display: flex; align-items: center; gap: 12px; }
.search-box {
    display: flex; align-items: center; position: relative;
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    border-radius: 50px; padding: 0 16px; height: 38px;
    transition: all 0.3s; width: 200px;
}
.search-box:focus-within {
    border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
    width: 260px; background: rgba(0,212,255,0.04);
}
.search-box .search-icon { color: var(--text-muted); flex-shrink: 0; width: 16px; height: 16px; }
.search-box input {
    background: none; border: none; outline: none;
    color: var(--text-primary); font-family: inherit; font-size: 13px;
    padding: 0 10px; width: 100%;
}
.search-box input::placeholder { color: var(--text-muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 18px; border-radius: var(--radius-sm); font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; transition: all var(--transition); border: 1px solid transparent; text-decoration: none; line-height: 1.4; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #0099cc); color: #fff; border: none; box-shadow: 0 0 20px rgba(0,212,255,0.2); }
.btn-primary:hover { box-shadow: 0 0 30px rgba(0,212,255,0.35); transform: translateY(-1px); color: #fff; }
.btn-success { background: var(--accent-green); color: #fff; }
.btn-success:hover { background: #16a34a; color: #fff; }
.btn-warning { background: var(--accent-warm); color: #000; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: var(--accent-red); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-secondary { background: rgba(255,255,255,0.08); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); border-color: var(--border-accent); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-pill { border-radius: 50px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }

/* ---------- Mobile Bottom Nav ---------- */
.mobile-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    background: rgba(17,24,39,0.95);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.mobile-nav .container { display: flex; justify-content: space-around; }
.mobile-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--text-muted); font-size: 10px; font-weight: 500; padding: 4px 8px;
    transition: color var(--transition);
}
.mobile-nav a:hover, .mobile-nav a.active { color: var(--accent); }
.mobile-nav svg { width: 22px; height: 22px; }

/* ---------- Slider / Carousel ---------- */
.hero-section { padding: 24px 0 8px; }

/* Container - explicit size prevents Swiper recalc issues */
#hero-slider {
    overflow: hidden !important;
    border-radius: var(--radius);
    position: relative;
    height: 400px;
    background: var(--bg-surface);
}
#hero-slider .swiper-wrapper {
    display: flex !important;
    height: 100% !important;
}
#hero-slider .swiper-slide {
    position: relative !important;
    height: 400px !important;
    min-height: 400px !important;
    overflow: hidden;
    background: var(--bg-surface);
    flex-shrink: 0;
    width: 100% !important;
}
#hero-slider .swiper-slide > a {
    display: block; width: 100%; height: 100%; position: relative;
    color: inherit; text-decoration: none;
}
#hero-slider .swiper-slide .slide-bg {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    object-fit: cover !important;
    z-index: 0;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}
#hero-slider .swiper-slide > a::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 80%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    pointer-events: none; z-index: 1;
}
.slide-content {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 30px 60px; z-index: 2;
}
.slide-content .badge-cat {
    display: inline-block; background: var(--accent); color: #000;
    font-size: 11px; font-weight: 700; padding: 4px 12px;
    border-radius: 4px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.slide-content h3 {
    font-size: 22px; font-weight: 800; line-height: 1.3;
    margin-bottom: 10px; color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.slide-content .meta { display: flex; gap: 16px; font-size: 13px; color: rgba(255,255,255,0.7); }
.slide-content .meta span { display: inline-flex; align-items: center; gap: 5px; }
.slide-content .desc { color: rgba(255,255,255,0.6); font-size: 13.5px; margin-top: 8px; max-width: 600px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.swiper-pagination-bullet { background: rgba(255,255,255,0.4); opacity: 1; width: 10px; height: 10px; }
.swiper-pagination-bullet-active { background: var(--accent); width: 28px; border-radius: 5px; }
.swiper-button-next, .swiper-button-prev {
    width: 42px; height: 42px; background: rgba(0,0,0,0.5);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-radius: 50%; color: #fff;
}
.swiper-button-next::after, .swiper-button-prev::after { font-size: 16px; font-weight: bold; }

/* Featured articles slider (category pages) */
#featured-articles { overflow: hidden; border-radius: var(--radius); }
#featured-articles .swiper-slide { height: auto !important; min-height: auto !important; }

/* Hero side cards */
.hero-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; }
.hero-side { display: flex; flex-direction: column; gap: 16px; }
.hero-card {
    position: relative; border-radius: var(--radius); overflow: hidden;
    cursor: pointer; background: var(--bg-card); flex: 1;
}
.hero-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.hero-card:hover img { transform: scale(1.05); }
.hero-card::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 75%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    pointer-events: none;
}
.hero-card-content {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 18px; z-index: 2;
}
.hero-card-content .badge-cat {
    font-size: 10px; background: var(--accent); color: #000;
    padding: 3px 8px; border-radius: 4px; font-weight: 700;
    margin-bottom: 8px; display: inline-block; text-transform: uppercase;
}
.hero-card-content h4 { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-card-content .meta { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 6px; }

/* ---------- Promo Banner ---------- */
.promo-banner {
    margin: 20px 0 8px;
    background: linear-gradient(135deg, rgba(0,212,255,0.06) 0%, rgba(124,58,237,0.06) 100%);
    border: 1px solid rgba(0,212,255,0.12);
    border-radius: var(--radius); padding: 16px 24px;
    display: flex; align-items: center; gap: 16px; font-size: 14px;
    color: var(--text-secondary); line-height: 1.5;
}
.promo-banner .promo-icon { font-size: 28px; flex-shrink: 0; }
.promo-banner a { color: var(--accent); font-weight: 600; }
.promo-banner a:hover { text-decoration: underline; }

/* ---------- Section Headers ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 18px; }
.section-head h2 { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-head h2 .sh-icon {
    width: 32px; height: 32px; background: var(--accent-glow); border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center; color: var(--accent);
}
.section-head .view-all {
    color: var(--text-muted); font-size: 13px; font-weight: 500;
    display: inline-flex; align-items: center; gap: 4px; transition: color var(--transition);
}
.section-head .view-all:hover { color: var(--accent); }

/* ---------- Sort Tabs: see SORT TABS FIX section below ---------- */

/* ---------- Main Layout ---------- */
.main-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; padding-bottom: 40px; }
.content-area { min-width: 0; }

/* ---------- Mod Cards (shortstory) ---------- */
.mod-card {
    display: flex; background: var(--bg-card); border-radius: var(--radius);
    overflow: hidden; border: 1px solid var(--border); transition: all 0.3s ease;
    margin-bottom: 16px;
}
.mod-card:hover {
    border-color: var(--border-accent); box-shadow: var(--shadow-glow);
    transform: translateY(-2px); background: var(--bg-card-hover);
}
.mod-card-img {
    width: 260px; min-height: 180px; flex-shrink: 0;
    position: relative; overflow: hidden;
}
.mod-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.mod-card:hover .mod-card-img img { transform: scale(1.08); }
.mod-card-img .size-badge {
    position: absolute; bottom: 10px; left: 10px;
    background: rgba(0,0,0,0.75);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    padding: 4px 10px; border-radius: 6px; font-size: 12px;
    font-weight: 600; color: var(--accent); font-family: var(--font-mono);
}
.mod-card-img .badge-fixed {
    position: absolute; top: 10px; left: 10px;
    background: var(--accent-red); color: #fff; font-size: 11px;
    font-weight: 700; padding: 3px 10px; border-radius: 4px;
}
.mod-card-body {
    padding: 18px 22px; display: flex; flex-direction: column; flex: 1; min-width: 0;
}
.mod-card-cats { display: flex; gap: 6px; flex-wrap: wrap; font-size: 0; flex: 1; min-width: 0; }
.mod-card-cats a {
    font-size: 11px; font-weight: 600; color: var(--accent);
    background: var(--accent-glow); padding: 3px 10px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.3px; transition: background var(--transition);
}
.mod-card-cats a:hover { background: rgba(0,212,255,0.22); }
.mod-card-cats span, .mod-card-cats br { display: none; }
.mod-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mod-card-fav { flex-shrink: 0; }
.mod-card-fav a { color: var(--text-muted); transition: color 0.2s; display: inline-flex; line-height: 1; }
.mod-card-fav a:hover { color: var(--accent); }
.mod-card-fav i { font-size: 16px; }
.mod-card h3 {
    font-size: 16px; font-weight: 700; line-height: 1.35; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mod-card h3 a { color: var(--text-primary); }
.mod-card h3 a:hover { color: var(--accent); }
.mod-card .desc {
    font-size: 13px; color: var(--text-secondary); line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: auto;
}
.mod-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
    flex-wrap: wrap; gap: 8px;
}
.mod-card-stats { display: flex; gap: 14px; }
.mod-stat {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12.5px; color: var(--text-muted); font-weight: 500;
}
.mod-stat i { color: var(--accent-warm); font-size: 14px; }
.mod-card-date { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
.mod-card-actions { display: flex; gap: 6px; }

/* ---------- Grid Card variant (homepage) ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-card {
    background: var(--bg-card); border-radius: var(--radius);
    overflow: hidden; border: 1px solid var(--border);
    transition: all 0.3s ease; display: flex; flex-direction: column;
}
.grid-card:hover {
    border-color: var(--border-accent); box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}
.grid-card-img { position: relative; overflow: hidden; aspect-ratio: 16/10; }
.grid-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.grid-card:hover .grid-card-img img { transform: scale(1.06); }
.grid-card-img .overlay {
    position: absolute; bottom: 0; left: 0; right: 0; top: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0; transition: opacity 0.3s;
}
.grid-card:hover .grid-card-img .overlay { opacity: 1; }
.grid-card-img .badge-cat {
    position: absolute; top: 10px; left: 10px;
    background: var(--accent-green); color: #fff; font-size: 10.5px;
    font-weight: 700; padding: 3px 8px; border-radius: 4px; z-index: 2;
}
.grid-card-img .size-badge {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(0,0,0,0.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    padding: 3px 8px; border-radius: 5px; font-size: 11px;
    font-weight: 600; color: var(--accent-warm); font-family: var(--font-mono); z-index: 2;
}
.grid-card-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.grid-card-body h5 { font-size: 14.5px; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid-card-body h5 a { color: var(--text-primary); }
.grid-card-body h5 a:hover { color: var(--accent); }
.grid-card-meta {
    display: flex; gap: 12px; font-size: 12px; color: var(--text-muted);
    margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
}
.grid-card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.grid-card-meta i { color: var(--accent-warm); font-size: 13px; }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.sb-block {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}
.sb-block-head {
    padding: 14px 18px; border-bottom: 1px solid var(--border);
    font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.sb-block-head i { color: var(--accent); }

/* Popular list */
.popular-item {
    display: flex; gap: 12px; padding: 12px 18px;
    border-bottom: 1px solid var(--border); transition: background var(--transition);
    cursor: pointer; align-items: center;
}
.popular-item:last-child { border-bottom: none; }
.popular-item:hover { background: var(--bg-card-hover); }
.popular-item .pi-img {
    width: 56px; height: 56px; border-radius: 8px;
    overflow: hidden; flex-shrink: 0;
}
.popular-item .pi-img img { width: 100%; height: 100%; object-fit: cover; }
.popular-info { flex: 1; min-width: 0; }
.popular-info h6 {
    font-size: 13px; font-weight: 600; line-height: 1.35; margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.popular-info h6 a { color: var(--text-primary); }
.popular-info h6 a:hover { color: var(--accent); }
.popular-info .pi-meta { font-size: 11.5px; color: var(--text-muted); display: flex; gap: 10px; }
.popular-info .pi-meta i { color: var(--accent-warm); }

/* Random mod */
.random-mod { position: relative; overflow: hidden; }
.random-mod img { width: 100%; height: 220px; object-fit: cover; }
.random-mod::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 75%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
}
.random-mod-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; z-index: 2; }
.random-mod-content h4 { font-size: 15px; color: #fff; margin-top: 6px; }
.random-mod-content .meta { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 6px; }

/* Last comment sidebar */
.sb-comment { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.sb-comment:last-child { border-bottom: none; }
.sb-comment .sc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.sb-comment .sc-head img { width: 32px; height: 32px; border-radius: 50%; }
.sb-comment .sc-head .sc-name { font-weight: 600; font-size: 13px; }
.sb-comment .sc-head .sc-date { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.sb-comment .sc-text { font-size: 12.5px; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sb-comment .sc-link { font-size: 12px; color: var(--accent); font-weight: 600; }
.sb-comment .sc-link:hover { text-decoration: underline; }

/* Tags Cloud */
.tags-cloud { padding: 16px 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags-cloud a, a.tag-item {
    font-size: 12px; padding: 5px 12px; border-radius: 50px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    color: var(--text-secondary); transition: all var(--transition); font-weight: 500;
}
.tags-cloud a:hover, a.tag-item:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* ---------- Fullstory ---------- */
.fullstory-header {
    position: relative; border-radius: var(--radius); overflow: hidden;
    background: var(--bg-card); margin-bottom: 20px;
}
.fullstory-header .fs-bg {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover; background-position: top;
    filter: blur(3px); transform: scale(1.05);
}
.fullstory-header .fs-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(10,14,23,0.6) 0%, rgba(10,14,23,0.95) 100%);
}
.fullstory-header .fs-content { position: relative; z-index: 2; padding: 30px; display: flex; gap: 24px; }
.fullstory-header .fs-poster { width: 200px; flex-shrink: 0; }
.fullstory-header .fs-poster img { width: 100%; border-radius: var(--radius-sm); box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.fullstory-header .fs-info { flex: 1; }
.fullstory-header .fs-info h1 { font-size: 24px; margin-bottom: 14px; color: #fff; }
.fullstory-header .fs-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; font-size: 13px; color: rgba(255,255,255,0.7); }
.fullstory-header .fs-meta span { display: inline-flex; align-items: center; gap: 5px; }
.fullstory-header .fs-meta i { color: var(--accent-warm); }
.fs-details { display: flex; flex-wrap: wrap; gap: 12px; }
.fs-detail-item {
    background: rgba(255,255,255,0.06); border-radius: var(--radius-sm);
    padding: 10px 16px; min-width: 120px;
}
.fs-detail-item dt { font-size: 11px; color: var(--accent); text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 3px; }
.fs-detail-item dd { font-size: 13px; color: var(--text-primary); margin: 0; }

/* Fullstory body */
.fullstory-body {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 20px;
}
.fullstory-body .card-body { padding: 24px; }
.fullstory-body .text { color: var(--text-secondary); line-height: 1.75; font-size: 14.5px; }
.fullstory-body .text img { border-radius: var(--radius-sm); margin: 8px 0; }
.fullstory-body .text a { color: var(--accent); }
.fullstory-body .text a:hover { text-decoration: underline; }
.fullstory-body h1 { font-size: 20px; text-align: center; margin-bottom: 16px; }

/* Spoiler */
.spoiler-wrap { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.spoiler-head {
    padding: 12px 18px; cursor: pointer; font-weight: 600; font-size: 14px;
    display: flex; align-items: center; gap: 8px; color: var(--text-primary);
    transition: background var(--transition);
}
.spoiler-head:hover { background: rgba(255,255,255,0.03); }
.spoiler-head::before { content: '\25B8'; color: var(--accent); font-size: 16px; -webkit-transition: -webkit-transform 0.2s; transition: transform 0.2s; }
.spoiler-wrap.active .spoiler-head::before { -webkit-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); }
.spoiler-body { padding: 16px 18px; display: none; color: var(--text-secondary); line-height: 1.7; }
.spoiler-wrap.active .spoiler-body { display: block; }

/* DLE Native Spoilers (bbcode [spoiler]) */
.title_spoiler {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 18px; cursor: pointer; font-weight: 600; font-size: 14px;
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    gap: 10px; color: var(--text-primary);
    -webkit-transition: background 0.2s, border-radius 0.2s;
    transition: background 0.2s, border-radius 0.2s;
    -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
    width: 100%;
}
.title_spoiler:hover { background: rgba(255,255,255,0.03); }
/* Hide ALL DLE native spoiler icons (img, svg, i, span with icon) */
.title_spoiler img,
.title_spoiler svg,
.title_spoiler > i:first-child { display: none !important; width: 0 !important; height: 0 !important; overflow: hidden !important; }
/* Our CSS arrow - single icon */
.title_spoiler::before {
    content: '\25B8'; color: var(--accent); font-size: 16px; line-height: 1;
    -webkit-transition: -webkit-transform 0.2s ease;
    transition: transform 0.2s ease;
    display: inline-block; -ms-flex-negative: 0; flex-shrink: 0;
    min-width: 12px; text-align: center;
}
/* Rotate arrow when spoiler is open - class toggled by our JS */
.title_spoiler.active::before {
    -webkit-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
    transform: rotate(90deg);
}
.text_spoiler {
    padding: 16px 18px; color: var(--text-secondary); line-height: 1.7;
    background: var(--bg-surface); border: 1px solid var(--border); border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-bottom: 12px;
}
.text_spoiler ~ .title_spoiler { border-radius: var(--radius-sm); }
.text_spoiler a { color: var(--accent); }
.text_spoiler a:hover { color: var(--accent-secondary); }
/* DLE 19.1 native HTML spoilers (<details>/<summary>) */
details.text_spoiler { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; }
details.text_spoiler > summary,
.card-body details > summary {
    background: var(--bg-surface); padding: 12px 18px; cursor: pointer;
    font-weight: 600; font-size: 14px; color: var(--text-primary);
    list-style: none; display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center; gap: 10px;
    border-radius: var(--radius-sm);
}
details.text_spoiler > summary::-webkit-details-marker,
.card-body details > summary::-webkit-details-marker { display: none; }
details.text_spoiler > summary::marker,
.card-body details > summary::marker { content: ''; display: none; }
details.text_spoiler > summary::before,
.card-body details > summary::before {
    content: '\25B8'; color: var(--accent); font-size: 16px;
    -webkit-transition: -webkit-transform 0.2s; transition: transform 0.2s;
    display: inline-block;
}
details[open].text_spoiler > summary::before,
.card-body details[open] > summary::before {
    -webkit-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg);
}

/* Download buttons */
.download-section { text-align: center; padding: 16px 0; }
.download-section .btn { margin: 6px; min-width: 240px; justify-content: center; }
.download-info {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px 20px; margin: 12px 0;
    text-align: center; color: var(--accent-warm); font-weight: 600;
}
.download-info a { color: var(--accent); }

/* Screenshots */
.screens_cash { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.screens_cash a img { border-radius: var(--radius-sm); transition: transform 0.3s; }
.screens_cash a:hover img { transform: scale(1.03); }

/* Fullstory footer */
.fullstory-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; border-top: 1px solid var(--border);
}
.fs-actions { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 8px; -ms-flex-wrap: wrap; flex-wrap: wrap; }
.fs-actions a {
    display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    gap: 6px; padding: 6px 14px; border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.06); border: 1px solid var(--border);
    color: var(--text-secondary) !important; font-size: 13px; font-weight: 500;
    text-decoration: none !important; cursor: pointer;
    -webkit-transition: all 0.2s; transition: all 0.2s;
}
.fs-actions a:hover { background: rgba(0,212,255,0.1); color: var(--accent) !important; border-color: var(--border-accent); }
.fs-actions a i { font-size: 15px; }

/* Prev/Next */
.nextprev {
    display: flex; justify-content: space-between; gap: 16px;
    margin-bottom: 20px;
}
.nextprev a {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 20px;
    color: var(--text-secondary); font-size: 13px; font-weight: 500;
    transition: all var(--transition); flex: 1;
}
.nextprev a:hover { border-color: var(--border-accent); color: var(--text-primary); }
.nextprev a.next { justify-content: flex-end; text-align: right; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tags a {
    display: inline-block; font-size: 12px; padding: 4px 12px;
    border-radius: 50px; background: rgba(255,255,255,0.04);
    border: 1px solid var(--border); color: var(--text-secondary);
    transition: all var(--transition);
}
.tags a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* Comments: see THREADED COMMENTS section below */

/* Add comment */
.addcomment-section .form-control {
    background: var(--bg-input); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: var(--radius-sm);
    padding: 10px 14px; font-size: 14px; transition: border-color var(--transition);
}
.addcomment-section .form-control:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}
.addcomment-section label, .form-label { color: var(--text-secondary); font-size: 13px; margin-bottom: 6px; display: block; font-weight: 500; }

/* ---------- Forms ---------- */
.form-control {
    background: var(--bg-input); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: var(--radius-sm);
    padding: 10px 14px; font-size: 14px; width: 100%;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); outline: none; }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-group { margin-bottom: 16px; }
select.form-control { -webkit-appearance: none; appearance: none; }

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--border); font-weight: 700; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); }

/* Callout */
.callout {
    background: var(--bg-surface); border-left: 4px solid var(--accent-warm);
    border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 16px;
}
.callout h5 { margin-bottom: 6px; }
.callout p { color: var(--text-secondary); margin: 0; }
.callout-warning { border-left-color: var(--accent-warm); }

/* Alert */
.alert {
    padding: 12px 18px; border-radius: var(--radius-sm); margin-bottom: 16px;
    font-size: 14px;
}
.alert-dark-danger { background: rgba(239,68,68,0.1); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.2); }
.alert-dark-info { background: rgba(0,212,255,0.08); color: var(--accent); border: 1px solid rgba(0,212,255,0.15); }
.alert-dark-success { background: rgba(34,197,94,0.08); color: var(--accent-green); border: 1px solid rgba(34,197,94,0.15); }
.alert-primary { background: var(--accent-glow); color: var(--accent); border: 1px solid var(--border-accent); }

/* Badge */
.badge { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11.5px; font-weight: 600; }
.badge-primary { background: var(--accent); color: #000; }
.badge-success { background: var(--accent-green); color: #fff; }
.badge-warning { background: var(--accent-warm); color: #000; }
.badge-danger { background: var(--accent-red); color: #fff; }
.badge-info { background: #3b82f6; color: #fff; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; padding: 0; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span {
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
    color: var(--text-secondary); background: var(--bg-card);
    border: 1px solid var(--border); transition: all var(--transition);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .active, .pagination span.nav_ext { background: var(--accent); color: #000; border-color: var(--accent); }
.pagination .prev, .pagination .next { background: var(--accent); color: #000 !important; border-color: var(--accent); font-weight: 800; }
.pages a, .pages span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border); margin: 0 3px; transition: all var(--transition); text-decoration: none; }
.pages a:hover { border-color: var(--accent); color: var(--accent); }
.pages span.nav_ext { background: var(--accent); color: #000; border-color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
    background: var(--bg-secondary); border-top: 1px solid var(--border); margin-top: 40px;
}
.footer-inner {
    padding: 36px 0; display: grid;
    grid-template-columns: 1fr auto auto; gap: 60px; align-items: start;
}
.footer-brand p { color: var(--text-muted); font-size: 13px; line-height: 1.6; margin-top: 12px; max-width: 340px; }
.footer-links h5 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 14px; }
.footer-links a { display: block; color: var(--text-secondary); font-size: 14px; padding: 4px 0; transition: color var(--transition); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
    padding: 16px 0; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    font-size: 13px; color: var(--text-muted);
}

/* ---------- Scroll Buttons ---------- */
.scroll-btns {
    position: fixed; left: 16px; bottom: 50%; transform: translateY(50%);
    display: flex; flex-direction: column; gap: 8px; z-index: 150;
}
.scroll-btn {
    width: 42px; height: 42px; border-radius: 50%;
    background: rgba(17,24,39,0.9);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid var(--border); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--transition); font-size: 18px;
}
.scroll-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 15px rgba(0,212,255,0.15); }

/* ---------- Login Modal ---------- */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    z-index: 300; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px; width: 100%;
    max-width: 420px; margin: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-box h3 { text-align: center; margin-bottom: 24px; }
.modal-box .form-group { margin-bottom: 16px; }
.modal-box .modal-footer { text-align: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }

/* Profile: see USER PROFILE REVAMP section below */

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--accent); }

/* ---------- Misc DLE ---------- */
.videoWrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius-sm); }
.videoWrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.bg-light { background: var(--bg-surface) !important; }
.text-warning { color: var(--accent-warm) !important; }
.text-danger { color: var(--accent-red) !important; }
.text-success { color: var(--accent-green) !important; }
.text-body { color: var(--text-primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-white { color: #fff !important; }
.font-weight-bold { font-weight: 700 !important; }
.font-weight-semibold { font-weight: 600 !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; } .mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; } .mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; } .mr-1 { margin-right: 4px !important; }
.mr-2 { margin-right: 8px !important; } .mr-3 { margin-right: 16px !important; }
.ml-1 { margin-left: 4px !important; } .ml-2 { margin-left: 8px !important; }
.p-2 { padding: 8px !important; } .p-3 { padding: 16px !important; }
.px-3 { padding-left: 16px !important; padding-right: 16px !important; }
.py-3 { padding-top: 16px !important; padding-bottom: 16px !important; }
.d-none { display: none !important; } .d-block { display: block !important; }
.d-inline-block { display: inline-block !important; } .d-flex { display: flex !important; }
.float-right { float: right !important; } .float-left { float: left !important; }
.text-center { text-align: center !important; } .text-right { text-align: right !important; }
.rounded { border-radius: var(--radius) !important; }
.rounded-circle { border-radius: 50% !important; }
.overflow-hidden { overflow: hidden !important; }
.w-100 { width: 100% !important; }
.small { font-size: 12.5px !important; }
.clearfix::after { content: ''; display: table; clear: both; }

/* DLE-specific UI elements */
.ui-w-40 { width: 40px !important; height: 40px !important; }
.ui-w-80 { width: 80px !important; height: 80px !important; }
.xfields td { padding: 6px 4px; color: var(--text-secondary); }
.xfields input, .xfields select, .xfields textarea { background: var(--bg-input); border: 1px solid var(--border); color: var(--text-primary); border-radius: var(--radius-sm); padding: 8px 12px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; }
legend { font-weight: 600; font-size: 14px; color: var(--text-primary); padding: 0 8px; }
#dle-content img { border-radius: var(--radius-sm); }

/* PM */
.pm-page .pmlist { color: var(--text-secondary); }
.pm-page .pmlist table { width: 100%; }
.pm-page .pmlist td, .pm-page .pmlist th { padding: 10px; border-bottom: 1px solid var(--border); }
.pm_status { background: var(--bg-surface); padding: 10px 14px; font-size: 13px; color: var(--text-secondary); margin-top: 12px; }

/* DLE editor */
#comment-editor { background: var(--bg-input); border-radius: var(--radius-sm); padding: 4px; }
#comment-editor textarea { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border); }
.highslide img { cursor: zoom-in; }

/* Checkbox styling */
input[type="checkbox"] { accent-color: var(--accent); }

/* Fast search */
#dofullsearch, #dosearch, #doclear, #doreset { background: var(--accent) !important; color: #000 !important; border: none !important; padding: 8px 18px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; }
.searchheading { display: block; font-weight: 600; color: var(--text-primary); }

/* DLE Mass action checkbox */
.mass-action input[type="checkbox"] { accent-color: var(--accent); }

/* Speedbar overrides */
.speedbar { font-size: 13px; color: var(--text-muted); }
.speedbar a { color: var(--text-secondary); }
.speedbar a:hover { color: var(--accent); }

/* ---------- RESPONSIVE ---------- */
/* ---------- Print ---------- */
@media print {
    .header, .top-bar, .footer, .sidebar, .scroll-btns, .mobile-nav, .promo-banner { display: none !important; }
    body { background: #fff; color: #000; }
    .card, .fullstory-body { border: 1px solid #ddd; background: #fff; }
}

/* ==================== FULLSTORY NEW HEADER ==================== */
.fs-header-new {
    position: relative; border-radius: var(--radius); overflow: hidden;
    margin-bottom: 20px;
}
.fs-header-bg {
    position: absolute; inset: 0; background-size: cover; background-position: center;
    filter: blur(18px) brightness(0.3) saturate(1.4); transform: scale(1.1);
    pointer-events: none;
}
.fs-header-overlay {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(135deg, rgba(10,14,23,0.85) 0%, rgba(10,14,23,0.6) 100%);
}
.fs-header-inner {
    position: relative; z-index: 1; display: flex; gap: 28px;
    padding: 28px 24px; align-items: flex-start;
}
.fs-poster-wrap { flex-shrink: 0; }
.fs-poster-img {
    width: 180px; border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 2px rgba(0,212,255,0.2);
    display: block; object-fit: cover; max-height: 280px;
}
.fs-header-info { flex: 1; min-width: 0; }
.fs-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; position: relative; z-index: 2; font-size: 0; color: transparent; }
.fs-badges a {
    display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 12px;
    border-radius: 4px; background: rgba(0,212,255,0.15); color: var(--accent) !important;
    text-decoration: none !important; text-transform: uppercase; letter-spacing: 0.3px;
    transition: all 0.2s ease; border: 1px solid rgba(0,212,255,0.25);
    position: relative; z-index: 3; cursor: pointer;
}
.fs-badges a:hover { background: var(--accent); color: #000 !important; }
.fs-title {
    font-size: clamp(18px,2.5vw,28px); font-weight: 800; line-height: 1.3;
    color: #fff; margin-bottom: 14px; text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.fs-version { color: var(--accent); font-weight: 700; }
.fs-meta-row {
    display: flex; flex-wrap: wrap; gap: 12px 20px; font-size: 13px;
    color: rgba(255,255,255,0.65); margin-bottom: 20px;
}
.fs-meta-row i { margin-right: 4px; color: var(--accent); }
.fs-meta-row a:hover { color: var(--accent); }
.fs-detail-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
    gap: 10px;
}
.fs-detail-cell {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm); padding: 10px 14px;
}
.fs-detail-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: rgba(255,255,255,0.4); margin-bottom: 4px; }
.fs-detail-val { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9); }
.fs-detail-accent { color: var(--accent-warm) !important; }
.fs-detail-size { color: var(--accent) !important; }

/* ==================== DOWNLOAD SPOILER SPECIAL ==================== */
.spoiler-download {
    border: 2px solid var(--accent) !important;
    box-shadow: 0 0 20px rgba(0,212,255,0.15), inset 0 0 40px rgba(0,212,255,0.03);
    background: linear-gradient(135deg, rgba(0,212,255,0.05), rgba(124,58,237,0.05)) !important;
}
.spoiler-head-download {
    background: linear-gradient(90deg, rgba(0,212,255,0.12), rgba(124,58,237,0.12)) !important;
    color: var(--accent) !important;
    font-size: 15px !important;
    padding: 16px 20px !important;
    border-bottom: 1px solid rgba(0,212,255,0.2);
    animation: dl-pulse 3s ease-in-out infinite;
}
.spoiler-head-download::before { color: var(--accent) !important; }
@keyframes dl-pulse {
    0%,100% { box-shadow: inset 0 0 0 rgba(0,212,255,0); }
    50% { box-shadow: inset 0 0 20px rgba(0,212,255,0.08); }
}
.dl-size-badge {
    margin-left: auto; background: var(--accent); color: #000;
    padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.spoiler-body-download { background: rgba(0,0,0,0.1); }
.dl-title { text-align: center; margin-bottom: 16px; font-size: 14px; }
.dl-btn-main { min-width: 260px !important; position: relative; overflow: hidden; }
.dl-btn-main::after {
    content:''; position:absolute; top:-50%; left:-75%; width:50%; height:200%;
    background: linear-gradient(90deg,transparent,rgba(255,255,255,0.15),transparent);
    transform: skewX(-20deg); animation: btn-shine 3s infinite;
}
@keyframes btn-shine { 0%{left:-75%} 100%{left:125%} }

/* ==================== RATING WIDGET ==================== */
.rating-widget {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center; gap: 8px;
}
.rating-like-dislike {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center; gap: 0;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 50px; overflow: hidden; padding: 4px;
}
/* Style DLE-generated <a> tags inside rating */
.rating-widget > a,
.rating-like-dislike > a {
    display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    gap: 8px; padding: 10px 20px; font-size: 14px; font-weight: 600;
    text-decoration: none !important; cursor: pointer;
    -webkit-transition: all 0.25s ease; transition: all 0.25s ease;
    background: transparent; color: var(--text-secondary) !important;
    border-radius: 50px;
}
.rating-widget > a i,
.rating-like-dislike > a i { font-size: 18px; -webkit-transition: -webkit-transform 0.2s; transition: transform 0.2s; }
.rating-widget > a:hover i,
.rating-like-dislike > a:hover i { -webkit-transform: scale(1.15); -ms-transform: scale(1.15); transform: scale(1.15); }
/* First link = like/plus */
.rating-like-dislike > a:first-of-type:hover { background: rgba(74,222,128,0.12); color: #4ade80 !important; }
/* Last link = dislike/minus */
.rating-like-dislike > a:last-of-type:hover { background: rgba(239,68,68,0.12); color: var(--accent-red) !important; }
/* Single like button (type 2) */
.rating-widget > a:hover { background: rgba(0,212,255,0.12); color: var(--accent) !important; }
.rating-score {
    font-size: 16px; font-weight: 800; min-width: 44px; text-align: center;
    padding: 6px 10px; color: var(--accent);
    background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(124,58,237,0.08));
    border-radius: 8px;
}
.rating-like-dislike > a b { font-weight: 700; }

/* User menu toggle chevron */
.user-menu-toggle svg { transition: transform 0.2s; }
.user-menu-toggle + .sub-menu.active ~ .user-menu-toggle svg,
.user-menu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ==================== THREADED COMMENTS ==================== */
.comment-block {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: 10px; overflow: visible;
    position: relative; transition: border-color var(--transition);
}
.comment-block:hover { border-color: rgba(0,212,255,0.2); }

/* DLE Tree Comments: DLE wraps comments in <ol class="comments-tree-list"> > <li class="comments-tree-item"> */
/* Nested replies are another ol.comments-tree-list inside the parent li */
.comments-tree-list {
    display: block; margin: 0; padding: 0; list-style: none !important;
}
.comments-tree-item {
    display: block; margin: 0; padding: 0; list-style: none !important;
}
/* Level 1 replies (first level nesting) */
.comments-tree-list .comments-tree-list {
    padding-left: 32px !important; margin-top: 4px;
    border-left: 3px solid var(--accent);
}
/* Level 2 replies */
.comments-tree-list .comments-tree-list .comments-tree-list {
    padding-left: 28px !important;
    border-left-color: rgba(0,212,255,0.5);
}
/* Level 3 replies */
.comments-tree-list .comments-tree-list .comments-tree-list .comments-tree-list {
    padding-left: 24px !important;
    border-left-color: rgba(0,212,255,0.3);
}
/* Level 4+ replies */
.comments-tree-list .comments-tree-list .comments-tree-list .comments-tree-list .comments-tree-list {
    padding-left: 20px !important;
    border-left-color: rgba(0,212,255,0.15);
}
/* Also handle DLE's inline margin-left for older versions */
.comment-block[style*="margin-left"],
.comment-block[style*="padding-left"] {
    border-left: 3px solid var(--accent) !important;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: rgba(0,212,255,0.02);
}
.cb-head {
    display: flex; gap: 12px; padding: 12px 16px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cb-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); flex-shrink: 0; }
.cb-avatar-link { display: block; flex-shrink: 0; }
.cb-top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cb-name-wrap { display: flex; align-items: center; gap: 6px; }
.cb-name { font-weight: 700; font-size: 14px; color: var(--accent); }
.cb-name:hover { text-decoration: underline; }
.cb-online-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.cb-online-dot.online { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.cb-online-dot.offline { background: var(--text-muted); }
.cb-badge-admin {
    font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
    background: var(--accent-warm); color: #000; text-transform: uppercase;
}
.cb-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cb-reply-to { margin-left: 8px; color: var(--accent); font-size: 11px; }
.cb-reply-to a { color: inherit; text-decoration: underline; }
.cb-actions-top { display: flex; gap: 4px; align-items: center; }
.cb-body { padding: 12px 16px; color: var(--text-secondary); line-height: 1.7; }
.cb-text blockquote { border-left: 3px solid var(--accent); padding-left: 12px; margin: 8px 0; color: var(--text-muted); }
.cb-news-title { margin-bottom: 10px; font-size: 14px; }
.cb-news-title a { color: var(--accent); }
.cb-signature { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 8px; color: var(--text-muted); font-size: 12px; }
.cb-actions { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px 12px 10px; }
.btn-xs { padding: 3px 10px; font-size: 12px; border-radius: 4px; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,212,255,0.05); }
.cb-like:hover { border-color: var(--accent-green); color: var(--accent-green); }
.cb-dislike:hover { border-color: var(--accent-red); color: var(--accent-red); }
.cb-btn-reply:hover { border-color: var(--accent); color: var(--accent); }
.cb-btn-del:hover { border-color: var(--accent-red); color: var(--accent-red); }

/* ==================== FAST SEARCH ==================== */
.fastsearch-dropdown {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 360px;
    background: var(--bg-card); border: 1px solid var(--accent);
    border-radius: var(--radius-sm); z-index: 9999; overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    max-height: 420px; overflow-y: auto;
}
.fastsearch-dropdown::-webkit-scrollbar { width: 4px; }
.fastsearch-dropdown::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }
.fastsearch-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; text-decoration: none; color: var(--text-primary);
    border-bottom: 1px solid var(--border); transition: background var(--transition);
}
.fastsearch-item:last-child { border-bottom: none; }
.fastsearch-item:hover { background: rgba(0,212,255,0.07); }
.fastsearch-img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.fastsearch-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fastsearch-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fastsearch-cat { font-size: 11px; color: var(--accent); }
.fastsearch-more { display: block; text-align: center; padding: 10px; font-size: 13px; color: var(--accent); border-top: 1px solid var(--border); background: rgba(0,212,255,0.04); }
.fastsearch-more:hover { background: rgba(0,212,255,0.1); }
.fastsearch-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ==================== SORT TABS FIX ==================== */
.sort-wrapper {
    text-align: center; margin-bottom: 20px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px;
}
.sort-label {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 12px;
}
.sort-type, #sort ul { display: flex !important; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; justify-content: center; }
.sort-type li, #sort ul li { display: block; }
.sort-type li a, #sort ul li a {
    display: inline-block; padding: 8px 18px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg-surface);
    color: var(--text-secondary); font-size: 13px; font-weight: 600;
    transition: all 0.25s ease; text-decoration: none;
    position: relative; overflow: hidden;
}
.sort-type li a::before, #sort ul li a::before {
    content: ''; position: absolute; inset: 0; opacity: 0;
    background: linear-gradient(135deg, rgba(0,212,255,0.12), rgba(124,58,237,0.12));
    transition: opacity 0.25s ease;
}
.sort-type li a:hover::before, #sort ul li a:hover::before { opacity: 1; }
.sort-type li a:hover, #sort ul li a:hover {
    border-color: var(--accent); color: var(--accent);
    transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,212,255,0.15);
}
.sort-type li a:active, #sort ul li a:active { transform: translateY(0); }
.sort-type li.active a, #sort ul li.active a, .sort-type li a.active, #sort ul li a.active {
    background: var(--accent); color: #000 !important; border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0,212,255,0.3);
}
.sort-type li.active a::before, #sort ul li.active a::before { opacity: 0; }
#sort { justify-content: center; margin-bottom: 0; }

/* ==================== FEEDBACK FORM ==================== */
.feedback-wrap { max-width: 700px; }
.feedback-wrap .form-control { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); padding: 10px 14px; width: 100%; transition: border-color var(--transition); }
.feedback-wrap .form-control:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(0,212,255,0.1); }

/* ==================== USER PROFILE REVAMP ==================== */
.profile-header {
    border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; position: relative; min-height: 200px;
}
.profile-header .ph-bg {
    position: absolute; inset: 0; background-size: cover; background-position: center;
    filter: blur(10px) brightness(0.3); transform: scale(1.05);
}
.profile-header .ph-bg::after { content:''; position:absolute; inset:0; background: linear-gradient(to bottom, transparent, rgba(10,14,23,0.8)); }
.profile-header .ph-content {
    position: relative; z-index: 1; display: flex; align-items: center;
    gap: 20px; padding: 30px 24px;
}
.profile-header .ph-avatar {
    width: 90px; height: 90px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--accent); box-shadow: 0 0 20px rgba(0,212,255,0.3);
}
.profile-header .ph-info h2 { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 4px; }
/* PM button wrapper */
.ph-pm-wrap { margin-left: auto; flex-shrink: 0; }
.ph-pm-wrap a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #0099cc);
    color: #fff !important; text-decoration: none !important;
    font-size: 13px; font-weight: 600; white-space: nowrap;
    transition: all var(--transition); box-shadow: 0 0 20px rgba(0,212,255,0.2);
}
.ph-pm-wrap a:hover { box-shadow: 0 0 30px rgba(0,212,255,0.4); transform: translateY(-1px); }
.profile-tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.profile-tab-btn {
    padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
    border: none; background: transparent; color: var(--text-muted);
    border-bottom: 3px solid transparent; margin-bottom: -1px; transition: all var(--transition);
}
.profile-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.profile-tab-btn:hover { color: var(--text-primary); }

/* ==================== PM PAGE ==================== */
.pm-inbox-btn { background: var(--accent-warm) !important; color: #000 !important; }
.pm-new-btn { background: var(--accent) !important; color: #000 !important; }


/* Profile info grid */
.profile-info-grid {
    display: grid; grid-template-columns: 200px 1fr;
    gap: 10px 16px; font-size: 14px;
}
.pinfo-label { color: var(--text-muted); display: flex; align-items: center; }
.pinfo-val { color: var(--text-primary); font-weight: 500; }

/* ==================== DLE POPUP MENU (edit dropdown) ==================== */
.dle-popup-menu, .dle_b_menu, #dle-popup-menu, div[id^="dle_act"],
div[style*="position: absolute"][style*="z-index"] > a:first-child {
    /* Catch DLE dynamically created menus */
}
/* DLE creates absolute-positioned divs for dropdownmenu() */
body > div[style*="z-index"]:not(.page-wrapper):not(.modal-overlay):not(.scroll-btns):not([class]) {
    background: var(--bg-card) !important; border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important; padding: 6px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 12px rgba(0,212,255,0.08) !important;
    min-width: 180px !important;
}
body > div[style*="z-index"]:not(.page-wrapper):not(.modal-overlay):not(.scroll-btns):not([class]) a {
    display: block !important; padding: 9px 14px !important; border-radius: var(--radius-sm) !important;
    font-size: 13px !important; color: var(--text-secondary) !important;
    text-decoration: none !important; white-space: nowrap !important;
    transition: all 0.2s ease !important;
}
body > div[style*="z-index"]:not(.page-wrapper):not(.modal-overlay):not(.scroll-btns):not([class]) a:hover {
    background: rgba(0,212,255,0.1) !important; color: var(--accent) !important;
}
/* Edit button specific */
.dle-edit-btn { cursor: pointer; }

/* Shortstory card rating fix */
.mod-stat i { margin-right: 3px; }

/* ==================== ORDERS / FULL_OTHERS META ==================== */
.fo-meta {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px;
}
.fo-meta-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 50px;
    background: var(--bg-surface); border: 1px solid var(--border);
    font-size: 13px; font-weight: 500; color: var(--text-secondary);
}
.fo-meta-chip i { color: var(--accent); font-size: 14px; }

/* ==================== DLE FAST EDIT / OVERLAY ==================== */
#dofastreply, #dle-popup, .dle-popup-bg,
div.dle_b_menu, #fastreply, .dle-promt, .doaction {
    z-index: 500 !important;
}
.dle-popup-bg, #overlay, .overlay, div[id="overlay"] {
    background: rgba(0,0,0,0.6) !important;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    z-index: 499 !important;
}
#fastreply, .ui-dialog, .dle-promt {
    background: var(--bg-card) !important; color: var(--text-primary) !important;
    border: 1px solid var(--border) !important; border-radius: var(--radius) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 20px rgba(0,212,255,0.08) !important;
    overflow: hidden !important;
}
.ui-dialog .ui-dialog-titlebar, #fastreply .title, .dle-promt .title {
    background: var(--bg-surface) !important; color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 16px 50px 16px 20px !important;
    font-weight: 700 !important; font-size: 15px !important;
    position: relative !important;
    display: flex !important; align-items: center !important;
}
/* Close button — X icon, top-right */
.ui-dialog .ui-dialog-titlebar-close {
    position: absolute !important; top: 50% !important; right: 14px !important;
    -webkit-transform: translateY(-50%) !important; transform: translateY(-50%) !important;
    width: 30px !important; height: 30px !important;
    background: rgba(255,255,255,0.06) !important; border: 1px solid var(--border) !important;
    border-radius: 8px !important; cursor: pointer !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    padding: 0 !important; margin: 0 !important;
    color: var(--text-muted) !important;
    -webkit-transition: all 0.2s ease !important; transition: all 0.2s ease !important;
    overflow: hidden !important; text-decoration: none !important;
    font-size: 0 !important; /* hide original text */
    z-index: 2 !important;
}
.ui-dialog .ui-dialog-titlebar-close:hover {
    background: rgba(239,68,68,0.15) !important; border-color: rgba(239,68,68,0.4) !important;
    color: #ef4444 !important;
}
.ui-dialog .ui-dialog-titlebar-close::after {
    content: '\00D7' !important; font-size: 20px !important; line-height: 1 !important;
    color: inherit !important; display: block !important;
    pointer-events: none !important;
}
/* Hide original close button inner elements visually */
.ui-dialog .ui-dialog-titlebar-close .ui-button-icon,
.ui-dialog .ui-dialog-titlebar-close .ui-icon,
.ui-dialog .ui-dialog-titlebar-close .ui-button-text,
.ui-dialog .ui-dialog-titlebar-close span {
    font-size: 0 !important; width: 0 !important; height: 0 !important;
    overflow: hidden !important; position: absolute !important;
}
.ui-dialog .ui-dialog-content {
    padding: 24px 20px !important; font-size: 14px !important; line-height: 1.6 !important;
    background: var(--bg-card) !important; color: var(--text-secondary) !important;
}
#fastreply textarea, .ui-dialog textarea, .dle-promt textarea,
#fastreply input[type="text"], .ui-dialog input[type="text"] {
    background: var(--bg-surface) !important; border: 1px solid var(--border) !important;
    color: var(--text-primary) !important; border-radius: var(--radius-sm) !important;
    padding: 12px 14px !important; width: 100% !important; box-sizing: border-box !important;
    font-size: 14px !important; font-family: inherit !important;
    -webkit-transition: border-color 0.2s !important; transition: border-color 0.2s !important;
    resize: vertical !important;
}
#fastreply textarea:focus, .ui-dialog textarea:focus,
.ui-dialog input[type="text"]:focus {
    border-color: var(--accent) !important; outline: none !important;
    box-shadow: 0 0 0 3px rgba(0,212,255,0.12) !important;
}
/* Button pane */
.ui-dialog .ui-dialog-buttonpane {
    background: var(--bg-surface) !important; border-top: 1px solid var(--border) !important;
    padding: 14px 20px !important;
    display: flex !important; justify-content: flex-end !important; gap: 10px !important;
}
.ui-dialog .ui-dialog-buttonset {
    display: flex !important; gap: 10px !important;
}
/* Buttons */
.ui-dialog .ui-dialog-buttonpane button,
.ui-dialog .ui-dialog-buttonpane .ui-button,
#fastreply .btn, #fastreply input[type="button"], #fastreply input[type="submit"],
.ui-dialog .ui-dialog-content button, .dle-promt button {
    border: 1px solid transparent !important; border-radius: var(--radius-sm) !important;
    padding: 10px 22px !important; font-weight: 600 !important; font-size: 13px !important;
    font-family: inherit !important; cursor: pointer !important; letter-spacing: 0.3px !important;
    -webkit-transition: all 0.2s ease !important; transition: all 0.2s ease !important;
    line-height: 1.4 !important; min-width: 100px !important; text-align: center !important;
    pointer-events: auto !important; position: relative !important; z-index: 1 !important;
}
/* Primary button (last / submit) */
.ui-dialog .ui-dialog-buttonpane button:last-child,
.ui-dialog .ui-dialog-buttonpane .ui-button:last-child,
#fastreply input[type="submit"] {
    background: var(--accent) !important; color: #000 !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(0,212,255,0.25) !important;
}
.ui-dialog .ui-dialog-buttonpane button:last-child:hover,
#fastreply input[type="submit"]:hover {
    background: #33dfff !important;
    box-shadow: 0 4px 16px rgba(0,212,255,0.4) !important;
    -webkit-transform: translateY(-1px) !important; transform: translateY(-1px) !important;
}
.ui-dialog .ui-dialog-buttonpane button:last-child:active {
    -webkit-transform: translateY(0) !important; transform: translateY(0) !important;
}
/* Secondary button (cancel = first-child, but NOT when it's the only one) */
.ui-dialog .ui-dialog-buttonpane button:first-child:not(:only-child),
.ui-dialog .ui-dialog-buttonpane .ui-button:first-child:not(:only-child) {
    background: rgba(255,255,255,0.06) !important; color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important;
}
.ui-dialog .ui-dialog-buttonpane button:first-child:not(:only-child):hover,
.ui-dialog .ui-dialog-buttonpane .ui-button:first-child:not(:only-child):hover {
    background: rgba(255,255,255,0.12) !important; color: var(--text-primary) !important;
    border-color: var(--border-accent) !important;
}
/* If only one button, treat as primary */
.ui-dialog .ui-dialog-buttonpane button:only-child,
.ui-dialog .ui-dialog-buttonpane .ui-button:only-child {
    background: var(--accent) !important; color: #000 !important;
    box-shadow: 0 2px 8px rgba(0,212,255,0.25) !important;
}

/* ==================== EDITION BADGES SPLIT ==================== */
/* fs-badges already defined in header section */

/* Comment list cleanup - no numbering, preserve tree nesting */
.comments_inner, #dle-comments-list,
div[id*="comment"] > ol:not(.comments-tree-list), .card-body > ol:not(.comments-tree-list) {
    list-style: none !important; padding-left: 0 !important; margin: 0 !important;
}
/* Only reset padding on root level tree list */
.card-body > .comments-tree-list,
#dle-comments > .comments-tree-list,
.fullstory-body > .comments-tree-list {
    padding-left: 0 !important; margin: 0 !important; list-style: none !important;
}
.content-area ol:not(.breadcrumbs):not([class*="sort"]):not(.comments-tree-list) {
    list-style: none; padding-left: 0;
}

/* ==================== DLE NOTIFICATIONS / ALERTS ==================== */
/* DLE uses DLEalert() which creates jQuery UI dialogs, and also inline dle_b_help messages */
.dle_b_help, .dle-info, .dle_info, #dle-info,
.info_message, .success_message, .error_message {
    background: var(--bg-card) !important; color: var(--text-primary) !important;
    border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important;
    padding: 14px 20px !important; margin: 10px 0 !important;
    font-size: 14px !important; line-height: 1.6 !important;
}
.success_message { border-color: var(--accent-green) !important; background: rgba(74,222,128,0.08) !important; }
.error_message { border-color: var(--accent-red) !important; background: rgba(239,68,68,0.08) !important; }
.info_message { border-color: var(--accent) !important; background: rgba(0,212,255,0.08) !important; }
/* jQuery UI dialog (used by DLEalert) — force visible + centered on all devices */
.ui-widget-overlay {
    background: rgba(0,0,0,0.6) !important; opacity: 1 !important;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    z-index: 999998 !important; position: fixed !important;
    top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important;
}
.ui-dialog {
    background: var(--bg-card) !important; color: var(--text-primary) !important;
    border: 1px solid var(--border) !important; border-radius: var(--radius) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px rgba(0,212,255,0.06) !important;
    padding: 0 !important; z-index: 999999 !important;
    position: fixed !important; top: 50% !important; left: 50% !important;
    -webkit-transform: translate(-50%, -50%) !important;
    -ms-transform: translate(-50%, -50%) !important;
    transform: translate(-50%, -50%) !important;
    max-width: 90vw !important; max-height: 80vh !important;
    min-width: 320px !important; width: auto !important;
    overflow: hidden !important;
}
/* DLE popup for rating/favorites feedback */
#dlealert, .dle-popup, #dle-popup {
    z-index: 999999 !important;
}
/* Ensure DLE's native notification toasts are visible */
.dle_b_help { z-index: 1000 !important; position: fixed !important; }
/* DLE toast/notification patterns (covers DLE 17-19.1) */
#dle-info, .dle-info, .dle_info,
.ui-tooltip, [role="alert"], [role="status"],
div[id*="dlealert"], div[class*="dle-alert"],
.mass_comments_action, #loading-layer,
body > div[style*="position: fixed"][style*="z-index"],
body > div[style*="position: absolute"][style*="z-index"][class*="ui-"] {
    color: var(--text-primary) !important;
}
/* DLE loading overlay */
#loading-layer, .loading-layer {
    background: rgba(0,0,0,0.5) !important;
    z-index: 9998 !important;
}
/* Ensure DLE action buttons within <a> tags remain clickable */
.fs-actions a, .rating-widget a,
[add-favorites] a, [del-favorites] a { cursor: pointer !important; }
.fs-actions a > *, .rating-widget a > * { pointer-events: auto; }
