:root {
    /* Color Palette - Light Mode */
    --bg-primary: #fdfaf6; /* Parchment-like */
    --bg-secondary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --accent-primary: #c43e1c; /* Deep Terracotta */
    --accent-secondary: #8b2d15;
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    
    /* Fonts */
    --font-heading: 'Amiri', serif;
    --font-body: 'Tajawal', sans-serif;
    
    /* Spacing */
    --container-width: 1200px;
    --nav-height: 80px;
}

[data-theme="dark"] {
    --bg-primary: #0f1115; /* Charcoal */
    --bg-secondary: #1a1d23;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-primary: #e65b39;
    --accent-secondary: #f07b5d;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(15, 17, 21, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* Header */
#main-header {
    height: var(--nav-height);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
}

#main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--accent-primary);
}

.logo h1 {
    font-size: 1.8rem;
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a:hover {
    color: var(--accent-primary);
}

.actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

#theme-toggle:hover {
    transform: rotate(15deg);
}

.login-link {
    font-weight: 500;
    font-size: 0.95rem;
}

.login-link:hover {
    color: var(--accent-primary);
}

/* Buttons */
.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: var(--font-body);
}

.btn-primary {
    display: flex;
    align-items: flex-end;
   
    gap: 0.5rem;
    background-color: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(196, 62, 28, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline:hover {
    background-color: var(--accent-primary);
    color: white;
}

.app-toast {
    position: fixed;
    top: 92px;
    inset-inline-end: 20px;
    z-index: 2300;
    min-width: 260px;
    max-width: min(92vw, 420px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 0.75rem 0.8rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.55rem;
    transform: translateY(-10px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.app-toast__icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(22, 163, 74, 0.14);
    color: #15803d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
}

.app-toast__body {
    color: var(--text-primary);
    font-size: 0.93rem;
    line-height: 1.5;
}

.app-toast__close {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-toast__close:hover {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-primary);
}

.terms-content {
    max-width: 980px;
    margin: 0 auto;
    font-size: 1.12rem;
    line-height: 2.15;
}

.terms-content-title {
    font-size: 1.55rem;
    margin-bottom: 1rem;
}

.terms-copyright {
    margin-top: 1.5rem;
}

.contact-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.1fr);
    gap: 1.25rem;
    align-items: start;
}

.contact-form {
    display: grid;
    gap: 0.95rem;
}

.contact-form__field {
    display: grid;
    gap: 0.45rem;
}

.contact-form__field > span {
    font-weight: 600;
}

.contact-form__field input,
.contact-form__field textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
}

.contact-form__field textarea {
    resize: vertical;
    min-height: 10rem;
}

.contact-form__field input:focus,
.contact-form__field textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(196, 62, 28, 0.12);
}

.contact-form__error {
    color: #b91c1c;
    font-size: 0.82rem;
}

.faq-list {
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    gap: 0.75rem;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-primary);
    padding: 1rem 1.1rem;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-primary);
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item p {
    margin: 0.75rem 0 0;
    color: var(--text-secondary);
    line-height: 1.9;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.blog-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.15rem;
    display: grid;
    gap: 0.65rem;
}

.blog-card__thumb-link {
    display: block;
}

.blog-card__thumb {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.blog-card__tag {
    display: inline-flex;
    justify-self: start;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--accent-primary);
    background: rgba(196, 62, 28, 0.12);
}

.blog-card h3 {
    margin: 0;
    font-size: 1.12rem;
}

.blog-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.8;
}

.blog-card__link {
    color: var(--accent-primary);
    font-weight: 700;
}

.blog-card__link:hover {
    text-decoration: underline;
}

.blog-pagination {
    margin-top: 1.2rem;
}

.blog-show-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.blog-post-body {
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 14px;
    padding: 1.2rem;
}

