/* Memur Kahvesi unified theme lock.
   Loaded after page CSS and site-header.css to keep public/admin surfaces consistent. */

:root {
    --mk-font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mk-font-mono: Consolas, "Liberation Mono", "Courier New", monospace;
    --mk-bg: #f6f5f2;
    --mk-ink: #111827;
    --mk-muted: #64748b;
    --mk-soft: #f8fafc;
    --mk-surface: #ffffff;
    --mk-line: #e5ded6;
    --mk-line-strong: #d6cfc7;
    --mk-navy: #111827;
    --mk-navy-soft: #1f2937;
    --mk-brand: #8f1d1d;
    --mk-brand-strong: #6f1717;
    --mk-brand-hot: #dc2626;
    --mk-blue: #2563eb;
    --mk-green: #047857;
    --mk-radius: 8px;
    --mk-radius-lg: 10px;
    --mk-shadow-sm: 0 1px 2px rgba(17, 24, 39, .05);
    --mk-shadow: 0 10px 26px rgba(17, 24, 39, .08);
    --mk-shadow-lg: 0 22px 55px rgba(17, 24, 39, .14);
    --mk-container: 1400px;
    --mk-gutter: 1rem;
    --mk-hero-min: 190px;
    --mk-hero-pad: clamp(1.45rem, 3vw, 2.35rem);
    --mk-hero-bg: linear-gradient(135deg, #111827 0%, #27252a 50%, #8f2525 100%);
}

html,
body {
    font-family: var(--mk-font-sans) !important;
    color: var(--mk-ink);
    background: var(--mk-bg);
}

.site-main,
.site-main *:not(code):not(pre):not(kbd):not(samp),
.site-footer,
.site-footer *:not(code):not(pre):not(kbd):not(samp) {
    font-family: var(--mk-font-sans) !important;
}

.site-main :where(code, pre, kbd, samp) {
    font-family: var(--mk-font-mono) !important;
}

.site-main :where(.fa, .fas, .fa-solid) {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

.site-main :where(.far, .fa-regular) {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}

.site-main :where(.fab, .fa-brands) {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

.site-main :where(
    .post-content,
    .article-content,
    .law-article,
    .mk-reading-body,
    .legal-text,
    .info-readable,
    .announcement-body,
    .document-body,
    .topic-content
) {
    font-family: var(--mk-font-sans) !important;
}

.site-main {
    background: var(--mk-bg);
}

.site-main :where(
    .container,
    .page-container,
    .content-container,
    .main-container,
    .wrap,
    .page-wrap,
    .forum-container,
    .documents-wrap,
    .tools-wrap,
    .city-wrap,
    .compare-wrap,
    .announcements-wrap,
    .law-wrap,
    .users-wrap,
    .blog-section-wrap,
    .blog-main-layout,
    .blog-category-layout,
    .blog-post-layout,
    .bh-container,
    .admin-content,
    .admin-main,
    .mod-content,
    .mod-main
) {
    width: min(100% - (var(--mk-gutter) * 2), var(--mk-container)) !important;
    max-width: var(--mk-container) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

/* Unified public page heroes */
.site-main :where(
    .forum-topbar,
    .documents-hero,
    .tools-hero,
    .law-hero,
    .law-detail-hero,
    .article-hero,
    .city-hero,
    .city-detail-hero,
    .compare-hero,
    .announcements-hero,
    .users-hero,
    .blog-hero,
    .cat-hero,
    .tag-hero,
    .search-hero,
    .post-hero,
    .becayis-hero,
    .signals-hero,
    .cetele-hero,
    .leaderboard-hero,
    .mk-hero-header,
    .mk-simple-hero,
    .mk-search-hero,
    .page-hero,
    .hero-section,
    .admin-page-hero,
    .admin-dashboard-hero,
    .admin-hero,
    .mod-hero
) {
    width: min(100% - (var(--mk-gutter) * 2), var(--mk-container)) !important;
    max-width: var(--mk-container) !important;
    min-height: var(--mk-hero-min) !important;
    margin: 0 auto 1.5rem !important;
    padding: var(--mk-hero-pad) !important;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    border-radius: var(--mk-radius-lg) !important;
    background: var(--mk-hero-bg) !important;
    color: #fff !important;
    box-shadow: var(--mk-shadow-lg) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    text-align: left !important;
}

.site-main :where(
    .forum-topbar,
    .documents-hero,
    .tools-hero,
    .law-hero,
    .law-detail-hero,
    .article-hero,
    .city-hero,
    .city-detail-hero,
    .compare-hero,
    .announcements-hero,
    .users-hero,
    .blog-hero,
    .cat-hero,
    .tag-hero,
    .search-hero,
    .post-hero,
    .becayis-hero,
    .signals-hero,
    .cetele-hero,
    .leaderboard-hero,
    .mk-hero-header,
    .mk-simple-hero,
    .mk-search-hero,
    .page-hero,
    .hero-section
) {
    display: grid !important;
    align-items: center !important;
}

.site-main :where(
    .hero-content,
    .mk-hero-content,
    .blog-hero-inner,
    .becayis-hero-inner,
    .signals-hero-copy,
    .cetele-hero-copy,
    .admin-hero-copy,
    .mod-hero-copy
) {
    width: min(100%, 960px) !important;
    max-width: 960px !important;
    margin: 0 !important;
    text-align: left !important;
    justify-self: start !important;
}

.site-main :where(
    .hero-layout,
    .documents-hero .hero-content,
    .tools-hero .hero-content,
    .law-hero .hero-content,
    .city-hero .hero-content,
    .compare-hero .hero-content,
    .announcements-hero .hero-content,
    .users-hero .hero-content,
    .leaderboard-hero .hero-content,
    .mk-hero-header .mk-hero-content
) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: clamp(1rem, 3vw, 2rem) !important;
    width: 100% !important;
    max-width: none !important;
}

.site-main :where(
    .forum-title,
    .hero-title,
    .mk-hero-title,
    .documents-hero h1,
    .tools-hero h1,
    .law-hero h1,
    .city-hero h1,
    .compare-hero h1,
    .announcements-hero h1,
    .users-hero h1,
    .blog-hero h1,
    .cat-hero h1,
    .tag-hero h1,
    .search-hero h1,
    .post-hero h1,
    .post-hero .post-title,
    .becayis-hero h1,
    .signals-hero h1,
    .cetele-hero h1,
    .leaderboard-hero h1,
    .admin-page-hero h1,
    .admin-dashboard-hero h1,
    .admin-hero h1,
    .mod-hero h1
) {
    margin: 0 !important;
    color: #fff !important;
    font-size: clamp(2rem, 3vw, 2.8rem) !important;
    line-height: 1.08 !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
    text-shadow: none !important;
}

.site-main :where(
    .forum-subtitle,
    .hero-subtitle,
    .mk-hero-subtitle,
    .documents-hero p,
    .tools-hero p,
    .law-hero p,
    .city-hero p,
    .compare-hero p,
    .announcements-hero p,
    .users-hero p,
    .blog-hero p,
    .cat-hero p,
    .tag-hero p,
    .search-hero p,
    .post-hero p,
    .post-hero .post-lede,
    .becayis-hero p,
    .signals-hero p,
    .cetele-hero p,
    .leaderboard-hero p,
    .admin-page-hero p,
    .admin-dashboard-hero p,
    .admin-hero p,
    .mod-hero p
) {
    max-width: 860px !important;
    margin: .65rem 0 0 !important;
    color: rgba(255, 255, 255, .78) !important;
    font-size: 1rem !important;
    line-height: 1.65 !important;
}

.site-main :where(
    .hero-eyebrow,
    .mk-hero-eyebrow,
    .blog-eyebrow,
    .hero-kicker,
    .mk-kicker,
    .signals-hero .hero-badge,
    .cetele-hero .hero-badge
) {
    display: inline-flex !important;
    align-items: center !important;
    gap: .4rem !important;
    width: fit-content !important;
    min-height: 30px !important;
    margin: 0 0 .85rem !important;
    padding: .35rem .85rem !important;
    border: 1px solid rgba(147, 197, 253, .35) !important;
    border-radius: 999px !important;
    background: rgba(59, 130, 246, .14) !important;
    color: #bfdbfe !important;
    font-size: .76rem !important;
    font-weight: 900 !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
}

.site-main :where(
    .hero-stats,
    .hero-stats-grid,
    .forum-stats-bar,
    .signals-hero-stats,
    .cetele-hero-stats,
    .hero-metrics
) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
    gap: .75rem !important;
}

.site-main :where(
    .hero-stat,
    .hero-stat-card,
    .forum-stat,
    .signals-hero-stat,
    .cetele-hero-stat,
    .hero-metric
) {
    min-height: 76px !important;
    padding: .85rem 1rem !important;
    border: 1px solid rgba(255, 255, 255, .15) !important;
    border-radius: var(--mk-radius) !important;
    background: rgba(255, 255, 255, .08) !important;
    color: #fff !important;
    box-shadow: none !important;
}

/* Buttons */
.site-main :where(
    .btn,
    .button,
    .cta-button,
    .primary-action,
    .hero-primary,
    .btn-cta,
    .btn-hero,
    .btn-filter,
    .btn-submit,
    .btn-detail,
    .btn-new-topic,
    .btn-upload,
    .btn-primary,
    .btn-primary-signal,
    .auth-state-button,
    .notifications-mark-btn,
    .mk-primary-link,
    .search-form button,
    .blog-search button,
    .law-filter button,
    .compare-form button,
    form button[type="submit"]:not(.notification-close):not(.mobile-menu-btn):not(.nav-dropdown-toggle)
) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .45rem !important;
    min-height: 42px !important;
    padding: 0 .95rem !important;
    border: 1px solid rgba(127, 29, 29, .18) !important;
    border-radius: var(--mk-radius) !important;
    background: var(--mk-brand-hot) !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(220, 38, 38, .16) !important;
    font-size: .92rem !important;
    font-weight: 850 !important;
    line-height: 1.15 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease !important;
}

.site-main :where(
    .btn:hover,
    .button:hover,
    .cta-button:hover,
    .primary-action:hover,
    .hero-primary:hover,
    .btn-cta:hover,
    .btn-hero:hover,
    .btn-filter:hover,
    .btn-submit:hover,
    .btn-detail:hover,
    .btn-new-topic:hover,
    .btn-upload:hover,
    .btn-primary:hover,
    .btn-primary-signal:hover,
    .auth-state-button:hover,
    .notifications-mark-btn:hover,
    .mk-primary-link:hover,
    .search-form button:hover,
    .blog-search button:hover,
    .law-filter button:hover,
    .compare-form button:hover,
    form button[type="submit"]:not(.notification-close):not(.mobile-menu-btn):not(.nav-dropdown-toggle):hover
) {
    background: var(--mk-brand) !important;
    box-shadow: 0 14px 28px rgba(127, 29, 29, .20) !important;
    transform: translateY(-1px) !important;
}

.site-main :where(
    .btn-secondary,
    .button-secondary,
    .hero-secondary,
    .btn-filter-reset,
    .btn-cancel,
    .btn-secondary-signal,
    .mk-secondary-link,
    .mk-ghost-button,
    .btn-outline,
    .ghost-button,
    .secondary-action
) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .45rem !important;
    min-height: 42px !important;
    padding: 0 .95rem !important;
    border: 1px solid rgba(17, 24, 39, .12) !important;
    border-radius: var(--mk-radius) !important;
    background: #fff !important;
    color: var(--mk-ink) !important;
    box-shadow: var(--mk-shadow-sm) !important;
    font-size: .92rem !important;
    font-weight: 850 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

.site-main :where(
    .btn-secondary:hover,
    .button-secondary:hover,
    .hero-secondary:hover,
    .btn-filter-reset:hover,
    .btn-cancel:hover,
    .btn-secondary-signal:hover,
    .mk-secondary-link:hover,
    .mk-ghost-button:hover,
    .btn-outline:hover,
    .ghost-button:hover,
    .secondary-action:hover
) {
    border-color: rgba(127, 29, 29, .22) !important;
    background: #fff7f7 !important;
    color: var(--mk-brand) !important;
}

.site-main :where(
    .btn-danger,
    .danger-button,
    .btn-secondary-danger,
    .delete-button,
    .remove-button
) {
    background: #b91c1c !important;
    color: #fff !important;
    border-color: rgba(185, 28, 28, .25) !important;
}

/* Forms */
.site-main :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea) {
    min-height: 42px !important;
    border: 1px solid var(--mk-line-strong) !important;
    border-radius: var(--mk-radius) !important;
    background: #fff !important;
    color: var(--mk-ink) !important;
    font: inherit !important;
    box-shadow: none !important;
    outline: none !important;
}

