/* =========================================================
   ASYA'S LITTLE LIBRARY
   CLEAN Y2K PINK STYLE
   ========================================================= */

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

html {
    margin: 0;
    padding: 0;
    background: #fff8fc;
}

body {
    margin: 0;
    padding: 0;

    background: #fff8fc;
    color: #241b21;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    line-height: 1.5;
}

/* =========================================================
   GLOBAL IMAGE SAFETY
   ========================================================= */

img {
    display: block;
    max-width: 100%;
}

.top-line {
    width: 100%;
    height: 4px;
    background: #ed4f98;
}

/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    width: 100%;

    background: #ffffff;

    border-bottom: 1px solid #f1b4d2;
}

.header-inner {
    width: min(1080px, calc(100% - 32px));

    min-height: 76px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;
}

/* =========================================================
   BRAND
   ========================================================= */

.site-brand {
    display: inline-flex;
    align-items: center;

    gap: 10px;

    flex-shrink: 0;

    color: #241b21;

    text-decoration: none;
}

.brand-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    overflow: hidden;
}

.brand-icon img {
    width: 34px !important;
    height: 34px !important;

    max-width: 34px !important;
    max-height: 34px !important;

    object-fit: contain !important;
}

.brand-text {
    display: flex;
    flex-direction: column;

    line-height: 1;
}

.brand-name {
    margin-bottom: 4px;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 2px;
}

.brand-text strong {
    color: #ed4f98;

    font-size: 17px;
    font-weight: 900;

    letter-spacing: 1px;
}

/* =========================================================
   NAVIGATION
   ========================================================= */

.site-nav {
    display: flex;
    align-items: center;

    gap: 4px;

    flex-shrink: 0;
}

.site-nav a {
    min-height: 42px;

    padding: 6px 10px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    color: #30262c;

    text-decoration: none;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 1px;

    border: 1px solid transparent;

    white-space: nowrap;

    transition:
        background .15s ease,
        color .15s ease,
        border-color .15s ease;
}

.nav-icon {
    width: 19px;
    height: 19px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    flex-shrink: 0;
}

.nav-icon img {
    width: 18px !important;
    height: 18px !important;

    max-width: 18px !important;
    max-height: 18px !important;

    object-fit: contain !important;
}

.site-nav a:hover,
.site-nav a.active {
    color: #d92f7c;

    background: #fff0f7;

    border-color: #f3bfd8;
}

.site-nav .writer-link {
    color: #d92f7c;
}

/* =========================================================
   MAIN
   ========================================================= */

.page-container {
    width: min(1080px, calc(100% - 32px));

    margin: 0 auto;

    padding: 32px 0 55px;
}

/* =========================================================
   HOME
   ========================================================= */

.home-welcome {
    position: relative;

    width: 100%;

    padding: 55px 25px 60px;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;

    overflow: hidden;

    background: #fff8fc;
}

/* Dekorasi kecil kiri/kanan */

.welcome-decoration {
    position: absolute;

    top: 20px;
    left: 30px;
    right: 30px;

    display: flex;
    justify-content: space-between;

    pointer-events: none;
}

.welcome-decoration img {
    width: 25px !important;
    height: 25px !important;

    max-width: 25px !important;
    max-height: 25px !important;

    object-fit: contain !important;
}

/* Buku */

.welcome-book {
    width: 76px !important;
    height: 76px !important;

    max-width: 76px !important;
    max-height: 76px !important;

    object-fit: contain !important;

    margin-bottom: 15px;
}

/* Text */

.welcome-small {
    margin: 0 0 5px;

    color: #d93d82;

    font-size: 10px;
    font-weight: 900;

    letter-spacing: 3px;
}

.home-welcome h1 {
    margin: 0;

    font-size: clamp(30px, 5vw, 48px);

    line-height: 1.05;

    letter-spacing: 1px;

    font-weight: 900;
}

.home-welcome h1 span {
    display: block;

    color: #ed4f98;
}

.welcome-description {
    width: min(500px, 100%);

    margin: 17px 0 24px;

    color: #765f6b;

    font-size: 13px;

    line-height: 1.7;
}

/* =========================================================
   BUTTON
   ========================================================= */

.pink-button {
    min-height: 44px;

    padding: 9px 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    background: #f36aaa;
    color: #ffffff;

    border: 2px solid #241b21;

    box-shadow: 4px 4px 0 #241b21;

    text-decoration: none;

    font-size: 10px;
    font-weight: 900;

    letter-spacing: 1px;
}

.pink-button img {
    width: 19px !important;
    height: 19px !important;

    max-width: 19px !important;
    max-height: 19px !important;

    object-fit: contain !important;
}

/* =========================================================
   SECTION TITLE
   ========================================================= */

.latest-section {
    margin-top: 10px;
}

.section-heading {
    min-height: 55px;

    padding: 0 4px 13px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    border-bottom: 2px solid #efb0ce;
}

.section-heading p {
    margin: 0 0 2px;

    color: #d43b81;

    font-size: 9px;
    font-weight: 900;

    letter-spacing: 2px;
}

.section-heading h2 {
    margin: 0;

    font-size: 25px;
    line-height: 1.1;
}

.section-heading > img {
    width: 34px !important;
    height: 34px !important;

    max-width: 34px !important;
    max-height: 34px !important;

    object-fit: contain !important;
}

/* =========================================================
   STORY GRID
   ========================================================= */

.latest-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;

    margin-top: 20px;
}

.story-card {
    min-width: 0;

    overflow: hidden;

    background: #ffffff;

    border: 2px solid #241b21;

    box-shadow: 5px 5px 0 #f4a7ca;
}

.story-cover {
    width: 100%;
    height: 235px;

    overflow: hidden;

    background: #ffeaf4;

    border-bottom: 2px solid #241b21;
}

.story-cover > img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.empty-cover {
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 7px;

    background: #ffeaf4;
}

.empty-cover img {
    width: 52px !important;
    height: 52px !important;

    max-width: 52px !important;
    max-height: 52px !important;

    object-fit: contain !important;
}

.empty-cover span {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
}

.story-content {
    padding: 16px;
}

.story-genre {
    display: flex;
    align-items: center;

    gap: 5px;

    margin-bottom: 7px;

    color: #d83c82;

    font-size: 9px;
    font-weight: 900;

    letter-spacing: 1px;
}

.story-genre img {
    width: 14px !important;
    height: 14px !important;

    max-width: 14px !important;
    max-height: 14px !important;

    object-fit: contain !important;
}

.story-content h3 {
    margin: 0 0 7px;

    font-size: 19px;
    line-height: 1.2;
}

.story-description {
    margin: 0 0 13px;

    color: #76636d;

    font-size: 12px;

    line-height: 1.65;
}

.story-meta {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 14px;

    color: #806c76;

    font-size: 10px;
    font-weight: 700;
}

.story-meta span {
    display: inline-flex;
    align-items: center;

    gap: 4px;
}

.story-meta img {
    width: 15px !important;
    height: 15px !important;

    max-width: 15px !important;
    max-height: 15px !important;

    object-fit: contain !important;
}

.read-button {
    width: 100%;
    min-height: 39px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    background: #fff0f7;

    border: 2px solid #241b21;

    color: #241b21;

    text-decoration: none;

    font-size: 9px;
    font-weight: 900;

    letter-spacing: 1px;
}

.read-button img {
    width: 17px !important;
    height: 17px !important;

    max-width: 17px !important;
    max-height: 17px !important;

    object-fit: contain !important;
}

/* =========================================================
   VIEW ALL
   ========================================================= */

.stories-button-wrapper {
    display: flex;
    justify-content: center;

    margin-top: 25px;
}

.all-stories-button {
    min-height: 42px;

    padding: 8px 17px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    background: #ffffff;

    border: 2px solid #241b21;

    box-shadow: 4px 4px 0 #f4a7ca;

    color: #241b21;

    text-decoration: none;

    font-size: 9px;
    font-weight: 900;

    letter-spacing: 1px;
}