.blog-post-thumb {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.blog-post-excerpt {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: rgba(196, 62, 28, 0.08);
    color: var(--text-primary);
}

.blog-post-content {
    color: var(--text-primary);
    line-height: 2;
    white-space: normal;
}

.blog-related-list {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-related-list a {
    color: var(--text-primary);
}

.blog-related-list a:hover {
    color: var(--accent-primary);
}

.writers-search-form {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    align-items: center;
}

.writers-search-status {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.writers-search-slug {
    display: block;
    color: var(--text-secondary);
    margin: -0.25rem 0 0.25rem;
}

.writers-search-highlight {
    background: rgba(196, 62, 28, 0.18);
    color: inherit;
    padding: 0 0.2rem;
    border-radius: 0.3rem;
}

.writers-search-input {
    flex: 1 1 320px;
    min-height: 46px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
}

.writers-grid-list {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.writer-card--list {
    min-width: 0;
    padding: 2rem 1rem 1.4rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

/* Sections Global */
section {
    padding: 8rem 0;
    opacity: 1;
    transform: translateY(30px);
    transition: all 1s ease;
}

section.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 3rem;
}

.view-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary);
    font-weight: 500;
}

/* Hero Section Styles */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: calc(var(--nav-height) + 6rem);
    background: radial-gradient(circle at 10% 20%, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
}

.hero-image {
    position: relative;
    height: 600px;
}

.hero-blob {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url('../images/hero-bg.png');
    background-size: cover;
    background-position: center;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: blobMorph 20s linear infinite alternate;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

@keyframes blobMorph {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
    50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
    75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

/* Featured Stories Section Styles */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.story-card {
    background: var(--bg-secondary);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
}

.story-card:hover {
    transform: translateY(-10px);
}

.story-image {
    height: 240px;
    background-size: cover;
    background-position: center;
}

.story-body {
    padding: 2rem;
}

.category-tag {
    background: rgba(196, 62, 28, 0.1);
    color: var(--accent-primary);
    padding: 0.3rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 1rem;
}

.story-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.story-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.author {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.author span {
    font-size: 0.9rem;
    font-weight: 500;
}

.read-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Categories Section Styles */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.category-item {
    background: var(--bg-secondary);
    padding: 3rem 2rem;
    border-radius: 24px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

a.category-item {
    display: block;
    text-decoration: none;
    color: inherit;
}

.category-item:hover {
    transform: translateY(-12px);
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.category-item:hover * {
    color: white !important;
}

.category-icon {
    width: 60px;
    height: 60px;
    background: rgba(196, 62, 28, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--accent-primary);
    transition: all 0.3s ease;
}

.category-item h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.category-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Top Writers Section Styles */
.writers-scroll {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 1rem 0 3rem;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.writers-scroll::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.writer-card {
    min-width: 280px;
    background: var(--bg-secondary);
    padding: 3rem 2rem;
    border-radius: 30px;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.3s ease;
}

.writer-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.writer-avatar {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
}

.writer-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-primary);
}

.badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #666;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    border: 2px solid var(--bg-secondary);
}

.badge.gold { background: #ffd700; color: #000; }
.badge.silver { background: #c0c0c0; color: #000; }
.badge.bronze { background: #cd7f32; color: #fff; }

.writer-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
}

.writer-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.writer-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.writer-stats span {
    font-size: 0.85rem;
}

.writer-stats b {
    display: block;
    font-size: 1.1rem;
    color: var(--accent-primary);
}

/* Start Writing CTA Section Styles */
.cta-banner {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    text-align: center;
    border-radius: 40px;
    margin: 4rem 2rem;
    padding: 6rem 2rem;
}

.cta-content h2 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.cta-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-inline: auto;
}

.cta-banner .btn-primary {
    background: white;
    color: var(--accent-primary);
}

.cta-banner .btn-primary:hover {
    background: #f3f4f6;
    color: var(--accent-secondary);
}

/* Testimonials Section Styles */
.testimonials-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.testimonial-card {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    position: relative;
}

.quote-icon {
    font-size: 5rem;
    color: var(--accent-primary);
    opacity: 0.1;
    position: absolute;
    top: 1rem;
    right: 2rem;
    line-height: 1;
}

.testimonial-card p {
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.user-info span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* App Preview Section Styles */
.app-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    background: var(--bg-secondary);
    padding: 4rem;
    border-radius: 40px;
    border: 1px solid var(--border-color);
}

.tag {
    background: rgba(196, 62, 28, 0.1);
    color: var(--accent-primary);
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.app-text h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.app-text p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.app-btns {
    display: flex;
    gap: 1rem;
}

.btn-dark {
    background: #000;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.app-visual {
    position: relative;
}

.app-mockup {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

/* Newsletter Section Styles */
.newsletter-box {
    background: var(--accent-primary);
    background-image: radial-gradient(circle at 90% 10%, rgba(255,255,255,0.1) 0%, transparent 40%);
    color: white;
    padding: 6rem 4rem;
    border-radius: 40px;
    text-align: center;
}

.newsletter-box h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.newsletter-box p {
    margin-bottom: 3rem;
    opacity: 0.9;
    font-size: 1.1rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    border: none;
    font-family: var(--font-body);
    font-size: 1rem;
}

/* Footer Styles */
#main-footer {
    background: var(--bg-secondary);
    padding: 6rem 0 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-about p {
    margin: 1.5rem 0 2rem;
    color: var(--text-secondary);
    max-width: 300px;
}

.social-links {
    display: flex;
    gap: 1.2rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-links a svg,
.social-links a svg * {
    stroke: currentColor;
}

.social-links a:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.footer-links h4 {
    font-size: 1.4rem;
    margin-bottom: 2rem;
}

.footer-links ul li {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive Navigation */
#menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    align-items: center;
    justify-content: center;
}

@media (max-width: 992px) {
    .contact-page-grid {
        grid-template-columns: 1fr;
    }

    .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .blog-show-grid {
        grid-template-columns: 1fr;
    }

    .writers-grid-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        right: -100%;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: var(--bg-secondary);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2.5rem;
        transition: 0.3s ease-in-out;
        z-index: 999;
        border-top: 1px solid var(--border-color);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    #menu-toggle {
        display: flex;
    }

    .actions .login-link, 
    .actions .btn-primary {
        display: none; /* Hide on mobile to show in menu or simplify */
    }
}

@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .writers-grid-list {
        grid-template-columns: 1fr;
    }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .stories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .section-header {
        margin-bottom: 2.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-header h2 { font-size: 2rem; }
    
    .hero-title { 
        font-size: 2.8rem;
        text-align: center;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        text-align: center;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
    }

    .hero-btns .btn {
        width: 100%;
        text-align: center;
    }

    .hero-container, .stories-grid, .testimonials-grid, .app-container, .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero-image { height: 350px; }
    
    .app-container, .newsletter-box {
        padding: 3rem 1.5rem;
    }

    .app-text h2, .newsletter-box h2 {
        font-size: 2.22rem;
    }

    .newsletter-form { flex-direction: column; }
    
    .cta-banner {
        margin: 2rem 1rem;
        padding: 4rem 1.5rem;
    }

    .cta-content h2 { font-size: 2.2rem; }
    .app-text h2 { font-size: 2.2rem; }

    .footer-grid {
        gap: 2.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 1s ease forwards;
}
/* Login Page Styles */
.login-body {
    height: 100vh;
    overflow: hidden;
}

.login-container {
    display: flex;
    height: 100vh;
    width: 100%;
    background: var(--bg-primary);
}

.login-visual {
    flex: 1.2;
    background:
        radial-gradient(circle at 20% 20%, rgba(196, 62, 28, 0.25), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(196, 62, 28, 0.12), transparent 50%),
        linear-gradient(135deg, #3a140b 0%, #5d2011 45%, #7a2a17 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 4rem;
    color: white;
}

.login-visual::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
}

.login-visual-content {
    position: relative;
    z-index: 2;
    max-width: 500px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    padding: 2rem;
    border-radius: 20px;
}

.login-visual-content h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: white;
}

.login-visual-content p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.login-form-side {
    flex: 1;
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 6rem;
    overflow-y: auto;
    position: relative;
    border-inline-start: 1px solid var(--border-color);
}

.login-header {
    margin-bottom: 3rem;
}

.auth-mode-switch {
    display: inline-flex;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.25rem;
    margin-top: 1.25rem;
}

.auth-mode-switch a {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.auth-mode-switch a.active {
    background: var(--accent-primary);
    color: #fff;
}

.login-header .logo {
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    inset-inline-end: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.input-wrapper input {
    width: 100%;
    min-height: 52px;
    padding: 1rem 3rem 1rem 2.8rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(196, 62, 28, 0.1);
}

.toggle-password {
    margin-right: -30px;
    position: absolute;
    inset-inline-start: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    display: flex;
    align-items: center;
}

.form-utils {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.forgot-password {
    color: var(--accent-primary);
    font-weight: 500;
}

.login-btn {
    margin-top: 1rem;
    width: 100%;
}

.social-login {
    margin-top: 2.5rem;
    text-align: center;
}

.social-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.social-divider::before,
.social-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.social-btns {
    display: flex;
    gap: 1rem;
}

.btn-social {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.btn-social:hover {
    background-color: var(--bg-secondary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.login-footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-secondary);
}

.login-footer a {
    color: var(--accent-primary);
    font-weight: 700;
}

.back-home {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.back-home:hover {
    color: var(--accent-primary);
}

/* Responsive Login */
@media (max-width: 1024px) {
    .login-visual {
        display: none;
    }
    .login-form-side {
        padding: 4rem 1.25rem;
    }
    
    .back-home {
        position: static;
        margin-bottom: 2rem;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .social-btns {
        flex-direction: column;
    }
    
    .btn-social {
        width: 100%;
    }
}

/* Story Details Page */
.story-details-page {
    padding-top: var(--nav-height);
}

.story-details-page section {
    opacity: 1;
    transform: none;
    transition: none;
    padding: 5rem 0;
}

.story-hero {
    padding-top: 3rem !important;
    background: radial-gradient(circle at 80% 10%, rgba(196, 62, 28, 0.08), transparent 40%);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.breadcrumbs a:hover {
    color: var(--accent-primary);
}

.story-hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

.story-main-card,
.sidebar-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
}

.story-main-card {
    padding: 2.2rem;
}

.story-main-card h2 {
    font-size: 3rem;
    line-height: 1.2;
    margin: 1rem 0;
}

.story-lead {
    color: var(--text-secondary);
    font-size: 1.15rem;
    margin-bottom: 2rem;
}

.story-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.story-cover {
    min-height: 420px;
    border-radius: 24px;
    background-size: cover;
    background-position: center;
    box-shadow: var(--card-shadow);
}

.story-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.article-body {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    padding: 2.5rem;
}

.article-body p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 2;
}

.article-body blockquote {
    border-inline-start: 4px solid var(--accent-primary);
    background: rgba(196, 62, 28, 0.08);
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    margin: 2rem 0;
    font-size: 1.2rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.story-chapters-nav {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.story-reading-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-block: 0.9rem;
}

.story-reading-tools__label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.story-reading-size-switcher {
    display: inline-flex;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.2rem;
}

.story-reading-size-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    width: 40px;
    height: 32px;
    border-radius: 999px;
    font-family: var(--font-body);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.story-reading-size-btn.is-active {
    background: rgba(196, 62, 28, 0.14);
    color: var(--accent-primary);
}

.story-reading-size-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
}

.story-reading-tools__quote-hint {
    flex-basis: 100%;
    margin: 0.65rem 0 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
    max-width: 36rem;
}

.story-chapter-content--sm {
    font-size: 1.15rem !important;
    line-height: 1.9 !important;
}

.story-chapter-content--sm p {
    font-size: 1.15rem !important;
    line-height: 1.9 !important;
}

.story-chapter-content--md {
    font-size: 1.35rem !important;
    line-height: 2 !important;
}

.story-chapter-content--md p {
    font-size: 1.35rem !important;
    line-height: 2 !important;
}

.story-chapter-content--lg {
    font-size: 1.6rem !important;
    line-height: 2.2 !important;
}

.story-chapter-content--lg p {
    font-size: 1.6rem !important;
    line-height: 2.2 !important;
}

.story-comments-under-writing {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.story-comments-heading {
    font-size: 1.35rem;
    margin: 0;
    color: var(--text-primary);
}

.story-comments-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.story-comment-form {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.story-comment-form textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    resize: vertical;
}

.story-comment-form-error {
    display: block;
    color: #b91c1c;
    font-size: 0.85rem;
}

.story-comments-login-hint {
    margin: 0 0 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.story-comments-list {
    display: grid;
    gap: 1rem;
}

.story-comment-item {
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
}

.story-comment-item__inner {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.story-comment-item__avatar-link,
.story-comment-item__avatar-wrap {
    flex-shrink: 0;
    line-height: 0;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary, rgba(148, 163, 184, 0.12));
}

.story-comment-item__avatar-link:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.story-comment-item__avatar {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: cover;
}

.story-comment-item__body {
    flex: 1;
    min-width: 0;
}

.story-comment-item__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.45rem 0.65rem;
    margin-bottom: 0.45rem;
}

.story-comment-item__meta b a {
    color: inherit;
    text-decoration: none;
}

.story-comment-item__meta b a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.story-comment-item small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.story-comment-item p {
    margin: 0;
    color: var(--text-primary);
}

.story-comments-empty {
    margin: 0;
    color: var(--text-secondary);
}

/* Share selection as quote image (story reading page) */
.story-quote-share-popover {
    position: fixed;
    z-index: 2100;
    padding: 0.25rem;
    border-radius: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.story-quote-share-popover__btn {
    white-space: nowrap;
    font-size: 0.88rem;
    padding: 0.45rem 0.85rem;
}

.story-quote-share-modal {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.story-quote-share-modal[hidden] {
    display: none;
}

.story-quote-share-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.story-quote-share-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 640px);
    max-height: min(92vh, 900px);
    overflow: auto;
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 1.25rem 1.35rem 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.story-quote-share-modal__hint {
    margin: 0.35rem 0 1rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
}

.story-quote-share-modal__preview-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: auto;
    padding: 0.5rem;
    background: rgba(148, 163, 184, 0.12);
    border-radius: 12px;
}

.story-quote-share-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-start;
}

.story-quote-share-modal__error {
    margin: 0.75rem 0 0;
    color: #b91c1c;
    font-size: 0.9rem;
}

.quote-share-card {
    width: 880px;
    max-width: 100%;
    box-sizing: border-box;
    font-family: 'Tajawal', 'Amiri', system-ui, sans-serif;
    background: linear-gradient(155deg, #2a1210 0%, #1a0f0c 42%, #120a08 100%);
    color: #fdf6f3;
    border-radius: 20px;
    padding: 2.5rem 2.75rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.quote-share-card__inner {
    position: relative;
}

.quote-share-card__mark {
    margin: 0;
    font-family: 'Amiri', serif;
    font-size: 4.5rem;
    line-height: 0.85;
    color: rgba(253, 186, 116, 0.55);
    user-select: none;
}

.quote-share-card__mark--end {
    text-align: left;
    margin-top: -0.25rem;
}

.quote-share-card__text {
    margin: 0.25rem 0 1.25rem;
    font-size: 1.65rem;
    line-height: 1.75;
    font-weight: 500;
    color: #fff7f2;
    white-space: pre-wrap;
    word-break: break-word;
}

.quote-share-card__footer {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.quote-share-card__author {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fdba74;
}

.quote-share-card__site {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.65);
    word-break: break-all;
}

.writer-contact-form {
    display: grid;
    gap: 0.5rem;
}

.writer-contact-form textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    resize: vertical;
}

.writer-message-row {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.writer-message-row:last-child {
    border-bottom: none;
}

.writer-message-row.is-unread {
    background: rgba(196, 62, 28, 0.06);
    margin: 0 -0.5rem;
    padding-inline: 0.5rem;
    border-radius: 10px;
}

.writer-message-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.writer-message-meta small {
    color: var(--text-secondary);
}

.writer-message-body {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.7;
}

.writer-inline-form {
    display: inline;
}

.writer-blocked-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.writer-blocked-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.writer-messages-pref-form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
}

.writer-message-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 1rem;
}

.writer-message-threads-panel,
.writer-message-thread-panel {
    min-height: 420px;
}

.writer-thread-item {
    display: grid;
    gap: 0.45rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    margin-bottom: 0.65rem;
    background: var(--bg-primary);
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.writer-thread-item__main {
    display: block;
}

.writer-thread-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.writer-thread-item.is-active {
    border-color: var(--accent-primary);
    background: rgba(196, 62, 28, 0.08);
}

.writer-thread-item__head {
    display: flex;
    justify-content: space-between;
    gap: 0.55rem;
    align-items: center;
}

.writer-thread-item__head small {
    color: var(--text-secondary);
    white-space: nowrap;
}

.writer-thread-item p {
    margin: 0.4rem 0 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.writer-thread-item__action {
    justify-self: flex-end;
}

.writer-thread-item__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 0.45rem;
}

.writer-thread-header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.8rem;
}

.writer-thread-messages {
    display: grid;
    gap: 0.7rem;
    max-height: 520px;
    overflow: auto;
    padding-inline-end: 0.25rem;
}

.writer-chat-bubble {
    border-radius: 12px;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border-color);
    max-width: min(78%, 680px);
}

.writer-chat-bubble.is-received {
    justify-self: start;
    background: var(--bg-primary);
    border-color: rgba(107, 114, 128, 0.32);
}

.writer-chat-bubble.is-sent {
    justify-self: end;
    background: linear-gradient(135deg, #c43e1c 0%, #b53b1d 100%);
    border-color: rgba(196, 62, 28, 0.35);
    color: #ffffff;
}

.writer-chat-bubble.is-sent .writer-message-body,
.writer-chat-bubble.is-sent .writer-chat-bubble__meta small,
.writer-chat-bubble.is-sent .writer-chat-bubble__meta b {
    color: #ffffff;
}

.writer-chat-bubble__meta {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.35rem;
}

.writer-chat-bubble__meta small {
    color: var(--text-secondary);
    font-size: 0.78rem;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .writer-chat-bubble {
        max-width: 92%;
    }
}

.writer-thread-reply-form {
    margin-top: 0.9rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.9rem;
    display: grid;
    gap: 0.5rem;
}

.writer-thread-reply-form__label {
    font-weight: 600;
    font-size: 0.9rem;
}

.writer-thread-reply-form__textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    padding: 0.65rem 0.75rem;
    resize: vertical;
    min-height: 88px;
}

.writer-thread-reply-form__textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(196, 62, 28, 0.14);
}

.writer-thread-reply-form__actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 920px) {
    .writer-message-layout {
        grid-template-columns: 1fr;
    }

    .writer-message-threads-panel,
    .writer-message-thread-panel {
        min-height: auto;
    }

    .writer-thread-messages {
        max-height: none;
    }
}

.story-sidebar {
    display: grid;
    gap: 1rem;
}

.sidebar-card {
    padding: 1.5rem;
}

.sidebar-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.sidebar-card p {
    color: var(--text-secondary);
}

.sidebar-card ul {
    display: grid;
    gap: 0.8rem;
}

.sidebar-card li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.6rem;
    color: var(--text-secondary);
}

.sidebar-card li b {
    color: var(--accent-primary);
}

.sidebar-card .btn {
    min-height: 34px;
    padding: .35rem .65rem;
    font-size: .88rem;
}

.story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.related-stories .story-card h3 a:hover {
    color: var(--accent-primary);
}

@media (max-width: 992px) {
    .story-hero-grid,
    .story-layout {
        grid-template-columns: 1fr;
    }

    .story-main-card h2 {
        font-size: 2.3rem;
    }

    .story-cover {
        min-height: 320px;
    }
}

@media (max-width: 768px) {
    .story-details-page section {
        padding: 3.5rem 0;
    }

    .story-main-card,
    .article-body {
        padding: 1.5rem;
    }

    .story-main-card h2 {
        font-size: 1.9rem;
    }

    .story-lead,
    .article-body p {
        font-size: 1rem;
    }

    .breadcrumbs {
        flex-wrap: wrap;
    }
}

/* Writer Profile Page */
.writer-layout-body {
    min-height: 100vh;
    background: var(--bg-primary);
}

.writer-layout-body .writer-dashboard-page,
.writer-layout-body .writer-profile-page,
.writer-layout-body .writer-add-story-page {
    padding-top: 0 !important;
}

.writer-profile-page {
    padding-top: var(--nav-height);
    min-height:100vh;
}

.writer-profile-page section {
    opacity: 1;
    transform: none;
    transition: none;
    padding: 5rem 0;
}

.writer-profile-hero {
    padding-top: 3rem !important;
    background: radial-gradient(circle at 20% 10%, rgba(196, 62, 28, 0.08), transparent 35%);
}

.writer-profile-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    box-shadow: var(--card-shadow);
    padding: 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.writer-profile-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--bg-primary);
    object-fit: cover;
}

.writer-profile-main h2 {
    font-size: 2.8rem;
    margin: 0.8rem 0 0.4rem;
}

.writer-profile-role,
.writer-profile-bio {
    color: var(--text-secondary);
}

.writer-profile-role {
    font-weight: 500;
}

.writer-profile-bio {
    margin-top: 0.8rem;
    max-width: 760px;
}

.writer-profile-actions {
    margin-top: 1.2rem;
    display: flex;
    gap: 0.8rem;
}

.writer-profile-card-full {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}

.writer-message-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: clamp(0.75rem, 3vh, 2rem) 1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.writer-message-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.writer-message-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.68);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

.writer-message-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    max-height: min(90vh, 640px);
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem 1.5rem 1.25rem;
    transform: translateY(10px) scale(0.98);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.writer-message-modal.is-open .writer-message-modal__dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.writer-message-modal__dialog h3 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.writer-message-modal__close {
    position: absolute;
    top: 0.85rem;
    inset-inline-end: 0.85rem;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-message-modal__close:hover {
    color: var(--accent-primary);
}

.writer-message-modal__hint {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.writer-profile-stats {
    display: grid;
    gap: 0.8rem;
    min-width: 120px;
}

.writer-profile-stats div {
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.8rem;
    background: var(--bg-primary);
}

.writer-profile-stats b {
    color: var(--accent-primary);
    display: block;
    font-size: 1.2rem;
}

.writer-profile-stats span {
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.writer-content-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.writer-stories-grid {
    grid-template-columns: repeat(2, 1fr);
}

.writer-side-panels {
    display: grid;
    gap: 1rem;
}

@media (max-width: 1100px) {
    .writer-profile-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .writer-profile-avatar {
        display: flex;
        justify-content: center;
    }

    .writer-profile-actions {
        justify-content: center;
    }

    .writer-profile-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .writer-content-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .writer-profile-page section {
        padding: 3.5rem 0;
    }

    .writer-profile-main h2 {
        font-size: 2rem;
    }

    .writer-profile-stats {
        grid-template-columns: 1fr;
    }

    .writer-stories-grid {
        grid-template-columns: 1fr;
    }
}

/* Auth V2 */
.auth-v2-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 10%, rgba(196, 62, 28, 0.12), transparent 30%),
        radial-gradient(circle at 90% 90%, rgba(196, 62, 28, 0.08), transparent 35%),
        var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
}

.auth-v2-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
}

.auth-v2-brand {
    padding: 2.5rem;
    background: linear-gradient(140deg, rgba(196, 62, 28, 0.96), rgba(139, 45, 21, 0.98));
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.auth-v2-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    color: #fff;
    opacity: 0.9;
}

.auth-v2-home:hover {
    opacity: 1;
}

.auth-v2-brand-card {
    margin: auto 0;
    max-width: 520px;
}

.auth-v2-brand-card h2 {
    font-size: 3rem;
    line-height: 1.2;
    margin: 1rem 0;
}

.auth-v2-brand-card p {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.1rem;
    margin-bottom: 1.4rem;
}

.auth-v2-points {
    display: grid;
    gap: 0.9rem;
}

.auth-v2-points li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 500;
}

.auth-v2-form-side {
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-v2-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 560px;
    width: 100%;
    margin: 0 auto 1.2rem;
}

.auth-v2-theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.auth-v2-switch {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-secondary);
    padding: 0.2rem;
}

.auth-v2-switch a {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.auth-v2-switch a.active {
    background: var(--accent-primary);
    color: #fff;
}

.auth-v2-card {
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    padding: 2rem;
}

.auth-v2-card h3 {
    font-size: 2rem;
}

.auth-v2-card > p {
    color: var(--text-secondary);
    margin-top: 0.4rem;
    margin-bottom: 1.2rem;
}

.auth-v2-form {
    display: grid;
    gap: 1rem;
}

.auth-v2-register-form {
    gap: 0.9rem;
}

.auth-v2-field {
    display: grid;
    gap: 0.45rem;
}

.auth-v2-field label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-v2-input {
    position: relative;
}

.auth-v2-input > i,
.auth-v2-input > svg {
    position: absolute;
    inset-inline-start: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.auth-v2-input input {
    width: 100%;
    min-height: 50px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 0.9rem 2.8rem 0.9rem 2.8rem;
    font-family: var(--font-body);
    font-size: 0.98rem;
}

.auth-v2-input input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(196, 62, 28, 0.12);
}

.auth-v2-password .toggle-password {
    position: absolute;
    left: 0.9rem;
    inset-inline-end: auto;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.1rem;
    width: 24px;
    height: 24px;
    line-height: 0;
    z-index: 2;
}

.auth-v2-password .toggle-password i,
.auth-v2-password .toggle-password svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.auth-v2-password input {
    padding-left: 2.8rem;
}

.auth-v2-utils {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.2rem;
}

.auth-v2-submit {
    width: 100%;
    margin-top: 0.2rem;
    border-radius: 12px;
}

.auth-v2-social {
    margin-top: 1.2rem;
}

.auth-v2-card .social-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.auth-v2-card .btn-social {
    min-height: 48px;
    border-radius: 12px;
}

@media (max-width: 1024px) {
    .auth-v2-wrap {
        grid-template-columns: 1fr;
    }

    .auth-v2-brand {
        display: none;
    }

    .auth-v2-form-side {
        padding: 1.2rem;
    }

    .auth-v2-card {
        padding: 1.4rem;
    }
}

@media (max-width: 600px) {
    .auth-v2-topbar {
        gap: 0.7rem;
    }

    .auth-v2-switch {
        width: 100%;
        justify-content: space-between;
    }

    .auth-v2-switch a {
        flex: 1;
        text-align: center;
    }

    .auth-v2-card h3 {
        font-size: 1.65rem;
    }

    .auth-v2-card .social-btns {
        grid-template-columns: 1fr;
    }
}

/* Explore Page */
.explore-page {
    padding-top: var(--nav-height);
}

.explore-page section {
    opacity: 1;
    transform: none;
    transition: none;
}

.explore-hero {
    padding: 4.5rem 0 2.5rem !important;
    background: radial-gradient(circle at 80% 10%, rgba(196, 62, 28, 0.1), transparent 40%);
}

.explore-hero h2 {
    font-size: 3.2rem;
    margin-bottom: 0.8rem;
}

.explore-hero p {
    color: var(--text-secondary);
    max-width: 720px;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.explore-search {
    max-width: 820px;
    position: relative;
    display: flex;
    gap: 0.7rem;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.7rem;
    box-shadow: var(--card-shadow);
}

.explore-search > i,
.explore-search > svg {
    color: var(--text-secondary);
    margin-inline: 0.45rem 0.2rem;
}

.explore-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
}

.explore-search input:focus {
    outline: none;
}

.explore-search .btn {
    border-radius: 12px;
}

.explore-filters {
    padding: 1rem 0 2rem !important;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.chip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-family: var(--font-body);
    cursor: pointer;
}

.chip.active,
.chip:hover {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.explore-layout {
    padding: 1rem 0 5rem !important;
}

.explore-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

.explore-side {
    display: grid;
    gap: 1rem;
}

.explore-side .sidebar-card ul li a {
    color: var(--accent-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.explore-stories {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1100px) {
    .explore-grid {
        grid-template-columns: 1fr;
    }

    .explore-stories {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .explore-hero h2 {
        font-size: 2.2rem;
    }

    .explore-search {
        flex-wrap: wrap;
    }

    .explore-search .btn {
        width: 100%;
    }

    .explore-stories {
        grid-template-columns: 1fr;
    }
}

/* Trending Page */
.trending-page {
    padding-top: var(--nav-height);
}

.trending-page section {
    opacity: 1;
    transform: none;
    transition: none;
}

.trending-hero {
    padding: 4.5rem 0 2.5rem !important;
    background: radial-gradient(circle at 15% 15%, rgba(196, 62, 28, 0.12), transparent 40%);
}

.trending-hero h2 {
    font-size: 3rem;
    margin-bottom: 0.8rem;
}

.trending-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.4rem;
}

.trending-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 190px));
    gap: 0.8rem;
}

.trending-stats div {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.8rem;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.trending-stats b {
    display: block;
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.trending-stats span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.trending-layout {
    padding: 1rem 0 5rem !important;
}

.trending-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

.trending-sidebar {
    display: grid;
    gap: 1rem;
}

.trending-sidebar .sidebar-card ul li a {
    color: var(--accent-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.trending-stories {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1100px) {
    .trending-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .trending-hero h2 {
        font-size: 2.2rem;
    }

    .trending-stats {
        grid-template-columns: 1fr;
    }

    .trending-stories {
        grid-template-columns: 1fr;
    }
}

/* Writer Dashboard */
.writer-dashboard-page {
    padding-top: var(--nav-height);
    min-height: 100vh;
}

.writer-dashboard-page section {
    opacity: 1;
    transform: none;
    transition: none;
}

.writer-dashboard-hero {
    padding: 4rem 0 2rem !important;
    background: radial-gradient(circle at 80% 20%, rgba(196, 62, 28, 0.12), transparent 42%);
}

.dashboard-hero-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
}

.dashboard-hero-row h2 {
    font-size: 2.6rem;
}

.dashboard-hero-row p {
    color: var(--text-secondary);
}

.dashboard-hero-actions {
    display: flex;
    gap: 0.6rem;
}

.writer-hero-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.writer-hero-icon-btn i,
.writer-hero-icon-btn svg {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
}

.writer-hero-icon-btn.btn-outline:hover svg,
.writer-hero-icon-btn.btn-outline:hover svg *,
.writer-hero-icon-btn.btn-primary:hover svg,
.writer-hero-icon-btn.btn-primary:hover svg * {
    stroke: #ffffff;
    color: #ffffff;
}

.writer-dashboard-body {
    padding: 1.2rem 0 5rem !important;
}

.writer-page.admin-page {
    background: var(--bg-primary);
}

.writer-shell .writer-admin-sidebar {
    width: 300px;
    background: linear-gradient(180deg, #7c2d12 0%, #9a3412 100%);
    padding: 1.6rem 1rem;
}

.writer-shell .writer-admin-main {
    margin-right: 300px;
    padding: 0;
}

.writer-page .writer-dashboard-page,
.writer-page .writer-add-story-page,
.writer-page .writer-profile-page {
    padding-top: 0 !important;
}

.writer-page .writer-dashboard-hero,
.writer-page .writer-add-story-hero,
.writer-page .writer-profile-hero {
    padding-top: 1.5rem;
}

.writer-shell .admin-nav-link {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.88);
}

.writer-shell .admin-nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.writer-shell .admin-nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

.writer-shell .admin-nav-section {
    color: rgba(255, 255, 255, 0.66);
}

.writer-shell .admin-sidebar-brand h1 {
    color: #ffffff;
}

.writer-shell .admin-sidebar-brand p {
    color: rgba(255, 255, 255, 0.75);
}

.writer-shell .admin-footer-link {
    color: rgba(255, 255, 255, 0.8);
}

.writer-shell .admin-footer-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.writer-shell .admin-nav-link i,
.writer-shell .admin-footer-link i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

.writer-sidebar-logout-form {
    margin: 0;
}

.writer-logout-btn {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: right;
    font-family: inherit;
    cursor: pointer;
}

.writer-dashboard-main {
    min-width: 0;
    display: grid;
    gap: 1rem;
}

.writer-dashboard-main > .dashboard-panel,
.writer-dashboard-main > .stories-grid,
.writer-dashboard-main > .dashboard-table-wrap {
    animation: fadeInUp 0.24s ease;
}

.dashboard-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    padding: 1.2rem;
}

.collection-reader-panel {
    background: var(--bg-secondary);
   
    padding: 0.9rem;
}

.dashboard-menu {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.8rem;
}

.dashboard-menu a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    color: var(--text-secondary);
}

.dashboard-menu a:hover,
.dashboard-menu a.active {
    background: rgba(196, 62, 28, 0.12);
    color: var(--accent-primary);
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 1rem;
}

.metric-card span {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.metric-card b {
    display: block;
    font-size: 1.55rem;
    color: var(--accent-primary);
    margin: 0.2rem 0;
}

.metric-card small {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.dashboard-content-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 1rem;
}

.dashboard-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.dashboard-panel-head a {
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.dashboard-table-wrap {
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.dashboard-table th,
.dashboard-table td {
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    padding: 0.65rem 0.4rem;
    font-size: 0.92rem;
}

.dashboard-table th {
    color: var(--text-secondary);
    font-weight: 500;
}

.dashboard-table td a:hover {
    color: var(--accent-primary);
}

.status-badge {
    display: inline-flex;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.status-badge.published {
    background: rgba(16, 185, 129, 0.16);
    color: #059669;
}

.status-badge.draft {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
}

.dashboard-comments {
    display: grid;
    gap: 0.8rem;
}

.dashboard-comments li {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.8rem;
    background: var(--bg-primary);
}

.dashboard-comments p {
    margin-bottom: 0.35rem;
}

.dashboard-comments small {
    color: var(--text-secondary);
}

.dashboard-insight-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.dashboard-insight-chip.success {
    color: #047857;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
}

.dashboard-insight-chip.warning {
    color: #b45309;
    background: rgba(245, 158, 11, 0.17);
    border-color: rgba(245, 158, 11, 0.35);
}

.dashboard-insight-chip.attention {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.34);
}

@media (max-width: 1100px) {
    .writer-shell .writer-admin-sidebar {
        position: static;
        width: 100%;
        max-height: none;
        margin: 1rem auto 0;
    }

    .writer-shell .writer-admin-main {
        margin-right: 0;
        padding: 1rem;
    }

    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .dashboard-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-hero-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-hero-row h2 {
        font-size: 2rem;
    }

    .dashboard-hero-actions {
        width: 100%;
        flex-direction: column;
    }

    .dashboard-hero-actions .btn {
        width: 100%;
        text-align: center;
    }

    .dashboard-metrics {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   Admin UI — Deep Indigo Theme
   ============================================= */

.admin-page {
    background: #f0f2f5;
    font-family: var(--font-body);
}

.admin-shell {
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.admin-sidebar {
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
    color: #e0e7ff;
    padding: 1.6rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.admin-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.4rem;
}

.admin-logo-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.admin-sidebar-brand h1 {
    font-size: 1.15rem;
    color: #fff;
    font-weight: 700;
    line-height: 1.2;
}

.admin-sidebar-brand p {
    color: #a5b4fc;
    font-size: 0.78rem;
    margin-top: 0.1rem;
}

.admin-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.admin-nav-section {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #818cf8;
    padding: 0.8rem 0.6rem 0.35rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    color: #c7d2fe;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.admin-nav-link svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.admin-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.admin-nav-link:hover svg {
    opacity: 1;
}

.admin-nav-link.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-weight: 600;
}

.admin-nav-link.active svg {
    opacity: 1;
}

.admin-sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-footer-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    color: #a5b4fc;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.admin-footer-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* ---- Main Content ---- */
.admin-main {
    margin-right: 260px;
    padding: 1.75rem 2rem;
    overflow-x: hidden;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-topbar h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: #1e1b4b;
    margin-bottom: 0.2rem;
}

.admin-topbar p {
    color: #6b7280;
    font-size: 0.9rem;
}

.admin-topbar-date {
    color: #6b7280;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ---- Flash / Alerts ---- */
.admin-flash {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

/* ---- Badges ---- */
.admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border-radius: 6px;
    padding: 0.2rem 0.55rem;
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.admin-badge-success {
    background: #dcfce7;
    color: #166534;
}

.admin-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.admin-badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.admin-badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.admin-badge-neutral {
    background: #f3f4f6;
    color: #4b5563;
}

/* ---- Cards ---- */
.admin-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.25rem;
}

.admin-card-warning {
    border-color: #fbbf24;
    border-width: 1px 1px 1px 4px;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.admin-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e1b4b;
}

.admin-card-header a {
    color: #4f46e5;
    font-size: 0.82rem;
    font-weight: 600;
}

.admin-card-header a:hover {
    text-decoration: underline;
}

.admin-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-section-head a {
    color: #4f46e5;
    font-weight: 600;
    font-size: 0.88rem;
}

/* ---- Metrics Grid ---- */
.admin-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.admin-metric-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: box-shadow 0.2s ease;
}

.admin-metric-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.admin-metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.admin-metric-body span {
    display: block;
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 500;
}

.admin-metric-body b {
    display: block;
    margin-top: 0.15rem;
    color: #1e1b4b;
    font-size: 1.35rem;
    font-weight: 800;
}

/* ---- Charts Row ---- */
.admin-charts-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.admin-chart-card {
    display: flex;
    flex-direction: column;
}

.admin-chart-wide {
    grid-column: span 2;
}

.admin-chart-legend {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.admin-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-inline-end: 0.2rem;
    flex-shrink: 0;
}

/* Bar Chart */
.admin-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 180px;
    padding-top: 0.5rem;
    flex: 1;
}

.admin-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    gap: 4px;
}

.admin-bar-stack {
    width: 100%;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 4px;
}

.admin-bar-seg {
    width: 100%;
    min-height: 2px;
}

.admin-bar-label {
    font-size: 0.62rem;
    color: #9ca3af;
    white-space: nowrap;
    text-align: center;
}

/* Donut Chart */
.admin-donut-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    flex: 1;
}

.admin-donut {
    width: 130px;
    height: 130px;
    transform: rotate(-90deg);
}

.admin-donut circle {
    transition: stroke-dashoffset 0.4s ease;
}

.admin-donut-center {
    position: absolute;
    text-align: center;
}

.admin-donut-center b {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e1b4b;
    line-height: 1;
}

.admin-donut-center span {
    font-size: 0.72rem;
    color: #9ca3af;
}

.admin-donut-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.admin-donut-legend li {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: #6b7280;
}

.admin-donut-legend li strong {
    color: #374151;
    margin-inline-start: 0.15rem;
}

/* Horizontal Bar Chart */
.admin-hbar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1;
    justify-content: center;
}

.admin-hbar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-hbar-name {
    width: 70px;
    font-size: 0.78rem;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    flex-shrink: 0;
}

.admin-hbar-track {
    flex: 1;
    height: 10px;
    background: #eef2ff;
    border-radius: 999px;
    overflow: hidden;
}

.admin-hbar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4f46e5, #818cf8);
    min-width: 4px;
    transition: width 0.3s ease;
}

.admin-hbar-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: #4f46e5;
    min-width: 36px;
    text-align: left;
}

/* ---- Dashboard Grid ---- */
.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

/* ---- Lists ---- */
.admin-growth-list,
.admin-compact-list,
.admin-review-list,
.admin-stat-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-growth-item {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 10px;
    padding: 0.8rem 0.9rem;
}

.admin-compact-list li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.admin-compact-list li:hover {
    background: #f9fafb;
}

.admin-list-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.admin-rank {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #eef2ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.admin-list-body {
    flex: 1;
    min-width: 0;
}

.admin-list-body p {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-list-body small {
    display: block;
    color: #9ca3af;
    font-size: 0.78rem;
    margin-top: 0.1rem;
}

.admin-empty-row {
    text-align: center;
    color: #9ca3af;
    padding: 1.5rem !important;
    font-size: 0.9rem;
}

.admin-stat-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
}

.admin-stat-list li span:first-child {
    font-size: 0.88rem;
    font-weight: 500;
    color: #374151;
}

/* ---- Growth / Trends ---- */
.admin-growth-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.admin-growth-head b {
    font-size: 0.88rem;
    color: #111827;
}

.admin-growth-badge {
    border-radius: 6px;
    padding: 0.2rem 0.55rem;
    font-size: 0.73rem;
    font-weight: 700;
}

.admin-growth-up {
    background: #dcfce7;
    color: #166534;
}

.admin-growth-down {
    background: #fee2e2;
    color: #991b1b;
}

.admin-growth-flat {
    background: #f3f4f6;
    color: #6b7280;
}

.admin-mini-bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    margin: 0.5rem 0 0.35rem;
}

.admin-mini-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4f46e5, #818cf8);
}

.admin-growth-item small {
    color: #9ca3af;
    font-size: 0.78rem;
}

.admin-growth-item small strong {
    color: #374151;
}

/* ---- Review Items ---- */
.admin-review-item {
    border-inline-start: 3px solid #f59e0b;
    padding-inline-start: 0.9rem !important;
}

.admin-review-item .admin-list-body {
    margin-bottom: 0.5rem;
}

/* ---- Action Buttons ---- */
.admin-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-body);
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.admin-action-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.admin-action-approve {
    border-color: #86efac;
    color: #166534;
    background: #f0fdf4;
}

.admin-action-approve:hover {
    background: #dcfce7;
}

.admin-action-reject {
    border-color: #fca5a5;
    color: #991b1b;
    background: #fef2f2;
}

.admin-action-reject:hover {
    background: #fee2e2;
}

.admin-inline-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

.admin-inline-form {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

/* ---- Filter Bar ---- */
.admin-filter-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.writer-writings-filter-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    -webkit-overflow-scrolling: touch;
}

.writer-writings-filter-bar > .admin-input {
    flex: 0 0 auto;
    min-width: 9.5rem;
}

.writer-writings-filter-bar > input.admin-input[type="text"] {
    flex: 1 1 11rem;
    min-width: 10rem;
}

.writer-writings-filter-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
    align-items: center;
}

.writer-writings-filter-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    min-width: 2.35rem;
    padding: 0;
    flex: 0 0 auto;
    font-size: 0;
}

