/* ==========================================================================
   NochToon (ru_portal) — Layout D: Stage Mosaic Gallery
   Palette: Deep Velvet Indigo (#4338ca / #3730a3), Gallery Canvas (#f6f6fb),
            Raised Sheet (#ffffff), Muted Tint (#ecebfa), Stage Charcoal (#171625),
            Warm Spotlight Amber (#d97706)
   Typography: Literata (Cyrillic serif display) + Rubik (Cyrillic UI sans)
   ========================================================================== */

:root {
    --surface-base: #f6f6fb;
    --surface-raised: #ffffff;
    --surface-muted: #ecebfa;
    --surface-stage: #171625;
    --tone-accent: #4338ca;
    --tone-accent-deep: #3730a3;
    --tone-warm: #d97706;
    --tone-ink: #191729;
    --tone-soft: #5b5675;
    --stroke-subtle: #dedbe8;
    --curve-md: 14px;
    --curve-sm: 8px;
    --font-display: 'Literata', Georgia, serif;
    --font-sans: 'Rubik', system-ui, -apple-system, sans-serif;
    --site-accent: #4338ca;
    --target-size: 24px;
}

@media (pointer: coarse) {
    :root {
        --target-size: 44px;
    }
}

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

html {
    scroll-padding-top: 5.5rem;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background-color: var(--surface-base);
    color: var(--tone-ink);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--tone-ink);
    line-height: 1.24;
    letter-spacing: -0.02em;
    text-wrap: balance;
    margin: 0;
}

h4, h5, h6 {
    color: var(--tone-ink);
    line-height: 1.3;
    margin: 0;
}

p, li {
    text-wrap: pretty;
}

img, video {
    max-inline-size: 100%;
    block-size: auto;
}

:where(a, code) {
    overflow-wrap: anywhere;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

:where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], nav a, label:has(input[type="checkbox"], input[type="radio"])) {
    min-block-size: var(--target-size);
    min-inline-size: var(--target-size);
}

:focus-visible {
    outline: 2px solid var(--tone-accent);
    outline-offset: 2px;
}

.hidden {
    display: none !important;
}

.visually-hidden:where(:not(:focus-within, :active)) {
    position: absolute !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: nowrap !important;
}

/* Native <dialog> Top-Layer & Scroll Containment */
dialog:not([open]) {
    display: none !important;
}

dialog:modal {
    overscroll-behavior: contain;
}

dialog::backdrop {
    background: rgba(23, 22, 37, 0.68);
    backdrop-filter: blur(5px);
    overflow: hidden;
    overscroll-behavior: contain;
}

/* Post-Interaction Validation States */
:is(:user-invalid, .user-invalid-fallback),
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.nc-field-error {
    display: none;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #b91c1c;
}

:is(:user-invalid, .user-invalid-fallback) + .nc-field-error {
    display: block;
}

/* Shared Shell Container */
.nc-shell {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3.25rem;
}

.nc-main-stage {
    flex: 1 0 auto;
    min-width: 0;
}

.nc-svg {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.nc-svg-sm {
    width: 0.92rem;
    height: 0.92rem;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

/* ==========================================================================
   1. Frosted Translucent Sticky Topbar (Layout D)
   ========================================================================== */
.nc-topbar {
    position: sticky;
    top: 0;
    z-index: 45;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--stroke-subtle);
}

.nc-topbar-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0.7rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nc-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.nc-brand-emblem {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--tone-accent);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nc-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.nc-brand-word {
    font-family: var(--font-display);
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--tone-ink);
    line-height: 1.1;
}

.nc-brand-tag {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--tone-soft);
    line-height: 1.2;
}

.nc-topnav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid var(--stroke-subtle);
}

.nc-topnav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--tone-soft);
    white-space: nowrap;
}

.nc-topnav-link:hover {
    color: var(--tone-ink);
    background: rgba(255, 255, 255, 0.72);
}

.nc-topnav-link[aria-current="page"] {
    background: var(--surface-raised);
    color: var(--tone-accent-deep);
    font-weight: 700;
    border: 1px solid rgba(67, 56, 202, 0.26);
}

.nc-search-slot {
    flex: 0 1 320px;
    min-width: 210px;
}

.nc-search-form {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
}

.nc-search-field {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.75rem;
    min-height: 40px;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: 999px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.nc-search-field:focus-within {
    border-color: var(--tone-accent);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.14);
}

.nc-search-field svg {
    color: var(--tone-soft);
}

.nc-search-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--tone-ink);
    font-family: inherit;
    font-size: 0.88rem;
    padding: 0.45rem 0;
    outline: none;
}

.nc-search-input::placeholder {
    color: var(--tone-soft);
}

.nc-search-submit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0.45rem 0.95rem;
    border: 0;
    border-radius: 999px;
    background: var(--tone-accent);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.nc-search-submit:hover {
    background: var(--tone-accent-deep);
}

.nc-auth-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.nc-btn-solid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0.48rem 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--tone-accent);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.nc-btn-solid:hover {
    background: var(--tone-accent-deep);
    color: #ffffff;
}

.nc-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--stroke-subtle);
    border-radius: 999px;
    background: var(--surface-raised);
    color: var(--tone-ink);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.nc-btn-ghost:hover {
    background: var(--surface-muted);
    border-color: rgba(67, 56, 202, 0.32);
    color: var(--tone-accent-deep);
}

.nc-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--stroke-subtle);
    border-radius: 10px;
    background: var(--surface-raised);
    color: var(--tone-ink);
    cursor: pointer;
}

.nc-menu-toggle:hover {
    background: var(--surface-muted);
}

.nc-mobile-drawer {
    display: none;
    border-top: 1px solid var(--stroke-subtle);
    background: var(--surface-raised);
    padding: 0.85rem 1.25rem 1.1rem;
}

.nc-mobile-drawer.is-open {
    display: block;
}

.nc-drawer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    max-width: 1360px;
    margin: 0 auto;
}

.nc-drawer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border-radius: var(--curve-sm);
    background: var(--surface-base);
    color: var(--tone-ink);
    font-size: 0.88rem;
    font-weight: 600;
}

.nc-drawer-link[aria-current="page"] {
    background: var(--surface-muted);
    color: var(--tone-accent-deep);
    border: 1px solid rgba(67, 56, 202, 0.28);
}

.nc-drawer-full {
    grid-column: 1 / -1;
}

@media (max-width: 1120px) {
    .nc-topnav {
        display: none;
    }
    .nc-menu-toggle {
        display: inline-flex;
    }
    .nc-search-slot {
        flex: 1 1 280px;
    }
}

