/* Flat ReadChief UI reset.
   Keeps the product content-first: no glow, no faux depth, no pill borders. */

:root {
    --gradient-primary: var(--color-accent-primary);
    --gradient-secondary: var(--color-bg-tertiary);
    --gradient-gold: var(--color-accent-gold);
    --gradient-card: var(--color-bg-card);
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;
    --shadow-glow: none;
    --shadow-glow-sm: none;
}

body {
    background-image: none !important;
}

:where(a, button, input, textarea, select, [tabindex]):focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 3px;
    box-shadow: none !important;
}

.mobile-header {
    transition: transform 180ms ease, background-color var(--transition-normal);
    will-change: transform;
    box-shadow: none !important;
}

.mobile-header.is-hidden {
    transform: translateY(-105%);
}

.search-bar-wrapper,
.sidebar-search-wrapper,
.search-suggestions,
.search-icon-wrapper,
.nav-link,
.corners-search input,
.filter-select,
.category-filters,
.view-toggle,
.view-btn,
.category-tag,
.story-card,
.story-card-compact,
.corner-card,
.comment-form-container,
.comment-textarea,
.rc-top-level-form,
.rc-reply-form-inner,
.auth-modal-content,
.auth-tabs,
.form-group input,
.form-group textarea,
.toast,
.profile-card,
.profile-header,
.stat-card,
.admin-stat-card,
.admin-tab,
.admin-tab .badge,
.status-badge,
.modal-content,
.empty-category,
.privacy-card,
.guideline-card,
.principle-card,
.moderation-card,
.security-highlight {
    border: 0 !important;
    box-shadow: none !important;
}

.search-bar-wrapper,
.sidebar-search-wrapper,
.search-suggestions,
.search-icon-wrapper,
.corners-search input,
.filter-select,
.category-filters,
.view-toggle,
.auth-tabs,
.form-group input,
.form-group textarea,
.comment-textarea,
.rc-top-level-form,
.rc-reply-form-inner {
    border-radius: 4px !important;
}

.btn,
.auth-btn,
.editor-btn,
.action-btn,
.view-btn,
.category-tag,
.sc-react,
.toast,
.theme-toggle,
.hamburger-btn,
.mobile-write-btn,
.close-menu,
.search-clear-btn,
.password-toggle-btn,
.comment-submit-btn,
.rc-submit-btn,
.rc-submit-reply-btn,
.rc-cancel-reply-btn,
.rc-collapse-btn,
.tab-btn,
.avatar-change-btn,
.avatar-edit-btn,
.ad-upload-btn {
    border: 0 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    background-image: none !important;
}

.btn-primary,
.auth-btn.signup,
.auth-tab.active,
.story-rank.top,
.privacy-hero,
.guidelines-hero,
.moderation-hero,
.profile-cover-default,
.hero-section,
.hero-dark-bleed,
.hero-fragment,
.profile-hero-info,
.search-icon-wrapper,
.story-card,
.story-rank.top,
.admin-tab.active,
.status-badge,
.comments-count-badge {
    background-image: none !important;
}

.btn-primary,
.auth-btn.signup,
.auth-tab.active {
    background: var(--color-accent-primary) !important;
}

.btn-outline,
.auth-btn.login,
.view-btn,
.sc-react,
.category-tag,
.comment-action-btn,
.rc-reply-btn,
.rc-delete-btn,
.search-icon-wrapper {
    background: transparent !important;
}

.btn:hover,
.auth-btn:hover,
.story-card:hover,
.story-card-compact:hover,
.corner-card:hover,
.category-tag:hover,
.sc-react:hover,
.mobile-write-btn:hover,
.theme-toggle:hover {
    transform: none !important;
    box-shadow: none !important;
}

.search-bar-wrapper:hover,
.search-bar-wrapper:focus-within,
.search-suggestions,
.corners-search input:focus,
.filter-select:focus,
.comment-textarea:focus,
.form-group input:focus,
.form-group textarea:focus {
    border: 0 !important;
    box-shadow: none !important;
}