.writer-writings-filter-icon-btn i,
.writer-writings-filter-icon-btn svg {
    width: 1rem;
    height: 1rem;
}

.writer-writings-table-actions {
    display: inline-flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
}

.writer-writings-action-form {
    display: inline;
    margin: 0;
}

.writer-writings-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    min-width: 2.15rem;
    padding: 0;
    font-size: 0;
}

.writer-writings-action-btn i,
.writer-writings-action-btn svg {
    width: 1rem;
    height: 1rem;
}

.writer-writings-action-btn.btn-outline:hover svg,
.writer-writings-action-btn.btn-outline:hover svg *,
.writer-writings-filter-icon-btn.btn-outline:hover svg,
.writer-writings-filter-icon-btn.btn-outline:hover svg * {
    stroke: #ffffff;
    color: #ffffff;
}

.writer-writings-filter-icon-btn.btn-primary svg,
.writer-writings-filter-icon-btn.btn-primary:hover svg,
.writer-writings-filter-icon-btn.btn-primary svg *,
.writer-writings-filter-icon-btn.btn-primary:hover svg * {
    stroke: #ffffff;
    color: #ffffff;
}

.writer-writings-action-btn--danger.btn-outline:hover {
    border-color: #dc2626;
    background-color: #dc2626;
    color: #ffffff;
}