/* Mobile 2-Row Header Contract (<= 768px) */
@media (max-width: 768px) {
    .nc-topbar-inner {
        flex-wrap: wrap;
        padding: 0.65rem 1rem;
        gap: 0.6rem;
    }
    .nc-brand {
        order: 1;
    }
    .nc-brand-tag {
        display: none;
    }
    .nc-auth-group {
        order: 2;
        margin-inline-start: auto;
    }
    .nc-auth-register-desktop {
        display: none;
    }
    .nc-search-slot {
        order: 3;
        flex: 1 0 100%;
        min-width: 0;
    }
    .nc-search-field,
    .nc-search-submit {
        min-height: 44px;
    }
    .nc-shell {
        padding: 1.1rem 1rem 2.5rem;
    }
}

/* ==========================================================================
   2. Asymmetric 2-Column Footer (Layout D)
   ========================================================================== */
.nc-footer {
    margin-top: auto;
    background: var(--surface-raised);
    border-top: 1px solid var(--stroke-subtle);
    padding: 2.75rem 1.5rem 1.75rem;
}

.nc-footer-inner {
    max-width: 1360px;
    margin: 0 auto;
}

.nc-footer-split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.85fr);
    gap: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--stroke-subtle);
}

.nc-footer-about {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.nc-footer-desc {
    margin: 0;
    font-size: 0.88rem;
    color: var(--tone-soft);
    max-width: 52ch;
}

.nc-footer-advisory {
    padding: 0.85rem 1rem;
    border-radius: var(--curve-sm);
    background: var(--surface-base);
    border: 1px solid var(--stroke-subtle);
    font-size: 0.8rem;
    color: var(--tone-soft);
    line-height: 1.5;
}

.nc-footer-advisory strong {
    color: var(--tone-ink);
}

.nc-footer-mail {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
    color: var(--tone-soft);
}

.nc-footer-mail a {
    font-weight: 700;
    color: var(--tone-accent);
}

.nc-footer-mail a:hover {
    text-decoration: underline;
}

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

.nc-footer-col h3 {
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--tone-ink);
    margin-bottom: 0.75rem;
}

.nc-footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.nc-footer-links a {
    font-size: 0.86rem;
    color: var(--tone-soft);
    display: inline-flex;
    align-items: center;
}

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

.nc-footer-bar {
    padding-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    font-size: 0.8rem;
    color: var(--tone-soft);
}

.nc-footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nc-footer-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.24rem 0.65rem;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--tone-accent-deep);
    font-size: 0.75rem;
    font-weight: 600;
}

@media (max-width: 900px) {
    .nc-footer-split {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
}

@media (max-width: 600px) {
    .nc-footer {
        padding: 2rem 1rem 1.5rem;
    }
    .nc-footer-matrix {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

/* ==========================================================================
   3. Home First Viewport: Asymmetric Stage Mosaic (Layout D)
   ========================================================================== */
.nc-mosaic {
    margin-bottom: 1.65rem;
}

.nc-section-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.nc-section-heading {
    font-size: clamp(1.22rem, 2vw, 1.52rem);
    font-weight: 700;
}

.nc-section-more {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--tone-accent);
}

.nc-section-more:hover {
    color: var(--tone-accent-deep);
    text-decoration: underline;
}

.nc-mosaic-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 1.15rem;
    align-items: stretch;
}

.nc-mosaic-lead {
    background: var(--surface-stage);
    color: #f6f6fb;
    border-radius: var(--curve-md);
    padding: 1.4rem;
    display: grid;
    grid-template-columns: minmax(150px, 215px) minmax(0, 1fr);
    gap: 1.35rem;
    align-items: center;
}

.nc-mosaic-poster {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    overflow: hidden;
    background: #252338;
}

.nc-mosaic-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.nc-mosaic-lead:hover .nc-mosaic-poster img {
    transform: scale(1.03);
}

.nc-rank-flag {
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: var(--tone-warm);
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.nc-mosaic-lead-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.nc-mosaic-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.nc-stage-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #f6f6fb;
    font-size: 0.75rem;
    font-weight: 600;
}

.nc-stage-pill.is-warm {
    background: rgba(217, 119, 6, 0.24);
    color: #fcd34d;
}

.nc-mosaic-lead-title {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 1.9vw, 1.58rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.26;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nc-mosaic-lead-title a:hover {
    color: #c7d2fe;
}

.nc-mosaic-lead-desc {
    margin: 0;
    font-size: 0.87rem;
    color: #cbc8de;
    line-height: 1.55;
    max-width: 48ch;
}

.nc-mosaic-lead-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.15rem;
}

.nc-stage-cta-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0.55rem 1.15rem;
    border-radius: var(--curve-sm);
    background: var(--tone-accent);
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 600;
}

.nc-stage-cta-primary:hover {
    background: var(--tone-accent-deep);
    color: #ffffff;
}

.nc-stage-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0.55rem 1rem;
    border-radius: var(--curve-sm);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #f6f6fb;
    font-size: 0.85rem;
    font-weight: 600;
}

.nc-stage-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

.nc-mosaic-quad {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.nc-mosaic-tile {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    transition: border-color 0.16s ease, background-color 0.16s ease;
}

.nc-mosaic-tile:hover {
    border-color: var(--tone-accent);
    background: #fcfcff;
}

.nc-mosaic-tile-thumb {
    position: relative;
    width: 68px;
    aspect-ratio: 3 / 4;
    border-radius: var(--curve-sm);
    overflow: hidden;
    background: var(--surface-muted);
    flex-shrink: 0;
}

.nc-mosaic-tile-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nc-mosaic-rank {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 0.08rem 0.36rem;
    border-radius: 5px;
    background: var(--surface-stage);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.nc-mosaic-tile-info {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 0;
    flex: 1;
}

.nc-mosaic-tile-cat {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--tone-accent);
}

.nc-mosaic-tile-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--tone-ink);
    line-height: 1.32;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nc-mosaic-tile-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.74rem;
    color: var(--tone-soft);
    font-variant-numeric: tabular-nums;
}

.nc-mosaic-strip {
    list-style: none;
    margin: 0.85rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
}

.nc-mosaic-pill-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: 10px;
}

.nc-mosaic-pill-card:hover {
    border-color: var(--tone-accent);
}

.nc-mosaic-pill-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.nc-mosaic-pill-num {
    padding: 0.14rem 0.45rem;
    border-radius: 6px;
    background: var(--surface-muted);
    color: var(--tone-accent-deep);
    font-size: 0.74rem;
    font-weight: 700;
    flex-shrink: 0;
}