.site-main :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):focus, select:focus, textarea:focus) {
    border-color: rgba(127, 29, 29, .55) !important;
    box-shadow: 0 0 0 3px rgba(127, 29, 29, .10) !important;
}

/* Cards and panels */
.site-main :where(
    .card,
    .panel,
    .content-card,
    .content-section,
    .profile-card,
    .blog-card,
    .bh-post-card,
    .post-card,
    .document-card,
    .forum-category-card,
    .forum-card,
    .signal-card,
    .mk-official-card,
    .mk-result-card,
    .legal-static-card,
    .sidebar-card,
    .blog-sidebar-card,
    .admin-card,
    .dashboard-card,
    .stat-card,
    .form-card,
    .table-card
) {
    border: 1px solid var(--mk-line) !important;
    border-radius: var(--mk-radius-lg) !important;
    background: var(--mk-surface) !important;
    box-shadow: var(--mk-shadow) !important;
}

/* Blog consistency */
.site-main > .blog-hero,
.site-main > .blog-category-page > .cat-hero,
.site-main > .post-hero {
    height: 260px !important;
    min-height: 260px !important;
    margin-top: 0 !important;
}

.site-main > .blog-hero > .blog-hero-inner,
.site-main > .blog-category-page > .cat-hero > .blog-hero-inner,
.site-main > .post-hero > .blog-hero-inner {
    width: min(100%, 900px) !important;
    max-width: 900px !important;
    margin: 0 !important;
    justify-self: start !important;
}

