:root {
    --dz-bg: #f6f2ea;
    --dz-surface: #fffdf8;
    --dz-surface-2: #f3ece1;
    --dz-text: #1f1d1a;
    --dz-muted: #5f5a53;
    --dz-accent: #c44d2b;
    --dz-accent-2: #0d766e;
    --dz-border: #d8ccba;
    --dz-shadow: 0 12px 30px rgba(25, 20, 13, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at top right, #fbe8d7 0%, var(--dz-bg) 45%, #f3ede2 100%);
    color: var(--dz-text);
    font-family: 'Poppins', sans-serif;
}

.dz-skip-link {
    position: absolute;
    top: -44px;
    left: 12px;
    z-index: 3000;
    border-radius: 0.5rem;
    background: #fff;
    color: #1f1d1a;
    border: 2px solid rgba(13, 118, 110, 0.7);
    box-shadow: 0 6px 14px rgba(31, 29, 26, 0.15);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
}

.dz-skip-link:focus,
.dz-skip-link:focus-visible {
    top: 12px;
    color: #1f1d1a;
    text-decoration: none;
}

a {
    color: var(--dz-accent-2);
    text-decoration: none;
}

a:hover {
    color: var(--dz-accent);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
    outline: 3px solid rgba(13, 118, 110, 0.55);
    outline-offset: 2px;
}

.custom-header {
    position: relative;
    border-bottom: 1px solid rgba(216, 204, 186, 0.55);
}

.header-image {
    height: 220px;
    overflow: hidden;
}

.header-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.95) contrast(1.05);
}

.dz-navbar {
    background: linear-gradient(135deg, rgba(255, 253, 248, 0.94), rgba(251, 240, 226, 0.92));
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(216, 204, 186, 0.75);
    box-shadow: 0 8px 25px rgba(31, 29, 26, 0.08);
}

.dz-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.logo-image {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.site-title {
    font-weight: 700;
    font-size: 1.3rem;
    color: #22201d;
    letter-spacing: 0.02em;
}

.navbar-toggler {
    border-color: rgba(31, 29, 26, 0.2);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(196, 77, 43, 0.2);
}

.navbar-toggler-icon {
    filter: contrast(0.5);
}

.header-btn {
    display: inline-block;
    border-radius: 999px;
    border: 1px solid rgba(196, 77, 43, 0.35);
    background-color: #fff;
    color: #432820;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 10px 16px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.header-btn:hover,
.header-btn:focus {
    background-color: #fef3ed;
    color: var(--dz-accent);
    text-decoration: none;
}

.header-btn.active {
    background: linear-gradient(135deg, var(--dz-accent), #dc6a49);
    color: #fff;
    border-color: transparent;
}

.home-hero {
    margin-top: 1.5rem;
}

.hero-kicker {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--dz-accent);
}

.lead {
    color: var(--dz-muted);
}

.dz-search-stack .form-control,
.dz-search-stack .form-select,
.sidebar-card .form-control,
.sidebar-card .form-select {
    border-color: var(--dz-border);
    background-color: #fff;
}

.dz-search-stack .form-control:focus,
.dz-search-stack .form-select:focus,
.sidebar-card .form-control:focus,
.sidebar-card .form-select:focus {
    border-color: rgba(13, 118, 110, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(13, 118, 110, 0.14);
}

.custom-carousel,
.dz-carousel {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--dz-shadow);
}

.carousel-item img {
    height: clamp(250px, 40vw, 420px);
    object-fit: cover;
}

.carousel-caption {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.72));
    border-radius: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.25rem;
    text-align: left;
}

.carousel-caption h2,
.carousel-caption h5 {
    color: #fff;
    margin: 0;
    font-weight: 600;
}

