/* Extracted from includes/header.php. Keep header/nav/global shell rules here. */

:root {
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg-base: #f7f7f5;
    --mk-ink: #18181b;
    --mk-muted: #71717a;
    --mk-border: rgba(24, 24, 27, .10);
    --mk-surface: #ffffff;
    --mk-red: #dc2626;
    --mk-red-dark: #7f1d1d;
    --mk-shadow: 0 18px 45px rgba(24, 24, 27, .08);
}

* { 

    margin: 0; 

    padding: 0; 

    box-sizing: border-box; 

}



body { 

    font-family: var(--font-sans);

    background: var(--bg-base);

    padding-top: 70px;

}



/* ═══════════════════════════════════════════════════════════

   HEADER - Modern & Balanced

   ═══════════════════════════════════════════════════════════ */

.header {

    position: fixed;

    top: 0;

    left: 0;

    right: 0;

    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);

    color: white;

    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45), 0 1px 0 0 rgba(255,255,255,0.04) inset;

    z-index: 1000;

    backdrop-filter: blur(20px);

}



.header::before {

    content: '';

    position: absolute;

    inset: 0;

    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 40%);

    pointer-events: none;

}

.header::after {

    content: '';

    position: absolute;

    bottom: 0;

    left: 0;

    right: 0;

    height: 1px;

    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 30%, rgba(255,255,255,0.08) 70%, transparent 100%);

    pointer-events: none;

}



.header-content {

    max-width: 1600px;

    margin: 0 auto;

    padding: 0 2rem;

    display: flex;

    justify-content: space-between;

    align-items: center;

    height: 70px;

    position: relative;

}



/* ═══════════════════════════════════════════════════════════

   LOGO - Support for both text and image

   ═══════════════════════════════════════════════════════════ */

.logo {

    display: flex;

    align-items: center;

    gap: 0.5rem;

    text-decoration: none;

    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));

    flex-shrink: 0;

}



.logo:hover {

    transform: translateY(-2px);

    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));

}



/* Logo için resim */

.logo-image {

    height: 50px;

    width: auto;

    display: block;

}



/* Logo için text (eğer resim yoksa) */

.logo-text {

    font-size: 1.5rem;

    font-weight: 900;

    color: white;

    letter-spacing: -0.02em;

}



/* ═══════════════════════════════════════════════════════════

   NAVIGATION WRAPPER

   ═══════════════════════════════════════════════════════════ */

.nav-wrapper {

    display: flex;

    align-items: center;

    gap: 2rem;

    flex: 1;

    margin-left: 2rem;

}



/* ═══════════════════════════════════════════════════════════

   NAVIGATION LINKS - Icons and text properly aligned

   ═══════════════════════════════════════════════════════════ */

.nav {

    display: flex;

    gap: 0.25rem;

    align-items: center;

    flex: 1;

}



.nav-link {

    color: rgba(255, 255, 255, 0.75);

    text-decoration: none;

    padding: 0.5rem 0.875rem;

    border-radius: 6px;

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    font-weight: 500;

    font-size: 0.875rem;

    white-space: nowrap;

    display: inline-flex;

    align-items: center;

    gap: 0.4rem;

    border: 1px solid transparent;

    background: transparent;

    letter-spacing: 0.01em;

}



.nav-link:hover {

    color: white;

    background: rgba(255, 255, 255, 0.08);

    border-color: rgba(255, 255, 255, 0.10);

}

.nav-link.active {

    color: white;

    background: rgba(255, 255, 255, 0.12);

    border-color: rgba(255, 255, 255, 0.14);

    font-weight: 600;

}



.nav-link-icon {

    font-size: 1.1rem;

    line-height: 1;

}



.nav-link-text {

    line-height: 1;

}

.nav > a[href="/sinyaller"],
.nav > a[href="/cetele"],
.nav > a[href="/chat.php"],
.nav > a[href="/kullanicilar"],
.nav > a[href="/liderlik"] {
    display: none;
}

.nav-dropdown {
    position: relative;
    display: inline-flex;
}

.nav-dropdown-toggle {
    cursor: default;
}

.nav-dropdown-toggle::after {
    content: '⌄';
    font-size: 0.8rem;
    opacity: 0.75;
    transition: transform 0.18s ease;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.65rem);
    left: 0;
    min-width: 240px;
    padding: 0.45rem;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.42);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 1001;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown.open .nav-dropdown-toggle::after {
    transform: rotate(180deg);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.72rem 0.78rem;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

.nav-dropdown-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
}

.nav-dropdown-item small {
    display: block;
    margin-top: 0.12rem;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.72rem;
    font-weight: 500;
}



/* ═══════════════════════════════════════════════════════════

   USER MENU - Properly sized buttons

   ═══════════════════════════════════════════════════════════ */

.user-menu {

    display: flex;

    align-items: center;

    gap: 0.5rem;

    margin-left: auto;

    padding-left: 1rem;

    border-left: 1px solid rgba(255, 255, 255, 0.10);

    flex-shrink: 0;

}



/* ═══════════════════════════════════════════════════════════

   MESSAGE ICON - Compact and balanced

   ═══════════════════════════════════════════════════════════ */

.message-icon-header {

    position: relative;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: 38px;

    height: 38px;

    border-radius: 6px;

    background: rgba(255, 255, 255, 0.08);

    color: rgba(255, 255, 255, 0.85);

    font-size: 1.1rem;

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    border: 1px solid rgba(255, 255, 255, 0.10);

    text-decoration: none;

}



.message-icon-header:hover {

    background: rgba(255, 255, 255, 0.14);

    border-color: rgba(255, 255, 255, 0.18);

    color: white;

}



.message-badge {

    position: absolute;

    top: -6px;

    right: -6px;

    background: linear-gradient(135deg, #ef4444, #dc2626);

    color: white;

    font-size: 0.65rem;

    font-weight: 800;

    padding: 3px 6px;

    border-radius: 10px;

    min-width: 18px;

    text-align: center;

    border: 2px solid #1e293b;

    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.5);

    animation: pulse 2s infinite;

}

.notification-center {
    position: relative;
    display: inline-flex;
}

.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    font: inherit;
    font-size: 1.08rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    padding: 3px 6px;
    border: 2px solid #1e293b;
    border-radius: 10px;
    background: linear-gradient(135deg, #f97316, #dc2626);
    color: #fff;
    font-size: .65rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    box-shadow: 0 2px 12px rgba(249, 115, 22, .42);
}

.notification-bell.has-new-alert {
    animation: notificationBellRing .7s ease both;
}

@keyframes notificationBellRing {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(-10deg) scale(1.04); }
    30% { transform: rotate(9deg) scale(1.04); }
    45% { transform: rotate(-7deg) scale(1.02); }
    60% { transform: rotate(5deg) scale(1.02); }
    75% { transform: rotate(-2deg); }
}