.site-main > .blog-category-page > .cat-hero .cat-stats {
    position: absolute !important;
    right: var(--mk-hero-pad) !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 96px !important;
    min-height: 44px !important;
    padding: .55rem .9rem !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .10) !important;
    color: #fff !important;
    font-weight: 850 !important;
}

.site-main :where(.blog-main-layout, .blog-category-layout, .blog-post-layout, .bh-main-layout) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 300px !important;
    gap: 2rem !important;
    align-items: start !important;
}

.site-main :where(.post-feature, .blog-post-layout .post-feature) {
    width: min(100%, 760px) !important;
    margin-left: 0 !important;
    margin-right: auto !important;
}

.site-main :where(
    .blog-post-layout .post-content,
    .blog-post-layout .post-tags,
    .blog-post-layout .post-share,
    .blog-post-layout .related,
    .blog-post-layout .comments
) {
    margin-left: 0 !important;
    margin-right: auto !important;
}

.site-main :where(.post-feature img, .post-content img) {
    max-width: 100% !important;
    height: clamp(220px, 32vw, 360px) !important;
    object-fit: contain !important;
    object-position: center !important;
    border-radius: var(--mk-radius-lg) !important;
}

.site-main :where(.blog-search) {
    display: flex !important;
    align-items: stretch !important;
    gap: .65rem !important;
    width: min(100%, 560px) !important;
    max-width: 560px !important;
    margin: 1rem 0 0 !important;
}

