:root {
    /* Brand palette, matched to PipbukSite (violet-based) */
    --violet: #784dfe;
    --violet-dark: #5f34e0;
    --violet-tint: rgba(120, 77, 254, 0.1);
    --paper: #ffffff;
    --line: rgba(10, 10, 10, 0.12);
    --pastel-blue: #d0dff2;
    --pastel-pink: #f7dadf;

    /* Existing tokens, remapped to the new palette so the rest of the
       stylesheet (which references these names) picks up the new colors. */
    --navy: var(--violet);
    --navy-light: #9673ff;
    --orange: #f9a717;
    --orange-dark: #fc8f02;
    --blue: var(--violet-dark);
    --blue-dark: #4c2ab8;
    --bg: #fcfcfc;
    --ink: #0a0a0a;
    --muted: #6b6b6b;
    --danger: #cc4845;
    --danger-bg: #fbeceb;
    --success: #247442;
    --success-bg: #eaf7ef;
}

* {
    box-sizing: border-box;
}

img {
    -webkit-user-drag: none;
    user-drag: none;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: "Lexend", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    overflow-x: hidden;
}

h1,
h2 {
    font-family: "Poppins", "Lexend", sans-serif;
    color: var(--navy);
}

img {
    max-width: 100%;
}

.brand-accent {
    color: var(--orange);
}

.landing {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

.landing-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(3rem, 10vw, 6rem) 1.5rem;
    background: linear-gradient(135deg, var(--navy), var(--navy-light) 45%, #1c2a5e 70%, var(--navy));
    background-size: 300% 300%;
    animation: gradientShift 12s ease infinite;
    color: #fff;
    text-align: center;
}

.landing-hero::before,
.landing-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
    z-index: 0;
}

.landing-hero::before {
    width: 320px;
    height: 320px;
    background: var(--orange);
    top: -80px;
    left: -80px;
}

.landing-hero::after {
    width: 260px;
    height: 260px;
    background: var(--blue);
    bottom: -60px;
    right: -60px;
}

.landing-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 480px;
    width: 100%;
    animation: fadeUp 0.7s ease both;
}

.landing-title {
    font-family: "Poppins", sans-serif;
    font-size: clamp(2.25rem, 8vw, 3rem);
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #fff;
}

.landing-tagline {
    font-size: clamp(1.1rem, 4vw, 1.35rem);
    font-weight: 600;
    color: var(--orange);
    margin: 0 0 0.75rem;
}

.landing-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 1.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.landing-alert {
    text-align: left;
}

.landing-cta {
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.landing-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}

.landing-steps {
    padding: clamp(2.5rem, 8vw, 4rem) 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.landing-steps h2 {
    text-align: center;
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    margin: 0 0 2rem;
    color: var(--navy);
}

.step-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.step-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(28, 36, 75, 0.08);
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    animation: fadeUp 0.6s ease both;
    animation-delay: var(--delay, 0s);
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(28, 36, 75, 0.14);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--orange);
    color: var(--navy);
    font-weight: 700;
    font-family: "Poppins", sans-serif;
    margin-bottom: 0.75rem;
}

.step-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    color: var(--navy);
    font-family: "Poppins", sans-serif;
}

.step-card p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.4;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .landing-hero,
    .landing-hero-inner,
    .step-card {
        animation: none;
    }
}

.btn-google {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 0.85rem 1.25rem;
    text-decoration: none;
    color: #3c4043;
    font-weight: 500;
    width: 100%;
    min-height: 44px;
}

