/*
 * MOBILE CSS ONLY
 * Chỉ dùng cho giao diện mobile public website.
 * Desktop layout đã ổn, không sửa desktop ở đây.
 * File này dùng lại CSS variables từ app.css.
 */

@media (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100%;
    }

    body:not(.reader-body) {
        background: var(--color-bg);
    }

    body:not(.reader-body) .site-nav-row {
        display: none !important;
    }

    body:not(.reader-body) .site-search-form {
        display: none !important;
    }

    body:not(.reader-body) .site-header-top {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }

    body:not(.reader-body) .site-header-inner {
        padding: 0.55rem 0.75rem;
    }

    body:not(.reader-body) .request-desktop-view,
    body:not(.reader-body) .info-desktop-view {
        display: none !important;
    }

    body:not(.reader-body) .request-mobile-view,
    body:not(.reader-body) .info-mobile-view {
        display: block !important;
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    body:not(.reader-body) .site-nav-ticker--mobile {
        display: block !important;
        width: calc(100% - 32px);
        margin: 12px 16px 20px;
        padding: 14px 16px;
        min-height: 52px;
        border: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--color-border) 82%);
        border-radius: 16px;
        background: var(--color-primary-soft);
        color: var(--color-primary);
        box-sizing: border-box;
        position: relative;
        overflow: hidden;
    }

    html[data-theme='dark'] .site-nav-ticker--mobile,
    .theme-dark .site-nav-ticker--mobile {
        background: var(--color-surface-soft);
        border-color: color-mix(in srgb, var(--color-primary) 18%, var(--color-border) 82%);
        color: var(--color-primary);
    }

    body:not(.reader-body) .site-nav-ticker--mobile::before {
        content: '\1F514';
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1rem;
        line-height: 1;
        color: var(--color-primary-dark);
    }

    body:not(.reader-body) .site-nav-ticker--mobile .site-nav-ticker-item {
        display: none;
        width: 100%;
        min-width: 0;
        padding-left: 28px;
        overflow: hidden;
        white-space: normal;
        word-break: break-word;
        font-size: 1rem;
        font-weight: 700;
        line-height: 1.45;
        text-align: left;
        color: inherit;
        text-decoration: none;
    }

    body:not(.reader-body) .site-nav-ticker--mobile .site-nav-ticker-item.is-active {
        display: block;
    }

    body:not(.reader-body) .site-nav-ticker--mobile .site-nav-ticker-item:focus-visible,
    body:not(.reader-body) .site-nav-ticker--mobile .site-nav-ticker-item:hover {
        outline: none;
        text-decoration: underline;
    }

    body:not(.reader-body) .contact-social-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    body:not(.reader-body) .site-footer-social {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    body:not(.reader-body) .site-footer-social-link {
        min-width: 44px;
        width: 44px;
        height: 44px;
    }

}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    body:not(.reader-body) .site-nav-ticker--mobile {
        transition: none;
    }
}