.nc-mosaic-pill-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--tone-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nc-mosaic-pill-views {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tone-soft);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .nc-mosaic-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .nc-mosaic-lead {
        grid-template-columns: 1fr;
        padding: 1.15rem;
    }
    .nc-mosaic-poster {
        max-width: 210px;
        margin: 0 auto;
    }
    .nc-mosaic-quad {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   4. Brand Notice Bar, Category Pills & Gallery Grid (Layout D)
   ========================================================================== */
.nc-notice-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.75rem 1.1rem;
    margin-bottom: 1.5rem;
    background: var(--surface-muted);
    border: 1px solid rgba(67, 56, 202, 0.2);
    border-radius: var(--curve-md);
}

.nc-notice-left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    flex: 1 1 280px;
}

.nc-notice-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--tone-accent);
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 700;
    flex-shrink: 0;
}

.nc-notice-copy {
    font-size: 0.86rem;
    color: var(--tone-ink);
}

.nc-notice-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--tone-accent-deep);
    white-space: nowrap;
}

.nc-notice-link:hover {
    text-decoration: underline;
}

.nc-gallery-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin: 1.5rem 0 1.2rem;
}

.nc-gallery-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
}

.nc-gallery-counter {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--tone-soft);
    font-variant-numeric: tabular-nums;
}

.nc-cat-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.nc-cat-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.88rem;
    border-radius: 999px;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    color: var(--tone-soft);
    font-size: 0.83rem;
    font-weight: 600;
}

.nc-cat-pill:hover {
    background: var(--surface-muted);
    color: var(--tone-accent-deep);
}

.nc-cat-pill.is-active,
.nc-cat-pill[aria-current="page"] {
    background: var(--tone-accent);
    border-color: var(--tone-accent);
    color: #ffffff;
}

.nc-gallery-wrap {
    container-type: inline-size;
    width: 100%;
}

.nc-gallery {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1rem;
}

@media (min-width: 720px) {
    .nc-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1060px) {
    .nc-gallery {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.45rem 1.2rem;
    }
}

@supports (container-type: inline-size) {
    @container (min-width: 620px) {
        .nc-gallery {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }
    }
    @container (min-width: 920px) {
        .nc-gallery {
            grid-template-columns: repeat(4, minmax(0, 1fr));
        }
    }
    @container (min-width: 1180px) {
        .nc-gallery {
            grid-template-columns: repeat(5, minmax(0, 1fr));
        }
    }
}

.nc-frame {
    background: var(--surface-raised);
    border-radius: var(--curve-md);
    box-shadow: 0 8px 22px rgba(25, 23, 41, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}

.nc-frame:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(25, 23, 41, 0.11);
}

.nc-gallery .nc-frame:nth-child(n+11) {
    content-visibility: auto;
    contain-intrinsic-size: auto 360px;
}

.nc-frame-media {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    background: var(--surface-muted);
    overflow: hidden;
}

.nc-frame-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.nc-frame:hover .nc-frame-img {
    transform: scale(1.03);
}

.nc-frame-pages {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    padding: 0.16rem 0.5rem;
    border-radius: 6px;
    background: rgba(23, 22, 37, 0.82);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.nc-frame-body {
    padding: 0.8rem 0.85rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.nc-frame-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    font-size: 0.73rem;
}

.nc-frame-cat {
    font-weight: 700;
    color: var(--tone-accent);
}

.nc-frame-score {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 700;
    color: var(--tone-warm);
    font-variant-numeric: tabular-nums;
}

.nc-frame-title {
    font-size: 0.89rem;
    font-weight: 600;
    color: var(--tone-ink);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nc-frame-title:hover {
    color: var(--tone-accent);
}

.nc-frame-foot {
    margin-top: auto;
    padding-top: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    font-size: 0.74rem;
    color: var(--tone-soft);
    font-variant-numeric: tabular-nums;
}

.nc-empty-state {
    grid-column: 1 / -1;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 3.5rem 1.25rem;
    text-align: center;
}

.nc-empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.nc-empty-state p {
    margin: 0 auto 1.25rem;
    max-width: 48ch;
    color: var(--tone-soft);
    font-size: 0.92rem;
}

/* Bottom Register CTA */
.nc-cta-band {
    margin-top: 2rem;
    padding: 1.5rem 1.75rem;
    border-radius: var(--curve-md);
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.nc-cta-copy h3 {
    font-size: 1.18rem;
    margin-bottom: 0.28rem;
}

.nc-cta-copy p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--tone-soft);
    max-width: 62ch;
}

.nc-cta-btn {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .nc-cta-band {
        flex-direction: column;
        align-items: stretch;
        padding: 1.25rem;
    }
    .nc-cta-btn {
        align-self: center;
    }
}

/* ==========================================================================
   5. Shared Pagination (<x-site.pagination />) & Ad Slots
   ========================================================================== */
.ep-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin: 2rem 0;
}

.ep-page-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.78rem;
    border-radius: var(--curve-sm);
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    color: var(--tone-ink);
    font-size: 0.86rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ep-page-item:hover:not(.disabled):not(.active) {
    background: var(--surface-muted);
    border-color: var(--tone-accent);
    color: var(--tone-accent-deep);
}

.ep-page-item.active {
    background: var(--tone-accent);
    border-color: var(--tone-accent);
    color: #ffffff;
    font-weight: 700;
}

.ep-page-item.disabled {
    opacity: 0.42;
    pointer-events: none;
}

.ep-page-nav-icon {
    display: none;
    align-items: center;
    justify-content: center;
}

.ep-page-nav-svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 640px) {
    .ep-pagination {
        flex-wrap: nowrap;
        justify-content: safe center;
        overflow-x: auto;
        scrollbar-width: none;
        gap: 0.32rem;
    }
    .ep-pagination::-webkit-scrollbar {
        display: none;
    }
    .ep-page-nav-label,
    .ep-page-item-far {
        display: none !important;
    }
    .ep-page-nav-icon {
        display: inline-flex;
    }
    .ep-page-item-prev {
        order: 0;
    }
    .ep-page-item-num {
        order: 1;
    }
    .ep-page-item-next {
        order: 2;
    }
    .ep-page-item-nav {
        width: 2.5rem;
        min-width: 2.5rem;
        height: 2.5rem;
        padding: 0;
        flex-shrink: 0;
    }
    .ep-page-item-dots {
        min-width: 1.15rem;
        width: 1.15rem;
        padding: 0;
        background: transparent;
        border-color: transparent;
    }
}