.btn-google img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-google:hover,
.btn-google:active {
    background: #f8f9fa;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    text-align: left;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

.app-header {
    background: var(--navy);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    min-width: 0;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.brand {
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    content: "";
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #fff;
}

.nav-toggle-bars {
    position: relative;
}

.nav-toggle-bars::before {
    position: absolute;
    top: -6px;
    left: 0;
}

.nav-toggle-bars::after {
    position: absolute;
    top: 6px;
    left: 0;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.app-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.app-nav a:hover {
    color: var(--orange);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle[aria-expanded="true"] {
    color: var(--orange);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: auto;
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(28, 36, 75, 0.18);
    min-width: 200px;
    max-width: calc(100vw - 2rem);
    overflow: hidden;
    z-index: 20;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-dropdown-menu a:hover {
    background: var(--bg);
}

@media (max-width: 640px) {
    .nav-toggle {
        display: inline-flex;
    }

    .app-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--navy-light);
        padding: 0.5rem 1.25rem 1rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    }

    .app-nav:not([hidden]) {
        display: flex;
    }

    .app-nav a {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-dropdown-menu {
        position: static;
        left: auto;
        right: auto;
        min-width: 0;
        max-width: none;
        width: 100%;
        box-shadow: none;
        border-radius: 8px;
        margin: 0.35rem 0 0.5rem;
        background: rgba(255, 255, 255, 0.08);
    }

    .nav-dropdown-menu a {
        color: #fff;
        padding: 0.6rem 0.75rem;
    }

    .nav-dropdown-menu a:hover {
        background: rgba(255, 255, 255, 0.14);
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.user-info > div {
    min-width: 0;
}

.user-info strong {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    color: #fff;
}

.user-info div div {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.role-badge-admin {
    background: var(--orange);
    color: var(--navy);
}

.avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--orange);
    color: var(--navy);
    font-weight: 700;
    font-size: 1rem;
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    padding: 0.25rem;
    border-radius: 999px;
    cursor: pointer;
}

.user-menu-toggle:hover,
.user-menu-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.12);
}

.user-menu-chevron {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(28, 36, 75, 0.18);
    min-width: 220px;
    max-width: calc(100vw - 2rem);
    overflow: hidden;
    z-index: 20;
}

.user-menu-info {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #eef0f4;
}

.user-menu-info strong {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    color: var(--ink);
    font-size: 0.95rem;
}

.user-menu-email {
    font-size: 0.8rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.15rem;
}

.user-menu-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.user-menu-dropdown a:hover {
    background: var(--bg);
}

.user-menu-dropdown a.user-menu-logout {
    color: var(--danger);
    border-top: 1px solid #eef0f4;
}

main {
    padding: clamp(1.25rem, 5vw, 2rem);
    flex: 1;
}

main h1 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    word-break: break-word;
}

main p {
    color: var(--muted);
}

@media (max-width: 480px) {
    .app-header {
        padding: 0.75rem 1rem;
    }

    .user-info div div {
        max-width: 45vw;
    }

    .avatar,
    .avatar-fallback {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
}

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: clamp(1.75rem, 6vw, 2.75rem);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 1px 4px rgba(28, 36, 75, 0.08);
}

.page-narrow {
    max-width: 480px;
}

.page-wide {
    max-width: 100%;
    background: none;
    border-radius: 0;
    box-shadow: none;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(1.4rem, 4vw, 2rem);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--orange);
    color: var(--navy);
    text-decoration: none;
    font-weight: 700;
    padding: 0.65rem 1.3rem;
    border-radius: 999px;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    min-height: 44px;
    white-space: nowrap;
}

.btn-primary:hover,
.btn-primary:active {
    background: var(--orange-dark);
}

.empty-state {
    color: var(--muted);
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.4rem;
}

@media (max-width: 600px) {
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.35rem;
    }
}

.campaign-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    background: #fff;
    border-radius: 14px;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 4px rgba(28, 36, 75, 0.08);
}

.campaign-filter label {
    font-weight: 500;
    font-size: 0.9rem;
}

.campaign-filter select,
.campaign-filter input[type="search"] {
    font: inherit;
    padding: 0.55rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
}

.campaign-filter input[type="search"] {
    flex: 1;
    min-width: 160px;
}

.campaign-filter select:focus,
.campaign-filter input[type="search"]:focus {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
    border-color: var(--blue);
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 220px;
}

.filter-search .icon-btn {
    width: 38px;
    height: 38px;
}

.filter-clear {
    color: var(--muted);
    font-size: 0.85rem;
    text-decoration: underline;
    margin-left: auto;
    white-space: nowrap;
}

.filter-clear:hover {
    color: var(--ink);
}

.campaign-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.pagination-status {
    color: var(--muted);
    font-size: 0.9rem;
}

.campaign-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border-radius: 14px;
    padding: 0.85rem 1.25rem;
    box-shadow: 0 1px 4px rgba(28, 36, 75, 0.08);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.campaign-row:hover,