.all-stories-button img {
    width: 19px !important;
    height: 19px !important;

    max-width: 19px !important;
    max-height: 19px !important;

    object-fit: contain !important;
}

/* =========================================================
   EMPTY
   ========================================================= */

.empty-library {
    padding: 45px 20px;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;

    background: #ffffff;

    border: 2px dashed #ee9fc5;
}

.empty-library > img {
    width: 55px !important;
    height: 55px !important;

    max-width: 55px !important;
    max-height: 55px !important;

    object-fit: contain !important;

    margin-bottom: 10px;
}

.empty-library p {
    margin: 0;

    color: #765f6b;
}

.empty-library a {
    margin-top: 15px;

    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 8px 14px;

    background: #f36aaa;

    border: 2px solid #241b21;

    color: #ffffff;

    text-decoration: none;

    font-size: 9px;
    font-weight: 900;
}

.empty-library a img {
    width: 17px !important;
    height: 17px !important;

    max-width: 17px !important;
    max-height: 17px !important;

    object-fit: contain !important;
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    width: 100%;

    padding: 28px 15px 32px;

    background: #fff1f8;

    border-top: 1px solid #efb1d0;

    text-align: center;
}

/* Dekorasi */

.footer-decoration {
    height: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    margin-bottom: 8px;
}

.footer-decoration img {
    width: 17px !important;
    height: 17px !important;

    max-width: 17px !important;
    max-height: 17px !important;

    object-fit: contain !important;
}

/* Footer brand */

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    color: #d83d82;

    font-size: 10px;
    font-weight: 900;

    letter-spacing: 1.5px;
}

.footer-brand img {
    width: 22px !important;
    height: 22px !important;

    max-width: 22px !important;
    max-height: 22px !important;

    object-fit: contain !important;
}

/* Made */

.footer-made {
    margin-top: 8px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    color: #5f4c56;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 1px;
}

.footer-made img {
    width: 16px !important;
    height: 16px !important;

    max-width: 16px !important;
    max-height: 16px !important;

    object-fit: contain !important;
}

/* Tagline */

.footer-tagline {
    margin-top: 5px;

    color: #b56b91;

    font-size: 8px;

    letter-spacing: 2px;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 760px) {

    .header-inner {
        width: calc(100% - 24px);

        min-height: auto;

        padding: 14px 0;

        flex-direction: column;

        gap: 11px;
    }

    .site-brand {
        justify-content: center;
    }

    .site-nav {
        width: 100%;

        justify-content: center;

        gap: 2px;
    }

    .site-nav a {
        flex: 1 1 0;

        min-width: 0;

        padding: 6px 3px;
    }

    .page-container {
        width: calc(100% - 24px);

        padding-top: 22px;
    }

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

}

@media (max-width: 520px) {

    .header-inner {
        width: calc(100% - 18px);
    }

    .brand-icon {
        width: 32px;
        height: 32px;
    }

    .brand-icon img {
        width: 29px !important;
        height: 29px !important;

        max-width: 29px !important;
        max-height: 29px !important;
    }

    .brand-name {
        font-size: 9px;
        letter-spacing: 1.5px;
    }

    .brand-text strong {
        font-size: 15px;
    }

    .site-nav a {
        min-height: 40px;

        flex-direction: column;

        gap: 2px;

        font-size: 8px;
        letter-spacing: .5px;
    }

    .nav-icon {
        width: 17px;
        height: 17px;
    }

    .nav-icon img {
        width: 16px !important;
        height: 16px !important;

        max-width: 16px !important;
        max-height: 16px !important;
    }

    .page-container {
        width: calc(100% - 18px);

        padding-top: 15px;
    }

    .home-welcome {
        padding: 48px 12px 48px;
    }

    .welcome-decoration {
        left: 15px;
        right: 15px;
    }

    .welcome-decoration img {
        width: 20px !important;
        height: 20px !important;

        max-width: 20px !important;
        max-height: 20px !important;
    }

    .welcome-book {
        width: 64px !important;
        height: 64px !important;

        max-width: 64px !important;
        max-height: 64px !important;
    }

    .home-welcome h1 {
        font-size: 29px;
    }

    .welcome-description {
        max-width: 320px;

        font-size: 12px;
    }

    .latest-grid {
        grid-template-columns: 1fr;
    }

    .story-cover {
        height: 260px;
    }

    .section-heading h2 {
        font-size: 21px;
    }

    .section-heading > img {
        width: 28px !important;
        height: 28px !important;

        max-width: 28px !important;
        max-height: 28px !important;
    }

    .footer-brand {
        font-size: 9px;
    }

}

@media (max-width: 350px) {

    .brand-text strong {
        font-size: 13px;
    }

    .site-nav a {
        font-size: 7px;
    }

    .home-welcome h1 {
        font-size: 26px;
    }

}

/* =========================================================
   ✦ RETRO / Y2K AURA BOOST ✦
   Jangan mengubah struktur layout
   ========================================================= */

/* Background retro halus */
body {
    background:
        radial-gradient(circle, rgba(241, 93, 157, .16) 1px, transparent 1px),
        #fff8fc !important;

    background-size: 14px 14px !important;
}

/* Garis retro atas */
.top-line {
    height: 7px !important;

    background:
        repeating-linear-gradient(
            90deg,
            #ec438d 0 18px,
            #f77bb5 18px 36px,
            #ffafd3 36px 54px
        ) !important;

    border-bottom: 2px solid #231820;
}

/* =========================================================
   HEADER RETRO
   ========================================================= */

.site-header {
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fffafd 70%,
            #ffeaf5 100%
        ) !important;

    border-bottom: 2px solid #241b21 !important;

    box-shadow:
        0 4px 0 #f4a2c8,
        0 7px 0 rgba(238, 74, 145, .12);
}

.header-inner {
    position: relative;
}

/* Dekorasi kecil header */
.header-inner::before {
    content: "✦";
    position: absolute;

    left: -18px;
    top: 9px;

    color: #ef6ca8;
    font-size: 13px;

    pointer-events: none;
}

.header-inner::after {
    content: "✧";
    position: absolute;

    right: -15px;
    bottom: 7px;

    color: #ef6ca8;
    font-size: 15px;

    pointer-events: none;
}

/* Logo */
.site-brand {
    position: relative;
}

.brand-text strong {
    text-shadow:
        1px 1px 0 #ffffff,
        2px 2px 0 #f5b0d0 !important;
}

/* Nav */
.site-nav a {
    position: relative;

    border: 2px solid transparent !important;

    text-shadow: 1px 1px 0 #ffffff;
}

.site-nav a:hover,
.site-nav a.active {
    background: #ffcae3 !important;

    border: 2px solid #241b21 !important;

    box-shadow:
        3px 3px 0 #ed6ca8 !important;

    transform: translate(-1px, -1px);
}

.site-nav a::before {
    content: "·";

    position: absolute;

    top: -5px;
    left: 50%;

    color: #ee5d9f;

    font-size: 15px;

    opacity: 0;
}

.site-nav a:hover::before {
    opacity: 1;
}

/* =========================================================
   HOME RETRO
   ========================================================= */

.home-welcome {
    background:
        radial-gradient(
            circle at 10% 20%,
            rgba(255, 105, 174, .15) 0 2px,
            transparent 3px
        ),
        radial-gradient(
            circle at 90% 30%,
            rgba(255, 105, 174, .15) 0 2px,
            transparent 3px
        ),
        radial-gradient(
            circle at 20% 80%,
            rgba(255, 105, 174, .13) 0 2px,
            transparent 3px
        ),
        #fff8fc !important;

    background-size:
        42px 42px,
        57px 57px,
        49px 49px !important;

    border: 2px solid #241b21;

    box-shadow:
        7px 7px 0 #f4a2c8;

    margin-bottom: 30px;
}