@media (max-width: 374px) {
    .ep-page-item {
        min-width: 2.25rem;
        height: 2.25rem;
        padding: 0 0.5rem;
        font-size: 0.8rem;
    }
    .ep-page-item-nav {
        width: 2.25rem;
        min-width: 2.25rem;
        height: 2.25rem;
    }
    .ep-page-item-dots {
        min-width: 0.9rem;
        width: 0.9rem;
    }
}

/* Ad Slots */
.site-ad-slot.site-ad-banner-320x50 {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.25rem auto;
    min-height: 50px;
    max-width: 100%;
    overflow: hidden;
}

.site-ad-banner-320x50__inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min(320px, 100%);
    min-height: 50px;
}

.site-ad-slot.site-ad-banner-320x50.is-placeholder .site-ad-banner-320x50__inner {
    border: 1px dashed var(--stroke-subtle);
    border-radius: var(--curve-sm);
    background: var(--surface-raised);
    color: var(--tone-soft);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0 0.75rem;
}

.site-ad-social-bar.is-placeholder {
    position: fixed;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 30;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--surface-stage);
    color: #f6f6fb;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ==========================================================================
   6. Breadcrumbs & Detail Page Stage Hero + Sticky Related Aside (Layout D)
   ========================================================================== */
.nc-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.15rem;
    font-size: 0.83rem;
    color: var(--tone-soft);
}

.nc-crumbs a:hover {
    color: var(--tone-accent);
    text-decoration: underline;
}

.nc-crumbs-current {
    color: var(--tone-ink);
    font-weight: 600;
}

.nc-stage-hero {
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-raised) 52%);
    border: 1px solid var(--stroke-subtle);
    border-radius: 18px;
    padding: 1.6rem;
    margin-bottom: 1.25rem;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) 250px;
    gap: 1.5rem;
    align-items: start;
}

.nc-stage-cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-muted);
    box-shadow: 0 12px 28px rgba(25, 23, 41, 0.14);
}

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

.nc-stage-cover-pages {
    position: absolute;
    right: 0.55rem;
    bottom: 0.55rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.55rem;
    border-radius: 6px;
    background: rgba(23, 22, 37, 0.85);
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 600;
}

.nc-stage-center {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-width: 0;
}

.nc-stage-top-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.nc-badge-accent {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.24rem 0.7rem;
    border-radius: 999px;
    background: var(--tone-accent);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 600;
}

.nc-badge-accent:hover {
    background: var(--tone-accent-deep);
    color: #ffffff;
}

.nc-badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.24rem 0.65rem;
    border-radius: 999px;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    color: var(--tone-soft);
    font-size: 0.76rem;
    font-weight: 600;
}

.nc-work-title {
    font-size: clamp(1.32rem, 2.2vw, 1.82rem);
    font-weight: 700;
}

.nc-work-subtitle {
    font-family: var(--font-sans);
    font-size: 0.96rem;
    font-weight: 500;
    color: var(--tone-soft);
}

.nc-meta-pills {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.55rem;
}

.nc-meta-pill {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.nc-meta-lbl {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--tone-soft);
}

.nc-meta-val {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--tone-ink);
    font-variant-numeric: tabular-nums;
}

.nc-meta-link {
    color: var(--tone-accent);
}

.nc-meta-link:hover {
    text-decoration: underline;
}

.nc-rating-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.95rem;
    border-radius: 10px;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
}

.nc-rating-summary {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.86rem;
}

.nc-rating-avg {
    font-weight: 700;
    color: var(--tone-warm);
    font-variant-numeric: tabular-nums;
}

.nc-rating-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.nc-star-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.nc-star-btn {
    border: 0;
    background: transparent;
    padding: 0.2rem;
    color: #cbd5e1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.14s ease, transform 0.14s ease;
}

.nc-star-btn.is-filled,
.nc-star-btn:hover {
    color: var(--tone-warm);
}

.nc-star-btn:hover {
    transform: scale(1.1);
}

.nc-rating-yours {
    font-size: 0.8rem;
    color: var(--tone-soft);
    font-variant-numeric: tabular-nums;
}

.nc-rating-yours strong {
    color: var(--tone-accent-deep);
}

.nc-stage-actions {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.nc-act-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 46px;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    background: var(--tone-accent);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    border: 0;
    cursor: pointer;
}

.nc-act-primary:hover {
    background: var(--tone-accent-deep);
    color: #ffffff;
}

.nc-act-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.95rem;
    border-radius: 10px;
    background: var(--surface-muted);
    border: 1px solid rgba(67, 56, 202, 0.25);
    color: var(--tone-accent-deep);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.nc-act-secondary:hover {
    background: #e2e0f8;
}

.nc-act-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.nc-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 42px;
    padding: 0.48rem 0.6rem;
    border-radius: var(--curve-sm);
    background: var(--surface-base);
    border: 1px solid var(--stroke-subtle);
    color: var(--tone-ink);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.nc-act-btn:hover {
    border-color: var(--tone-accent);
    color: var(--tone-accent-deep);
}

.nc-act-btn.is-favorited,
.nc-act-btn.favorited {
    background: #eef2ff;
    border-color: var(--tone-accent);
    color: var(--tone-accent-deep);
}

.nc-act-util-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.4rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--stroke-subtle);
}

.nc-util-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 0;
    background: transparent;
    color: var(--tone-soft);
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.25rem 0.2rem;
    cursor: pointer;
}

.nc-util-btn:hover {
    color: var(--tone-accent);
    text-decoration: underline;
}

.nc-stage-id {
    font-size: 0.74rem;
    color: var(--tone-soft);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1080px) {
    .nc-stage-hero {
        grid-template-columns: 190px minmax(0, 1fr);
    }
    .nc-stage-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .nc-stage-hero {
        grid-template-columns: 1fr;
        padding: 1.15rem;
    }
    .nc-stage-cover {
        max-width: 200px;
        margin: 0 auto;
    }
}

/* Collapsible Tag Panel */
.nc-tags-panel {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 1.15rem 1.35rem;
    margin-bottom: 1.35rem;
}

.nc-tags-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--stroke-subtle);
    margin-bottom: 0.85rem;
}

.nc-tags-heading {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
}

.nc-tags-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-base);
    color: var(--tone-soft);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.nc-tags-toggle svg {
    transition: transform 0.18s ease;
}

.nc-tags-toggle.is-expanded svg {
    transform: rotate(180deg);
}

.nc-tags-scroll {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-right: 0.25rem;
}