.campaign-row:focus-visible {
    box-shadow: 0 8px 20px rgba(28, 36, 75, 0.15);
    transform: translateY(-2px);
}

.campaign-row-body {
    min-width: 0;
    flex: 1;
}

.campaign-row-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 1rem;
}

.campaign-row-top h2 {
    margin: 0;
    font-size: 1.05rem;
    word-break: break-word;
}

.campaign-row-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex-shrink: 0;
}

.campaign-row .book-pages {
    margin: 0.25rem 0 0;
}

.book-cover-sm {
    width: 56px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.book-cover-sm .book-cover-fallback {
    font-size: 0.6rem;
    padding: 0 0.25rem;
    text-align: center;
}

.back-link {
    display: inline-block;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.book-card {
    display: block;
    background: #fff;
    border-radius: 12px;
    padding: 0.9rem;
    box-shadow: 0 1px 4px rgba(28, 36, 75, 0.08);
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-card:hover,
.book-card:focus-visible {
    box-shadow: 0 8px 20px rgba(28, 36, 75, 0.15);
    transform: translateY(-2px);
}

.book-hero {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--navy), var(--navy-light) 45%, #1c2a5e 70%, var(--navy));
    margin-bottom: 1.75rem;
}

.book-hero-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(22px) brightness(0.55) saturate(1.1);
    transform: scale(1.15);
}

.book-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(28, 36, 75, 0.55), rgba(28, 36, 75, 0.88) 55%, var(--navy) 100%);
}

.book-hero-content {
    position: relative;
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: clamp(1.5rem, 5vw, 2.5rem);
}

.book-hero-poster {
    width: 170px;
    flex-shrink: 0;
    margin-bottom: 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.book-hero-info {
    flex: 1;
    min-width: 220px;
    color: #fff;
    padding-bottom: 0.25rem;
}

.book-hero-info h1 {
    color: #fff;
    font-size: clamp(1.6rem, 5vw, 2.5rem);
    margin: 0 0 0.35rem;
}

.book-hero-author {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    margin: 0 0 0.2rem;
}

.book-hero-pages {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    margin: 0 0 0.85rem;
}

.book-hero-genres {
    margin-bottom: 1.1rem;
}

.book-hero-genres .genre-chip {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.book-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-secondary-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 0.65rem 1.3rem;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    cursor: pointer;
    min-height: 44px;
    white-space: nowrap;
}

.btn-secondary-light:hover,
.btn-secondary-light:active {
    background: rgba(255, 255, 255, 0.15);
}

.book-hero-synopsis {
    max-width: 720px;
}

.book-hero-synopsis h2 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
}

@media (max-width: 560px) {
    .book-hero-content {
        justify-content: center;
        text-align: center;
    }

    .book-hero-poster {
        width: 140px;
    }

    .book-hero-genres,
    .book-hero-actions {
        justify-content: center;
    }
}

.book-hero-info .badge {
    margin-right: 0.4rem;
}

.campaign-hero-quota {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 360px;
    margin-bottom: 1.1rem;
}

.campaign-hero-quota .quota-bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    margin-bottom: 0;
}

.campaign-hero-quota-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    white-space: nowrap;
}

.campaign-hero-leave {
    margin-top: 0.85rem;
}

.campaign-hero-leave button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.campaign-hero-leave button:hover {
    color: #fff;
}

.btn-secondary-light:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-secondary-light:disabled:hover {
    background: transparent;
}

.campaign-readers {
    margin-top: 1.75rem;
}

.campaign-readers h2 {
    font-size: 1.1rem;
    margin: 0 0 0.75rem;
}

.campaign-card {
    background: var(--bg);
    border-radius: 14px;
    padding: 1.25rem;
    margin-top: 1.75rem;
}

