:root { --apx-brand: #0284c7; --apx-bg: #ffffff; --apx-text: #1a1a1a; --apx-text-mut: #6b7280; --apx-border: #f3f4f6; --apx-border-heavy: #e5e7eb; --apx-panel: #fafafa; --apx-font-sans: 'Source Sans 3', -apple-system, sans-serif; --apx-font-serif: 'Merriweather', Georgia, serif; --apx-ease: cubic-bezier(0.25, 1, 0.5, 1); }
body.dark-mode { --apx-bg: #0f172a; --apx-text: #f8fafc; --apx-text-mut: #94a3b8; --apx-border: #1e293b; --apx-border-heavy: #334155; --apx-panel: #1e293b; background-color: var(--apx-bg); color: var(--apx-text); }
body { background-color: var(--apx-bg); color: var(--apx-text); margin: 0; padding: 0; transition: background-color 0.2s, color 0.2s; -webkit-font-smoothing: antialiased; }

body, .reader-container, .reader-container div, .reader-container p, .reader-container span, .reader-container a { font-family: var(--apx-font-serif) !important; }
.reader-container h1, .reader-container h2, .reader-container h3, .reader-container h4, .reader-container h5, .reader-container h6,
.av-meta-row, .av-meta-row *, .av-actions-bar, .av-actions-bar *, .av-bottom-actions, .av-bottom-actions *, .av-bio-box, .av-bio-box *, 
.av-comments-sec, .av-comments-sec *, .av-tags, .av-tags *, .apx-login-wall *, .av-related-wrapper * { font-family: var(--apx-font-sans) !important; }

h1, h2, h3, h4, .av-ui-font { font-family: var(--apx-font-sans); }
.av-content, .av-deck { font-family: var(--apx-font-serif); }
.reader-container { max-width: 680px; margin: 40px auto 60px auto; padding: 0 24px; min-height: 70vh; }
.av-category-tag { display: inline-block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--apx-brand); margin-bottom: 16px; text-decoration: none; transition: 0.2s; }
.av-category-tag:hover { opacity: 0.8; }
.av-title { font-size: clamp(34px, 5vw, 46px); font-weight: 800; line-height: 1.15; color: var(--apx-text); margin: 0 0 12px 0; letter-spacing: -0.02em; }
.av-deck { font-size: 20px; font-weight: 400; line-height: 1.4; color: var(--apx-text-mut); margin: 0 0 32px 0; }
.av-author-strip { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.av-meta-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.av-author-info { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.av-author-name { font-weight: 600; font-size: 16px; color: var(--apx-text); text-decoration: none; }
.av-meta-stats { font-size: 14.5px; color: var(--apx-text-mut); }

.av-btn-follow { background: transparent; border: 1px solid var(--apx-text); border-radius: 99px; color: var(--apx-text); padding: 4px 14px; font-size: 14px; font-weight: 500; cursor: pointer; transition: 0.2s; margin-left: 4px; }
.av-btn-follow:hover { background: var(--apx-text); color: var(--apx-bg); }
.av-btn-follow.active { color: var(--apx-text-mut); border-color: var(--apx-text-mut); }

/* Actions Bar */
.av-actions-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--apx-border-heavy); border-bottom: 1px solid var(--apx-border-heavy); margin-bottom: 40px; flex-wrap: wrap; gap: 16px;}
.av-actions-left, .av-actions-right { display: flex; gap: 24px; align-items: center; }
.av-actions-left {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-right: auto;
}

.rxn-wrap {
    display: inline-flex;
    align-items: center;
    position: relative;
}
.av-stat-item { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--apx-text-mut); text-decoration: none; transition: 0.2s; cursor: pointer; user-select: none; }
.av-stat-item:hover { color: var(--apx-text); }
.av-stat-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.av-stat-item svg.solid-icon { fill: currentColor; stroke: none; } 
.av-action-icon { background: transparent; border: none; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--apx-text-mut); transition: 0.2s; }
.av-action-icon:hover { color: var(--apx-text); }
.av-action-icon svg { width: 22px; height: 22px; stroke-width: 1.2; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.av-action-icon.active svg { fill: currentColor; }
.av-action-icon svg.fill-icon { fill: currentColor; stroke: none; }

/* Reaction System */
.rxn-wrap { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.rxn-trigger { display: flex; align-items: center; gap: 6px; background: transparent; border: none; font-size: 14px; color: var(--apx-text-mut); cursor: pointer; padding: 0; transition: 0.2s; }
.rxn-trigger:hover { color: var(--apx-text); }
.rxn-trigger .icon { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; }
.rxn-picker { position: absolute; bottom: calc(100% + 8px); left: 0; display: flex; gap: 6px; background: var(--apx-bg); border: 1px solid var(--apx-border-heavy); border-radius: 99px; padding: 6px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); opacity: 0; pointer-events: none; transform: translateY(10px) scale(0.95); transition: 0.2s; z-index: 50; }
.rxn-picker.open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.rxn-opt { width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.15s; }
.rxn-opt:hover { transform: scale(1.3) translateY(-4px); }

/* Bottom Distinct Actions Bar */
.av-bottom-actions { background: var(--apx-panel); border: 1px solid var(--apx-border-heavy); border-radius: 12px; padding: 20px 30px; margin: 40px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.av-bottom-actions .av-actions-left { gap: 32px; }
.av-bottom-actions .rxn-trigger, .av-bottom-actions .av-stat-item, .av-bottom-actions .av-action-icon { font-size: 16px; font-weight: 600; color: var(--apx-text); }
.av-bottom-actions svg { width: 26px; height: 26px; }

/* Hero Image & Article Content */
.av-hero-img { margin: 0 0 40px 0; width: 100%; }
.av-hero-img img { width: 100%; height: auto; object-fit: cover; border-radius: 0 !important; }
.av-hero-caption { text-align: center; font-size: 13.5px; color: var(--apx-text-mut); margin-top: 10px; }
.av-content { font-size: 20px; line-height: 1.8; color: var(--apx-text); position: relative; }
.av-content p { margin-bottom: 1.6em; font-family: unset;}
.av-content img { max-width: 100%; }
.av-content h2 { font-size: 28px; font-weight: 800; margin: 2em 0 0.8em; letter-spacing: -0.01em; color: #407bff; }
.av-content h3 { font-size: 22px; font-weight: 700; margin: 1.5em 0 0.8em; }
.av-content a { color: var(--apx-brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.av-content blockquote {
    border-left: 3px solid #1141ad;
    margin: 40px 0;
    padding: 0 0 0 24px;
    font-style: italic;
    font-size: 22px;
    color: #407bff;
}

/* Ads */
.apx-ad-isolate { margin: 40px 0 !important; padding: 12px 0 !important; text-align: center !important; border-top: 1px dashed var(--apx-border-heavy) !important; border-bottom: 1px dashed var(--apx-border-heavy) !important; }
.apx-ad-isolate-label { font-size: 10px !important; color: var(--apx-text-mut) !important; text-transform: uppercase !important; letter-spacing: 1px !important; margin-bottom: 10px !important; display: block !important; font-weight: 700 !important; }
.apx-ad-isolate-content { display: block; width: 100%; }

/* Comments Section */
.av-comments-sec { border-top: 1px solid var(--apx-border-heavy); padding-top: 48px; margin-top: 48px; }
.av-comments-sec h2 { font-weight: 800; font-size: 22px; margin: 0 0 32px 0; color: var(--apx-text); }
.av-comment-form textarea { width: 100%; background: transparent; border: 1px solid var(--apx-border-heavy); border-radius: 8px; padding: 14px; font-size: 15px; color: var(--apx-text); resize: vertical; margin-bottom: 12px; box-sizing: border-box; transition: border-color 0.2s; }
.av-comment-form textarea:focus { outline: none; border-color: var(--apx-text-mut); }
.av-btn-post { background: var(--apx-text); color: var(--apx-bg); border: none; padding: 8px 20px; border-radius: 99px; font-weight: 600; cursor: pointer; transition: 0.2s; font-size: 14px; }
.av-btn-post:hover { opacity: 0.85; }
.av-comment { display: flex; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--apx-border-heavy); }
.av-comment:last-child { border-bottom: none; }
.av-c-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.av-c-body { flex: 1; }
.av-c-header { margin-bottom: 12px; }
.av-c-name { font-weight: 600; font-size: 15px; color: var(--apx-text); display: flex; align-items: center; text-decoration: none; }
.av-c-time { font-size: 13.5px; color: var(--apx-text-mut); margin-top: 2px; }
.av-c-text { font-size: 15.5px; line-height: 1.6; color: var(--apx-text); margin-bottom: 12px; word-break: break-word; }
.av-c-actions { display: flex; gap: 16px; align-items: center; }
.av-c-reply-btn { background: none; border: none; color: var(--apx-text-mut); font-weight: 500; font-size: 13.5px; cursor: pointer; padding: 0; transition: color 0.2s; }
.av-c-reply-btn:hover { color: var(--apx-text); }
.av-reply-form { display: none; margin-top: 16px; }
.av-reply-form.active { display: block; }
.av-reply { display: flex; gap: 14px; margin-top: 20px; padding-left: 20px; border-left: 2px solid var(--apx-border-heavy); }
.av-reply .av-c-avatar { width: 32px; height: 32px; }

/* Layouts & Grids (Related, Weekly, Books) */
.av-related-wrapper { background: var(--apx-panel); border-top: 1px solid var(--apx-border-heavy); padding: 60px 24px; margin-top: 60px; }
.av-related-inner { max-width: 1200px; margin: 0 auto 60px auto; }
.av-related-inner h2 { font-size: 24px; font-weight: 800; margin: 0 0 32px 0; color: var(--apx-text); border-bottom: 2px solid var(--apx-border-heavy); padding-bottom: 12px; }
.av-rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 40px; }
.av-r-card { display: flex; flex-direction: column; text-decoration: none; transition: transform 0.2s; }
.av-r-card:hover { transform: translateY(-4px); }
.av-r-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 0 !important; margin-bottom: 16px; }
.av-r-title { font-size: 22px; font-weight: 800; line-height: 1.25; color: var(--apx-text); margin: 0 0 8px 0; letter-spacing: -0.01em; }
.av-r-deck { font-size: 15px; color: var(--apx-text-mut); line-height: 1.5; margin: 0 0 20px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.av-r-actions { display: flex; justify-content: flex-start; align-items: center; border-top: 1px solid var(--apx-border-heavy); padding-top: 16px; color: var(--apx-text-mut); font-size: 14px; gap: 24px; }
.av-r-stat { display: flex; align-items: center; gap: 6px; }
.av-r-stat svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.av-r-stat svg.solid-icon { fill: currentColor; stroke: none; }

/* Books Grid Specialty Styling */
.books-grid .av-r-img { aspect-ratio: 2/3; object-fit: cover; border-radius: 4px !important; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.progress-container { position: fixed; top: 0; left: 0; width: 100%; height: 4px; z-index: 9999; background: transparent; }
.progress-bar { height: 100%; background: var(--apx-brand); width: 0%; }
.floating-controls { position: fixed; bottom: 80px; right: 30px; z-index: 1000; }
.theme-toggle-btn { width: 48px; height: 48px; border-radius: 50%; background: var(--apx-text); color: var(--apx-bg); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.15); transition: transform 0.2s; }
.theme-toggle-btn:hover { transform: scale(1.08); }
.av-comments-sec .fa-solid, .av-comments-sec .fa-regular, .av-comments-sec i[class*="fa-"] { font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "FontAwesome" !important; font-weight: 900 !important; }

/* TRENDING BOOKS GRID */
.books-grid-wrapper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 24px; }
@media (max-width: 768px) { .books-grid-wrapper { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
.book-card-item { display: flex; flex-direction: column; text-decoration: none; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.book-card-item:hover { transform: translateY(-4px); }
.book-cover-box { position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: #cbd5e1; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); }
.book-cover-box img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Title Overlay over the Cover Image */
.book-cover-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.2) 60%, transparent 100%); display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; z-index: 3; }
.book-cover-title { font-family: var(--apx-font-serif, serif); font-size: 25px; font-weight: 800; color: #ffffff; line-height: 1.3; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.book-author-sub { font-size: 11px; font-weight: 600; color: #38bdf8; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--apx-text-mut); font-weight: 600; }