.writer-writings-action-btn--danger.btn-outline:hover svg,
.writer-writings-action-btn--danger.btn-outline:hover svg * {
    stroke: #ffffff;
    color: #ffffff;
}

.admin-filter-group {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.admin-filter-sep {
    color: #9ca3af;
    font-size: 0.82rem;
}

.admin-filter-actions {
    display: flex;
    gap: 0.4rem;
    margin-inline-start: auto;
}

.admin-input {
    height: 38px;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Light field surface: keep dark text in dark mode (body color is light). */
[data-theme="dark"] .admin-input {
    color: #111827;
}

[data-theme="dark"] .admin-input::placeholder {
    color: #6b7280;
    opacity: 1;
}

.admin-input-sm {
    height: 32px;
    padding: 0.25rem 0.45rem;
    font-size: 0.82rem;
}

.admin-toolbar-card {
    margin-bottom: 0.75rem;
}

.admin-bulk-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.admin-bulk-bar small {
    color: #9ca3af;
    font-size: 0.82rem;
}

/* ---- Table ---- */
.admin-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #f3f4f6;
}

.admin-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    text-align: right;
    padding: 0.7rem 0.65rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    font-size: 0.88rem;
}

.admin-table th {
    color: #6b7280;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f9fafb;
    position: sticky;
    top: 0;
}