.notification-panel {
    position: fixed;
    top: 76px;
    right: max(1rem, calc((100vw - 1400px) / 2 + 1rem));
    z-index: 1200;
    width: min(420px, calc(100vw - 1.5rem));
    max-height: min(680px, calc(100dvh - 92px));
    overflow: auto;
    padding: .9rem;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 14px;
    background: #18181b;
    color: #fff;
    box-shadow: 0 26px 70px rgba(0, 0, 0, .36);
}

.notification-panel[hidden] {
    display: none !important;
}

.notification-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: .25rem .25rem .85rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.notification-kicker {
    color: rgba(255, 255, 255, .56);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.notification-panel-header h2 {
    margin: .15rem 0 0;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 900;
}

.notification-close {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.notification-list {
    display: grid;
    gap: .55rem;
    padding: .85rem 0;
}

.notification-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: .75rem;
    padding: .75rem;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    background: rgba(255, 255, 255, .045);
    color: #fff;
    text-decoration: none;
}

.notification-item:hover {
    background: rgba(255, 255, 255, .08);
}

.notification-item.is-unread {
    border-color: rgba(248, 113, 113, .30);
    background: rgba(127, 29, 29, .23);
}

.notification-item-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, .08);
}

.notification-item-body {
    min-width: 0;
    display: grid;
    gap: .18rem;
}

.notification-item-body strong {
    color: #fff;
    font-size: .92rem;
    font-weight: 900;
    line-height: 1.25;
}

.notification-item-body small {
    overflow: hidden;
    color: rgba(255, 255, 255, .70);
    font-size: .8rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-item-body em {
    color: rgba(255, 255, 255, .48);
    font-size: .74rem;
    font-style: normal;
    font-weight: 700;
}

.notification-empty {
    display: grid;
    justify-items: center;
    gap: .35rem;
    padding: 1.4rem .75rem;
    color: rgba(255, 255, 255, .68);
    text-align: center;
}

.notification-empty span {
    font-size: 1.8rem;
}

.notification-empty strong {
    color: #fff;
    font-weight: 900;
}

.notification-empty p {
    margin: 0;
    max-width: 280px;
    font-size: .84rem;
    line-height: 1.5;
}

.notification-highlight {
    display: grid;
    gap: .18rem;
    margin-top: .15rem;
    padding: .8rem;
    border: 1px solid rgba(212, 163, 115, .24);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(127, 29, 29, .34), rgba(212, 163, 115, .12));
    color: #fff;
    text-decoration: none;
}

.notification-highlight span {
    color: rgba(255, 255, 255, .56);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.notification-highlight strong {
    font-size: .92rem;
    font-weight: 900;
}

.notification-highlight small {
    color: rgba(255, 255, 255, .72);
    font-size: .78rem;
    line-height: 1.45;
}

.notification-panel-footer {
    display: flex;
    justify-content: space-between;
    gap: .65rem;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.notification-panel-footer a,
.notification-panel-footer button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 .75rem;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: .8rem;
    font-weight: 900;
    text-decoration: none;
}

.notification-panel-footer a:hover,
.notification-panel-footer button:hover {
    background: rgba(255, 255, 255, .11);
}



@keyframes pulse {

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

    50% { transform: scale(1.1); }

}



/* ═══════════════════════════════════════════════════════════

   USERNAME BUTTON - Icon and text separated

   ═══════════════════════════════════════════════════════════ */

.username-link {

    padding: 0.4rem 0.875rem;

    background: rgba(255, 255, 255, 0.08);

    border-radius: 6px;

    font-weight: 600;

    display: inline-flex;

    align-items: center;

    gap: 0.5rem;

    font-size: 0.85rem;

    border: 1px solid rgba(255, 255, 255, 0.10);

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    text-decoration: none;

    color: rgba(255, 255, 255, 0.9);

}



.username-link:hover {

    background: rgba(255, 255, 255, 0.14);

    border-color: rgba(255, 255, 255, 0.18);

    color: white;

}



.username-icon {

    font-size: 1.1rem;

    line-height: 1;

}



.username-text {

    line-height: 1;

}



/* ═══════════════════════════════════════════════════════════

   ADMIN/MOD BADGES - Icon and text separated

   ═══════════════════════════════════════════════════════════ */

.admin-badge,

.mod-badge {

    padding: 0.4rem 0.875rem;

    border-radius: 6px;

    font-weight: 600;

    font-size: 0.8rem;

    display: inline-flex;

    align-items: center;

    gap: 0.4rem;

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    border: 1px solid rgba(255, 255, 255, 0.15);

    text-decoration: none;

    color: white;

}



.admin-badge {

    background: rgba(220, 38, 38, 0.85);

}



.admin-badge:hover {

    background: rgba(220, 38, 38, 1);

    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5);

}



.mod-badge {

    background: rgba(16, 185, 129, 0.85);

}



.mod-badge:hover {

    background: rgba(16, 185, 129, 1);

    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.5);

}



.user-menu .badge-icon {

    font-size: 0.85rem;

    line-height: 1;

    display: inline;

}



.user-menu .badge-text {

    line-height: 1;

    font-size: inherit;

    font-weight: inherit;

    letter-spacing: normal;

}



/* ═══════════════════════════════════════════════════════════

   LOGOUT BUTTON - Icon and text separated

   ═══════════════════════════════════════════════════════════ */

.logout-btn {

    padding: 0.4rem 0.875rem;

    background: rgba(239, 68, 68, 0.15);

    border-radius: 6px;

    font-weight: 600;

    display: inline-flex;

    align-items: center;

    gap: 0.4rem;

    font-size: 0.8rem;

    border: 1px solid rgba(239, 68, 68, 0.25);

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    text-decoration: none;

    color: rgba(255, 255, 255, 0.85);

}



.logout-btn:hover {

    background: rgba(239, 68, 68, 0.25);

    border-color: rgba(239, 68, 68, 0.40);

    color: white;

}



.logout-icon {

    font-size: 1rem;

    line-height: 1;

}



.logout-text {

    line-height: 1;

}



/* ═══════════════════════════════════════════════════════════

   LOGIN BUTTON (Guest)

   ═══════════════════════════════════════════════════════════ */

.login-btn {

    padding: 0.5rem 1.25rem;

    background: rgba(255, 255, 255, 0.08);

    border-radius: 6px;

    font-weight: 600;

    display: inline-flex;

    align-items: center;

    gap: 0.5rem;

    font-size: 0.875rem;

    border: 1px solid rgba(255, 255, 255, 0.15);

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    text-decoration: none;

    color: rgba(255, 255, 255, 0.9);

}



