.np-page {
    --np-gutter: clamp(12px, 3vw, 24px);
}
.np-container,
.np-container *,
.np-container *::before,
.np-container *::after,
.np-header * { box-sizing: border-box; }

.np-header {
    gap: clamp(10px, 1.8vw, 24px);
}
.np-header .main-nav { gap: clamp(12px, 1.4vw, 24px); }
.np-header .np-site-search { min-width: 100px; }
.np-header .np-account { flex: none; gap: 8px; }
.np-account > a { white-space: nowrap; }
.np-header .np-account > a[href^="/auth/"] {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    margin-left: 0;
}
.np-header #global-search-input::placeholder { color: var(--g-muted); }

.np-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
}
.np-profile .profile-avatar { width: 36px; height: 36px; }
.np-profile span {
    max-width: clamp(80px, 10vw, 150px);
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .85rem;
    font-weight: 700;
}
.np-header #bell-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 0;
    background: transparent;
}
.np-header #notification-dot { top: 7px; right: 7px; }

.np-container {
    max-width: 1200px;
    padding-inline: var(--np-gutter);
    margin: 0 auto clamp(36px, 6vw, 80px);
    color: var(--g-text);
}
.np-container [hidden] { display: none !important; }
.np-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    font-size: .8rem;
    color: var(--g-muted);
}
.np-breadcrumb a { text-decoration: none; }
.np-breadcrumb a:hover { text-decoration: underline; }
.np-breadcrumb [aria-current] { color: var(--g-text); }
.np-breadcrumb [aria-hidden] { color: var(--g-dim); }

.np-discover,
.np-novel-header {
    display: grid;
    gap: clamp(16px, 3.5vw, 40px);
    align-items: center;
    padding: clamp(16px, 3vw, 32px);
    border: 1px solid var(--g-line);
    border-radius: var(--g-radius-l);
    background: var(--g-surface);
}
.np-discover { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
.np-eyebrow {
    color: var(--g-muted);
    font-weight: 700;
    font-size: .72rem;
    letter-spacing: .09em;
    line-height: 1.5;
    margin: 0 0 10px;
}
.np-container h1 {
    margin: 0;
    color: var(--g-text);
    overflow-wrap: anywhere;
}
.np-discover h1 { font-size: clamp(1.75rem, 3.3vw, 2.6rem); line-height: 1.16; }
.np-intro {
    max-width: 48ch;
    margin: 10px 0 0;
    color: var(--g-muted);
    line-height: 1.6;
    font-size: clamp(.88rem, 1.35vw, 1rem);
}
.np-url {
    padding: clamp(12px, 1.8vw, 20px);
    background: var(--g-surface-2);
    border: 1px solid var(--g-line);
    border-radius: var(--g-radius-m);
}
.np-url label { font-size: .95rem; font-weight: 800; }
.np-url p { color: var(--g-muted); font-size: .8rem; margin: 6px 0 14px; }
.np-input-row { display: flex; gap: 8px; }
.np-input-row input { flex: 1 1 0; }

.np-container input,
.np-container select,
.np-button {
    min-height: 44px;
    min-width: 0;
    border: 1px solid var(--g-line-strong);
    border-radius: 9px;
    padding: 10px 12px;
    background: var(--g-surface);
    color: var(--g-text);
    font: inherit;
    font-size: .875rem;
}
.np-container input::placeholder { color: var(--g-muted); }
.np-container input:disabled,
.np-container select:disabled { opacity: .55; }
.np-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--g-raised);
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}
.np-button:hover { background: var(--g-hover); }
.np-button.np-primary { color: #fff; border-color: var(--g-action-line); background: var(--g-action); }
.np-button.np-primary:hover { background: var(--g-action-hover); }
.np-button:disabled {
    background: var(--g-surface-2);
    border-color: var(--g-line);
    color: var(--g-muted);
    cursor: not-allowed;
}

.np-library { margin-top: clamp(28px, 4vw, 46px); }
.np-section-heading,
.np-results-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0 12px;
}
.np-section-heading h2 { font-size: clamp(1.3rem, 2.4vw, 1.8rem); margin: 0; }
.np-section-heading span,
.np-results-heading span { font-size: .78rem; color: var(--g-muted); }
.np-filter-panel,
.np-details {
    border: 1px solid var(--g-line);
    border-radius: var(--g-radius-l);
    background: var(--g-surface);
}
.np-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px clamp(10px, 2vw, 20px);
    border-bottom: 1px solid var(--g-line);
}
.np-categories button,
.np-detail-tabs button {
    padding: 8px 14px;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--g-muted);
    font-size: .875rem;
    font-weight: 700;
    cursor: pointer;
}
.np-categories button:hover,
.np-detail-tabs button:hover { background: var(--g-surface-2); color: var(--g-text); }
.np-categories button[aria-pressed="true"] {
    border-color: var(--g-line-strong);
    background: var(--g-raised);
    color: var(--g-text);
}
.np-filter-body { padding: 12px clamp(12px, 2vw, 20px); }
.np-filter-body label { display: grid; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--g-muted); }
.np-filter-body > label { margin-bottom: 6px; }
.np-advanced { margin-top: 4px; }
.np-advanced summary {
    display: list-item;
    width: fit-content;
    padding: 12px 0;
    color: var(--g-text);
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}
.np-advanced summary::marker { color: var(--g-muted); }
.np-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
    gap: 10px;
}
.np-apply { margin-top: 10px; }
.np-results-heading { margin-top: 26px; scroll-margin-top: 74px; }
.np-results-heading h3 { font-size: 1rem; margin: 0; }
.np-status {
    border: 1px solid var(--g-line);
    border-radius: 12px;
    background: var(--g-surface);
    margin: 0 0 14px;
    padding: 14px 16px;
    font-size: .875rem;
    color: var(--g-muted);
    line-height: 1.55;
}
.np-status:empty { display: none; }
#np-detail + .np-status { margin: 14px 0 0; }