.admin-th-check {
    width: 40px;
}

.admin-table tbody tr {
    transition: background 0.1s ease;
}

.admin-table tbody tr:hover {
    background: #f9fafb;
}

.admin-actions-cell {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-pagination-wrap {
    margin-top: 1rem;
}

/* ---- Forms ---- */
.admin-form-card {
    max-width: 900px;
}

.admin-form-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.admin-form-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    align-items: center;
}

.admin-field {
    display: grid;
    gap: 0.4rem;
}

.admin-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
}

.admin-textarea {
    min-height: 160px;
    resize: vertical;
}

.admin-error {
    display: block;
    color: #dc2626;
    font-size: 0.82rem;
    margin-top: 0.15rem;
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .admin-metrics-grid {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .admin-charts-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-chart-wide {
        grid-column: span 2;
    }
}

@media (max-width: 1024px) {
    .admin-sidebar {
        position: static;
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1rem;
    }

    .admin-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .admin-nav-section {
        display: none;
    }

    .admin-nav-link svg {
        display: none;
    }

    .admin-sidebar-footer {
        flex-direction: row;
        border-top: none;
        padding-top: 0;
    }

    .admin-main {
        margin-right: 0;
        padding: 1.25rem;
    }

    .admin-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .admin-topbar h2 {
        font-size: 1.35rem;
    }

    .admin-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-filter-group {
        flex-wrap: wrap;
    }

    .admin-filter-actions {
        margin-inline-start: 0;
    }

    .admin-charts-row {
        grid-template-columns: 1fr;
    }

    .admin-chart-wide {
        grid-column: span 1;
    }

    .admin-bar-chart {
        height: 140px;
    }
}

/* Writer Add Story */
.writer-add-story-page {
    padding-top: calc(var(--nav-height) - 50px);
    min-height: 100vh;
}

.writer-add-story-page section {
    opacity: 1;
    transform: none;
    transition: none;
}

.writer-add-story-hero {
    padding: 4rem 0 2rem !important;
    background: radial-gradient(circle at 20% 10%, rgba(196, 62, 28, 0.12), transparent 42%);
}

.writer-add-story-hero h2 {
    font-size: 2.6rem;
}

.writer-add-story-hero p {
    color: var(--text-secondary);
}

.writer-add-story-body {
    padding: 1.2rem 0 5rem !important;
}

.writer-add-story-grid {
    display: block;
    width: 100%;
}

.add-story-form {
    display: grid;
    gap: 0.9rem;
}

.story-type-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
}