.login-btn:hover {

    background: rgba(255, 255, 255, 0.14);

    border-color: rgba(255, 255, 255, 0.22);

    color: white;

}

.guest-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1.5rem;
    flex: 0 0 auto;
}



/* ═══════════════════════════════════════════════════════════

   MOBILE MENU BUTTON

   ═══════════════════════════════════════════════════════════ */

.mobile-menu-btn {

    display: none;

    background: rgba(255, 255, 255, 0.08);

    border: 1px solid rgba(255, 255, 255, 0.12);

    color: rgba(255, 255, 255, 0.85);

    font-size: 1.3rem;

    width: 40px;

    height: 40px;

    border-radius: 6px;

    cursor: pointer;

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    align-items: center;

    justify-content: center;

}



.mobile-menu-btn:hover {

    background: rgba(255, 255, 255, 0.14);

    border-color: rgba(255, 255, 255, 0.20);

    color: white;

}



/* ═══════════════════════════════════════════════════════════

   GLOBAL STYLES (Çetele, Alerts, etc.)

   ═══════════════════════════════════════════════════════════ */

.cetele-container {

    max-width: 1200px;

    margin: 2rem auto;

    padding: 0 2rem;

}



.cetele-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 2rem;

    padding: 1.5rem 2rem;

    background: white;

    border-radius: 12px;

    box-shadow: 0 2px 8px rgba(0,0,0,0.05);

}



.cetele-header .header-left h1 {

    font-size: 2rem;

    color: #1f2937;

    margin: 0 0 0.5rem 0;

}



.cetele-header .header-left p {

    color: #6b7280;

    margin: 0;

}



.cetele-header .header-right {

    display: flex;

    gap: 1rem;

}



.btn-back,

.btn-categories,

.btn-add {

    padding: 0.75rem 1.5rem;

    border-radius: 8px;

    font-weight: 600;

    text-decoration: none;

    transition: all 0.3s;

    display: inline-block;

}



.btn-back,

.btn-categories {

    background: #f3f4f6;

    color: #374151;

}



.btn-back:hover,

.btn-categories:hover {

    background: #e5e7eb;

}



.btn-add {

    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);

    color: white;

}



.btn-add:hover {

    transform: translateY(-2px);

    box-shadow: 0 6px 20px rgba(30, 41, 59, 0.4);

}



.alert {

    padding: 1rem 1.5rem;

    border-radius: 8px;

    margin-bottom: 1.5rem;

}



.alert-success {

    background: #d1fae5;

    color: #065f46;

    border-left: 4px solid #10b981;

}



.alert-error {

    background: #fee2e2;

    color: #991b1b;

    border-left: 4px solid #ef4444;

}



.alert-warning {

    background: #fef3c7;

    color: #92400e;

    border-left: 4px solid #f59e0b;

}



/* ═══════════════════════════════════════════════════════════

   RESPONSIVE - TABLET

   ═══════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {

    .header-content {

        padding: 0 1.5rem;

    }

    

    .nav {

        gap: 0.4rem;

    }

    

    .nav-link {

        padding: 0.45rem 0.8rem;

        font-size: 0.85rem;

    }

    

    .user-menu {

        gap: 0.6rem;

        padding-left: 1rem;

        margin-left: 1rem;

    }

}



/* ═══════════════════════════════════════════════════════════

   RESPONSIVE - MOBILE

   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    body {

        padding-top: 65px;

    }

    

    .header-content {

        height: 65px;

        padding: 0 1rem;

        gap: 0.75rem;

    }

    

    .logo-image {

        height: 40px;

    }

    

    .logo-text {

        font-size: 1.2rem;

    }

    

    .mobile-menu-btn {

        display: flex;

    }

    

    .nav-wrapper {

        position: fixed;

        top: 65px;

        left: 0;

        right: 0;

        background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);

        flex-direction: column;

        gap: 0;

        padding: 0;

        box-shadow: 0 4px 20px rgba(0,0,0,0.4);

        max-height: 0;

        overflow: hidden;

        transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;

        z-index: 999;

        opacity: 0;

        visibility: hidden;

        margin-left: 0;

    }

    

    .nav-wrapper.active {

        max-height: calc(100vh - 65px);

        overflow-y: auto;

        padding: 1rem;

        opacity: 1;

        visibility: visible;

    }

    

    .nav {

        flex-direction: column;

        width: 100%;

        gap: 0.5rem;

    }

    

    .nav-link {

        width: 100%;

        padding: 0.9rem 1.2rem;

        justify-content: flex-start;

        background: rgba(255, 255, 255, 0.1);

        font-size: 1rem;

    }

    

    .nav-link:hover {

        background: rgba(255, 255, 255, 0.2);

        transform: translateX(4px);

    }

    .nav-dropdown {
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .nav-dropdown-toggle {
        cursor: pointer;
    }

    .nav-dropdown-menu {
        position: static;
        min-width: 0;
        width: 100%;
        margin-top: 0.35rem;
        padding: 0.35rem;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
        transform: translateY(-4px);
        box-shadow: none;
        background: rgba(255, 255, 255, 0.06);
        transition: max-height 0.22s ease, opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    }

    .nav-dropdown:hover .nav-dropdown-menu,
    .nav-dropdown:focus-within .nav-dropdown-menu {
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
    }

    .nav-dropdown.open .nav-dropdown-menu {
        max-height: 70vh;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        overflow-y: auto;
    }

    .nav-dropdown.open .nav-dropdown-toggle {
        background: rgba(255, 255, 255, 0.18);
    }

    .guest-nav {
        flex-direction: row;
        width: auto;
        gap: 0.35rem;
        margin-left: auto;
        flex: 0 1 auto;
    }

    .guest-nav .nav-link,
    .guest-nav .login-btn {
        width: auto;
        padding: 0.58rem 0.7rem;
        justify-content: center;
        font-size: 0.82rem;
        line-height: 1;
        white-space: nowrap;
    }

    .guest-nav .nav-link {
        background: rgba(255, 255, 255, 0.08);
    }

    .guest-nav .nav-link-icon {
        font-size: 1rem;
    }

    

    .user-menu {

        flex-direction: column;

        width: 100%;

        margin: 0;

        padding: 0;

        border: none;

        gap: 0.5rem;

        margin-top: 1rem;

        padding-top: 1rem;

        border-top: 2px solid rgba(255, 255, 255, 0.25);

    }

    

    .username-link,

    .admin-badge,

    .mod-badge,

    .logout-btn {

        width: 100%;

        justify-content: center;

        padding: 0.9rem 1.2rem;

    }

    

    .message-icon-header {

        width: 100%;

        height: 50px;

        border-radius: 10px;

    }

}

@media (max-width: 420px) {
    .header-content {
        padding: 0 0.65rem;
        min-width: 0;
    }

    .logo {
        min-width: 0;
    }

    .logo-image {
        height: 36px;
    }

    .logo-text {
        font-size: 1rem;
        max-width: 48vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .guest-nav .nav-link,
    .guest-nav .login-btn {
        padding: 0.5rem 0.55rem;
        font-size: 0.78rem;
        gap: 0.28rem;
    }

    .guest-nav .nav-link-text {
        display: none;
    }
}






/* BECAYİŞ NAV BUTONU */
.nav-link-becayis {
    background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(139,92,246,0.18)) !important;
    border-color: rgba(99,179,237,0.35) !important;
    color: #93c5fd !important;
    font-weight: 700 !important;
}
.nav-link-becayis:hover {
    background: linear-gradient(135deg, rgba(59,130,246,0.30), rgba(139,92,246,0.30)) !important;
    color: #fff !important;
    border-color: rgba(99,179,237,0.55) !important;
    box-shadow: 0 0 12px rgba(59,130,246,0.3);
}
.becayis-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    border: 1.5px solid #1e293b;
    animation: pulse 2s infinite;
}