.site-main :where(.blog-search input) {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.site-main :where(.blog-search button) {
    flex: 0 0 auto !important;
}

/* Compact signal/cetele public metric areas */
.site-main :where(.signals-page .signals-hero, .cetele-page .cetele-hero, .signals-hero, .cetele-hero) {
    min-height: 190px !important;
}

.site-main :where(.signals-stats, .signal-stats, .cetele-stats, .stats-strip) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
    gap: .85rem !important;
    width: min(100% - (var(--mk-gutter) * 2), var(--mk-container)) !important;
    margin: 0 auto 1.25rem !important;
}

.site-main :where(.signals-stats .stat-card, .signal-stats .stat-card, .cetele-stats .stat-card, .stats-strip .stat-card) {
    min-height: 82px !important;
    padding: .85rem 1rem !important;
}

/* Footer legal links in one row on desktop */
.site-footer .footer-links {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: .55rem !important;
    width: 100% !important;
}

.site-footer .footer-links a {
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* Back office rhythm */
.site-main :where(.admin-dashboard, .admin-page, .mod-page) {
    color: var(--mk-ink) !important;
}

.site-main :where(.admin-actions-grid, .quick-actions-grid, .admin-grid, .mod-grid) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
    gap: 1rem !important;
}

.site-main :where(.admin-actions-grid a, .quick-actions-grid a, .admin-action-card) {
    min-height: 104px !important;
    padding: 1rem !important;
    border-radius: var(--mk-radius-lg) !important;
    border: 1px solid var(--mk-line) !important;
    background: var(--mk-surface) !important;
    box-shadow: var(--mk-shadow-sm) !important;
}

/* Mobile */
@media (max-width: 900px) {
    :root {
        --mk-gutter: .5rem;
        --mk-hero-min: auto;
        --mk-hero-pad: 1.35rem;
    }

    .site-main {
        overflow-x: hidden !important;
    }

    .site-main :where(
        .hero-layout,
        .documents-hero .hero-content,
        .tools-hero .hero-content,
        .law-hero .hero-content,
        .city-hero .hero-content,
        .compare-hero .hero-content,
        .announcements-hero .hero-content,
        .users-hero .hero-content,
        .leaderboard-hero .hero-content,
        .mk-hero-header .mk-hero-content,
        .blog-main-layout,
        .blog-category-layout,
        .blog-post-layout,
        .bh-main-layout,
        .page-layout,
        .content-layout,
        .sidebar-layout,
        .post-layout,
        .main-layout,
        .dashboard-grid,
        .cards-grid,
        .modules-grid,
        .profile-grid,
        .forum-grid,
        .city-grid,
        .compare-grid,
        .results-grid,
        .form-grid,
        .filter-grid,
        .search-grid
    ) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .site-main > .blog-hero,
    .site-main > .blog-category-page > .cat-hero,
    .site-main > .post-hero {
        height: auto !important;
        min-height: auto !important;
    }

    .site-main > .blog-category-page > .cat-hero .cat-stats {
        position: static !important;
        transform: none !important;
        margin-top: 1rem !important;
        width: fit-content !important;
    }

    .site-main :where(.post-feature, .blog-post-layout .post-feature) {
        width: 100% !important;
    }
}

@media (max-width: 640px) {
    .site-main :where(
        .hero-actions,
        .page-actions,
        .form-actions,
        .mk-actions,
        .mk-form-actions,
        .filter-form,
        .search-form,
        .forum-search-panel,
        .documents-search-panel,
        .law-search-panel,
        .compare-form,
        .profile-actions
    ) {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: .6rem !important;
    }

    .site-main :where(
        .btn,
        .button,
        .cta-button,
        .primary-action,
        .hero-primary,
        .hero-secondary,
        .btn-filter,
        .btn-submit,
        .btn-cancel,
        .mk-primary-link,
        .mk-secondary-link
    ) {
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
    }

    .site-main :where(.blog-search) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: .5rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .site-main :where(.blog-search button) {
        width: auto !important;
        min-width: 72px !important;
        max-width: none !important;
        padding-inline: .85rem !important;
    }

    .site-main :where(.blog-search input) {
        width: 100% !important;
        min-width: 0 !important;
    }

    .site-footer .footer-links {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .site-footer .footer-links a {
        flex: 0 0 auto !important;
        width: auto !important;
        padding-inline: .8rem !important;
    }

    .site-main :where(input, select, textarea) {
        font-size: 16px !important;
    }
}

/* Targeted hero repairs after the broad theme lock.
   These pages have a two-zone hero: copy/actions on the left and compact stats
   on the right. Keep the shared shell, but do not flatten their internal layout. */
.site-main :where(.documents-hero, .law-hero, .announcements-hero) {
    min-height: 190px !important;
    padding: clamp(1.45rem, 2.6vw, 2.15rem) !important;
}

.site-main :where(.documents-hero .hero-content, .law-hero .hero-content, .announcements-hero .hero-content) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 430px) !important;
    grid-template-areas:
        "copy stats"
        "actions stats" !important;
    align-items: center !important;
    gap: 1rem clamp(1.5rem, 3vw, 2.5rem) !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.site-main :where(.documents-hero .hero-left, .law-hero .hero-left, .announcements-hero .hero-left) {
    grid-area: copy !important;
    align-self: end !important;
    width: 100% !important;
    max-width: 860px !important;
}