.category-filters,
.view-toggle,
.corner-card,
.story-card-compact,
.comment-form-container,
.empty-category,
.story-card,
.privacy-card,
.guideline-card,
.principle-card,
.moderation-card,
.security-highlight {
    background: transparent !important;
}

.category-tag,
.view-btn {
    padding-inline: 0 !important;
}

.category-tag.active,
.view-btn.active,
.nav-link.active {
    background: transparent !important;
    color: var(--color-accent-primary) !important;
}

.category-tag.active::after,
.view-btn.active::after {
    content: '';
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    position: absolute;
    left: 0;
    bottom: -4px;
}

.category-tag,
.view-btn {
    position: relative;
}

.main-footer,
.menu-header,
.feed-toolbar,
.comments-section-header,
.comment-item,
.story-author-row,
.sc-divider,
.rc-comment {
    box-shadow: none !important;
}

.sidebar::before,
.main-footer::before {
    display: none !important;
}

.feed-toolbar,
.menu-header,
.main-footer,
.category-filters,
.category-tag,
.corner-card,
.story-card,
.story-card-compact,
.search-suggestions,
.search-icon-wrapper,
.feed-toolbar,
.story-author-row,
.comment-item,
.rc-comment {
    border-color: transparent !important;
}

.search-section-header,
.feed-toolbar,
.story-author-row,
.comment-item,
.rc-comment,
.sc-divider {
    border-color: transparent !important;
}

.sidebar {
    border-right: 0 !important;
}

.search-bar-wrapper,
.sidebar-search-wrapper {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    position: relative;
}

.search-bar-wrapper::after,
.sidebar-search-wrapper::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--color-border-neutral);
    opacity: 0.9;
    transition: height 160ms ease, opacity 160ms ease, background-color 160ms ease;
}

.search-bar-wrapper:focus-within::after,
.sidebar-search-wrapper:focus-within::after {
    height: 2px;
    background: var(--color-text-secondary);
    opacity: 1;
}

.search-bar-wrapper:hover,
.search-bar-wrapper:focus-within,
.sidebar-search-wrapper:hover,
.sidebar-search-wrapper:focus-within {
    background: transparent !important;
}

.search-icon-left {
    color: var(--color-text-secondary) !important;
}

.content-wrapper {
    padding-top: 18px !important;
    padding-bottom: 18px !important;
}

.feed-toolbar {
    margin-bottom: 0 !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid color-mix(in srgb, var(--color-border-secondary) 38%, transparent) !important;
}

.latest-section {
    margin-top: 0 !important;
}

.stories-grid,
.stories-grid.is-loading {
    gap: 0 !important;
    padding-top: 0 !important;
}

.loading-stack {
    display: grid;
    gap: 0;
    padding-top: 0;
}

.loading-stack .loading-story-card {
    width: 100%;
}

.story-card,
.loading-story-card {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid color-mix(in srgb, var(--color-border-secondary) 42%, transparent) !important;
    border-radius: 0 !important;
}

.story-card {
    padding: 14px 4px 15px !important;
}

.story-card:hover,
.story-card:focus-visible {
    background: color-mix(in srgb, var(--color-bg-tertiary) 22%, transparent) !important;
    border-bottom-color: color-mix(in srgb, var(--color-border-neutral) 48%, transparent) !important;
}

.sc-top-bar {
    margin-bottom: 6px !important;
}

.sc-title {
    margin-bottom: 5px !important;
}

.sc-excerpt {
    margin-bottom: 10px !important;
    line-height: 1.5 !important;
}

.sc-bottom-bar {
    gap: 8px !important;
}

.sc-react {
    min-height: 32px !important;
    padding: 5px 8px !important;
}