/* Memur Kahvesi design refresh - header phase */
body {
    background:
        linear-gradient(180deg, #fafafa 0%, #f6f5f2 420px, #f7f7f5 100%) !important;
    color: #18181b;
    max-width: 100%;
    overflow-x: hidden;
}

.header {
    background: rgba(24, 24, 27, .96) !important;
    border-bottom: 1px solid rgba(228, 223, 215, .14);
    box-shadow: 0 14px 34px rgba(17, 24, 39, .22) !important;
}

.header::before {
    background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, transparent 55%) !important;
}

.header::after {
    background: linear-gradient(90deg, transparent 0%, rgba(212, 163, 115, .28) 28%, rgba(127, 29, 29, .44) 52%, rgba(212, 163, 115, .24) 74%, transparent 100%) !important;
}

.header-content {
    max-width: 1400px !important;
    padding-left: clamp(1rem, 3vw, 1.5rem) !important;
    padding-right: clamp(1rem, 3vw, 1.5rem) !important;
}

.nav {
    gap: .25rem !important;
}

.nav-link,
.nav-dropdown-toggle,
.message-icon-header,
.notification-bell,
.profile-trigger {
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    color: rgba(255,255,255,.82) !important;
    letter-spacing: 0 !important;
}

.nav-link:hover,
.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown:focus-within .nav-dropdown-toggle,
.message-icon-header:hover,
.notification-bell:hover,
.profile-trigger:hover {
    background: rgba(255,255,255,.08) !important;
    border-color: rgba(255,255,255,.10) !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
}

.nav-link.active,
.nav-dropdown.open .nav-dropdown-toggle {
    background: rgba(127, 29, 29, .34) !important;
    border-color: rgba(248, 113, 113, .26) !important;
    color: #fff !important;
}

.nav-link-becayis {
    background: rgba(127, 29, 29, .22) !important;
    border-color: rgba(248, 113, 113, .22) !important;
    color: rgba(255,255,255,.9) !important;
}

.nav-link-becayis:hover {
    background: rgba(127, 29, 29, .34) !important;
    border-color: rgba(248, 113, 113, .34) !important;
    box-shadow: none !important;
}

.nav-dropdown-menu,
.notification-dropdown,
.profile-dropdown {
    background: #18181b !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 10px !important;
    box-shadow: 0 22px 55px rgba(0,0,0,.28) !important;
}

.nav-dropdown-item,
.notification-item,
.profile-menu-item {
    border-radius: 8px !important;
}

.nav-dropdown-item:hover,
.notification-item:hover,
.profile-menu-item:hover {
    background: rgba(255,255,255,.08) !important;
}

.mobile-menu-btn {
    border-radius: 8px !important;
}

@media (max-width: 768px) {
    .nav-wrapper {
        background: #18181b !important;
        border-top: 1px solid rgba(255,255,255,.08);
    }

    .notification-center {
        width: 100%;
    }

    .notification-bell {
        width: 100%;
        height: 50px;
    }

    .notification-panel {
        top: 72px;
        right: .5rem;
        left: .5rem;
        width: auto;
        max-height: calc(100dvh - 84px);
    }

    .notification-panel-footer {
        flex-direction: column;
    }

    .notification-panel-footer a,
    .notification-panel-footer button {
        width: 100%;
    }
}

/* Critical public fallback.
   This file is the one live pages reliably load with the header. These low-specificity
   rules keep public pages usable if the large design-system stylesheet is stale,
   missing, or cached by the browser. */
.skip-link {
    position: fixed !important;
    top: 1rem !important;
    left: 1rem !important;
    z-index: 10000 !important;
    transform: translateY(-170%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: max-content !important;
    max-width: calc(100vw - 2rem) !important;
    clip-path: inset(0 0 100% 0) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: .45rem !important;
    padding: .65rem .9rem !important;
    border-radius: 8px !important;
    background: #18181b !important;
    color: #fff !important;
    box-shadow: 0 12px 30px rgba(0,0,0,.24) !important;
    transition: transform .18s ease, opacity .18s ease !important;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    clip-path: none !important;
    outline: 3px solid rgba(220, 38, 38, .35) !important;
    outline-offset: 2px !important;
}

.site-main {
    width: 100%;
    min-height: calc(100vh - 140px);
    padding: clamp(1.25rem, 3vw, 2rem) 0 clamp(2rem, 4vw, 3rem);
}

.site-main > :where(
    .container,
    .page-container,
    .classic-forum-wrapper,
    .tools-page,
    .documents-page-container,
    .signals-page-container,
    .chat-page-modern,
    .users-page,
    .cetele-page-container,
    .messages-container,
    .profile-page,
    .profile-container,
    .law-page-container,
    .info-center-page,
    .public-page,
    .content-container
) {
    width: min(100% - 2rem, 1400px);
    margin-inline: auto;
}

.site-main :where(
    .tools-hero,
    .documents-hero,
    .signals-hero,
    .cetele-hero,
    .law-hero,
    .forum-hero,
    .profile-hero,
    .messages-hero,
    .page-hero,
    .hero-section
) {
    margin: 0 0 1.5rem;
    padding: clamp(2rem, 4vw, 3.25rem);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(24,24,27,.96) 0%, rgba(39,39,42,.94) 48%, rgba(127,29,29,.92) 100%);
    color: #fff;
    box-shadow: 0 24px 60px rgba(24, 24, 27, .16);
    overflow: hidden;
}

.site-main :where(
    .tools-hero,
    .documents-hero,
    .signals-hero,
    .cetele-hero,
    .law-hero,
    .forum-hero,
    .profile-hero,
    .messages-hero,
    .page-hero,
    .hero-section
) :where(h1, h2, p, span, a) {
    color: inherit;
}