.nc-tags-scroll.is-expanded {
    max-height: none;
}

.nc-tag-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.nc-tag-type {
    min-width: 105px;
    padding-top: 0.2rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--tone-soft);
    flex-shrink: 0;
}

.nc-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.nc-tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.62rem;
    border-radius: 6px;
    font-size: 0.79rem;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
}

.nc-tag-chip.is-selected {
    outline: 2px solid var(--tone-accent);
    outline-offset: 1px;
}

.nc-tag-search-bar {
    margin-top: 0.95rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--stroke-subtle);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.nc-selected-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 240px;
}

.nc-no-tag-hint {
    font-size: 0.8rem;
    color: var(--tone-soft);
}

.nc-sel-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--tone-accent-deep);
    font-size: 0.78rem;
    font-weight: 600;
}

.nc-sel-remove {
    border: 0;
    background: transparent;
    color: var(--tone-accent-deep);
    font-weight: 700;
    padding: 0 0.15rem;
    cursor: pointer;
    min-inline-size: auto;
    min-block-size: auto;
}

@media (max-width: 640px) {
    .nc-tag-row {
        flex-direction: column;
        gap: 0.3rem;
    }
    .nc-tag-type {
        min-width: 0;
    }
}

/* Two-Column Detail Lower Body (75% Thumbnails & Comments + 25% Sticky Related Aside) */
.nc-detail-body {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.nc-detail-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.nc-related-aside {
    position: sticky;
    top: 5.5rem;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 1.1rem;
}

.nc-related-heading {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.9rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--stroke-subtle);
}

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

.nc-related-item a {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0.7rem;
    align-items: center;
    padding: 0.35rem;
    border-radius: var(--curve-sm);
}

.nc-related-item a:hover {
    background: var(--surface-base);
}

.nc-related-thumb {
    aspect-ratio: 3 / 4;
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface-muted);
}

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

.nc-related-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--tone-ink);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 980px) {
    .nc-detail-body {
        grid-template-columns: 1fr;
    }
    .nc-related-aside {
        position: static;
    }
    .nc-related-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* Detail Thumbnail Pagination (.nc-thumb-pager) */
.nc-thumb-pager {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.nc-thumb-pager-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.nc-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.65rem;
    border-radius: var(--curve-sm);
    background: var(--surface-base);
    border: 1px solid var(--stroke-subtle);
    color: var(--tone-ink);
    font-size: 0.82rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.nc-pager-btn:hover:not(.is-disabled):not(.is-active) {
    background: var(--surface-muted);
    border-color: var(--tone-accent);
    color: var(--tone-accent-deep);
}

.nc-pager-btn.is-active {
    background: var(--tone-accent);
    border-color: var(--tone-accent);
    color: #ffffff;
}

.nc-pager-btn.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.nc-thumb-jump {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nc-thumb-jump-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tone-soft);
}

.nc-thumb-jump-input {
    width: 3.6rem;
    height: 2.25rem;
    padding: 0 0.4rem;
    border-radius: var(--curve-sm);
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-base);
    color: var(--tone-ink);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
}

.nc-thumb-jump-total {
    display: none;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--tone-soft);
    font-variant-numeric: tabular-nums;
}

.nc-thumb-jump-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    padding: 0 0.75rem;
    border-radius: var(--curve-sm);
    background: var(--tone-accent);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
}

.nc-thumb-pager-info {
    font-size: 0.8rem;
    color: var(--tone-soft);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
    .nc-thumb-pager {
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 0.35rem;
        padding: 0.6rem 0.65rem;
    }
    .nc-thumb-pager-links {
        display: contents;
    }
    .nc-pager-first {
        order: 1;
    }
    .nc-pager-prev {
        order: 2;
        margin-right: auto;
    }
    .nc-thumb-jump {
        order: 3;
    }
    .nc-pager-next {
        order: 4;
        margin-left: auto;
    }
    .nc-pager-last {
        order: 5;
    }
    .nc-pager-label,
    .nc-pager-num,
    .nc-thumb-pager-info,
    .nc-thumb-jump-label {
        display: none !important;
    }
    #jump-page-btn,
    .nc-thumb-jump-btn {
        display: none !important;
    }
    .nc-thumb-jump-total {
        display: inline;
    }
    .nc-pager-nav {
        width: 2.25rem;
        min-width: 2.25rem;
        height: 2.25rem;
        padding: 0;
        overflow: hidden;
        flex-shrink: 0;
    }
    .nc-thumb-jump-input {
        font-size: 1rem;
        width: 3.2rem;
    }
}

@media (max-width: 374px) {
    .nc-pager-nav {
        width: 2rem;
        min-width: 2rem;
        height: 2rem;
    }
}

/* Sprite Thumbnail Matrix (.comic-thumbnail) */
.nc-thumb-board {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 1.25rem;
}

.nc-thumb-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fill, 200px);
    justify-content: center;
    gap: 1rem;
}

.comic-thumbnail {
    position: relative;
    display: block;
    width: 200px;
    height: 292px;
    border-radius: var(--curve-sm);
    overflow: hidden;
    background-color: var(--surface-muted);
    background-repeat: no-repeat;
    border: 1px solid var(--stroke-subtle);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.comic-thumbnail:hover {
    transform: translateY(-2px);
    border-color: var(--tone-accent);
}

.nc-thumb-page-tag {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 0.14rem 0.48rem;
    border-radius: 5px;
    background: rgba(23, 22, 37, 0.82);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
    .nc-thumb-board {
        padding: 0.85rem 0.5rem;
    }
    .nc-thumb-matrix {
        grid-template-columns: repeat(2, max-content);
        gap: 0.65rem;
    }
    .comic-thumbnail {
        zoom: 0.76;
    }
}

/* Comments Section */
.nc-comments-panel {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 1.35rem;
}

.nc-comments-heading {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

.nc-comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.35rem;
}

.nc-comment-textarea {
    width: 100%;
    min-height: 96px;
    padding: 0.75rem 0.9rem;
    border-radius: var(--curve-sm);
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-base);
    color: var(--tone-ink);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.nc-comment-textarea:focus {
    outline: none;
    border-color: var(--tone-accent);
    background: var(--surface-raised);
}

.nc-comment-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nc-comment-item {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    background: var(--surface-base);
    border: 1px solid var(--stroke-subtle);
}

.nc-comment-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.nc-comment-author {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.nc-avatar-dot {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--tone-accent);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Detail Native <dialog> Modals & Toast */
dialog.nc-dialog {
    width: min(460px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 0;
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    background: var(--surface-raised);
    color: var(--tone-ink);
    box-shadow: 0 24px 56px rgba(23, 22, 37, 0.28);
}

.nc-dialog-box {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nc-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.nc-dialog-title {
    font-size: 1.18rem;
    font-weight: 700;
}

.nc-dialog-sub {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--tone-soft);
}

.nc-dialog-close {
    width: 36px;
    height: 36px;
    border-radius: var(--curve-sm);
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-base);
    color: var(--tone-soft);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nc-dialog-close:hover {
    color: var(--tone-ink);
    background: var(--surface-muted);
}

.nc-form-stack {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.nc-label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--tone-ink);
    margin-bottom: 0.32rem;
}

.nc-input,
.nc-select,
.nc-textarea {
    width: 100%;
    padding: 0.62rem 0.8rem;
    border-radius: var(--curve-sm);
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-raised);
    color: var(--tone-ink);
    font-family: inherit;
    font-size: 0.9rem;
}

.nc-input:focus,
.nc-select:focus,
.nc-textarea:focus {
    outline: none;
    border-color: var(--tone-accent);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.14);
}