.story-type-card {
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 14px;
    padding: 0.85rem 0.9rem;
    text-align: start;
    cursor: pointer;
    display: grid;
    gap: 0.35rem;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.story-type-card b {
    font-size: 1rem;
}

.story-type-card i,
.story-type-card svg {
    width: 19px;
    height: 19px;
    color: var(--accent-primary);
    margin-bottom: 0.1rem;
}

.story-type-card span {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.5;
}

.story-type-card:hover,
.story-type-card.is-selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(196, 62, 28, 0.12);
}

.story-stepper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
}

.add-writing-autosave-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.2rem;
}

#add-writing-autosave-status {
    color: var(--text-secondary);
    font-size: 0.83rem;
}

.add-writing-autosave-clear {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.step-chip {
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(148, 163, 184, 0.05) 100%);
    color: var(--text-secondary);
    border-radius: 14px;
    padding: 0.62rem 0.78rem;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.step-chip--plain {
    padding-inline: 1rem;
}

.step-chip span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    transition: all 0.2s ease;
}

.step-chip--plain span {
    display: none;
}

.step-chip:hover {
    border-color: color-mix(in srgb, var(--accent-primary) 45%, var(--border-color));
    color: var(--text-primary);
}

.step-chip.active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(196, 62, 28, 0.12);
    box-shadow: 0 0 0 3px rgba(196, 62, 28, 0.14);
}

.step-chip.active span {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: #fff;
}

.step-chip.is-complete {
    border-color: #16a34a;
    color: #166534;
    background: rgba(22, 163, 74, 0.08);
}

.step-chip.is-complete span {
    border-color: #16a34a;
    background: #16a34a;
    color: #fff;
}

.form-step {
    display: none;
    gap: 0.9rem;
    padding: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-primary);
}

.form-step.active {
    display: grid;
}

.add-story-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.add-story-field {
    display: grid;
    gap: 0.45rem;
}

.add-story-field label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.add-story-field input,
.add-story-field select,
.add-story-field textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.add-story-field textarea {
    resize: vertical;
}

.story-tags-input {
    width: 100%;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 0.45rem 0.5rem;
    min-height: 52px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    cursor: text;
}

.story-tags-input:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(196, 62, 28, 0.1);
}

.story-tags-input__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.story-tags-chip {
    border: 1px solid rgba(196, 62, 28, 0.3);
    background: rgba(196, 62, 28, 0.08);
    color: var(--accent-primary);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.22rem 0.55rem;
    font-size: 0.82rem;
    font-family: var(--font-body);
    cursor: pointer;
}

.story-tags-chip i,
.story-tags-chip svg {
    width: 0.8rem;
    height: 0.8rem;
}

.story-tags-chip--c1 {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.32);
    color: #1d4ed8;
}

.story-tags-chip--c2 {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.32);
    color: #047857;
}

.story-tags-chip--c3 {
    background: rgba(168, 85, 247, 0.14);
    border-color: rgba(168, 85, 247, 0.32);
    color: #7e22ce;
}

.story-tags-chip--c4 {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.34);
    color: #b45309;
}

.story-tags-chip--c5 {
    background: rgba(236, 72, 153, 0.14);
    border-color: rgba(236, 72, 153, 0.32);
    color: #be185d;
}

.story-tags-chip--c6 {
    background: rgba(20, 184, 166, 0.14);
    border-color: rgba(20, 184, 166, 0.32);
    color: #0f766e;
}

.story-cover-preview-wrap {
    margin-top: 0.6rem;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    min-height: 120px;
    padding: 0.45rem;
    display: grid;
    place-items: center;
}

.story-cover-preview-wrap img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    display: none;
}

.story-cover-preview-wrap.has-image img {
    display: block;
}

.story-cover-preview-wrap small {
    color: var(--text-secondary);
}

#story-tags-editor {
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    flex: 1 0 180px;
    min-width: 120px;
    padding: 0.15rem 0.25rem;
}

.add-story-field input:focus,
.add-story-field select:focus,
.add-story-field textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(196, 62, 28, 0.1);
}

.settings-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.2rem;
    align-items: start;
}

.settings-avatar-card {
    display: grid;
    gap: 0.75rem;
    justify-items: center;
    text-align: center;
    padding: 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-primary);
}

.settings-avatar-card h3 {
    margin: 0;
}

.settings-avatar-card p {
    margin: 0;
    color: var(--text-secondary);
}

.settings-avatar-preview {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(196, 62, 28, 0.12);
}

.settings-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.settings-alert {
    margin-bottom: 1rem;
}

.settings-alert-success {
    color: #065f46;
}

.settings-help {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.settings-error {
    color: #b91c1c;
    font-size: 0.85rem;
}

.settings-checkbox-field {
    align-content: start;
}

.settings-checkbox {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 52px;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.settings-checkbox input {
    width: 18px;
    height: 18px;
}

@media (max-width: 900px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }
}

.story-actions-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.8rem;
}

.story-action-form {
    margin: 0;
    display: inline-flex;
}

.story-actions-row--stats {
    gap: 0.45rem;
    margin-top: 0.95rem;
}

.story-action-status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
}

.story-action-status-chip.is-ongoing {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.35);
}

.story-action-status-chip.is-completed,
.story-action-status-chip.is-reader-completed {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.35);
}

.story-action-status-chip.is-schedule {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.35);
}

.story-action-stat {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.4rem;
    padding: 0.34rem 0.7rem 0.34rem 0.48rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.story-action-stat__icon {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.16);
}

.story-action-stat__icon svg {
    width: 12px;
    height: 12px;
    stroke-width: 2.2;
}

.story-action-stat__value {
    margin-inline: .1rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.story-action-stat__label {
    margin-left: .1rem;
    color: var(--text-secondary);
}

.story-action-stat--likes .story-action-stat__icon {
    background: rgba(239, 68, 68, 0.14);
    color: #dc2626;
}

.story-action-stat--shares .story-action-stat__icon {
    background: rgba(59, 130, 246, 0.14);
    color: #2563eb;
}

.story-action-stat--saves .story-action-stat__icon {
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
}

.story-action-stat--comments .story-action-stat__icon {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}

@media (max-width: 768px) {
    .story-action-stat__label {
        display: none;
    }
}

.story-action-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 999px;
    width: 34px;
    height: 34px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Icon + count stacked inside one circle */
.story-action-btn--with-count {
    flex-direction: column;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0.24rem 0.15rem 0.18rem;
    gap: 0;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.story-action-btn__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
    position: absolute;
    inset: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 1;
    transform: translateY(0);
}

.story-action-btn--with-count .story-action-btn__icon svg,
.story-action-btn--with-count .story-action-btn__icon i svg {
    width: 14px;
    height: 14px;
}

.story-action-btn--with-count .story-action-count {
    font-size: 0.9rem;
    font-weight: 700;
    color: inherit;
    opacity: 0.92;
    line-height: 1;
    margin-top: 0;
    font-variant-numeric: tabular-nums;
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.story-action-btn.is-active .story-action-count {
    color: var(--accent-primary);
}

.story-action-btn--with-count:hover .story-action-btn__icon,
.story-action-btn--with-count:focus-visible .story-action-btn__icon {
    opacity: 0;
    transform: translateY(-4px);
}

.story-action-btn--with-count:hover .story-action-count,
.story-action-btn--with-count:focus-visible .story-action-count {
    opacity: 1;
    transform: translateY(0);
}

.story-action-btn--icon-only {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
}

.story-action-btn--icon-only svg {
    width: 17px;
    height: 17px;
    stroke-width: 2.1;
}

.story-reactions-toolbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.8rem 1.2rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    margin-top: 2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-body:hover .story-reactions-toolbar,
.story-reactions-toolbar.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.story-reactions-toolbar__label,
.story-reactions-toolbar__total {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.story-reactions-toolbar__items {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.story-reaction-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 0.9rem 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset;
    position: relative;
}

.story-reaction-btn__icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    line-height: 1;
    transform-origin: center;
}

.story-reaction-btn:hover,
.story-reaction-btn:focus-visible {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.story-reaction-btn:hover .story-reaction-btn__icon,
.story-reaction-btn:focus-visible .story-reaction-btn__icon {
    animation: storyReactionWiggle 450ms ease;
}

.story-reaction-btn.is-active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(196, 62, 28, 0.12);
    box-shadow: 0 0 0 3px rgba(196, 62, 28, 0.14);
}

.story-reaction-btn.is-active .story-reaction-btn__icon {
    animation: storyReactionPulse 900ms ease;
}

.story-reaction-btn.is-burst .story-reaction-btn__icon {
    animation: storyReactionBurst 320ms ease;
}

.story-reaction-btn__sparkle-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
}

.story-reaction-sparkle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent-primary);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
    animation: storyReactionSparkle 520ms ease-out forwards;
    animation-delay: var(--spark-delay, 0ms);
}