.site-main :where(h1) {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    letter-spacing: 0;
    margin: 0 0 .75rem;
}

.site-main :where(h2) {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    line-height: 1.18;
    letter-spacing: 0;
    margin: 0 0 .65rem;
}

.site-main :where(h3) {
    font-size: 1.1rem;
    line-height: 1.25;
    letter-spacing: 0;
    margin: 0 0 .45rem;
}

.site-main :where(p) {
    line-height: 1.65;
}

.site-main :where(
    .search-panel,
    .documents-search-panel,
    .forum-search-panel,
    .filter-panel,
    .filters-wrapper,
    .content-section,
    .category-section,
    .forum-category-card,
    .document-card,
    .signal-card,
    .chat-panel,
    .messages-panel,
    .profile-card,
    .profile-section,
    .archive-panel,
    .personal-archive-panel,
    .generated-documents-panel,
    .stats-container,
    .stat-card,
    .empty-state,
    .modal-content
) {
    border: 1px solid var(--mk-border);
    border-radius: 8px;
    background: var(--mk-surface);
    box-shadow: var(--mk-shadow);
}

.site-main :where(
    .search-panel,
    .documents-search-panel,
    .forum-search-panel,
    .filter-panel,
    .filters-wrapper
) {
    padding: 1rem;
    margin: 0 0 1.25rem;
}

.site-main :where(
    .content-section,
    .category-section,
    .forum-category-card,
    .document-card,
    .signal-card,
    .chat-panel,
    .messages-panel,
    .profile-card,
    .profile-section,
    .archive-panel,
    .personal-archive-panel,
    .generated-documents-panel,
    .empty-state
) {
    padding: clamp(1rem, 2vw, 1.35rem);
    margin-bottom: 1rem;
}

.site-main :where(.stats-container, .quick-actions, .modules-grid, .category-grid, .documents-grid, .signals-grid, .profile-grid) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.site-main :where(.stat-card) {
    padding: 1rem;
}

.site-main :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    padding: .65rem .8rem;
    border: 1px solid rgba(24, 24, 27, .18);
    border-radius: 8px;
    background: #fff;
    color: var(--mk-ink);
    font: inherit;
    outline: none;
}

.site-main :where(textarea) {
    min-height: 110px;
    resize: vertical;
}

.site-main :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
    border-color: rgba(220, 38, 38, .55);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, .10);
}

.site-main :where(
    button:not(.mobile-menu-btn):not(.nav-dropdown-toggle):not(.profile-trigger),
    input[type="submit"],
    .btn,
    .button,
    .primary-action,
    .cta-button
) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 42px;
    padding: .65rem 1rem;
    border: 1px solid rgba(220, 38, 38, .25);
    border-radius: 8px;
    background: #dc2626;
    color: #fff;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(220, 38, 38, .16);
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.site-main :where(
    button:not(.mobile-menu-btn):not(.nav-dropdown-toggle):not(.profile-trigger),
    input[type="submit"],
    .btn,
    .button,
    .primary-action,
    .cta-button
):hover {
    transform: translateY(-1px);
    background: #b91c1c;
    box-shadow: 0 14px 26px rgba(220, 38, 38, .20);
}

.site-main :where(.tabs, .filter-tabs, .nav-pills, .room-tabs) {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1rem;
}

.site-main :where(.tabs a, .filter-tabs a, .nav-pills a, .room-tabs a) {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 38px;
    padding: .55rem .8rem;
    border: 1px solid var(--mk-border);
    border-radius: 8px;
    background: #fff;
    color: var(--mk-ink);
    font-weight: 700;
    text-decoration: none;
}

.site-main :where(.chat-layout, .messages-layout, .profile-layout) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1rem;
    align-items: start;
}

.site-footer {
    width: min(100% - 2rem, 1400px);
    margin: 0 auto;
    padding: 1.25rem 0 2rem;
    color: var(--mk-muted);
    font-size: .92rem;
}

.site-footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--mk-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--mk-shadow);
}

.footer-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
    color: var(--mk-ink);
    font-weight: 800;
}

.footer-section-head span:last-child,
.footer-muted,
.site-footer-copy {
    color: var(--mk-muted);
}

.footer-status-dot {
    width: .65rem;
    height: .65rem;
    border-radius: 999px;
    background: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, .12);
}

.footer-online-list {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .75rem;
}

.footer-online-user,
.footer-online-more {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: .35rem .6rem;
    border: 1px solid rgba(220, 38, 38, .16);
    border-radius: 999px;
    background: #fff5f5;
    color: var(--mk-dynamic-color, #dc2626);
    font-weight: 800;
    text-decoration: none;
}

.footer-online-more {
    color: var(--mk-muted);
    background: #f7f7f5;
    border-color: var(--mk-border);
}

.footer-links {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: .55rem;
    overflow-x: auto;
    padding-top: .85rem;
    border-top: 1px solid var(--mk-border);
    scrollbar-width: thin;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: .45rem .6rem;
    border: 1px solid var(--mk-border);
    border-radius: 8px;
    color: var(--mk-ink);
    text-decoration: none;
    font-weight: 750;
    background: #fafafa;
    white-space: nowrap;
}

.footer-links a:hover {
    border-color: rgba(220, 38, 38, .28);
    color: #991b1b;
    background: #fff;
}

.site-footer-copy {
    margin-top: .9rem;
}

.legal-static-page {
    width: min(100% - 2rem, 1000px);
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2rem) 0 3rem;
}

.legal-static-hero {
    padding: clamp(2rem, 4vw, 3rem);
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, #18181b 0%, #27272a 54%, #7f1d1d 100%);
    box-shadow: 0 24px 60px rgba(24, 24, 27, .16);
}

.legal-static-hero span {
    color: #fecaca;
    font-size: .8rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.legal-static-hero h1 {
    margin: .45rem 0 .6rem;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
}

.legal-static-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255,255,255,.78);
}

.legal-static-card {
    margin-top: 1rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid var(--mk-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--mk-shadow);
}

.legal-static-card h2 {
    margin-top: 1.5rem;
    color: var(--mk-ink);
}

.legal-static-card h2:first-child {
    margin-top: 0;
}

.legal-static-card p {
    color: #3f3f46;
}

.legal-static-card ul {
    margin: .75rem 0 1.25rem 1.1rem;
    padding: 0;
    color: #3f3f46;
    line-height: 1.7;
}

.legal-static-card li + li {
    margin-top: .35rem;
}

.legal-static-card strong {
    color: var(--mk-ink);
}

.legal-static-note,
.legal-static-grid {
    margin-top: 1rem;
}

.legal-static-note {
    padding: 1rem;
    border: 1px solid rgba(220, 38, 38, .16);
    border-radius: 8px;
    background: #fff7f7;
    color: #3f3f46;
}