/* Kotak kecil ala website lama */
.home-welcome::before {
    content: "♡ ASYA'S LITTLE CORNER ♡";

    position: absolute;

    top: 12px;
    left: 50%;

    transform: translateX(-50%);

    padding: 3px 10px;

    background: #ffd7e9;

    border: 1px solid #241b21;

    color: #b72c6c;

    font-size: 7px;
    font-weight: 900;

    letter-spacing: 1.5px;

    white-space: nowrap;
}

/* Bintang kecil */
.home-welcome::after {
    content: "✦  ✧  ✦";

    position: absolute;

    bottom: 13px;
    left: 50%;

    transform: translateX(-50%);

    color: #ec5b9b;

    font-size: 13px;

    letter-spacing: 7px;
}

/* Buku */
.welcome-book {
    filter:
        drop-shadow(4px 4px 0 #f3a3c8);
}

/* Heading */
.home-welcome h1 {
    text-shadow:
        2px 2px 0 #ffffff,
        3px 3px 0 #f6b1d1;
}

.home-welcome h1 span {
    text-shadow:
        2px 2px 0 #ffffff,
        3px 3px 0 #f08ab8;
}

/* =========================================================
   RETRO BUTTON
   ========================================================= */

.pink-button {
    position: relative;

    background:
        linear-gradient(
            180deg,
            #ff8bc1 0%,
            #f35b9e 48%,
            #df3f86 49%,
            #ee5b9f 100%
        ) !important;

    border: 2px solid #241b21 !important;

    box-shadow:
        4px 4px 0 #241b21,
        inset 0 1px 0 rgba(255,255,255,.8);
}

.pink-button:hover {
    transform: translate(3px, 3px);

    box-shadow:
        1px 1px 0 #241b21,
        inset 0 1px 0 rgba(255,255,255,.8);
}

/* =========================================================
   SECTION TITLE RETRO
   ========================================================= */

.section-heading {
    position: relative;

    border-bottom: 3px double #ed7eaf !important;
}

.section-heading p {
    font-family:
        "Courier New",
        monospace !important;

    text-shadow: 1px 1px 0 #ffffff;
}

.section-heading h2 {
    text-shadow:
        2px 2px 0 #f7b5d3;
}

/* =========================================================
   STORY CARD RETRO
   ========================================================= */

.story-card {
    position: relative;

    border: 2px solid #241b21 !important;

    box-shadow:
        6px 6px 0 #f29bc3,
        9px 9px 0 rgba(237, 76, 143, .08);

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #ffffff 82%,
            #fff2f8 100%
        );
}

.story-card::before {
    content: "✦";

    position: absolute;

    z-index: 5;

    top: 7px;
    right: 8px;

    color: #ffffff;

    font-size: 15px;

    text-shadow:
        1px 1px 0 #d7357e;
}

.story-cover {
    background:
        repeating-linear-gradient(
            45deg,
            #ffddeb 0,
            #ffddeb 8px,
            #ffeaf4 8px,
            #ffeaf4 16px
        ) !important;
}

.story-genre {
    display: inline-flex !important;

    padding: 3px 7px;

    background: #ffe0ed;

    border: 1px solid #ed8ab5;
}

.story-content h3 {
    text-shadow:
        1px 1px 0 #ffffff;
}

/* Stats retro */
.story-meta {
    padding-top: 9px;
    padding-bottom: 9px;

    border-top: 1px dotted #e795b8;
    border-bottom: 1px dotted #e795b8;
}

/* Read button */
.read-button {
    background:
        linear-gradient(
            180deg,
            #ffffff,
            #ffe7f2
        ) !important;

    box-shadow:
        3px 3px 0 #f3a3c7;
}

.read-button:hover {
    background: #ffb9d7 !important;
}

/* =========================================================
   VIEW ALL RETRO
   ========================================================= */

.all-stories-button {
    background:
        linear-gradient(
            180deg,
            #ffffff,
            #ffe7f2
        ) !important;

    box-shadow:
        4px 4px 0 #ef8bb7 !important;
}

.all-stories-button:hover {
    background: #ffc5df !important;

    transform: translate(2px, 2px);
}

/* =========================================================
   FOOTER RETRO
   ========================================================= */

.site-footer {
    position: relative;

    background:
        radial-gradient(
            circle,
            rgba(239, 80, 148, .13) 1px,
            transparent 1px
        ),
        #ffeaf4 !important;

    background-size: 13px 13px !important;

    border-top: 3px double #241b21 !important;
}

.site-footer::before {
    content: "♡ ───────── ✦ ───────── ♡";

    display: block;

    margin-bottom: 12px;

    color: #e45594;

    font-size: 10px;

    letter-spacing: 2px;
}

.footer-brand {
    text-shadow:
        1px 1px 0 #ffffff;
}

.footer-made {
    color: #6c4e5c !important;
}

.footer-tagline {
    font-family:
        "Courier New",
        monospace !important;

    font-weight: 700;

    text-shadow:
        1px 1px 0 #ffffff;
}

/* =========================================================
   MOBILE RETRO
   ========================================================= */

@media (max-width: 520px) {

    .site-header {
        box-shadow:
            0 3px 0 #f4a2c8 !important;
    }

    .header-inner::before,
    .header-inner::after {
        display: none;
    }

    .home-welcome {
        box-shadow:
            5px 5px 0 #f4a2c8 !important;
    }

    .home-welcome::before {
        font-size: 6px;

        max-width: calc(100% - 30px);

        overflow: hidden;
        text-overflow: ellipsis;
    }

    .story-card {
        box-shadow:
            5px 5px 0 #f29bc3 !important;
    }

    .site-footer::before {
        font-size: 8px;
        letter-spacing: 1px;
    }
}

/* =========================================================
   ASYA ICON SYSTEM — GIF / PNG ONLY
   Keep every secondary page visually consistent with index.php.
   ========================================================= */

:root {
    --asya-pink: #f56aa9;
    --asya-hot-pink: #e45594;
    --asya-soft-pink: #ffe7f2;
    --asya-border: #241b21;
    --asya-shadow: #ef8bb7;
}

/* Shared image-icon treatment */
.pink-button img,
.read-button img,
.all-stories-button img,
.section-heading > img,
.story-genre img,
.story-meta img,
.empty-cover img,
.site-nav img,
.site-brand img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    image-rendering: auto;
    vertical-align: middle;
    flex: 0 0 auto;
}

.site-nav .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
}

.site-nav .nav-icon img {
    width: 20px;
    height: 20px;
}

.site-nav a.active {
    background: #ffe0ed !important;
    color: #d94283 !important;
    box-shadow: 2px 2px 0 #f4a2c8;
}