.sc-react i,
.sc-react .rc-svg-icon {
    width: 21px !important;
    height: 21px !important;
    font-size: 20px !important;
}

.sc-reactions {
    gap: 7px !important;
}

.category-tags-shell {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 8px;
    margin: 18px 0 20px;
}

.category-tags-shell .category-tags {
    margin: 0 !important;
    padding: 2px 0 8px !important;
    scroll-behavior: smooth;
}

.category-scroll-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 150ms ease, opacity 150ms ease, background-color 150ms ease;
}

.category-scroll-btn:hover:not(:disabled) {
    color: var(--color-text-primary);
    background: color-mix(in srgb, var(--color-text-primary) 7%, transparent);
}

.category-scroll-btn:disabled {
    opacity: 0.28;
    cursor: default;
}

.category-scroll-btn i,
.category-scroll-btn .rc-svg-icon {
    width: 19px !important;
    height: 19px !important;
    font-size: 18px !important;
}

.auth-modal {
    background: color-mix(in srgb, var(--color-bg-primary) 78%, transparent) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.auth-modal-content {
    max-width: 430px !important;
    padding: 30px !important;
    background: var(--color-bg-card) !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    border-image: repeating-linear-gradient(90deg,
            #A67C2E 0 8px,
            #D4A84B 8px 16px,
            #F0E0B0 16px 24px,
            #3D2A05 24px 32px) 1 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

.auth-tabs {
    gap: 18px !important;
    margin-bottom: 22px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid color-mix(in srgb, var(--color-border-secondary) 46%, transparent) !important;
    border-radius: 0 !important;
}

.auth-tab {
    flex: 0 0 auto !important;
    padding: 0 0 10px !important;
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--color-text-secondary) !important;
    font-size: 0.95rem;
}

.auth-tab.active {
    background: transparent !important;
    color: var(--color-text-primary) !important;
    border-bottom-color: var(--color-text-primary) !important;
}

.auth-form {
    gap: 14px !important;
}

.auth-modal .form-group {
    gap: 6px !important;
}

.auth-modal .form-group label {
    color: var(--color-text-tertiary) !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
}

.auth-modal .form-group input,
.auth-modal .form-group textarea {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid color-mix(in srgb, var(--color-border-neutral) 70%, transparent) !important;
    border-radius: 0 !important;
    padding: 10px 0 !important;
    box-shadow: none !important;
}

.auth-modal .form-group input:focus,
.auth-modal .form-group textarea:focus {
    border-bottom-color: var(--color-text-secondary) !important;
}

.auth-modal .password-toggle-btn {
    right: 0 !important;
    color: var(--color-text-tertiary) !important;
}

.auth-modal .form-actions {
    gap: 10px !important;
    margin-top: 12px !important;
}

.auth-modal .btn {
    min-height: 42px !important;
    justify-content: center !important;
    background: transparent !important;
    color: var(--color-text-secondary) !important;
    border: 0 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}

.auth-modal .btn-outline {
    color: var(--color-text-primary) !important;
    text-decoration: underline;
    text-underline-offset: 5px;
    background: transparent !important;
}

.auth-modal .btn-primary {
    background: color-mix(in srgb, var(--color-text-primary) 8%, transparent) !important;
    color: var(--color-text-primary) !important;
}

.auth-modal .btn-outline:hover,
.auth-modal .btn-primary:hover {
    background: color-mix(in srgb, var(--color-text-primary) 12%, transparent) !important;
    color: var(--color-text-primary) !important;
}

.auth-divider {
    margin: 18px 0 14px !important;
}

.auth-divider::before,
.auth-divider::after {
    background: color-mix(in srgb, var(--color-border-secondary) 52%, transparent) !important;
}

.google-auth-button-container,
#googleAuthButtonContainer {
    box-shadow: none !important;
}

.story-page #storyActions {
    margin-top: 14px !important;
    padding: 8px 0 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-top: 1px solid color-mix(in srgb, var(--color-border-secondary) 52%, transparent) !important;
    border-radius: 0 !important;
}