.nc-dialog-alert {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--curve-sm);
    font-size: 0.84rem;
    font-weight: 600;
}

.nc-dialog-alert.is-warning {
    display: flex;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.nc-dialog-alert.is-error {
    display: flex;
    background: #fef2f2;
    border: 1px solid #dc2626;
    color: #b91c1c;
}

.nc-dialog-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.nc-result-window {
    padding: 1.65rem 1.4rem;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.nc-result-window .nc-dialog-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
}

.nc-result-icon {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: #166534;
}

.nc-result-window.is-error .nc-result-icon {
    background: #b91c1c;
}

.nc-share-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.nc-share-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.5rem 0.75rem;
    border-radius: var(--curve-sm);
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-base);
    color: var(--tone-ink);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.nc-share-link:hover {
    background: var(--surface-muted);
    border-color: var(--tone-accent);
    color: var(--tone-accent-deep);
}

.nc-toast {
    position: fixed;
    inset: auto;
    top: auto;
    right: auto;
    left: 50%;
    bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    margin: 0;
    border: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    gap: 0.55rem;
    width: max-content;
    max-width: min(440px, calc(100vw - 2rem));
    padding: 0.72rem 1.15rem;
    border-radius: 999px;
    background: var(--surface-stage);
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.38;
    box-shadow: 0 12px 28px rgba(23, 22, 37, 0.32);
    opacity: 0;
    transform: translateX(-50%);
    transition-property: opacity, transform, display, overlay;
    transition-duration: 0.2s;
    transition-timing-function: ease-out;
    transition-behavior: allow-discrete;
}

@media (prefers-reduced-motion: no-preference) {
    .nc-toast {
        transform: translateX(-50%) translateY(10px);
    }
}

.nc-toast:is(:popover-open, .\:popover-open, .is-visible, .active) {
    display: inline-flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@starting-style {
    .nc-toast:is(:popover-open, .\:popover-open, .is-visible, .active) {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: no-preference) {
    @starting-style {
        .nc-toast:is(:popover-open, .\:popover-open, .is-visible, .active) {
            transform: translateX(-50%) translateY(10px);
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .nc-toast {
        transition-duration: 0.1s;
    }
}

.nc-toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-block-size: 24px;
    min-inline-size: 24px;
    margin-inline-start: 0.2rem;
    padding: 0 0.2rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-size: 1.05rem;
    line-height: 1;
    opacity: 0.82;
    cursor: pointer;
}

.nc-toast-close:hover {
    opacity: 1;
}

.nc-toast.toast-success { background: #166534; }
.nc-toast.toast-error { background: #b91c1c; }
.nc-toast.toast-warning { background: #92400e; }

/* ==========================================================================
   7. Reader Page: Dark Charcoal Gallery Stage (Layout D)
   ========================================================================== */
.nc-reader-top {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.nc-reader-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.nc-reader-title {
    font-size: clamp(1.08rem, 1.8vw, 1.35rem);
    font-weight: 700;
}

.nc-reader-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--tone-soft);
    margin-top: 0.2rem;
}

.nc-reader-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nc-reader-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-base);
    color: var(--tone-ink);
    font-family: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.nc-reader-act-btn:hover {
    background: var(--surface-muted);
    border-color: var(--tone-accent);
    color: var(--tone-accent-deep);
}

.nc-reader-progress {
    height: 4px;
    border-radius: 999px;
    background: var(--surface-muted);
    overflow: hidden;
}

.nc-reader-progress-bar {
    height: 100%;
    background: var(--tone-accent);
}

.nc-reader-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: 999px;
    padding: 0.5rem 0.75rem;
}

.nc-reader-nav.is-embedded {
    border: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.nc-reader-pair {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.nc-reader-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 42px;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-base);
    color: var(--tone-ink);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.nc-reader-pill:hover:not(.is-disabled) {
    background: var(--surface-muted);
    border-color: var(--tone-accent);
}

.nc-reader-pill.is-primary {
    background: var(--tone-accent);
    border-color: var(--tone-accent);
    color: #ffffff;
}

.nc-reader-pill.is-primary:hover:not(.is-disabled) {
    background: var(--tone-accent-deep);
}

.nc-reader-pill.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.nc-reader-jump {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.nc-reader-select {
    min-height: 40px;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-base);
    color: var(--tone-ink);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
}

.nc-reader-counter {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--tone-soft);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.nc-dark-stage {
    background: var(--surface-stage);
    border-radius: var(--curve-md);
    padding: clamp(0.75rem, 2vw, 1.5rem);
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 360px;
}

.nc-dark-stage:fullscreen {
    border-radius: 0;
    overflow: auto;
    padding: 1rem;
}

.nc-reader-img-link {
    display: inline-flex;
    justify-content: center;
    max-width: 100%;
}

.nc-reader-img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

/* Mobile Reader 2-Row CSS Grid Contract (<= 640px) */
@media (max-width: 640px) {
    .nc-reader-tip {
        display: none !important;
    }
    .nc-reader-actions {
        width: 100%;
    }
    .nc-reader-act-btn {
        flex: 1 1 auto;
        min-height: 2.5rem;
    }
    .nc-reader-nav {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "center center"
            "prev next";
        gap: 0.6rem 0.4rem !important;
        border-radius: var(--curve-md);
        padding: 0.7rem;
    }
    .nc-reader-jump,
    .nc-reader-counter {
        grid-area: center;
        justify-self: center;
    }
    .nc-reader-prev-group {
        grid-area: prev;
    }
    .nc-reader-next-group {
        grid-area: next;
    }
    .nc-reader-pair {
        gap: 0.35rem;
        min-width: 0;
    }
    .nc-reader-edge {
        width: 2.75rem;
        min-width: 2.75rem;
        height: 2.75rem;
        padding: 0;
        flex-shrink: 0;
    }
    .nc-reader-edge-label {
        display: none !important;
    }
    .nc-reader-step {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0.45rem 0.55rem;
        font-size: 0.82rem;
    }
}

/* ==========================================================================
   8. Search & Directory Pages (Layout D)
   ========================================================================== */
.nc-filter-card {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.35rem;
}

.nc-filter-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.nc-filter-title {
    font-size: clamp(1.25rem, 2.2vw, 1.68rem);
    font-weight: 700;
}

.nc-filter-desc {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: var(--tone-soft);
}

.nc-query-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.nc-query-input-wrap {
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.9rem;
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-base);
}

.nc-query-input-wrap:focus-within {
    border-color: var(--tone-accent);
    background: var(--surface-raised);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.14);
}

.nc-query-input-wrap input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent !important;
    color: var(--tone-ink);
    font-family: inherit;
    font-size: 0.92rem;
    padding: 0.5rem 0;
    outline: none;
}

.nc-dir-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--stroke-subtle);
}