.legal-static-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
}

.legal-mini-card {
    padding: 1rem;
    border: 1px solid var(--mk-border);
    border-radius: 8px;
    background: #fafafa;
}

.legal-mini-card h3 {
    margin: 0 0 .45rem;
    color: var(--mk-ink);
    font-size: 1rem;
}

.legal-mini-card p {
    margin: 0;
}

.legal-contact-link {
    display: inline-flex;
    margin: .4rem 0 1rem;
    padding: .7rem 1rem;
    border-radius: 8px;
    background: #dc2626;
    color: #fff;
    font-weight: 900;
    text-decoration: none;
}

@media (max-width: 900px) {
    .footer-links {
        justify-content: flex-start;
    }

    .legal-static-grid {
        grid-template-columns: 1fr;
    }
}

.mk-social-card {
    padding: 1rem;
    border: 1px solid var(--mk-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--mk-shadow);
}

.mk-social-head h3 {
    margin: 0;
    color: var(--mk-ink);
    font-size: 1rem;
}

.mk-social-head span {
    display: block;
    margin-top: .25rem;
    color: var(--mk-muted);
    font-size: .88rem;
}

.mk-social-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .6rem;
    margin-top: .85rem;
}

.mk-social-link {
    aspect-ratio: 1;
    min-height: 46px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    font-weight: 950;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .12);
    transition: transform .16s ease, box-shadow .16s ease;
}

.mk-social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .18);
}

.mk-social-twitter { background: #111827; }
.mk-social-telegram { background: #229ed9; }
.mk-social-facebook { background: #1877f2; }
.mk-social-instagram { background: linear-gradient(135deg, #f97316, #db2777 50%, #4f46e5); }

@media (max-width: 900px) {
    .site-main > :where(
        .container,
        .page-container,
        .classic-forum-wrapper,
        .tools-page,
        .documents-page-container,
        .signals-page-container,
        .chat-page-modern,
        .users-page,
        .cetele-page-container,
        .messages-container,
        .profile-page,
        .profile-container,
        .law-page-container,
        .info-center-page,
        .public-page,
        .content-container
    ),
    .site-footer {
        width: min(100% - 1rem, 1400px);
    }

    .site-main :where(.chat-layout, .messages-layout, .profile-layout) {
        grid-template-columns: 1fr;
    }

    .site-footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
}

@media (max-width: 640px) {
    .site-footer {
        width: min(100% - .75rem, 1400px);
        padding: .75rem 0 1.25rem;
        overflow-x: hidden;
        font-size: .84rem;
    }

    .site-footer-grid {
        gap: .85rem;
        padding: .85rem;
        border-radius: 8px;
    }

    .footer-section-head {
        align-items: flex-start;
        gap: .45rem;
    }

    .footer-section-head strong {
        flex: 1 1 100%;
        font-size: .95rem;
    }

    .footer-section-head span:last-child {
        font-size: .78rem;
    }

    .footer-online-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .45rem;
    }

    .footer-online-user,
    .footer-online-more {
        width: 100%;
        min-width: 0;
        justify-content: center;
        padding: .42rem .45rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .78rem;
    }

    .footer-links {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: .45rem;
    }

    .footer-links a {
        width: auto;
        flex: 0 0 auto;
        min-width: 0;
        justify-content: center;
        padding: .55rem .6rem;
        text-align: center;
        white-space: nowrap;
        overflow-wrap: normal;
    }

    .site-footer-copy {
        text-align: center;
        font-size: .78rem;
    }
}

/* Managed ad placements */
.mk-ad-slot {
    display: flex;
    align-items: center;
    gap: .9rem;
    width: min(1200px, calc(100% - 2rem));
    margin: .75rem auto;
    padding: .8rem 1rem;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .9));
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .08);
}

.mk-ad-slot:hover {
    color: #0f172a;
    transform: translateY(-1px);
}

.mk-ad-image {
    flex: 0 0 auto;
    width: 78px;
    height: 54px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
}

.mk-ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mk-ad-copy {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: .18rem;
}

.mk-ad-copy strong {
    font-size: .98rem;
    line-height: 1.25;
}

.mk-ad-copy small {
    color: #64748b;
    line-height: 1.35;
}

.mk-ad-badge {
    width: fit-content;
    padding: .18rem .48rem;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.mk-ad-slot em {
    flex: 0 0 auto;
    padding: .48rem .75rem;
    border-radius: 8px;
    background: #991b1b;
    color: #fff;
    font-style: normal;
    font-weight: 800;
    font-size: .82rem;
}

.ad-slot-header-top {
    margin-top: .6rem;
    margin-bottom: .45rem;
}

.site-footer .ad-slot-footer {
    width: 100%;
    margin: 0 0 1rem;
}

.notification-highlight {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.notification-highlight-image {
    width: 64px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, .18);
    flex: 0 0 auto;
}

.notification-highlight-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.notification-highlight-copy {
    display: grid;
    gap: .14rem;
    min-width: 0;
}

.mk-ad-popup[hidden] {
    display: none !important;
}

.mk-ad-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.mk-ad-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(4px);
}

.mk-ad-popup-card {
    position: relative;
    width: min(560px, 100%);
    padding: 1.1rem;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .34);
}