.dashboard-hero {
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-hero-active {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    background: #fff;
    border-left: 6px solid var(--orange);
    box-shadow: 0 1px 4px rgba(28, 36, 75, 0.08);
}

.dashboard-hero-cover {
    width: 96px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.dashboard-hero-body {
    flex: 1;
    min-width: 220px;
}

.dashboard-hero-body h2 {
    margin: 0.35rem 0 0.5rem;
    font-size: 1.3rem;
}

.dashboard-hero-countdown {
    font-size: 1.05rem;
    color: var(--navy);
    margin: 0 0 0.5rem;
}

.dashboard-hero-countdown strong {
    color: var(--orange-dark);
    font-size: 1.35rem;
}

.dashboard-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.dashboard-hero-actions p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    width: 100%;
}

.dashboard-hero-invite {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--navy), var(--navy-light) 45%, #1c2a5e 70%, var(--navy));
    background-size: 300% 300%;
    animation: gradientShift 12s ease infinite;
    color: #fff;
    text-align: center;
    padding: clamp(2.25rem, 7vw, 3.5rem) 1.5rem;
}

.dashboard-hero-invite::before,
.dashboard-hero-invite::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    z-index: 0;
}

.dashboard-hero-invite::before {
    width: 260px;
    height: 260px;
    background: var(--orange);
    top: -80px;
    left: -70px;
}

.dashboard-hero-invite::after {
    width: 220px;
    height: 220px;
    background: var(--blue);
    bottom: -70px;
    right: -60px;
}

.dashboard-hero-invite > * {
    position: relative;
    z-index: 1;
}

.dashboard-hero-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--orange);
    margin-bottom: 0.75rem;
}

.dashboard-hero-invite h2 {
    color: #fff;
    font-size: clamp(1.5rem, 4vw, 2.15rem);
    margin: 0 0 0.6rem;
}

.dashboard-hero-invite p {
    color: rgba(255, 255, 255, 0.85);
    margin: 0 auto 1.5rem;
    max-width: 440px;
}

.dashboard-hero-invite .dashboard-hero-actions {
    justify-content: center;
    margin-top: 0;
}

.profile-header {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--orange);
    color: var(--navy);
    text-decoration: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.icon-btn:hover,
.icon-btn:active {
    background: var(--orange-dark);
}

.icon-btn-danger {
    background: var(--danger);
    color: #fff;
}

.icon-btn-danger:hover,
.icon-btn-danger:active {
    background: #8f1f18;
}

.profile-header .user-info strong {
    color: var(--ink);
}

.profile-header .user-info div div {
    color: var(--muted);
}

.campaign-card h2 {
    font-size: 1.05rem;
    margin: 0 0 0.75rem;
}

.campaign-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.campaign-card-header h2 {
    margin: 0;
}

.campaign-facts {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0 0 0.75rem;
}

.campaign-facts dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    font-weight: 600;
}

.campaign-facts dd {
    margin: 0.1rem 0 0;
    font-weight: 600;
    color: var(--ink);
}

.quota-bar {
    background: #eef0f4;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.quota-bar-fill {
    background: var(--orange);
    height: 100%;
    border-radius: inherit;
}

.campaign-card .form-actions {
    margin: 0 0 0.75rem;
}

.campaign-card .form-actions:last-child {
    margin-bottom: 0;
}

.form-actions-admin {
    padding-top: 0.75rem;
    border-top: 1px solid #eef0f4;
}

.book-card h2 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    word-break: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.book-author {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.book-pages {
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.genre-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.genre-chip {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--ink);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

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

.badge-activa,
.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-proxima {
    background: var(--violet-tint);
    color: var(--blue-dark);
}

.badge-finalizada {
    background: #eef0f4;
    color: var(--muted);
}

.badge-enrolled {
    background: var(--orange);
    color: var(--navy);
}

.badge-rejected {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-reviewed {
    background: var(--violet-tint);
    color: var(--blue-dark);
}

.badge-stat {
    background: #eef0f4;
    color: var(--navy);
}

.enrollment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.enrollment-list li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(28, 36, 75, 0.08);
    transition: box-shadow 0.15s ease;
}

.enrollment-list li:hover {
    box-shadow: 0 4px 12px rgba(28, 36, 75, 0.12);
}

.enrollment-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}

.enrollment-body strong {
    font-size: 0.95rem;
    color: var(--ink);
}

.enrollment-email {
    font-size: 0.82rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.enrollment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.enrollment-date {
    color: var(--muted);
    font-size: 0.78rem;
}

.enrollment-list .icon-btn {
    width: 34px;
    height: 34px;
}

.review-actions .icon-btn {
    width: 36px;
    height: 36px;
}

.review-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.review-list li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(28, 36, 75, 0.08);
}

.review-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.9rem;
}