.nc-alpha-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.nc-alpha-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--tone-soft);
    margin-right: 0.25rem;
}

.nc-alpha-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-base);
    color: var(--tone-soft);
    font-size: 0.8rem;
    font-weight: 600;
}

.nc-alpha-pill:hover {
    background: var(--surface-muted);
    color: var(--tone-accent-deep);
}

.nc-alpha-pill.is-active {
    background: var(--tone-accent);
    border-color: var(--tone-accent);
    color: #ffffff;
}

.nc-dir-sort-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--tone-soft);
}

.nc-dir-cloud {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.85rem;
}

.nc-dir-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    transition: border-color 0.16s ease, transform 0.16s ease;
}

.nc-dir-card:hover {
    border-color: var(--tone-accent);
    transform: translateY(-2px);
}

.nc-dir-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tone-ink);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nc-dir-count {
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--tone-accent-deep);
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* ==========================================================================
   9. Download Progress Page (Layout D)
   ========================================================================== */
.nc-dl-advisory {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 1rem;
    border-radius: var(--curve-sm);
    background: var(--surface-muted);
    border: 1px solid rgba(67, 56, 202, 0.22);
    color: var(--tone-ink);
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 1.15rem;
}

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

.nc-dl-work-card {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: center;
}

.nc-dl-cover {
    aspect-ratio: 3 / 4;
    border-radius: var(--curve-sm);
    overflow: hidden;
    background: var(--surface-muted);
}

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

.nc-dl-task-card {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.nc-dl-task-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.nc-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--surface-muted);
    color: var(--tone-accent-deep);
}

.nc-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.nc-status-pill.is-ready {
    background: #dcfce7;
    color: #166534;
}

.nc-status-pill.is-queued {
    background: #fef3c7;
    color: #92400e;
}

.nc-status-pill.is-failed {
    background: #fee2e2;
    color: #b91c1c;
}

.nc-progress-panel {
    background: var(--surface-base);
    border: 1px solid var(--stroke-subtle);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
}

.nc-progress-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.nc-progress-track {
    height: 10px;
    border-radius: 999px;
    background: var(--surface-muted);
    overflow: hidden;
}

.nc-progress-fill {
    height: 100%;
    background: var(--tone-accent);
    transition: background-color 0.25s ease;
}

.nc-progress-fill.is-completed {
    background: #16a34a;
}

.nc-milestones {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: 0.55rem;
    font-size: 0.74rem;
    color: var(--tone-soft);
}

.nc-steps-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.nc-step-card {
    padding: 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-base);
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.nc-step-card.is-active {
    border-color: var(--tone-accent);
    background: var(--surface-muted);
}

.nc-step-card.is-completed {
    border-color: #86efac;
    background: #f0fdf4;
}

.nc-step-badge {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.nc-step-card.is-active .nc-step-badge {
    background: var(--tone-accent);
    border-color: var(--tone-accent);
    color: #ffffff;
}

.nc-step-card.is-completed .nc-step-badge {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}

.nc-dl-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-radius: 10px;
    border: 1px solid #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.nc-dl-alert[hidden] {
    display: none !important;
}

.nc-dl-alert.is-danger {
    border-color: #dc2626;
    background: #fef2f2;
    color: #b91c1c;
}

.nc-dl-alert-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.nc-dl-alert-btn {
    padding: 0.4rem 0.85rem;
    border-radius: var(--curve-sm);
    border: 1px solid currentColor;
    background: var(--surface-raised);
    color: inherit;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.nc-dl-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: stretch;
}

.nc-dl-action-box {
    background: var(--surface-base);
    border: 1px solid var(--stroke-subtle);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.nc-turnstile-hint {
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: var(--tone-soft);
}

.nc-turnstile-hint.is-verified {
    color: #166534;
    font-weight: 600;
}

.nc-dl-start-btn,
.nc-dl-ready-btn {
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
}

.nc-dl-start-btn {
    background: var(--tone-accent);
    color: #ffffff;
}

.nc-dl-start-btn:hover:not(:disabled) {
    background: var(--tone-accent-deep);
}

.nc-dl-start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nc-dl-ready-btn {
    background: #16a34a;
    color: #ffffff;
}

.nc-dl-ready-btn:hover {
    background: #15803d;
    color: #ffffff;
}

.nc-dl-perks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    font-size: 0.78rem;
    color: var(--tone-soft);
}

.nc-terminal {
    background: var(--surface-stage);
    color: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

.nc-term-head {
    padding: 0.6rem 0.9rem;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.76rem;
}

.nc-term-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nc-term-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
}