.site-main :where(.documents-hero .hero-stats-grid, .law-hero .hero-stats-grid, .announcements-hero .hero-stats-grid) {
    grid-area: stats !important;
    align-self: center !important;
    justify-self: end !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: .75rem !important;
    width: min(100%, 430px) !important;
    max-width: 430px !important;
}

.site-main :where(.documents-hero .hero-stat-card, .law-hero .hero-stat-card, .announcements-hero .hero-stat-card) {
    min-height: 76px !important;
    padding: .85rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: .65rem !important;
}

.site-main :where(.documents-hero .stat-icon, .law-hero .stat-icon, .announcements-hero .stat-icon) {
    flex: 0 0 auto !important;
}

.site-main :where(.documents-hero .stat-value, .law-hero .stat-value, .announcements-hero .stat-value) {
    font-size: 1.25rem !important;
    line-height: 1 !important;
    font-weight: 950 !important;
}

.site-main :where(.documents-hero .stat-label, .law-hero .stat-label, .announcements-hero .stat-label) {
    font-size: .68rem !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
}

.site-main :where(.documents-hero .hero-actions, .law-hero .hero-actions, .announcements-hero .hero-actions) {
    grid-area: actions !important;
    align-self: start !important;
    justify-self: start !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .65rem !important;
    width: auto !important;
    max-width: 100% !important;
}

.site-main .documents-hero .btn-upload {
    grid-area: actions !important;
    align-self: start !important;
    justify-self: start !important;
    width: auto !important;
    min-width: 180px !important;
    max-width: 260px !important;
}

.site-main .law-hero .law-back {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: fit-content !important;
    max-width: max-content !important;
    min-height: 34px !important;
    margin: 0 0 .85rem !important;
    padding: .45rem .75rem !important;
    border: 1px solid rgba(255, 255, 255, .16) !important;
    border-radius: var(--mk-radius) !important;
    background: rgba(255, 255, 255, .10) !important;
    color: #fff !important;
    box-shadow: none !important;
    text-decoration: none !important;
    font-size: .86rem !important;
    font-weight: 850 !important;
}

.site-main .announcements-hero .hero-secondary {
    width: auto !important;
    min-width: 132px !important;
    max-width: max-content !important;
}

/* Compact city/announcement heroes: these should sit closer to the forum header
   rhythm while keeping their right-side metric cards readable. */
.site-main :where(.announcements-hero, .city-hero, .compare-hero) {
    min-height: 170px !important;
    padding: clamp(1.15rem, 2.2vw, 1.75rem) !important;
}

.site-main :where(.city-hero .hero-content, .compare-hero .hero-content) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px) !important;
    align-items: center !important;
    gap: 1rem clamp(1.25rem, 2.4vw, 2rem) !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.site-main :where(.announcements-hero .hero-title, .city-hero .hero-title, .compare-hero .hero-title) {
    font-size: clamp(2rem, 3vw, 2.55rem) !important;
    margin-bottom: .45rem !important;
}

.site-main :where(.announcements-hero .hero-subtitle, .city-hero .hero-subtitle, .compare-hero .hero-subtitle) {
    max-width: 760px !important;
    margin-bottom: .75rem !important;
    line-height: 1.5 !important;
}

.site-main :where(.announcements-hero .hero-stats-grid, .city-hero .hero-stats-grid, .compare-hero .hero-stats-grid) {
    width: min(100%, 420px) !important;
    max-width: 420px !important;
    gap: .6rem !important;
}

.site-main :where(.announcements-hero .hero-stat-card, .city-hero .hero-stat-card, .compare-hero .hero-stat-card) {
    min-height: 66px !important;
    padding: .7rem .78rem !important;
}

.site-main :where(.announcements-hero .stat-value, .city-hero .stat-value, .compare-hero .stat-value) {
    font-size: 1.12rem !important;
}

.site-main :where(.announcements-hero .stat-label, .city-hero .stat-label, .compare-hero .stat-label) {
    font-size: .62rem !important;
}

.site-main :where(.city-hero .hero-actions, .compare-hero .hero-actions) {
    margin-top: .65rem !important;
}

/* Rail alignment: when a hero already lives inside a 1400px page container,
   do not shrink it again with the global 100% - gutter rule. */