.review-info .review-meta {
    color: var(--muted);
    font-size: 0.85rem;
}

.review-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.book-synopsis {
    font-size: 0.9rem;
    color: #374151;
    margin: 0;
    white-space: pre-line;
    text-align: justify;
}

.book-cover {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f3f4;
    margin-bottom: 0.75rem;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.85rem;
}

.book-card-cover-only {
    padding: 0;
    background: none;
    box-shadow: none;
}

.book-card-cover-only .book-cover {
    margin-bottom: 0;
}

.book-cover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 0.85rem;
    background: rgba(28, 36, 75, 0.8);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.book-cover-overlay span {
    color: #fff;
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}

.book-card-cover-only:hover .book-cover-overlay,
.book-card-cover-only:focus-visible .book-cover-overlay {
    opacity: 1;
}

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

.form label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-top: 0.65rem;
}

.form input,
.form textarea,
.form select {
    font: inherit;
    padding: 0.65rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    width: 100%;
    background: #fff;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
    border-color: var(--blue);
}

.form input[type="file"] {
    padding: 0.5rem 0;
    border: none;
}

.form small {
    color: var(--muted);
    font-size: 0.8rem;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
}

.form label.checkbox-list-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    font-weight: 400;
    font-size: 0.9rem;
    margin-top: 0;
    border-bottom: 1px solid #eef0f4;
    cursor: pointer;
}

.checkbox-list-item:last-child {
    border-bottom: none;
}

.checkbox-list-item:hover {
    background: var(--bg);
}

.checkbox-list-item input[type="checkbox"] {
    width: auto;
    flex-shrink: 0;
}

.form .form-actions {
    margin-top: 1.25rem;
}

.current-cover {
    width: 100px;
    aspect-ratio: 2 / 3;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f3f4;
    margin: 0.35rem 0;
}

.current-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
    padding: 0.65rem 1.3rem;
    border-radius: 999px;
    border: 1.5px solid var(--navy);
    font-size: 0.95rem;
    cursor: pointer;
    min-height: 44px;
    white-space: nowrap;
}

.btn-secondary:hover,
.btn-secondary:active {
    background: var(--navy);
    color: #fff;
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #fff;
    color: var(--navy);
}

.btn-secondary:disabled:hover {
    background: #fff;
    color: var(--navy);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 0.65rem 1.3rem;
    border-radius: 999px;
    border: 1.5px solid var(--danger);
    font-size: 0.95rem;
    cursor: pointer;
    min-height: 44px;
    white-space: nowrap;
}

.btn-danger:hover,
.btn-danger:active {
    background: #8f1f18;
    border-color: #8f1f18;
}

.btn-sm {
    padding: 0.4rem 1rem;
    min-height: 34px;
    font-size: 0.85rem;
}