.custom-card {
    border: 1px solid rgba(216, 204, 186, 0.7);
    border-radius: 0.9rem;
    overflow: hidden;
    background: var(--dz-surface);
    box-shadow: 0 8px 18px rgba(31, 29, 26, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.custom-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(31, 29, 26, 0.1);
}

.custom-image {
    width: 100%;
    height: 210px;
    object-fit: cover;
    object-position: center;
}

.custom-card-body {
    background: linear-gradient(180deg, #fff, #fff9f0);
    padding: 12px;
}

.custom-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    color: #312f2b;
    min-height: 2.45rem;
}

.sidebar-card {
    background: var(--dz-surface);
    border: 1px solid rgba(216, 204, 186, 0.75);
    border-radius: 0.9rem;
    box-shadow: 0 8px 18px rgba(31, 29, 26, 0.05);
    overflow: hidden;
}

.sidebar-card-header {
    background: linear-gradient(135deg, #efe3d2, #f7efe2);
    color: #2b2926;
    font-weight: 700;
    font-size: 0.96rem;
    border-bottom: 1px solid rgba(216, 204, 186, 0.6);
}

.sidebar-card-body {
    background: var(--dz-surface);
    color: var(--dz-text);
}

/*
 * Launch simplification pass:
 * helper/cue/hint copy should not be visible on the public frontend.
 */
.dz-public-app [id*="helper"],
.dz-public-app [id*="Helper"],
.dz-public-app [id*="cue"],
.dz-public-app [id*="Cue"],
.dz-public-app [id*="hint"],
.dz-public-app [id*="Hint"] {
    display: none !important;
}

/*
 * Visual cleanup:
 * launch pages should not read like an operator dashboard.
 * Keep the DOM hooks intact, but suppress low-signal public status copy that
 * bloats the rendered UI on homepage and detail pages.
 */
.dz-public-app #discovery-status-marker,
.dz-public-app #trending-summary,
.dz-public-app #featured-spotlight-status,
.dz-public-app #latest-shows-state-marker,
.dz-public-app #latest-shows-freshness-status,
.dz-public-app #recent-recaps-state-marker,
.dz-public-app #popular-shows-state-marker,
.dz-public-app #popular-mangas-state-marker,
.dz-public-app #recent-news-state-marker,
.dz-public-app #show-scan-helper,
.dz-public-app #show-engagement-helper,
.dz-public-app #show-review-path-helper,
.dz-public-app #ratings-state-summary,
.dz-public-app #ratings-scan-helper,
.dz-public-app #ratings-confidence-helper,
.dz-public-app #ratings-visibility-helper,
.dz-public-app #ratings-refresh-status-helper,
.dz-public-app #source-link-episode-scope-status,
.dz-public-app #episode-show-overview-status,
.dz-public-app #source-link-health-ordering-status,
.dz-public-app #source-link-trust-snapshot-status,
.dz-public-app #source-link-health-snapshot,
.dz-public-app #episode-comments-summary,
.dz-public-app #episode-comments-visibility-status,
.dz-public-app #episode-comments-action-marker,
.dz-public-app .shareon + p.text-muted.fst-italic {
    display: none !important;
}

.dz-public-app p.text-muted.small[role="note"],
.dz-public-app span.text-muted.small[role="note"],
.dz-public-app .dropdown-item-text.text-muted[role="note"] {
    display: none !important;
}

.dz-public-app .dz-home-page p.text-muted.small,
.dz-public-app .dz-show-detail-page p.text-muted.small,
.dz-public-app .dz-hide-helper-copy p.text-muted.small,
.dz-public-app .dz-watchlist-page p.text-muted.small:not(.dz-keep-status-line) {
    display: none !important;
}

/* Sidebar UX/accessibility polish */
.dz-sidebar .sidebar-card-header {
    padding: 0.72rem 0.95rem;
}

.dz-sidebar .sidebar-card-body {
    padding: 0.95rem;
}

.dz-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.dz-sidebar-item {
    line-height: 1.45;
}

.dz-sidebar-link {
    display: inline-block;
    line-height: 1.45;
}

.dz-sidebar-empty {
    font-size: 0.92rem;
    margin: 0;
}

.dz-sidebar-news-list {
    gap: 0.8rem;
}

.dz-sidebar-news-item {
    gap: 0.7rem;
    margin-bottom: 0 !important;
}

.dz-sidebar-news-thumbnail {
    margin-right: 0 !important;
    flex: 0 0 auto;
}

.dz-sidebar-news-link {
    display: block;
    color: var(--dz-text);
    line-height: 1.4;
}

.dz-sidebar-news-link:hover {
    color: var(--dz-accent);
}

.dz-sidebar-store-image {
    border-radius: 10px;
}

.dz-sidebar a:focus-visible,
.dz-sidebar button:focus-visible,
.dz-sidebar input:focus-visible {
    outline: 2px solid rgba(13, 118, 110, 0.5);
    outline-offset: 2px;
    border-radius: 0.4rem;
}

.detail-card {
    border-width: 0;
    background: var(--dz-surface);
    border-radius: 0.9rem;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(31, 29, 26, 0.05);
}

.detail-card-header {
    margin: 0;
    color: #2b2926 !important;
    font-weight: 700;
}

.detail-card-body {
    background: linear-gradient(135deg, #f7efe2, #fffaf3) !important;
    color: #2d2b27 !important;
}

.detail-bottom {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.dz-article {
    background: var(--dz-surface);
    border-radius: 1rem;
    padding: 1rem;
    border: 1px solid rgba(216, 204, 186, 0.7);
}

.dz-breadcrumb {
    margin-bottom: 10px !important;
    border-radius: 10px !important;
    background-color: var(--dz-surface) !important;
    border: 1px solid rgba(216, 204, 186, 0.65);
}

.dz-ol-breadcrumb {
    padding: 8px 12px !important;
    margin-bottom: 0;
}

.pagination .page-link {
    color: #3c3a36;
    border-color: rgba(216, 204, 186, 0.8);
}

.pagination .page-item.active .page-link {
    background-color: var(--dz-accent-2);
    border-color: var(--dz-accent-2);
}

.pagination .page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 118, 110, 0.2);
}

.dz-footer {
    background-image: linear-gradient(135deg, rgba(24, 47, 45, 0.94), rgba(34, 26, 22, 0.94)), url('/static/assets/footer-background.jpg');
    background-size: cover;
    background-position: center;
}

.footer-link {
    color: #f5ede5;
}

.footer-link:hover {
    color: #ffd3b6;
    text-decoration: none;
}

.news-thumbnail {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
}

/* Modal Backdrop - Dark Background */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1040;
}

#emailModal {
    z-index: 1050;
}