.story-reaction-sparkle--2 {
    background: #f59e0b;
}

.story-reaction-sparkle--3 {
    background: #ec4899;
}

.story-reaction-sparkle--4 {
    background: #22c55e;
}

.story-reaction-sparkle--5 {
    background: #3b82f6;
}

.story-reaction-btn.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

@keyframes storyReactionWiggle {
    0% { transform: rotate(0deg) scale(1); }
    35% { transform: rotate(-10deg) scale(1.12); }
    70% { transform: rotate(10deg) scale(1.08); }
    100% { transform: rotate(0deg) scale(1); }
}

@keyframes storyReactionPulse {
    0% { transform: scale(1); }
    45% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

@keyframes storyReactionBurst {
    0% { transform: scale(1); }
    50% { transform: scale(1.38); }
    100% { transform: scale(1); }
}

@keyframes storyReactionSparkle {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    25% {
        opacity: 0.95;
    }
    100% {
        opacity: 0;
        transform:
            translate(
                calc(-50% + var(--spark-x, 0px)),
                calc(-50% + var(--spark-y, 0px))
            )
            scale(0.2);
    }
}

.story-report-feedback {
    margin: 0.5rem 0 0.65rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.story-report-feedback.is-success {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.story-report-feedback.is-error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.story-report-form {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.story-report-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.story-report-select,
.story-report-form textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-primary);
}

.story-report-form textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.story-action-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.story-action-btn.is-active {
    border-color: var(--accent-primary);
    background: rgba(196, 62, 28, 0.12);
    color: var(--accent-primary);
}

.story-action-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
}

.story-action-btn--with-count .story-action-btn__icon svg {
    stroke-width: 2.1;
}

a.story-action-btn {
    text-decoration: none;
}

.story-editor {
    border: none;
    background: transparent;
    border-radius: 0;
    overflow: visible;
}

.story-editor:focus-within {
    border-color: transparent;
    box-shadow: none;
}

.story-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.55rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.editor-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.editor-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.editor-btn-focus {
    margin-inline-start: auto;
}

.editor-btn i,
.editor-btn svg {
    width: 16px;
    height: 16px;
}

.story-editor-area {
    min-height: 260px;
    padding: 0.9rem;
    color: var(--text-primary);
    line-height: 1.9;
    outline: none;
}

.story-editor-area:empty::before {
    content: attr(data-placeholder);
    color: var(--text-secondary);
}

.story-editor--preview {
    border-color: rgba(148, 163, 184, 0.42);
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.06), rgba(148, 163, 184, 0.02));
}

.story-editor-area--preview {
    min-height: 220px;
    background: transparent;
    color: var(--text-primary);
    cursor: default;
    user-select: text;
}

.story-editor-area--preview:focus {
    box-shadow: none;
}

.story-preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.55rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 600;
}

body.editor-focus-mode #main-header,
body.editor-focus-mode #main-footer,
body.editor-focus-mode .writer-dashboard-hero,
body.editor-focus-mode .writer-add-story-hero,
body.editor-focus-mode .story-stepper,
body.editor-focus-mode .form-step[data-step="1"],
body.editor-focus-mode .form-step[data-step="3"],
body.editor-focus-mode .form-step[data-step="2"] #chapters-section,
body.editor-focus-mode .form-step[data-step="2"] .step-actions {
    display: none !important;
}

body.editor-focus-mode .writer-add-story-body {
    padding: 0.8rem 0 1rem !important;
}

body.editor-focus-mode .writer-shell .writer-admin-sidebar {
    display: none;
}

body.editor-focus-mode .writer-shell .writer-admin-main {
    margin-right: 0 !important;
    padding: 0 !important;
}

body.editor-focus-mode .writer-add-story-page .container {
    max-width: 100%;
    width: 100%;
    padding-inline: 0.75rem;
}

body.editor-focus-mode .add-story-form {
    gap: 0.7rem;
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0.65rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: var(--bg-secondary);
}

body.editor-focus-mode .form-step {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    padding: 0.55rem;
    background: var(--bg-primary);
}

body.editor-focus-mode .form-step[data-step="2"] {
    display: grid;
    gap: 0.45rem;
}

body.editor-focus-mode .form-step[data-step="2"] .story-editor {
    position: relative;
    min-height: calc(100vh - 185px);
    border: 1px solid rgba(196, 62, 28, 0.35);
    border-radius: 12px;
    overflow: hidden;
}

body.editor-focus-mode .form-step[data-step="2"] .story-editor-area {
    min-height: calc(100vh - 260px);
    font-size: 1.04rem;
    line-height: 2;
    padding: 0.95rem 1rem;
}

body.editor-focus-mode .form-step[data-step="2"] > .add-story-field > label {
    margin-inline-start: 0.2rem;
}

/* Exit focus: fixed to physical top-left of the editor frame (RTL page still uses top-left as requested) */
body.editor-focus-mode .form-step[data-step="2"] .story-editor-toolbar {
    padding-left: 3rem;
}

body.editor-focus-mode .form-step[data-step="2"] .story-editor .editor-btn-focus,
body.editor-focus-mode > .editor-btn-focus {
    position: fixed !important;
    top: 40px !important;
    left: 40px !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    z-index: 9999999 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    background: var(--bg-primary) !important;
    border: 2px solid var(--accent-primary) !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: all !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.editor-focus-mode .add-story-actions {
    position: fixed !important;
    left: 40px !important;
    bottom: 40px !important;
    right: auto !important;
    top: auto !important;
    z-index: 9999999 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    pointer-events: all !important;
    visibility: visible !important;
    opacity: 1 !important;
}
body.editor-focus-mode .add-story-actions .step-prev {
    display: none !important;
}

body.editor-focus-mode .add-writing-autosave-row {
    margin-top: 0;
}

body.chapter-editor-focus-mode #main-header,
body.chapter-editor-focus-mode #main-footer,
body.chapter-editor-focus-mode .writer-dashboard-hero,
body.chapter-editor-focus-mode .writer-add-story-hero,
body.chapter-editor-focus-mode .story-stepper,
body.chapter-editor-focus-mode .form-step[data-step="1"],
body.chapter-editor-focus-mode .form-step[data-step="3"],
body.chapter-editor-focus-mode .form-step[data-step="2"] #single-content-section,
body.chapter-editor-focus-mode .form-step[data-step="2"] .step-actions,
body.chapter-editor-focus-mode .form-step[data-step="2"] .chapters-head,
body.chapter-editor-focus-mode .form-step[data-step="2"] #chapter-edit-manager,
body.chapter-editor-focus-mode .form-step[data-step="2"] #chapter-editor-actions {
    display: none !important;
}

body.chapter-editor-focus-mode .writer-add-story-body {
    padding: 0.8rem 0 1rem !important;
}

body.chapter-editor-focus-mode .writer-shell .writer-admin-sidebar {
    display: none;
}

body.chapter-editor-focus-mode .writer-shell .writer-admin-main {
    margin-right: 0 !important;
    padding: 0 !important;
}

body.chapter-editor-focus-mode .writer-add-story-page .container {
    max-width: 100%;
    width: 100%;
    padding-inline: 0.75rem;
}

body.chapter-editor-focus-mode .add-story-form {
    gap: 0.7rem;
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0.65rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: var(--bg-secondary);
}

body.chapter-editor-focus-mode .form-step {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    padding: 0.55rem;
    background: var(--bg-primary);
}

body.chapter-editor-focus-mode .form-step[data-step="2"] .chapter-block {
    display: none !important;
}

body.chapter-editor-focus-mode .form-step[data-step="2"] .chapter-block.is-focus-target {
    display: block !important;
    margin: 0 !important;
}

body.chapter-editor-focus-mode .form-step[data-step="2"] .chapter-block.is-focus-target .story-editor {
    min-height: calc(100vh - 185px);
    border: 1px solid rgba(196, 62, 28, 0.35);
    border-radius: 12px;
    overflow: hidden;
}

body.chapter-editor-focus-mode .form-step[data-step="2"] .chapter-block.is-focus-target .chapter-editor {
    min-height: calc(100vh - 260px);
    font-size: 1.04rem;
    line-height: 2;
    padding: 0.95rem 1rem;
}

body.chapter-editor-focus-mode .form-step[data-step="2"] .chapter-block.is-focus-target .story-editor-toolbar {
    padding-left: 3rem;
}

body.chapter-editor-focus-mode .form-step[data-step="2"] .chapter-block.is-focus-target .editor-btn-focus {
    position: fixed;
    top: 20px;
    left: 20px;
    margin: 0;
    z-index: 9999;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.12);
    background: var(--bg-primary);
}

body.chapter-editor-focus-mode #chapter-editor-actions {
    display: flex !important;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    margin: 0;
    padding: 0;
}

.story-editor-hidden {
    display: none;
}

.chapters-section-hidden {
    display: none;
}

.chapters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    gap: 0.8rem;
}

.chapters-list {
    display: grid;
    gap: 0.8rem;
}

.chapter-block {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    padding: 0.8rem;
}

.chapter-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.remove-chapter-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 0.35rem 0.7rem;
    font-family: var(--font-body);
    cursor: pointer;
}

.remove-chapter-btn:hover {
    border-color: #dc2626;
    color: #dc2626;
}

.chapter-editor-wrap {
    margin-top: 0.4rem;
}

.chapter-editor {
    min-height: 180px;
    padding: 0.8rem;
    color: var(--text-primary);
    line-height: 1.85;
    outline: none;
}

.chapter-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-secondary);
}

.add-story-options {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.2rem;
}