.mk-ad-popup-close {
    position: absolute;
    top: .7rem;
    right: .7rem;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.mk-ad-popup-card .ad-slot-popup {
    width: 100%;
    margin: 0;
    padding: 1.25rem;
    box-shadow: none;
}

.mk-ad-popup-card .mk-ad-image {
    width: 160px;
    height: 120px;
}

@media (max-width: 640px) {
    .mk-ad-slot {
        align-items: flex-start;
        gap: .7rem;
        width: calc(100% - 1rem);
        padding: .75rem;
    }

    .mk-ad-slot em {
        display: none;
    }

    .mk-ad-image {
        width: 62px;
        height: 48px;
    }

    .mk-ad-popup-card .ad-slot-popup {
        display: grid;
    }

    .mk-ad-popup-card .mk-ad-image {
        width: 100%;
        height: 160px;
    }
}

@media (max-width: 380px) {
    .footer-online-list {
        grid-template-columns: 1fr;
    }
}

/* Footer legal links final layout override */
.site-footer-grid {
    display: flex !important;
    flex-direction: column !important;
}

.footer-links {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: .55rem !important;
    overflow-x: visible !important;
}

.footer-links a {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
}

@media (max-width: 900px) {
    .footer-links {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch;
    }

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

/* Users directory hero alignment */
.users-page .users-hero {
    margin: 0 0 1.25rem !important;
    padding: clamp(1.35rem, 3vw, 2.25rem) !important;
    border: 1px solid rgba(255, 255, 255, .1) !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, rgba(17, 24, 39, .96) 0%, rgba(39, 39, 42, .98) 52%, rgba(127, 29, 29, .95) 100%) !important;
    color: #fff !important;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .12) !important;
}

.users-page .users-hero h1 {
    display: flex !important;
    align-items: center;
    gap: .65rem;
    margin: 0 0 .6rem !important;
    color: #fff !important;
    font-size: clamp(1.95rem, 3vw, 2.65rem) !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
}

.users-page .users-hero h1::before {
    content: "👥";
    flex: 0 0 auto;
    font-size: .9em;
}

.users-page .users-hero p {
    margin: 0 !important;
    color: rgba(255, 255, 255, .78) !important;
    font-size: 1rem !important;
    line-height: 1.65 !important;
}

.users-page .users-hero .member-count {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: .45rem .75rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-weight: 850;
}

/* Public core page header standard */
.site-main :where(
    .forum-topbar,
    .documents-hero,
    .tools-hero,
    .mk-hero-header,
    .city-hero,
    .compare-hero,
    .announcements-hero,
    .users-hero,
    .blog-hero,
    .cat-hero,
    .search-hero,
    .becayis-hero,
    .leaderboard-hero
) {
    width: min(100% - 2rem, 1400px) !important;
    min-height: clamp(150px, 15vw, 190px) !important;
    margin: 0 auto 1.25rem !important;
    padding: clamp(1.35rem, 3vw, 2.25rem) !important;
    border: 1px solid rgba(255, 255, 255, .1) !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, rgba(17, 24, 39, .96) 0%, rgba(39, 39, 42, .98) 52%, rgba(127, 29, 29, .95) 100%) !important;
    color: #fff !important;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .12) !important;
    overflow: hidden !important;
}

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

.site-main :where(.blog-hero-inner, .becayis-hero-inner) {
    width: min(100%, 900px) !important;
    max-width: 900px !important;
    margin: 0 !important;
    display: block !important;
}

.site-main :where(.blog-hero) {
    display: grid !important;
    align-items: center !important;
    text-align: left !important;
}

.site-main :where(.blog-hero-inner) {
    text-align: left !important;
}

.site-main :where(.blog-hero .blog-eyebrow) {
    margin: 0 0 .9rem !important;
}

.site-main :where(.blog-hero .blog-search) {
    margin: 1rem 0 0 !important;
    max-width: 560px !important;
}

.site-main :where(
    .forum-title,
    .documents-hero .hero-title,
    .tools-hero .hero-title,
    .mk-hero-title,
    .city-hero .hero-title,
    .compare-hero .hero-title,
    .announcements-hero .hero-title,
    .users-hero h1,
    .blog-hero h1,
    .cat-hero h1,
    .search-hero h1,
    .becayis-hero h1,
    .leaderboard-hero h1
) {
    max-width: 960px !important;
    margin: 0 !important;
    color: #fff !important;
    font-size: clamp(1.95rem, 3vw, 2.65rem) !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
    text-shadow: none !important;
}

.site-main :where(
    .forum-subtitle,
    .documents-hero .hero-subtitle,
    .tools-hero .hero-subtitle,
    .mk-hero-subtitle,
    .city-hero .hero-subtitle,
    .compare-hero .hero-subtitle,
    .announcements-hero .hero-subtitle,
    .users-hero p,
    .blog-hero p,
    .cat-hero p,
    .search-hero p,
    .becayis-hero p,
    .leaderboard-hero p
) {
    max-width: 820px !important;
    margin: .6rem 0 0 !important;
    color: rgba(255, 255, 255, .78) !important;
    font-size: 1rem !important;
    line-height: 1.65 !important;
}

.site-main :where(.hero-stats-grid, .hero-stats, .forum-stats-bar) {
    align-self: center;
}

@media (max-width: 900px) {
    .site-main :where(
        .forum-topbar,
        .documents-hero,
        .tools-hero,
        .mk-hero-header,
        .city-hero,
        .compare-hero,
        .announcements-hero,
        .users-hero,
        .blog-hero,
        .cat-hero,
        .search-hero,
        .becayis-hero,
        .leaderboard-hero
    ) {
        width: min(100% - 1rem, 1400px) !important;
        min-height: auto !important;
    }

    .site-main :where(
        .forum-topbar,
        .documents-hero .hero-content,
        .tools-hero .hero-content,
        .mk-hero-content,
        .city-hero .hero-content,
        .compare-hero .hero-content,
        .announcements-hero .hero-content,
        .users-hero .hero-content,
        .leaderboard-hero .hero-content
    ) {
        grid-template-columns: 1fr !important;
    }
}

/* Blog article/category hero final override.
   site-header.css loads last, so this neutralizes older blog-post max-width rules. */
.site-main :where(.post-hero, .blog-category-page > .cat-hero) {
    width: min(100% - 2rem, 1400px) !important;
    max-width: none !important;
    min-height: clamp(150px, 15vw, 190px) !important;
    margin: 0 auto 1.25rem !important;
    padding: clamp(1.35rem, 3vw, 2.25rem) !important;
    display: grid !important;
    align-items: center !important;
    text-align: left !important;
}

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

.site-main :where(.post-hero .post-byline) {
    padding-bottom: 0 !important;
    border-bottom: 0 !important;
}

.site-main :where(.post-hero .post-title) {
    color: #fff !important;
    margin: 0 0 .65rem !important;
}

.site-main :where(.post-hero .post-lede) {
    color: rgba(255, 255, 255, .82) !important;
    margin: 0 0 1rem !important;
}

.site-main :where(.post-hero .byline-author-link, .post-hero .byline-author strong) {
    color: #fff !important;
}

.site-main :where(.post-hero .byline-author small) {
    color: rgba(255, 255, 255, .72) !important;
}

@media (max-width: 900px) {
    .site-main :where(.post-hero, .blog-category-page > .cat-hero) {
        width: min(100% - 1rem, 1400px) !important;
        min-height: auto !important;
    }
}

/* Mobile hardening layer.
   site-header.css is loaded last, so these rules catch older page styles that
   still carry desktop widths, wide grids, tables, or fixed modals on phones. */