.modal-dialog {
    margin-top: 10%;
}

.modal-title {
    font-weight: bold;
    font-size: 1.75rem;
    text-align: center;
}

.modal-body p {
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
}

.modal-content {
    padding: 15px;
    border-radius: 10px;
}

.close {
    font-size: 1.5rem;
    color: #333;
    opacity: 1;
    position: absolute;
    right: 10px;
    top: 10px;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-body input[type="email"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.modal-body button {
    background-color: var(--dz-accent-2);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    width: 100%;
    font-size: 1rem;
}

.modal-body button:hover {
    background-color: #09564f;
}

.flash-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4caf50;
    color: #fff;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

/* Auth and legal page polish */
.auth-shell {
    min-height: calc(100vh - 320px);
    display: flex;
    align-items: center;
}

.auth-card {
    border: 1px solid rgba(216, 204, 186, 0.75);
    border-radius: 1rem;
    background: var(--dz-surface);
    box-shadow: var(--dz-shadow);
}

.auth-form .form-control {
    border-color: var(--dz-border);
    padding: 0.7rem 0.85rem;
}

.auth-form .form-control:focus {
    border-color: rgba(13, 118, 110, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(13, 118, 110, 0.14);
}

.legal-shell {
    margin-top: 0.5rem;
}

.legal-card {
    background: var(--dz-surface);
    border: 1px solid rgba(216, 204, 186, 0.75);
    border-radius: 1rem;
    box-shadow: var(--dz-shadow);
    padding: clamp(1.1rem, 2vw, 2rem);
}

.legal-section {
    margin-bottom: 1.5rem;
}

.legal-section:last-child {
    margin-bottom: 0;
}

.legal-section h2 {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    margin-bottom: 0.6rem;
    color: #272521;
}

.legal-section p,
.legal-section li {
    color: #3d3a35;
    line-height: 1.7;
    font-size: 0.98rem;
}

.legal-section ul {
    padding-left: 1.1rem;
    margin-bottom: 0;
}

/* Reusable state pages: error and maintenance */
.dz-state-shell {
    min-height: calc(100vh - 320px);
    display: flex;
    align-items: center;
}

.dz-state-card {
    background: var(--dz-surface);
    border: 1px solid rgba(216, 204, 186, 0.8);
    border-radius: 1rem;
    box-shadow: var(--dz-shadow);
    padding: clamp(1.2rem, 2.5vw, 2.25rem);
}

.dz-state-badge {
    display: inline-block;
    border-radius: 999px;
    border: 1px solid rgba(13, 118, 110, 0.35);
    color: #085e58;
    background: rgba(13, 118, 110, 0.08);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.42rem 0.75rem;
}

/* Manga character presentation */
.dz-character-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(216, 204, 186, 0.9);
    background: #fff;
    color: #3c3934;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.35rem 0.65rem;
}

.dz-character-card {
    background: linear-gradient(180deg, #fff, #fff9f0);
    border: 1px solid rgba(216, 204, 186, 0.75);
    border-radius: 0.9rem;
    padding: 0.9rem;
    box-shadow: 0 8px 16px rgba(31, 29, 26, 0.05);
}

.dz-character-thumb {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid rgba(216, 204, 186, 0.8);
    background: #f7efe2;
    flex: 0 0 auto;
}

.dz-character-thumb-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #6b6053;
}

.dz-character-fallback-hero {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5e9d8, #fff8ee);
    border: 1px solid rgba(216, 204, 186, 0.75);
    color: #5e4f3f;
    font-weight: 700;
    font-size: 3rem;
}

.dz-character-summary {
    line-height: 1.55;
}

.dz-character-content p,
.dz-character-content li {
    line-height: 1.75;
    color: #3b3833;
}

.dz-character-nav-list .dz-character-nav-item {
    border-color: rgba(216, 204, 186, 0.6);
}

.dz-character-nav-item.is-current {
    background: linear-gradient(135deg, #f7efe2, #fff9f1);
}

/* Show watchlist controls */
.dz-watchlist-panel {
    border: 1px solid rgba(216, 204, 186, 0.8);
    border-radius: 0.9rem;
    background: linear-gradient(180deg, #fff, #fff9f1);
    padding: 0.85rem 0.95rem;
}

.dz-watchlist-panel .btn {
    white-space: nowrap;
}

.dz-watchlist-feedback {
    min-height: 1.2rem;
}

.dz-watchlist-feedback.is-success {
    color: #0b6b64 !important;
}

.dz-watchlist-feedback.is-error {
    color: #b6411f !important;
}

/* Show detail star rating + meta chips (moved from inline template styles) */
.dz-show-detail-page .star-rating {
    direction: rtl;
    display: inline-block;
}

.dz-show-detail-page .star-rating input[type="radio"] {
    display: none;
}

.dz-show-detail-page .star-rating label {
    color: #bbb;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin-bottom: 0;
}

.dz-show-detail-page .star-rating label:hover,
.dz-show-detail-page .star-rating label:hover ~ label,
.dz-show-detail-page .star-rating input[type="radio"]:checked ~ label {
    color: #f2b600;
}

.dz-show-detail-page .dz-meta-chip {
    display: inline-block;
    margin: 0 0.35rem 0.35rem 0;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: #f0f3f8;
    font-size: 0.85rem;
    color: #212529;
}

/* Watchlist page polish */
.dz-watchlist-page .dz-watchlist-grid {
    margin-top: 0.15rem;
}

.dz-watchlist-page .dz-watchlist-count {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid rgba(216, 204, 186, 0.85);
    border-radius: 999px;
    background: #fff;
    color: #3a3732;
    font-size: 0.88rem;
    line-height: 1.2;
    padding: 0.42rem 0.72rem;
}

.dz-watchlist-page .dz-watchlist-entry {
    border-color: rgba(216, 204, 186, 0.8);
    background: linear-gradient(180deg, #fff, #fff9f1);
}

.dz-watchlist-page .dz-watchlist-entry .btn {
    white-space: nowrap;
}

.dz-watchlist-page .dz-watchlist-empty .sidebar-card-body {
    background: linear-gradient(180deg, #fff, #fff9f1);
}

/* Episode watched-progress controls */
.dz-progress-panel {
    border: 1px solid rgba(216, 204, 186, 0.8);
    border-radius: 0.9rem;
    background: linear-gradient(180deg, #fff, #fffaf3);
    padding: 0.85rem 0.95rem;
}

.dz-progress-panel .badge {
    font-weight: 600;
}

.dz-progress-feedback {
    min-height: 1.2rem;
}

.dz-progress-feedback.is-success {
    color: #0b6b64 !important;
}

.dz-progress-feedback.is-error {
    color: #b6411f !important;
}

@media (max-width: 991.98px) {
    .header-image {
        height: 170px;
    }

    .site-title {
        font-size: 1.15rem;
    }

    .navbar-nav {
        margin-top: 0.75rem;
    }

    .header-btn {
        width: 100%;
        text-align: center;
        margin-bottom: 0.4rem;
    }

    .auth-shell {
        min-height: auto;
        align-items: flex-start;
    }

    .legal-card {
        padding: 1rem;
    }

    .dz-state-shell {
        min-height: auto;
        align-items: flex-start;
    }

    .dz-state-card {
        padding: 1rem;
    }

    .dz-character-fallback-hero {
        min-height: 220px;
    }

    .dz-watchlist-panel {
        padding: 0.8rem 0.85rem;
    }

    .dz-progress-panel {
        padding: 0.8rem 0.85rem;
    }
}

@media (max-width: 767.98px) {
    .carousel-item img {
        height: 240px;
    }

    .custom-image {
        height: 190px;
    }

    .logo-image {
        width: 52px;
        height: 52px;
    }

    .dz-character-card {
        padding: 0.8rem;
    }

    .dz-character-thumb {
        width: 76px;
        height: 76px;
    }

    .dz-character-fallback-hero {
        min-height: 180px;
        font-size: 2.3rem;
    }

    .dz-sidebar-list {
        gap: 0.5rem;
    }

    .dz-sidebar-news-list {
        gap: 0.65rem;
    }

    .dz-sidebar-news-item {
        gap: 0.55rem;
    }
}