.story-page #storyActions > div {
    gap: 12px !important;
}

.story-page .story-author-meta,
.story-page .story-author-meta span,
.story-page .story-view-count,
.story-page #storyActions .story-action-row,
.story-page #storyActions .story-action-primary,
.story-page #storyActions .story-action-reactions,
.story-page #storyActions .story-action-secondary {
    align-items: center !important;
}

.story-page .story-author-meta span,
.story-page .story-view-count,
.story-page #storyActions .btn,
.story-page #storyActions .rc-action-count {
    white-space: nowrap !important;
}

.story-page .story-author-meta span {
    display: inline-flex !important;
}

.story-page .story-view-count,
.story-page #storyActions .btn {
    display: inline-flex !important;
    flex-direction: row !important;
}

.story-page .story-view-count {
    gap: 4px !important;
}

.story-page #storyActions .story-action-row,
.story-page #storyActions .story-action-primary,
.story-page #storyActions .story-action-reactions,
.story-page #storyActions .story-action-secondary {
    display: flex !important;
    flex-wrap: wrap !important;
}

.story-page #storyActions div[style*="gap: 24px"] {
    gap: 12px !important;
}

.story-page #storyActions div[style*="gap: 12px"],
.story-page #storyActions div[style*="gap: 8px"] {
    gap: 9px !important;
}

.story-page #storyActions .btn {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 8px 10px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 4px !important;
    color: var(--color-text-secondary) !important;
    font-size: 0.98rem !important;
    gap: 7px !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    line-height: 1 !important;
}

.story-page #storyActions .rc-action-count {
    display: inline-block !important;
    line-height: 1 !important;
    margin-left: 0 !important;
}

.story-page #storyActions .btn:hover,
.story-page #storyActions .btn:focus-visible {
    background: color-mix(in srgb, var(--color-text-primary) 7%, transparent) !important;
    color: var(--color-text-primary) !important;
}

.story-page #storyActions .rc-react-like.liked {
    color: #7D1128 !important;
}

.story-page #storyActions .rc-react-like.reaction-burst .rc-svg-icon,
.story-page #storyActions .rc-react-like.reaction-burst i {
    animation: rc-story-heart-pop 420ms cubic-bezier(0.2, 0.9, 0.25, 1.25);
}

@keyframes rc-story-heart-pop {
    0% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.36);
    }

    100% {
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-page #storyActions .rc-react-like.reaction-burst .rc-svg-icon,
    .story-page #storyActions .rc-react-like.reaction-burst i {
        animation: none;
    }
}

.story-page #storyActions .btn i,
.story-page #storyActions .btn .rc-svg-icon {
    width: 24px !important;
    height: 24px !important;
    font-size: 23px !important;
    flex: 0 0 auto !important;
}

.story-page #storyActions .rc-react-lamba.lambad {
    color: #7D1128 !important;
}

@media (max-width: 600px) {
    .story-page .story-author-meta {
        gap: 7px !important;
        row-gap: 4px !important;
        font-size: 0.78rem !important;
    }

    .story-page .story-view-count .rc-svg-icon {
        width: 16px !important;
        height: 16px !important;
    }

    .story-page #storyActions {
        padding-top: 6px !important;
    }

    .story-page #storyActions .story-action-row {
        gap: 7px !important;
        justify-content: flex-start !important;
    }

    .story-page #storyActions .story-action-primary,
    .story-page #storyActions .story-action-reactions,
    .story-page #storyActions .story-action-secondary {
        gap: 5px !important;
    }

    .story-page #storyActions .btn {
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 7px 8px !important;
        gap: 5px !important;
        font-size: 0.86rem !important;
    }

    .story-page #storyActions .btn .rc-svg-icon,
    .story-page #storyActions .btn i {
        width: 21px !important;
        height: 21px !important;
        font-size: 20px !important;
    }
}