@media (max-width: 768px) {
    body:not(.reader-body) .site-brand {
        font-size: 1rem;
        max-width: calc(100% - 11rem);
        min-width: 0;
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body:not(.reader-body) .site-header-logo {
        max-height: 42px;
    }

    body:not(.reader-body) .site-header-actions {
        flex: 0 0 auto;
        width: auto !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end;
        align-items: center !important;
        gap: 0.4rem;
    }

    body:not(.reader-body) .mobile-header-search-button.mobile-only-element {
        display: inline-flex !important;
    }

    body:not(.reader-body) .home-panels--desktop {
        display: none !important;
    }

    body:not(.reader-body) .home-panels--mobile,
    body:not(.reader-body) .mobile-home-panels {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    body:not(.reader-body) .mobile-only-panel-shell {
        display: block !important;
    }

    body:not(.reader-body) .request-page .page-hero,
    body:not(.reader-body) .info-page .info-hero {
        margin-bottom: 0.8rem;
        padding: 0.9rem;
        border-radius: 14px;
    }

    body:not(.reader-body) .info-page .info-hero {
        padding: 14px;
        margin-bottom: 14px;
        min-height: 0;
    }

    body:not(.reader-body) .info-page .info-eyebrow {
        margin: 0 0 4px;
        font-size: 0.72rem;
        line-height: 1.2;
    }

    body:not(.reader-body) .info-page .info-hero h1 {
        margin: 0 0 4px;
        font-size: 1.25rem;
        line-height: 1.25;
    }

    body:not(.reader-body) .info-page .info-hero > p:last-child {
        margin: 0;
        font-size: 0.8rem;
        line-height: 1.45;
    }

    body:not(.reader-body) .request-page .request-toolbar {
        display: none !important;
    }

    body:not(.reader-body) .request-page .page-hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 14px;
        margin-bottom: 14px;
        min-height: 0;
    }

    body:not(.reader-body) .request-page .page-hero > div {
        min-width: 0;
    }

    body:not(.reader-body) .request-page .page-hero h1,
    body:not(.reader-body) .info-page .info-hero h1 {
        font-size: 1.35rem;
        line-height: 1.15;
    }

    body:not(.reader-body) .request-page .page-hero h1 {
        margin: 0 0 4px;
        font-size: 1.2rem;
        line-height: 1.25;
    }

    body:not(.reader-body) .request-page .page-hero p,
    body:not(.reader-body) .info-page .info-hero p {
        margin-top: 0.4rem;
        font-size: 0.84rem;
        line-height: 1.5;
    }

    body:not(.reader-body) .request-page .page-hero .muted {
        margin: 0;
        font-size: 0.78rem;
        line-height: 1.4;
    }

    body:not(.reader-body) .request-page .page-hero .request-open-modal {
        width: auto;
        min-width: 92px;
        padding: 9px 12px;
        white-space: nowrap;
        align-self: center;
    }

    body:not(.reader-body) .request-page .request-mobile-view {
        margin-top: 0;
    }

    body:not(.reader-body) .mobile-header-search-button,
    body:not(.reader-body) .site-mode-button {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        border-radius: 999px;
        border: 1px solid var(--color-border);
        background: var(--color-surface);
    }

    body:not(.reader-body) .mobile-header-search-button {
        color: var(--color-primary);
    }
}

@media (max-width: 640px) {
    .profile-web-push__body {
        padding: 14px;
    }

    .profile-web-push__status {
        margin-bottom: 10px;
        font-size: 14px;
        line-height: 1.4;
    }

    .profile-web-push__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .profile-web-push__button {
        min-height: 38px;
        padding: 8px 10px;
        border-radius: 999px;
        font-size: 13px;
        line-height: 1.2;
    }

    .profile-web-push__message {
        margin-top: 8px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .profile-web-push__actions {
        grid-template-columns: 1fr;
    }
}


    body:not(.reader-body) .site-mode-button {
        background: var(--color-surface);
        color: var(--color-text);
    }

    body:not(.reader-body) .mobile-header-search-button svg,
    body:not(.reader-body) .site-mode-button svg,
    .site-icon-button svg,
    .site-account-button svg {
        width: 18px;
        height: 18px;
        display: block;
    }

    body:not(.reader-body) .site-login-link {
        height: 42px;
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 1rem;
        line-height: 1;
        border-radius: 999px;
        white-space: nowrap;
        transform: none;
        margin: 0;
    }

    .app-shell {
        min-height: 100dvh;
    }

    .site-header {
        position: sticky;
        top: 0;
        z-index: 80;
        background: color-mix(in srgb, var(--color-surface) 94%, transparent);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--color-border);
    }

    .site-icon-button,
    .site-account-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 0;
        border-radius: 999px;
        line-height: 1;
        box-sizing: border-box;
    }

    .site-icon-button.notification-button {
        position: relative;
    }

    .site-login-link {
        min-width: 38px;
        height: 38px;
        padding: 0;
        border-radius: 999px;
    }

    .site-account-button {
        font-size: 0;
        overflow: hidden;
        color: transparent;
        gap: 0;
    }

    .site-account-button svg {
        width: 18px;
        height: 18px;
        display: block;
        color: var(--color-text);
        flex: 0 0 auto;
        margin: 0;
    }

    .notification-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        background: var(--color-primary);
        color: var(--color-on-primary);
        font-size: 0.65rem;
        font-weight: 800;
        line-height: 1;
    }

    .site-login-link {
        padding-inline: 0.75rem;
        width: auto;
        color: var(--color-surface);
        background: var(--color-primary);
        border-color: var(--color-primary);
        font-size: 0.82rem;
    }

    .site-container,
    .page-container {
        padding-inline: 0.75rem;
    }

    body:not(.reader-body) .tag-page .tag-story-grid,
    body:not(.reader-body) .tag-page .stories-grid,
    body:not(.reader-body) .tag-page .home-story-grid {
        padding-inline: 1rem;
        box-sizing: border-box;
    }

    body:not(.reader-body) .tag-filter-panel--desktop {
        display: none !important;
    }

    body:not(.reader-body) .mobile-tag-filter {
        display: grid !important;
        gap: 0.45rem;
        padding-inline: 1rem;
        margin: 0.75rem 0 1rem;
    }

    body:not(.reader-body) .mobile-tag-filter-bar {
        width: 100%;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.65rem 0.85rem;
        border-radius: 18px;
        border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
        background: var(--color-primary-soft);
        color: var(--color-primary);
        box-shadow: 0 8px 18px color-mix(in srgb, var(--color-primary) 6%, transparent);
        font-weight: 900;
        cursor: pointer;
        text-align: left;
    }

    body:not(.reader-body) .mobile-tag-filter-bar__main {
        min-width: 0;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

    body:not(.reader-body) .mobile-tag-filter-bar__icon {
        width: 30px;
        height: 30px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        color: var(--color-primary);
        flex: 0 0 auto;
    }

    body:not(.reader-body) .request-mobile-list,
    body:not(.reader-body) .info-mobile-list {
        display: grid;
        gap: 0.55rem;
    }

    body:not(.reader-body) .info-mobile-list {
        border: 1px solid var(--color-border);
        border-radius: 12px;
        overflow: hidden;
        background: var(--color-surface);
        gap: 0;
    }

    body:not(.reader-body) .info-page .info-pagination {
        gap: 6px;
        margin: 14px 0 0;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    body:not(.reader-body) .info-page .info-pagination__item {
        min-width: 34px;
        min-height: 34px;
        padding: 5px 8px;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    body:not(.reader-body) .request-mobile-item {
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr) 72px;
        align-items: center;
        gap: 0.65rem;
        min-height: 76px;
        padding: 0.65rem 0.75rem;
        border: 1px solid var(--color-border);
        border-radius: 12px;
        background: var(--color-surface);
    }

    body:not(.reader-body) .request-mobile-item--top {
        border-left: 4px solid var(--color-primary);
        background: color-mix(in srgb, var(--color-primary-soft) 24%, var(--color-surface) 76%);
    }

    body:not(.reader-body) .request-mobile-rank {
        font-size: 0.82rem;
        font-weight: 900;
        text-align: center;
        color: var(--color-primary);
    }

    body:not(.reader-body) .request-mobile-content {
        min-width: 0;
    }

    body:not(.reader-body) .request-mobile-title {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        font-size: 0.9rem;
        line-height: 1.25;
        font-weight: 800;
        color: var(--color-text);
        text-decoration: none;
    }

    body:not(.reader-body) .request-mobile-meta {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.3rem 0.5rem;
        margin-top: 0.3rem;
        font-size: 0.72rem;
        color: var(--color-text-secondary);
    }

    body:not(.reader-body) .request-mobile-action {
        min-width: 0;
        display: grid;
        justify-items: stretch;
        gap: 0.35rem;
    }

    body:not(.reader-body) .request-mobile-votes {
        font-size: 0.72rem;
        font-weight: 800;
        text-align: center;
        color: var(--color-primary);
    }

    body:not(.reader-body) .request-mobile-action button,
    body:not(.reader-body) .request-mobile-action .button {
        width: 100%;
        min-height: 32px;
        padding: 0.35rem 0.4rem;
        border-radius: var(--radius-sm);
        font-size: 0.74rem;
    }

    body:not(.reader-body) .info-mobile-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        min-height: 68px;
        padding: 11px 13px;
        color: var(--color-text);
        text-decoration: none;
        border-bottom: 1px solid var(--color-border);
        background: var(--color-surface);
    }

    body:not(.reader-body) .info-mobile-item:last-child {
        border-bottom: 0;
    }

    body:not(.reader-body) .info-mobile-content {
        min-width: 0;
    }

    body:not(.reader-body) .info-mobile-title-row {
        display: flex;
        align-items: flex-start;
        gap: 6px;
        min-width: 0;
    }

    body:not(.reader-body) .info-mobile-pin {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 16px;
        height: 16px;
    }

    body:not(.reader-body) .info-mobile-pin svg {
        width: 14px;
        height: 14px;
    }

    body:not(.reader-body) .info-mobile-item--pinned {
        border-left: 4px solid var(--color-primary);
    }

    body:not(.reader-body) .info-mobile-title {
        display: -webkit-box;
        margin: 0;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        font-size: 0.9rem;
        line-height: 1.3;
        color: var(--color-text);
    }

    body:not(.reader-body) .info-mobile-date {
        display: block;
        margin-top: 4px;
        font-size: 0.72rem;
        line-height: 1.25;
        color: var(--color-muted);
    }

    body:not(.reader-body) .info-mobile-link {
        font-size: 0.78rem;
        font-weight: 800;
        color: var(--color-primary);
        white-space: nowrap;
    }

    body:not(.reader-body) .info-post-detail {
        padding: 14px;
    }

    body:not(.reader-body) .info-post-detail .info-post-detail__header {
        padding: 14px;
        margin-bottom: 14px;
        min-height: 0;
    }

    body:not(.reader-body) .info-post-detail .page-heading__title {
        margin: 0;
        font-size: 1.3rem;
        line-height: 1.35;
    }

    body:not(.reader-body) .info-post-detail .page-heading__lead {
        margin: 5px 0 0;
        font-size: 0.75rem;
        line-height: 1.3;
    }

    body:not(.reader-body) .info-post-content {
        font-size: 0.94rem;
        line-height: 1.7;
        overflow-wrap: anywhere;
    }

/* Soft Aura mobile: ensure padding inside panel without causing horizontal scroll
   Applies only to public layout and when soft_aura is active (not reader). */
@media (max-width: 768px) {
    html[data-layout="public"]
    body[data-visual-effect="soft_aura"]:not(.reader-body)
    .info-post-content {
        padding: 14px;
        box-sizing: border-box;
    }

    html[data-layout="public"]
    body[data-visual-effect="soft_aura"]:not(.reader-body)
    .info-post-content > :first-child {
        margin-top: 0;
    }

    html[data-layout="public"]
    body[data-visual-effect="soft_aura"]:not(.reader-body)
    .info-post-content > :last-child {
        margin-bottom: 0;
    }
}

    body:not(.reader-body) .info-post-content img {
        max-width: 100%;
        height: auto;
    }

    body:not(.reader-body) .info-post-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }

    @media (max-width: 320px) {
        body:not(.reader-body) .request-mobile-item {
            grid-template-columns: 26px minmax(0, 1fr) 64px;
        }
    }

    body:not(.reader-body) .mobile-tag-filter-bar__label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.95rem;
    }

    .protected-paragraph-image-wrap {
        width: 100%;
        overflow-x: hidden;
        margin: 1rem auto;
    }

    .protected-paragraph-image {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        object-fit: contain;
        margin: 1rem auto;
        border-radius: 0.5rem;
    }

    body:not(.reader-body) .mobile-tag-filter-bar__count {
        flex: 0 0 auto;
        min-width: 36px;
        min-height: 28px;
        padding: 0.25rem 0.55rem;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--color-primary);
        color: var(--button-primary-text);
        font-size: 0.78rem;
        font-weight: 900;
    }

    body:not(.reader-body) .mobile-tag-filter-chips {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 0.4rem;
        overflow-x: auto;
        padding: 0.1rem 0.05rem 0.2rem;
        border: 0;
        background: transparent;
        text-align: left;
        cursor: pointer;
        -webkit-overflow-scrolling: touch;
    }

    body:not(.reader-body) .mobile-tag-filter-chips::-webkit-scrollbar {
        display: none;
    }

    body:not(.reader-body) .mobile-tag-filter-chip {
        flex: 0 0 auto;
        max-width: 9rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        padding: 0.35rem 0.7rem;
        border-radius: 999px;
        background: var(--color-surface);
        border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
        color: var(--color-primary);
        font-size: 0.78rem;
        font-weight: 800;
    }

    body:not(.reader-body) .mobile-tag-filter-chip--more {
        background: var(--color-primary);
        color: var(--color-on-primary);
        border-color: var(--color-primary-dark);
    }

    body:not(.reader-body) .mobile-tag-filter__open {
        display: none !important;
    }

    body:not(.reader-body) .mobile-tag-filter__count {
        background: color-mix(in srgb, var(--color-surface) 18%, transparent);
        border-radius: 999px;
        padding: 0.2rem 0.75rem;
        font-size: 0.85rem;
        font-weight: 700;
    }

    body:not(.reader-body) .mobile-tag-filter__sheet[hidden] {
        display: none !important;
    }

    body:not(.reader-body) .mobile-tag-filter__sheet {
        position: fixed;
        inset: 0;
        z-index: 180;
    }

    body:not(.reader-body) .mobile-tag-filter__backdrop {
        position: absolute;
        inset: 0;
        background: color-mix(in srgb, var(--color-text) 42%, transparent);
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 82vh;
        overflow: auto;
        border-radius: 24px 24px 0 0;
        background: var(--color-bg-page);
        border: 1px solid var(--color-border);
        box-shadow: 0 -18px 42px color-mix(in srgb, var(--color-text) 22%, transparent);
        display: grid;
        grid-template-rows: auto 1fr auto;
    }

    body:not(.reader-body) .mobile-tag-filter__header,
    body:not(.reader-body) .mobile-tag-filter__footer {
        position: sticky;
        background: var(--color-bg-page);
        z-index: 1;
        padding: 1rem;
    }

    body:not(.reader-body) .mobile-tag-filter__header {
        top: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--color-border);
    }

    body:not(.reader-body) .mobile-tag-filter__mode {
        display: grid;
        gap: 0.75rem;
        padding: 1rem;
    }

    body:not(.reader-body) .mobile-tag-filter__mode label {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        padding: 0.85rem 1rem;
        border-radius: 14px;
        border: 1px solid var(--color-border);
        background: var(--color-surface);
        cursor: pointer;
        color: var(--color-text);
        font-weight: 700;
    }

    body:not(.reader-body) .mobile-tag-filter__mode input {
        accent-color: var(--color-primary);
    }

    body:not(.reader-body) .mobile-tag-filter__groups {
        display: grid;
        gap: 0.75rem;
        padding: 1rem;
    }

    body:not(.reader-body) .mobile-tag-group {
        border: 1px solid var(--color-border);
        border-radius: 18px;
        background: var(--color-surface);
        overflow: hidden;
    }

    body:not(.reader-body) .mobile-tag-group__header {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 1rem;
        border: none;
        background: transparent;
        color: var(--color-text);
        font-weight: 800;
        cursor: pointer;
    }

    body:not(.reader-body) .mobile-tag-group__body {
        padding: 0 1rem 1rem;
        display: grid;
        gap: 0.65rem;
    }

    body:not(.reader-body) .mobile-tag-filter-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    body:not(.reader-body) .mobile-tag-filter__tag {
        display: inline-flex;
        align-items: center;
        min-height: 36px;
        padding: 0.35rem 0.75rem;
        border-radius: 999px;
        border: 1px solid var(--color-border);
        background: var(--color-surface);
        color: var(--color-text);
        font-weight: 700;
        gap: 0.45rem;
        cursor: pointer;
        user-select: none;
    }

    body:not(.reader-body) .mobile-tag-filter__tag input {
        margin: 0;
        width: 16px;
        height: 16px;
    }

    body:not(.reader-body) .mobile-tag-filter__tag.is-selected {
        background: var(--color-primary);
        color: var(--button-primary-text);
        border-color: var(--color-primary-dark);
    }

    body:not(.reader-body) .mobile-tag-filter__footer {
        bottom: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        border-top: 1px solid var(--color-border);
    }

    body:not(.reader-body) .mobile-tag-filter__footer button {
        min-height: 48px;
        border-radius: 14px;
        border: 1px solid var(--color-border);
        background: var(--color-surface);
        color: var(--color-text);
        font-weight: 700;
        cursor: pointer;
    }

    body:not(.reader-body) .mobile-tag-filter__footer button:last-child {
        background: var(--color-primary);
        color: var(--button-primary-text);
        border-color: var(--color-primary);
    }

    body:not(.reader-body) .mobile-tag-filter__tag.tag-chip-disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }

    body:not(.reader-body) .tag-chip-count {
        font-size: 0.75rem;
        color: var(--color-muted);
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        padding-bottom: 1rem;
    }

    body:not(.reader-body) .mobile-tag-filter__sheet.is-open .mobile-tag-filter__panel {
        transform: translateY(0);
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        transform: translateY(100%);
        transition: transform 180ms ease-out;
    }

    body:not(.reader-body) .mobile-tag-filter__sheet.is-open .mobile-tag-filter__panel {
        transform: translateY(0);
    }

    body:not(.reader-body) .mobile-tag-filter__sheet:not(.is-open) .mobile-tag-filter__panel {
        transform: translateY(100%);
    }

    body:not(.reader-body) .mobile-tag-filter__open {
        text-align: left;
    }

    body:not(.reader-body) .mobile-tag-filter__mode {
        padding: 1rem;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        padding-top: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__panel .mobile-tag-filter__header {
        padding-top: 1rem;
    }

    body:not(.reader-body) .mobile-tag-filter__panel .mobile-tag-filter__footer {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    body:not(.reader-body) .mobile-tag-filter__groups {
        padding-bottom: 1rem;
    }

    body:not(.reader-body) .mobile-tag-filter__sheet {
        padding-top: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__open {
        display: flex;
    }

    body:not(.reader-body) .mobile-tag-filter__footer button {
        width: 100%;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        max-height: 84vh;
    }

    body:not(.reader-body) .mobile-tag-filter__header button,
    body:not(.reader-body) .mobile-tag-filter__footer button {
        font-weight: 800;
    }

    body:not(.reader-body) .mobile-tag-filter__mode label {
        min-height: 48px;
    }

    body:not(.reader-body) .mobile-tag-group__header span:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body:not(.reader-body) .mobile-tag-filter__sheet {
        display: block;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        padding-bottom: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__footer {
        position: sticky;
    }

    body:not(.reader-body) .mobile-tag-filter__footer {
        z-index: 2;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        overflow-y: auto;
    }

    body:not(.reader-body) .mobile-tag-filter__mode {
        margin-top: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__mode label {
        border-radius: 14px;
    }

    body:not(.reader-body) .mobile-tag-filter__header button,
    body:not(.reader-body) .mobile-tag-filter__footer button {
        border-radius: 14px;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    body:not(.reader-body) .mobile-tag-filter__footer {
        gap: 0.75rem;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        padding-top: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        min-height: auto;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        border-radius: 24px 24px 0 0;
    }

    body:not(.reader-body) .mobile-tag-filter__groups {
        padding-bottom: 1rem;
    }

    body:not(.reader-body) .mobile-tag-filter__is-selected {
        background: var(--color-primary);
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        background: var(--color-bg-page);
    }

    body:not(.reader-body) .mobile-tag-filter__groups {
        margin-bottom: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__mode label input {
        margin-left: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__mode label {
        gap: 0.75rem;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        box-shadow: 0 -18px 42px color-mix(in srgb, var(--color-text) 22%, transparent);
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        padding: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__groups {
        padding: 1rem;
    }

    body:not(.reader-body) .mobile-tag-filter__tag {
        width: auto;
    }

    body:not(.reader-body) .mobile-tag-filter__tag input {
        width: 18px;
        height: 18px;
    }

    body:not(.reader-body) .mobile-tag-filter__tag .tag-chip-count {
        margin-left: 0.35rem;
    }

    body:not(.reader-body) .mobile-tag-filter__footer button:first-child {
        background: var(--color-surface);
    }

    body:not(.reader-body) .mobile-tag-filter__footer button:last-child {
        background: var(--color-primary);
        color: var(--color-on-primary);
        border-color: var(--color-primary);
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        padding-top: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__sheet {
        padding-top: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__header {
        padding: 1rem;
    }

    body:not(.reader-body) .mobile-tag-filter__footer {
        padding: 1rem;
    }

    body:not(.reader-body) .mobile-tag-filter__open {
        padding: 0.85rem 1rem;
    }

    body:not(.reader-body) .mobile-tag-filter__tag {
        padding: 0.35rem 0.75rem;
    }

    body:not(.reader-body) .mobile-tag-filter__group {
        margin: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        overflow-x: hidden;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        min-height: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__body {
        max-height: none;
    }

    body:not(.reader-body) .mobile-tag-filter__groups {
        gap: 0.85rem;
    }

    body:not(.reader-body) .mobile-tag-filter__mode label {
        min-height: 48px;
    }

    body:not(.reader-body) .mobile-tag-filter__mode {
        margin: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__groups {
        padding: 1rem;
    }

    body:not(.reader-body) .mobile-tag-filter__footer {
        border-top: 1px solid var(--color-border);
    }

    body:not(.reader-body) .mobile-tag-filter__header {
        border-bottom: 1px solid var(--color-border);
    }

    body:not(.reader-body) .mobile-tag-filter__footer {
        gap: 0.75rem;
    }

    body:not(.reader-body) .mobile-tag-filter__sheet {
        z-index: 190;
    }

    body:not(.reader-body) .mobile-tag-filter__open {
        width: 100%;
    }

    body:not(.reader-body) .mobile-tag-filter__mode {
        gap: 0.75rem;
    }

    body:not(.reader-body) .mobile-tag-filter__groups {
        gap: 0.75rem;
    }

    body:not(.reader-body) .mobile-tag-filter__tag {
        min-width: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__tag input {
        flex-shrink: 0;
    }

    body:not(.reader-body) .mobile-tag-filter__tag.is-selected {
        color: var(--button-primary-text);
    }

    body:not(.reader-body) .mobile-tag-filter__tag.is-selected .tag-chip-count {
        color: var(--button-primary-text);
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        background: var(--color-bg-page);
    }

    body:not(.reader-body) .mobile-tag-filter__footer button {
        font-weight: 800;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        border-top: 1px solid var(--color-border);
    }

    body:not(.reader-body) .mobile-tag-filter__mode label {
        width: 100%;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    body:not(.reader-body) .mobile-tag-filter__footer {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    body:not(.reader-body) .mobile-tag-filter__open {
        font-size: 0.95rem;
    }

    body:not(.reader-body) .mobile-tag-filter__sheet {
        overflow: hidden;
    }

    body:not(.reader-body) .mobile-tag-filter__panel {
        min-height: 0;
    }

    .site-footer {
        margin-top: 1.25rem;
        padding-bottom: calc(82px + env(safe-area-inset-bottom));
    }

    .site-footer-inner {
        min-height: auto;
        padding: 0.9rem 0.75rem;
        gap: 0.5rem;
    }

    .site-footer-nav {
        display: none;
    }

    .site-footer-brand span,
    .site-footer-meta {
        font-size: 0.78rem;
    }

    body:not(.reader-body) .mobile-bottom-nav.mobile-only-element {
        --mobile-nav-bg: color-mix(in srgb, var(--color-primary) 84%, var(--color-background) 16%);
        --mobile-nav-border: color-mix(in srgb, var(--color-primary) 46%, var(--color-border) 54%);
        --mobile-nav-text: color-mix(in srgb, var(--color-on-primary) 90%, var(--color-surface) 10%);
        --mobile-nav-muted: color-mix(in srgb, var(--color-on-primary) 82%, var(--color-primary) 18%);
        --mobile-nav-icon: color-mix(in srgb, var(--color-on-primary) 90%, var(--color-surface) 10%);
        --mobile-nav-icon-muted: color-mix(in srgb, var(--color-on-primary) 84%, var(--color-primary) 16%);
        --mobile-nav-icon-active: color-mix(in srgb, var(--color-primary) 88%, var(--color-text) 12%);
        --mobile-nav-active-bg: color-mix(in srgb, var(--color-surface) 84%, var(--color-primary) 16%);
        --mobile-nav-active-text: color-mix(in srgb, var(--color-primary) 86%, var(--color-text) 14%);
        --mobile-nav-active-border: color-mix(in srgb, var(--color-primary) 60%, var(--color-border) 40%);
        --mobile-nav-shadow: color-mix(in srgb, var(--color-primary) 24%, transparent);

        display: grid !important;
        grid-auto-flow: column !important;
        grid-auto-columns: minmax(0, 1fr) !important;
        grid-template-columns: none !important;
        grid-template-rows: minmax(54px, auto);
        align-items: stretch;
        justify-items: stretch;
        position: fixed;
        left: max(8px, env(safe-area-inset-left));
        right: max(8px, env(safe-area-inset-right));
        bottom: max(8px, env(safe-area-inset-bottom));
        z-index: 120;
        gap: 0;
        min-height: 68px;
        padding: 6px;
        border: 1px solid var(--mobile-nav-border);
        border-radius: 22px;
        background: var(--mobile-nav-bg);
        box-shadow: 0 18px 40px var(--mobile-nav-shadow);
        backdrop-filter: blur(16px);
        width: auto;
        max-width: none;
        overflow: hidden;
        box-sizing: border-box;
    }

    body:not(.reader-body) .mobile-bottom-nav.mobile-only-element > [hidden],
    body:not(.reader-body) .mobile-bottom-nav.mobile-only-element > .is-hidden {
        display: none !important;
    }

    body:not(.reader-body) .mobile-bottom-nav.mobile-only-element > .mobile-bottom-nav__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: initial;
        width: 100%;
        min-width: 0;
        max-width: none;
        min-height: 54px;
        gap: 2px;
        border-radius: 16px;
        color: var(--mobile-nav-muted);
        text-decoration: none;
        font-size: 0.64rem;
        font-weight: 800;
        letter-spacing: 0.01em;
        line-height: 1.1;
        padding: 6px 2px;
        overflow: hidden;
        text-align: center;
        box-sizing: border-box;
        opacity: 1;
        transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
    }

    .mobile-bottom-nav__item > span:not(.mobile-bottom-nav__icon) {
        color: inherit;
        font-weight: 800;
        letter-spacing: 0.01em;
    }

    .mobile-bottom-nav__item > span:not(.mobile-bottom-nav__icon) {
        display: block;
        width: 100%;
        min-width: 0;
        font-size: 0.62rem;
        line-height: 1.15;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-bottom-nav__icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        flex: 0 0 auto;
        color: var(--mobile-nav-icon-muted);
        opacity: 1;
    }

    .mobile-bottom-nav__icon svg {
        width: 20px;
        height: 20px;
        display: block;
        color: inherit;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-bottom-nav__item.is-active {
        background: var(--mobile-nav-active-bg);
        color: var(--mobile-nav-active-text);
        box-shadow: inset 0 0 0 1px var(--mobile-nav-active-border), 0 0 0 1px color-mix(in srgb, var(--mobile-nav-active-border) 40%, transparent);
    }

    .mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon {
        color: var(--mobile-nav-icon-active);
    }

    .mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon svg {
        stroke-width: 2.1;
    }

    .mobile-bottom-nav__item:not(.is-active):hover,
    .mobile-bottom-nav__item:not(.is-active):focus-visible {
        background: color-mix(in srgb, var(--mobile-nav-active-bg) 56%, transparent);
        color: var(--mobile-nav-text);
    }

    html[data-theme="light"] body:not(.reader-body) .mobile-bottom-nav.mobile-only-element {
        --mobile-nav-bg: color-mix(in srgb, var(--color-primary) 86%, var(--color-background) 14%);
        --mobile-nav-border: color-mix(in srgb, var(--color-primary) 50%, var(--color-border) 50%);
        --mobile-nav-text: color-mix(in srgb, var(--color-on-primary) 94%, var(--color-surface) 6%);
        --mobile-nav-muted: color-mix(in srgb, var(--color-on-primary) 86%, var(--color-primary) 14%);
        --mobile-nav-icon: color-mix(in srgb, var(--color-on-primary) 94%, var(--color-surface) 6%);
        --mobile-nav-icon-muted: color-mix(in srgb, var(--color-on-primary) 88%, var(--color-primary) 12%);
        --mobile-nav-icon-active: color-mix(in srgb, var(--color-primary) 88%, var(--color-text) 12%);
        --mobile-nav-active-bg: color-mix(in srgb, var(--color-surface) 82%, var(--color-primary) 18%);
        --mobile-nav-active-text: color-mix(in srgb, var(--color-primary) 84%, var(--color-text) 16%);
        --mobile-nav-active-border: color-mix(in srgb, var(--color-primary) 62%, var(--color-border) 38%);
        --mobile-nav-shadow: color-mix(in srgb, var(--color-primary) 22%, transparent);
    }

    html[data-theme="dark"] body:not(.reader-body) .mobile-bottom-nav.mobile-only-element,
    .theme-dark body:not(.reader-body) .mobile-bottom-nav.mobile-only-element {
        --mobile-nav-bg: color-mix(in srgb, var(--color-primary) 80%, var(--color-background) 20%);
        --mobile-nav-border: color-mix(in srgb, var(--color-primary) 42%, var(--color-border) 58%);
        --mobile-nav-text: color-mix(in srgb, var(--color-on-primary) 90%, var(--color-background) 10%);
        --mobile-nav-muted: color-mix(in srgb, var(--color-on-primary) 80%, var(--color-background) 20%);
        --mobile-nav-icon: color-mix(in srgb, var(--color-on-primary) 92%, var(--color-background) 8%);
        --mobile-nav-icon-muted: color-mix(in srgb, var(--color-on-primary) 84%, var(--color-background) 16%);
        --mobile-nav-icon-active: color-mix(in srgb, var(--color-primary) 90%, var(--color-on-primary) 10%);
        --mobile-nav-active-bg: color-mix(in srgb, var(--color-surface) 78%, var(--color-primary) 22%);
        --mobile-nav-active-text: color-mix(in srgb, var(--color-primary) 90%, var(--color-on-primary) 10%);
        --mobile-nav-active-border: color-mix(in srgb, var(--color-primary) 54%, var(--color-border) 46%);
        --mobile-nav-shadow: color-mix(in srgb, var(--color-primary) 28%, transparent);
    }

    body:not(.reader-body) .home-story-actions {
        width: 100%;
        display: flex;
        justify-content: center;
        flex-direction: column;
        gap: 0.75rem;
    }

    body:not(.reader-body) .home-story-tabs,
    body:not(.reader-body) .home-ranking-tabs,
    body:not(.reader-body) .story-tabs,
    body:not(.reader-body) .story-page-tabs {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.5rem;
        width: 100%;
        max-width: 100%;
        justify-content: center;
        align-items: center;
        margin-inline: auto;
        overflow: visible;
    }

    body:not(.reader-body) .home-story-tabs a,
    body:not(.reader-body) .home-story-tabs button,
    body:not(.reader-body) .home-ranking-tabs a,
    body:not(.reader-body) .home-ranking-tabs button,
    body:not(.reader-body) .story-tabs a,
    body:not(.reader-body) .story-tabs button,
    body:not(.reader-body) .story-page-tabs a,
    body:not(.reader-body) .story-page-tabs button {
        width: 100%;
        min-width: 0;
        min-height: 40px;
        padding: 8px 4px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
        font-size: 0.72rem;
        line-height: 1;
        box-sizing: border-box;
    }

    @media (max-width: 320px) {
        body:not(.reader-body) .home-story-tabs,
        body:not(.reader-body) .home-ranking-tabs,
        body:not(.reader-body) .story-tabs,
        body:not(.reader-body) .story-page-tabs {
            gap: 0.25rem;
        }
        body:not(.reader-body) .home-story-tabs a,
        body:not(.reader-body) .home-story-tabs button,
        body:not(.reader-body) .home-ranking-tabs a,
        body:not(.reader-body) .home-ranking-tabs button,
        body:not(.reader-body) .story-tabs a,
        body:not(.reader-body) .story-tabs button,
        body:not(.reader-body) .story-page-tabs a,
        body:not(.reader-body) .story-page-tabs button {
            font-size: 0.68rem;
        }
    }

    body:not(.reader-body) .home-story-tabs a,
    body:not(.reader-body) .home-story-tabs button,
    body:not(.reader-body) .home-ranking-tabs a,
    body:not(.reader-body) .home-ranking-tabs button,
    body:not(.reader-body) .story-tabs a,
    body:not(.reader-body) .story-tabs button,
    body:not(.reader-body) .story-page-tabs a,
    body:not(.reader-body) .story-page-tabs button {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        padding: 0.55rem 0.5rem;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        line-height: 1.15;
        font-size: 0.82rem;
        font-weight: 900;
        white-space: normal;
        background: var(--color-primary-soft);
        color: var(--color-primary);
        border: 1px solid color-mix(in srgb, var(--color-primary) 24%, transparent);
        text-decoration: none;
        box-shadow: 0 8px 18px color-mix(in srgb, var(--color-primary) 6%, transparent);
    }

    body:not(.reader-body) .home-story-tabs a.is-active,
    body:not(.reader-body) .home-story-tabs button.is-active,
    body:not(.reader-body) .home-ranking-tabs a.is-active,
    body:not(.reader-body) .home-ranking-tabs button.is-active,
    body:not(.reader-body) .story-tabs a.is-active,
    body:not(.reader-body) .story-tabs button.is-active,
    body:not(.reader-body) .story-page-tabs a.is-active,
    body:not(.reader-body) .story-page-tabs button.is-active {
        background: var(--color-primary);
        color: var(--color-on-primary);
        border-color: var(--color-primary-dark);
        box-shadow: 0 10px 22px color-mix(in srgb, var(--color-primary) 22%, transparent);
    }

    body:not(.reader-body) .home-story-grid,
    body:not(.reader-body) .story-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        padding-inline: 1rem;
        box-sizing: border-box;
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    body:not(.reader-body) .tag-page .tag-page-heading {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
        min-width: 0;
    }

    body:not(.reader-body) .tag-page .tag-page-heading > div:first-child {
        width: 100%;
        min-width: 0;
    }

    body:not(.reader-body) .tag-page .tag-page-heading h1,
    body:not(.reader-body) .tag-page .tag-page-heading .page-heading__title {
        margin: 0;
        width: auto;
        max-width: 100%;
        font-size: 1.75rem;
        line-height: 1.1;
        white-space: normal;
        word-break: normal;
        overflow-wrap: normal;
    }

    body:not(.reader-body) .tag-page .tag-page-heading .page-heading__subtitle,
    body:not(.reader-body) .tag-page .tag-page-heading .muted,
    body:not(.reader-body) .tag-page .tag-page-heading p {
        margin: 4px 0 0;
    }

    body:not(.reader-body) .tag-page .tag-page-pagination,
    body:not(.reader-body) .tag-page .story-pagination {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 6px;
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    body:not(.reader-body) .tag-page .tag-page-pagination--bottom {
        display: none;
    }

    @media (max-width: 768px) {
        body:not(.reader-body) .tag-page .tag-page-pagination--bottom {
            display: flex;
            justify-content: center;
            margin: 20px 0 12px;
        }
    }

    body:not(.reader-body) .tag-page .tag-page-pagination__item,
    body:not(.reader-body) .tag-page .story-pagination-link,
    body:not(.reader-body) .tag-page .story-pagination-page {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        width: auto;
        height: 34px;
        padding: 0 10px;
        line-height: 1;
        white-space: nowrap;
    }

    body:not(.reader-body) .tag-page .tag-filter-panel--desktop {
        display: none !important;
    }

    body:not(.reader-body) .tag-page .mobile-tag-filter {
        display: flex;
    }

    body:not(.reader-body) .tag-page .home-story-grid.desktop-only-element {
        display: none !important;
    }

    body:not(.reader-body) .tag-page .tag-story-results-mobile.mobile-only-element {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        width: 100%;
        min-width: 0;
        margin-top: 14px;
        padding-inline: 1rem;
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
        box-sizing: border-box;
    }

    body:not(.reader-body) .home-story-grid .story-card,
    body:not(.reader-body) .story-grid .story-card,
    body:not(.reader-body) .home-story-grid .home-story-card,
    body:not(.reader-body) .story-grid .home-story-card {
        max-width: 100%;
    }

    body:not(.reader-body) .story-page-pagination,
    body:not(.reader-body) .story-pagination,
    body:not(.reader-body) .home-story-pagination,
    body:not(.reader-body) .home-story-pagination-inline {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        margin-inline: auto;
        max-width: 420px;
    }

    body:not(.reader-body) .story-page-pagination .story-pagination-link,
    body:not(.reader-body) .story-pagination .story-pagination-link,
    body:not(.reader-body) .home-story-pagination__item,
    body:not(.reader-body) .home-story-pagination-inline a,
    body:not(.reader-body) .home-story-pagination-inline span {
        min-width: 0;
        flex: 1 1 0;
        max-width: 180px;
    }

    body:not(.reader-body) .story-page-pagination .story-pagination-page,
    body:not(.reader-body) .story-pagination .story-pagination-page {
        min-width: 0;
        text-align: center;
    }

    body:not(.reader-body) .home-story-pagination__item {
        min-width: 0;
        flex: 1 1 0;
        max-width: 120px;
        text-align: center;
    }

    body:not(.reader-body) .home-story-card {
        overflow: hidden;
        border-radius: 18px;
    }

    /* Mobile: make home story cards horizontal (cover left, info right) */
    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-card {
        display: grid;
        grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
        align-items: stretch;
        gap: 12px;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 10px;
        box-sizing: border-box;
        overflow: hidden;
    }

    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-cover {
        position: relative;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        aspect-ratio: 2 / 3;
        overflow: hidden;
        border-radius: 12px;
        background: var(--color-surface);
    }

    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-cover img {
        display: block;
        width: 100%;
        height: 100%;
        max-width: 100%;
        object-fit: cover;
    }

    body:not(.reader-body) .home-story-card .home-story-body {
        display: flex;
        flex-direction: column;
        min-width: 0;
        width: 100%;
        padding: 2px 0;
        overflow: hidden;
    }

    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-progress {
        position: absolute;
        left: 6px;
        right: 6px;
        bottom: 6px;
        width: auto;
        max-width: calc(100% - 12px);
        padding: 4px 7px;
        font-size: 0.68rem;
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-progress--desktop {
        display: none !important;
    }

    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-progress--mobile {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        left: 5px;
        right: 5px;
        bottom: 5px;
        width: auto;
        max-width: calc(100% - 10px);
        padding: 3px 6px;
        font-size: 0.62rem;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        box-sizing: border-box;
    }

    body:not(.reader-body) .home-story-card .home-story-body {
        display: flex;
        flex-direction: column;
        min-width: 0;
        padding: 2px 0;
    }

    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-card .home-story-title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        margin: 0;
        padding: 0;
        border: 0;
        font-size: clamp(0.9rem, 4vw, 1.02rem);
        font-weight: 700;
        line-height: 1.25;
        height: 2.5em;
        min-height: 2.5em;
        max-height: 2.5em;
        white-space: normal;
        word-break: normal;
        overflow-wrap: anywhere;
        overflow: hidden;
        overflow: clip;
        contain: paint;
    }

    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-author {
        margin-top: 8px;
        font-size: 0.78rem;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-stats {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 10px;
        margin-top: auto;
        padding-top: 10px;
        min-width: 0;
        font-size: 0.72rem;
        line-height: 1.2;
    }

    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-stats > * {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        white-space: nowrap;
    }

    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-stats svg {
        width: 14px;
        height: 14px;
        flex: 0 0 auto;
    }

    @media (max-width: 350px) {
        body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-stats {
            gap: 6px;
            font-size: 0.68rem;
        }
    }

    /* Mobile: compact character pills for story cards (reuse existing pill visual language) */
    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-card .home-story-characters {
        display: flex !important;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 4px;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin-top: 6px;
        overflow: hidden;
    }

    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-characters.has-one-character .home-story-character-pill {
        flex: 0 1 auto;
        width: auto;
        max-width: 100%;
    }

    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-characters.has-two-characters .home-story-character-pill {
        flex: 1 1 0;
        width: 0;
        min-width: 0;
        max-width: calc(50% - 2px);
    }

    body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-character-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        padding: 3px 6px;
        border-radius: 999px;
        border: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--color-border) 82%);
        background: var(--color-primary-soft);
        color: var(--color-primary-dark);
        font-size: 0.62rem;
        line-height: 1.2;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        box-sizing: border-box;
        text-decoration: none;
    }

    @media (max-width: 320px) {
        body:not(.reader-body) :is(.home-stories, .tag-story-results-mobile) .home-story-character-pill {
            padding: 2px 6px;
            font-size: 0.6rem;
        }
    }

    body:not(.reader-body) .story-hero-band .story-hero-inner,
    body:not(.reader-body) .story-hero-band .story-hero-inner.site-container {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem;
        padding: 1rem;
        text-align: center;
    }

    body:not(.reader-body) .story-cover-column,
    body:not(.reader-body) .story-cover-image,
    body:not(.reader-body) .story-cover-placeholder {
        margin-inline: auto;
        width: min(48vw, 170px);
        max-width: 170px;
    }

    body:not(.reader-body) .story-cover-image,
    body:not(.reader-body) .story-cover-placeholder {
        width: 100%;
        height: auto;
        display: block;
        object-fit: cover;
        border-radius: 14px;
    }

    body:not(.reader-body) .story-hero-content {
        min-width: 0;
        display: grid;
        justify-items: center;
        text-align: center;
    }

    body:not(.reader-body) .story-hero-title,
    body:not(.reader-body) .story-title {
        margin-top: 0.5rem;
        text-align: center;
        font-size: clamp(1.55rem, 7vw, 2rem);
        line-height: 1.18;
        word-break: break-word;
    }

    body:not(.reader-body) .story-author-row,
    body:not(.reader-body) .story-stat-pills,
    body:not(.reader-body) .story-hero-character-row,
    body:not(.reader-body) .story-tag-row,
    body:not(.reader-body) .story-tag-strip .story-tag-list,
    body:not(.reader-body) .story-action-row {
        width: 100%;
    }

    body:not(.reader-body) .story-author-row,
    body:not(.reader-body) .story-stat-pills,
    body:not(.reader-body) .story-hero-meta,
    body:not(.reader-body) .story-info-chips {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.45rem;
        width: 100%;
    }

    body:not(.reader-body) .story-author-row > *,
    body:not(.reader-body) .story-stat-pills > *,
    body:not(.reader-body) .story-hero-meta > *,
    body:not(.reader-body) .story-info-chips > * {
        max-width: 100%;
    }

    body:not(.reader-body) .story-action-row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        margin-top: 0.9rem;
    }

    body:not(.reader-body) .story-action-row > a,
    body:not(.reader-body) .story-action-row > button {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 0.55rem 0.45rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        border-radius: 12px;
        font-size: 0.86rem;
        font-weight: 900;
        line-height: 1.15;
        white-space: normal;
    }

    body:not(.reader-body) .story-hero-character-row,
    body:not(.reader-body) .story-tag-row,
    body:not(.reader-body) .story-hero-character-list,
    body:not(.reader-body) .story-tag-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.4rem;
        width: 100%;
        margin-top: 0.75rem;
    }

    body:not(.reader-body) .story-tag-pill,
    body:not(.reader-body) .story-hero-character-pill,
    body:not(.reader-body) .story-author-label,
    body:not(.reader-body) .story-author-tag,
    body:not(.reader-body) .story-stat-pill {
        max-width: 100%;
    }

    body:not(.reader-body) .story-action-primary {
        background: var(--color-primary);
        color: var(--color-on-primary);
    }

    body:not(.reader-body) .story-action-secondary {
        background: var(--color-surface);
        color: var(--color-text);
        border: 1px solid color-mix(in srgb, var(--color-primary) 16%, transparent);
    }

    body:not(.reader-body) .story-tag-strip .story-tag-list {
        justify-content: flex-start;
        align-items: flex-start;
        width: 100%;
    }

    body:not(.reader-body) .story-tag-strip-inner {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
        width: 100%;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: 18px;
        padding: 1rem;
    }

    body:not(.reader-body) .story-tag-strip .story-tag-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        width: 100%;
        margin-top: 1rem;
    }

    body:not(.reader-body) .story-tag-row:first-child {
        margin-top: 0;
    }

    body:not(.reader-body) .story-tag-label {
        display: block;
        text-align: left;
        font-weight: 700;
        margin-bottom: 0.55rem;
    }

    body:not(.reader-body) .story-tag-list {
        justify-content: flex-start;
        align-items: flex-start;
        gap: 0.45rem 0.55rem;
    }

    body:not(.reader-body) .story-description-inner {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    body:not(.reader-body) .story-description-box {
        height: auto;
        max-height: 300px;
        overflow-y: auto;
        text-align: left;
        line-height: 1.7;
        padding: 1rem;
        border-radius: 18px;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
    }

    body:not(.reader-body) .story-chapter-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
    }

    body:not(.reader-body) .story-chapter-item {
        min-height: auto;
        padding: 0.85rem 1rem;
        word-break: break-word;
        border-right: none;
    }

    body:not(.reader-body) .story-chapter-item:nth-child(odd) {
        border-right: none;
    }

    body:not(.reader-body) .story-detail-page {
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    body:not(.reader-body) .story-description-box::-webkit-scrollbar {
        width: 6px;
    }

    body:not(.reader-body) .story-description-box::-webkit-scrollbar-thumb {
        background: color-mix(in srgb, var(--color-primary) 18%, transparent);
        border-radius: 999px;
    }

    body:not(.reader-body) .story-section-heading-row {
        align-items: flex-start;
    }

    body:not(.reader-body) .story-hero-character-label,
    body:not(.reader-body) .story-tag-label {
        display: inline-flex;
        align-items: center;
    }

    body:not(.reader-body) .story-cover-placeholder span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        padding: 2rem 0;
        font-size: 2rem;
    }

    body:not(.reader-body) .home-panel {
        border-radius: 18px;
        overflow: hidden;
    }

    body:not(.reader-body) .mobile-home-panel {
        overflow: hidden;
        border: 1px solid var(--color-border);
        border-radius: 18px;
        background: var(--color-surface);
        box-shadow: 0 8px 20px color-mix(in srgb, var(--color-primary) 6%, transparent);
        margin-bottom: 0.75rem;
    }

    body:not(.reader-body) .mobile-home-panel > summary {
        min-height: 54px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        cursor: pointer;
        list-style: none;
        font-weight: 900;
        color: var(--color-primary);
        background: var(--color-primary-soft);
    }

    body:not(.reader-body) .mobile-home-panel > summary::-webkit-details-marker,
    body:not(.reader-body) .mobile-home-panel > summary::marker {
        display: none;
    }

    body:not(.reader-body) .mobile-home-panel > summary::after {
        content: "+";
        flex: 0 0 auto;
        width: 28px;
        height: 28px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        color: var(--color-primary);
        font-weight: 900;
    }

    body:not(.reader-body) .mobile-home-panel[open] > summary::after {
        content: "–";
    }

    body:not(.reader-body) .mobile-home-panel__content,
    body:not(.reader-body) .mobile-home-panel__body {
        display: none;
        padding: 0 1rem 1rem;
    }

    body:not(.reader-body) .mobile-home-panel[open] > .mobile-home-panel__content,
    body:not(.reader-body) .mobile-home-panel[open] > .mobile-home-panel__body {
        display: block;
    }

    @media (min-width: 769px) {
        body:not(.reader-body) .mobile-home-panel > .mobile-home-panel__content,
        body:not(.reader-body) .mobile-home-panel > .mobile-home-panel__body {
            display: block !important;
        }

        body:not(.reader-body) .mobile-home-panel > summary::after {
            display: none;
        }

        body:not(.reader-body) .mobile-home-panel > summary {
            cursor: default;
        }
    }

    body:not(.reader-body) .page-section {
        padding-block: 1rem;
    }

    body:not(.reader-body) .page-hero {
        padding: 1rem;
        border-radius: 18px;
    }


/* Mobile Panel Collapse v1: hide panel bodies/footers by default on mobile */
@media (max-width: 768px) {
    body:not(.reader-body) .is-mobile-collapsible .home-panel-list,
    body:not(.reader-body) .is-mobile-collapsible .home-panel-footer {
        display: none !important;
    }

    body:not(.reader-body) .is-mobile-collapsible.is-open .home-panel-list,
    body:not(.reader-body) .is-mobile-collapsible.is-open .home-panel-footer {
        display: block !important;
    }

    body:not(.reader-body) .is-mobile-collapsible .home-panel-header {
        cursor: pointer;
        position: relative;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    body:not(.reader-body) .is-mobile-collapsible .home-panel-header::after {
        content: "+";
        margin-left: auto;
        width: 28px;
        height: 28px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        color: var(--color-primary);
        font-weight: 900;
    }

    body:not(.reader-body) .is-mobile-collapsible.is-open .home-panel-header::after {
        content: "–";
    }
    
    body:not(.reader-body) .section-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    body:not(.reader-body) .home-panels,
    body:not(.reader-body) .home-panels[data-visible-count="3"],
    body:not(.reader-body) .home-panels[data-visible-count="2"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
        width: 100%;
        max-width: 100%;
    }

    body:not(.reader-body) .home-panel {
        width: 100%;
        max-width: 100%;
    }
}