.np-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 138px), 1fr));
    gap: 14px;
}
.np-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: var(--g-radius-s);
    color: var(--g-text);
    text-decoration: none;
}
.np-card:hover .np-card-cover { border-color: var(--g-line-strong); }
.np-card-cover,
.np-novel-cover {
    position: relative;
    aspect-ratio: 5 / 7;
    overflow: hidden;
    border: 1px solid var(--g-line);
    border-radius: var(--g-radius-s);
    background: var(--g-surface-2);
}
.np-card-cover img,
.np-novel-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.np-card img { transition: transform .2s ease; }
.np-card:hover img { transform: scale(1.035); }
.np-card h4 {
    margin: 7px 2px 0;
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.np-age {
    position: absolute;
    inset: auto 0 0;
    display: grid;
    place-content: center;
    height: 100%;
    color: var(--g-muted);
    background: var(--g-surface-2);
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: .06em;
}
.np-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2vw, 20px);
    margin-top: 26px;
    font-size: .83rem;
    color: var(--g-muted);
}

.np-novel-header { grid-template-columns: clamp(140px, 22vw, 220px) minmax(0, 1fr); align-items: start; }
.np-novel-info { align-self: center; }
.np-novel-info h1 { font-size: clamp(1.5rem, 3.2vw, 2.5rem); line-height: 1.18; word-break: keep-all; }
.np-meta,
.np-tags,
.np-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.np-meta {
    gap: 6px 16px;
    align-items: center;
    margin-top: 14px;
    color: var(--g-muted);
    font-size: .875rem;
}
#np-author { color: var(--g-text); font-weight: 700; overflow-wrap: anywhere; }
.np-tags {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}
.np-tags li {
    border: 1px solid var(--g-line-strong);
    border-radius: 999px;
    background: var(--g-surface-2);
    padding: 5px 10px;
    color: var(--g-muted);
    font-size: .76rem;
    overflow-wrap: anywhere;
}
.np-actions { margin-top: 22px; }
.np-note { margin: 10px 0 0; color: var(--g-muted); font-size: .8rem; line-height: 1.55; }
.np-details { margin-top: 16px; }
.np-detail-tabs {
    display: flex;
    gap: 8px;
    padding: 6px 12px 0;
    border-bottom: 1px solid var(--g-line);
}
.np-detail-tabs button {
    position: relative;
    padding-inline: clamp(10px, 2vw, 20px);
    border-radius: 8px 8px 0 0;
}
.np-detail-tabs button[aria-selected="true"] { color: var(--g-text); }
.np-detail-tabs button[aria-selected="true"]::after {
    content: "";
    position: absolute;
    inset: auto 8px 0;
    border-bottom: 2px solid var(--g-focus);
}
.np-tab-panel { padding: clamp(14px, 3vw, 28px); }
#np-description {
    max-width: 72ch;
    margin: 0;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.np-episodes { list-style: none; padding: 0; margin: 0; }
.np-episodes li + li { border-top: 1px solid var(--g-line); }
.np-episodes a {
    display: grid;
    grid-template-columns: minmax(86px, 7rem) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: baseline;
    min-height: 48px;
    padding: 13px 8px;
    border-radius: 6px;
    text-decoration: none;
    font-size: .87rem;
    overflow-wrap: anywhere;
}
.np-episodes a:hover { background: var(--g-surface-2); }
.np-episode-number,
.np-episode-arrow { color: var(--g-muted); }
.np-more { margin-top: 14px; }

@media (max-width: 1200px) {
    .np-header .np-profile span { display: none; }
}
@media (max-width: 768px) {
    .np-header .main-nav,
    .np-header .np-account > a.np-register,
    .np-header #bell-icon { display: none; }
    .np-header .np-site-search,
    .np-header .np-account { display: flex; }
    .np-header { flex-flow: row nowrap; min-height: 56px; }
    .np-header .np-site-search { max-width: 420px; min-width: 0; }
    .np-header .search-input-wrapper { width: 100%; }
    .np-header #global-search-input { font-size: 16px; }
    .np-page { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .np-page .mobile-nav-item:focus-visible { outline: 2px solid var(--g-focus) !important; outline-offset: -3px; }
    .np-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
    .np-card h4 {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        font-size: .75rem;
    }
}
@media (max-width: 640px) {
    .np-header { padding: 8px 14px; }
    .np-header a[href="/auth/login"] { padding: 7px 10px !important; }
    .np-breadcrumb { min-height: 42px; }
    .np-discover { grid-template-columns: 1fr; }
    .np-intro { margin-top: 10px; }
    .np-filter-body input, .np-filter-body select, .np-url input { font-size: 16px; }
    .np-categories button { padding-inline: 10px; font-size: .8rem; }
    .np-novel-header {
        grid-template-columns: clamp(84px, 26vw, 128px) minmax(0, 1fr);
        gap: 14px;
        align-items: center;
    }
    .np-novel-info { display: contents; }
    .np-novel-info > :not(.np-title-block) { grid-column: 1 / -1; margin-top: 0; }
    .np-actions .np-button { flex: 1 1 115px; }
}
@media (max-width: 480px) {
    .np-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
    .np-url .np-input-row { flex-direction: column; }
    .np-categories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .np-categories button { padding-inline: 3px; }
    .np-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