@media (max-width: 360px) {
    .story-page #storyActions .btn {
        min-width: 38px !important;
        min-height: 38px !important;
        padding: 6px 7px !important;
        gap: 4px !important;
        font-size: 0.8rem !important;
    }

    .story-page #storyActions .btn .rc-svg-icon,
    .story-page #storyActions .btn i {
        width: 19px !important;
        height: 19px !important;
        font-size: 18px !important;
    }
}

.loading-story-card {
    min-height: 138px !important;
    padding: 14px 4px 15px !important;
    gap: 10px !important;
}

.loading-card-head,
.loading-card-footer {
    gap: 9px !important;
}

.loading-avatar {
    width: 32px !important;
    height: 32px !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px !important;
    overflow: hidden;
}

.loading-avatar-mascot {
    width: 24px;
    height: 24px;
    object-fit: contain;
    opacity: 1;
    filter: grayscale(1) contrast(1.05) brightness(0.62);
    mix-blend-mode: luminosity;
}

.loading-line {
    height: 10px !important;
    border-radius: 4px !important;
}

.loading-title {
    width: 70% !important;
    height: 16px !important;
}

.loading-line-short {
    width: 30% !important;
}

.loading-line-medium {
    width: 56% !important;
}

.loading-pill {
    width: 72px !important;
    height: 24px !important;
    border-radius: 4px !important;
}

.loading-pill-wide {
    width: 108px !important;
}

.rc-svg-icon {
    width: 1.22em;
    height: 1.22em;
    stroke-width: 1.95;
}

.fa-spin .rc-svg-icon {
    animation: rc-icon-spin 900ms linear infinite;
}

@keyframes rc-icon-spin {
    to {
        transform: rotate(360deg);
    }
}

.nav-link .rc-svg-icon {
    width: 24px;
    height: 24px;
}

.mobile-write-btn .rc-svg-icon,
.hamburger-btn .rc-svg-icon,
.theme-toggle .rc-svg-icon,
.close-menu .rc-svg-icon,
.search-clear-btn .rc-svg-icon,
.password-toggle-btn .rc-svg-icon {
    width: 23px;
    height: 23px;
}

.search-icon-left {
    font-size: 1.22rem;
}

.sc-react .rc-svg-icon {
    width: 21px;
    height: 21px;
}

.category-tag .rc-svg-icon,
.stat-item .rc-svg-icon,
.story-meta .rc-svg-icon,
.meta-item .rc-svg-icon,
.btn .rc-svg-icon,
.auth-btn .rc-svg-icon,
.editor-btn .rc-svg-icon,
.action-btn .rc-svg-icon {
    width: 1.2em;
    height: 1.2em;
}

.corner-icon,
.category-icon-large,
.empty-icon,
.comment-login-prompt i,
.comments-empty i {
    box-shadow: none !important;
    border: 0 !important;
    background: transparent !important;
}

@media (max-width: 600px) {
    .mobile-header-content {
        flex-wrap: nowrap !important;
        gap: 6px !important;
    }

    .mobile-logo {
        margin-left: 0 !important;
    }

    .mobile-logo .site-logo {
        height: 22px !important;
        max-width: 92px !important;
    }

    .mobile-header .search-bar-container {
        order: 0 !important;
        flex: 1 1 118px !important;
        min-width: 96px !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 4px !important;
    }

    .mobile-header .search-bar-wrapper {
        min-height: 42px !important;
    }

    .search-bar-input {
        min-width: 0;
        padding: 10px 8px;
    }

    .search-icon-left {
        padding-left: 12px;
    }

    .main-content {
        padding-top: 70px !important;
    }
}

@media (max-width: 360px) {
    .mobile-logo .site-logo {
        max-width: 74px !important;
    }

    .mobile-header .search-bar-container {
        flex-basis: 92px !important;
        min-width: 82px !important;
    }
}