.nc-term-body {
    padding: 0.85rem 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.55;
    max-height: 210px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.nc-term-time {
    color: #94a3b8;
}

.nc-term-msg.is-info { color: #a5b4fc; }
.nc-term-msg.is-success { color: #86efac; }
.nc-term-msg.is-warning { color: #fcd34d; }

.nc-dl-notes {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 1.35rem;
}

.nc-dl-notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.nc-note-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.84rem;
    color: var(--tone-soft);
}

.nc-note-item strong {
    display: block;
    color: var(--tone-ink);
    margin-bottom: 0.15rem;
}

.nc-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 999px;
    display: inline-block;
    animation: ncSpin 0.7s linear infinite;
}

@keyframes ncSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
    .nc-steps-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .nc-dl-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .nc-dl-work-card {
        grid-template-columns: 1fr;
    }
    .nc-dl-cover {
        max-width: 140px;
    }
    .nc-steps-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   10. Legal, Contact, Auth, Favorites & Error Pages (Layout D)
   ========================================================================== */
.nc-legal-sheet,
.nc-contact-sheet {
    max-width: 860px;
    margin: 0.5rem auto 1.5rem;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    overflow: hidden;
}

.nc-accent-crest {
    height: 5px;
    background: linear-gradient(90deg, var(--tone-accent) 0%, var(--tone-warm) 100%);
}

.nc-sheet-body {
    padding: clamp(1.35rem, 3.5vw, 2.25rem);
}

.nc-sheet-body h1 {
    font-size: clamp(1.45rem, 2.6vw, 1.95rem);
    margin-bottom: 0.65rem;
}

.nc-sheet-intro {
    margin: 0 0 1.5rem;
    color: var(--tone-soft);
    font-size: 0.95rem;
    max-width: 68ch;
}

.nc-legal-sec + .nc-legal-sec {
    margin-top: 1.5rem;
    padding-top: 1.35rem;
    border-top: 1px solid var(--stroke-subtle);
}

.nc-legal-sec h2 {
    font-size: 1.18rem;
    margin-bottom: 0.65rem;
}

.nc-legal-sec ul {
    margin: 0;
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    color: var(--tone-soft);
    font-size: 0.92rem;
}

/* Contact Email Channels Tint Alignment (Layout D) */
.nc-contact-sheet .site-contact-channel-card {
    background: var(--surface-muted);
    border-color: rgba(67, 56, 202, 0.22);
    border-radius: var(--curve-md);
}

.contact-result,
.bg-green-50 {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.contact-result a {
    color: var(--tone-accent);
    text-decoration: underline;
}

.bg-red-50 {
    background: #fef2f2;
    border: 1px solid #dc2626;
    color: #b91c1c;
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.bg-red-50 ul {
    margin: 0.4rem 0 0 1.15rem;
    padding: 0;
    font-size: 0.84rem;
    font-weight: 500;
}

/* Auth Cards (.nc-auth-panel) */
.nc-auth-panel {
    max-width: 500px;
    margin: 1.5rem auto;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: clamp(1.35rem, 3.5vw, 2rem);
}

.nc-auth-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.nc-auth-head h1 {
    font-size: 1.38rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nc-auth-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--curve-sm);
    border: 1px solid var(--stroke-subtle);
    color: var(--tone-soft);
    font-size: 1.35rem;
    line-height: 1;
}

.nc-auth-close:hover {
    background: var(--surface-muted);
    color: var(--tone-ink);
}

.nc-auth-panel input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.nc-contact-sheet input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.nc-contact-sheet select,
.nc-contact-sheet textarea {
    width: 100%;
    padding: 0.68rem 0.85rem;
    border-radius: var(--curve-sm);
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-raised);
    color: var(--tone-ink);
    font-family: inherit;
    font-size: 0.94rem;
}

.nc-auth-panel input:not([type="checkbox"]):focus,
.nc-contact-sheet input:not([type="checkbox"]):focus,
.nc-contact-sheet select:focus,
.nc-contact-sheet textarea:focus {
    outline: none;
    border-color: var(--tone-accent);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.14);
}

.nc-auth-panel input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--tone-accent);
    cursor: pointer;
    flex-shrink: 0;
}

/* Support <x-auth.remember-device /> utility classes inside .nc-auth-panel */
.nc-auth-panel .mt-4 { margin-top: 1rem; }
.nc-auth-panel .mt-1 { margin-top: 0.2rem; }
.nc-auth-panel .text-sm { font-size: 0.88rem; color: var(--tone-soft); }
.nc-auth-panel .flex { display: flex; }
.nc-auth-panel .items-start { align-items: flex-start; }
.nc-auth-panel .gap-2 { gap: 0.55rem; }
.nc-auth-panel .py-2 { padding: 0.35rem 0; }
.nc-auth-panel .cursor-pointer { cursor: pointer; }

.nc-auth-err {
    margin-top: 0.32rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #dc2626;
}

.nc-auth-footer {
    margin-top: 1.4rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.nc-auth-links {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.nc-auth-links a {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--tone-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.nc-auth-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

/* Favorites & Profile Page */
.nc-profile-card {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.nc-profile-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nc-profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--tone-accent);
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nc-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
    margin-top: 0.35rem;
    font-size: 0.84rem;
    color: var(--tone-soft);
}

.nc-profile-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nc-tabs-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.15rem;
    border-bottom: 1px solid var(--stroke-subtle);
    padding-bottom: 0.65rem;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--stroke-subtle);
    background: var(--surface-raised);
    color: var(--tone-soft);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--surface-muted);
    border-color: var(--tone-accent);
    color: var(--tone-accent) !important;
    font-weight: 700;
}

.nc-fav-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.nc-capacity-card {
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.35rem;
}

.nc-capacity-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.nc-capacity-track {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-muted);
    overflow: hidden;
}

.nc-capacity-bar {
    height: 100%;
    background: var(--tone-accent);
    transition: background-color 0.25s ease;
}

.nc-capacity-note {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: var(--tone-soft);
}

.nc-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #fca5a5;
    background: #fef2f2;
    color: #b91c1c;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.nc-btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.nc-fav-remove-btn {
    border: 0;
    background: transparent;
    color: #b91c1c;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.35rem;
    cursor: pointer;
}

.nc-fav-remove-btn:hover {
    text-decoration: underline;
}

.fav-full-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 75;
    background: rgba(23, 22, 37, 0.65);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.fav-full-modal.show {
    display: flex;
}

.nc-fav-modal-card {
    max-width: 420px;
    width: 100%;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 1.5rem;
    text-align: center;
}

/* Error Pages (403 / 404) */
.nc-error-stage {
    min-height: 76dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.nc-error-card {
    max-width: 460px;
    width: 100%;
    background: var(--surface-raised);
    border: 1px solid var(--stroke-subtle);
    border-radius: var(--curve-md);
    padding: 2.25rem 1.75rem;
    text-align: center;
}

.nc-error-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.8rem;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--tone-accent-deep);
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 800;
    margin-bottom: 0.9rem;
}

.nc-error-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.55rem;
}

.nc-error-card p {
    margin: 0 0 1.4rem;
    color: var(--tone-soft);
    font-size: 0.92rem;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