.site-main :where(
    .signals-page-container .signals-hero,
    .tools-page .tools-hero,
    .law-page-container .law-hero,
    .law-page .law-hero,
    .search-page-container .search-hero,
    .search-page-container .mk-search-hero,
    .mk-legal-search .mk-search-hero,
    .emsal-page-container .mk-search-hero,
    .mk-aym-search .mk-aym-card,
    .aym-page-container .mk-aym-card,
    .announcements-page-container .announcements-hero,
    .city-page .city-hero,
    .compare-page .compare-hero
) {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.site-main > :where(
    .tools-page,
    .search-page-container,
    .mk-legal-search,
    .mk-aym-search
) {
    width: min(100% - (var(--mk-gutter) * 2), var(--mk-container)) !important;
    max-width: var(--mk-container) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.site-main :where(
    .mk-legal-search .emsal-page-container,
    .mk-aym-search .aym-page-container,
    .site-main > .emsal-page-container,
    .site-main > .aym-page-container
) {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Emsal and AYM pages have older nested rails. Force every major panel to use
   the same edge as the page container, matching the signal/list pages. */
.site-main > :where(.emsal-page-container, .aym-page-container),
.site-main > :where(.mk-legal-search, .mk-aym-search) > :where(.emsal-page-container, .aym-page-container) {
    width: min(100% - (var(--mk-gutter) * 2), var(--mk-container)) !important;
    max-width: var(--mk-container) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.site-main :where(
    .emsal-page-container > .mk-search-hero,
    .emsal-page-container > .mk-results-panel,
    .emsal-page-container > .mk-document-archive-card,
    .emsal-page-container > .mk-source-tabs,
    .aym-page-container > .mk-aym-card,
    .aym-page-container > .mk-aym-results,
    .aym-page-container > .mk-results-panel,
    .mk-legal-search > .mk-search-hero,
    .mk-legal-search > .mk-results-panel,
    .mk-aym-search > .mk-aym-card,
    .mk-aym-search > .mk-aym-results
) {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Cetele must align all main blocks to one exact width. */
.site-main > .cetele-page-container {
    width: min(100% - 2rem, var(--mk-container)) !important;
    max-width: var(--mk-container) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.site-main .cetele-page-container :where(
    .cetele-hero,
    .archive-focus-grid,
    .archive-save-alert,
    .generated-documents-panel,
    .personal-archive-panel,
    .stats-grid-modern,
    .filters-container-modern,
    .tasks-grid-modern
) {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

.site-main .cetele-page-container .cetele-hero {
    min-height: 190px !important;
}

.site-main .cetele-page-container .cetele-hero .hero-content {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    align-items: center !important;
    gap: 1rem clamp(1rem, 2.5vw, 2rem) !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.site-main .cetele-page-container .cetele-hero .hero-left {
    align-self: center !important;
}

.site-main .cetele-page-container .cetele-hero .hero-title {
    margin: 0 !important;
    line-height: 1.05 !important;
}

.site-main .cetele-page-container .cetele-hero .hero-subtitle {
    margin-top: .55rem !important;
}

.site-main .cetele-page-container .hero-progress,
.site-main .cetele-page-container .hero-actions {
    align-self: center !important;
    justify-self: end !important;
}

.site-main .cetele-page-container .stats-grid-modern {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1rem !important;
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
}

.site-main .cetele-page-container .stat-card-cetele {
    min-height: 112px !important;
    padding: 1rem !important;
}

@media (max-width: 1100px) {
    .site-main :where(.documents-hero .hero-content, .law-hero .hero-content, .announcements-hero .hero-content) {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas:
            "copy"
            "stats"
            "actions" !important;
    }

    .site-main :where(.documents-hero .hero-stats-grid, .law-hero .hero-stats-grid, .announcements-hero .hero-stats-grid) {
        justify-self: start !important;
        width: min(100%, 560px) !important;
        max-width: 560px !important;
    }
}

@media (max-width: 900px) {
    .site-main .cetele-page-container .cetele-hero .hero-content {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .site-main .cetele-page-container .hero-progress,
    .site-main .cetele-page-container .hero-actions {
        justify-self: start !important;
    }

    .site-main .cetele-page-container .stats-grid-modern {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    .site-main :where(.documents-hero .hero-stats-grid, .law-hero .hero-stats-grid, .announcements-hero .hero-stats-grid),
    .site-main .cetele-page-container .stats-grid-modern {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .site-main > .cetele-page-container {
        width: min(100% - 1rem, var(--mk-container)) !important;
    }

    .site-main .documents-hero .btn-upload,
    .site-main .announcements-hero .hero-secondary {
        width: 100% !important;
        max-width: 100% !important;
    }
}
/* Final public-page rail overrides for legacy modules that still use older shells. */
.site-main > :where(
    .emsal-page-container,
    .aym-page-container,
    .becayis-page-container,
    .becayis-page,
    .leaderboard-page,
    .mk-legal-search,
    .mk-aym-search
) {
    width: min(100% - (var(--mk-gutter) * 2), var(--mk-container)) !important;
    max-width: var(--mk-container) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.site-main :where(
    .mk-legal-search .emsal-page-container,
    .mk-aym-search .aym-page-container,
    .emsal-page-container,
    .aym-page-container,
    .becayis-page-container,
    .becayis-page,
    .leaderboard-page
) {
    box-sizing: border-box;
}

.site-main :where(
    .mk-legal-search :where(.mk-search-hero, .mk-results-panel, .mk-document-archive-card, .mk-source-tabs, .mk-official-search, .mk-example-list, .mk-search-form),
    .emsal-page-container :where(.mk-search-hero, .mk-results-panel, .mk-document-archive-card, .mk-source-tabs, .mk-official-search, .mk-example-list, .mk-search-form),
    .mk-aym-search :where(.mk-aym-card, .mk-aym-results, .mk-aym-form, .mk-results-panel),
    .aym-page-container :where(.mk-aym-card, .mk-aym-results, .mk-aym-form, .mk-results-panel),
    .becayis-page-container :where(.becayis-hero, .becayis-filter-bar, .becayis-toolbar, .becayis-tabs, .becayis-listings, .becayis-grid, .listing-grid, .becayis-empty, .forum-card, .section-card),
    .becayis-page :where(.becayis-hero, .becayis-filter-bar, .becayis-toolbar, .becayis-tabs, .becayis-listings, .becayis-grid, .listing-grid, .becayis-empty, .forum-card, .section-card),
    .leaderboard-page :where(.leaderboard-hero, .leaderboard-grid, .leaderboard-board, .leaderboard-panel, .leaderboard-card, .leaderboard-tabs, .leaderboard-list)
) {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

.site-main :where(
    .becayis-page-container .becayis-hero,
    .becayis-page .becayis-hero,
    .leaderboard-page .leaderboard-hero,
    .emsal-page-container .mk-search-hero,
    .mk-legal-search .mk-search-hero,
    .aym-page-container .mk-aym-card,
    .mk-aym-search .mk-aym-card
) {
    min-height: var(--mk-hero-min) !important;
    padding: clamp(1.35rem, 2.5vw, 2rem) !important;
}

/* Hard rail lock: these pages still appear with legacy wrappers on some routes. */
body :where(
    .mk-legal-search,
    .mk-aym-search,
    .emsal-page-container,
    .aym-page-container,
    .becayis-wrap,
    .becayis-page-container,
    .becayis-page,
    .leaderboard-page
) {
    width: min(100% - (var(--mk-gutter) * 2), var(--mk-container)) !important;
    max-width: var(--mk-container) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
}

body :where(
    .mk-legal-search .mk-search-hero,
    .mk-legal-search .mk-results-panel,
    .mk-legal-search .mk-document-archive-card,
    .mk-legal-search .mk-source-tabs,
    .mk-legal-search .mk-search-form,
    .mk-aym-search .mk-aym-card,
    .mk-aym-search .mk-aym-results,
    .mk-aym-search .mk-aym-form,
    .emsal-page-container .mk-search-hero,
    .emsal-page-container .mk-results-panel,
    .emsal-page-container .mk-document-archive-card,
    .emsal-page-container .mk-source-tabs,
    .aym-page-container .mk-aym-card,
    .aym-page-container .mk-aym-results,
    .becayis-wrap .becayis-hero,
    .becayis-wrap .becayis-filter-bar,
    .becayis-wrap .becayis-toolbar,
    .becayis-wrap .becayis-tabs,
    .becayis-wrap .becayis-grid,
    .becayis-wrap .listing-grid,
    .becayis-page-container .becayis-hero,
    .becayis-page-container .becayis-filter-bar,
    .becayis-page-container .listing-grid,
    .leaderboard-page .leaderboard-hero,
    .leaderboard-page .leaderboard-container,
    .leaderboard-page .leaderboard-grid,
    .leaderboard-page .leaderboard-list
) {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

body :where(
    .becayis-wrap .becayis-hero,
    .becayis-page-container .becayis-hero,
    .leaderboard-page .leaderboard-hero,
    .mk-legal-search .mk-search-hero,
    .emsal-page-container .mk-search-hero,
    .mk-aym-search .mk-aym-card,
    .aym-page-container .mk-aym-card
) {
    min-height: var(--mk-hero-min) !important;
    padding: clamp(1.35rem, 2.5vw, 2rem) !important;
}

/* Strong rail fix: prevent double gutter shrink on older public modules. */
body .site-main .mk-legal-search,
body .site-main .mk-aym-search,
body .site-main .emsal-page-container,
body .site-main .aym-page-container,
body .site-main .becayis-wrap,
body .site-main .becayis-page-container,
body .site-main .leaderboard-page {
    width: min(100% - (var(--mk-gutter) * 2), var(--mk-container)) !important;
    max-width: var(--mk-container) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body .site-main .mk-legal-search > .emsal-page-container,
body .site-main .mk-aym-search > .aym-page-container {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body .site-main .mk-legal-search .mk-search-hero,
body .site-main .emsal-page-container .mk-search-hero,
body .site-main .mk-aym-search .mk-aym-card,
body .site-main .aym-page-container .mk-aym-card,
body .site-main .becayis-wrap .becayis-hero,
body .site-main .becayis-page-container .becayis-hero,
body .site-main .leaderboard-page .leaderboard-hero {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

body .site-main .mk-legal-search .mk-results-panel,
body .site-main .mk-legal-search .mk-document-archive-card,
body .site-main .mk-legal-search .mk-source-tabs,
body .site-main .emsal-page-container .mk-results-panel,
body .site-main .emsal-page-container .mk-document-archive-card,
body .site-main .emsal-page-container .mk-source-tabs,
body .site-main .mk-aym-search .mk-aym-results,
body .site-main .aym-page-container .mk-aym-results,
body .site-main .becayis-wrap .becayis-filter-bar,
body .site-main .becayis-wrap .becayis-tabs,
body .site-main .becayis-wrap .becayis-grid,
body .site-main .becayis-wrap .listing-grid,
body .site-main .leaderboard-page .leaderboard-container,
body .site-main .leaderboard-page .leaderboard-grid,
body .site-main .leaderboard-page .leaderboard-list {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

/* Direct main wrappers: AYM/Emsal pages use the module class on <main>, not inside .site-main. */
main.mk-legal-search,
main.mk-aym-search {
    width: min(100% - (var(--mk-gutter) * 2), var(--mk-container)) !important;
    max-width: var(--mk-container) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

main.mk-legal-search > .emsal-page-container,
main.mk-aym-search > .aym-page-container {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

main.mk-legal-search > .emsal-page-container > .mk-hero-header,
main.mk-aym-search > .aym-page-container > .mk-hero-header,
main.mk-legal-search > .mk-document-archive-card,
main.mk-legal-search > .mk-search-hero,
main.mk-legal-search > .mk-results-panel,
main.mk-aym-search > .mk-aym-card,
main.mk-aym-search > .mk-aym-results {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

main.mk-legal-search > .emsal-page-container > .mk-hero-header,
main.mk-aym-search > .aym-page-container > .mk-hero-header {
    min-height: var(--mk-hero-min) !important;
    padding: clamp(1.35rem, 2.5vw, 2rem) !important;
}

/* Direct main wrappers: announcements, city guide and city comparison pages. */
main.mk-announcements,
main.mk-cities-main,
main.mk-compare-main {
    width: min(100% - (var(--mk-gutter) * 2), var(--mk-container)) !important;
    max-width: var(--mk-container) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

main.mk-announcements > .announcements-page-container,
main.mk-cities-main > .city-page,
main.mk-compare-main > .compare-page {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

main.mk-announcements > .announcements-page-container > *,
main.mk-cities-main > .city-page > *,
main.mk-compare-main > .compare-page > * {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

main.mk-announcements .announcements-hero,
main.mk-cities-main .city-hero,
main.mk-compare-main .compare-hero {
    min-height: var(--mk-hero-min) !important;
    padding: clamp(1.35rem, 2.5vw, 2rem) !important;
}
/* Final page-specific polish: becayis hero action rail and profile card contrast */
main.becayis-wrap .becayis-hero-inner {
    width: 100% !important;
    max-width: none !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(220px, auto) !important;
    grid-template-areas:
        "eyebrow actions"
        "title actions"
        "lead actions"
        "stats actions" !important;
    align-items: center !important;
    column-gap: clamp(1.25rem, 4vw, 3rem) !important;
}

main.becayis-wrap .becayis-hero .hero-eyebrow {
    grid-area: eyebrow;
    justify-self: start;
}

main.becayis-wrap .becayis-hero h1 {
    grid-area: title;
}

main.becayis-wrap .becayis-hero p {
    grid-area: lead;
}

main.becayis-wrap .becayis-hero .hero-stats {
    grid-area: stats;
    max-width: 760px;
}

main.becayis-wrap .becayis-hero-actions {
    grid-area: actions;
    justify-self: end;
    align-self: center;
    display: flex !important;
    flex-direction: column !important;
    gap: .7rem !important;
    width: min(240px, 100%) !important;
}

main.becayis-wrap .becayis-hero-actions .btn-hero {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: center !important;
}

.profile-page .profile-card {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e4dfd7 !important;
    box-shadow: 0 20px 46px rgba(15, 23, 42, .12) !important;
    text-align: center !important;
}

.profile-page .profile-username,
.profile-page .profile-card h1 {
    color: var(--rank-color, #dc2626) !important;
    text-shadow: none !important;
}

.profile-page .profile-stats-mini {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .75rem !important;
    margin: 1rem 0 !important;
}

.profile-page .stat-mini,
.profile-page .profile-info-chip,
.profile-page .profile-meta {
    width: 100% !important;
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;
    color: #111827 !important;
    box-shadow: none !important;
}

.profile-page .profile-info-label,
.profile-page .stat-label,
.profile-page .profile-meta p {
    color: #64748b !important;
}

.profile-page .profile-info-value,
.profile-page .stat-value,
.profile-page .profile-meta strong {
    color: #111827 !important;
}

.profile-page .profile-info-chip,
.profile-page .profile-meta {
    text-align: left !important;
}

.profile-page .profile-actions,
.profile-page .profile-card > .btn {
    width: 100% !important;
}

@media (max-width: 900px) {
    main.becayis-wrap .becayis-hero-inner {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "eyebrow"
            "title"
            "lead"
            "stats"
            "actions" !important;
    }

    main.becayis-wrap .becayis-hero-actions {
        justify-self: stretch;
        width: 100% !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }

    main.becayis-wrap .becayis-hero-actions .btn-hero {
        flex: 1 1 190px !important;
    }
}

@media (max-width: 520px) {
    .profile-page .profile-stats-mini {
        grid-template-columns: 1fr !important;
    }
}