/* Buttons on non-index pages */
.btn,
.admin-btn,
.tinybtn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Complete button styling for writer/secondary pages. */
.btn {
    min-height: 34px;
    box-sizing: border-box;
    padding: 8px 11px;
    color: #6d3150;
    background: #fff5fa;
    border: 2px solid #d77da6;
    border-radius: 5px;
    box-shadow: 2px 2px 0 #f2a0c4;
    text-decoration: none;
    font: 900 9px/1 "Courier New", monospace;
    letter-spacing: .5px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.btn:hover {
    background: #ffe0ed;
    color: #b72c6c;
}

.btn.pink {
    background: #e94b91;
    color: #fff !important;
    border-color: #241b21;
}

.btn.pink:hover {
    background: #d83c82;
}

.btn.danger {
    background: #fff0f5;
    color: #a92861 !important;
    border-color: #d77da6;
}

/* These buttons already contain their own image icon; don't add a second pseudo icon. */
.btn:has(img)::before {
    display: none;
}

.btn::before,
.admin-btn::before,
.tinybtn::before {
    content: "";
    width: 22px;
    height: 22px;
    display: inline-block;
    flex: 0 0 22px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Reader controls */
.reader-nav .btn:not(.pink)::before {
    background-image: url('/assets/images/icons/back.gif');
}

.reader-nav .btn.pink::before {
    background-image: url('/assets/images/icons/book-open.gif');
}

/* Generic form/save controls */
.btn.pink::before {
    background-image: url('/assets/images/icons/save.png');
}

/* Destructive controls */
.btn.danger::before,
.admin-btn-danger::before {
    background-image: url('/assets/images/icons/trash.png');
}

/* Writer controls */
.admin-btn-primary::before {
    background-image: url('/assets/images/icons/writing.gif');
}

.writer-toolbar-actions .admin-btn:not(.admin-btn-primary):not(.admin-btn-danger)::before {
    background-image: url('/assets/images/icons/home.png');
}

/* Small edit actions */
.tinybtn:not(.danger)::before {
    background-image: url('/assets/images/icons/writing.gif');
}

/* Search/filter controls */
.search-form button::before,
.search-button::before {
    content: "";
    width: 20px;
    height: 20px;
    display: inline-block;
    background: url('/assets/images/icons/search.png') center/contain no-repeat;
}

/* Writer dashboard replaces emoji-only decorative icons with real assets. */
.toolbar-icon,
.admin-stat-icon,
.empty-book {
    font-size: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.toolbar-icon::before {
    content: "";
    width: 34px;
    height: 34px;
    background: url('/assets/images/icons/writing.gif') center/contain no-repeat;
}

.admin-stat-icon::before {
    content: "";
    width: 34px;
    height: 34px;
    background: url('/assets/images/icons/notebook.gif') center/contain no-repeat;
}

.empty-book::before {
    content: "";
    width: 58px;
    height: 58px;
    background: url('/assets/images/icons/book-close.gif') center/contain no-repeat;
}

/* Writer empty-state decoration */
/* Consistent decorative heading icon */
.section-heading > img {
    width: 48px;
    height: 48px;
}

/* Icon spacing inside action rows */
.actions,
.story-card-actions,
.writer-toolbar-actions {
    align-items: center;
}

/* Make clickable icon buttons feel like the index cards */
.btn:hover,
.admin-btn:hover,
.tinybtn:hover {
    transform: translate(1px, 1px);
}

/* Login form button keeps the actual GIF/PNG inside the markup. */
.form-button img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

@media (max-width: 600px) {
    .btn::before,
    .admin-btn::before,
    .tinybtn::before {
        width: 19px;
        height: 19px;
        flex-basis: 19px;
    }

    .site-nav .nav-icon img {
        width: 18px;
        height: 18px;
    }
}


/* =========================================================
   NOVEL / STORY DETAIL — SAME AS INDEX.PHP
   ========================================================= */

.novel-hero {
    display: grid;
    grid-template-columns: minmax(230px, 34%) minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 34px;
    padding: 18px;
    background: #ffffff;
    border: 2px solid #241b21;
    box-shadow: 6px 6px 0 #f29bc3;
}

.novel-cover {
    width: 100%;
    min-height: 300px;
    overflow: hidden;
    background: #ffeaf4;
    border: 2px solid #241b21;
}

.novel-cover > img {
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
}

.novel-info {
    min-width: 0;
    padding: 8px 4px;
}

.novel-info > small {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    color: #d83c82;
    background: #ffe0ed;
    border: 1px solid #ed8ab5;
    font-family: "Courier New", monospace;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.novel-info h1 {
    margin: 10px 0 10px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
    overflow-wrap: anywhere;
    text-shadow: 2px 2px 0 #f7b5d3;
}

.novel-info > p {
    margin: 0 0 18px;
    color: #76636d;
    font-size: 13px;
    line-height: 1.7;
    white-space: normal;
}

.novel-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 0 0 18px;
    padding: 10px 0;
    border-top: 1px dotted #e795b8;
    border-bottom: 1px dotted #e795b8;
}

.novel-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #806c76;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .3px;
}

.novel-stat img {
    width: 17px !important;
    height: 17px !important;
    max-width: 17px !important;
    max-height: 17px !important;
    object-fit: contain !important;
}

.novel-info .pink-button {
    margin-top: 2px;
}

/* Chapter list */
.novel-chapters,
.admin-story {
    text-decoration: none;
}

.novel-chapter-card {
    width: 100%;
    min-height: 76px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    padding: 14px 16px;
    color: #241b21;
    background: linear-gradient(180deg, #ffffff, #fff2f8);
    border: 2px solid #241b21;
    border-radius: 10px;
    box-shadow: 4px 4px 0 #f4a7ca;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.novel-chapter-card:hover {
    background: #ffe7f2;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #f29bc3;
}

.novel-chapter-card strong {
    display: block;
    color: #d83c82;
    font-family: "Courier New", monospace;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.novel-chapter-card p {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.chapter-arrow {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ed8ab5;
    background: #ffe0ed;
    overflow: hidden;
}

.chapter-arrow img {
    width: 19px !important;
    height: 19px !important;
    max-width: 19px !important;
    max-height: 19px !important;
    object-fit: contain !important;
    transform: rotate(180deg);
}

/* The original page used inline styles on chapter links. Override them
   so they cannot break the library theme. */
.admin-story {
    display: grid !important;
    background: linear-gradient(180deg, #ffffff, #fff2f8) !important;
    border: 2px solid #241b21 !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    margin-bottom: 12px !important;
    color: #241b21 !important;
    box-shadow: 4px 4px 0 #f4a7ca;
}

.admin-story:hover {
    background: #ffe7f2 !important;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #f29bc3;
}

.admin-story > div p {
    margin: 4px 0 0;
}

.admin-story > span {
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-story .chapter-arrow img {
    display: block;
}

@media (max-width: 700px) {
    .novel-hero {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 12px;
        box-shadow: 5px 5px 0 #f29bc3;
    }

    .novel-cover,
    .novel-cover > img {
        min-height: 0;
        height: auto;
    }

    .novel-cover > img {
        aspect-ratio: 4 / 3;
    }

    .novel-info h1 {
        font-size: clamp(26px, 9vw, 38px);
    }

    .novel-stats {
        gap: 7px 11px;
    }

    .novel-stat {
        font-size: 9px;
    }

    .novel-chapter-card,
    .admin-story {
        padding: 13px !important;
    }
}


/* =========================================================
   READER / CHAPTER PAGE — MOBILE FIRST
   ========================================================= */

.reader {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto 28px;
    padding: 24px;
    background: #ffffff;
    border: 2px solid #241b21;
    box-shadow: 6px 6px 0 #f29bc3;
}

.reader-top {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 20px;
    border-bottom: 2px double #ed7eaf;
}

.reader-back {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #d83c82;
    text-decoration: none;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .7px;
}

.reader-back img {
    width: 24px !important;
    height: 24px !important;
    object-fit: contain !important;
    flex: 0 0 24px;
}

.reader-back span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reader-chapter-label {
    flex: 0 0 auto;
    padding: 5px 8px;
    color: #b72c6c;
    background: #ffe0ed;
    border: 1px solid #ed8ab5;
    font: 900 9px/1 "Courier New", monospace;
    letter-spacing: 1px;
}

.reader > .tiny {
    margin: 0 0 5px;
    color: #d83c82;
    font: 900 9px/1.3 "Courier New", monospace;
    letter-spacing: 2px;
}

.reader > h1 {
    margin: 0 0 24px;
    font-size: clamp(28px, 5vw, 44px);
    line-height: 1.08;
    overflow-wrap: anywhere;
    text-shadow: 2px 2px 0 #f7b5d3;
}

.reader-content {
    margin: 0;
    padding: 24px 0 30px;
    color: #3c3037;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(16px, 2vw, 19px);
    line-height: 1.95;
    white-space: normal;
    overflow-wrap: anywhere;
}

.reader-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
    padding-top: 18px;
    border-top: 1px dotted #e795b8;
}

.reader-nav .btn {
    min-height: 46px;
    padding: 8px 12px;
    color: #241b21;
    background: #fff1f7;
    border: 2px solid #241b21;
    box-shadow: 4px 4px 0 #ef8bb7;
    text-decoration: none;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
}

.reader-nav .btn.pink {
    color: #fff;
    background: linear-gradient(180deg, #ff8bc1, #df3f86);
}

.comments {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto 40px;
    padding: 24px;
    background: #fff8fc;
    border: 2px solid #241b21;
    box-shadow: 6px 6px 0 #f4a2c8;
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    color: #30262c;
    font-size: clamp(22px, 4vw, 30px);
    line-height: 1.1;
    text-shadow: 2px 2px 0 #f7b5d3;
}

.comments-title img {
    width: 28px !important;
    height: 28px !important;
    object-fit: contain !important;
}

.comment-form {
    display: grid;
    grid-template-columns: minmax(150px, .45fr) minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    margin-bottom: 20px;
}

.comment-form input,
.comment-form textarea,
.auth-box input {
    width: 100%;
    min-width: 0;
    padding: 12px 13px;
    color: #241b21;
    background: #ffffff;
    border: 2px solid #d98aae;
    border-radius: 0;
    outline: none;
    font: 13px/1.4 Arial, Helvetica, sans-serif;
}

.comment-form textarea {
    min-height: 45px;
    resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus,
.auth-box input:focus {
    border-color: #e45594;
    box-shadow: 3px 3px 0 #f4a2c8;
}

.comment-form .btn {
    min-height: 45px;
    white-space: nowrap;
}

.comment-form .btn img {
    width: 20px !important;
    height: 20px !important;
    object-fit: contain !important;
}

.comment,
.comments .empty {
    padding: 14px 0;
    border-top: 1px dotted #e795b8;
}

.comment b {
    color: #d83c82;
}

.comment small {
    display: block;
    margin-top: 2px;
    color: #8b7480;
    font-size: 9px;
}

.comment p {
    margin: 7px 0 0;
    line-height: 1.7;
}

/* =========================================================
   LOGIN — MATCH INDEX THEME + COMFORTABLE MOBILE INPUTS
   ========================================================= */

.auth-wrapper {
    width: min(520px, calc(100% - 32px));
    margin: 25px auto 45px;
}

.auth-box {
    padding: 30px;
    text-align: center;
    background:
        radial-gradient(circle at 10% 20%, rgba(255,105,174,.12) 0 2px, transparent 3px),
        radial-gradient(circle at 90% 70%, rgba(255,105,174,.12) 0 2px, transparent 3px),
        #fff8fc;
    background-size: 42px 42px, 57px 57px;
    border: 2px solid #241b21;
    box-shadow: 7px 7px 0 #f4a2c8;
}

.auth-box > img {
    width: 58px !important;
    height: 58px !important;
    margin: 0 auto 10px;
    object-fit: contain !important;
    filter: drop-shadow(3px 3px 0 #f4a2c8);
}

.auth-box h1 {
    margin: 0;
    color: #30262c;
    font-size: clamp(25px, 7vw, 34px);
    text-shadow: 2px 2px 0 #f7b5d3;
}

.auth-box > p {
    margin: 7px auto 22px;
    color: #76636d;
    font-size: 12px;
}

.auth-box .alert {
    margin: 0 0 16px;
    padding: 10px 12px;
    color: #a92861;
    background: #ffe0ed;
    border: 2px solid #e45594;
    font-size: 11px;
    font-weight: 800;
}

.auth-box form {
    text-align: left;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin: 0 0 6px;
    color: #b72c6c;
    font: 900 9px/1.2 "Courier New", monospace;
    letter-spacing: 1.5px;
}

.auth-box .form-input {
    min-height: 46px;
}

.auth-box .form-button {
    width: 100%;
    margin-top: 4px;
    cursor: pointer;
}

@media (max-width: 600px) {
    .reader,
    .comments,
    .auth-wrapper {
        width: calc(100% - 20px);
    }

    .reader,
    .comments {
        padding: 16px;
    }

    .reader-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .reader-chapter-label {
        align-self: flex-start;
    }

    .reader-content {
        padding-top: 14px;
        font-size: 16px;
        line-height: 1.85;
    }

    .reader-nav {
        grid-template-columns: 1fr;
    }

    .comment-form {
        grid-template-columns: 1fr;
    }

    .comment-form .btn {
        width: 100%;
    }

    .auth-wrapper {
        margin-top: 15px;
    }

    .auth-box {
        padding: 22px 17px;
    }
}


/* =========================================================
   STORIES SEARCH — ASYA'S LITTLE LIBRARY
   ========================================================= */
.stories-search {
    margin-left: auto;
    width: min(430px, 48%);
}

.stories-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 4px 5px 4px 10px;
    background: #fff8fc;
    border: 2px solid #e8a2c5;
    box-shadow: 3px 3px 0 #f4a7ca;
}

.stories-search-box > img {
    width: 20px !important;
    height: 20px !important;
    flex: 0 0 20px;
    object-fit: contain !important;
}

.stories-search-box input {
    min-width: 0;
    flex: 1;
    height: 32px;
    padding: 0 3px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #3a2831;
    font: 700 12px/1.2 "Courier New", monospace;
}

.stories-search-box input::placeholder {
    color: #c28da9;
}

.stories-search-box input:focus {
    color: #9e285f;
}

.stories-search-box button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 13px;
    border: 2px solid #9e285f;
    background: #d43b81;
    color: #fff;
    cursor: pointer;
    font: 900 9px/1 "Courier New", monospace;
    letter-spacing: 1px;
    box-shadow: 2px 2px 0 #7f1f4d;
}

.stories-search-box button:hover {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #7f1f4d;
}

.stories-search-clear {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: #c33a78;
    text-decoration: none;
    font: 900 19px/1 Arial, sans-serif;
}

.stories-search-result {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
    margin: 15px 0 0;
    padding: 9px 12px;
    border-left: 4px solid #d43b81;
    background: #fff0f7;
    color: #7e5267;
    font: 700 10px/1.5 "Courier New", monospace;
}

.stories-search-result span {
    color: #d43b81;
    letter-spacing: 1px;
}

.stories-search-result strong {
    color: #3a2831;
}

.stories-search-result small {
    color: #a66d88;
}

@media (max-width: 700px) {
    .section-heading {
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .section-heading > img {
        margin-left: auto;
    }

    .stories-search {
        order: 3;
        width: 100%;
        margin-left: 0;
        flex-basis: 100%;
    }

    .stories-search-box {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 420px) {
    .stories-search-box {
        gap: 6px;
        padding-left: 8px;
    }

    .stories-search-box button {
        padding: 0 9px;
        font-size: 8px;
    }

    .stories-search-box input {
        font-size: 11px;
    }
}

/* =========================================================
   COMMENT OWNER CONTROLS + CHAPTER BACK BUTTON
   ========================================================= */
.comment-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.comment-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.comment-action {
    display: inline-block;
    padding: 5px 7px;
    color: #b72c6c;
    background: #fff0f7;
    border: 1px solid #df8bb1;
    cursor: pointer;
    list-style: none;
    font: 900 8px/1 "Courier New", monospace;
    letter-spacing: .7px;
}

.comment-action::-webkit-details-marker {
    display: none;
}

.danger-link {
    color: #a92861 !important;
    background: #ffe4ef !important;
    border-color: #df7da9 !important;
}

.comment-edit-form {
    width: min(360px, 78vw);
    display: grid;
    gap: 7px;
    margin-top: 7px;
    padding: 10px;
    background: #fff8fc;
    border: 1px solid #e6a1bf;
}

.comment-edit-form input,
.comment-edit-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 9px;
    border: 1px solid #d98aae;
    background: #fff;
    font: 12px/1.4 Arial, sans-serif;
}

.comment-edit-form textarea {
    min-height: 75px;
    resize: vertical;
}

.comment-edit-form .tinybtn {
    width: 100%;
}

@media (max-width: 600px) {
    .comment-head {
        flex-direction: column;
    }

    .comment-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .comment-edit-form {
        width: calc(100vw - 74px);
    }
}

.moderation-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dotted #e795b8;
}

.moderation-toolbar .btn {
    cursor: pointer;
}


/* =========================================================
   WRITER / ADMIN AREA — FULL ASYA PINK Y2K THEME
   ========================================================= */
.writer-dashboard {
    width: min(1100px, calc(100% - 28px));
    margin: 0 auto;
    padding: 24px 0 42px;
}

.writer-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 190px;
    gap: 24px;
    align-items: center;
    padding: 28px 30px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #fff7fb 0%, #ffe5f1 55%, #ffd5e8 100%);
    border: 2px solid #241b21;
    border-radius: 14px;
    box-shadow: 7px 7px 0 #f29bc3;
}
.writer-hero::after {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    right: -55px;
    top: -65px;
    background: none center/contain no-repeat;
    opacity: .28;
    pointer-events: none;
}
.writer-label,
.admin-kicker {
    color: #c93478;
    font: 900 10px/1.3 "Courier New", monospace;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}
.writer-hero h1 {
    margin: 8px 0 10px;
    color: #241b21;
    font-family: "Courier New", monospace;
    font-size: clamp(29px, 5vw, 52px);
    line-height: .98;
    letter-spacing: -1px;
}
.writer-hero h1 span { color: #d83c82; }
.writer-hero p {
    max-width: 650px;
    margin: 0;
    color: #765e69;
    font-size: 14px;
    line-height: 1.7;
}
.writer-hero-art {
    min-height: 150px;
    display: grid;
    place-items: center;
    color: transparent;
    background: url('/assets/images/icons/notebook.gif') center/95px no-repeat;
    filter: drop-shadow(4px 4px 0 #f3a1c5);
}
.writer-hero-art span { display: none; }

.writer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
    background: #fff;
    border: 2px solid #241b21;
    border-radius: 10px;
    box-shadow: 4px 4px 0 #f4a7ca;
}
.writer-toolbar-title,
.writer-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.writer-toolbar-title small { display:block; color:#8a707c; font-size:11px; margin-top:2px; }
.toolbar-icon { width:38px; height:38px; flex:0 0 38px; }
.writer-toolbar-actions { flex-wrap: wrap; justify-content:flex-end; }

.admin-btn {
    min-height: 34px;
    box-sizing: border-box;
    padding: 8px 11px;
    color: #6d3150;
    background: #fff5fa;
    border: 2px solid #d77da6;
    border-radius: 5px;
    box-shadow: 2px 2px 0 #f2a0c4;
    text-decoration: none;
    font: 900 9px/1 "Courier New", monospace;
    letter-spacing: .5px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.admin-btn:hover { background:#ffe0ed; color:#b72c6c; }
.admin-btn-primary { background:#e94b91; color:#fff !important; border-color:#241b21; }
.admin-btn-primary:hover { background:#d83c82; }
.admin-btn-danger { background:#fff0f5; color:#a92861 !important; }

.admin-stats {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;
    margin-bottom:18px;
}
.admin-stat {
    display:flex;
    align-items:center;
    gap:10px;
    padding:14px;
    background:#fff;
    border:2px solid #241b21;
    border-radius:10px;
    box-shadow:3px 3px 0 #f4a7ca;
}
.admin-stat-icon { width:38px; height:38px; flex:0 0 38px; }
.admin-stat strong { display:block; font:900 23px/1 "Courier New",monospace; color:#d83c82; }
.admin-stat span { display:block; margin-top:5px; color:#78626d; font:900 8px/1 "Courier New",monospace; letter-spacing:1px; }

.admin-panel {
    padding:20px;
    background:#fff;
    border:2px solid #241b21;
    border-radius:12px;
    box-shadow:6px 6px 0 #f29bc3;
}
.admin-panel-header {
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:15px;
    padding-bottom:16px;
    margin-bottom:18px;
    border-bottom:1px dotted #e795b8;
}
.admin-panel-header h2 { margin:5px 0 4px; color:#241b21; font:900 22px/1.1 "Courier New",monospace; }
.admin-panel-header p { margin:0; color:#8a707c; font-size:12px; }
.admin-story-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.admin-story-card {
    display:grid;
    grid-template-columns:125px minmax(0,1fr);
    min-width:0;
    overflow:hidden;
    background:linear-gradient(180deg,#fff,#fff3f8);
    border:2px solid #241b21;
    border-radius:10px;
    box-shadow:4px 4px 0 #f4a7ca;
}
.admin-story-cover { position:relative; min-height:180px; background:#ffe6f1; overflow:hidden; }
.admin-story-cover > img { width:100%; height:100%; min-height:180px; display:block; object-fit:cover; }
.cover-placeholder { min-height:180px; display:flex; align-items:center; justify-content:center; background:#ffe6f1; }
.cover-badge { position:absolute; left:7px; top:7px; padding:5px 7px; color:#fff; background:#d83c82; border:1px solid #241b21; font:900 8px/1 "Courier New",monospace; text-transform:uppercase; }
.admin-story-content { min-width:0; padding:14px; }
.story-genre { color:#c93478; font:900 8px/1.3 "Courier New",monospace; text-transform:uppercase; letter-spacing:1px; }
.admin-story-content h3 { margin:7px 0; color:#241b21; font:900 20px/1.05 "Courier New",monospace; overflow-wrap:anywhere; }
.admin-story-content > p { margin:0 0 10px; color:#725d67; font-size:11px; line-height:1.55; }
.story-numbers { display:flex; flex-wrap:wrap; gap:9px; margin-bottom:12px; color:#806c76; font:900 8px/1 "Courier New",monospace; }
.story-card-actions { display:flex; flex-wrap:wrap; gap:7px; }

/* Writer secondary pages */
.writer-head {
    width:min(1050px,calc(100% - 28px));
    margin:22px auto 14px;
    padding:16px 18px;
    background:#fff;
    border:2px solid #241b21;
    border-radius:10px;
    box-shadow:4px 4px 0 #f4a7ca;
}
.writer-head h1 { margin:5px 0 0; color:#241b21; font:900 clamp(23px,5vw,34px)/1.05 "Courier New",monospace; }
.writer-head .tiny { margin:0; color:#c93478; }
.writer-head + .paper,
.writer-head ~ .paper { width:min(1050px,calc(100% - 28px)); margin-left:auto; margin-right:auto; }
.admin-row,
.moderate-comment {
    display:flex; align-items:center; justify-content:space-between; gap:14px;
    padding:13px 0; border-bottom:1px dotted #e5a2bd;
}
.admin-row:last-child,.moderate-comment:last-child { border-bottom:0; }
.moderate-comment > div { min-width:0; }
.moderate-comment b { color:#b72c6c; font:900 12px/1.2 "Courier New",monospace; }
.moderate-comment small { display:block; color:#927682; margin-top:4px; font-size:9px; }
.moderate-comment p { margin:7px 0 0; line-height:1.55; }
.moderation-toolbar { justify-content:flex-end; }

.form-grid,
.two-col { gap:14px; }
.editor-page .paper,
.editor-page { width:min(1050px,calc(100% - 28px)); margin-left:auto; margin-right:auto; }

/* Comment buttons: EDIT + DELETE + REPLY shortcut in one compact row. */
.comment-head { align-items:center; }
.comment-actions { align-items:center; flex-wrap:nowrap; }
.comment-actions form { margin:0; }
.reply-shortcut { text-decoration:none; }
.comment-action { white-space:nowrap; }
.reply-form {
    display:none;
    scroll-margin-top:25px;
}
.reply-form:target {
    display:grid;
    grid-template-columns:minmax(150px,.45fr) minmax(0,1fr) auto;
    align-items:start;
    gap:10px;
}

@media (max-width: 800px) {
    .writer-hero { grid-template-columns:1fr; padding:22px; }
    .writer-hero-art { min-height:70px; background-size:70px; }
    .writer-toolbar { align-items:flex-start; flex-direction:column; }
    .writer-toolbar-actions { width:100%; justify-content:flex-start; }
    .admin-stats { grid-template-columns:repeat(2,1fr); }
    .admin-story-grid { grid-template-columns:1fr; }
}
@media (max-width: 600px) {
    .writer-dashboard { width:calc(100% - 18px); padding-top:14px; }
    .writer-hero { box-shadow:4px 4px 0 #f29bc3; }
    .writer-hero h1 { font-size:31px; }
    .writer-toolbar-actions .admin-btn { flex:1 1 auto; }
    .admin-stats { gap:8px; }
    .admin-stat { padding:10px; }
    .admin-stat-icon { width:30px; height:30px; flex-basis:30px; }
    .admin-stat strong { font-size:18px; }
    .admin-story-card { grid-template-columns:92px minmax(0,1fr); }
    .admin-story-cover,.admin-story-cover > img,.cover-placeholder { min-height:145px; }
    .admin-panel { padding:13px; box-shadow:4px 4px 0 #f29bc3; }
    .admin-panel-header { align-items:flex-start; flex-direction:column; }
    .writer-head { width:calc(100% - 18px); }
    .writer-head + .paper,.writer-head ~ .paper { width:calc(100% - 18px); }
    .moderate-comment { align-items:flex-start; flex-direction:column; }
    .moderate-comment .btn { width:100%; }
    .comment-head { flex-direction:row !important; }
    .comment-actions { width:auto !important; justify-content:flex-end; overflow-x:auto; max-width:62vw; }
    .comment-edit-form { position:absolute; right:0; z-index:5; }
    .comment { position:relative; }
    .reply-form { grid-template-columns:1fr; }
}

/* =========================================================
   WRITER POLISH v2 — SAME GIF/PNG LANGUAGE AS INDEX.PHP
   ========================================================= */
.writer-area .site-nav a[href="/index.php"]:not(.active) {
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
}
.writer-area .site-nav .writer-link {
    background: #ffe0ed !important;
    color: #d94283 !important;
    box-shadow: 3px 3px 0 #f4a2c8 !important;
}

.writer-label { display:flex; align-items:center; gap:7px; }
.writer-label-icon { width:18px; height:18px; object-fit:contain; }
.inline-icon { width:15px; height:15px; object-fit:contain; vertical-align:-3px; }
.writer-title-icon { width:22px; height:22px; object-fit:contain; vertical-align:-5px; margin-right:6px; }
.tiny-inline-icon { width:16px; height:16px; object-fit:contain; vertical-align:-3px; }
.stat-img { width:34px; height:34px; object-fit:contain; }
.story-stat-icon { width:18px; height:18px; object-fit:contain; vertical-align:-5px; }

.writer-hero-art {
    position:relative;
    min-height:170px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:none;
    filter:none;
}
.writer-hero-art-main {
    width:145px;
    height:95px;
    object-fit:contain;
    filter:drop-shadow(4px 4px 0 #f3a1c5);
    position:relative;
    z-index:2;
}
.writer-hero::after { display:none; }

.cover-placeholder img { width:68px; height:68px; object-fit:contain; }
.empty-book::before { background-image:url('/assets/images/icons/book-close.gif'); }
.admin-stat-icon::before { display:none; }
.admin-stat-icon { font-size:0 !important; }

.admin-btn img,
.btn img,
.tinybtn img {
    width:19px;
    height:19px;
    object-fit:contain;
    flex:0 0 auto;
    vertical-align:middle;
}

.writer-toolbar-title .toolbar-icon img {
    width:34px;
    height:34px;
    object-fit:contain;
}

/* Secondary writer pages */
.writer-head {
    position:relative;
    background:
        radial-gradient(circle at 96% 12%, rgba(228,85,148,.12) 0 3px, transparent 4px),
        #fff;
}
.writer-head::after {
    content:"";
    position:absolute;
    right:16px;
    top:12px;
    width:42px;
    height:42px;
    background:none center/contain no-repeat;
    opacity:.55;
    pointer-events:none;
}

.paper {
    background:
        radial-gradient(circle, rgba(239,80,148,.06) 1px, transparent 1px),
        #fff;
    background-size:14px 14px;
    border:2px solid #241b21;
    border-radius:12px;
    box-shadow:6px 6px 0 #f29bc3;
    padding:22px;
}
.paper h1 {
    color:#241b21;
    font:900 clamp(22px,5vw,34px)/1.05 "Courier New",monospace;
    margin:0 0 18px;
    letter-spacing:-.5px;
}
.paper label {
    color:#6d3150;
    font:900 10px/1.4 "Courier New",monospace;
    letter-spacing:.8px;
    text-transform:uppercase;
}
.paper input:not([type="checkbox"]):not([type="file"]),
.paper select,
.paper textarea {
    width:100%;
    box-sizing:border-box;
    margin-top:7px;
    padding:11px 12px;
    border:2px solid #d77da6;
    border-radius:7px;
    background:#fffafd;
    color:#34252d;
    outline:none;
    font:600 13px/1.5 Arial,sans-serif;
    box-shadow:2px 2px 0 #f4a7ca;
}
.paper textarea { resize:vertical; min-height:160px; }
.paper input:focus,.paper select:focus,.paper textarea:focus {
    border-color:#d83c82;
    box-shadow:3px 3px 0 #ef8bb7;
}
.paper input[type="file"] {
    width:100%;
    box-sizing:border-box;
    margin-top:7px;
    padding:9px;
    border:2px dashed #d77da6;
    border-radius:7px;
    background:#fff5fa;
}
.form-grid { display:grid; grid-template-columns:1fr; }
.form-grid > label { display:block; }
.form-grid > .two-col { display:grid; grid-template-columns:1fr 1fr; }
.editor-meta {
    display:flex;
    justify-content:space-between;
    gap:10px;
    flex-wrap:wrap;
    padding:9px 11px;
    border:1px dotted #d77da6;
    border-radius:7px;
    background:#fff5fa;
    color:#8a707c;
    font:700 9px/1.4 "Courier New",monospace;
}
.notice.error {
    padding:11px 13px;
    margin-bottom:14px;
    color:#9b285c;
    background:#fff0f5;
    border:2px solid #d77da6;
    border-radius:7px;
}
.admin-row { align-items:center; }
.admin-row b { color:#3a2830; font:900 12px/1.4 "Courier New",monospace; }
.admin-row small { color:#927682; font-size:10px; }
.actions { display:flex; gap:7px; flex-wrap:wrap; }
.empty {
    padding:32px 18px;
    text-align:center;
    color:#8a707c;
    border:2px dashed #e29abb;
    border-radius:10px;
    background:#fff8fb;
}
.moderation-toolbar { display:flex; justify-content:flex-end; margin-bottom:12px; }
.moderate-comment { align-items:flex-start; }
.moderate-comment form { flex:0 0 auto; }

@media (max-width:800px) {
    .writer-hero-art { min-height:105px; }
    .writer-hero-art-main { width:115px; height:75px; }
    
.paper { padding:15px; }
    .form-grid > .two-col { grid-template-columns:1fr; }
}
@media (max-width:600px) {
    .writer-dashboard { width:calc(100% - 18px); }
    .writer-hero { padding:18px; }
    .writer-hero-art { min-height:90px; }
    .writer-hero-art-main { width:105px; height:68px; }
    
.writer-head { width:calc(100% - 18px); padding:13px; }
    .writer-head::after { width:30px; height:30px; right:9px; top:8px; }
    .writer-head + .paper,.writer-head ~ .paper { width:calc(100% - 18px); }
    .paper { padding:13px; box-shadow:4px 4px 0 #f29bc3; }
    .admin-row { align-items:flex-start; flex-direction:column; }
    .admin-row .actions { width:100%; }
    .admin-row .actions .btn { flex:1 1 90px; min-height:38px; }
    .moderate-comment { flex-direction:column; }
    .moderate-comment form { width:100%; }
    .moderate-comment form .btn { width:100%; }
    .writer-toolbar-actions .admin-btn { min-width:0; }
}

/* ================================================================
   WRITER NOVEL COVERS — SHOW FULL IMAGE (NO CROPPING)
   ================================================================ */
.admin-story-cover {
    min-height: 0;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff7fb;
}

.admin-story-cover > img {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: block;
    object-fit: contain;
    object-position: center;
    background: #fff7fb;
}

.admin-story-cover .cover-placeholder {
    width: 100%;
    height: 100%;
    min-height: 0;
}

@media (max-width: 700px) {
    .admin-story-cover {
        aspect-ratio: 3 / 4;
        min-height: 0;
    }

    .admin-story-cover > img {
        min-height: 0;
        object-fit: contain;
    }
}


/* ================================================================
   FINAL MOBILE/PANEL POLISH — FULL COVERS + CLEAN ACTION ROWS
   ================================================================ */
.admin-story-card {
    display: block;
    overflow: hidden;
}

.admin-story-cover {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
    display: block;
    overflow: hidden;
    background: #fff7fb;
    border-bottom: 2px solid #241b21;
}

.admin-story-cover > img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    object-fit: contain;
    object-position: center;
    background: #fff7fb;
}

.admin-story-cover .cover-placeholder {
    width: 100%;
    min-height: 210px;
    height: 210px;
}

.admin-story-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 15px;
}

.story-card-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-top: auto;
    padding-top: 4px;
}

.story-card-actions .admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 92px;
}

.writer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.writer-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.writer-head-actions .btn,
.actions .btn,
.admin-row .actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.writer-head-actions .btn img,
.actions .btn img,
.admin-row .actions .btn img {
    width: 17px;
    height: 17px;
    object-fit: contain;
}

.admin-row .actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.moderation-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.moderation-toolbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.moderation-toolbar .btn img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.moderate-comment {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.moderate-comment > form {
    flex: 0 0 auto;
}

.moderate-comment > form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.comment-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    width: auto !important;
    max-width: none !important;
    overflow: visible !important;
}

.comment-actions form,
.comment-actions details {
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 auto;
}

.comment-action,
.comment-actions .comment-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    box-sizing: border-box;
    white-space: nowrap;
}

.comment-actions details summary {
    cursor: pointer;
}

.reply-shortcut {
    text-decoration: none !important;
}

@media (max-width: 700px) {
    .admin-story-grid {
        grid-template-columns: 1fr;
    }

    .admin-story-cover > img {
        width: 100%;
        height: auto;
    }

    .admin-story-cover .cover-placeholder {
        min-height: 170px;
        height: 170px;
    }

    .story-card-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .story-card-actions .admin-btn {
        width: 100%;
        min-width: 0;
    }

    .writer-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .writer-head-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .writer-head-actions .btn {
        flex: 1 1 140px;
    }

    .admin-row .actions {
        width: 100%;
        justify-content: flex-start;
    }

    .admin-row .actions .btn,
    .admin-row .actions form {
        flex: 1 1 120px;
    }

    .admin-row .actions form .btn {
        width: 100%;
    }

    .moderate-comment {
        align-items: flex-start;
        flex-direction: column;
    }

    .moderate-comment > form {
        width: auto;
    }

    .comment-head {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .comment-actions {
        width: auto !important;
        justify-content: flex-start !important;
        overflow: visible !important;
        max-width: 100% !important;
    }
}

@media (max-width: 390px) {
    .story-card-actions {
        grid-template-columns: 1fr;
    }

    .writer-head-actions .btn,
    .admin-row .actions .btn,
    .admin-row .actions form {
        flex-basis: 100%;
    }
}


/* ================================================================
   ADMIN STATISTICS — WRITER DASHBOARD
   ================================================================ */
.admin-insights {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
    margin:0 0 18px;
}
.admin-insight-card {
    min-width:0;
    display:flex;
    align-items:center;
    gap:11px;
    padding:13px;
    background:#fff;
    border:2px solid #241b21;
    border-radius:10px;
    box-shadow:4px 4px 0 #f4a7ca;
}
.admin-insight-icon {
    width:38px;
    height:38px;
    flex:0 0 38px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#ffe0ed;
    border:1px solid #d77da6;
    border-radius:7px;
}
.admin-insight-icon img {
    width:25px;
    height:25px;
    object-fit:contain;
}
.admin-insight-card > div:last-child {
    min-width:0;
}
.admin-insight-label {
    display:block;
    color:#b72c6c;
    font:900 8px/1.2 "Courier New",monospace;
    letter-spacing:1px;
}
.admin-insight-card strong {
    display:block;
    margin-top:4px;
    color:#30232a;
    font:900 15px/1.2 "Courier New",monospace;
    overflow-wrap:anywhere;
}
.admin-insight-card small {
    display:block;
    margin-top:3px;
    color:#927682;
    font-size:9px;
    line-height:1.3;
}
.admin-top-story strong {
    font-size:12px;
}

/* Admin moderation: the bulk action is intentionally only rendered in
   writer/comments.php, which is protected by require_admin(). */
.moderation-admin-badge {
    display:inline-flex;
    align-items:center;
    gap:5px;
    padding:5px 8px;
    color:#b72c6c;
    background:#ffe8f2;
    border:1px solid #d77da6;
    border-radius:6px;
    font:900 8px/1 "Courier New",monospace;
    letter-spacing:.7px;
}
.moderation-admin-badge img { width:14px; height:14px; object-fit:contain; }

@media (max-width:900px) {
    .admin-insights { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:600px) {
    .admin-insights { grid-template-columns:1fr; gap:9px; }
    .admin-insight-card { box-shadow:3px 3px 0 #f4a7ca; }
}


/* ================================================================
   WRITER DASHBOARD — STATISTICS CLEANUP v4
   ================================================================ */
.admin-stats {
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
    margin-bottom:14px;
}
.admin-stat {
    min-width:0;
    min-height:76px;
    box-sizing:border-box;
    padding:10px 11px;
    gap:9px;
    border-radius:10px;
    box-shadow:3px 3px 0 #f4a7ca;
}
.admin-stat-icon {
    width:34px;
    height:34px;
    flex:0 0 34px;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}
.admin-stat-icon .stat-img {
    width:30px;
    height:30px;
    object-fit:contain;
}
.admin-stat strong {
    font-size:20px;
    line-height:1;
}
.admin-stat span {
    margin-top:4px;
    font-size:7px;
    letter-spacing:.8px;
}

.admin-insights {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    margin:0 0 16px;
}
.admin-insight-card {
    min-height:72px;
    box-sizing:border-box;
    padding:10px;
    gap:9px;
    border-radius:10px;
    box-shadow:3px 3px 0 #f4a7ca;
}
.admin-insight-icon {
    width:32px;
    height:32px;
    flex:0 0 32px;
    border-radius:7px;
}
.admin-insight-icon img {
    width:21px;
    height:21px;
}
.admin-insight-label {
    font-size:7px;
    letter-spacing:.8px;
}
.admin-insight-card strong {
    margin-top:3px;
    font-size:14px;
    line-height:1.15;
}
.admin-insight-card small {
    margin-top:2px;
    font-size:8px;
}

@media (max-width:900px) {
    .admin-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:600px) {
    .admin-stats {
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:8px;
        margin-bottom:12px;
    }
    .admin-stat {
        min-height:68px;
        padding:9px;
        gap:8px;
    }
    .admin-stat-icon {
        width:30px;
        height:30px;
        flex-basis:30px;
    }
    .admin-stat-icon .stat-img {
        width:27px;
        height:27px;
    }
    .admin-stat strong { font-size:18px; }
    .admin-stat span { font-size:7px; }

    .admin-insights {
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:8px;
    }
    .admin-insight-card {
        min-height:64px;
        padding:8px;
        gap:7px;
        box-shadow:2px 2px 0 #f4a7ca;
    }
    .admin-insight-icon {
        width:28px;
        height:28px;
        flex-basis:28px;
    }
    .admin-insight-icon img {
        width:18px;
        height:18px;
    }
    .admin-insight-label { font-size:6.5px; }
    .admin-insight-card strong { font-size:12px; }
    .admin-insight-card small { font-size:7px; }
    .admin-top-story strong { font-size:10px; }
}