@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .site-main {
        min-width: 0;
        padding: 1rem 0 1.5rem;
        overflow-x: hidden;
    }

    .site-main > * {
        width: min(calc(100% - 1rem), 1400px) !important;
        max-width: calc(100vw - 1rem) !important;
        min-width: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .site-main *,
    .site-footer * {
        min-width: 0;
    }

    .site-main :where(img, video, canvas, svg) {
        max-width: 100%;
        height: auto;
    }

    .site-main :where(iframe, embed, object) {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 16 / 9;
    }

    .site-main :where(
        .hero-layout,
        .hero-content,
        .dashboard-grid,
        .stats-grid,
        .stat-grid,
        .cards-grid,
        .modules-grid,
        .category-grid,
        .documents-grid,
        .signals-grid,
        .profile-grid,
        .forum-grid,
        .city-grid,
        .compare-grid,
        .results-grid,
        .source-grid,
        .admin-grid,
        .main-layout,
        .page-layout,
        .content-layout,
        .sidebar-layout,
        .blog-main-layout,
        .bh-main-layout,
        .post-layout,
        .tools-layout,
        .law-layout,
        .messages-layout,
        .chat-layout,
        .profile-layout,
        .becayis-layout,
        .detay-layout,
        .profil-layout,
        .form-grid,
        .form-row,
        .filter-grid,
        .search-grid,
        .invite-stats-bar,
        .invite-info-grid,
        .profile-stats-mini
    ) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .site-main :where(
        .hero-actions,
        .page-actions,
        .form-actions,
        .mk-actions,
        .mk-form-actions,
        .mk-pagination,
        .pagination,
        .filter-form,
        .search-form,
        .forum-search-panel,
        .documents-search-panel,
        .law-search-panel,
        .city-filter,
        .compare-form,
        .profile-actions,
        .invite-create-form,
        .document-tools,
        .mk-document-tools
    ) {
        align-items: stretch !important;
        flex-wrap: wrap;
        max-width: 100%;
    }

    .site-main :where(
        .tabs,
        .filter-tabs,
        .nav-pills,
        .room-tabs,
        .category-tabs,
        .blog-category-tabs,
        .blog-category-strip,
        .bh-category-strip,
        .mk-source-tabs,
        .announcement-source-tabs
    ) {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .site-main :where(
        .tabs,
        .filter-tabs,
        .nav-pills,
        .room-tabs,
        .category-tabs,
        .blog-category-tabs,
        .blog-category-strip,
        .bh-category-strip,
        .mk-source-tabs,
        .announcement-source-tabs
    ) > * {
        flex: 0 0 auto;
    }

    .site-main :where(
        .filter-form,
        .search-form,
        .form-actions,
        .mk-form-actions,
        .hero-actions,
        .page-actions,
        .profile-actions,
        .invite-create-form,
        .document-tools,
        .mk-document-tools
    ) {
        flex-direction: column !important;
    }

    .site-main :where(
        input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
        select,
        textarea
    ) {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        font-size: 16px;
    }

    .site-main :where(input[type="file"]) {
        white-space: normal;
    }

    .site-main :where(
        button:not(.mobile-menu-btn):not(.nav-dropdown-toggle):not(.profile-trigger),
        input[type="submit"],
        .btn,
        .button,
        .primary-action,
        .cta-button,
        .hero-primary,
        .hero-secondary,
        .mk-primary-link,
        .mk-secondary-link,
        .mk-ghost-button,
        .btn-new-topic,
        .btn-upload,
        .btn-copy
    ) {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .site-main :where(
        .table-responsive,
        .table-wrap,
        .table-scroll,
        .compare-table-wrap,
        .invitations-table,
        .taxonomy-table-wrap,
        .document-table-wrap,
        .admin-table-wrap
    ) {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .site-main table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .site-main :where(th, td) {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .site-main :where(
        .modal-content,
        .delete-modal,
        .messages-modal,
        .cetele-delete-modal,
        .thank-modal,
        .notification-panel,
        .profile-dropdown
    ) {
        width: min(calc(100vw - 1rem), 560px) !important;
        max-width: calc(100vw - 1rem) !important;
        max-height: calc(100dvh - 1rem);
        overflow: auto;
    }

    .site-main :where(
        h1,
        h2,
        h3,
        p,
        a,
        span,
        strong,
        small,
        label,
        .card,
        .panel,
        .content-section,
        .profile-card,
        .blog-card,
        .document-card,
        .forum-category-card,
        .signal-card,
        .mk-official-card,
        .mk-result-card
    ) {
        overflow-wrap: anywhere;
    }

    .site-main :where(
        .badge,
        .pill,
        .tag,
        .chip,
        .status-badge,
        .type-badge,
        .quality-badge,
        .category-pill,
        .mk-source-pill,
        .meta-pill
    ) {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 420px) {
    .site-main > * {
        width: min(calc(100% - .75rem), 1400px) !important;
        max-width: calc(100vw - .75rem) !important;
    }

    .site-main :where(
        .content-section,
        .profile-card,
        .forum-category-card,
        .document-card,
        .signal-card,
        .mk-official-card,
        .mk-result-card,
        .legal-static-card
    ) {
        padding: .9rem !important;
    }
}

/* Final blog hero lock: blog.php, blog category and single post use the same box. */
.site-main > .blog-hero,
.site-main > .blog-category-page > .cat-hero,
.site-main > .post-hero {
    width: min(100% - 2rem, 1400px) !important;
    max-width: none !important;
    height: 260px !important;
    min-height: 260px !important;
    margin: 0 auto 1.25rem !important;
    padding: clamp(1.35rem, 3vw, 2.25rem) !important;
    display: grid !important;
    align-items: center !important;
    justify-items: start !important;
    text-align: left !important;
    border-radius: 8px !important;
    box-sizing: border-box !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;
    text-align: left !important;
    justify-self: start !important;
}

.site-main > .post-hero .breadcrumb {
    margin: 0 0 .85rem !important;
}

.site-main > .post-hero .post-title {
    margin: 0 0 .65rem !important;
}

.site-main > .post-hero .post-lede {
    max-width: 820px !important;
}

.site-main > .blog-category-page > .cat-hero {
    position: relative !important;
}

.site-main > .blog-category-page > .cat-hero .cat-stats {
    position: absolute !important;
    right: clamp(1.35rem, 3vw, 2.25rem) !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,.1) !important;
    color: #fff !important;
    font-weight: 850 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08) !important;
}

.site-main :where(
    .blog-post-layout .post-feature,
    .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;
}

@media (max-width: 900px) {
    .site-main > .blog-hero,
    .site-main > .blog-category-page > .cat-hero,
    .site-main > .post-hero {
        width: min(100% - 1rem, 1400px) !important;
        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;
    }
}

/* Mobile blog search: keep the input usable and the submit button compact. */
@media (max-width: 640px) {
    .site-main > .blog-hero .blog-search {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: stretch !important;
        gap: .5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 1rem !important;
    }

    .site-main > .blog-hero .blog-search input {
        width: 100% !important;
        min-width: 0 !important;
        height: 46px !important;
        padding: 0 .85rem !important;
        font-size: .95rem !important;
    }

    .site-main > .blog-hero .blog-search button {
        width: auto !important;
        min-width: 72px !important;
        max-width: none !important;
        height: 46px !important;
        padding: 0 1rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }
}