/* Compartir: panel con opciones de color y entrada escalonada. */
.campaign-share { margin:.65rem 0; font-size:.8rem; text-align:left; }
.campaign-share > summary { display:flex; align-items:center; gap:.55rem; width:fit-content; min-height:44px; box-sizing:border-box; padding:.65rem .9rem; border:1px solid #d9caf3; border-radius:12px; background:linear-gradient(135deg,#faf6ff,#eee6ff); color:#6236a5; cursor:pointer; list-style:none; font-weight:600; box-shadow:0 3px 8px #7649bc0a; transition:transform .18s,box-shadow .18s; }
.campaign-share > summary::-webkit-details-marker { display:none; }
.campaign-share > summary:hover { transform:translateY(-2px); box-shadow:0 6px 15px #7649bc1c; }
.campaign-share-plus { margin-left:.3rem; font-size:1.1rem; font-weight:400; }
.campaign-share-dialog { box-sizing:border-box; width:min(440px,calc(100% - 32px)); max-height:calc(100dvh - 32px); margin:auto; padding:32px 28px 24px; overflow-y:auto; border:1px solid #e6dbf5; border-radius:24px; background:linear-gradient(155deg,#faf6ff 0%,#fff 50%); color:#292238; text-align:left; box-shadow:0 30px 100px #28164333; }
.campaign-share-dialog[open] { animation:campaign-share-reveal .28s cubic-bezier(.2,.8,.2,1) both; }
.campaign-share-dialog::backdrop { background:#24163588; backdrop-filter:blur(5px); animation:campaign-share-fade .22s ease both; }
html:has(.campaign-share-dialog[open]) { overflow:hidden; }
.campaign-share-close { position:absolute; top:10px; right:10px; display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; border-radius:50%; background:transparent; color:#736780; font-size:26px; cursor:pointer; }
.campaign-share-close:hover { background:#ede5f8; }
.campaign-share-eyebrow { display:block; padding-right:28px; color:#794bac; font-size:.65rem; font-weight:600; letter-spacing:.09em; text-transform:uppercase; }
.campaign-share-dialog h2 { margin:14px 0 10px; color:#39284d; font-size:1.75rem; font-weight:600; line-height:1.2; letter-spacing:-.04em; }
.campaign-share-book { margin:0 0 24px; color:#81718c; font-size:.85rem; line-height:1.6; overflow-wrap:anywhere; }
.campaign-share-reward { margin:-8px 0 20px; padding:12px; border:1px solid #ebdfb9; border-radius:12px; background:#fff8e9; color:#856329; font-size:.75rem; line-height:1.6; }
.campaign-share-options { display:grid; gap:10px; }
.campaign-share-options .campaign-share-choice { --share-color:#8050bb; --share-tint:#f1eafa; display:flex; align-items:center; gap:12px; box-sizing:border-box; width:100%; min-height:72px; padding:12px; border:1px solid #eee8f3; border-radius:14px; background:#fff; color:#352b40; font:inherit; font-weight:600; text-decoration:none; text-align:left; cursor:pointer; transition:transform .18s,border-color .18s,box-shadow .18s; }
.campaign-share-choice > span:nth-child(2) { min-width:0; flex:1; }
.campaign-share-choice small { display:block; margin-top:4px; color:#8a7e94; font-size:.7rem; line-height:1.4; font-weight:400; }
.campaign-share-options .share-whatsapp { --share-color:#198854; --share-tint:#e1f6e9; }
.campaign-share-options .share-facebook { --share-color:#2670d6; --share-tint:#e9f1ff; }
.campaign-share-options .share-copy { --share-color:#b17a27; --share-tint:#fcf1dc; }
.campaign-share-icon { display:grid; place-items:center; width:44px; height:44px; flex:0 0 44px; border-radius:13px; background:var(--share-tint); color:var(--share-color); transition:transform .2s; }
.campaign-share-icon svg { width:25px; height:25px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.share-facebook .campaign-share-icon svg { fill:currentColor; stroke:none; }
.campaign-share-arrow { color:var(--share-color); padding-right:4px; font-size:1.1rem; }
.campaign-share-options .campaign-share-choice:hover { transform:translateY(-2px); border-color:var(--share-color); box-shadow:0 5px 12px #38204f0a; }
.campaign-share-choice:hover .campaign-share-icon { transform:rotate(-6deg) scale(1.06); }
.campaign-share-dialog[open] .campaign-share-choice { animation:campaign-share-reveal .28s ease backwards; }
.campaign-share-choice:nth-child(1) { animation-delay:40ms !important; }
.campaign-share-choice:nth-child(2) { animation-delay:80ms !important; }
.campaign-share-choice:nth-child(3) { animation-delay:120ms !important; }
.campaign-share-choice:nth-child(4) { animation-delay:160ms !important; }
.campaign-share-options [hidden] { display:none; }
.campaign-share-url { box-sizing:border-box; width:100%; min-width:0; padding:.75rem; border:1px solid #ded2f0; border-radius:8px; font:inherit; }
.campaign-share-status { color:#4a775b; font-size:.75rem; line-height:1.5; }
.campaign-share-status:empty { display:none; }
.share-reward-earned .campaign-share-status { padding:12px; border:1px solid #c5dfb9; border-radius:12px; background:#f0f8e9; color:#426c32; font-weight:500; }
.campaign-share-options .is-copied { border-color:#a8d9b9; background:#f1faf4; }
.campaign-share :focus-visible { outline:3px solid #9164d3; outline-offset:3px; }
.campaign-detail > .campaign-share { margin-bottom:1.25rem; }
@keyframes campaign-share-reveal { from { opacity:0; transform:translateY(16px) scale(.97); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes campaign-share-fade { from { opacity:0; } to { opacity:1; } }
@media (max-width:520px) { .campaign-share-dialog { width:calc(100% - 20px); max-height:calc(100dvh - 20px); margin:auto auto 10px; padding:30px 20px 20px; border-radius:24px; } .campaign-share-dialog h2 { font-size:1.6rem; } }
@media (prefers-reduced-motion:reduce) { .campaign-share *, .campaign-share-dialog::backdrop { animation:none !important; transition:none !important; } }
.local-auth-form {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 420px;
    margin: 24px 0;
    text-align: left;
}
.local-auth-form input:not([type="hidden"]) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 12px;
    border: 1px solid #b8b0c1;
    border-radius: 8px;
    background: #fff;
    color: #282332;
    font: inherit;
}
.local-auth-form button { margin-top: 8px; }
.local-auth-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: fit-content;
    margin-top: 16px;
    padding: 12px 22px;
    border: 1px solid #d8cbee;
    border-radius: 100px;
    color: #604096;
    background: #f6f0ff;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, transform .2s;
}
.local-auth-trigger:hover { background: #ece0ff; transform: translateY(-2px); }
.local-auth-dialog {
    box-sizing: border-box;
    width: min(460px, calc(100% - 32px));
    max-height: calc(100dvh - 40px);
    margin: auto;
    padding: 36px;
    border: 1px solid #e1d4ef;
    border-radius: 26px;
    background: linear-gradient(155deg, #f6edff, #fffcf7 55%);
    color: #32253f;
    box-shadow: 0 24px 90px #24133440;
    text-align: left;
}
.local-auth-dialog::backdrop { background: #24133488; backdrop-filter: blur(6px); }
.local-auth-register { border-top: 5px solid var(--violet); }
.local-auth-logo { display: block; width: 112px; height: auto; margin: 0 0 24px; }
.local-auth-register .local-auth-form { gap: 8px; }
.local-auth-register .local-auth-form small { color: #74647f; font-size: 11px; line-height: 1.5; }
.local-auth-dialog .local-auth-form a { color: var(--violet-dark); font-weight: 600; }
.local-auth-dialog[open] { animation: local-auth-appear .22s ease-out; }
.local-auth-close {
    position: absolute; top: 16px; right: 16px;
    width: 36px; height: 36px;
    border: 0; border-radius: 50%;
    background: #ebe0f6; color: #604096;
    font-size: 26px; cursor: pointer;
}
.local-auth-emblem {
    display: grid; place-items: center;
    width: 54px; height: 54px; margin-bottom: 22px;
    background: #e8daf8; color: #8053bb;
    border-radius: 18px; font-size: 30px; transform: rotate(-8deg);
}
.local-auth-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .12em; color: #8053a4; }
.local-auth-dialog h2 { margin: 10px 0; font-size: clamp(25px, 6vw, 32px); line-height: 1.2; }
.local-auth-dialog > p { color: #74647f; font-size: 14px; line-height: 1.6; }
.local-auth-dialog .local-auth-form { margin: 24px 0 0; max-width: none; }
.local-auth-dialog .local-auth-form label { font-size: 13px; font-weight: 600; }
.local-auth-dialog .local-auth-form input { border-color: #ded2e8; border-radius: 12px; }
.local-auth-dialog .local-auth-form input:focus-visible { outline: 3px solid #c9aff0; outline-offset: 2px; }
.local-auth-dialog .local-auth-form button { width: 100%; border-radius: 12px; padding: 14px; }
.local-auth-dialog .local-auth-form p { font-size: 13px; text-align: center; margin: 8px 0 0; }
html:has(.local-auth-dialog[open]) { overflow: hidden; }
@keyframes local-auth-appear { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .local-auth-dialog[open] { animation: none; } }
@media (max-width: 480px) { .local-auth-dialog { padding: 28px 22px; } }