.add-story-actions {
    display: flex;
    gap: 0.7rem;
    justify-content: flex-end;
    margin-top: 0.2rem;
}

.step-actions {
    display: flex;
    gap: 0.7rem;
    justify-content: flex-end;
    margin-top: 0.2rem;
}

.publish-review {
    margin-top: 0.2rem;
}

.add-story-side {
    display: grid;
    gap: 1rem;
}

@media (max-width: 1100px) {
    .writer-add-story-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .writer-add-story-hero h2 {
        font-size: 2rem;
    }

    .add-story-row {
        grid-template-columns: 1fr;
    }

    .story-stepper {
        grid-template-columns: 1fr;
    }

    .add-story-actions {
        flex-direction: column;
    }

    .add-story-actions .btn {
        width: 100%;
        text-align: center;
    }

    .step-actions {
        flex-direction: column;
    }

    .step-actions .btn {
        width: 100%;
        text-align: center;
    }
}

.collection-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #4b5563;
    cursor: grab;
    background: #fff;
}

.js-collection-story-row {
    transition: background-color .18s ease, border-color .18s ease, opacity .18s ease;
}

.js-collection-story-row.is-dragging {
    opacity: .55;
}

.js-collection-story-row.is-drag-over {
    background: #f8fafc;
    border-color: #93c5fd;
}

.collection-reader-sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
}

.collection-reader-start-wrap {
    margin-top: .85rem;
}

.collection-reader-nav {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}

.collection-reader-nav--top {
    margin-top: .9rem;
}

.collection-reader-nav--bottom {
    margin-top: 1rem;
    padding-top: .8rem;
    align-items: center;
    justify-content: flex-start;
}

.collection-reader-nav--bottom.has-prev.has-next {
    justify-content: space-between;
}

.collection-reader-nav--bottom.has-next:not(.has-prev) {
    justify-content: flex-end;
}

.collection-reader-nav--bottom.has-prev:not(.has-next) {
    justify-content: flex-start;
}

.collection-reader-nav--bottom .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 36px;
    padding: .4rem .7rem;
    font-size: .9rem;
}

@media (max-width: 768px) {
    .collection-reader-nav--bottom {
        justify-content: flex-start;
    }

    .collection-reader-nav--bottom .btn {
        width: 100%;
    }
}


.story-reading-size-letter {
    display: inline-block;
    font-weight: 700;
    line-height: 1;
}

.story-reading-size-letter--sm {
    font-size: 0.8rem;
}

.story-reading-size-letter--md {
    font-size: 1rem;
}

.story-reading-size-letter--lg {
    font-size: 1.2rem;
}

/* Editor UI/UX Enhancements */
.seamless-title-field {
    margin-bottom: 0 !important;
    position: relative;
    z-index: 2;
}
.seamless-title-input {
    width: 100%;
    font-size: 2.2rem;
    font-weight: bold;
    font-family: var(--font-heading);
    border: none;
    background: transparent;
    padding: 1rem 1.5rem 0.5rem;
    outline: none;
    color: var(--text-primary);
}
.seamless-title-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.floating-toolbar {
    position: absolute;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.3rem;
    display: flex;
    gap: 0.3rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 100;
}
.floating-toolbar.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.floating-toolbar .editor-btn {
    padding: 0.4rem;
    border-radius: 4px;
    border: none;
    background: transparent;
}
.floating-toolbar .editor-btn:hover {
    background: var(--accent-primary);
    color: white;
}

.ambient-word-count {
    position: absolute;
    bottom: 10px;
    left: 15px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.ambient-word-count.visible {
    opacity: 0.6;
}

.typewriter-active {
    padding-bottom: 50vh !important;
}
.js-typewriter-toggle[data-active="1"] {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(196, 62, 28, 0.1);
}

body.editor-focus-mode {
    overflow: auto !important;
}

body.editor-focus-mode .writer-shell,
body.editor-focus-mode .writer-admin-main,
body.editor-focus-mode .writer-add-story-page,
body.editor-focus-mode .writer-add-story-body,
body.editor-focus-mode .container,
body.editor-focus-mode .writer-add-story-grid,
body.editor-focus-mode .add-story-form,
body.editor-focus-mode .form-step,
body.editor-focus-mode .story-editor,
body.editor-focus-mode .story-editor-toolbar {
    transform: none !important;
    perspective: none !important;
    filter: none !important;
    will-change: auto !important;
    position: static !important;
    overflow: visible !important;
}

body.editor-focus-mode .seamless-title-input {
    text-align: right;
    font-size: 3rem;
    margin-top: 2rem;
    padding-bottom: 0;
}
body.editor-focus-mode .story-editor-toolbar .editor-btn:not(.editor-btn-focus) {
    display: none !important;
}
body.editor-focus-mode .story-editor-toolbar {
    border-bottom: none !important;
    background: transparent !important;
}
body.editor-focus-mode .form-step[data-step="2"] .story-editor {
    max-width: 100%;
    width: 100%;
    margin: 0;
    position: relative;
    border: none;
}
body.editor-focus-mode .form-step[data-step="2"] .story-editor-area {
    font-size: 1.25rem;
    line-height: 2.2;
}

body.editor-focus-mode .form-step[data-step="2"] label,
body.chapter-editor-focus-mode .form-step[data-step="2"] label {
    display: none !important;
}

/* Editor Enhancements */
.story-editor-area:empty::before,
.story-editor-area:has(> br:first-child:last-child)::before {
    content: attr(data-placeholder);
    color: var(--text-secondary);
    opacity: 0.7;
    pointer-events: none;
    display: block;
}

#story-title {
    border: none;
    background: transparent;
    font-size: 2.2rem;
    font-weight: bold;
    padding: 0.5rem 0;
    box-shadow: none !important;
}
#story-title:focus {
    border: none;
    box-shadow: none;
    outline: none;
}

/* --- Reader Experience Enhancements --- */

:root {
    --reader-bg: transparent;
    --reader-text: inherit;
    --reader-border: var(--border-color);
}

.reader-theme-sepia {
    --reader-bg: #f4ecd8;
    --reader-text: #43302b;
    --reader-border: rgba(67, 48, 43, 0.15);
}

.story-details-page.reader-theme-sepia .story-chapter-content,
.story-details-page.reader-theme-sepia .story-reactions-toolbar,
.story-details-page.reader-theme-sepia .collection-reader-panel,
.story-details-page.reader-theme-sepia .collection-reader-nav--bottom .btn {
    background-color: #f4ecd8;
    color: #43302b;
    border-color: rgba(67, 48, 43, 0.2);
}

.story-details-page.reader-theme-sepia .reader-btn {
    background-color: #efe4cd;
    color: #43302b;
    border-color: rgba(67, 48, 43, 0.25);
}

.story-details-page.reader-theme-sepia .reader-btn:hover {
    border-color: #7c5b4b;
    color: #7c2d12;
}

.story-details-page.reader-theme-sepia .reader-btn.is-active {
    background-color: #7c5b4b;
    border-color: #7c5b4b;
    color: #fff;
}

.reader-theme-dark {
    --reader-bg: #1a1a1a;
    --reader-text: #e2e8f0;
    --reader-border: rgba(255, 255, 255, 0.1);
}

.story-details-page[class*="reader-theme-"] {
    background-color: var(--reader-bg);
    color: var(--reader-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.story-details-page[class*="reader-theme-"] .article-body,
.story-details-page[class*="reader-theme-"] .sidebar-card,
.story-details-page[class*="reader-theme-"] .story-reading-tools {
    background-color: var(--reader-bg);
    color: var(--reader-text);
    border-color: var(--reader-border);
}

.story-details-page[class*="reader-theme-"] h1,
.story-details-page[class*="reader-theme-"] h2,
.story-details-page[class*="reader-theme-"] h3,
.story-details-page[class*="reader-theme-"] b,
.story-details-page[class*="reader-theme-"] strong {
    color: var(--reader-text);
}

/* Serif Font Option */
.reader-font-serif .story-chapter-content {
    font-family: "Amiri", serif;
    font-size: 1.15em; /* Serif usually needs more size */
}

/* Reader Focus Mode */
body.reader-focus-active #main-header,
body.reader-focus-active #main-footer,
body.reader-focus-active .story-hero,
body.reader-focus-active .story-sidebar,
body.reader-focus-active .related-stories,
body.reader-focus-active .story-comments-under-writing,
body.reader-focus-active .breadcrumbs {
    display: none !important;
}

body.reader-focus-active .story-layout {
    display: block;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5vh 1rem 3vh;
}

body.reader-focus-active .story-content {
    background-color: var(--reader-bg);
}

body.reader-focus-active .story-details-page {
    min-height: 100vh;
}

body.reader-focus-active .story-details-page section {
    margin: 0 !important;
    padding: 0 !important;
}

body.reader-focus-active .collection-reader-nav--bottom {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    pointer-events: none;
}

body.reader-focus-active .collection-reader-nav--bottom .collection-nav-btn {
    position: fixed !important;
    top: 50vh !important;
    transform: translate3d(0, -50%, 0) !important;
    z-index: 10005;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    padding: 0 !important;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    pointer-events: all;
    will-change: transform;
}

body.reader-focus-active .collection-reader-nav--bottom .collection-nav-btn span {
    display: none !important;
}

body.reader-focus-active .collection-reader-nav--bottom .collection-nav-btn--prev {
    right: 14px;
}

body.reader-focus-active .collection-reader-nav--bottom .collection-nav-btn--next {
    left: 14px;
}

/* Reading Progress Bar */
#reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 10001;
}

#reading-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-primary);
    transition: width 0.1s linear;
}

/* Enhanced Reading Tools */
.story-reading-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    background: var(--bg-primary);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.article-body:hover .story-reading-tools,
.story-reading-tools.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

.reader-controls-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.reader-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.reader-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.reader-btn.is-active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.reader-btn--sepia { background-color: #f4ecd8; color: #43302b; }
.reader-btn--dark { background-color: #1a1a1a; color: #e2e8f0; }

